@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.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
|
-
var
|
|
4
|
+
var React48 = require('react');
|
|
4
5
|
var classVarianceAuthority = require('class-variance-authority');
|
|
5
6
|
var clsx = require('clsx');
|
|
6
7
|
var tailwindMerge = require('tailwind-merge');
|
|
7
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var SelectPrimitive = require('@radix-ui/react-select');
|
|
9
9
|
var lucideReact = require('lucide-react');
|
|
10
|
-
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
11
10
|
var framerMotion = require('framer-motion');
|
|
11
|
+
var SelectPrimitive = require('@radix-ui/react-select');
|
|
12
|
+
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
12
13
|
var reactTable = require('@tanstack/react-table');
|
|
13
14
|
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
14
15
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
@@ -16,6 +17,12 @@ var sonner = require('sonner');
|
|
|
16
17
|
var SwitchPrimitives = require('@radix-ui/react-switch');
|
|
17
18
|
var reactHookForm = require('react-hook-form');
|
|
18
19
|
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
20
|
+
var AvatarPrimitive = require('@radix-ui/react-avatar');
|
|
21
|
+
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
22
|
+
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
23
|
+
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
|
24
|
+
var SeparatorPrimitive = require('@radix-ui/react-separator');
|
|
25
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
19
26
|
|
|
20
27
|
function _interopNamespace(e) {
|
|
21
28
|
if (e && e.__esModule) return e;
|
|
@@ -35,13 +42,18 @@ function _interopNamespace(e) {
|
|
|
35
42
|
return Object.freeze(n);
|
|
36
43
|
}
|
|
37
44
|
|
|
38
|
-
var
|
|
45
|
+
var React48__namespace = /*#__PURE__*/_interopNamespace(React48);
|
|
39
46
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
40
47
|
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
41
48
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
42
49
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
43
50
|
var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
|
|
44
51
|
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
52
|
+
var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
|
|
53
|
+
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
54
|
+
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
55
|
+
var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
|
|
56
|
+
var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
|
|
45
57
|
|
|
46
58
|
// src/components/Button/Button.tsx
|
|
47
59
|
function cn(...inputs) {
|
|
@@ -55,7 +67,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
55
67
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
56
68
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
57
69
|
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
58
|
-
secondary: "bg-
|
|
70
|
+
secondary: "bg-primary/15 text-primary hover:bg-primary/25",
|
|
59
71
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
60
72
|
link: "text-primary underline-offset-4 hover:underline"
|
|
61
73
|
},
|
|
@@ -73,7 +85,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
73
85
|
}
|
|
74
86
|
}
|
|
75
87
|
);
|
|
76
|
-
var Button =
|
|
88
|
+
var Button = React48__namespace.forwardRef(
|
|
77
89
|
({ className, variant, size, ...props }, ref) => {
|
|
78
90
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
91
|
"button",
|
|
@@ -86,6 +98,66 @@ var Button = React36__namespace.forwardRef(
|
|
|
86
98
|
}
|
|
87
99
|
);
|
|
88
100
|
Button.displayName = "Button";
|
|
101
|
+
function Card({ className, ...props }) {
|
|
102
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
className: cn(
|
|
106
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
Card.displayName = "Card";
|
|
114
|
+
function CardHeader({ className, ...props }) {
|
|
115
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
CardHeader.displayName = "CardHeader";
|
|
124
|
+
function CardTitle({ className, ...props }) {
|
|
125
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
126
|
+
"h3",
|
|
127
|
+
{
|
|
128
|
+
className: cn(
|
|
129
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
130
|
+
className
|
|
131
|
+
),
|
|
132
|
+
...props
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
CardTitle.displayName = "CardTitle";
|
|
137
|
+
function CardDescription({ className, ...props }) {
|
|
138
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
139
|
+
"p",
|
|
140
|
+
{
|
|
141
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
142
|
+
...props
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
CardDescription.displayName = "CardDescription";
|
|
147
|
+
function CardContent({ className, ...props }) {
|
|
148
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("p-6 pt-0", className), ...props });
|
|
149
|
+
}
|
|
150
|
+
CardContent.displayName = "CardContent";
|
|
151
|
+
function CardFooter({ className, ...props }) {
|
|
152
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
156
|
+
...props
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
CardFooter.displayName = "CardFooter";
|
|
89
161
|
var inputVariants = classVarianceAuthority.cva(
|
|
90
162
|
"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",
|
|
91
163
|
{
|
|
@@ -106,7 +178,7 @@ var inputVariants = classVarianceAuthority.cva(
|
|
|
106
178
|
}
|
|
107
179
|
}
|
|
108
180
|
);
|
|
109
|
-
var Input =
|
|
181
|
+
var Input = React48__namespace.forwardRef(
|
|
110
182
|
({
|
|
111
183
|
className,
|
|
112
184
|
variant,
|
|
@@ -120,13 +192,13 @@ var Input = React36__namespace.forwardRef(
|
|
|
120
192
|
labelClassName,
|
|
121
193
|
...props
|
|
122
194
|
}, ref) => {
|
|
123
|
-
const inputRef =
|
|
124
|
-
const [showPassword, setShowPassword] =
|
|
125
|
-
|
|
126
|
-
const focusInput =
|
|
195
|
+
const inputRef = React48__namespace.useRef(null);
|
|
196
|
+
const [showPassword, setShowPassword] = React48__namespace.useState(false);
|
|
197
|
+
React48__namespace.useImperativeHandle(ref, () => inputRef.current, []);
|
|
198
|
+
const focusInput = React48__namespace.useCallback(() => {
|
|
127
199
|
inputRef.current?.focus();
|
|
128
200
|
}, []);
|
|
129
|
-
const togglePasswordVisibility =
|
|
201
|
+
const togglePasswordVisibility = React48__namespace.useCallback(() => {
|
|
130
202
|
setShowPassword((prev) => !prev);
|
|
131
203
|
}, []);
|
|
132
204
|
const inputType = type === "password" ? showPassword ? "text" : "password" : type;
|
|
@@ -235,13 +307,13 @@ var badgeVariants = classVarianceAuthority.cva(
|
|
|
235
307
|
{
|
|
236
308
|
variants: {
|
|
237
309
|
variant: {
|
|
238
|
-
default: "border-transparent bg-primary text-primary
|
|
310
|
+
default: "border-transparent bg-primary/15 text-primary hover:bg-primary/25",
|
|
239
311
|
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
240
|
-
success: "border-transparent bg-green-500 text-
|
|
241
|
-
warning: "border-transparent bg-yellow-500 text-
|
|
242
|
-
error: "border-transparent bg-red-500 text-
|
|
243
|
-
info: "border-transparent bg-blue-500 text-
|
|
244
|
-
outline: "border-
|
|
312
|
+
success: "border-transparent bg-green-500/15 text-green-600 dark:text-green-400 hover:bg-green-500/25",
|
|
313
|
+
warning: "border-transparent bg-yellow-500/15 text-yellow-600 dark:text-yellow-400 hover:bg-yellow-500/25",
|
|
314
|
+
error: "border-transparent bg-red-500/15 text-red-600 dark:text-red-400 hover:bg-red-500/25",
|
|
315
|
+
info: "border-transparent bg-blue-500/15 text-blue-600 dark:text-blue-400 hover:bg-blue-500/25",
|
|
316
|
+
outline: "border-border text-foreground hover:bg-muted"
|
|
245
317
|
},
|
|
246
318
|
size: {
|
|
247
319
|
default: "px-2.5 py-0.5 text-xs",
|
|
@@ -259,6 +331,239 @@ function Badge({ className, variant, size, ...props }) {
|
|
|
259
331
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant, size }), className), ...props });
|
|
260
332
|
}
|
|
261
333
|
Badge.displayName = "Badge";
|
|
334
|
+
var colorClasses = {
|
|
335
|
+
"chart-1": "text-chart-1",
|
|
336
|
+
"chart-2": "text-chart-2",
|
|
337
|
+
"chart-3": "text-chart-3",
|
|
338
|
+
"chart-4": "text-chart-4",
|
|
339
|
+
"chart-5": "text-chart-5"
|
|
340
|
+
};
|
|
341
|
+
function generateSmoothPath(points) {
|
|
342
|
+
if (points.length < 2) return "";
|
|
343
|
+
if (points.length === 2) {
|
|
344
|
+
return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;
|
|
345
|
+
}
|
|
346
|
+
let path = `M ${points[0].x.toFixed(2)} ${points[0].y.toFixed(2)}`;
|
|
347
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
348
|
+
const p0 = points[Math.max(0, i - 1)];
|
|
349
|
+
const p1 = points[i];
|
|
350
|
+
const p2 = points[i + 1];
|
|
351
|
+
const p3 = points[Math.min(points.length - 1, i + 2)];
|
|
352
|
+
const tension = 0.3;
|
|
353
|
+
const cp1x = p1.x + (p2.x - p0.x) * tension;
|
|
354
|
+
const cp1y = p1.y + (p2.y - p0.y) * tension;
|
|
355
|
+
const cp2x = p2.x - (p3.x - p1.x) * tension;
|
|
356
|
+
const cp2y = p2.y - (p3.y - p1.y) * tension;
|
|
357
|
+
path += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${p2.x.toFixed(2)} ${p2.y.toFixed(2)}`;
|
|
358
|
+
}
|
|
359
|
+
return path;
|
|
360
|
+
}
|
|
361
|
+
function Sparkline({
|
|
362
|
+
data,
|
|
363
|
+
color = "chart-1",
|
|
364
|
+
animate = true,
|
|
365
|
+
className,
|
|
366
|
+
show = true
|
|
367
|
+
}) {
|
|
368
|
+
const gradientId = React48__namespace.useId();
|
|
369
|
+
const { linePath, areaPath } = React48__namespace.useMemo(() => {
|
|
370
|
+
if (data.length < 2) {
|
|
371
|
+
return { linePath: "", areaPath: "" };
|
|
372
|
+
}
|
|
373
|
+
const max = Math.max(...data);
|
|
374
|
+
const min = Math.min(...data);
|
|
375
|
+
const range = max - min || 1;
|
|
376
|
+
const points = data.map((value, index) => ({
|
|
377
|
+
x: index / (data.length - 1) * 100,
|
|
378
|
+
y: 100 - (value - min) / range * 70 - 15
|
|
379
|
+
// 15% padding top, 15% bottom
|
|
380
|
+
}));
|
|
381
|
+
const line = generateSmoothPath(points);
|
|
382
|
+
const area = `${line} L 100 100 L 0 100 Z`;
|
|
383
|
+
return { linePath: line, areaPath: area };
|
|
384
|
+
}, [data]);
|
|
385
|
+
if (!show || data.length < 2) {
|
|
386
|
+
return null;
|
|
387
|
+
}
|
|
388
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
389
|
+
"svg",
|
|
390
|
+
{
|
|
391
|
+
viewBox: "0 0 100 100",
|
|
392
|
+
preserveAspectRatio: "none",
|
|
393
|
+
className: cn("w-full h-16", colorClasses[color], className),
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
396
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: "currentColor", stopOpacity: "0.3" }),
|
|
397
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: "currentColor", stopOpacity: "0" })
|
|
398
|
+
] }) }),
|
|
399
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
400
|
+
framerMotion.motion.path,
|
|
401
|
+
{
|
|
402
|
+
d: areaPath,
|
|
403
|
+
fill: `url(#${gradientId})`,
|
|
404
|
+
initial: animate ? { opacity: 0 } : void 0,
|
|
405
|
+
animate: { opacity: 1 },
|
|
406
|
+
transition: { duration: 0.5, delay: 0.3 }
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
410
|
+
framerMotion.motion.path,
|
|
411
|
+
{
|
|
412
|
+
d: linePath,
|
|
413
|
+
fill: "none",
|
|
414
|
+
stroke: "currentColor",
|
|
415
|
+
strokeWidth: "2",
|
|
416
|
+
strokeLinecap: "round",
|
|
417
|
+
strokeLinejoin: "round",
|
|
418
|
+
vectorEffect: "non-scaling-stroke",
|
|
419
|
+
initial: animate ? { pathLength: 0 } : void 0,
|
|
420
|
+
animate: { pathLength: 1 },
|
|
421
|
+
transition: { duration: 0.8, ease: "easeOut" }
|
|
422
|
+
}
|
|
423
|
+
)
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
Sparkline.displayName = "BigNumberCard.Sparkline";
|
|
429
|
+
var rootVariants = classVarianceAuthority.cva(
|
|
430
|
+
"relative overflow-hidden rounded-xl border border-border bg-card shadow-sm min-h-[140px]",
|
|
431
|
+
{
|
|
432
|
+
variants: {
|
|
433
|
+
size: {
|
|
434
|
+
default: "p-5 pb-14",
|
|
435
|
+
sm: "p-4 pb-12",
|
|
436
|
+
lg: "p-6 pb-16"
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
defaultVariants: {
|
|
440
|
+
size: "default"
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
function BigNumberCardRoot({ children, className, size }) {
|
|
445
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(rootVariants({ size }), className), children });
|
|
446
|
+
}
|
|
447
|
+
BigNumberCardRoot.displayName = "BigNumberCard.Root";
|
|
448
|
+
function BigNumberCardHeader({ children, className }) {
|
|
449
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center justify-between", className), children });
|
|
450
|
+
}
|
|
451
|
+
BigNumberCardHeader.displayName = "BigNumberCard.Header";
|
|
452
|
+
function BigNumberCardTitle({ children, className }) {
|
|
453
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-sm font-medium text-muted-foreground", className), children });
|
|
454
|
+
}
|
|
455
|
+
BigNumberCardTitle.displayName = "BigNumberCard.Title";
|
|
456
|
+
function BigNumberCardLink({ children, href, onClick, className }) {
|
|
457
|
+
const handleClick = (e) => {
|
|
458
|
+
if (onClick) {
|
|
459
|
+
e.preventDefault();
|
|
460
|
+
onClick();
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
464
|
+
"a",
|
|
465
|
+
{
|
|
466
|
+
href: href ?? "#",
|
|
467
|
+
onClick: handleClick,
|
|
468
|
+
className: cn(
|
|
469
|
+
"text-xs font-medium text-primary hover:text-primary/80 hover:underline transition-colors",
|
|
470
|
+
className
|
|
471
|
+
),
|
|
472
|
+
children
|
|
473
|
+
}
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
BigNumberCardLink.displayName = "BigNumberCard.Link";
|
|
477
|
+
function BigNumberCardContent({ children, className }) {
|
|
478
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mt-3 space-y-1", className), children });
|
|
479
|
+
}
|
|
480
|
+
BigNumberCardContent.displayName = "BigNumberCard.Content";
|
|
481
|
+
function BigNumberCardValue({ children, prefix, suffix, className }) {
|
|
482
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mt-3 text-3xl font-bold tracking-tight text-foreground", className), children: [
|
|
483
|
+
prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-2xl", children: prefix }),
|
|
484
|
+
children,
|
|
485
|
+
suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-2xl ml-0.5", children: suffix })
|
|
486
|
+
] });
|
|
487
|
+
}
|
|
488
|
+
BigNumberCardValue.displayName = "BigNumberCard.Value";
|
|
489
|
+
function BigNumberCardTrend({ value, direction, children, className, show = true }) {
|
|
490
|
+
if (!show) {
|
|
491
|
+
return null;
|
|
492
|
+
}
|
|
493
|
+
const isUp = direction === "up";
|
|
494
|
+
const Icon2 = isUp ? lucideReact.TrendingUp : lucideReact.TrendingDown;
|
|
495
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
496
|
+
"div",
|
|
497
|
+
{
|
|
498
|
+
className: cn(
|
|
499
|
+
"mt-2 flex items-center gap-1.5 text-sm",
|
|
500
|
+
isUp ? "text-emerald-600 dark:text-emerald-400" : "text-red-600 dark:text-red-400",
|
|
501
|
+
className
|
|
502
|
+
),
|
|
503
|
+
children: [
|
|
504
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4 flex-shrink-0" }),
|
|
505
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-semibold", children: [
|
|
506
|
+
isUp ? "+" : "",
|
|
507
|
+
value.toFixed(1),
|
|
508
|
+
"%"
|
|
509
|
+
] }),
|
|
510
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground font-normal", children })
|
|
511
|
+
]
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
BigNumberCardTrend.displayName = "BigNumberCard.Trend";
|
|
516
|
+
function BigNumberCardDescription({ children, className, show = true }) {
|
|
517
|
+
if (!show) {
|
|
518
|
+
return null;
|
|
519
|
+
}
|
|
520
|
+
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("mt-1 text-xs text-muted-foreground", className), children });
|
|
521
|
+
}
|
|
522
|
+
BigNumberCardDescription.displayName = "BigNumberCard.Description";
|
|
523
|
+
function BigNumberCardSparklineWrapper(props) {
|
|
524
|
+
const { show = true, ...rest } = props;
|
|
525
|
+
if (!show) {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-0 left-0 right-0 h-16 opacity-80", children: /* @__PURE__ */ jsxRuntime.jsx(Sparkline, { ...rest, show }) });
|
|
529
|
+
}
|
|
530
|
+
BigNumberCardSparklineWrapper.displayName = "BigNumberCard.Sparkline";
|
|
531
|
+
var BigNumberCard = {
|
|
532
|
+
Root: BigNumberCardRoot,
|
|
533
|
+
Header: BigNumberCardHeader,
|
|
534
|
+
Title: BigNumberCardTitle,
|
|
535
|
+
Link: BigNumberCardLink,
|
|
536
|
+
Content: BigNumberCardContent,
|
|
537
|
+
Value: BigNumberCardValue,
|
|
538
|
+
Trend: BigNumberCardTrend,
|
|
539
|
+
Description: BigNumberCardDescription,
|
|
540
|
+
Sparkline: BigNumberCardSparklineWrapper
|
|
541
|
+
};
|
|
542
|
+
function Skeleton({
|
|
543
|
+
className,
|
|
544
|
+
variant = "default",
|
|
545
|
+
animation = "pulse",
|
|
546
|
+
...props
|
|
547
|
+
}) {
|
|
548
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
549
|
+
"div",
|
|
550
|
+
{
|
|
551
|
+
className: cn(
|
|
552
|
+
"bg-muted",
|
|
553
|
+
{
|
|
554
|
+
"rounded-md": variant === "default",
|
|
555
|
+
"rounded-full": variant === "circular",
|
|
556
|
+
"rounded h-4": variant === "text",
|
|
557
|
+
"animate-pulse": animation === "pulse",
|
|
558
|
+
"animate-shimmer": animation === "wave"
|
|
559
|
+
},
|
|
560
|
+
className
|
|
561
|
+
),
|
|
562
|
+
...props
|
|
563
|
+
}
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
Skeleton.displayName = "Skeleton";
|
|
262
567
|
var selectVariants = classVarianceAuthority.cva(
|
|
263
568
|
"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",
|
|
264
569
|
{
|
|
@@ -279,7 +584,7 @@ var selectVariants = classVarianceAuthority.cva(
|
|
|
279
584
|
}
|
|
280
585
|
}
|
|
281
586
|
);
|
|
282
|
-
var Select =
|
|
587
|
+
var Select = React48__namespace.forwardRef(
|
|
283
588
|
({
|
|
284
589
|
className,
|
|
285
590
|
variant,
|
|
@@ -348,7 +653,7 @@ var Select = React36__namespace.forwardRef(
|
|
|
348
653
|
}
|
|
349
654
|
);
|
|
350
655
|
Select.displayName = "Select";
|
|
351
|
-
var SelectItem =
|
|
656
|
+
var SelectItem = React48__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
352
657
|
SelectPrimitive__namespace.Item,
|
|
353
658
|
{
|
|
354
659
|
ref,
|
|
@@ -367,7 +672,7 @@ var SelectItem = React36__namespace.forwardRef(({ className, children, ...props
|
|
|
367
672
|
));
|
|
368
673
|
SelectItem.displayName = "SelectItem";
|
|
369
674
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
370
|
-
var SelectLabel =
|
|
675
|
+
var SelectLabel = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
371
676
|
SelectPrimitive__namespace.Label,
|
|
372
677
|
{
|
|
373
678
|
ref,
|
|
@@ -376,7 +681,7 @@ var SelectLabel = React36__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
376
681
|
}
|
|
377
682
|
));
|
|
378
683
|
SelectLabel.displayName = "SelectLabel";
|
|
379
|
-
var SelectSeparator =
|
|
684
|
+
var SelectSeparator = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
380
685
|
SelectPrimitive__namespace.Separator,
|
|
381
686
|
{
|
|
382
687
|
ref,
|
|
@@ -386,7 +691,7 @@ var SelectSeparator = React36__namespace.forwardRef(({ className, ...props }, re
|
|
|
386
691
|
));
|
|
387
692
|
SelectSeparator.displayName = "SelectSeparator";
|
|
388
693
|
var Tabs = TabsPrimitive__namespace.Root;
|
|
389
|
-
var TabsList =
|
|
694
|
+
var TabsList = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
390
695
|
TabsPrimitive__namespace.List,
|
|
391
696
|
{
|
|
392
697
|
ref,
|
|
@@ -398,7 +703,7 @@ var TabsList = React36__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
398
703
|
}
|
|
399
704
|
));
|
|
400
705
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
401
|
-
var TabsTrigger =
|
|
706
|
+
var TabsTrigger = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
402
707
|
TabsPrimitive__namespace.Trigger,
|
|
403
708
|
{
|
|
404
709
|
ref,
|
|
@@ -410,7 +715,7 @@ var TabsTrigger = React36__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
410
715
|
}
|
|
411
716
|
));
|
|
412
717
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
413
|
-
var TabsContent =
|
|
718
|
+
var TabsContent = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
414
719
|
TabsPrimitive__namespace.Content,
|
|
415
720
|
{
|
|
416
721
|
ref,
|
|
@@ -519,7 +824,7 @@ function BarsLoader() {
|
|
|
519
824
|
i
|
|
520
825
|
)) });
|
|
521
826
|
}
|
|
522
|
-
var Loader =
|
|
827
|
+
var Loader = React48__namespace.forwardRef(
|
|
523
828
|
({
|
|
524
829
|
variant = "default",
|
|
525
830
|
message,
|
|
@@ -569,21 +874,21 @@ var Loader = React36__namespace.forwardRef(
|
|
|
569
874
|
}
|
|
570
875
|
);
|
|
571
876
|
Loader.displayName = "Loader";
|
|
572
|
-
var LoaderContext =
|
|
877
|
+
var LoaderContext = React48__namespace.createContext(
|
|
573
878
|
void 0
|
|
574
879
|
);
|
|
575
880
|
function LoaderProvider({ children }) {
|
|
576
|
-
const [isLoading, setIsLoading] =
|
|
577
|
-
const [loaderOptions, setLoaderOptions] =
|
|
578
|
-
const show =
|
|
881
|
+
const [isLoading, setIsLoading] = React48__namespace.useState(false);
|
|
882
|
+
const [loaderOptions, setLoaderOptions] = React48__namespace.useState({});
|
|
883
|
+
const show = React48__namespace.useCallback((options = {}) => {
|
|
579
884
|
setLoaderOptions(options);
|
|
580
885
|
setIsLoading(true);
|
|
581
886
|
}, []);
|
|
582
|
-
const hide =
|
|
887
|
+
const hide = React48__namespace.useCallback(() => {
|
|
583
888
|
setIsLoading(false);
|
|
584
889
|
setTimeout(() => setLoaderOptions({}), 300);
|
|
585
890
|
}, []);
|
|
586
|
-
const value =
|
|
891
|
+
const value = React48__namespace.useMemo(
|
|
587
892
|
() => ({ show, hide, isLoading }),
|
|
588
893
|
[show, hide, isLoading]
|
|
589
894
|
);
|
|
@@ -602,7 +907,7 @@ function LoaderProvider({ children }) {
|
|
|
602
907
|
] });
|
|
603
908
|
}
|
|
604
909
|
function useLoader() {
|
|
605
|
-
const context =
|
|
910
|
+
const context = React48__namespace.useContext(LoaderContext);
|
|
606
911
|
if (context === void 0) {
|
|
607
912
|
throw new Error("useLoader must be used within a LoaderProvider");
|
|
608
913
|
}
|
|
@@ -634,7 +939,7 @@ var loader = {
|
|
|
634
939
|
};
|
|
635
940
|
function GlobalLoaderController() {
|
|
636
941
|
const loaderController = useLoader();
|
|
637
|
-
|
|
942
|
+
React48__namespace.useEffect(() => {
|
|
638
943
|
setGlobalLoader(loaderController);
|
|
639
944
|
return () => {
|
|
640
945
|
setGlobalLoader(null);
|
|
@@ -720,7 +1025,7 @@ var iconAnimation = {
|
|
|
720
1025
|
whileHover: { scale: 1.1 },
|
|
721
1026
|
whileTap: { scale: 0.9 }
|
|
722
1027
|
};
|
|
723
|
-
var EmptyStateContent =
|
|
1028
|
+
var EmptyStateContent = React48__namespace.memo(
|
|
724
1029
|
({
|
|
725
1030
|
message = "Nenhum item encontrado",
|
|
726
1031
|
description,
|
|
@@ -732,7 +1037,7 @@ var EmptyStateContent = React36__namespace.memo(
|
|
|
732
1037
|
layout = "vertical",
|
|
733
1038
|
className
|
|
734
1039
|
}) => {
|
|
735
|
-
const handleAction =
|
|
1040
|
+
const handleAction = React48__namespace.useCallback(() => {
|
|
736
1041
|
if (onAction) {
|
|
737
1042
|
onAction();
|
|
738
1043
|
}
|
|
@@ -762,7 +1067,7 @@ var EmptyStateContent = React36__namespace.memo(
|
|
|
762
1067
|
}
|
|
763
1068
|
);
|
|
764
1069
|
EmptyStateContent.displayName = "EmptyStateContent";
|
|
765
|
-
var AnimatedEmptyState =
|
|
1070
|
+
var AnimatedEmptyState = React48__namespace.memo((props) => {
|
|
766
1071
|
const {
|
|
767
1072
|
message = "Nenhum item encontrado",
|
|
768
1073
|
description,
|
|
@@ -774,7 +1079,7 @@ var AnimatedEmptyState = React36__namespace.memo((props) => {
|
|
|
774
1079
|
layout = "vertical",
|
|
775
1080
|
className
|
|
776
1081
|
} = props;
|
|
777
|
-
const handleAction =
|
|
1082
|
+
const handleAction = React48__namespace.useCallback(() => {
|
|
778
1083
|
if (onAction) {
|
|
779
1084
|
onAction();
|
|
780
1085
|
}
|
|
@@ -817,7 +1122,7 @@ var AnimatedEmptyState = React36__namespace.memo((props) => {
|
|
|
817
1122
|
);
|
|
818
1123
|
});
|
|
819
1124
|
AnimatedEmptyState.displayName = "AnimatedEmptyState";
|
|
820
|
-
var EmptyState =
|
|
1125
|
+
var EmptyState = React48__namespace.memo(
|
|
821
1126
|
({ animated = true, ...props }) => {
|
|
822
1127
|
if (!animated) {
|
|
823
1128
|
return /* @__PURE__ */ jsxRuntime.jsx(EmptyStateContent, { ...props });
|
|
@@ -831,13 +1136,13 @@ function useDataTableInternal({
|
|
|
831
1136
|
columns,
|
|
832
1137
|
getRowId
|
|
833
1138
|
}) {
|
|
834
|
-
const [rowSelection, setRowSelection] =
|
|
835
|
-
const [columnVisibility, setColumnVisibility] =
|
|
836
|
-
const [columnFilters, setColumnFilters] =
|
|
837
|
-
const [sorting, setSorting] =
|
|
838
|
-
const [globalFilter, setGlobalFilter] =
|
|
839
|
-
const [density, setDensity] =
|
|
840
|
-
const [pagination, setPagination] =
|
|
1139
|
+
const [rowSelection, setRowSelection] = React48__namespace.useState({});
|
|
1140
|
+
const [columnVisibility, setColumnVisibility] = React48__namespace.useState({});
|
|
1141
|
+
const [columnFilters, setColumnFilters] = React48__namespace.useState([]);
|
|
1142
|
+
const [sorting, setSorting] = React48__namespace.useState([]);
|
|
1143
|
+
const [globalFilter, setGlobalFilter] = React48__namespace.useState("");
|
|
1144
|
+
const [density, setDensity] = React48__namespace.useState("default");
|
|
1145
|
+
const [pagination, setPagination] = React48__namespace.useState({
|
|
841
1146
|
pageIndex: 0,
|
|
842
1147
|
pageSize: 10
|
|
843
1148
|
});
|
|
@@ -871,7 +1176,7 @@ function useDataTableInternal({
|
|
|
871
1176
|
getPaginationRowModel: reactTable.getPaginationRowModel(),
|
|
872
1177
|
getSortedRowModel: reactTable.getSortedRowModel()
|
|
873
1178
|
});
|
|
874
|
-
const meta =
|
|
1179
|
+
const meta = React48__namespace.useMemo(
|
|
875
1180
|
() => ({
|
|
876
1181
|
isLoading: false,
|
|
877
1182
|
// Loading é controlado externamente via DataTable.Loading
|
|
@@ -889,11 +1194,11 @@ function useDataTableInternal({
|
|
|
889
1194
|
setDensity
|
|
890
1195
|
};
|
|
891
1196
|
}
|
|
892
|
-
var DataTableInstanceContext =
|
|
1197
|
+
var DataTableInstanceContext = React48__namespace.createContext(null);
|
|
893
1198
|
DataTableInstanceContext.displayName = "DataTableInstanceContext";
|
|
894
|
-
var DataTableMetaContext =
|
|
1199
|
+
var DataTableMetaContext = React48__namespace.createContext(null);
|
|
895
1200
|
DataTableMetaContext.displayName = "DataTableMetaContext";
|
|
896
|
-
var DataTableDensityContext =
|
|
1201
|
+
var DataTableDensityContext = React48__namespace.createContext(null);
|
|
897
1202
|
DataTableDensityContext.displayName = "DataTableDensityContext";
|
|
898
1203
|
function DataTableProvider({
|
|
899
1204
|
children,
|
|
@@ -902,11 +1207,11 @@ function DataTableProvider({
|
|
|
902
1207
|
density,
|
|
903
1208
|
setDensity
|
|
904
1209
|
}) {
|
|
905
|
-
const metaValue =
|
|
1210
|
+
const metaValue = React48__namespace.useMemo(
|
|
906
1211
|
() => meta,
|
|
907
1212
|
[meta.isLoading, meta.isEmpty, meta.selectedRowCount, meta.totalRows, meta.density]
|
|
908
1213
|
);
|
|
909
|
-
const densityValue =
|
|
1214
|
+
const densityValue = React48__namespace.useMemo(
|
|
910
1215
|
() => ({ density, setDensity }),
|
|
911
1216
|
[density, setDensity]
|
|
912
1217
|
);
|
|
@@ -914,7 +1219,7 @@ function DataTableProvider({
|
|
|
914
1219
|
return /* @__PURE__ */ jsxRuntime.jsx(DataTableInstanceContext.Provider, { value: tableValue, children: /* @__PURE__ */ jsxRuntime.jsx(DataTableMetaContext.Provider, { value: metaValue, children: /* @__PURE__ */ jsxRuntime.jsx(DataTableDensityContext.Provider, { value: densityValue, children }) }) });
|
|
915
1220
|
}
|
|
916
1221
|
function useDataTable() {
|
|
917
|
-
const context =
|
|
1222
|
+
const context = React48__namespace.useContext(DataTableInstanceContext);
|
|
918
1223
|
if (!context) {
|
|
919
1224
|
throw new Error(
|
|
920
1225
|
"useDataTable must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -923,7 +1228,7 @@ function useDataTable() {
|
|
|
923
1228
|
return context;
|
|
924
1229
|
}
|
|
925
1230
|
function useDataTableMeta() {
|
|
926
|
-
const context =
|
|
1231
|
+
const context = React48__namespace.useContext(DataTableMetaContext);
|
|
927
1232
|
if (!context) {
|
|
928
1233
|
throw new Error(
|
|
929
1234
|
"useDataTableMeta must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -941,12 +1246,12 @@ function useDataTableEmpty() {
|
|
|
941
1246
|
}
|
|
942
1247
|
function useDataTableSelection() {
|
|
943
1248
|
const table = useDataTable();
|
|
944
|
-
return
|
|
1249
|
+
return React48__namespace.useMemo(() => {
|
|
945
1250
|
return table.getSelectedRowModel().rows.map((row) => row.original);
|
|
946
1251
|
}, [table.getSelectedRowModel().rows]);
|
|
947
1252
|
}
|
|
948
1253
|
function useDataTableDensity() {
|
|
949
|
-
const context =
|
|
1254
|
+
const context = React48__namespace.useContext(DataTableDensityContext);
|
|
950
1255
|
if (!context) {
|
|
951
1256
|
throw new Error(
|
|
952
1257
|
"useDataTableDensity must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -957,7 +1262,7 @@ function useDataTableDensity() {
|
|
|
957
1262
|
function useDataTablePagination() {
|
|
958
1263
|
const table = useDataTable();
|
|
959
1264
|
const { pageIndex, pageSize } = table.getState().pagination;
|
|
960
|
-
return
|
|
1265
|
+
return React48__namespace.useMemo(() => {
|
|
961
1266
|
const pageCount = table.getPageCount();
|
|
962
1267
|
return {
|
|
963
1268
|
pageIndex,
|
|
@@ -977,7 +1282,7 @@ function useDataTablePagination() {
|
|
|
977
1282
|
function useDataTableSorting() {
|
|
978
1283
|
const table = useDataTable();
|
|
979
1284
|
const sorting = table.getState().sorting;
|
|
980
|
-
return
|
|
1285
|
+
return React48__namespace.useMemo(() => ({
|
|
981
1286
|
sorting,
|
|
982
1287
|
setSorting: table.setSorting,
|
|
983
1288
|
clearSorting: () => table.resetSorting(),
|
|
@@ -990,7 +1295,7 @@ function useDataTableSorting() {
|
|
|
990
1295
|
function useDataTableColumnVisibility() {
|
|
991
1296
|
const table = useDataTable();
|
|
992
1297
|
const columnVisibility = table.getState().columnVisibility;
|
|
993
|
-
return
|
|
1298
|
+
return React48__namespace.useMemo(() => ({
|
|
994
1299
|
columnVisibility,
|
|
995
1300
|
setColumnVisibility: table.setColumnVisibility,
|
|
996
1301
|
toggleColumn: (columnId) => {
|
|
@@ -1052,7 +1357,7 @@ var DENSITY_CONFIG = {
|
|
|
1052
1357
|
padding: "py-3 px-4"
|
|
1053
1358
|
}
|
|
1054
1359
|
};
|
|
1055
|
-
var Table =
|
|
1360
|
+
var Table = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1056
1361
|
"table",
|
|
1057
1362
|
{
|
|
1058
1363
|
ref,
|
|
@@ -1061,9 +1366,9 @@ var Table = React36__namespace.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1061
1366
|
}
|
|
1062
1367
|
) }));
|
|
1063
1368
|
Table.displayName = "Table";
|
|
1064
|
-
var TableHeader =
|
|
1369
|
+
var TableHeader = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1065
1370
|
TableHeader.displayName = "TableHeader";
|
|
1066
|
-
var TableBody =
|
|
1371
|
+
var TableBody = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1067
1372
|
"tbody",
|
|
1068
1373
|
{
|
|
1069
1374
|
ref,
|
|
@@ -1072,7 +1377,7 @@ var TableBody = React36__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1072
1377
|
}
|
|
1073
1378
|
));
|
|
1074
1379
|
TableBody.displayName = "TableBody";
|
|
1075
|
-
var TableFooter =
|
|
1380
|
+
var TableFooter = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1076
1381
|
"tfoot",
|
|
1077
1382
|
{
|
|
1078
1383
|
ref,
|
|
@@ -1084,8 +1389,8 @@ var TableFooter = React36__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
1084
1389
|
}
|
|
1085
1390
|
));
|
|
1086
1391
|
TableFooter.displayName = "TableFooter";
|
|
1087
|
-
var TableRow =
|
|
1088
|
-
|
|
1392
|
+
var TableRow = React48__namespace.memo(
|
|
1393
|
+
React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1089
1394
|
"tr",
|
|
1090
1395
|
{
|
|
1091
1396
|
ref,
|
|
@@ -1098,7 +1403,7 @@ var TableRow = React36__namespace.memo(
|
|
|
1098
1403
|
))
|
|
1099
1404
|
);
|
|
1100
1405
|
TableRow.displayName = "TableRow";
|
|
1101
|
-
var TableHead =
|
|
1406
|
+
var TableHead = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1102
1407
|
"th",
|
|
1103
1408
|
{
|
|
1104
1409
|
ref,
|
|
@@ -1110,8 +1415,8 @@ var TableHead = React36__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1110
1415
|
}
|
|
1111
1416
|
));
|
|
1112
1417
|
TableHead.displayName = "TableHead";
|
|
1113
|
-
var TableCell =
|
|
1114
|
-
|
|
1418
|
+
var TableCell = React48__namespace.memo(
|
|
1419
|
+
React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1115
1420
|
"td",
|
|
1116
1421
|
{
|
|
1117
1422
|
ref,
|
|
@@ -1121,7 +1426,7 @@ var TableCell = React36__namespace.memo(
|
|
|
1121
1426
|
))
|
|
1122
1427
|
);
|
|
1123
1428
|
TableCell.displayName = "TableCell";
|
|
1124
|
-
var TableCaption =
|
|
1429
|
+
var TableCaption = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1125
1430
|
"caption",
|
|
1126
1431
|
{
|
|
1127
1432
|
ref,
|
|
@@ -1130,7 +1435,7 @@ var TableCaption = React36__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
1130
1435
|
}
|
|
1131
1436
|
));
|
|
1132
1437
|
TableCaption.displayName = "TableCaption";
|
|
1133
|
-
var DataTableContent =
|
|
1438
|
+
var DataTableContent = React48__namespace.memo(function DataTableContent2({
|
|
1134
1439
|
stickyHeader = false,
|
|
1135
1440
|
stripedRows = false,
|
|
1136
1441
|
highlightOnHover = true,
|
|
@@ -1176,15 +1481,15 @@ var DataTableContent = React36__namespace.memo(function DataTableContent2({
|
|
|
1176
1481
|
] }) });
|
|
1177
1482
|
});
|
|
1178
1483
|
DataTableContent.displayName = "DataTable.Content";
|
|
1179
|
-
var DataTableToolbar =
|
|
1484
|
+
var DataTableToolbar = React48__namespace.memo(function DataTableToolbar2({
|
|
1180
1485
|
className,
|
|
1181
1486
|
children
|
|
1182
1487
|
}) {
|
|
1183
1488
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center justify-between gap-2", className), children });
|
|
1184
1489
|
});
|
|
1185
1490
|
function useDebounce(value, delay = 300) {
|
|
1186
|
-
const [debouncedValue, setDebouncedValue] =
|
|
1187
|
-
|
|
1491
|
+
const [debouncedValue, setDebouncedValue] = React48__namespace.useState(value);
|
|
1492
|
+
React48__namespace.useEffect(() => {
|
|
1188
1493
|
const handler = setTimeout(() => {
|
|
1189
1494
|
setDebouncedValue(value);
|
|
1190
1495
|
}, delay);
|
|
@@ -1195,12 +1500,12 @@ function useDebounce(value, delay = 300) {
|
|
|
1195
1500
|
return debouncedValue;
|
|
1196
1501
|
}
|
|
1197
1502
|
function useDebouncedCallback(callback, delay = 300) {
|
|
1198
|
-
const callbackRef =
|
|
1199
|
-
const timeoutRef =
|
|
1200
|
-
|
|
1503
|
+
const callbackRef = React48__namespace.useRef(callback);
|
|
1504
|
+
const timeoutRef = React48__namespace.useRef(null);
|
|
1505
|
+
React48__namespace.useEffect(() => {
|
|
1201
1506
|
callbackRef.current = callback;
|
|
1202
1507
|
}, [callback]);
|
|
1203
|
-
return
|
|
1508
|
+
return React48__namespace.useCallback(
|
|
1204
1509
|
(...args) => {
|
|
1205
1510
|
if (timeoutRef.current) {
|
|
1206
1511
|
clearTimeout(timeoutRef.current);
|
|
@@ -1212,7 +1517,7 @@ function useDebouncedCallback(callback, delay = 300) {
|
|
|
1212
1517
|
[delay]
|
|
1213
1518
|
);
|
|
1214
1519
|
}
|
|
1215
|
-
var DataTableSearch =
|
|
1520
|
+
var DataTableSearch = React48__namespace.memo(function DataTableSearch2({
|
|
1216
1521
|
column,
|
|
1217
1522
|
placeholder = "Buscar...",
|
|
1218
1523
|
debounce = 300,
|
|
@@ -1221,17 +1526,17 @@ var DataTableSearch = React36__namespace.memo(function DataTableSearch2({
|
|
|
1221
1526
|
}) {
|
|
1222
1527
|
const table = useDataTableInstance();
|
|
1223
1528
|
const columnInstance = table.getColumn(column);
|
|
1224
|
-
const [value, setValue] =
|
|
1529
|
+
const [value, setValue] = React48__namespace.useState(
|
|
1225
1530
|
columnInstance?.getFilterValue() ?? ""
|
|
1226
1531
|
);
|
|
1227
1532
|
const debouncedValue = useDebounce(value, debounce);
|
|
1228
|
-
|
|
1533
|
+
React48__namespace.useEffect(() => {
|
|
1229
1534
|
columnInstance?.setFilterValue(debouncedValue);
|
|
1230
1535
|
if (onSearch) {
|
|
1231
1536
|
onSearch(debouncedValue);
|
|
1232
1537
|
}
|
|
1233
1538
|
}, [debouncedValue, columnInstance, onSearch]);
|
|
1234
|
-
|
|
1539
|
+
React48__namespace.useEffect(() => {
|
|
1235
1540
|
const filterValue = columnInstance?.getFilterValue() ?? "";
|
|
1236
1541
|
if (filterValue !== value) {
|
|
1237
1542
|
setValue(filterValue);
|
|
@@ -1247,15 +1552,15 @@ var DataTableSearch = React36__namespace.memo(function DataTableSearch2({
|
|
|
1247
1552
|
}
|
|
1248
1553
|
);
|
|
1249
1554
|
});
|
|
1250
|
-
var DataTableFilters =
|
|
1555
|
+
var DataTableFilters = React48__namespace.memo(function DataTableFilters2({
|
|
1251
1556
|
onChange,
|
|
1252
1557
|
className,
|
|
1253
1558
|
children
|
|
1254
1559
|
}) {
|
|
1255
1560
|
const table = useDataTableInstance();
|
|
1256
1561
|
const filters = table.getState().columnFilters;
|
|
1257
|
-
const filtersRef =
|
|
1258
|
-
|
|
1562
|
+
const filtersRef = React48__namespace.useRef(filters);
|
|
1563
|
+
React48__namespace.useEffect(() => {
|
|
1259
1564
|
if (onChange && JSON.stringify(filters) !== JSON.stringify(filtersRef.current)) {
|
|
1260
1565
|
filtersRef.current = filters;
|
|
1261
1566
|
onChange(filters);
|
|
@@ -1263,7 +1568,7 @@ var DataTableFilters = React36__namespace.memo(function DataTableFilters2({
|
|
|
1263
1568
|
}, [filters, onChange]);
|
|
1264
1569
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex gap-2", className), children });
|
|
1265
1570
|
});
|
|
1266
|
-
var DataTableFilter =
|
|
1571
|
+
var DataTableFilter = React48__namespace.memo(function DataTableFilter2({
|
|
1267
1572
|
column: columnId,
|
|
1268
1573
|
title,
|
|
1269
1574
|
options,
|
|
@@ -1273,7 +1578,7 @@ var DataTableFilter = React36__namespace.memo(function DataTableFilter2({
|
|
|
1273
1578
|
const column = table.getColumn(columnId);
|
|
1274
1579
|
const filterValue = column?.getFilterValue() ?? [];
|
|
1275
1580
|
const currentValue = filterValue.length > 0 ? filterValue[0] : "all";
|
|
1276
|
-
const handleValueChange =
|
|
1581
|
+
const handleValueChange = React48__namespace.useCallback(
|
|
1277
1582
|
(value) => {
|
|
1278
1583
|
if (value === "all") {
|
|
1279
1584
|
column?.setFilterValue(void 0);
|
|
@@ -1298,7 +1603,7 @@ var DataTableFilter = React36__namespace.memo(function DataTableFilter2({
|
|
|
1298
1603
|
}
|
|
1299
1604
|
);
|
|
1300
1605
|
});
|
|
1301
|
-
var DataTablePagination =
|
|
1606
|
+
var DataTablePagination = React48__namespace.memo(function DataTablePagination2({
|
|
1302
1607
|
mode = "client",
|
|
1303
1608
|
pageCount: externalPageCount,
|
|
1304
1609
|
pageSizes = [10, 20, 30, 50],
|
|
@@ -1325,7 +1630,7 @@ var DataTablePagination = React36__namespace.memo(function DataTablePagination2(
|
|
|
1325
1630
|
const pageCount = mode === "server" && externalPageCount !== void 0 ? externalPageCount : internalPageCount;
|
|
1326
1631
|
const canGoPrevious = pageIndex > 0;
|
|
1327
1632
|
const canGoNext = pageIndex < pageCount - 1;
|
|
1328
|
-
const handlePageSizeChange =
|
|
1633
|
+
const handlePageSizeChange = React48__namespace.useCallback(
|
|
1329
1634
|
(value) => {
|
|
1330
1635
|
setPageSize(Number(value));
|
|
1331
1636
|
},
|
|
@@ -1424,7 +1729,7 @@ var DataTablePagination = React36__namespace.memo(function DataTablePagination2(
|
|
|
1424
1729
|
);
|
|
1425
1730
|
});
|
|
1426
1731
|
DataTablePagination.displayName = "DataTable.Pagination";
|
|
1427
|
-
var DataTableEmptyState =
|
|
1732
|
+
var DataTableEmptyState = React48__namespace.memo(function DataTableEmptyState2({
|
|
1428
1733
|
message = "Nenhum resultado encontrado.",
|
|
1429
1734
|
description,
|
|
1430
1735
|
icon,
|
|
@@ -1548,8 +1853,8 @@ var iconSizeMap = {
|
|
|
1548
1853
|
md: "h-4 w-4",
|
|
1549
1854
|
lg: "h-5 w-5"
|
|
1550
1855
|
};
|
|
1551
|
-
var Checkbox =
|
|
1552
|
-
|
|
1856
|
+
var Checkbox = React48__namespace.memo(
|
|
1857
|
+
React48__namespace.forwardRef(({ className, variant, size = "md", ...props }, ref) => {
|
|
1553
1858
|
const iconSize = iconSizeMap[size || "md"];
|
|
1554
1859
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1555
1860
|
CheckboxPrimitive__namespace.Root,
|
|
@@ -1573,9 +1878,9 @@ function DataTableColumnVisibility({
|
|
|
1573
1878
|
className
|
|
1574
1879
|
}) {
|
|
1575
1880
|
const table = useDataTable();
|
|
1576
|
-
const [open, setOpen] =
|
|
1577
|
-
const dropdownRef =
|
|
1578
|
-
|
|
1881
|
+
const [open, setOpen] = React48__namespace.useState(false);
|
|
1882
|
+
const dropdownRef = React48__namespace.useRef(null);
|
|
1883
|
+
React48__namespace.useEffect(() => {
|
|
1579
1884
|
function handleClickOutside(event) {
|
|
1580
1885
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1581
1886
|
setOpen(false);
|
|
@@ -1654,9 +1959,9 @@ function DataTableDensityToggle({
|
|
|
1654
1959
|
className
|
|
1655
1960
|
}) {
|
|
1656
1961
|
const { density, setDensity } = useDataTableDensity();
|
|
1657
|
-
const [open, setOpen] =
|
|
1658
|
-
const dropdownRef =
|
|
1659
|
-
|
|
1962
|
+
const [open, setOpen] = React48__namespace.useState(false);
|
|
1963
|
+
const dropdownRef = React48__namespace.useRef(null);
|
|
1964
|
+
React48__namespace.useEffect(() => {
|
|
1660
1965
|
function handleClickOutside(event) {
|
|
1661
1966
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1662
1967
|
setOpen(false);
|
|
@@ -1835,9 +2140,9 @@ function DataTableExport({
|
|
|
1835
2140
|
className
|
|
1836
2141
|
}) {
|
|
1837
2142
|
const table = useDataTable();
|
|
1838
|
-
const [open, setOpen] =
|
|
1839
|
-
const dropdownRef =
|
|
1840
|
-
|
|
2143
|
+
const [open, setOpen] = React48__namespace.useState(false);
|
|
2144
|
+
const dropdownRef = React48__namespace.useRef(null);
|
|
2145
|
+
React48__namespace.useEffect(() => {
|
|
1841
2146
|
function handleClickOutside(event) {
|
|
1842
2147
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1843
2148
|
setOpen(false);
|
|
@@ -1848,7 +2153,7 @@ function DataTableExport({
|
|
|
1848
2153
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1849
2154
|
}
|
|
1850
2155
|
}, [open]);
|
|
1851
|
-
const handleExport =
|
|
2156
|
+
const handleExport = React48__namespace.useCallback((format) => {
|
|
1852
2157
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
1853
2158
|
const rows = table.getFilteredRowModel().rows;
|
|
1854
2159
|
const headers = [];
|
|
@@ -1951,7 +2256,7 @@ function DataTableTabs({
|
|
|
1951
2256
|
onValueChange,
|
|
1952
2257
|
className
|
|
1953
2258
|
}) {
|
|
1954
|
-
const [internalValue, setInternalValue] =
|
|
2259
|
+
const [internalValue, setInternalValue] = React48__namespace.useState(defaultValue ?? tabs[0]?.value);
|
|
1955
2260
|
const activeValue = value ?? internalValue;
|
|
1956
2261
|
const handleTabClick = (tabValue) => {
|
|
1957
2262
|
if (value === void 0) {
|
|
@@ -2038,8 +2343,8 @@ var Dialog = DialogPrimitive__namespace.Root;
|
|
|
2038
2343
|
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
2039
2344
|
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
2040
2345
|
var DialogClose = DialogPrimitive__namespace.Close;
|
|
2041
|
-
var DialogOverlay =
|
|
2042
|
-
|
|
2346
|
+
var DialogOverlay = React48__namespace.memo(
|
|
2347
|
+
React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2043
2348
|
DialogPrimitive__namespace.Overlay,
|
|
2044
2349
|
{
|
|
2045
2350
|
ref,
|
|
@@ -2086,8 +2391,8 @@ var dialogContentVariants = classVarianceAuthority.cva(
|
|
|
2086
2391
|
}
|
|
2087
2392
|
}
|
|
2088
2393
|
);
|
|
2089
|
-
var DialogContent =
|
|
2090
|
-
|
|
2394
|
+
var DialogContent = React48__namespace.memo(
|
|
2395
|
+
React48__namespace.forwardRef(({ className, children, showCloseButton = true, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
2091
2396
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
2092
2397
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2093
2398
|
DialogPrimitive__namespace.Content,
|
|
@@ -2107,7 +2412,7 @@ var DialogContent = React36__namespace.memo(
|
|
|
2107
2412
|
] }))
|
|
2108
2413
|
);
|
|
2109
2414
|
DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
|
|
2110
|
-
var DialogHeader =
|
|
2415
|
+
var DialogHeader = React48__namespace.memo(
|
|
2111
2416
|
({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2112
2417
|
"div",
|
|
2113
2418
|
{
|
|
@@ -2120,7 +2425,7 @@ var DialogHeader = React36__namespace.memo(
|
|
|
2120
2425
|
)
|
|
2121
2426
|
);
|
|
2122
2427
|
DialogHeader.displayName = "DialogHeader";
|
|
2123
|
-
var DialogFooter =
|
|
2428
|
+
var DialogFooter = React48__namespace.memo(
|
|
2124
2429
|
({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2125
2430
|
"div",
|
|
2126
2431
|
{
|
|
@@ -2133,8 +2438,8 @@ var DialogFooter = React36__namespace.memo(
|
|
|
2133
2438
|
)
|
|
2134
2439
|
);
|
|
2135
2440
|
DialogFooter.displayName = "DialogFooter";
|
|
2136
|
-
var DialogTitle =
|
|
2137
|
-
|
|
2441
|
+
var DialogTitle = React48__namespace.memo(
|
|
2442
|
+
React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2138
2443
|
DialogPrimitive__namespace.Title,
|
|
2139
2444
|
{
|
|
2140
2445
|
ref,
|
|
@@ -2147,8 +2452,8 @@ var DialogTitle = React36__namespace.memo(
|
|
|
2147
2452
|
))
|
|
2148
2453
|
);
|
|
2149
2454
|
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
2150
|
-
var DialogDescription =
|
|
2151
|
-
|
|
2455
|
+
var DialogDescription = React48__namespace.memo(
|
|
2456
|
+
React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2152
2457
|
DialogPrimitive__namespace.Description,
|
|
2153
2458
|
{
|
|
2154
2459
|
ref,
|
|
@@ -2158,7 +2463,7 @@ var DialogDescription = React36__namespace.memo(
|
|
|
2158
2463
|
))
|
|
2159
2464
|
);
|
|
2160
2465
|
DialogDescription.displayName = DialogPrimitive__namespace.Description.displayName;
|
|
2161
|
-
var DialogBody =
|
|
2466
|
+
var DialogBody = React48__namespace.memo(
|
|
2162
2467
|
({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 overflow-y-auto py-2", className), ...props })
|
|
2163
2468
|
);
|
|
2164
2469
|
DialogBody.displayName = "DialogBody";
|
|
@@ -2189,7 +2494,7 @@ var COLOR_MAP = {
|
|
|
2189
2494
|
accent: "border-accent",
|
|
2190
2495
|
muted: "border-muted"
|
|
2191
2496
|
};
|
|
2192
|
-
var RippleRing =
|
|
2497
|
+
var RippleRing = React48__namespace.memo(({ size, color, opacity }) => {
|
|
2193
2498
|
const borderColorClass = COLOR_MAP[color] || COLOR_MAP.primary;
|
|
2194
2499
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2195
2500
|
"div",
|
|
@@ -2208,7 +2513,7 @@ var RippleRing = React36__namespace.memo(({ size, color, opacity }) => {
|
|
|
2208
2513
|
);
|
|
2209
2514
|
});
|
|
2210
2515
|
RippleRing.displayName = "RippleRing";
|
|
2211
|
-
var RippleEffect =
|
|
2516
|
+
var RippleEffect = React48__namespace.memo(
|
|
2212
2517
|
({
|
|
2213
2518
|
size = "md",
|
|
2214
2519
|
color = "primary",
|
|
@@ -2220,7 +2525,7 @@ var RippleEffect = React36__namespace.memo(
|
|
|
2220
2525
|
const { base, increment } = SIZE_CONFIG[size];
|
|
2221
2526
|
const opacities = INTENSITY_CONFIG[intensity];
|
|
2222
2527
|
const positionClasses = POSITION_CONFIG[position];
|
|
2223
|
-
const rippleRings =
|
|
2528
|
+
const rippleRings = React48__namespace.useMemo(
|
|
2224
2529
|
() => Array.from({ length: rings }).map((_, index) => {
|
|
2225
2530
|
const ringSize = base + increment * (rings - index - 1);
|
|
2226
2531
|
const opacity = opacities[index] || opacities[opacities.length - 1];
|
|
@@ -2250,7 +2555,7 @@ var RippleEffect = React36__namespace.memo(
|
|
|
2250
2555
|
}
|
|
2251
2556
|
);
|
|
2252
2557
|
RippleEffect.displayName = "RippleEffect";
|
|
2253
|
-
var RippleWrapper =
|
|
2558
|
+
var RippleWrapper = React48__namespace.memo(
|
|
2254
2559
|
({ children, rippleProps, className }) => {
|
|
2255
2560
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
2256
2561
|
rippleProps && /* @__PURE__ */ jsxRuntime.jsx(RippleEffect, { ...rippleProps }),
|
|
@@ -2259,7 +2564,7 @@ var RippleWrapper = React36__namespace.memo(
|
|
|
2259
2564
|
}
|
|
2260
2565
|
);
|
|
2261
2566
|
RippleWrapper.displayName = "RippleWrapper";
|
|
2262
|
-
var RippleBackground =
|
|
2567
|
+
var RippleBackground = React48__namespace.memo(
|
|
2263
2568
|
({ containerClassName, ...rippleProps }) => {
|
|
2264
2569
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2265
2570
|
"div",
|
|
@@ -2325,7 +2630,7 @@ var statusIndicatorVariants = classVarianceAuthority.cva(
|
|
|
2325
2630
|
}
|
|
2326
2631
|
}
|
|
2327
2632
|
);
|
|
2328
|
-
var DialogWrapper =
|
|
2633
|
+
var DialogWrapper = React48__namespace.memo(
|
|
2329
2634
|
({
|
|
2330
2635
|
children,
|
|
2331
2636
|
className,
|
|
@@ -2338,7 +2643,7 @@ var DialogWrapper = React36__namespace.memo(
|
|
|
2338
2643
|
rippleProps,
|
|
2339
2644
|
...props
|
|
2340
2645
|
}) => {
|
|
2341
|
-
const defaultRippleProps =
|
|
2646
|
+
const defaultRippleProps = React48__namespace.useMemo(
|
|
2342
2647
|
() => ({
|
|
2343
2648
|
size: size === "sm" ? "md" : size === "lg" ? "xl" : "lg",
|
|
2344
2649
|
color: variant === "secondary" ? "secondary" : variant === "accent" ? "accent" : "primary",
|
|
@@ -2348,7 +2653,7 @@ var DialogWrapper = React36__namespace.memo(
|
|
|
2348
2653
|
}),
|
|
2349
2654
|
[size, variant, rippleProps]
|
|
2350
2655
|
);
|
|
2351
|
-
const backgroundRippleProps =
|
|
2656
|
+
const backgroundRippleProps = React48__namespace.useMemo(
|
|
2352
2657
|
() => ({
|
|
2353
2658
|
position: "top-right",
|
|
2354
2659
|
size: "xl",
|
|
@@ -2451,7 +2756,7 @@ var Toaster = ({ ...props }) => {
|
|
|
2451
2756
|
}
|
|
2452
2757
|
);
|
|
2453
2758
|
};
|
|
2454
|
-
var CustomToast =
|
|
2759
|
+
var CustomToast = React48__namespace.memo(
|
|
2455
2760
|
({ title, description, variant = "default", action, onClose }) => {
|
|
2456
2761
|
const variantStyles = toastVariants[variant];
|
|
2457
2762
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2587,8 +2892,8 @@ var thumbVariants = classVarianceAuthority.cva(
|
|
|
2587
2892
|
}
|
|
2588
2893
|
}
|
|
2589
2894
|
);
|
|
2590
|
-
var Switch =
|
|
2591
|
-
|
|
2895
|
+
var Switch = React48__namespace.memo(
|
|
2896
|
+
React48__namespace.forwardRef(({ className, variant, size = "md", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2592
2897
|
SwitchPrimitives__namespace.Root,
|
|
2593
2898
|
{
|
|
2594
2899
|
className: cn(switchVariants({ variant, size, className })),
|
|
@@ -2619,8 +2924,8 @@ var textareaVariants = classVarianceAuthority.cva(
|
|
|
2619
2924
|
}
|
|
2620
2925
|
}
|
|
2621
2926
|
);
|
|
2622
|
-
var Textarea =
|
|
2623
|
-
|
|
2927
|
+
var Textarea = React48__namespace.memo(
|
|
2928
|
+
React48__namespace.forwardRef(
|
|
2624
2929
|
({
|
|
2625
2930
|
className,
|
|
2626
2931
|
variant,
|
|
@@ -2635,12 +2940,12 @@ var Textarea = React36__namespace.memo(
|
|
|
2635
2940
|
onChange,
|
|
2636
2941
|
...props
|
|
2637
2942
|
}, ref) => {
|
|
2638
|
-
const textareaRef =
|
|
2639
|
-
|
|
2640
|
-
const focusTextarea =
|
|
2943
|
+
const textareaRef = React48__namespace.useRef(null);
|
|
2944
|
+
React48__namespace.useImperativeHandle(ref, () => textareaRef.current, []);
|
|
2945
|
+
const focusTextarea = React48__namespace.useCallback(() => {
|
|
2641
2946
|
textareaRef.current?.focus();
|
|
2642
2947
|
}, []);
|
|
2643
|
-
const handleChange =
|
|
2948
|
+
const handleChange = React48__namespace.useCallback(
|
|
2644
2949
|
(e) => {
|
|
2645
2950
|
if (autoResize && textareaRef.current) {
|
|
2646
2951
|
textareaRef.current.style.height = "auto";
|
|
@@ -2650,7 +2955,7 @@ var Textarea = React36__namespace.memo(
|
|
|
2650
2955
|
},
|
|
2651
2956
|
[autoResize, onChange]
|
|
2652
2957
|
);
|
|
2653
|
-
|
|
2958
|
+
React48__namespace.useEffect(() => {
|
|
2654
2959
|
if (autoResize && textareaRef.current) {
|
|
2655
2960
|
textareaRef.current.style.height = "auto";
|
|
2656
2961
|
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
@@ -2701,9 +3006,9 @@ var Textarea = React36__namespace.memo(
|
|
|
2701
3006
|
)
|
|
2702
3007
|
);
|
|
2703
3008
|
Textarea.displayName = "Textarea";
|
|
2704
|
-
var FormContext =
|
|
3009
|
+
var FormContext = React48__namespace.createContext(null);
|
|
2705
3010
|
function useFormContext() {
|
|
2706
|
-
const context =
|
|
3011
|
+
const context = React48__namespace.useContext(FormContext);
|
|
2707
3012
|
if (!context) {
|
|
2708
3013
|
throw new Error("useFormContext must be used within a Form provider");
|
|
2709
3014
|
}
|
|
@@ -2713,27 +3018,27 @@ function FormProvider({
|
|
|
2713
3018
|
form,
|
|
2714
3019
|
children
|
|
2715
3020
|
}) {
|
|
2716
|
-
const value =
|
|
3021
|
+
const value = React48__namespace.useMemo(() => ({ form }), [form]);
|
|
2717
3022
|
return /* @__PURE__ */ jsxRuntime.jsx(FormContext.Provider, { value, children });
|
|
2718
3023
|
}
|
|
2719
|
-
var FormFieldContext =
|
|
3024
|
+
var FormFieldContext = React48__namespace.createContext(null);
|
|
2720
3025
|
function useFormFieldContext() {
|
|
2721
|
-
const context =
|
|
3026
|
+
const context = React48__namespace.useContext(FormFieldContext);
|
|
2722
3027
|
if (!context) {
|
|
2723
3028
|
throw new Error("useFormFieldContext must be used within a Form.Field");
|
|
2724
3029
|
}
|
|
2725
3030
|
return context;
|
|
2726
3031
|
}
|
|
2727
3032
|
function useFormFieldContextOptional() {
|
|
2728
|
-
return
|
|
3033
|
+
return React48__namespace.useContext(FormFieldContext);
|
|
2729
3034
|
}
|
|
2730
3035
|
function FormFieldProvider({ name, children }) {
|
|
2731
3036
|
const form = useFormContext();
|
|
2732
|
-
const id =
|
|
3037
|
+
const id = React48__namespace.useId();
|
|
2733
3038
|
const fieldState = form.getFieldState(name, form.formState);
|
|
2734
3039
|
const error = fieldState.error?.message;
|
|
2735
3040
|
const isRequired = false;
|
|
2736
|
-
const value =
|
|
3041
|
+
const value = React48__namespace.useMemo(
|
|
2737
3042
|
() => ({
|
|
2738
3043
|
name,
|
|
2739
3044
|
id,
|
|
@@ -2841,7 +3146,7 @@ function FormInput({
|
|
|
2841
3146
|
const form = useFormContext();
|
|
2842
3147
|
const fieldState = form.getFieldState(name, form.formState);
|
|
2843
3148
|
const error = fieldState.error?.message;
|
|
2844
|
-
const getInputType =
|
|
3149
|
+
const getInputType = React48__namespace.useCallback(() => {
|
|
2845
3150
|
if (["money", "percent", "phone", "cpf", "cnpj", "cep"].includes(mask || "")) {
|
|
2846
3151
|
return "tel";
|
|
2847
3152
|
}
|
|
@@ -3037,7 +3342,7 @@ function FormCheckbox({
|
|
|
3037
3342
|
const form = useFormContext();
|
|
3038
3343
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3039
3344
|
const error = fieldState.error?.message;
|
|
3040
|
-
const id =
|
|
3345
|
+
const id = React48__namespace.useId();
|
|
3041
3346
|
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3042
3347
|
reactHookForm.Controller,
|
|
3043
3348
|
{
|
|
@@ -3092,7 +3397,7 @@ function FormSwitch({
|
|
|
3092
3397
|
const form = useFormContext();
|
|
3093
3398
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3094
3399
|
const error = fieldState.error?.message;
|
|
3095
|
-
const id =
|
|
3400
|
+
const id = React48__namespace.useId();
|
|
3096
3401
|
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3097
3402
|
reactHookForm.Controller,
|
|
3098
3403
|
{
|
|
@@ -3230,7 +3535,7 @@ function FormRadioGroup({
|
|
|
3230
3535
|
) });
|
|
3231
3536
|
}
|
|
3232
3537
|
FormRadioGroup.displayName = "Form.RadioGroup";
|
|
3233
|
-
var FormLabel =
|
|
3538
|
+
var FormLabel = React48__namespace.forwardRef(
|
|
3234
3539
|
({ className, required, children, ...props }, ref) => {
|
|
3235
3540
|
const fieldContext = useFormFieldContextOptional();
|
|
3236
3541
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3253,7 +3558,7 @@ var FormLabel = React36__namespace.forwardRef(
|
|
|
3253
3558
|
}
|
|
3254
3559
|
);
|
|
3255
3560
|
FormLabel.displayName = "Form.Label";
|
|
3256
|
-
var FormDescription =
|
|
3561
|
+
var FormDescription = React48__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
3257
3562
|
const fieldContext = useFormFieldContextOptional();
|
|
3258
3563
|
if (fieldContext?.error) {
|
|
3259
3564
|
return null;
|
|
@@ -3268,7 +3573,7 @@ var FormDescription = React36__namespace.forwardRef(({ className, ...props }, re
|
|
|
3268
3573
|
);
|
|
3269
3574
|
});
|
|
3270
3575
|
FormDescription.displayName = "Form.Description";
|
|
3271
|
-
var FormError =
|
|
3576
|
+
var FormError = React48__namespace.forwardRef(
|
|
3272
3577
|
({ className, message, children, ...props }, ref) => {
|
|
3273
3578
|
const fieldContext = useFormFieldContextOptional();
|
|
3274
3579
|
const errorMessage = message ?? fieldContext?.error;
|
|
@@ -3287,7 +3592,7 @@ var FormError = React36__namespace.forwardRef(
|
|
|
3287
3592
|
}
|
|
3288
3593
|
);
|
|
3289
3594
|
FormError.displayName = "Form.Error";
|
|
3290
|
-
var FormFieldWrapper =
|
|
3595
|
+
var FormFieldWrapper = React48__namespace.forwardRef(({ className, label, description, required, error, children, ...props }, ref) => {
|
|
3291
3596
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-1", className), ...props, children: [
|
|
3292
3597
|
label && /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { required, children: label }),
|
|
3293
3598
|
children,
|
|
@@ -3330,14 +3635,192 @@ var Form = Object.assign(FormRoot, {
|
|
|
3330
3635
|
FieldWrapper: FormFieldWrapper,
|
|
3331
3636
|
Field: FormFieldProvider
|
|
3332
3637
|
});
|
|
3333
|
-
var
|
|
3638
|
+
var Avatar = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3639
|
+
AvatarPrimitive__namespace.Root,
|
|
3640
|
+
{
|
|
3641
|
+
ref,
|
|
3642
|
+
className: cn(
|
|
3643
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
3644
|
+
className
|
|
3645
|
+
),
|
|
3646
|
+
...props
|
|
3647
|
+
}
|
|
3648
|
+
));
|
|
3649
|
+
Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
|
|
3650
|
+
var AvatarImage = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3651
|
+
AvatarPrimitive__namespace.Image,
|
|
3652
|
+
{
|
|
3653
|
+
ref,
|
|
3654
|
+
className: cn("aspect-square h-full w-full", className),
|
|
3655
|
+
...props
|
|
3656
|
+
}
|
|
3657
|
+
));
|
|
3658
|
+
AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
|
|
3659
|
+
var AvatarFallback = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3660
|
+
AvatarPrimitive__namespace.Fallback,
|
|
3661
|
+
{
|
|
3662
|
+
ref,
|
|
3663
|
+
className: cn(
|
|
3664
|
+
"flex h-full w-full items-center justify-center rounded-full bg-primary/10 text-primary font-semibold",
|
|
3665
|
+
className
|
|
3666
|
+
),
|
|
3667
|
+
...props
|
|
3668
|
+
}
|
|
3669
|
+
));
|
|
3670
|
+
AvatarFallback.displayName = AvatarPrimitive__namespace.Fallback.displayName;
|
|
3671
|
+
var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
|
|
3672
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
|
|
3673
|
+
var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
3674
|
+
var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
3675
|
+
var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
3676
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
3677
|
+
var DropdownMenuSubTrigger = React48__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3678
|
+
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
3679
|
+
{
|
|
3680
|
+
ref,
|
|
3681
|
+
className: cn(
|
|
3682
|
+
"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",
|
|
3683
|
+
inset && "pl-8",
|
|
3684
|
+
className
|
|
3685
|
+
),
|
|
3686
|
+
...props,
|
|
3687
|
+
children: [
|
|
3688
|
+
children,
|
|
3689
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
3690
|
+
]
|
|
3691
|
+
}
|
|
3692
|
+
));
|
|
3693
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
|
|
3694
|
+
var DropdownMenuSubContent = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3695
|
+
DropdownMenuPrimitive__namespace.SubContent,
|
|
3696
|
+
{
|
|
3697
|
+
ref,
|
|
3698
|
+
className: cn(
|
|
3699
|
+
"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",
|
|
3700
|
+
className
|
|
3701
|
+
),
|
|
3702
|
+
...props
|
|
3703
|
+
}
|
|
3704
|
+
));
|
|
3705
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
|
|
3706
|
+
var DropdownMenuContent = React48__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3707
|
+
DropdownMenuPrimitive__namespace.Content,
|
|
3708
|
+
{
|
|
3709
|
+
ref,
|
|
3710
|
+
sideOffset,
|
|
3711
|
+
className: cn(
|
|
3712
|
+
"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",
|
|
3713
|
+
className
|
|
3714
|
+
),
|
|
3715
|
+
...props
|
|
3716
|
+
}
|
|
3717
|
+
) }));
|
|
3718
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
3719
|
+
var DropdownMenuItem = React48__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3720
|
+
DropdownMenuPrimitive__namespace.Item,
|
|
3721
|
+
{
|
|
3722
|
+
ref,
|
|
3723
|
+
className: cn(
|
|
3724
|
+
"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",
|
|
3725
|
+
inset && "pl-8",
|
|
3726
|
+
className
|
|
3727
|
+
),
|
|
3728
|
+
...props
|
|
3729
|
+
}
|
|
3730
|
+
));
|
|
3731
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
3732
|
+
var DropdownMenuCheckboxItem = React48__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3733
|
+
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
3734
|
+
{
|
|
3735
|
+
ref,
|
|
3736
|
+
className: cn(
|
|
3737
|
+
"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",
|
|
3738
|
+
className
|
|
3739
|
+
),
|
|
3740
|
+
checked,
|
|
3741
|
+
...props,
|
|
3742
|
+
children: [
|
|
3743
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
|
|
3744
|
+
children
|
|
3745
|
+
]
|
|
3746
|
+
}
|
|
3747
|
+
));
|
|
3748
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
3749
|
+
var DropdownMenuRadioItem = React48__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3750
|
+
DropdownMenuPrimitive__namespace.RadioItem,
|
|
3751
|
+
{
|
|
3752
|
+
ref,
|
|
3753
|
+
className: cn(
|
|
3754
|
+
"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",
|
|
3755
|
+
className
|
|
3756
|
+
),
|
|
3757
|
+
...props,
|
|
3758
|
+
children: [
|
|
3759
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
3760
|
+
children
|
|
3761
|
+
]
|
|
3762
|
+
}
|
|
3763
|
+
));
|
|
3764
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
|
|
3765
|
+
var DropdownMenuLabel = React48__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3766
|
+
DropdownMenuPrimitive__namespace.Label,
|
|
3767
|
+
{
|
|
3768
|
+
ref,
|
|
3769
|
+
className: cn(
|
|
3770
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
3771
|
+
inset && "pl-8",
|
|
3772
|
+
className
|
|
3773
|
+
),
|
|
3774
|
+
...props
|
|
3775
|
+
}
|
|
3776
|
+
));
|
|
3777
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
3778
|
+
var DropdownMenuSeparator = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3779
|
+
DropdownMenuPrimitive__namespace.Separator,
|
|
3780
|
+
{
|
|
3781
|
+
ref,
|
|
3782
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
3783
|
+
...props
|
|
3784
|
+
}
|
|
3785
|
+
));
|
|
3786
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
|
|
3787
|
+
var DropdownMenuShortcut = ({
|
|
3788
|
+
className,
|
|
3789
|
+
...props
|
|
3790
|
+
}) => {
|
|
3791
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3792
|
+
"span",
|
|
3793
|
+
{
|
|
3794
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
3795
|
+
...props
|
|
3796
|
+
}
|
|
3797
|
+
);
|
|
3798
|
+
};
|
|
3799
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3800
|
+
var Popover = PopoverPrimitive__namespace.Root;
|
|
3801
|
+
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
3802
|
+
var PopoverContent = React48__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3803
|
+
PopoverPrimitive__namespace.Content,
|
|
3804
|
+
{
|
|
3805
|
+
ref,
|
|
3806
|
+
align,
|
|
3807
|
+
sideOffset,
|
|
3808
|
+
className: cn(
|
|
3809
|
+
"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",
|
|
3810
|
+
className
|
|
3811
|
+
),
|
|
3812
|
+
...props
|
|
3813
|
+
}
|
|
3814
|
+
) }));
|
|
3815
|
+
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
3816
|
+
var AuthLayoutContext = React48__namespace.createContext({
|
|
3334
3817
|
imagePosition: "left"
|
|
3335
3818
|
});
|
|
3336
3819
|
function AuthLayoutRoot({ children, className }) {
|
|
3337
|
-
const [imagePosition, setImagePosition] =
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
if (
|
|
3820
|
+
const [imagePosition, setImagePosition] = React48__namespace.useState("left");
|
|
3821
|
+
React48__namespace.useEffect(() => {
|
|
3822
|
+
React48__namespace.Children.forEach(children, (child) => {
|
|
3823
|
+
if (React48__namespace.isValidElement(child) && child.type === AuthLayoutImage) {
|
|
3341
3824
|
setImagePosition(child.props.position || "left");
|
|
3342
3825
|
}
|
|
3343
3826
|
});
|
|
@@ -3359,29 +3842,87 @@ function AuthLayoutImage({
|
|
|
3359
3842
|
alt,
|
|
3360
3843
|
position: _position = "left",
|
|
3361
3844
|
className,
|
|
3362
|
-
priority = true
|
|
3845
|
+
priority = true,
|
|
3846
|
+
showPattern = false
|
|
3363
3847
|
}) {
|
|
3364
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
3848
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3365
3849
|
"div",
|
|
3366
3850
|
{
|
|
3367
3851
|
className: cn(
|
|
3368
|
-
"hidden xl:block relative w-full xl:w-3/6 h-64 xl:h-screen overflow-hidden",
|
|
3852
|
+
"hidden xl:block relative w-full xl:w-3/6 h-64 xl:h-screen overflow-hidden bg-muted",
|
|
3369
3853
|
className
|
|
3370
3854
|
),
|
|
3371
|
-
children:
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3855
|
+
children: [
|
|
3856
|
+
src ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3857
|
+
"img",
|
|
3858
|
+
{
|
|
3859
|
+
src,
|
|
3860
|
+
alt,
|
|
3861
|
+
className: "absolute inset-0 w-full h-full object-cover object-top",
|
|
3862
|
+
loading: priority ? "eager" : "lazy"
|
|
3863
|
+
}
|
|
3864
|
+
) : null,
|
|
3865
|
+
showPattern && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 flex items-center justify-center", children: [
|
|
3866
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3867
|
+
"svg",
|
|
3868
|
+
{
|
|
3869
|
+
className: "absolute inset-0 w-full h-full opacity-10",
|
|
3870
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3871
|
+
children: [
|
|
3872
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3873
|
+
"pattern",
|
|
3874
|
+
{
|
|
3875
|
+
id: "auth-grid",
|
|
3876
|
+
width: "40",
|
|
3877
|
+
height: "40",
|
|
3878
|
+
patternUnits: "userSpaceOnUse",
|
|
3879
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3880
|
+
"path",
|
|
3881
|
+
{
|
|
3882
|
+
d: "M 40 0 L 0 0 0 40",
|
|
3883
|
+
fill: "none",
|
|
3884
|
+
stroke: "currentColor",
|
|
3885
|
+
strokeWidth: "0.5"
|
|
3886
|
+
}
|
|
3887
|
+
)
|
|
3888
|
+
}
|
|
3889
|
+
) }),
|
|
3890
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "100%", height: "100%", fill: "url(#auth-grid)" })
|
|
3891
|
+
]
|
|
3892
|
+
}
|
|
3893
|
+
),
|
|
3894
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative z-10", children: [
|
|
3895
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-64 h-64 rounded-full border border-muted-foreground/20" }),
|
|
3896
|
+
/* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
|
|
3897
|
+
"svg",
|
|
3898
|
+
{
|
|
3899
|
+
className: "w-10 h-10 text-muted-foreground/40",
|
|
3900
|
+
fill: "none",
|
|
3901
|
+
stroke: "currentColor",
|
|
3902
|
+
viewBox: "0 0 24 24",
|
|
3903
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3904
|
+
"path",
|
|
3905
|
+
{
|
|
3906
|
+
strokeLinecap: "round",
|
|
3907
|
+
strokeLinejoin: "round",
|
|
3908
|
+
strokeWidth: 1,
|
|
3909
|
+
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"
|
|
3910
|
+
}
|
|
3911
|
+
)
|
|
3912
|
+
}
|
|
3913
|
+
) }),
|
|
3914
|
+
/* @__PURE__ */ jsxRuntime.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" }),
|
|
3915
|
+
/* @__PURE__ */ jsxRuntime.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" }),
|
|
3916
|
+
/* @__PURE__ */ jsxRuntime.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" }),
|
|
3917
|
+
/* @__PURE__ */ jsxRuntime.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" })
|
|
3918
|
+
] })
|
|
3919
|
+
] })
|
|
3920
|
+
]
|
|
3921
|
+
}
|
|
3922
|
+
);
|
|
3923
|
+
}
|
|
3924
|
+
function AuthLayoutContent({
|
|
3925
|
+
children,
|
|
3385
3926
|
className,
|
|
3386
3927
|
maxWidth = "md"
|
|
3387
3928
|
}) {
|
|
@@ -3394,7 +3935,7 @@ function AuthLayoutContent({
|
|
|
3394
3935
|
"div",
|
|
3395
3936
|
{
|
|
3396
3937
|
className: cn(
|
|
3397
|
-
"w-full lg:w-3/6 flex items-center justify-center p-6
|
|
3938
|
+
"relative w-full lg:w-3/6 flex items-center justify-center p-6 lg:p-12 bg-background",
|
|
3398
3939
|
className
|
|
3399
3940
|
),
|
|
3400
3941
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full space-y-8", maxWidthClasses[maxWidth]), children })
|
|
@@ -3407,8 +3948,15 @@ function AuthLayoutHeader({
|
|
|
3407
3948
|
logo,
|
|
3408
3949
|
title,
|
|
3409
3950
|
description,
|
|
3410
|
-
centered = true
|
|
3951
|
+
centered = true,
|
|
3952
|
+
position = "top-right"
|
|
3411
3953
|
}) {
|
|
3954
|
+
if (position === "top-left" && logo) {
|
|
3955
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("absolute top-6 left-6 lg:top-8 lg:left-8", className), children: logo });
|
|
3956
|
+
}
|
|
3957
|
+
if (position === "top-right" && logo) {
|
|
3958
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("absolute top-6 right-6 lg:top-8 lg:right-8", className), children: logo });
|
|
3959
|
+
}
|
|
3412
3960
|
if (children) {
|
|
3413
3961
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-2", centered && "text-center", className), children });
|
|
3414
3962
|
}
|
|
@@ -3470,7 +4018,7 @@ var AuthLayout = Object.assign(AuthLayoutRoot, {
|
|
|
3470
4018
|
Link: AuthLayoutLink,
|
|
3471
4019
|
Divider: AuthLayoutDivider
|
|
3472
4020
|
});
|
|
3473
|
-
var TabsContext =
|
|
4021
|
+
var TabsContext = React48__namespace.createContext(null);
|
|
3474
4022
|
function SelectionLayoutRoot({ children, className }) {
|
|
3475
4023
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-h-screen bg-muted/30 flex flex-col lg:flex-row", className), children });
|
|
3476
4024
|
}
|
|
@@ -3581,7 +4129,7 @@ function SelectionLayoutTab({
|
|
|
3581
4129
|
badge,
|
|
3582
4130
|
className
|
|
3583
4131
|
}) {
|
|
3584
|
-
const context =
|
|
4132
|
+
const context = React48__namespace.useContext(TabsContext);
|
|
3585
4133
|
if (!context) {
|
|
3586
4134
|
throw new Error("SelectionLayout.Tab must be used within SelectionLayout.Tabs");
|
|
3587
4135
|
}
|
|
@@ -3726,17 +4274,17 @@ var SelectionLayout = Object.assign(SelectionLayoutRoot, {
|
|
|
3726
4274
|
Card: SelectionLayoutCard,
|
|
3727
4275
|
Empty: SelectionLayoutEmpty
|
|
3728
4276
|
});
|
|
3729
|
-
var DashboardLayoutContext =
|
|
4277
|
+
var DashboardLayoutContext = React48__namespace.createContext(null);
|
|
3730
4278
|
function useDashboardLayout() {
|
|
3731
|
-
const context =
|
|
4279
|
+
const context = React48__namespace.useContext(DashboardLayoutContext);
|
|
3732
4280
|
if (!context) {
|
|
3733
4281
|
throw new Error("useDashboardLayout must be used within DashboardLayout");
|
|
3734
4282
|
}
|
|
3735
4283
|
return context;
|
|
3736
4284
|
}
|
|
3737
4285
|
function useMediaQuery(query) {
|
|
3738
|
-
const [matches, setMatches] =
|
|
3739
|
-
|
|
4286
|
+
const [matches, setMatches] = React48__namespace.useState(false);
|
|
4287
|
+
React48__namespace.useEffect(() => {
|
|
3740
4288
|
const media = window.matchMedia(query);
|
|
3741
4289
|
if (media.matches !== matches) {
|
|
3742
4290
|
setMatches(media.matches);
|
|
@@ -3753,11 +4301,11 @@ function DashboardLayoutRoot({
|
|
|
3753
4301
|
defaultExpanded = false,
|
|
3754
4302
|
defaultPinned = false
|
|
3755
4303
|
}) {
|
|
3756
|
-
const [sidebarExpanded, setSidebarExpanded] =
|
|
3757
|
-
const [sidebarPinned, setSidebarPinned] =
|
|
3758
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
4304
|
+
const [sidebarExpanded, setSidebarExpanded] = React48__namespace.useState(defaultExpanded || defaultPinned);
|
|
4305
|
+
const [sidebarPinned, setSidebarPinned] = React48__namespace.useState(defaultPinned);
|
|
4306
|
+
const [mobileMenuOpen, setMobileMenuOpen] = React48__namespace.useState(false);
|
|
3759
4307
|
const isMobile = useMediaQuery("(max-width: 1024px)");
|
|
3760
|
-
|
|
4308
|
+
React48__namespace.useEffect(() => {
|
|
3761
4309
|
if (!isMobile) {
|
|
3762
4310
|
setMobileMenuOpen(false);
|
|
3763
4311
|
}
|
|
@@ -3896,9 +4444,9 @@ function DashboardLayoutSidebarNavItem({
|
|
|
3896
4444
|
primary: "bg-primary/10 text-primary",
|
|
3897
4445
|
destructive: "bg-destructive/10 text-destructive"
|
|
3898
4446
|
};
|
|
3899
|
-
const
|
|
4447
|
+
const renderIcon4 = () => {
|
|
3900
4448
|
if (!icon) return null;
|
|
3901
|
-
if (
|
|
4449
|
+
if (React48__namespace.isValidElement(icon)) {
|
|
3902
4450
|
return icon;
|
|
3903
4451
|
}
|
|
3904
4452
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -3919,7 +4467,7 @@ function DashboardLayoutSidebarNavItem({
|
|
|
3919
4467
|
),
|
|
3920
4468
|
onClick: disabled ? void 0 : onClick,
|
|
3921
4469
|
children: [
|
|
3922
|
-
|
|
4470
|
+
renderIcon4(),
|
|
3923
4471
|
sidebarExpanded && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3924
4472
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-sm", children: label }),
|
|
3925
4473
|
badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3953,15 +4501,15 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
3953
4501
|
className
|
|
3954
4502
|
}) {
|
|
3955
4503
|
const { sidebarExpanded } = useDashboardLayout();
|
|
3956
|
-
const [isOpen, setIsOpen] =
|
|
4504
|
+
const [isOpen, setIsOpen] = React48__namespace.useState(defaultOpen);
|
|
3957
4505
|
const badgeColors = {
|
|
3958
4506
|
default: "bg-muted text-muted-foreground",
|
|
3959
4507
|
primary: "bg-primary/10 text-primary",
|
|
3960
4508
|
destructive: "bg-destructive/10 text-destructive"
|
|
3961
4509
|
};
|
|
3962
|
-
const
|
|
4510
|
+
const renderIcon4 = () => {
|
|
3963
4511
|
if (!icon) return null;
|
|
3964
|
-
if (
|
|
4512
|
+
if (React48__namespace.isValidElement(icon)) {
|
|
3965
4513
|
return icon;
|
|
3966
4514
|
}
|
|
3967
4515
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -3970,7 +4518,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
3970
4518
|
}
|
|
3971
4519
|
return null;
|
|
3972
4520
|
};
|
|
3973
|
-
|
|
4521
|
+
React48__namespace.useEffect(() => {
|
|
3974
4522
|
if (isActive && sidebarExpanded) {
|
|
3975
4523
|
setIsOpen(true);
|
|
3976
4524
|
}
|
|
@@ -3986,7 +4534,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
3986
4534
|
isActive && "text-primary"
|
|
3987
4535
|
),
|
|
3988
4536
|
children: [
|
|
3989
|
-
|
|
4537
|
+
renderIcon4(),
|
|
3990
4538
|
sidebarExpanded && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3991
4539
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-sm", children: label }),
|
|
3992
4540
|
badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4074,7 +4622,7 @@ function DashboardLayoutHeaderUser({
|
|
|
4074
4622
|
children,
|
|
4075
4623
|
onLogout
|
|
4076
4624
|
}) {
|
|
4077
|
-
const [isOpen, setIsOpen] =
|
|
4625
|
+
const [isOpen, setIsOpen] = React48__namespace.useState(false);
|
|
4078
4626
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
4079
4627
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4080
4628
|
"button",
|
|
@@ -4155,7 +4703,7 @@ function DashboardLayoutBreadcrumbs({
|
|
|
4155
4703
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: cn("flex items-center gap-1 text-sm", className), children: items.map((item, index) => {
|
|
4156
4704
|
const Icon2 = item.icon;
|
|
4157
4705
|
const isLast = index === items.length - 1;
|
|
4158
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4706
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React48__namespace.Fragment, { children: [
|
|
4159
4707
|
item.href && !isLast ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4160
4708
|
"a",
|
|
4161
4709
|
{
|
|
@@ -4258,50 +4806,2335 @@ var DashboardLayout = Object.assign(DashboardLayoutRoot, {
|
|
|
4258
4806
|
MobileNav: DashboardLayoutMobileNav,
|
|
4259
4807
|
MobileNavItem: DashboardLayoutMobileNavItem
|
|
4260
4808
|
});
|
|
4261
|
-
var
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4809
|
+
var SidebarContext = React48__namespace.createContext(null);
|
|
4810
|
+
function useSidebar() {
|
|
4811
|
+
const context = React48__namespace.useContext(SidebarContext);
|
|
4812
|
+
if (!context) {
|
|
4813
|
+
throw new Error("useSidebar must be used within a Sidebar component");
|
|
4814
|
+
}
|
|
4815
|
+
return context;
|
|
4816
|
+
}
|
|
4817
|
+
function useSidebarOptional() {
|
|
4818
|
+
return React48__namespace.useContext(SidebarContext);
|
|
4819
|
+
}
|
|
4820
|
+
function SidebarProvider({ children, value }) {
|
|
4821
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value, children });
|
|
4822
|
+
}
|
|
4823
|
+
function useMediaQuery2(query) {
|
|
4824
|
+
const [matches, setMatches] = React48__namespace.useState(false);
|
|
4825
|
+
React48__namespace.useEffect(() => {
|
|
4826
|
+
if (typeof window === "undefined") return;
|
|
4827
|
+
const mediaQuery = window.matchMedia(query);
|
|
4828
|
+
setMatches(mediaQuery.matches);
|
|
4829
|
+
const handler = (event) => {
|
|
4830
|
+
setMatches(event.matches);
|
|
4831
|
+
};
|
|
4832
|
+
mediaQuery.addEventListener("change", handler);
|
|
4833
|
+
return () => mediaQuery.removeEventListener("change", handler);
|
|
4834
|
+
}, [query]);
|
|
4835
|
+
return matches;
|
|
4836
|
+
}
|
|
4837
|
+
var SidebarHeader = React48__namespace.memo(function SidebarHeader2({
|
|
4838
|
+
logo,
|
|
4839
|
+
collapsedLogo,
|
|
4840
|
+
title,
|
|
4841
|
+
showPinButton = true,
|
|
4842
|
+
className
|
|
4271
4843
|
}) {
|
|
4272
|
-
const
|
|
4273
|
-
|
|
4844
|
+
const { expanded, pinned, setPinned } = useSidebar();
|
|
4845
|
+
const handleTogglePin = React48__namespace.useCallback(() => {
|
|
4846
|
+
setPinned(!pinned);
|
|
4847
|
+
}, [pinned, setPinned]);
|
|
4848
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4849
|
+
"div",
|
|
4850
|
+
{
|
|
4851
|
+
className: cn(
|
|
4852
|
+
"flex items-center justify-between h-[60px] border-b border-border bg-primary px-3",
|
|
4853
|
+
className
|
|
4854
|
+
),
|
|
4855
|
+
children: [
|
|
4856
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 overflow-hidden", children: [
|
|
4857
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: !expanded && collapsedLogo && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4858
|
+
framerMotion.motion.div,
|
|
4859
|
+
{
|
|
4860
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
4861
|
+
animate: { opacity: 1, scale: 1 },
|
|
4862
|
+
exit: { opacity: 0, scale: 0.8 },
|
|
4863
|
+
transition: { duration: 0.15 },
|
|
4864
|
+
className: "flex items-center justify-center",
|
|
4865
|
+
children: collapsedLogo
|
|
4866
|
+
},
|
|
4867
|
+
"collapsed-logo"
|
|
4868
|
+
) }),
|
|
4869
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: expanded && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4870
|
+
framerMotion.motion.div,
|
|
4871
|
+
{
|
|
4872
|
+
initial: { opacity: 0, x: -10 },
|
|
4873
|
+
animate: { opacity: 1, x: 0 },
|
|
4874
|
+
exit: { opacity: 0, x: -10 },
|
|
4875
|
+
transition: { duration: 0.2 },
|
|
4876
|
+
className: "flex items-center gap-2",
|
|
4877
|
+
children: [
|
|
4878
|
+
logo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: logo }),
|
|
4879
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-primary-foreground whitespace-nowrap", children: title })
|
|
4880
|
+
]
|
|
4881
|
+
}
|
|
4882
|
+
) }),
|
|
4883
|
+
expanded && !logo && collapsedLogo && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4884
|
+
collapsedLogo,
|
|
4885
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4886
|
+
framerMotion.motion.span,
|
|
4887
|
+
{
|
|
4888
|
+
initial: { opacity: 0, x: -10 },
|
|
4889
|
+
animate: { opacity: 1, x: 0 },
|
|
4890
|
+
exit: { opacity: 0, x: -10 },
|
|
4891
|
+
transition: { duration: 0.2 },
|
|
4892
|
+
className: "text-sm font-semibold text-primary-foreground whitespace-nowrap",
|
|
4893
|
+
children: title
|
|
4894
|
+
}
|
|
4895
|
+
)
|
|
4896
|
+
] })
|
|
4897
|
+
] }),
|
|
4898
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showPinButton && expanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4899
|
+
framerMotion.motion.button,
|
|
4900
|
+
{
|
|
4901
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
4902
|
+
animate: { opacity: 1, scale: 1 },
|
|
4903
|
+
exit: { opacity: 0, scale: 0.8 },
|
|
4904
|
+
transition: { duration: 0.15 },
|
|
4905
|
+
onClick: handleTogglePin,
|
|
4906
|
+
className: cn(
|
|
4907
|
+
"flex h-6 w-6 items-center justify-center rounded-md transition-colors",
|
|
4908
|
+
"hover:bg-primary-foreground/10"
|
|
4909
|
+
// pinned ? '' : 'text-primary-foreground/60'
|
|
4910
|
+
),
|
|
4911
|
+
title: pinned ? "Unpin sidebar" : "Pin sidebar",
|
|
4912
|
+
children: pinned ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PinOff, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pin, { className: "h-3.5 w-3.5" })
|
|
4913
|
+
}
|
|
4914
|
+
) })
|
|
4915
|
+
]
|
|
4916
|
+
}
|
|
4274
4917
|
);
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4918
|
+
});
|
|
4919
|
+
SidebarHeader.displayName = "Sidebar.Header";
|
|
4920
|
+
var SidebarNav = React48__namespace.memo(function SidebarNav2({
|
|
4921
|
+
children,
|
|
4922
|
+
className
|
|
4923
|
+
}) {
|
|
4924
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4925
|
+
"nav",
|
|
4926
|
+
{
|
|
4927
|
+
className: cn(
|
|
4928
|
+
"flex-1 overflow-y-auto overflow-x-hidden py-1 custom-scrollbar",
|
|
4929
|
+
className
|
|
4930
|
+
),
|
|
4931
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5 px-2", children })
|
|
4284
4932
|
}
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4933
|
+
);
|
|
4934
|
+
});
|
|
4935
|
+
SidebarNav.displayName = "Sidebar.Nav";
|
|
4936
|
+
var SidebarSection = React48__namespace.memo(function SidebarSection2({
|
|
4937
|
+
title,
|
|
4938
|
+
children,
|
|
4939
|
+
className
|
|
4940
|
+
}) {
|
|
4941
|
+
const { expanded } = useSidebar();
|
|
4942
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-0.5", className), children: [
|
|
4943
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: title && expanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4944
|
+
framerMotion.motion.div,
|
|
4945
|
+
{
|
|
4946
|
+
initial: { opacity: 0, height: 0 },
|
|
4947
|
+
animate: { opacity: 1, height: "auto" },
|
|
4948
|
+
exit: { opacity: 0, height: 0 },
|
|
4949
|
+
transition: { duration: 0.2 },
|
|
4950
|
+
className: "mb-1 px-2 py-1",
|
|
4951
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-medium uppercase tracking-wider text-muted-foreground", children: title })
|
|
4294
4952
|
}
|
|
4295
|
-
}),
|
|
4296
|
-
|
|
4953
|
+
) }),
|
|
4954
|
+
children
|
|
4955
|
+
] });
|
|
4956
|
+
});
|
|
4957
|
+
SidebarSection.displayName = "Sidebar.Section";
|
|
4958
|
+
function renderIcon(icon, className) {
|
|
4959
|
+
if (!icon) return null;
|
|
4960
|
+
if (React48__namespace.isValidElement(icon)) {
|
|
4961
|
+
return React48__namespace.cloneElement(icon, { className });
|
|
4962
|
+
}
|
|
4963
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
4964
|
+
const IconComponent = icon;
|
|
4965
|
+
return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className });
|
|
4966
|
+
}
|
|
4967
|
+
return null;
|
|
4968
|
+
}
|
|
4969
|
+
var badgeVariantStyles = {
|
|
4970
|
+
default: "bg-primary/10 text-primary",
|
|
4971
|
+
notification: "bg-destructive/20 text-destructive",
|
|
4972
|
+
success: "bg-green-100 text-green-600",
|
|
4973
|
+
warning: "bg-amber-100 text-amber-600"
|
|
4974
|
+
};
|
|
4975
|
+
var SidebarNavItem = React48__namespace.memo(function SidebarNavItem2({
|
|
4976
|
+
icon,
|
|
4977
|
+
label,
|
|
4978
|
+
href,
|
|
4979
|
+
onClick,
|
|
4980
|
+
isActive = false,
|
|
4981
|
+
badge,
|
|
4982
|
+
badgeVariant = "default",
|
|
4983
|
+
disabled = false,
|
|
4984
|
+
className
|
|
4985
|
+
}) {
|
|
4986
|
+
const { expanded } = useSidebar();
|
|
4987
|
+
const handleClick = React48__namespace.useCallback(() => {
|
|
4988
|
+
if (disabled) return;
|
|
4989
|
+
if (onClick) {
|
|
4990
|
+
onClick();
|
|
4991
|
+
} else if (href && typeof window !== "undefined") {
|
|
4992
|
+
window.location.href = href;
|
|
4993
|
+
}
|
|
4994
|
+
}, [disabled, onClick, href]);
|
|
4995
|
+
const iconSize = expanded ? "h-3.5 w-3.5" : "h-4 w-4";
|
|
4996
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4997
|
+
"button",
|
|
4998
|
+
{
|
|
4999
|
+
onClick: handleClick,
|
|
5000
|
+
disabled,
|
|
5001
|
+
className: cn(
|
|
5002
|
+
"group relative flex w-full items-center rounded-md px-2 py-1.5 transition-all duration-200",
|
|
5003
|
+
isActive ? "bg-primary/10 text-primary" : "hover:bg-primary/5 hover:text-primary",
|
|
5004
|
+
disabled && "opacity-50 cursor-not-allowed",
|
|
5005
|
+
className
|
|
5006
|
+
),
|
|
5007
|
+
children: [
|
|
5008
|
+
isActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5009
|
+
framerMotion.motion.div,
|
|
5010
|
+
{
|
|
5011
|
+
layoutId: "sidebarActiveIndicator",
|
|
5012
|
+
className: "absolute left-0 top-0 bottom-0 w-0.5 rounded-r-full bg-primary",
|
|
5013
|
+
transition: { type: "spring", stiffness: 300, damping: 30 }
|
|
5014
|
+
}
|
|
5015
|
+
),
|
|
5016
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5017
|
+
"div",
|
|
5018
|
+
{
|
|
5019
|
+
className: cn(
|
|
5020
|
+
"flex h-6 w-6 items-center justify-center rounded-md transition-all duration-200",
|
|
5021
|
+
isActive ? "text-primary bg-primary/10 group-hover:bg-primary/20" : "text-muted-foreground group-hover:text-foreground"
|
|
5022
|
+
),
|
|
5023
|
+
children: renderIcon(icon, iconSize)
|
|
5024
|
+
}
|
|
5025
|
+
),
|
|
5026
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: expanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5027
|
+
framerMotion.motion.span,
|
|
5028
|
+
{
|
|
5029
|
+
initial: { opacity: 0, x: -10 },
|
|
5030
|
+
animate: { opacity: 1, x: 0 },
|
|
5031
|
+
exit: { opacity: 0, x: -10 },
|
|
5032
|
+
transition: { duration: 0.2 },
|
|
5033
|
+
className: "ml-2 flex-1 text-left text-xs font-medium truncate",
|
|
5034
|
+
children: label
|
|
5035
|
+
}
|
|
5036
|
+
) }),
|
|
5037
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: badge !== void 0 && expanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5038
|
+
framerMotion.motion.div,
|
|
5039
|
+
{
|
|
5040
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
5041
|
+
animate: { opacity: 1, scale: 1 },
|
|
5042
|
+
exit: { opacity: 0, scale: 0.8 },
|
|
5043
|
+
transition: { duration: 0.2 },
|
|
5044
|
+
className: cn(
|
|
5045
|
+
"ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full px-1 text-[10px] font-medium",
|
|
5046
|
+
badgeVariantStyles[badgeVariant]
|
|
5047
|
+
),
|
|
5048
|
+
children: badge
|
|
5049
|
+
}
|
|
5050
|
+
) }),
|
|
5051
|
+
badge !== void 0 && !expanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5052
|
+
"div",
|
|
5053
|
+
{
|
|
5054
|
+
className: cn(
|
|
5055
|
+
"absolute top-1 right-1 h-2 w-2 rounded-full",
|
|
5056
|
+
badgeVariant === "notification" && "bg-destructive",
|
|
5057
|
+
badgeVariant === "success" && "bg-green-500",
|
|
5058
|
+
badgeVariant === "warning" && "bg-amber-500",
|
|
5059
|
+
badgeVariant === "default" && "bg-primary"
|
|
5060
|
+
)
|
|
5061
|
+
}
|
|
5062
|
+
)
|
|
5063
|
+
]
|
|
5064
|
+
}
|
|
4297
5065
|
);
|
|
4298
|
-
|
|
5066
|
+
});
|
|
5067
|
+
SidebarNavItem.displayName = "Sidebar.NavItem";
|
|
5068
|
+
function renderIcon2(icon, className) {
|
|
5069
|
+
if (!icon) return null;
|
|
5070
|
+
if (React48__namespace.isValidElement(icon)) {
|
|
5071
|
+
return React48__namespace.cloneElement(icon, { className });
|
|
5072
|
+
}
|
|
5073
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5074
|
+
const IconComponent = icon;
|
|
5075
|
+
return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className });
|
|
5076
|
+
}
|
|
5077
|
+
return null;
|
|
4299
5078
|
}
|
|
4300
|
-
var
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
5079
|
+
var badgeVariantStyles2 = {
|
|
5080
|
+
default: "bg-primary/10 text-primary",
|
|
5081
|
+
notification: "bg-destructive/20 text-destructive",
|
|
5082
|
+
success: "bg-green-100 text-green-600",
|
|
5083
|
+
warning: "bg-amber-100 text-amber-600"
|
|
5084
|
+
};
|
|
5085
|
+
var SidebarNavGroup = React48__namespace.memo(function SidebarNavGroup2({
|
|
5086
|
+
icon,
|
|
5087
|
+
label,
|
|
5088
|
+
children,
|
|
5089
|
+
id,
|
|
5090
|
+
defaultOpen = false,
|
|
5091
|
+
isActive = false,
|
|
5092
|
+
badge,
|
|
5093
|
+
badgeVariant = "default",
|
|
5094
|
+
className
|
|
5095
|
+
}) {
|
|
5096
|
+
const { expanded, activeSection, setActiveSection } = useSidebar();
|
|
5097
|
+
const [isOpen, setIsOpen] = React48__namespace.useState(defaultOpen);
|
|
5098
|
+
const groupId = id || label.toLowerCase().replace(/\s+/g, "-");
|
|
5099
|
+
const isExpanded = expanded && (activeSection === groupId || isOpen);
|
|
5100
|
+
const handleClick = React48__namespace.useCallback(() => {
|
|
5101
|
+
if (activeSection === groupId) {
|
|
5102
|
+
setActiveSection(null);
|
|
5103
|
+
setIsOpen(false);
|
|
5104
|
+
} else {
|
|
5105
|
+
setActiveSection(groupId);
|
|
5106
|
+
setIsOpen(true);
|
|
5107
|
+
}
|
|
5108
|
+
}, [activeSection, groupId, setActiveSection]);
|
|
5109
|
+
React48__namespace.useEffect(() => {
|
|
5110
|
+
if (expanded && isActive && !isOpen) {
|
|
5111
|
+
setIsOpen(true);
|
|
5112
|
+
setActiveSection(groupId);
|
|
5113
|
+
}
|
|
5114
|
+
}, [expanded, isActive, isOpen, setActiveSection, groupId]);
|
|
5115
|
+
const iconSize = expanded ? "h-3.5 w-3.5" : "h-4 w-4";
|
|
5116
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
5117
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5118
|
+
"button",
|
|
5119
|
+
{
|
|
5120
|
+
onClick: handleClick,
|
|
5121
|
+
className: cn(
|
|
5122
|
+
"group relative flex w-full items-center rounded-md px-2 py-1.5 transition-all duration-200",
|
|
5123
|
+
isActive ? "bg-primary/10 text-primary" : "hover:bg-primary/5 hover:text-primary"
|
|
5124
|
+
),
|
|
5125
|
+
children: [
|
|
5126
|
+
isActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5127
|
+
framerMotion.motion.div,
|
|
5128
|
+
{
|
|
5129
|
+
layoutId: "sidebarGroupActiveIndicator",
|
|
5130
|
+
className: "absolute left-0 top-0 bottom-0 w-0.5 rounded-r-full bg-primary",
|
|
5131
|
+
transition: { type: "spring", stiffness: 300, damping: 30 }
|
|
5132
|
+
}
|
|
5133
|
+
),
|
|
5134
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5135
|
+
"div",
|
|
5136
|
+
{
|
|
5137
|
+
className: cn(
|
|
5138
|
+
"flex h-6 w-6 items-center justify-center rounded-md transition-all duration-200",
|
|
5139
|
+
isActive ? "text-primary bg-primary/10 group-hover:bg-primary/20" : "text-muted-foreground group-hover:text-foreground"
|
|
5140
|
+
),
|
|
5141
|
+
children: renderIcon2(icon, iconSize)
|
|
5142
|
+
}
|
|
5143
|
+
),
|
|
5144
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: expanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5145
|
+
framerMotion.motion.span,
|
|
5146
|
+
{
|
|
5147
|
+
initial: { opacity: 0, x: -10 },
|
|
5148
|
+
animate: { opacity: 1, x: 0 },
|
|
5149
|
+
exit: { opacity: 0, x: -10 },
|
|
5150
|
+
transition: { duration: 0.2 },
|
|
5151
|
+
className: "ml-2 flex-1 text-left text-xs font-medium truncate",
|
|
5152
|
+
children: label
|
|
5153
|
+
}
|
|
5154
|
+
) }),
|
|
5155
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: badge !== void 0 && expanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5156
|
+
framerMotion.motion.div,
|
|
5157
|
+
{
|
|
5158
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
5159
|
+
animate: { opacity: 1, scale: 1 },
|
|
5160
|
+
exit: { opacity: 0, scale: 0.8 },
|
|
5161
|
+
transition: { duration: 0.2 },
|
|
5162
|
+
className: cn(
|
|
5163
|
+
"ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full px-1 text-[10px] font-medium",
|
|
5164
|
+
badgeVariantStyles2[badgeVariant]
|
|
5165
|
+
),
|
|
5166
|
+
children: badge
|
|
5167
|
+
}
|
|
5168
|
+
) }),
|
|
5169
|
+
expanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5170
|
+
framerMotion.motion.div,
|
|
5171
|
+
{
|
|
5172
|
+
animate: { rotate: isExpanded ? 90 : 0 },
|
|
5173
|
+
transition: { duration: 0.2 },
|
|
5174
|
+
className: "ml-1",
|
|
5175
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3 w-3 text-muted-foreground" })
|
|
5176
|
+
}
|
|
5177
|
+
),
|
|
5178
|
+
badge !== void 0 && !expanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5179
|
+
"div",
|
|
5180
|
+
{
|
|
5181
|
+
className: cn(
|
|
5182
|
+
"absolute top-1 right-1 h-2 w-2 rounded-full",
|
|
5183
|
+
badgeVariant === "notification" && "bg-destructive",
|
|
5184
|
+
badgeVariant === "success" && "bg-green-500",
|
|
5185
|
+
badgeVariant === "warning" && "bg-amber-500",
|
|
5186
|
+
badgeVariant === "default" && "bg-primary"
|
|
5187
|
+
)
|
|
5188
|
+
}
|
|
5189
|
+
)
|
|
5190
|
+
]
|
|
5191
|
+
}
|
|
5192
|
+
),
|
|
5193
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isExpanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5194
|
+
framerMotion.motion.div,
|
|
5195
|
+
{
|
|
5196
|
+
initial: { height: 0, opacity: 0 },
|
|
5197
|
+
animate: { height: "auto", opacity: 1 },
|
|
5198
|
+
exit: { height: 0, opacity: 0 },
|
|
5199
|
+
transition: { duration: 0.2, ease: "easeInOut" },
|
|
5200
|
+
className: "overflow-hidden",
|
|
5201
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 space-y-0.5 pl-4 pr-2", children })
|
|
5202
|
+
}
|
|
5203
|
+
) })
|
|
5204
|
+
] });
|
|
5205
|
+
});
|
|
5206
|
+
SidebarNavGroup.displayName = "Sidebar.NavGroup";
|
|
5207
|
+
function isLucideIcon(icon) {
|
|
5208
|
+
return typeof icon === "function";
|
|
5209
|
+
}
|
|
5210
|
+
function getInitials(name) {
|
|
5211
|
+
return name.split(" ").map((part) => part.charAt(0)).slice(0, 2).join("").toUpperCase();
|
|
5212
|
+
}
|
|
5213
|
+
var SidebarFooter = React48__namespace.memo(function SidebarFooter2({
|
|
5214
|
+
user,
|
|
5215
|
+
menuItems,
|
|
5216
|
+
children,
|
|
5217
|
+
className
|
|
5218
|
+
}) {
|
|
5219
|
+
const { expanded } = useSidebar();
|
|
5220
|
+
const [menuOpen, setMenuOpen] = React48__namespace.useState(false);
|
|
5221
|
+
const handleToggleMenu = React48__namespace.useCallback(() => {
|
|
5222
|
+
setMenuOpen((prev) => !prev);
|
|
5223
|
+
}, []);
|
|
5224
|
+
React48__namespace.useEffect(() => {
|
|
5225
|
+
if (!menuOpen) return;
|
|
5226
|
+
const handleClickOutside = (event) => {
|
|
5227
|
+
const target = event.target;
|
|
5228
|
+
if (!target.closest("[data-sidebar-footer]")) {
|
|
5229
|
+
setMenuOpen(false);
|
|
5230
|
+
}
|
|
5231
|
+
};
|
|
5232
|
+
document.addEventListener("click", handleClickOutside);
|
|
5233
|
+
return () => document.removeEventListener("click", handleClickOutside);
|
|
5234
|
+
}, [menuOpen]);
|
|
5235
|
+
if (children) {
|
|
5236
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("border-t border-border p-2", className), children });
|
|
5237
|
+
}
|
|
5238
|
+
if (!user) return null;
|
|
5239
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5240
|
+
"div",
|
|
5241
|
+
{
|
|
5242
|
+
"data-sidebar-footer": true,
|
|
5243
|
+
className: cn("group cursor-pointer border-t border-border p-2", className),
|
|
5244
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
5245
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5246
|
+
"button",
|
|
5247
|
+
{
|
|
5248
|
+
onClick: handleToggleMenu,
|
|
5249
|
+
className: cn(
|
|
5250
|
+
"flex w-full items-center gap-2 rounded-md p-1.5 transition-all",
|
|
5251
|
+
"hover:bg-muted",
|
|
5252
|
+
menuOpen && "bg-muted"
|
|
5253
|
+
),
|
|
5254
|
+
children: [
|
|
5255
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex-shrink-0", children: user.avatar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5256
|
+
"img",
|
|
5257
|
+
{
|
|
5258
|
+
src: user.avatar,
|
|
5259
|
+
alt: user.name,
|
|
5260
|
+
className: "h-8 w-8 rounded-full object-cover"
|
|
5261
|
+
}
|
|
5262
|
+
) : /* @__PURE__ */ jsxRuntime.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) }) }),
|
|
5263
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: expanded && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5264
|
+
framerMotion.motion.div,
|
|
5265
|
+
{
|
|
5266
|
+
initial: { opacity: 0, x: -10 },
|
|
5267
|
+
animate: { opacity: 1, x: 0 },
|
|
5268
|
+
exit: { opacity: 0, x: -10 },
|
|
5269
|
+
transition: { duration: 0.2 },
|
|
5270
|
+
className: "flex flex-1 items-center justify-between",
|
|
5271
|
+
children: [
|
|
5272
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start", children: [
|
|
5273
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium truncate max-w-[120px]", children: user.name }),
|
|
5274
|
+
user.email && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground truncate max-w-[120px]", children: user.email })
|
|
5275
|
+
] }),
|
|
5276
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5277
|
+
lucideReact.ChevronDown,
|
|
5278
|
+
{
|
|
5279
|
+
className: cn(
|
|
5280
|
+
"h-3 w-3 text-muted-foreground transition-transform",
|
|
5281
|
+
menuOpen && "rotate-180"
|
|
5282
|
+
)
|
|
5283
|
+
}
|
|
5284
|
+
)
|
|
5285
|
+
]
|
|
5286
|
+
}
|
|
5287
|
+
) })
|
|
5288
|
+
]
|
|
5289
|
+
}
|
|
5290
|
+
),
|
|
5291
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: menuOpen && expanded && menuItems && menuItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5292
|
+
framerMotion.motion.div,
|
|
5293
|
+
{
|
|
5294
|
+
initial: { opacity: 0, y: -10 },
|
|
5295
|
+
animate: { opacity: 1, y: 0 },
|
|
5296
|
+
exit: { opacity: 0, y: -10 },
|
|
5297
|
+
transition: { duration: 0.15 },
|
|
5298
|
+
className: "absolute bottom-full left-0 right-0 mb-1 overflow-hidden rounded-md border border-border bg-card shadow-lg",
|
|
5299
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-1", children: menuItems.map((item, index) => {
|
|
5300
|
+
const IconComponent = item.icon && isLucideIcon(item.icon) ? item.icon : null;
|
|
5301
|
+
const isDestructive = item.variant === "destructive";
|
|
5302
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React48__namespace.Fragment, { children: [
|
|
5303
|
+
isDestructive && index > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-border" }),
|
|
5304
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5305
|
+
"button",
|
|
5306
|
+
{
|
|
5307
|
+
onClick: () => {
|
|
5308
|
+
item.onClick();
|
|
5309
|
+
setMenuOpen(false);
|
|
5310
|
+
},
|
|
5311
|
+
className: cn(
|
|
5312
|
+
"flex w-full items-center gap-2 px-3 py-1.5 text-xs transition-colors",
|
|
5313
|
+
isDestructive ? "text-destructive hover:bg-destructive/10" : "text-foreground hover:bg-muted"
|
|
5314
|
+
),
|
|
5315
|
+
children: [
|
|
5316
|
+
IconComponent && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "h-3 w-3" }),
|
|
5317
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
|
|
5318
|
+
]
|
|
5319
|
+
}
|
|
5320
|
+
)
|
|
5321
|
+
] }, item.label);
|
|
5322
|
+
}) })
|
|
5323
|
+
}
|
|
5324
|
+
) })
|
|
5325
|
+
] })
|
|
5326
|
+
}
|
|
5327
|
+
);
|
|
5328
|
+
});
|
|
5329
|
+
SidebarFooter.displayName = "Sidebar.Footer";
|
|
5330
|
+
var COLLAPSED_WIDTH = 60;
|
|
5331
|
+
var EXPANDED_WIDTH = 250;
|
|
5332
|
+
function SidebarRoot({
|
|
5333
|
+
children,
|
|
5334
|
+
defaultExpanded = false,
|
|
5335
|
+
defaultPinned = false,
|
|
5336
|
+
collapsedWidth = COLLAPSED_WIDTH,
|
|
5337
|
+
expandedWidth = EXPANDED_WIDTH
|
|
5338
|
+
}) {
|
|
5339
|
+
const [expanded, setExpanded] = React48__namespace.useState(defaultExpanded || defaultPinned);
|
|
5340
|
+
const [pinned, setPinned] = React48__namespace.useState(defaultPinned);
|
|
5341
|
+
const [activeSection, setActiveSection] = React48__namespace.useState(null);
|
|
5342
|
+
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5343
|
+
const handleSetPinned = React48__namespace.useCallback((value) => {
|
|
5344
|
+
setPinned(value);
|
|
5345
|
+
if (value) {
|
|
5346
|
+
setExpanded(true);
|
|
5347
|
+
}
|
|
5348
|
+
}, []);
|
|
5349
|
+
const contextValue = React48__namespace.useMemo(
|
|
5350
|
+
() => ({
|
|
5351
|
+
expanded,
|
|
5352
|
+
setExpanded,
|
|
5353
|
+
pinned,
|
|
5354
|
+
setPinned: handleSetPinned,
|
|
5355
|
+
activeSection,
|
|
5356
|
+
setActiveSection,
|
|
5357
|
+
isMobile,
|
|
5358
|
+
collapsedWidth,
|
|
5359
|
+
expandedWidth
|
|
5360
|
+
}),
|
|
5361
|
+
[expanded, pinned, handleSetPinned, activeSection, isMobile, collapsedWidth, expandedWidth]
|
|
5362
|
+
);
|
|
5363
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SidebarProvider, { value: contextValue, children });
|
|
5364
|
+
}
|
|
5365
|
+
SidebarRoot.displayName = "SidebarRoot";
|
|
5366
|
+
function SidebarAside({ children, className }) {
|
|
5367
|
+
const { expanded, pinned, setExpanded, isMobile, collapsedWidth, expandedWidth } = useSidebar();
|
|
5368
|
+
const sidebarRef = React48__namespace.useRef(null);
|
|
5369
|
+
const handleMouseEnter = React48__namespace.useCallback(() => {
|
|
5370
|
+
if (!pinned && !isMobile) {
|
|
5371
|
+
setExpanded(true);
|
|
5372
|
+
}
|
|
5373
|
+
}, [pinned, isMobile, setExpanded]);
|
|
5374
|
+
const handleMouseLeave = React48__namespace.useCallback(() => {
|
|
5375
|
+
if (!pinned && !isMobile) {
|
|
5376
|
+
setExpanded(false);
|
|
5377
|
+
}
|
|
5378
|
+
}, [pinned, isMobile, setExpanded]);
|
|
5379
|
+
if (isMobile) {
|
|
5380
|
+
return null;
|
|
5381
|
+
}
|
|
5382
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5383
|
+
framerMotion.motion.aside,
|
|
5384
|
+
{
|
|
5385
|
+
ref: sidebarRef,
|
|
5386
|
+
onMouseEnter: handleMouseEnter,
|
|
5387
|
+
onMouseLeave: handleMouseLeave,
|
|
5388
|
+
initial: { width: collapsedWidth },
|
|
5389
|
+
animate: { width: expanded ? expandedWidth : collapsedWidth },
|
|
5390
|
+
transition: {
|
|
5391
|
+
type: "spring",
|
|
5392
|
+
stiffness: 300,
|
|
5393
|
+
damping: 30,
|
|
5394
|
+
mass: 1
|
|
5395
|
+
},
|
|
5396
|
+
className: cn(
|
|
5397
|
+
"relative flex h-screen flex-col bg-card",
|
|
5398
|
+
"shadow-[0_0_20px_rgba(0,0,0,0.06)]",
|
|
5399
|
+
"fixed top-0 left-0 z-50",
|
|
5400
|
+
className
|
|
5401
|
+
),
|
|
5402
|
+
children
|
|
5403
|
+
}
|
|
5404
|
+
);
|
|
5405
|
+
}
|
|
5406
|
+
SidebarAside.displayName = "SidebarAside";
|
|
5407
|
+
function SidebarContent({ children, className }) {
|
|
5408
|
+
const sidebar = useSidebarOptional();
|
|
5409
|
+
if (!sidebar) {
|
|
5410
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children });
|
|
5411
|
+
}
|
|
5412
|
+
const { expanded, pinned, isMobile, collapsedWidth, expandedWidth } = sidebar;
|
|
5413
|
+
if (isMobile) {
|
|
5414
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children });
|
|
5415
|
+
}
|
|
5416
|
+
const marginLeft = pinned && expanded ? expandedWidth : collapsedWidth;
|
|
5417
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5418
|
+
framerMotion.motion.div,
|
|
5419
|
+
{
|
|
5420
|
+
initial: { marginLeft: collapsedWidth },
|
|
5421
|
+
animate: { marginLeft },
|
|
5422
|
+
transition: {
|
|
5423
|
+
type: "spring",
|
|
5424
|
+
stiffness: 300,
|
|
5425
|
+
damping: 30,
|
|
5426
|
+
mass: 1
|
|
5427
|
+
},
|
|
5428
|
+
className: cn("min-h-screen flex flex-col", className),
|
|
5429
|
+
children
|
|
5430
|
+
}
|
|
5431
|
+
);
|
|
5432
|
+
}
|
|
5433
|
+
SidebarContent.displayName = "SidebarContent";
|
|
5434
|
+
function LegacySidebar({
|
|
5435
|
+
children,
|
|
5436
|
+
defaultExpanded = false,
|
|
5437
|
+
defaultPinned = false,
|
|
5438
|
+
collapsedWidth = COLLAPSED_WIDTH,
|
|
5439
|
+
expandedWidth = EXPANDED_WIDTH,
|
|
5440
|
+
className
|
|
5441
|
+
}) {
|
|
5442
|
+
const [expanded, setExpanded] = React48__namespace.useState(defaultExpanded || defaultPinned);
|
|
5443
|
+
const [pinned, setPinned] = React48__namespace.useState(defaultPinned);
|
|
5444
|
+
const [activeSection, setActiveSection] = React48__namespace.useState(null);
|
|
5445
|
+
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5446
|
+
const sidebarRef = React48__namespace.useRef(null);
|
|
5447
|
+
const handleMouseEnter = React48__namespace.useCallback(() => {
|
|
5448
|
+
if (!pinned && !isMobile) {
|
|
5449
|
+
setExpanded(true);
|
|
5450
|
+
}
|
|
5451
|
+
}, [pinned, isMobile]);
|
|
5452
|
+
const handleMouseLeave = React48__namespace.useCallback(() => {
|
|
5453
|
+
if (!pinned && !isMobile) {
|
|
5454
|
+
setExpanded(false);
|
|
5455
|
+
}
|
|
5456
|
+
}, [pinned, isMobile]);
|
|
5457
|
+
const handleSetPinned = React48__namespace.useCallback((value) => {
|
|
5458
|
+
setPinned(value);
|
|
5459
|
+
if (value) {
|
|
5460
|
+
setExpanded(true);
|
|
5461
|
+
}
|
|
5462
|
+
}, []);
|
|
5463
|
+
const contextValue = React48__namespace.useMemo(
|
|
5464
|
+
() => ({
|
|
5465
|
+
expanded,
|
|
5466
|
+
setExpanded,
|
|
5467
|
+
pinned,
|
|
5468
|
+
setPinned: handleSetPinned,
|
|
5469
|
+
activeSection,
|
|
5470
|
+
setActiveSection,
|
|
5471
|
+
isMobile,
|
|
5472
|
+
collapsedWidth,
|
|
5473
|
+
expandedWidth
|
|
5474
|
+
}),
|
|
5475
|
+
[expanded, pinned, handleSetPinned, activeSection, isMobile, collapsedWidth, expandedWidth]
|
|
5476
|
+
);
|
|
5477
|
+
if (isMobile) {
|
|
5478
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SidebarProvider, { value: contextValue, children });
|
|
5479
|
+
}
|
|
5480
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SidebarProvider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5481
|
+
framerMotion.motion.aside,
|
|
5482
|
+
{
|
|
5483
|
+
ref: sidebarRef,
|
|
5484
|
+
onMouseEnter: handleMouseEnter,
|
|
5485
|
+
onMouseLeave: handleMouseLeave,
|
|
5486
|
+
initial: { width: collapsedWidth },
|
|
5487
|
+
animate: { width: expanded ? expandedWidth : collapsedWidth },
|
|
5488
|
+
transition: {
|
|
5489
|
+
type: "spring",
|
|
5490
|
+
stiffness: 300,
|
|
5491
|
+
damping: 30,
|
|
5492
|
+
mass: 1
|
|
5493
|
+
},
|
|
5494
|
+
className: cn(
|
|
5495
|
+
"relative flex h-screen flex-col bg-card",
|
|
5496
|
+
"shadow-[0_0_20px_rgba(0,0,0,0.06)]",
|
|
5497
|
+
"fixed top-0 left-0 z-50",
|
|
5498
|
+
className
|
|
5499
|
+
),
|
|
5500
|
+
children
|
|
5501
|
+
}
|
|
5502
|
+
) });
|
|
5503
|
+
}
|
|
5504
|
+
LegacySidebar.displayName = "Sidebar";
|
|
5505
|
+
var Sidebar = Object.assign(LegacySidebar, {
|
|
5506
|
+
// Layout components
|
|
5507
|
+
Root: SidebarRoot,
|
|
5508
|
+
Aside: SidebarAside,
|
|
5509
|
+
Content: SidebarContent,
|
|
5510
|
+
// Sidebar content components
|
|
5511
|
+
Header: SidebarHeader,
|
|
5512
|
+
Nav: SidebarNav,
|
|
5513
|
+
Section: SidebarSection,
|
|
5514
|
+
NavItem: SidebarNavItem,
|
|
5515
|
+
NavGroup: SidebarNavGroup,
|
|
5516
|
+
Footer: SidebarFooter
|
|
5517
|
+
});
|
|
5518
|
+
function renderIcon3(icon, className) {
|
|
5519
|
+
if (!icon) return null;
|
|
5520
|
+
if (React48__namespace.isValidElement(icon)) {
|
|
5521
|
+
return React48__namespace.cloneElement(icon, { className });
|
|
5522
|
+
}
|
|
5523
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5524
|
+
const IconComponent = icon;
|
|
5525
|
+
return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className });
|
|
5526
|
+
}
|
|
5527
|
+
return null;
|
|
5528
|
+
}
|
|
5529
|
+
var MobileNavItem = React48__namespace.memo(function MobileNavItem2({
|
|
5530
|
+
icon,
|
|
5531
|
+
label,
|
|
5532
|
+
isActive = false,
|
|
5533
|
+
onClick
|
|
5534
|
+
}) {
|
|
5535
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("button", { onClick, className: "group flex flex-col items-center", children: [
|
|
5536
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5537
|
+
"div",
|
|
5538
|
+
{
|
|
5539
|
+
className: cn(
|
|
5540
|
+
"flex items-center justify-center rounded-full p-1.5 transition-colors",
|
|
5541
|
+
isActive ? "text-primary" : "text-muted-foreground group-hover:text-foreground"
|
|
5542
|
+
),
|
|
5543
|
+
children: renderIcon3(icon, "h-5 w-5")
|
|
5544
|
+
}
|
|
5545
|
+
),
|
|
5546
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5547
|
+
"span",
|
|
5548
|
+
{
|
|
5549
|
+
className: cn(
|
|
5550
|
+
"mt-0.5 text-[10px] font-medium",
|
|
5551
|
+
isActive ? "text-primary" : "text-muted-foreground group-hover:text-foreground"
|
|
5552
|
+
),
|
|
5553
|
+
children: label
|
|
5554
|
+
}
|
|
5555
|
+
),
|
|
5556
|
+
isActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5557
|
+
framerMotion.motion.div,
|
|
5558
|
+
{
|
|
5559
|
+
layoutId: "mobileNavActiveIndicator",
|
|
5560
|
+
className: "mt-1 h-1 w-8 rounded-full bg-primary",
|
|
5561
|
+
transition: { type: "spring", stiffness: 500, damping: 30 }
|
|
5562
|
+
}
|
|
5563
|
+
)
|
|
5564
|
+
] });
|
|
5565
|
+
});
|
|
5566
|
+
MobileNavItem.displayName = "MobileNavItem";
|
|
5567
|
+
var MobileNav = React48__namespace.memo(function MobileNav2({
|
|
5568
|
+
items,
|
|
5569
|
+
fabAction,
|
|
5570
|
+
className
|
|
5571
|
+
}) {
|
|
5572
|
+
const leftItems = fabAction ? items.slice(0, Math.ceil(items.length / 2)) : items;
|
|
5573
|
+
const rightItems = fabAction ? items.slice(Math.ceil(items.length / 2)) : [];
|
|
5574
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5575
|
+
"div",
|
|
5576
|
+
{
|
|
5577
|
+
className: cn(
|
|
5578
|
+
"fixed bottom-0 left-0 right-0 z-50 bg-card px-2 pb-2 pt-1.5 md:hidden",
|
|
5579
|
+
"border-t border-border",
|
|
5580
|
+
className
|
|
5581
|
+
),
|
|
5582
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-around", children: [
|
|
5583
|
+
leftItems.map((item, index) => /* @__PURE__ */ jsxRuntime.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
|
+
`left-${index}-${item.label}`
|
|
5598
|
+
)),
|
|
5599
|
+
fabAction && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative -mt-5", children: [
|
|
5600
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5601
|
+
"button",
|
|
5602
|
+
{
|
|
5603
|
+
onClick: fabAction.onClick,
|
|
5604
|
+
className: cn(
|
|
5605
|
+
"flex h-14 w-14 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg",
|
|
5606
|
+
"transition-transform hover:bg-primary/90 active:scale-95"
|
|
5607
|
+
),
|
|
5608
|
+
"aria-label": fabAction.label,
|
|
5609
|
+
children: fabAction.icon
|
|
5610
|
+
}
|
|
5611
|
+
),
|
|
5612
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1 block text-center text-[10px] font-medium text-muted-foreground", children: fabAction.label })
|
|
5613
|
+
] }),
|
|
5614
|
+
rightItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5615
|
+
MobileNavItem,
|
|
5616
|
+
{
|
|
5617
|
+
icon: item.icon,
|
|
5618
|
+
label: item.label,
|
|
5619
|
+
isActive: item.isActive,
|
|
5620
|
+
onClick: () => {
|
|
5621
|
+
if (item.onClick) {
|
|
5622
|
+
item.onClick();
|
|
5623
|
+
} else if (item.href && typeof window !== "undefined") {
|
|
5624
|
+
window.location.href = item.href;
|
|
5625
|
+
}
|
|
5626
|
+
}
|
|
5627
|
+
},
|
|
5628
|
+
`right-${index}-${item.label}`
|
|
5629
|
+
))
|
|
5630
|
+
] })
|
|
5631
|
+
}
|
|
5632
|
+
);
|
|
5633
|
+
});
|
|
5634
|
+
MobileNav.displayName = "MobileNav";
|
|
5635
|
+
var Navbar = React48__namespace.memo(function Navbar2({
|
|
5636
|
+
children,
|
|
5637
|
+
className,
|
|
5638
|
+
style
|
|
5639
|
+
}) {
|
|
5640
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5641
|
+
"nav",
|
|
5642
|
+
{
|
|
5643
|
+
className: cn(
|
|
5644
|
+
"fixed top-0 right-0 bg-card border-b/50 h-16 z-40 w-full shadow-sm",
|
|
5645
|
+
className
|
|
5646
|
+
),
|
|
5647
|
+
style,
|
|
5648
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full px-4 sm:px-6 lg:pr-8 lg:pl-20", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-between items-center h-full", children }) })
|
|
5649
|
+
}
|
|
5650
|
+
);
|
|
5651
|
+
});
|
|
5652
|
+
Navbar.displayName = "Navbar";
|
|
5653
|
+
function ThemeToggle({ className }) {
|
|
5654
|
+
const [isDark, setIsDark] = React48__namespace.useState(false);
|
|
5655
|
+
React48__namespace.useEffect(() => {
|
|
5656
|
+
const isDarkMode = document.documentElement.classList.contains("dark");
|
|
5657
|
+
setIsDark(isDarkMode);
|
|
5658
|
+
}, []);
|
|
5659
|
+
const toggleTheme = () => {
|
|
5660
|
+
setIsDark(!isDark);
|
|
5661
|
+
if (isDark) {
|
|
5662
|
+
document.documentElement.classList.remove("dark");
|
|
5663
|
+
document.documentElement.style.colorScheme = "light";
|
|
5664
|
+
} else {
|
|
5665
|
+
document.documentElement.classList.add("dark");
|
|
5666
|
+
document.documentElement.style.colorScheme = "dark";
|
|
5667
|
+
}
|
|
5668
|
+
};
|
|
5669
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5670
|
+
Button,
|
|
5671
|
+
{
|
|
5672
|
+
variant: "ghost",
|
|
5673
|
+
size: "icon",
|
|
5674
|
+
onClick: toggleTheme,
|
|
5675
|
+
"aria-label": "Alternar tema",
|
|
5676
|
+
className,
|
|
5677
|
+
children: [
|
|
5678
|
+
isDark ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { className: "h-[1.2rem] w-[1.2rem] text-muted-foreground transition-all" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { className: "h-[1.2rem] w-[1.2rem] text-muted-foreground transition-all" }),
|
|
5679
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Alternar tema" })
|
|
5680
|
+
]
|
|
5681
|
+
}
|
|
5682
|
+
);
|
|
5683
|
+
}
|
|
5684
|
+
ThemeToggle.displayName = "ThemeToggle";
|
|
5685
|
+
function NavbarNotification({
|
|
5686
|
+
notifications = [],
|
|
5687
|
+
onMarkAllAsRead,
|
|
5688
|
+
onViewAll
|
|
5689
|
+
}) {
|
|
5690
|
+
const hasNotifications = notifications.length > 0;
|
|
5691
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
5692
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "icon", className: "rounded-full relative", children: [
|
|
5693
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bell, { className: "h-5 w-5 text-muted-foreground" }),
|
|
5694
|
+
hasNotifications && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500" }),
|
|
5695
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Abrir notifica\xE7\xF5es" })
|
|
5696
|
+
] }) }),
|
|
5697
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-[400px] p-0", align: "end", children: /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "border-0 shadow-none", children: [
|
|
5698
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
5699
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardTitle, { className: "text-xl font-bold", children: "Notifica\xE7\xF5es" }),
|
|
5700
|
+
onMarkAllAsRead && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5701
|
+
Button,
|
|
5702
|
+
{
|
|
5703
|
+
variant: "link",
|
|
5704
|
+
className: "text-primary hover:text-primary/80",
|
|
5705
|
+
onClick: onMarkAllAsRead,
|
|
5706
|
+
children: "Marcar todas como lidas"
|
|
5707
|
+
}
|
|
5708
|
+
)
|
|
5709
|
+
] }),
|
|
5710
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "px-0", children: notifications.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-8 text-center text-muted-foreground", children: "Nenhuma notifica\xE7\xE3o" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5711
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-background/30 px-6 py-2 text-sm font-medium text-gray-500", children: "Hoje" }),
|
|
5712
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4 px-6 py-3", children: notifications.map((notification) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5713
|
+
"div",
|
|
5714
|
+
{
|
|
5715
|
+
className: `flex items-start space-x-4 ${notification.isHighlighted ? "rounded-lg bg-primary/5 p-3" : ""}`,
|
|
5716
|
+
children: [
|
|
5717
|
+
notification.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5718
|
+
"div",
|
|
5719
|
+
{
|
|
5720
|
+
className: `mt-1 rounded-full p-2 ${notification.isHighlighted ? "bg-primary/25" : "bg-gray-500/20"}`,
|
|
5721
|
+
children: notification.icon
|
|
5722
|
+
}
|
|
5723
|
+
),
|
|
5724
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
5725
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: notification.title }),
|
|
5726
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500", children: notification.description }),
|
|
5727
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-gray-400", children: notification.time })
|
|
5728
|
+
] })
|
|
5729
|
+
]
|
|
5730
|
+
},
|
|
5731
|
+
notification.id
|
|
5732
|
+
)) })
|
|
5733
|
+
] }) }),
|
|
5734
|
+
onViewAll && /* @__PURE__ */ jsxRuntime.jsx(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5735
|
+
Button,
|
|
5736
|
+
{
|
|
5737
|
+
variant: "link",
|
|
5738
|
+
className: "text-primary hover:text-primary/80",
|
|
5739
|
+
onClick: onViewAll,
|
|
5740
|
+
children: "Ver todas notifica\xE7\xF5es"
|
|
5741
|
+
}
|
|
5742
|
+
) })
|
|
5743
|
+
] }) })
|
|
5744
|
+
] });
|
|
5745
|
+
}
|
|
5746
|
+
NavbarNotification.displayName = "NavbarNotification";
|
|
5747
|
+
var ScrollArea = React48__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5748
|
+
ScrollAreaPrimitive__namespace.Root,
|
|
5749
|
+
{
|
|
5750
|
+
ref,
|
|
5751
|
+
className: cn("relative overflow-hidden", className),
|
|
5752
|
+
...props,
|
|
5753
|
+
children: [
|
|
5754
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
5755
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, {}),
|
|
5756
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
|
|
5757
|
+
]
|
|
5758
|
+
}
|
|
5759
|
+
));
|
|
5760
|
+
ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
|
|
5761
|
+
var ScrollBar = React48__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5762
|
+
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
5763
|
+
{
|
|
5764
|
+
ref,
|
|
5765
|
+
orientation,
|
|
5766
|
+
className: cn(
|
|
5767
|
+
"flex touch-none select-none transition-colors",
|
|
5768
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
5769
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
5770
|
+
className
|
|
5771
|
+
),
|
|
5772
|
+
...props,
|
|
5773
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
5774
|
+
}
|
|
5775
|
+
));
|
|
5776
|
+
ScrollBar.displayName = ScrollAreaPrimitive__namespace.ScrollAreaScrollbar.displayName;
|
|
5777
|
+
var Separator3 = React48__namespace.forwardRef(
|
|
5778
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5779
|
+
SeparatorPrimitive__namespace.Root,
|
|
5780
|
+
{
|
|
5781
|
+
ref,
|
|
5782
|
+
decorative,
|
|
5783
|
+
orientation,
|
|
5784
|
+
className: cn(
|
|
5785
|
+
"shrink-0 bg-border",
|
|
5786
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
5787
|
+
className
|
|
5788
|
+
),
|
|
5789
|
+
...props
|
|
5790
|
+
}
|
|
5791
|
+
)
|
|
5792
|
+
);
|
|
5793
|
+
Separator3.displayName = SeparatorPrimitive__namespace.Root.displayName;
|
|
5794
|
+
function getInitials2(name) {
|
|
5795
|
+
return name.slice(0, 2).toUpperCase();
|
|
5796
|
+
}
|
|
5797
|
+
function defaultFormatCnpj(cnpj) {
|
|
5798
|
+
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);
|
|
5799
|
+
}
|
|
5800
|
+
function NavbarCompanyProfile({
|
|
5801
|
+
companies,
|
|
5802
|
+
activeCompanyId,
|
|
5803
|
+
onCompanySelect,
|
|
5804
|
+
isLoading = false,
|
|
5805
|
+
formatCnpj = defaultFormatCnpj
|
|
5806
|
+
}) {
|
|
5807
|
+
const currentCompany = companies.find(
|
|
5808
|
+
(company) => company.id === activeCompanyId
|
|
5809
|
+
);
|
|
5810
|
+
if (!currentCompany) {
|
|
5811
|
+
return isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Loader, { variant: "dots" }) : null;
|
|
5812
|
+
}
|
|
5813
|
+
const handleCompanyClick = (companyId) => {
|
|
5814
|
+
if (onCompanySelect) {
|
|
5815
|
+
onCompanySelect(companyId);
|
|
5816
|
+
}
|
|
5817
|
+
};
|
|
5818
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3 bg-primary/5 text-primary px-2 py-1 rounded-md", children: [
|
|
5819
|
+
/* @__PURE__ */ jsxRuntime.jsx(Avatar, { className: "h-10 w-10 bg-primary/20", children: /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { className: "font-semibold", children: getInitials2(currentCompany.name) }) }),
|
|
5820
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden sm:flex sm:flex-col sm:flex-grow", children: [
|
|
5821
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-sm", children: currentCompany.name }),
|
|
5822
|
+
currentCompany.cnpj && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-primary/70", children: formatCnpj(currentCompany.cnpj) })
|
|
5823
|
+
] }),
|
|
5824
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
5825
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5826
|
+
Button,
|
|
5827
|
+
{
|
|
5828
|
+
variant: "ghost",
|
|
5829
|
+
size: "sm",
|
|
5830
|
+
className: "h-8 px-2 text-primary hover:bg-primary/20",
|
|
5831
|
+
children: [
|
|
5832
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Abrir menu de empresas" }),
|
|
5833
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
|
|
5834
|
+
]
|
|
5835
|
+
}
|
|
5836
|
+
) }),
|
|
5837
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { className: "w-80 p-0", align: "end", children: [
|
|
5838
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-primary/5 p-4 rounded-t-lg", children: [
|
|
5839
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-sm mb-1", children: "Empresas Vinculadas" }),
|
|
5840
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Selecione para mudar de empresa" })
|
|
5841
|
+
] }),
|
|
5842
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "h-64", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4", children: [
|
|
5843
|
+
isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ jsxRuntime.jsx(Loader, { variant: "spinner" }) }),
|
|
5844
|
+
!isLoading && companies.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-center text-muted-foreground", children: "Nenhuma empresa encontrada." }),
|
|
5845
|
+
companies.map((company, index) => /* @__PURE__ */ jsxRuntime.jsxs(React48__namespace.Fragment, { children: [
|
|
5846
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5847
|
+
Button,
|
|
5848
|
+
{
|
|
5849
|
+
variant: "ghost",
|
|
5850
|
+
className: "w-full justify-start text-sm mb-1 hover:bg-primary/10",
|
|
5851
|
+
onClick: () => handleCompanyClick(company.id),
|
|
5852
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center w-full", children: [
|
|
5853
|
+
/* @__PURE__ */ jsxRuntime.jsx(Avatar, { className: "h-8 w-8 mr-3", children: /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { className: "bg-primary/20 text-primary text-xs", children: getInitials2(company.name) }) }),
|
|
5854
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-grow text-left", children: [
|
|
5855
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: company.name }),
|
|
5856
|
+
company.cnpj && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: formatCnpj(company.cnpj) })
|
|
5857
|
+
] }),
|
|
5858
|
+
company.id === activeCompanyId && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-4 w-4 text-primary ml-2" })
|
|
5859
|
+
] })
|
|
5860
|
+
}
|
|
5861
|
+
),
|
|
5862
|
+
index < companies.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(Separator3, { className: "my-2" })
|
|
5863
|
+
] }, company.id))
|
|
5864
|
+
] }) })
|
|
5865
|
+
] })
|
|
5866
|
+
] })
|
|
5867
|
+
] }) });
|
|
5868
|
+
}
|
|
5869
|
+
NavbarCompanyProfile.displayName = "NavbarCompanyProfile";
|
|
5870
|
+
function getInitials3(name) {
|
|
5871
|
+
return name.split(" ").map((part) => part[0]).join("").toUpperCase().slice(0, 2);
|
|
5872
|
+
}
|
|
5873
|
+
var defaultMenuItems = [
|
|
5874
|
+
{ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "h-4 w-4" }), label: "Ver Perfil" },
|
|
5875
|
+
{ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "h-4 w-4" }), label: "Configura\xE7\xF5es" },
|
|
5876
|
+
{ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bell, { className: "h-4 w-4" }), label: "Atualiza\xE7\xF5es" },
|
|
5877
|
+
{ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "h-4 w-4" }), label: "Sair", variant: "destructive" }
|
|
5878
|
+
];
|
|
5879
|
+
function NavbarUserMenu({
|
|
5880
|
+
name,
|
|
5881
|
+
email,
|
|
5882
|
+
avatarUrl,
|
|
5883
|
+
isCollapsed = false,
|
|
5884
|
+
menuItems = defaultMenuItems,
|
|
5885
|
+
children
|
|
5886
|
+
}) {
|
|
5887
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
5888
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", className: "w-full justify-start p-2", children: [
|
|
5889
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Avatar, { className: "h-8 w-8", children: [
|
|
5890
|
+
avatarUrl && /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: avatarUrl, alt: name }),
|
|
5891
|
+
/* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { children: getInitials3(name) })
|
|
5892
|
+
] }),
|
|
5893
|
+
!isCollapsed && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-2 text-left", children: [
|
|
5894
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: name }),
|
|
5895
|
+
email && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: email })
|
|
5896
|
+
] })
|
|
5897
|
+
] }) }),
|
|
5898
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-56 p-2", align: "end", children: children ? children : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: menuItems.map((item, index) => {
|
|
5899
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5900
|
+
Button,
|
|
5901
|
+
{
|
|
5902
|
+
variant: "ghost",
|
|
5903
|
+
className: `w-full justify-start text-sm ${item.variant === "destructive" ? "text-red-500" : ""}`,
|
|
5904
|
+
onClick: item.onClick,
|
|
5905
|
+
children: [
|
|
5906
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2", children: item.icon }),
|
|
5907
|
+
item.label
|
|
5908
|
+
]
|
|
5909
|
+
},
|
|
5910
|
+
index
|
|
5911
|
+
);
|
|
5912
|
+
if (item.href) {
|
|
5913
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5914
|
+
"a",
|
|
5915
|
+
{
|
|
5916
|
+
href: item.href,
|
|
5917
|
+
className: "flex flex-col items-center text-center",
|
|
5918
|
+
children: content
|
|
5919
|
+
},
|
|
5920
|
+
index
|
|
5921
|
+
);
|
|
5922
|
+
}
|
|
5923
|
+
return content;
|
|
5924
|
+
}) }) })
|
|
5925
|
+
] });
|
|
5926
|
+
}
|
|
5927
|
+
NavbarUserMenu.displayName = "NavbarUserMenu";
|
|
5928
|
+
var Breadcrumb = React48__namespace.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
5929
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
5930
|
+
var BreadcrumbList = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5931
|
+
"ol",
|
|
5932
|
+
{
|
|
5933
|
+
ref,
|
|
5934
|
+
className: cn(
|
|
5935
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
5936
|
+
className
|
|
5937
|
+
),
|
|
5938
|
+
...props
|
|
5939
|
+
}
|
|
5940
|
+
));
|
|
5941
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
5942
|
+
var BreadcrumbItem = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5943
|
+
"li",
|
|
5944
|
+
{
|
|
5945
|
+
ref,
|
|
5946
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
5947
|
+
...props
|
|
5948
|
+
}
|
|
5949
|
+
));
|
|
5950
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
5951
|
+
var BreadcrumbLink = React48__namespace.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
5952
|
+
const Comp = asChild ? reactSlot.Slot : "a";
|
|
5953
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5954
|
+
Comp,
|
|
5955
|
+
{
|
|
5956
|
+
ref,
|
|
5957
|
+
className: cn("transition-colors hover:text-foreground", className),
|
|
5958
|
+
...props
|
|
5959
|
+
}
|
|
5960
|
+
);
|
|
5961
|
+
});
|
|
5962
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
5963
|
+
var BreadcrumbPage = React48__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5964
|
+
"span",
|
|
5965
|
+
{
|
|
5966
|
+
ref,
|
|
5967
|
+
role: "link",
|
|
5968
|
+
"aria-disabled": "true",
|
|
5969
|
+
"aria-current": "page",
|
|
5970
|
+
className: cn("font-semibold text-primary", className),
|
|
5971
|
+
...props
|
|
5972
|
+
}
|
|
5973
|
+
));
|
|
5974
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
5975
|
+
var BreadcrumbSeparator = ({
|
|
5976
|
+
children,
|
|
5977
|
+
className,
|
|
5978
|
+
...props
|
|
5979
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5980
|
+
"li",
|
|
5981
|
+
{
|
|
5982
|
+
role: "presentation",
|
|
5983
|
+
"aria-hidden": "true",
|
|
5984
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
5985
|
+
...props,
|
|
5986
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {})
|
|
5987
|
+
}
|
|
5988
|
+
);
|
|
5989
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
5990
|
+
var BreadcrumbEllipsis = ({
|
|
5991
|
+
className,
|
|
5992
|
+
...props
|
|
5993
|
+
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5994
|
+
"span",
|
|
5995
|
+
{
|
|
5996
|
+
role: "presentation",
|
|
5997
|
+
"aria-hidden": "true",
|
|
5998
|
+
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
5999
|
+
...props,
|
|
6000
|
+
children: [
|
|
6001
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" }),
|
|
6002
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More" })
|
|
6003
|
+
]
|
|
6004
|
+
}
|
|
6005
|
+
);
|
|
6006
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
6007
|
+
function SectionHeaderRoot({
|
|
6008
|
+
children,
|
|
6009
|
+
className,
|
|
6010
|
+
gradient = true,
|
|
6011
|
+
bordered = true,
|
|
6012
|
+
...props
|
|
6013
|
+
}) {
|
|
6014
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6015
|
+
"div",
|
|
6016
|
+
{
|
|
6017
|
+
className: cn(
|
|
6018
|
+
"px-6 py-4",
|
|
6019
|
+
gradient && "bg-gradient-to-r from-primary/5 to-transparent",
|
|
6020
|
+
bordered && "border-b border-border/50",
|
|
6021
|
+
className
|
|
6022
|
+
),
|
|
6023
|
+
...props,
|
|
6024
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between gap-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 min-w-0 flex-1", children }) })
|
|
6025
|
+
}
|
|
6026
|
+
);
|
|
6027
|
+
}
|
|
6028
|
+
SectionHeaderRoot.displayName = "SectionHeader";
|
|
6029
|
+
function SectionHeaderIcon({ icon: Icon2, className }) {
|
|
6030
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("p-2.5 rounded-xl bg-primary/10 shrink-0", className), children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-5 w-5 text-primary" }) });
|
|
6031
|
+
}
|
|
6032
|
+
SectionHeaderIcon.displayName = "SectionHeader.Icon";
|
|
6033
|
+
function SectionHeaderContent({ children, className, ...props }) {
|
|
6034
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-w-0 flex-1", className), ...props, children });
|
|
6035
|
+
}
|
|
6036
|
+
SectionHeaderContent.displayName = "SectionHeader.Content";
|
|
6037
|
+
function SectionHeaderTitle({ children, className, ...props }) {
|
|
6038
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6039
|
+
"h3",
|
|
6040
|
+
{
|
|
6041
|
+
className: cn("font-semibold text-foreground truncate", className),
|
|
6042
|
+
...props,
|
|
6043
|
+
children
|
|
6044
|
+
}
|
|
6045
|
+
);
|
|
6046
|
+
}
|
|
6047
|
+
SectionHeaderTitle.displayName = "SectionHeader.Title";
|
|
6048
|
+
function SectionHeaderSubtitle({ children, className, ...props }) {
|
|
6049
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6050
|
+
"p",
|
|
6051
|
+
{
|
|
6052
|
+
className: cn("text-sm text-muted-foreground truncate", className),
|
|
6053
|
+
...props,
|
|
6054
|
+
children
|
|
6055
|
+
}
|
|
6056
|
+
);
|
|
6057
|
+
}
|
|
6058
|
+
SectionHeaderSubtitle.displayName = "SectionHeader.Subtitle";
|
|
6059
|
+
function SectionHeaderActions({ children, className, ...props }) {
|
|
6060
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6061
|
+
"div",
|
|
6062
|
+
{
|
|
6063
|
+
className: cn("flex items-center gap-2 shrink-0 ml-auto", className),
|
|
6064
|
+
...props,
|
|
6065
|
+
children
|
|
6066
|
+
}
|
|
6067
|
+
);
|
|
6068
|
+
}
|
|
6069
|
+
SectionHeaderActions.displayName = "SectionHeader.Actions";
|
|
6070
|
+
function SectionHeaderBadge({
|
|
6071
|
+
children,
|
|
6072
|
+
className,
|
|
6073
|
+
variant = "muted",
|
|
6074
|
+
...props
|
|
6075
|
+
}) {
|
|
6076
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6077
|
+
"span",
|
|
6078
|
+
{
|
|
6079
|
+
className: cn(
|
|
6080
|
+
"text-xs px-2 py-1 rounded-full shrink-0",
|
|
6081
|
+
variant === "muted" && "bg-muted text-muted-foreground",
|
|
6082
|
+
variant === "default" && "bg-primary/10 text-primary",
|
|
6083
|
+
className
|
|
6084
|
+
),
|
|
6085
|
+
...props,
|
|
6086
|
+
children
|
|
6087
|
+
}
|
|
6088
|
+
);
|
|
6089
|
+
}
|
|
6090
|
+
SectionHeaderBadge.displayName = "SectionHeader.Badge";
|
|
6091
|
+
var SectionHeader = Object.assign(SectionHeaderRoot, {
|
|
6092
|
+
Icon: SectionHeaderIcon,
|
|
6093
|
+
Content: SectionHeaderContent,
|
|
6094
|
+
Title: SectionHeaderTitle,
|
|
6095
|
+
Subtitle: SectionHeaderSubtitle,
|
|
6096
|
+
Actions: SectionHeaderActions,
|
|
6097
|
+
Badge: SectionHeaderBadge
|
|
6098
|
+
});
|
|
6099
|
+
var KanbanContext = React48__namespace.createContext(null);
|
|
6100
|
+
function useKanban() {
|
|
6101
|
+
const context = React48__namespace.useContext(KanbanContext);
|
|
6102
|
+
if (!context) {
|
|
6103
|
+
throw new Error("useKanban must be used within a Kanban.Board component");
|
|
6104
|
+
}
|
|
6105
|
+
return context;
|
|
6106
|
+
}
|
|
6107
|
+
function useKanbanOptional() {
|
|
6108
|
+
return React48__namespace.useContext(KanbanContext);
|
|
6109
|
+
}
|
|
6110
|
+
function KanbanProvider({ children, value }) {
|
|
6111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(KanbanContext.Provider, { value, children });
|
|
6112
|
+
}
|
|
6113
|
+
function KanbanBoard({
|
|
6114
|
+
children,
|
|
6115
|
+
onDragEnd,
|
|
6116
|
+
onDragStart,
|
|
6117
|
+
className
|
|
6118
|
+
}) {
|
|
6119
|
+
const [isDragging, setIsDragging] = React48__namespace.useState(false);
|
|
6120
|
+
const [draggedItemId, setDraggedItemId] = React48__namespace.useState(null);
|
|
6121
|
+
const [sourceColumnId, setSourceColumnId] = React48__namespace.useState(null);
|
|
6122
|
+
const [hoveredColumnId, setHoveredColumnId] = React48__namespace.useState(null);
|
|
6123
|
+
const dropValidatorsRef = React48__namespace.useRef(/* @__PURE__ */ new Map());
|
|
6124
|
+
const registerDropValidator = React48__namespace.useCallback((columnId, validator) => {
|
|
6125
|
+
dropValidatorsRef.current.set(columnId, validator);
|
|
6126
|
+
}, []);
|
|
6127
|
+
const unregisterDropValidator = React48__namespace.useCallback((columnId) => {
|
|
6128
|
+
dropValidatorsRef.current.delete(columnId);
|
|
6129
|
+
}, []);
|
|
6130
|
+
const canDropInColumn = React48__namespace.useCallback((columnId) => {
|
|
6131
|
+
if (!draggedItemId || !sourceColumnId) return false;
|
|
6132
|
+
if (columnId === sourceColumnId) return false;
|
|
6133
|
+
const validator = dropValidatorsRef.current.get(columnId);
|
|
6134
|
+
if (validator) {
|
|
6135
|
+
return validator(draggedItemId, sourceColumnId);
|
|
6136
|
+
}
|
|
6137
|
+
return true;
|
|
6138
|
+
}, [draggedItemId, sourceColumnId]);
|
|
6139
|
+
const handleDragStart = React48__namespace.useCallback((itemId, colId) => {
|
|
6140
|
+
setIsDragging(true);
|
|
6141
|
+
setDraggedItemId(itemId);
|
|
6142
|
+
setSourceColumnId(colId);
|
|
6143
|
+
onDragStart?.(itemId, colId);
|
|
6144
|
+
}, [onDragStart]);
|
|
6145
|
+
const handleDrop = React48__namespace.useCallback((destinationColumnId) => {
|
|
6146
|
+
if (draggedItemId && sourceColumnId && destinationColumnId !== sourceColumnId) {
|
|
6147
|
+
if (canDropInColumn(destinationColumnId)) {
|
|
6148
|
+
const result = {
|
|
6149
|
+
itemId: draggedItemId,
|
|
6150
|
+
sourceColumnId,
|
|
6151
|
+
destinationColumnId
|
|
6152
|
+
};
|
|
6153
|
+
onDragEnd?.(result);
|
|
6154
|
+
}
|
|
6155
|
+
}
|
|
6156
|
+
setIsDragging(false);
|
|
6157
|
+
setDraggedItemId(null);
|
|
6158
|
+
setSourceColumnId(null);
|
|
6159
|
+
setHoveredColumnId(null);
|
|
6160
|
+
}, [draggedItemId, sourceColumnId, canDropInColumn, onDragEnd]);
|
|
6161
|
+
const handleDragEnd = React48__namespace.useCallback(() => {
|
|
6162
|
+
setIsDragging(false);
|
|
6163
|
+
setDraggedItemId(null);
|
|
6164
|
+
setSourceColumnId(null);
|
|
6165
|
+
setHoveredColumnId(null);
|
|
6166
|
+
}, []);
|
|
6167
|
+
const contextValue = React48__namespace.useMemo(() => ({
|
|
6168
|
+
isDragging,
|
|
6169
|
+
draggedItemId,
|
|
6170
|
+
sourceColumnId,
|
|
6171
|
+
hoveredColumnId,
|
|
6172
|
+
setHoveredColumnId,
|
|
6173
|
+
canDropInColumn,
|
|
6174
|
+
registerDropValidator,
|
|
6175
|
+
unregisterDropValidator
|
|
6176
|
+
}), [isDragging, draggedItemId, sourceColumnId, hoveredColumnId, canDropInColumn, registerDropValidator, unregisterDropValidator]);
|
|
6177
|
+
return /* @__PURE__ */ jsxRuntime.jsx(KanbanProvider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6178
|
+
"div",
|
|
6179
|
+
{
|
|
6180
|
+
className: cn(
|
|
6181
|
+
"flex gap-4 overflow-x-auto pb-4",
|
|
6182
|
+
className
|
|
6183
|
+
),
|
|
6184
|
+
onDragEnd: handleDragEnd,
|
|
6185
|
+
"data-kanban-board": true,
|
|
6186
|
+
"data-onstart": handleDragStart.toString(),
|
|
6187
|
+
"data-ondrop": handleDrop.toString(),
|
|
6188
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(KanbanBoardInternalContext.Provider, { value: { handleDragStart, handleDrop }, children })
|
|
6189
|
+
}
|
|
6190
|
+
) });
|
|
6191
|
+
}
|
|
6192
|
+
var KanbanBoardInternalContext = React48__namespace.createContext(null);
|
|
6193
|
+
function useKanbanBoard() {
|
|
6194
|
+
const context = React48__namespace.useContext(KanbanBoardInternalContext);
|
|
6195
|
+
if (!context) {
|
|
6196
|
+
throw new Error("useKanbanBoard must be used within a Kanban.Board component");
|
|
6197
|
+
}
|
|
6198
|
+
return context;
|
|
6199
|
+
}
|
|
6200
|
+
KanbanBoard.displayName = "KanbanBoard";
|
|
6201
|
+
function KanbanColumn({
|
|
6202
|
+
id,
|
|
6203
|
+
title,
|
|
6204
|
+
count,
|
|
6205
|
+
children,
|
|
6206
|
+
className,
|
|
6207
|
+
headerClassName,
|
|
6208
|
+
emptyMessage = "Nenhum item",
|
|
6209
|
+
footer,
|
|
6210
|
+
canDrop
|
|
6211
|
+
}) {
|
|
6212
|
+
const { isDragging, sourceColumnId, hoveredColumnId, setHoveredColumnId, canDropInColumn, registerDropValidator, unregisterDropValidator } = useKanban();
|
|
6213
|
+
const { handleDrop } = useKanbanBoard();
|
|
6214
|
+
React48__namespace.useEffect(() => {
|
|
6215
|
+
if (canDrop) {
|
|
6216
|
+
registerDropValidator(id, canDrop);
|
|
6217
|
+
return () => unregisterDropValidator(id);
|
|
6218
|
+
}
|
|
6219
|
+
}, [id, canDrop, registerDropValidator, unregisterDropValidator]);
|
|
6220
|
+
const isValidDropTarget = isDragging && sourceColumnId !== id && canDropInColumn(id);
|
|
6221
|
+
const isInvalidDropTarget = isDragging && sourceColumnId !== id && !canDropInColumn(id);
|
|
6222
|
+
const isHovered = hoveredColumnId === id;
|
|
6223
|
+
const handleDragOver = React48__namespace.useCallback((e) => {
|
|
6224
|
+
e.preventDefault();
|
|
6225
|
+
if (isValidDropTarget) {
|
|
6226
|
+
e.dataTransfer.dropEffect = "move";
|
|
6227
|
+
setHoveredColumnId(id);
|
|
6228
|
+
} else {
|
|
6229
|
+
e.dataTransfer.dropEffect = "none";
|
|
6230
|
+
}
|
|
6231
|
+
}, [isValidDropTarget, setHoveredColumnId, id]);
|
|
6232
|
+
const handleDragLeave = React48__namespace.useCallback((e) => {
|
|
6233
|
+
if (e.currentTarget === e.target || !e.currentTarget.contains(e.relatedTarget)) {
|
|
6234
|
+
setHoveredColumnId(null);
|
|
6235
|
+
}
|
|
6236
|
+
}, [setHoveredColumnId]);
|
|
6237
|
+
const handleDropEvent = React48__namespace.useCallback((e) => {
|
|
6238
|
+
e.preventDefault();
|
|
6239
|
+
if (isValidDropTarget) {
|
|
6240
|
+
handleDrop(id);
|
|
6241
|
+
}
|
|
6242
|
+
}, [isValidDropTarget, handleDrop, id]);
|
|
6243
|
+
const childCount = React48__namespace.Children.count(children);
|
|
6244
|
+
const displayCount = count ?? childCount;
|
|
6245
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6246
|
+
"div",
|
|
6247
|
+
{
|
|
6248
|
+
className: cn(
|
|
6249
|
+
"flex flex-col min-w-[300px] max-w-[340px] rounded-2xl",
|
|
6250
|
+
"bg-muted/20 dark:bg-muted/10",
|
|
6251
|
+
"transition-all duration-200",
|
|
6252
|
+
isValidDropTarget && "ring-2 ring-primary/40 bg-primary/5",
|
|
6253
|
+
isInvalidDropTarget && "opacity-40",
|
|
6254
|
+
isHovered && isValidDropTarget && "ring-primary/60 bg-primary/10 scale-[1.01]",
|
|
6255
|
+
className
|
|
6256
|
+
),
|
|
6257
|
+
onDragOver: handleDragOver,
|
|
6258
|
+
onDragLeave: handleDragLeave,
|
|
6259
|
+
onDrop: handleDropEvent,
|
|
6260
|
+
"data-kanban-column": id,
|
|
6261
|
+
children: [
|
|
6262
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6263
|
+
"div",
|
|
6264
|
+
{
|
|
6265
|
+
className: cn(
|
|
6266
|
+
"flex items-center gap-2 px-4 py-3",
|
|
6267
|
+
headerClassName
|
|
6268
|
+
),
|
|
6269
|
+
children: [
|
|
6270
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u21BB" }),
|
|
6271
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-foreground flex-1", children: title }),
|
|
6272
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: displayCount }),
|
|
6273
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { className: "p-1 rounded-md hover:bg-muted/50 text-muted-foreground transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: "\u22EF" }) }),
|
|
6274
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { className: "p-1 rounded-md hover:bg-muted/50 text-muted-foreground transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: "+" }) })
|
|
6275
|
+
]
|
|
6276
|
+
}
|
|
6277
|
+
),
|
|
6278
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6279
|
+
"div",
|
|
6280
|
+
{
|
|
6281
|
+
className: cn(
|
|
6282
|
+
"flex-1 px-2 pb-2 space-y-3 min-h-[200px] max-h-[calc(100vh-200px)] overflow-y-auto",
|
|
6283
|
+
isHovered && isValidDropTarget && "bg-primary/5"
|
|
6284
|
+
),
|
|
6285
|
+
children: childCount === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-32 text-sm text-muted-foreground/60", children: emptyMessage }) : children
|
|
6286
|
+
}
|
|
6287
|
+
),
|
|
6288
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 pb-3", children: footer })
|
|
6289
|
+
]
|
|
6290
|
+
}
|
|
6291
|
+
);
|
|
6292
|
+
}
|
|
6293
|
+
KanbanColumn.displayName = "KanbanColumn";
|
|
6294
|
+
function KanbanCard({
|
|
6295
|
+
id,
|
|
6296
|
+
columnId,
|
|
6297
|
+
children,
|
|
6298
|
+
className,
|
|
6299
|
+
disabled = false
|
|
6300
|
+
}) {
|
|
6301
|
+
const { draggedItemId } = useKanban();
|
|
6302
|
+
const { handleDragStart } = useKanbanBoard();
|
|
6303
|
+
const isThisCardDragging = draggedItemId === id;
|
|
6304
|
+
const handleDragStartEvent = React48__namespace.useCallback((e) => {
|
|
6305
|
+
if (disabled) {
|
|
6306
|
+
e.preventDefault();
|
|
6307
|
+
return;
|
|
6308
|
+
}
|
|
6309
|
+
e.dataTransfer.effectAllowed = "move";
|
|
6310
|
+
e.dataTransfer.setData("text/plain", id);
|
|
6311
|
+
setTimeout(() => {
|
|
6312
|
+
handleDragStart(id, columnId);
|
|
6313
|
+
}, 0);
|
|
6314
|
+
}, [id, columnId, handleDragStart, disabled]);
|
|
6315
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6316
|
+
"div",
|
|
6317
|
+
{
|
|
6318
|
+
draggable: !disabled,
|
|
6319
|
+
onDragStart: handleDragStartEvent,
|
|
6320
|
+
className: cn(
|
|
6321
|
+
"group relative rounded-2xl border border-border/60 bg-card p-4",
|
|
6322
|
+
"shadow-[0_2px_8px_-2px_rgba(0,0,0,0.08),0_4px_16px_-4px_rgba(0,0,0,0.04)]",
|
|
6323
|
+
"transition-all duration-200",
|
|
6324
|
+
!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",
|
|
6325
|
+
!disabled && "active:cursor-grabbing active:scale-[0.98]",
|
|
6326
|
+
isThisCardDragging && "opacity-50 scale-[0.96] shadow-xl border-primary ring-2 ring-primary/20",
|
|
6327
|
+
disabled && "cursor-not-allowed opacity-60",
|
|
6328
|
+
className
|
|
6329
|
+
),
|
|
6330
|
+
"data-kanban-card": id,
|
|
6331
|
+
"data-column": columnId,
|
|
6332
|
+
children
|
|
6333
|
+
}
|
|
6334
|
+
);
|
|
6335
|
+
}
|
|
6336
|
+
KanbanCard.displayName = "KanbanCard";
|
|
6337
|
+
|
|
6338
|
+
// src/components/Kanban/Kanban.tsx
|
|
6339
|
+
var Kanban = {
|
|
6340
|
+
Board: KanbanBoard,
|
|
6341
|
+
Column: KanbanColumn,
|
|
6342
|
+
Card: KanbanCard
|
|
6343
|
+
};
|
|
6344
|
+
var WizardContext = React48.createContext(void 0);
|
|
6345
|
+
function useWizardContext() {
|
|
6346
|
+
const context = React48.useContext(WizardContext);
|
|
6347
|
+
if (context === void 0) {
|
|
6348
|
+
throw new Error("useWizardContext must be used within a Wizard component");
|
|
6349
|
+
}
|
|
6350
|
+
return context;
|
|
6351
|
+
}
|
|
6352
|
+
function useWizardContextOptional() {
|
|
6353
|
+
return React48.useContext(WizardContext);
|
|
6354
|
+
}
|
|
6355
|
+
function WizardProvider({
|
|
6356
|
+
children,
|
|
6357
|
+
form,
|
|
6358
|
+
steps,
|
|
6359
|
+
initialStep = 0,
|
|
6360
|
+
onStepChange,
|
|
6361
|
+
validateOnNext = true,
|
|
6362
|
+
allowJumpToStep = false
|
|
6363
|
+
}) {
|
|
6364
|
+
const [completedSteps, setCompletedSteps] = React48.useState(/* @__PURE__ */ new Set());
|
|
6365
|
+
const activeSteps = React48.useMemo(() => {
|
|
6366
|
+
const formValues = form.getValues();
|
|
6367
|
+
return steps.filter((step) => {
|
|
6368
|
+
if (typeof step.isHidden === "function") {
|
|
6369
|
+
return !step.isHidden(formValues);
|
|
6370
|
+
}
|
|
6371
|
+
return !step.isHidden;
|
|
6372
|
+
});
|
|
6373
|
+
}, [steps, form]);
|
|
6374
|
+
const [currentStep, setCurrentStep] = React48.useState(() => {
|
|
6375
|
+
return Math.min(Math.max(0, initialStep), activeSteps.length - 1);
|
|
6376
|
+
});
|
|
6377
|
+
const totalSteps = activeSteps.length;
|
|
6378
|
+
const isFirstStep = currentStep === 0;
|
|
6379
|
+
const isLastStep = currentStep === totalSteps - 1;
|
|
6380
|
+
const progress = totalSteps > 0 ? Math.round((currentStep + 1) / totalSteps * 100) : 0;
|
|
6381
|
+
const currentStepConfig = activeSteps[currentStep];
|
|
6382
|
+
const getStepConfig = React48.useCallback(
|
|
6383
|
+
(index) => activeSteps[index],
|
|
6384
|
+
[activeSteps]
|
|
6385
|
+
);
|
|
6386
|
+
const getStepByName = React48.useCallback(
|
|
6387
|
+
(name) => activeSteps.find((step) => step.name === name || step.id === name),
|
|
6388
|
+
[activeSteps]
|
|
6389
|
+
);
|
|
6390
|
+
const getStepIndexByName = React48.useCallback(
|
|
6391
|
+
(name) => activeSteps.findIndex((step) => step.name === name || step.id === name),
|
|
6392
|
+
[activeSteps]
|
|
6393
|
+
);
|
|
6394
|
+
const isStepCompleted = React48.useCallback(
|
|
6395
|
+
(index) => completedSteps.has(index),
|
|
6396
|
+
[completedSteps]
|
|
6397
|
+
);
|
|
6398
|
+
const hasStepErrors = React48.useCallback(
|
|
6399
|
+
(index) => {
|
|
6400
|
+
const stepConfig = activeSteps[index];
|
|
6401
|
+
if (!stepConfig?.fields) return false;
|
|
6402
|
+
const errors = form.formState.errors;
|
|
6403
|
+
return stepConfig.fields.some((field) => {
|
|
6404
|
+
const fieldPath = field;
|
|
6405
|
+
return fieldPath in errors;
|
|
6406
|
+
});
|
|
6407
|
+
},
|
|
6408
|
+
[activeSteps, form.formState.errors]
|
|
6409
|
+
);
|
|
6410
|
+
const validateCurrentStep = React48.useCallback(async () => {
|
|
6411
|
+
const stepConfig = currentStepConfig;
|
|
6412
|
+
if (!stepConfig?.validationSchema) {
|
|
6413
|
+
return true;
|
|
6414
|
+
}
|
|
6415
|
+
const formValues = form.getValues();
|
|
6416
|
+
const result = await stepConfig.validationSchema.safeParseAsync(formValues);
|
|
6417
|
+
if (!result.success) {
|
|
6418
|
+
if (stepConfig.fields) {
|
|
6419
|
+
await Promise.all(
|
|
6420
|
+
stepConfig.fields.map((field) => form.trigger(field))
|
|
6421
|
+
);
|
|
6422
|
+
}
|
|
6423
|
+
return false;
|
|
6424
|
+
}
|
|
6425
|
+
if (stepConfig.fields) {
|
|
6426
|
+
stepConfig.fields.forEach((field) => {
|
|
6427
|
+
form.clearErrors(field);
|
|
6428
|
+
});
|
|
6429
|
+
}
|
|
6430
|
+
return true;
|
|
6431
|
+
}, [currentStepConfig, form]);
|
|
6432
|
+
const goToNextStep = React48.useCallback(async () => {
|
|
6433
|
+
if (isLastStep) {
|
|
6434
|
+
return false;
|
|
6435
|
+
}
|
|
6436
|
+
if (validateOnNext) {
|
|
6437
|
+
const isValid = await validateCurrentStep();
|
|
6438
|
+
if (!isValid) {
|
|
6439
|
+
return false;
|
|
6440
|
+
}
|
|
6441
|
+
}
|
|
6442
|
+
setCompletedSteps((prev) => /* @__PURE__ */ new Set([...prev, currentStep]));
|
|
6443
|
+
const nextStep = currentStep + 1;
|
|
6444
|
+
setCurrentStep(nextStep);
|
|
6445
|
+
onStepChange?.(nextStep, "next");
|
|
6446
|
+
return true;
|
|
6447
|
+
}, [isLastStep, validateOnNext, validateCurrentStep, currentStep, onStepChange]);
|
|
6448
|
+
const goToPrevStep = React48.useCallback(() => {
|
|
6449
|
+
if (isFirstStep) {
|
|
6450
|
+
return;
|
|
6451
|
+
}
|
|
6452
|
+
const prevStep = currentStep - 1;
|
|
6453
|
+
setCurrentStep(prevStep);
|
|
6454
|
+
onStepChange?.(prevStep, "prev");
|
|
6455
|
+
}, [isFirstStep, currentStep, onStepChange]);
|
|
6456
|
+
const goToStep = React48.useCallback(
|
|
6457
|
+
async (targetStep) => {
|
|
6458
|
+
if (targetStep < 0 || targetStep >= totalSteps) {
|
|
6459
|
+
return false;
|
|
6460
|
+
}
|
|
6461
|
+
if (!allowJumpToStep && targetStep > currentStep) {
|
|
6462
|
+
for (let i = currentStep; i < targetStep; i++) {
|
|
6463
|
+
if (!completedSteps.has(i)) {
|
|
6464
|
+
return false;
|
|
6465
|
+
}
|
|
6466
|
+
}
|
|
6467
|
+
}
|
|
6468
|
+
if (targetStep < currentStep) {
|
|
6469
|
+
setCurrentStep(targetStep);
|
|
6470
|
+
onStepChange?.(targetStep, "jump");
|
|
6471
|
+
return true;
|
|
6472
|
+
}
|
|
6473
|
+
if (validateOnNext && targetStep > currentStep) {
|
|
6474
|
+
const isValid = await validateCurrentStep();
|
|
6475
|
+
if (!isValid) {
|
|
6476
|
+
return false;
|
|
6477
|
+
}
|
|
6478
|
+
setCompletedSteps((prev) => /* @__PURE__ */ new Set([...prev, currentStep]));
|
|
6479
|
+
}
|
|
6480
|
+
setCurrentStep(targetStep);
|
|
6481
|
+
onStepChange?.(targetStep, "jump");
|
|
6482
|
+
return true;
|
|
6483
|
+
},
|
|
6484
|
+
[totalSteps, allowJumpToStep, currentStep, completedSteps, validateOnNext, validateCurrentStep, onStepChange]
|
|
6485
|
+
);
|
|
6486
|
+
const reset = React48.useCallback(() => {
|
|
6487
|
+
setCurrentStep(Math.min(Math.max(0, initialStep), activeSteps.length - 1));
|
|
6488
|
+
setCompletedSteps(/* @__PURE__ */ new Set());
|
|
6489
|
+
form.reset();
|
|
6490
|
+
}, [initialStep, activeSteps.length, form]);
|
|
6491
|
+
const contextValue = React48.useMemo(
|
|
6492
|
+
() => ({
|
|
6493
|
+
// State
|
|
6494
|
+
currentStep,
|
|
6495
|
+
totalSteps,
|
|
6496
|
+
activeSteps,
|
|
6497
|
+
allSteps: steps,
|
|
6498
|
+
// Computed
|
|
6499
|
+
isFirstStep,
|
|
6500
|
+
isLastStep,
|
|
6501
|
+
progress,
|
|
6502
|
+
// Navigation
|
|
6503
|
+
goToNextStep,
|
|
6504
|
+
goToPrevStep,
|
|
6505
|
+
goToStep,
|
|
6506
|
+
reset,
|
|
6507
|
+
// Validation
|
|
6508
|
+
validateCurrentStep,
|
|
6509
|
+
isStepCompleted,
|
|
6510
|
+
hasStepErrors,
|
|
6511
|
+
// Form
|
|
6512
|
+
form,
|
|
6513
|
+
// Step info
|
|
6514
|
+
currentStepConfig,
|
|
6515
|
+
getStepConfig,
|
|
6516
|
+
getStepByName,
|
|
6517
|
+
getStepIndexByName,
|
|
6518
|
+
// Settings
|
|
6519
|
+
allowJumpToStep
|
|
6520
|
+
}),
|
|
6521
|
+
[
|
|
6522
|
+
currentStep,
|
|
6523
|
+
totalSteps,
|
|
6524
|
+
activeSteps,
|
|
6525
|
+
steps,
|
|
6526
|
+
isFirstStep,
|
|
6527
|
+
isLastStep,
|
|
6528
|
+
progress,
|
|
6529
|
+
goToNextStep,
|
|
6530
|
+
goToPrevStep,
|
|
6531
|
+
goToStep,
|
|
6532
|
+
reset,
|
|
6533
|
+
validateCurrentStep,
|
|
6534
|
+
isStepCompleted,
|
|
6535
|
+
hasStepErrors,
|
|
6536
|
+
form,
|
|
6537
|
+
currentStepConfig,
|
|
6538
|
+
getStepConfig,
|
|
6539
|
+
getStepByName,
|
|
6540
|
+
getStepIndexByName,
|
|
6541
|
+
allowJumpToStep
|
|
6542
|
+
]
|
|
6543
|
+
);
|
|
6544
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WizardContext.Provider, { value: contextValue, children });
|
|
6545
|
+
}
|
|
6546
|
+
var sizeConfig = {
|
|
6547
|
+
sm: {
|
|
6548
|
+
circle: "h-7 w-7 text-xs",
|
|
6549
|
+
icon: "h-3.5 w-3.5",
|
|
6550
|
+
label: "text-xs",
|
|
6551
|
+
description: "text-xs",
|
|
6552
|
+
gap: "gap-1.5"
|
|
6553
|
+
},
|
|
6554
|
+
md: {
|
|
6555
|
+
circle: "h-9 w-9 text-sm",
|
|
6556
|
+
icon: "h-4 w-4",
|
|
6557
|
+
label: "text-sm",
|
|
6558
|
+
description: "text-xs",
|
|
6559
|
+
gap: "gap-2"
|
|
6560
|
+
},
|
|
6561
|
+
lg: {
|
|
6562
|
+
circle: "h-11 w-11 text-base",
|
|
6563
|
+
icon: "h-5 w-5",
|
|
6564
|
+
label: "text-base",
|
|
6565
|
+
description: "text-sm",
|
|
6566
|
+
gap: "gap-2.5"
|
|
6567
|
+
}
|
|
6568
|
+
};
|
|
6569
|
+
var stateStyles = {
|
|
6570
|
+
completed: {
|
|
6571
|
+
circle: "bg-green-500 text-white border-green-500",
|
|
6572
|
+
label: "text-green-600 dark:text-green-400",
|
|
6573
|
+
description: "text-muted-foreground"
|
|
6574
|
+
},
|
|
6575
|
+
current: {
|
|
6576
|
+
circle: "bg-primary text-primary-foreground border-primary ring-4 ring-primary/20",
|
|
6577
|
+
label: "text-primary font-semibold",
|
|
6578
|
+
description: "text-muted-foreground"
|
|
6579
|
+
},
|
|
6580
|
+
pending: {
|
|
6581
|
+
circle: "bg-background text-muted-foreground border-muted-foreground/30",
|
|
6582
|
+
label: "text-muted-foreground",
|
|
6583
|
+
description: "text-muted-foreground/60"
|
|
6584
|
+
},
|
|
6585
|
+
error: {
|
|
6586
|
+
circle: "bg-destructive text-destructive-foreground border-destructive",
|
|
6587
|
+
label: "text-destructive",
|
|
6588
|
+
description: "text-destructive/60"
|
|
6589
|
+
},
|
|
6590
|
+
disabled: {
|
|
6591
|
+
circle: "bg-muted text-muted-foreground/50 border-muted cursor-not-allowed",
|
|
6592
|
+
label: "text-muted-foreground/50",
|
|
6593
|
+
description: "text-muted-foreground/30"
|
|
6594
|
+
}
|
|
6595
|
+
};
|
|
6596
|
+
function WizardStepIndicator({
|
|
6597
|
+
step,
|
|
6598
|
+
index,
|
|
6599
|
+
state,
|
|
6600
|
+
showNumber = false,
|
|
6601
|
+
showDescription = false,
|
|
6602
|
+
size = "md",
|
|
6603
|
+
isClickable = false,
|
|
6604
|
+
onClick
|
|
6605
|
+
}) {
|
|
6606
|
+
const config = sizeConfig[size];
|
|
6607
|
+
const styles = stateStyles[state];
|
|
6608
|
+
const Icon2 = step.icon;
|
|
6609
|
+
const renderCircleContent = () => {
|
|
6610
|
+
if (state === "completed") {
|
|
6611
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: config.icon, strokeWidth: 3 });
|
|
6612
|
+
}
|
|
6613
|
+
if (state === "error") {
|
|
6614
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: config.icon });
|
|
6615
|
+
}
|
|
6616
|
+
if (Icon2 && !showNumber) {
|
|
6617
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: config.icon });
|
|
6618
|
+
}
|
|
6619
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: index + 1 });
|
|
6620
|
+
};
|
|
6621
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6622
|
+
"div",
|
|
6623
|
+
{
|
|
6624
|
+
className: cn(
|
|
6625
|
+
"flex flex-col items-center",
|
|
6626
|
+
config.gap,
|
|
6627
|
+
isClickable && "cursor-pointer group"
|
|
6628
|
+
),
|
|
6629
|
+
onClick: isClickable ? onClick : void 0,
|
|
6630
|
+
role: isClickable ? "button" : void 0,
|
|
6631
|
+
tabIndex: isClickable ? 0 : void 0,
|
|
6632
|
+
onKeyDown: isClickable ? (e) => {
|
|
6633
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
6634
|
+
e.preventDefault();
|
|
6635
|
+
onClick?.();
|
|
6636
|
+
}
|
|
6637
|
+
} : void 0,
|
|
6638
|
+
"aria-current": state === "current" ? "step" : void 0,
|
|
6639
|
+
children: [
|
|
6640
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6641
|
+
"div",
|
|
6642
|
+
{
|
|
6643
|
+
className: cn(
|
|
6644
|
+
"flex items-center justify-center rounded-full border-2 transition-all duration-200",
|
|
6645
|
+
config.circle,
|
|
6646
|
+
styles.circle,
|
|
6647
|
+
isClickable && "group-hover:ring-4 group-hover:ring-primary/10"
|
|
6648
|
+
),
|
|
6649
|
+
children: renderCircleContent()
|
|
6650
|
+
}
|
|
6651
|
+
),
|
|
6652
|
+
(step.label || showDescription) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center text-center max-w-[120px]", children: [
|
|
6653
|
+
step.label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6654
|
+
"span",
|
|
6655
|
+
{
|
|
6656
|
+
className: cn(
|
|
6657
|
+
"leading-tight transition-colors duration-200",
|
|
6658
|
+
config.label,
|
|
6659
|
+
styles.label
|
|
6660
|
+
),
|
|
6661
|
+
children: step.label
|
|
6662
|
+
}
|
|
6663
|
+
),
|
|
6664
|
+
showDescription && step.description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6665
|
+
"span",
|
|
6666
|
+
{
|
|
6667
|
+
className: cn(
|
|
6668
|
+
"leading-tight mt-0.5",
|
|
6669
|
+
config.description,
|
|
6670
|
+
styles.description
|
|
6671
|
+
),
|
|
6672
|
+
children: step.description
|
|
6673
|
+
}
|
|
6674
|
+
)
|
|
6675
|
+
] })
|
|
6676
|
+
]
|
|
6677
|
+
}
|
|
6678
|
+
);
|
|
6679
|
+
}
|
|
6680
|
+
function WizardStepConnector({
|
|
6681
|
+
isCompleted = false,
|
|
6682
|
+
variant = "horizontal",
|
|
6683
|
+
className
|
|
6684
|
+
}) {
|
|
6685
|
+
const isHorizontal = variant === "horizontal";
|
|
6686
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6687
|
+
"div",
|
|
6688
|
+
{
|
|
6689
|
+
className: cn(
|
|
6690
|
+
"transition-colors duration-300",
|
|
6691
|
+
isHorizontal ? "flex-1 h-0.5 min-w-[24px] mx-2" : "w-0.5 min-h-[24px] my-2 ml-[18px]",
|
|
6692
|
+
isCompleted ? "bg-green-500" : "bg-muted-foreground/20",
|
|
6693
|
+
className
|
|
6694
|
+
),
|
|
6695
|
+
"aria-hidden": "true"
|
|
6696
|
+
}
|
|
6697
|
+
);
|
|
6698
|
+
}
|
|
6699
|
+
function WizardSteps({
|
|
6700
|
+
variant = "horizontal",
|
|
6701
|
+
showDescription = false,
|
|
6702
|
+
showNumbers = false,
|
|
6703
|
+
size = "md",
|
|
6704
|
+
className
|
|
6705
|
+
}) {
|
|
6706
|
+
const {
|
|
6707
|
+
activeSteps,
|
|
6708
|
+
currentStep,
|
|
6709
|
+
isStepCompleted,
|
|
6710
|
+
hasStepErrors,
|
|
6711
|
+
goToStep,
|
|
6712
|
+
allowJumpToStep
|
|
6713
|
+
} = useWizardContext();
|
|
6714
|
+
const getStepState = (index) => {
|
|
6715
|
+
const step = activeSteps[index];
|
|
6716
|
+
if (step.isDisabled) {
|
|
6717
|
+
return "disabled";
|
|
6718
|
+
}
|
|
6719
|
+
if (index === currentStep) {
|
|
6720
|
+
return hasStepErrors(index) ? "error" : "current";
|
|
6721
|
+
}
|
|
6722
|
+
if (isStepCompleted(index)) {
|
|
6723
|
+
return hasStepErrors(index) ? "error" : "completed";
|
|
6724
|
+
}
|
|
6725
|
+
return "pending";
|
|
6726
|
+
};
|
|
6727
|
+
const isStepClickable = (index) => {
|
|
6728
|
+
if (index === currentStep) return false;
|
|
6729
|
+
const step = activeSteps[index];
|
|
6730
|
+
if (step.isDisabled) return false;
|
|
6731
|
+
if (index < currentStep) return true;
|
|
6732
|
+
if (allowJumpToStep && index > currentStep) {
|
|
6733
|
+
for (let i = currentStep; i < index; i++) {
|
|
6734
|
+
if (!isStepCompleted(i)) return false;
|
|
6735
|
+
}
|
|
6736
|
+
return true;
|
|
6737
|
+
}
|
|
6738
|
+
return false;
|
|
6739
|
+
};
|
|
6740
|
+
const handleStepClick = async (index) => {
|
|
6741
|
+
if (isStepClickable(index)) {
|
|
6742
|
+
await goToStep(index);
|
|
6743
|
+
}
|
|
6744
|
+
};
|
|
6745
|
+
const isHorizontal = variant === "horizontal";
|
|
6746
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6747
|
+
"nav",
|
|
6748
|
+
{
|
|
6749
|
+
"aria-label": "Progresso do formul\xE1rio",
|
|
6750
|
+
className: cn(
|
|
6751
|
+
"flex",
|
|
6752
|
+
isHorizontal ? "flex-row items-center justify-center" : "flex-col items-start",
|
|
6753
|
+
className
|
|
6754
|
+
),
|
|
6755
|
+
children: activeSteps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6756
|
+
"div",
|
|
6757
|
+
{
|
|
6758
|
+
className: cn(
|
|
6759
|
+
"flex",
|
|
6760
|
+
isHorizontal ? "flex-row items-center" : "flex-col",
|
|
6761
|
+
index !== activeSteps.length - 1 && isHorizontal && "flex-1"
|
|
6762
|
+
),
|
|
6763
|
+
children: [
|
|
6764
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6765
|
+
WizardStepIndicator,
|
|
6766
|
+
{
|
|
6767
|
+
step,
|
|
6768
|
+
index,
|
|
6769
|
+
state: getStepState(index),
|
|
6770
|
+
showNumber: showNumbers,
|
|
6771
|
+
showDescription,
|
|
6772
|
+
size,
|
|
6773
|
+
isClickable: isStepClickable(index),
|
|
6774
|
+
onClick: () => handleStepClick(index)
|
|
6775
|
+
}
|
|
6776
|
+
),
|
|
6777
|
+
index !== activeSteps.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6778
|
+
WizardStepConnector,
|
|
6779
|
+
{
|
|
6780
|
+
isCompleted: isStepCompleted(index),
|
|
6781
|
+
variant
|
|
6782
|
+
}
|
|
6783
|
+
)
|
|
6784
|
+
]
|
|
6785
|
+
},
|
|
6786
|
+
step.id
|
|
6787
|
+
))
|
|
6788
|
+
}
|
|
6789
|
+
);
|
|
6790
|
+
}
|
|
6791
|
+
function WizardContent({ children, className }) {
|
|
6792
|
+
const { currentStepConfig } = useWizardContext();
|
|
6793
|
+
let activePanel = null;
|
|
6794
|
+
React48.Children.forEach(children, (child) => {
|
|
6795
|
+
if (!React48.isValidElement(child)) return;
|
|
6796
|
+
const panelProps = child.props;
|
|
6797
|
+
if (panelProps.name === currentStepConfig?.name || panelProps.name === currentStepConfig?.id) {
|
|
6798
|
+
activePanel = child;
|
|
6799
|
+
}
|
|
6800
|
+
});
|
|
6801
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6802
|
+
"div",
|
|
6803
|
+
{
|
|
6804
|
+
className: cn("flex-1", className),
|
|
6805
|
+
role: "tabpanel",
|
|
6806
|
+
"aria-label": currentStepConfig?.label || currentStepConfig?.name,
|
|
6807
|
+
children: activePanel
|
|
6808
|
+
}
|
|
6809
|
+
);
|
|
6810
|
+
}
|
|
6811
|
+
function WizardPanel({ name, children, className }) {
|
|
6812
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), "data-wizard-panel": name, children });
|
|
6813
|
+
}
|
|
6814
|
+
function WizardNavigation({
|
|
6815
|
+
cancelLabel = "Cancelar",
|
|
6816
|
+
prevLabel = "Voltar",
|
|
6817
|
+
nextLabel = "Continuar",
|
|
6818
|
+
submitLabel = "Finalizar",
|
|
6819
|
+
loadingLabel = "Processando...",
|
|
6820
|
+
onCancel,
|
|
6821
|
+
showCancel,
|
|
6822
|
+
submitDisabled = false,
|
|
6823
|
+
className
|
|
6824
|
+
}) {
|
|
6825
|
+
const {
|
|
6826
|
+
isFirstStep,
|
|
6827
|
+
isLastStep,
|
|
6828
|
+
goToNextStep,
|
|
6829
|
+
goToPrevStep,
|
|
6830
|
+
form
|
|
6831
|
+
} = useWizardContext();
|
|
6832
|
+
const isSubmitting = form.formState.isSubmitting;
|
|
6833
|
+
const shouldShowCancel = showCancel ?? isFirstStep;
|
|
6834
|
+
const handleNext = React48.useCallback(async () => {
|
|
6835
|
+
await goToNextStep();
|
|
6836
|
+
}, [goToNextStep]);
|
|
6837
|
+
const handlePrev = React48.useCallback(() => {
|
|
6838
|
+
goToPrevStep();
|
|
6839
|
+
}, [goToPrevStep]);
|
|
6840
|
+
const handleCancel = React48.useCallback(() => {
|
|
6841
|
+
onCancel?.();
|
|
6842
|
+
}, [onCancel]);
|
|
6843
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6844
|
+
"div",
|
|
6845
|
+
{
|
|
6846
|
+
className: cn(
|
|
6847
|
+
"flex items-center justify-between gap-3 pt-4 border-t border-border",
|
|
6848
|
+
className
|
|
6849
|
+
),
|
|
6850
|
+
children: [
|
|
6851
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: shouldShowCancel && onCancel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6852
|
+
Button,
|
|
6853
|
+
{
|
|
6854
|
+
type: "button",
|
|
6855
|
+
variant: "outline",
|
|
6856
|
+
onClick: handleCancel,
|
|
6857
|
+
disabled: isSubmitting,
|
|
6858
|
+
className: "w-full sm:w-auto",
|
|
6859
|
+
children: cancelLabel
|
|
6860
|
+
}
|
|
6861
|
+
) : !isFirstStep ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6862
|
+
Button,
|
|
6863
|
+
{
|
|
6864
|
+
type: "button",
|
|
6865
|
+
variant: "outline",
|
|
6866
|
+
onClick: handlePrev,
|
|
6867
|
+
disabled: isSubmitting,
|
|
6868
|
+
className: "w-full sm:w-auto",
|
|
6869
|
+
children: prevLabel
|
|
6870
|
+
}
|
|
6871
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", {}) }),
|
|
6872
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6873
|
+
!isFirstStep && shouldShowCancel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6874
|
+
Button,
|
|
6875
|
+
{
|
|
6876
|
+
type: "button",
|
|
6877
|
+
variant: "outline",
|
|
6878
|
+
onClick: handlePrev,
|
|
6879
|
+
disabled: isSubmitting,
|
|
6880
|
+
children: prevLabel
|
|
6881
|
+
}
|
|
6882
|
+
),
|
|
6883
|
+
isLastStep ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6884
|
+
Button,
|
|
6885
|
+
{
|
|
6886
|
+
type: "submit",
|
|
6887
|
+
disabled: submitDisabled || isSubmitting,
|
|
6888
|
+
className: "min-w-[120px]",
|
|
6889
|
+
children: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
|
|
6890
|
+
/* @__PURE__ */ jsxRuntime.jsx(Loader, { variant: "spinner" }),
|
|
6891
|
+
loadingLabel
|
|
6892
|
+
] }) : submitLabel
|
|
6893
|
+
}
|
|
6894
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
6895
|
+
Button,
|
|
6896
|
+
{
|
|
6897
|
+
type: "button",
|
|
6898
|
+
onClick: handleNext,
|
|
6899
|
+
disabled: isSubmitting,
|
|
6900
|
+
className: "min-w-[120px]",
|
|
6901
|
+
children: nextLabel
|
|
6902
|
+
}
|
|
6903
|
+
)
|
|
6904
|
+
] })
|
|
6905
|
+
]
|
|
6906
|
+
}
|
|
6907
|
+
);
|
|
6908
|
+
}
|
|
6909
|
+
function WizardProgress({
|
|
6910
|
+
showPercentage = false,
|
|
6911
|
+
showStepCount = false,
|
|
6912
|
+
className
|
|
6913
|
+
}) {
|
|
6914
|
+
const { progress, currentStep, totalSteps } = useWizardContext();
|
|
6915
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), children: [
|
|
6916
|
+
(showPercentage || showStepCount) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2 text-sm text-muted-foreground", children: [
|
|
6917
|
+
showStepCount && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
6918
|
+
"Etapa ",
|
|
6919
|
+
currentStep + 1,
|
|
6920
|
+
" de ",
|
|
6921
|
+
totalSteps
|
|
6922
|
+
] }),
|
|
6923
|
+
showPercentage && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: !showStepCount ? "ml-auto" : "", children: [
|
|
6924
|
+
progress,
|
|
6925
|
+
"%"
|
|
6926
|
+
] })
|
|
6927
|
+
] }),
|
|
6928
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6929
|
+
"div",
|
|
6930
|
+
{
|
|
6931
|
+
className: "h-2 w-full bg-muted rounded-full overflow-hidden",
|
|
6932
|
+
role: "progressbar",
|
|
6933
|
+
"aria-valuenow": progress,
|
|
6934
|
+
"aria-valuemin": 0,
|
|
6935
|
+
"aria-valuemax": 100,
|
|
6936
|
+
"aria-label": `Progresso: ${progress}%`,
|
|
6937
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6938
|
+
"div",
|
|
6939
|
+
{
|
|
6940
|
+
className: "h-full bg-primary transition-all duration-300 ease-out rounded-full",
|
|
6941
|
+
style: { width: `${progress}%` }
|
|
6942
|
+
}
|
|
6943
|
+
)
|
|
6944
|
+
}
|
|
6945
|
+
)
|
|
6946
|
+
] });
|
|
6947
|
+
}
|
|
6948
|
+
function WizardRoot({
|
|
6949
|
+
children,
|
|
6950
|
+
form,
|
|
6951
|
+
steps,
|
|
6952
|
+
initialStep,
|
|
6953
|
+
onStepChange,
|
|
6954
|
+
onComplete,
|
|
6955
|
+
validateOnNext = true,
|
|
6956
|
+
allowJumpToStep = false,
|
|
6957
|
+
className
|
|
6958
|
+
}) {
|
|
6959
|
+
const handleSubmit = async (data) => {
|
|
6960
|
+
if (onComplete) {
|
|
6961
|
+
await onComplete(data);
|
|
6962
|
+
}
|
|
6963
|
+
};
|
|
6964
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6965
|
+
WizardProvider,
|
|
6966
|
+
{
|
|
6967
|
+
form,
|
|
6968
|
+
steps,
|
|
6969
|
+
initialStep,
|
|
6970
|
+
onStepChange,
|
|
6971
|
+
onComplete,
|
|
6972
|
+
validateOnNext,
|
|
6973
|
+
allowJumpToStep,
|
|
6974
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.FormProvider, { ...form, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6975
|
+
"form",
|
|
6976
|
+
{
|
|
6977
|
+
onSubmit: form.handleSubmit(handleSubmit),
|
|
6978
|
+
className: cn("flex flex-col", className),
|
|
6979
|
+
noValidate: true,
|
|
6980
|
+
children
|
|
6981
|
+
}
|
|
6982
|
+
) })
|
|
6983
|
+
}
|
|
6984
|
+
);
|
|
6985
|
+
}
|
|
6986
|
+
var Wizard = Object.assign(WizardRoot, {
|
|
6987
|
+
/** Visual step indicators */
|
|
6988
|
+
Steps: WizardSteps,
|
|
6989
|
+
/** Container for step panels */
|
|
6990
|
+
Content: WizardContent,
|
|
6991
|
+
/** Individual step content panel */
|
|
6992
|
+
Panel: WizardPanel,
|
|
6993
|
+
/** Navigation buttons (prev, next, submit) */
|
|
6994
|
+
Navigation: WizardNavigation,
|
|
6995
|
+
/** Progress bar indicator */
|
|
6996
|
+
Progress: WizardProgress
|
|
6997
|
+
});
|
|
6998
|
+
function Logo({
|
|
6999
|
+
width = 100,
|
|
7000
|
+
color = "currentColor",
|
|
7001
|
+
className = "text-primary"
|
|
7002
|
+
}) {
|
|
7003
|
+
const originalWidth = 207;
|
|
7004
|
+
const originalHeight = 304;
|
|
7005
|
+
let calculatedHeight = originalHeight;
|
|
7006
|
+
if (typeof width === "number") {
|
|
7007
|
+
calculatedHeight = Math.round(width * (originalHeight / originalWidth));
|
|
7008
|
+
} else if (typeof width === "string" && width.endsWith("%")) {
|
|
7009
|
+
calculatedHeight = "auto";
|
|
7010
|
+
} else if (typeof width === "string") {
|
|
7011
|
+
const numWidth = parseFloat(width);
|
|
7012
|
+
if (!isNaN(numWidth)) {
|
|
7013
|
+
calculatedHeight = `${Math.round(
|
|
7014
|
+
numWidth * (originalHeight / originalWidth)
|
|
7015
|
+
)}${width.match(/[a-zA-Z%]+$/)?.[0] || ""}`;
|
|
7016
|
+
} else {
|
|
7017
|
+
calculatedHeight = originalHeight;
|
|
7018
|
+
}
|
|
7019
|
+
}
|
|
7020
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7021
|
+
"svg",
|
|
7022
|
+
{
|
|
7023
|
+
width,
|
|
7024
|
+
height: calculatedHeight,
|
|
7025
|
+
viewBox: "0 0 207 304",
|
|
7026
|
+
fill: "none",
|
|
7027
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7028
|
+
className: cn(className),
|
|
7029
|
+
style: color !== "currentColor" ? { fill: color } : void 0,
|
|
7030
|
+
"aria-label": "Facter Logo",
|
|
7031
|
+
role: "img",
|
|
7032
|
+
children: [
|
|
7033
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7034
|
+
"mask",
|
|
7035
|
+
{
|
|
7036
|
+
id: "facter-logo-mask",
|
|
7037
|
+
maskUnits: "userSpaceOnUse",
|
|
7038
|
+
x: "0",
|
|
7039
|
+
y: "0",
|
|
7040
|
+
width: "207",
|
|
7041
|
+
height: "304",
|
|
7042
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.15625H206.26V304H0V0.15625Z", fill: "white" })
|
|
7043
|
+
}
|
|
7044
|
+
),
|
|
7045
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { mask: "url(#facter-logo-mask)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7046
|
+
"path",
|
|
7047
|
+
{
|
|
7048
|
+
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",
|
|
7049
|
+
fill: color === "currentColor" ? "currentColor" : color
|
|
7050
|
+
}
|
|
7051
|
+
) })
|
|
7052
|
+
]
|
|
7053
|
+
}
|
|
7054
|
+
);
|
|
7055
|
+
}
|
|
7056
|
+
var initialState = {
|
|
7057
|
+
theme: "system",
|
|
7058
|
+
setTheme: () => null
|
|
7059
|
+
};
|
|
7060
|
+
var ThemeProviderContext = React48__namespace.createContext(initialState);
|
|
7061
|
+
function ThemeProvider({
|
|
7062
|
+
children,
|
|
7063
|
+
defaultTheme = "system",
|
|
7064
|
+
storageKey = "facter-ds-theme",
|
|
7065
|
+
...props
|
|
7066
|
+
}) {
|
|
7067
|
+
const [theme, setTheme] = React48__namespace.useState(
|
|
7068
|
+
() => localStorage.getItem(storageKey) || defaultTheme
|
|
7069
|
+
);
|
|
7070
|
+
const [resolvedTheme, setResolvedTheme] = React48__namespace.useState("light");
|
|
7071
|
+
React48__namespace.useEffect(() => {
|
|
7072
|
+
const root = window.document.documentElement;
|
|
7073
|
+
root.classList.remove("light", "dark");
|
|
7074
|
+
if (theme === "system") {
|
|
7075
|
+
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
7076
|
+
root.classList.add(systemTheme);
|
|
7077
|
+
setResolvedTheme(systemTheme);
|
|
7078
|
+
return;
|
|
7079
|
+
}
|
|
7080
|
+
root.classList.add(theme);
|
|
7081
|
+
setResolvedTheme(theme);
|
|
7082
|
+
}, [theme]);
|
|
7083
|
+
const value = React48__namespace.useMemo(
|
|
7084
|
+
() => ({
|
|
7085
|
+
theme,
|
|
7086
|
+
setTheme: (theme2) => {
|
|
7087
|
+
localStorage.setItem(storageKey, theme2);
|
|
7088
|
+
setTheme(theme2);
|
|
7089
|
+
}
|
|
7090
|
+
}),
|
|
7091
|
+
[theme, storageKey]
|
|
7092
|
+
);
|
|
7093
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ThemeProviderContext.Provider, { ...props, value, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: resolvedTheme, style: { minHeight: "100vh" }, children }) });
|
|
7094
|
+
}
|
|
7095
|
+
var useTheme = () => {
|
|
7096
|
+
const context = React48__namespace.useContext(ThemeProviderContext);
|
|
7097
|
+
if (context === void 0)
|
|
7098
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
7099
|
+
return context;
|
|
7100
|
+
};
|
|
7101
|
+
|
|
7102
|
+
// src/themes/index.ts
|
|
7103
|
+
var FACTER_THEMES = {
|
|
7104
|
+
default: "default",
|
|
7105
|
+
truck: "truck",
|
|
7106
|
+
vagas: "vagas",
|
|
7107
|
+
techcare: "techcare"
|
|
7108
|
+
};
|
|
7109
|
+
var THEME_INFO = {
|
|
7110
|
+
default: {
|
|
7111
|
+
name: "Default",
|
|
7112
|
+
primaryColor: "#18181B",
|
|
7113
|
+
primaryHsl: "240 5.9% 10%",
|
|
7114
|
+
ringHsl: "240 5.9% 10%",
|
|
7115
|
+
description: "Tema neutro padr\xE3o"
|
|
7116
|
+
},
|
|
7117
|
+
truck: {
|
|
7118
|
+
name: "Facter Truck",
|
|
7119
|
+
primaryColor: "#3B5BDB",
|
|
7120
|
+
primaryHsl: "233 65% 55%",
|
|
7121
|
+
ringHsl: "233 65% 55%",
|
|
7122
|
+
description: "Sistema de gest\xE3o de frotas"
|
|
7123
|
+
},
|
|
7124
|
+
vagas: {
|
|
7125
|
+
name: "Facter Vagas",
|
|
7126
|
+
primaryColor: "#8B5CF6",
|
|
7127
|
+
primaryHsl: "262 83% 58%",
|
|
7128
|
+
ringHsl: "262 83% 58%",
|
|
7129
|
+
description: "Plataforma de vagas de emprego"
|
|
7130
|
+
},
|
|
7131
|
+
techcare: {
|
|
7132
|
+
name: "Facter TechCare",
|
|
7133
|
+
primaryColor: "#16A34A",
|
|
7134
|
+
primaryHsl: "142 76% 36%",
|
|
7135
|
+
ringHsl: "142 76% 36%",
|
|
7136
|
+
description: "Sistema de assist\xEAncia t\xE9cnica"
|
|
7137
|
+
}
|
|
4305
7138
|
};
|
|
4306
7139
|
|
|
4307
7140
|
Object.defineProperty(exports, "flexRender", {
|
|
@@ -4309,8 +7142,25 @@ Object.defineProperty(exports, "flexRender", {
|
|
|
4309
7142
|
get: function () { return reactTable.flexRender; }
|
|
4310
7143
|
});
|
|
4311
7144
|
exports.AuthLayout = AuthLayout;
|
|
7145
|
+
exports.Avatar = Avatar;
|
|
7146
|
+
exports.AvatarFallback = AvatarFallback;
|
|
7147
|
+
exports.AvatarImage = AvatarImage;
|
|
4312
7148
|
exports.Badge = Badge;
|
|
7149
|
+
exports.BigNumberCard = BigNumberCard;
|
|
7150
|
+
exports.Breadcrumb = Breadcrumb;
|
|
7151
|
+
exports.BreadcrumbEllipsis = BreadcrumbEllipsis;
|
|
7152
|
+
exports.BreadcrumbItem = BreadcrumbItem;
|
|
7153
|
+
exports.BreadcrumbLink = BreadcrumbLink;
|
|
7154
|
+
exports.BreadcrumbList = BreadcrumbList;
|
|
7155
|
+
exports.BreadcrumbPage = BreadcrumbPage;
|
|
7156
|
+
exports.BreadcrumbSeparator = BreadcrumbSeparator;
|
|
4313
7157
|
exports.Button = Button;
|
|
7158
|
+
exports.Card = Card;
|
|
7159
|
+
exports.CardContent = CardContent;
|
|
7160
|
+
exports.CardDescription = CardDescription;
|
|
7161
|
+
exports.CardFooter = CardFooter;
|
|
7162
|
+
exports.CardHeader = CardHeader;
|
|
7163
|
+
exports.CardTitle = CardTitle;
|
|
4314
7164
|
exports.Checkbox = Checkbox;
|
|
4315
7165
|
exports.DENSITY_CONFIG = DENSITY_CONFIG;
|
|
4316
7166
|
exports.DashboardLayout = DashboardLayout;
|
|
@@ -4327,7 +7177,23 @@ exports.DialogPortal = DialogPortal;
|
|
|
4327
7177
|
exports.DialogTitle = DialogTitle;
|
|
4328
7178
|
exports.DialogTrigger = DialogTrigger;
|
|
4329
7179
|
exports.DialogWrapper = DialogWrapper;
|
|
7180
|
+
exports.DropdownMenu = DropdownMenu;
|
|
7181
|
+
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
7182
|
+
exports.DropdownMenuContent = DropdownMenuContent;
|
|
7183
|
+
exports.DropdownMenuGroup = DropdownMenuGroup;
|
|
7184
|
+
exports.DropdownMenuItem = DropdownMenuItem;
|
|
7185
|
+
exports.DropdownMenuLabel = DropdownMenuLabel;
|
|
7186
|
+
exports.DropdownMenuPortal = DropdownMenuPortal;
|
|
7187
|
+
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
|
|
7188
|
+
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
7189
|
+
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
7190
|
+
exports.DropdownMenuShortcut = DropdownMenuShortcut;
|
|
7191
|
+
exports.DropdownMenuSub = DropdownMenuSub;
|
|
7192
|
+
exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
7193
|
+
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
7194
|
+
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
4330
7195
|
exports.EmptyState = EmptyState;
|
|
7196
|
+
exports.FACTER_THEMES = FACTER_THEMES;
|
|
4331
7197
|
exports.Form = Form;
|
|
4332
7198
|
exports.FormCheckbox = FormCheckbox;
|
|
4333
7199
|
exports.FormDescription = FormDescription;
|
|
@@ -4343,18 +7209,44 @@ exports.FormSwitch = FormSwitch;
|
|
|
4343
7209
|
exports.FormTextarea = FormTextarea;
|
|
4344
7210
|
exports.GlobalLoaderController = GlobalLoaderController;
|
|
4345
7211
|
exports.Input = Input;
|
|
7212
|
+
exports.Kanban = Kanban;
|
|
4346
7213
|
exports.Loader = Loader;
|
|
4347
7214
|
exports.LoaderProvider = LoaderProvider;
|
|
7215
|
+
exports.Logo = Logo;
|
|
7216
|
+
exports.MobileNav = MobileNav;
|
|
7217
|
+
exports.MobileNavItem = MobileNavItem;
|
|
7218
|
+
exports.Navbar = Navbar;
|
|
7219
|
+
exports.NavbarCompanyProfile = NavbarCompanyProfile;
|
|
7220
|
+
exports.NavbarNotification = NavbarNotification;
|
|
7221
|
+
exports.NavbarUserMenu = NavbarUserMenu;
|
|
7222
|
+
exports.Popover = Popover;
|
|
7223
|
+
exports.PopoverContent = PopoverContent;
|
|
7224
|
+
exports.PopoverTrigger = PopoverTrigger;
|
|
4348
7225
|
exports.RippleBackground = RippleBackground;
|
|
4349
7226
|
exports.RippleEffect = RippleEffect;
|
|
4350
7227
|
exports.RippleWrapper = RippleWrapper;
|
|
7228
|
+
exports.ScrollArea = ScrollArea;
|
|
7229
|
+
exports.ScrollBar = ScrollBar;
|
|
7230
|
+
exports.SectionHeader = SectionHeader;
|
|
7231
|
+
exports.SectionHeaderActions = SectionHeaderActions;
|
|
7232
|
+
exports.SectionHeaderBadge = SectionHeaderBadge;
|
|
7233
|
+
exports.SectionHeaderContent = SectionHeaderContent;
|
|
7234
|
+
exports.SectionHeaderIcon = SectionHeaderIcon;
|
|
7235
|
+
exports.SectionHeaderRoot = SectionHeaderRoot;
|
|
7236
|
+
exports.SectionHeaderSubtitle = SectionHeaderSubtitle;
|
|
7237
|
+
exports.SectionHeaderTitle = SectionHeaderTitle;
|
|
4351
7238
|
exports.Select = Select;
|
|
4352
7239
|
exports.SelectGroup = SelectGroup;
|
|
4353
7240
|
exports.SelectItem = SelectItem;
|
|
4354
7241
|
exports.SelectLabel = SelectLabel;
|
|
4355
7242
|
exports.SelectSeparator = SelectSeparator;
|
|
4356
7243
|
exports.SelectionLayout = SelectionLayout;
|
|
7244
|
+
exports.Separator = Separator3;
|
|
7245
|
+
exports.Sidebar = Sidebar;
|
|
7246
|
+
exports.Skeleton = Skeleton;
|
|
7247
|
+
exports.Sparkline = Sparkline;
|
|
4357
7248
|
exports.Switch = Switch;
|
|
7249
|
+
exports.THEME_INFO = THEME_INFO;
|
|
4358
7250
|
exports.Table = Table;
|
|
4359
7251
|
exports.TableBody = TableBody;
|
|
4360
7252
|
exports.TableCaption = TableCaption;
|
|
@@ -4369,7 +7261,17 @@ exports.TabsList = TabsList;
|
|
|
4369
7261
|
exports.TabsTrigger = TabsTrigger;
|
|
4370
7262
|
exports.Textarea = Textarea;
|
|
4371
7263
|
exports.ThemeProvider = ThemeProvider;
|
|
7264
|
+
exports.ThemeToggle = ThemeToggle;
|
|
4372
7265
|
exports.Toaster = Toaster;
|
|
7266
|
+
exports.Wizard = Wizard;
|
|
7267
|
+
exports.WizardContent = WizardContent;
|
|
7268
|
+
exports.WizardNavigation = WizardNavigation;
|
|
7269
|
+
exports.WizardPanel = WizardPanel;
|
|
7270
|
+
exports.WizardProgress = WizardProgress;
|
|
7271
|
+
exports.WizardProvider = WizardProvider;
|
|
7272
|
+
exports.WizardStepConnector = WizardStepConnector;
|
|
7273
|
+
exports.WizardStepIndicator = WizardStepIndicator;
|
|
7274
|
+
exports.WizardSteps = WizardSteps;
|
|
4373
7275
|
exports.cn = cn;
|
|
4374
7276
|
exports.loader = loader;
|
|
4375
7277
|
exports.toast = toast;
|
|
@@ -4389,7 +7291,14 @@ exports.useDebounce = useDebounce;
|
|
|
4389
7291
|
exports.useDebouncedCallback = useDebouncedCallback;
|
|
4390
7292
|
exports.useFormContext = useFormContext;
|
|
4391
7293
|
exports.useFormFieldContext = useFormFieldContext;
|
|
7294
|
+
exports.useKanban = useKanban;
|
|
7295
|
+
exports.useKanbanOptional = useKanbanOptional;
|
|
4392
7296
|
exports.useLoader = useLoader;
|
|
7297
|
+
exports.useMediaQuery = useMediaQuery2;
|
|
7298
|
+
exports.useSidebar = useSidebar;
|
|
7299
|
+
exports.useSidebarOptional = useSidebarOptional;
|
|
4393
7300
|
exports.useTheme = useTheme;
|
|
7301
|
+
exports.useWizardContext = useWizardContext;
|
|
7302
|
+
exports.useWizardContextOptional = useWizardContextOptional;
|
|
4394
7303
|
//# sourceMappingURL=index.js.map
|
|
4395
7304
|
//# sourceMappingURL=index.js.map
|