@motor-hero/ui-kit 0.10.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/app-shell.d.ts +1 -1
- package/dist/components/app-shell.d.ts.map +1 -1
- package/dist/components/auth-card.d.ts +1 -1
- package/dist/components/auth-card.d.ts.map +1 -1
- package/dist/components/confirm-dialog.d.ts +1 -1
- package/dist/components/confirm-dialog.d.ts.map +1 -1
- package/dist/components/data-table-wrapper.d.ts +1 -1
- package/dist/components/data-table-wrapper.d.ts.map +1 -1
- package/dist/components/empty-state.d.ts +1 -1
- package/dist/components/empty-state.d.ts.map +1 -1
- package/dist/components/form-dialog.d.ts +33 -1
- package/dist/components/form-dialog.d.ts.map +1 -1
- package/dist/components/form-field.d.ts +1 -1
- package/dist/components/form-field.d.ts.map +1 -1
- package/dist/components/mobile-card-list.d.ts +1 -1
- package/dist/components/mobile-card-list.d.ts.map +1 -1
- package/dist/components/mode-toggle.d.ts +1 -1
- package/dist/components/mode-toggle.d.ts.map +1 -1
- package/dist/components/page-header.d.ts +1 -1
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.d.ts.map +1 -1
- package/dist/components/progress-bar.d.ts +12 -0
- package/dist/components/progress-bar.d.ts.map +1 -0
- package/dist/components/responsive-data-view.d.ts +1 -1
- package/dist/components/responsive-data-view.d.ts.map +1 -1
- package/dist/components/row-actions-menu.d.ts +1 -1
- package/dist/components/row-actions-menu.d.ts.map +1 -1
- package/dist/components/sidebar-nav.d.ts +1 -1
- package/dist/components/sidebar-nav.d.ts.map +1 -1
- package/dist/components/stat-card.d.ts +1 -1
- package/dist/components/stat-card.d.ts.map +1 -1
- package/dist/components/status-badge.d.ts +11 -0
- package/dist/components/status-badge.d.ts.map +1 -0
- package/dist/components/status-dot.d.ts +1 -1
- package/dist/components/status-dot.d.ts.map +1 -1
- package/dist/components/table-skeleton.d.ts +1 -1
- package/dist/components/table-skeleton.d.ts.map +1 -1
- package/dist/components/theme-provider.d.ts +1 -1
- package/dist/components/theme-provider.d.ts.map +1 -1
- package/dist/components/toaster.d.ts +1 -1
- package/dist/components/toaster.d.ts.map +1 -1
- package/dist/components/user-menu.d.ts +1 -1
- package/dist/components/user-menu.d.ts.map +1 -1
- package/dist/index.cjs +321 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +316 -145
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/components/form-dialog.tsx +121 -0
- package/src/components/page-header.tsx +8 -4
- package/src/components/progress-bar.tsx +49 -0
- package/src/components/status-badge.tsx +63 -0
- package/src/index.ts +5 -1
package/dist/index.cjs
CHANGED
|
@@ -35,17 +35,20 @@ __export(index_exports, {
|
|
|
35
35
|
ConfirmDialog: () => ConfirmDialog,
|
|
36
36
|
DataTableWrapper: () => DataTableWrapper,
|
|
37
37
|
EmptyState: () => EmptyState,
|
|
38
|
+
FormDialog: () => FormDialog,
|
|
38
39
|
FormDialogLayout: () => FormDialogLayout,
|
|
39
40
|
FormField: () => FormField,
|
|
40
41
|
MobileCardList: () => MobileCardList,
|
|
41
42
|
ModeToggle: () => ModeToggle,
|
|
42
43
|
PageHeader: () => PageHeader,
|
|
43
44
|
Pagination: () => Pagination,
|
|
45
|
+
ProgressBar: () => ProgressBar,
|
|
44
46
|
ResponsiveDataView: () => ResponsiveDataView,
|
|
45
47
|
RowActionsMenu: () => RowActionsMenu,
|
|
46
48
|
SearchInput: () => SearchInput,
|
|
47
49
|
SidebarNav: () => SidebarNav,
|
|
48
50
|
StatCard: () => StatCard,
|
|
51
|
+
StatusBadge: () => StatusBadge,
|
|
49
52
|
StatusDot: () => StatusDot,
|
|
50
53
|
TableSkeleton: () => TableSkeleton,
|
|
51
54
|
ThemeProvider: () => ThemeProvider,
|
|
@@ -220,13 +223,19 @@ function ConfirmDialog({
|
|
|
220
223
|
// src/components/page-header.tsx
|
|
221
224
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
222
225
|
function PageHeader({ title, description, action, className }) {
|
|
223
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
className: `flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between ${className ?? ""}`,
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "min-w-0", children: [
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { className: "truncate text-2xl font-semibold tracking-tight", children: title }),
|
|
233
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-muted-foreground", children: description })
|
|
234
|
+
] }),
|
|
235
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "shrink-0", children: action })
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
);
|
|
230
239
|
}
|
|
231
240
|
|
|
232
241
|
// src/components/status-dot.tsx
|
|
@@ -243,28 +252,124 @@ function StatusDot({ active, label, className }) {
|
|
|
243
252
|
] });
|
|
244
253
|
}
|
|
245
254
|
|
|
246
|
-
// src/components/
|
|
255
|
+
// src/components/status-badge.tsx
|
|
247
256
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
257
|
+
var variantClasses = {
|
|
258
|
+
neutral: {
|
|
259
|
+
badge: "bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300",
|
|
260
|
+
dot: "bg-gray-400"
|
|
261
|
+
},
|
|
262
|
+
info: {
|
|
263
|
+
badge: "bg-blue-100 text-blue-700 dark:bg-blue-950 dark:text-blue-400",
|
|
264
|
+
dot: "bg-blue-500"
|
|
265
|
+
},
|
|
266
|
+
success: {
|
|
267
|
+
badge: "bg-green-100 text-green-700 dark:bg-green-950 dark:text-green-400",
|
|
268
|
+
dot: "bg-green-500"
|
|
269
|
+
},
|
|
270
|
+
danger: {
|
|
271
|
+
badge: "bg-red-100 text-red-700 dark:bg-red-950 dark:text-red-400",
|
|
272
|
+
dot: "bg-red-500"
|
|
273
|
+
},
|
|
274
|
+
warning: {
|
|
275
|
+
badge: "bg-amber-100 text-amber-700 dark:bg-amber-950 dark:text-amber-400",
|
|
276
|
+
dot: "bg-amber-500"
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
function StatusBadge({
|
|
280
|
+
variant = "neutral",
|
|
281
|
+
dot = true,
|
|
282
|
+
className,
|
|
283
|
+
children
|
|
284
|
+
}) {
|
|
285
|
+
const classes = variantClasses[variant];
|
|
286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
287
|
+
"span",
|
|
288
|
+
{
|
|
289
|
+
className: `inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 text-xs font-medium ${classes.badge} ${className ?? ""}`,
|
|
290
|
+
children: [
|
|
291
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
292
|
+
"span",
|
|
293
|
+
{
|
|
294
|
+
className: `inline-block h-1.5 w-1.5 shrink-0 rounded-full ${classes.dot}`
|
|
295
|
+
}
|
|
296
|
+
),
|
|
297
|
+
children
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// src/components/progress-bar.tsx
|
|
304
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
305
|
+
var sizeClasses = {
|
|
306
|
+
sm: "h-1.5",
|
|
307
|
+
md: "h-2"
|
|
308
|
+
};
|
|
309
|
+
function ProgressBar({
|
|
310
|
+
value,
|
|
311
|
+
size = "md",
|
|
312
|
+
label,
|
|
313
|
+
valueLabel,
|
|
314
|
+
className,
|
|
315
|
+
indicatorClassName
|
|
316
|
+
}) {
|
|
317
|
+
const clamped = Math.min(100, Math.max(0, value));
|
|
318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `space-y-1.5 ${className ?? ""}`, children: [
|
|
319
|
+
(label || valueLabel) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
320
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm text-muted-foreground", children: label }),
|
|
321
|
+
valueLabel && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm font-semibold", children: valueLabel })
|
|
322
|
+
] }),
|
|
323
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
className: `w-full overflow-hidden rounded-full bg-muted ${sizeClasses[size]}`,
|
|
327
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
328
|
+
"div",
|
|
329
|
+
{
|
|
330
|
+
className: `h-full rounded-full transition-all duration-300 ${indicatorClassName ?? "bg-primary"}`,
|
|
331
|
+
style: { width: `${clamped}%` }
|
|
332
|
+
}
|
|
333
|
+
)
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
] });
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// src/components/form-field.tsx
|
|
340
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
248
341
|
function FormField({ label, htmlFor, error, required, children, className }) {
|
|
249
|
-
return /* @__PURE__ */ (0,
|
|
250
|
-
/* @__PURE__ */ (0,
|
|
342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `space-y-2 ${className ?? ""}`, children: [
|
|
343
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
251
344
|
"label",
|
|
252
345
|
{
|
|
253
346
|
htmlFor,
|
|
254
347
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
255
348
|
children: [
|
|
256
349
|
label,
|
|
257
|
-
required && /* @__PURE__ */ (0,
|
|
350
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ml-1 text-destructive", children: "*" })
|
|
258
351
|
]
|
|
259
352
|
}
|
|
260
353
|
),
|
|
261
354
|
children,
|
|
262
|
-
error && /* @__PURE__ */ (0,
|
|
355
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm text-destructive", children: error })
|
|
263
356
|
] });
|
|
264
357
|
}
|
|
265
358
|
|
|
266
359
|
// src/components/form-dialog.tsx
|
|
267
|
-
var
|
|
360
|
+
var Dialog = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
361
|
+
var import_lucide_react2 = require("lucide-react");
|
|
362
|
+
var React = __toESM(require("react"), 1);
|
|
363
|
+
|
|
364
|
+
// src/lib/utils.ts
|
|
365
|
+
var import_clsx = require("clsx");
|
|
366
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
367
|
+
function cn(...inputs) {
|
|
368
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// src/components/form-dialog.tsx
|
|
372
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
268
373
|
function FormDialogLayout({
|
|
269
374
|
title,
|
|
270
375
|
children,
|
|
@@ -275,11 +380,11 @@ function FormDialogLayout({
|
|
|
275
380
|
isSubmitting = false,
|
|
276
381
|
isDisabled = false
|
|
277
382
|
}) {
|
|
278
|
-
return /* @__PURE__ */ (0,
|
|
279
|
-
/* @__PURE__ */ (0,
|
|
280
|
-
/* @__PURE__ */ (0,
|
|
281
|
-
/* @__PURE__ */ (0,
|
|
282
|
-
/* @__PURE__ */ (0,
|
|
383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { onSubmit, children: [
|
|
384
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col space-y-1.5 text-center sm:text-left", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { className: "text-lg font-semibold leading-none tracking-tight", children: title }) }),
|
|
385
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-4 py-4", children }),
|
|
386
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
387
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
283
388
|
"button",
|
|
284
389
|
{
|
|
285
390
|
type: "button",
|
|
@@ -288,7 +393,7 @@ function FormDialogLayout({
|
|
|
288
393
|
children: cancelLabel
|
|
289
394
|
}
|
|
290
395
|
),
|
|
291
|
-
/* @__PURE__ */ (0,
|
|
396
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
292
397
|
"button",
|
|
293
398
|
{
|
|
294
399
|
type: "submit",
|
|
@@ -300,25 +405,98 @@ function FormDialogLayout({
|
|
|
300
405
|
] })
|
|
301
406
|
] });
|
|
302
407
|
}
|
|
408
|
+
var sizeClasses2 = {
|
|
409
|
+
sm: "sm:max-w-sm",
|
|
410
|
+
md: "sm:max-w-md",
|
|
411
|
+
lg: "sm:max-w-lg",
|
|
412
|
+
xl: "sm:max-w-xl",
|
|
413
|
+
"2xl": "sm:max-w-2xl"
|
|
414
|
+
};
|
|
415
|
+
function FormDialog({
|
|
416
|
+
open,
|
|
417
|
+
onOpenChange,
|
|
418
|
+
title,
|
|
419
|
+
description,
|
|
420
|
+
children,
|
|
421
|
+
footer,
|
|
422
|
+
onSubmit,
|
|
423
|
+
size = "lg",
|
|
424
|
+
className
|
|
425
|
+
}) {
|
|
426
|
+
React.useEffect(() => {
|
|
427
|
+
if (open) return;
|
|
428
|
+
const id = window.setTimeout(() => {
|
|
429
|
+
if (document.body.style.pointerEvents === "none") {
|
|
430
|
+
document.body.style.pointerEvents = "";
|
|
431
|
+
}
|
|
432
|
+
}, 0);
|
|
433
|
+
return () => window.clearTimeout(id);
|
|
434
|
+
}, [open]);
|
|
435
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
436
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex shrink-0 items-start justify-between gap-4 border-b px-6 py-4", children: [
|
|
437
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
438
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog.Title, { className: "text-lg font-semibold leading-none tracking-tight", children: title }),
|
|
439
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog.Description, { className: "text-sm text-muted-foreground", children: description })
|
|
440
|
+
] }),
|
|
441
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
442
|
+
Dialog.Close,
|
|
443
|
+
{
|
|
444
|
+
className: "-mr-1 shrink-0 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
445
|
+
"aria-label": "Fechar",
|
|
446
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.X, { className: "h-5 w-5" })
|
|
447
|
+
}
|
|
448
|
+
)
|
|
449
|
+
] }),
|
|
450
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto px-6 py-4", children }),
|
|
451
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex shrink-0 flex-col-reverse gap-2 border-t px-6 py-4 sm:flex-row sm:justify-end", children: footer })
|
|
452
|
+
] });
|
|
453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog.Root, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Dialog.Portal, { children: [
|
|
454
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog.Overlay, { className: "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }),
|
|
455
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
456
|
+
Dialog.Content,
|
|
457
|
+
{
|
|
458
|
+
onCloseAutoFocus: () => {
|
|
459
|
+
document.body.style.pointerEvents = "";
|
|
460
|
+
},
|
|
461
|
+
className: cn(
|
|
462
|
+
"fixed z-50 flex max-h-[92vh] flex-col bg-background shadow-lg outline-none",
|
|
463
|
+
"inset-x-0 bottom-0 rounded-t-2xl",
|
|
464
|
+
"sm:inset-x-auto sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:max-h-[90vh] sm:w-full sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-lg",
|
|
465
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
466
|
+
sizeClasses2[size],
|
|
467
|
+
className
|
|
468
|
+
),
|
|
469
|
+
children: onSubmit ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
470
|
+
"form",
|
|
471
|
+
{
|
|
472
|
+
onSubmit,
|
|
473
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
474
|
+
children: body
|
|
475
|
+
}
|
|
476
|
+
) : body
|
|
477
|
+
}
|
|
478
|
+
)
|
|
479
|
+
] }) });
|
|
480
|
+
}
|
|
303
481
|
|
|
304
482
|
// src/components/auth-card.tsx
|
|
305
|
-
var
|
|
483
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
306
484
|
function AuthCard({ title, description, children, footer }) {
|
|
307
|
-
return /* @__PURE__ */ (0,
|
|
308
|
-
/* @__PURE__ */ (0,
|
|
309
|
-
/* @__PURE__ */ (0,
|
|
310
|
-
description && /* @__PURE__ */ (0,
|
|
485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex min-h-screen items-center justify-center px-4", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w-full max-w-sm rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
486
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "mb-6 text-center", children: [
|
|
487
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h1", { className: "text-2xl font-semibold tracking-tight", children: title }),
|
|
488
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
|
|
311
489
|
] }),
|
|
312
|
-
/* @__PURE__ */ (0,
|
|
313
|
-
footer && /* @__PURE__ */ (0,
|
|
490
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "space-y-4", children }),
|
|
491
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "mt-4", children: footer })
|
|
314
492
|
] }) });
|
|
315
493
|
}
|
|
316
494
|
|
|
317
495
|
// src/components/pagination.tsx
|
|
318
|
-
var
|
|
496
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
319
497
|
function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, className }) {
|
|
320
|
-
return /* @__PURE__ */ (0,
|
|
321
|
-
/* @__PURE__ */ (0,
|
|
498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `flex items-center justify-end gap-4 ${className ?? ""}`, children: [
|
|
499
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
322
500
|
"button",
|
|
323
501
|
{
|
|
324
502
|
type: "button",
|
|
@@ -328,11 +506,11 @@ function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, classNam
|
|
|
328
506
|
children: "Anterior"
|
|
329
507
|
}
|
|
330
508
|
),
|
|
331
|
-
/* @__PURE__ */ (0,
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "text-sm text-muted-foreground", children: [
|
|
332
510
|
"P\xE1gina ",
|
|
333
511
|
page
|
|
334
512
|
] }),
|
|
335
|
-
/* @__PURE__ */ (0,
|
|
513
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
336
514
|
"button",
|
|
337
515
|
{
|
|
338
516
|
type: "button",
|
|
@@ -346,18 +524,18 @@ function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, classNam
|
|
|
346
524
|
}
|
|
347
525
|
|
|
348
526
|
// src/components/table-skeleton.tsx
|
|
349
|
-
var
|
|
527
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
350
528
|
function TableSkeleton({ rows = 5, columns = 4 }) {
|
|
351
|
-
return /* @__PURE__ */ (0,
|
|
529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tr", { className: "border-b transition-colors", children: Array.from({ length: columns }).map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("td", { className: "p-4 align-middle", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "h-5 w-full animate-pulse rounded bg-muted" }) }, j)) }, i)) });
|
|
352
530
|
}
|
|
353
531
|
|
|
354
532
|
// src/components/search-input.tsx
|
|
355
|
-
var
|
|
356
|
-
var
|
|
357
|
-
var SearchInput =
|
|
533
|
+
var React2 = __toESM(require("react"), 1);
|
|
534
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
535
|
+
var SearchInput = React2.forwardRef(
|
|
358
536
|
({ containerClassName, className, ...props }, ref) => {
|
|
359
|
-
return /* @__PURE__ */ (0,
|
|
360
|
-
/* @__PURE__ */ (0,
|
|
537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: `relative flex-1 ${containerClassName ?? ""}`, children: [
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
361
539
|
"svg",
|
|
362
540
|
{
|
|
363
541
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -371,12 +549,12 @@ var SearchInput = React.forwardRef(
|
|
|
371
549
|
strokeLinejoin: "round",
|
|
372
550
|
className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",
|
|
373
551
|
children: [
|
|
374
|
-
/* @__PURE__ */ (0,
|
|
375
|
-
/* @__PURE__ */ (0,
|
|
552
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
|
|
553
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "m21 21-4.3-4.3" })
|
|
376
554
|
]
|
|
377
555
|
}
|
|
378
556
|
),
|
|
379
|
-
/* @__PURE__ */ (0,
|
|
557
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
380
558
|
"input",
|
|
381
559
|
{
|
|
382
560
|
ref,
|
|
@@ -391,30 +569,30 @@ var SearchInput = React.forwardRef(
|
|
|
391
569
|
SearchInput.displayName = "SearchInput";
|
|
392
570
|
|
|
393
571
|
// src/components/stat-card.tsx
|
|
394
|
-
var
|
|
572
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
395
573
|
function StatCard({ label, value, detail, icon, isLoading }) {
|
|
396
574
|
if (isLoading) {
|
|
397
|
-
return /* @__PURE__ */ (0,
|
|
398
|
-
/* @__PURE__ */ (0,
|
|
399
|
-
/* @__PURE__ */ (0,
|
|
400
|
-
/* @__PURE__ */ (0,
|
|
575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
576
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between pb-2", children: [
|
|
577
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
578
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "h-4 w-4 animate-pulse rounded bg-muted" })
|
|
401
579
|
] }),
|
|
402
|
-
/* @__PURE__ */ (0,
|
|
403
|
-
/* @__PURE__ */ (0,
|
|
580
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mt-2 h-7 w-16 animate-pulse rounded bg-muted" }),
|
|
581
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mt-1 h-4 w-20 animate-pulse rounded bg-muted" })
|
|
404
582
|
] });
|
|
405
583
|
}
|
|
406
|
-
return /* @__PURE__ */ (0,
|
|
407
|
-
/* @__PURE__ */ (0,
|
|
408
|
-
/* @__PURE__ */ (0,
|
|
409
|
-
icon && /* @__PURE__ */ (0,
|
|
584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
585
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between pb-2", children: [
|
|
586
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-sm font-medium text-muted-foreground", children: label }),
|
|
587
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-muted-foreground", children: icon })
|
|
410
588
|
] }),
|
|
411
|
-
/* @__PURE__ */ (0,
|
|
412
|
-
detail && /* @__PURE__ */ (0,
|
|
589
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "text-2xl font-bold", children: value }),
|
|
590
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-muted-foreground", children: detail })
|
|
413
591
|
] });
|
|
414
592
|
}
|
|
415
593
|
|
|
416
594
|
// src/components/data-table-wrapper.tsx
|
|
417
|
-
var
|
|
595
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
418
596
|
function DataTableWrapper({
|
|
419
597
|
children,
|
|
420
598
|
isEmpty,
|
|
@@ -427,15 +605,15 @@ function DataTableWrapper({
|
|
|
427
605
|
hasNextPage = false,
|
|
428
606
|
hasPreviousPage = false
|
|
429
607
|
}) {
|
|
430
|
-
return /* @__PURE__ */ (0,
|
|
431
|
-
/* @__PURE__ */ (0,
|
|
432
|
-
!isLoading && isEmpty && /* @__PURE__ */ (0,
|
|
433
|
-
emptyIcon && /* @__PURE__ */ (0,
|
|
434
|
-
/* @__PURE__ */ (0,
|
|
435
|
-
emptyDescription && /* @__PURE__ */ (0,
|
|
608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-4", children: [
|
|
609
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "overflow-x-auto rounded-md border", children }),
|
|
610
|
+
!isLoading && isEmpty && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
611
|
+
emptyIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
612
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
613
|
+
emptyDescription && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
436
614
|
] }),
|
|
437
|
-
page !== void 0 && onPageChange && /* @__PURE__ */ (0,
|
|
438
|
-
/* @__PURE__ */ (0,
|
|
615
|
+
page !== void 0 && onPageChange && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-end gap-4", children: [
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
439
617
|
"button",
|
|
440
618
|
{
|
|
441
619
|
type: "button",
|
|
@@ -445,11 +623,11 @@ function DataTableWrapper({
|
|
|
445
623
|
children: "Anterior"
|
|
446
624
|
}
|
|
447
625
|
),
|
|
448
|
-
/* @__PURE__ */ (0,
|
|
626
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "text-sm text-muted-foreground", children: [
|
|
449
627
|
"P\xE1gina ",
|
|
450
628
|
page
|
|
451
629
|
] }),
|
|
452
|
-
/* @__PURE__ */ (0,
|
|
630
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
453
631
|
"button",
|
|
454
632
|
{
|
|
455
633
|
type: "button",
|
|
@@ -464,7 +642,7 @@ function DataTableWrapper({
|
|
|
464
642
|
}
|
|
465
643
|
|
|
466
644
|
// src/components/mobile-card-list.tsx
|
|
467
|
-
var
|
|
645
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
468
646
|
function MobileCardList({
|
|
469
647
|
data,
|
|
470
648
|
renderCard,
|
|
@@ -474,19 +652,19 @@ function MobileCardList({
|
|
|
474
652
|
className
|
|
475
653
|
}) {
|
|
476
654
|
if (isLoading) {
|
|
477
|
-
return /* @__PURE__ */ (0,
|
|
478
|
-
/* @__PURE__ */ (0,
|
|
479
|
-
/* @__PURE__ */ (0,
|
|
480
|
-
/* @__PURE__ */ (0,
|
|
655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: `space-y-3 ${className ?? ""}`, children: Array.from({ length: loadingCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rounded-xl border p-4", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "space-y-3", children: [
|
|
656
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between", children: [
|
|
657
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-5 w-32 animate-pulse rounded bg-muted" }),
|
|
658
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-5 w-16 animate-pulse rounded bg-muted" })
|
|
481
659
|
] }),
|
|
482
|
-
/* @__PURE__ */ (0,
|
|
483
|
-
/* @__PURE__ */ (0,
|
|
484
|
-
/* @__PURE__ */ (0,
|
|
485
|
-
/* @__PURE__ */ (0,
|
|
660
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-4 w-48 animate-pulse rounded bg-muted" }),
|
|
661
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between", children: [
|
|
662
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
663
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" })
|
|
486
664
|
] })
|
|
487
665
|
] }) }, i)) });
|
|
488
666
|
}
|
|
489
|
-
return /* @__PURE__ */ (0,
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: `space-y-3 ${className ?? ""}`, children: data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
490
668
|
"div",
|
|
491
669
|
{
|
|
492
670
|
className: "rounded-xl border p-4 transition-all duration-150 hover:border-foreground/20 active:scale-[0.99]",
|
|
@@ -497,7 +675,7 @@ function MobileCardList({
|
|
|
497
675
|
}
|
|
498
676
|
|
|
499
677
|
// src/components/responsive-data-view.tsx
|
|
500
|
-
var
|
|
678
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
501
679
|
function ResponsiveDataView({
|
|
502
680
|
table,
|
|
503
681
|
cards,
|
|
@@ -508,13 +686,13 @@ function ResponsiveDataView({
|
|
|
508
686
|
emptyDescription,
|
|
509
687
|
pagination
|
|
510
688
|
}) {
|
|
511
|
-
return /* @__PURE__ */ (0,
|
|
512
|
-
/* @__PURE__ */ (0,
|
|
513
|
-
/* @__PURE__ */ (0,
|
|
514
|
-
!isLoading && isEmpty && /* @__PURE__ */ (0,
|
|
515
|
-
emptyIcon && /* @__PURE__ */ (0,
|
|
516
|
-
/* @__PURE__ */ (0,
|
|
517
|
-
emptyDescription && /* @__PURE__ */ (0,
|
|
689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-4", children: [
|
|
690
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
|
|
691
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "md:hidden", children: cards }),
|
|
692
|
+
!isLoading && isEmpty && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
693
|
+
emptyIcon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
694
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
695
|
+
emptyDescription && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
518
696
|
] }),
|
|
519
697
|
pagination
|
|
520
698
|
] });
|
|
@@ -522,10 +700,10 @@ function ResponsiveDataView({
|
|
|
522
700
|
|
|
523
701
|
// src/components/toaster.tsx
|
|
524
702
|
var import_sonner = require("sonner");
|
|
525
|
-
var
|
|
703
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
526
704
|
function Toaster(props) {
|
|
527
705
|
const { theme = "system" } = useTheme();
|
|
528
|
-
return /* @__PURE__ */ (0,
|
|
706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
529
707
|
import_sonner.Toaster,
|
|
530
708
|
{
|
|
531
709
|
theme,
|
|
@@ -546,25 +724,18 @@ function Toaster(props) {
|
|
|
546
724
|
}
|
|
547
725
|
|
|
548
726
|
// src/components/app-shell.tsx
|
|
549
|
-
var
|
|
727
|
+
var import_lucide_react4 = require("lucide-react");
|
|
550
728
|
var import_react3 = require("react");
|
|
551
729
|
|
|
552
|
-
// src/lib/utils.ts
|
|
553
|
-
var import_clsx = require("clsx");
|
|
554
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
555
|
-
function cn(...inputs) {
|
|
556
|
-
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
557
|
-
}
|
|
558
|
-
|
|
559
730
|
// src/components/sidebar-nav.tsx
|
|
560
731
|
var import_react2 = require("react");
|
|
561
732
|
|
|
562
733
|
// src/components/types.tsx
|
|
563
|
-
var
|
|
564
|
-
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */ (0,
|
|
734
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
735
|
+
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("a", { ...props, children });
|
|
565
736
|
|
|
566
737
|
// src/components/sidebar-nav.tsx
|
|
567
|
-
var
|
|
738
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
568
739
|
function defaultIsActive(item, activePath) {
|
|
569
740
|
if (item.href === "/") return activePath === "/";
|
|
570
741
|
return activePath === item.href || activePath.startsWith(item.href + "/");
|
|
@@ -579,7 +750,7 @@ function SidebarNav({
|
|
|
579
750
|
onNavigate
|
|
580
751
|
}) {
|
|
581
752
|
const visible = items.filter((item) => !item.adminOnly || isAdmin);
|
|
582
|
-
return /* @__PURE__ */ (0,
|
|
753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("nav", { className: "flex flex-col gap-1", children: visible.map((item) => {
|
|
583
754
|
const active = isActive(item, activePath);
|
|
584
755
|
const link = renderLink({
|
|
585
756
|
href: item.href,
|
|
@@ -591,19 +762,19 @@ function SidebarNav({
|
|
|
591
762
|
active ? "bg-accent text-accent-foreground font-semibold" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
592
763
|
isCollapsed && "justify-center px-2"
|
|
593
764
|
),
|
|
594
|
-
children: /* @__PURE__ */ (0,
|
|
595
|
-
item.icon && /* @__PURE__ */ (0,
|
|
596
|
-
!isCollapsed && /* @__PURE__ */ (0,
|
|
765
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
766
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "shrink-0", children: item.icon }),
|
|
767
|
+
!isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "truncate", children: item.label })
|
|
597
768
|
] })
|
|
598
769
|
});
|
|
599
|
-
return /* @__PURE__ */ (0,
|
|
770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react2.Fragment, { children: link }, item.href);
|
|
600
771
|
}) });
|
|
601
772
|
}
|
|
602
773
|
|
|
603
774
|
// src/components/user-menu.tsx
|
|
604
775
|
var DropdownMenu2 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
605
|
-
var
|
|
606
|
-
var
|
|
776
|
+
var import_lucide_react3 = require("lucide-react");
|
|
777
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
607
778
|
function initials(user) {
|
|
608
779
|
const source = user?.name?.trim() || user?.email?.trim();
|
|
609
780
|
if (!source) return "";
|
|
@@ -621,44 +792,44 @@ function UserMenu({
|
|
|
621
792
|
align = "end"
|
|
622
793
|
}) {
|
|
623
794
|
const label = initials(user);
|
|
624
|
-
return /* @__PURE__ */ (0,
|
|
625
|
-
/* @__PURE__ */ (0,
|
|
795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DropdownMenu2.Root, { children: [
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenu2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
626
797
|
"button",
|
|
627
798
|
{
|
|
628
799
|
type: "button",
|
|
629
800
|
className: "inline-flex h-9 w-9 items-center justify-center overflow-hidden rounded-full border border-input bg-background text-xs font-semibold shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
630
801
|
"aria-label": "Menu do usu\xE1rio",
|
|
631
802
|
"data-testid": "user-menu",
|
|
632
|
-
children: user?.avatarUrl ? /* @__PURE__ */ (0,
|
|
803
|
+
children: user?.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: user.avatarUrl, alt: user.name ?? user.email ?? "Avatar", className: "h-full w-full object-cover" }) : label ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react3.User, { className: "h-4 w-4" })
|
|
633
804
|
}
|
|
634
805
|
) }),
|
|
635
|
-
/* @__PURE__ */ (0,
|
|
806
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenu2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
636
807
|
DropdownMenu2.Content,
|
|
637
808
|
{
|
|
638
809
|
align,
|
|
639
810
|
sideOffset: 6,
|
|
640
811
|
className: "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
|
|
641
812
|
children: [
|
|
642
|
-
(user?.name || user?.email) && /* @__PURE__ */ (0,
|
|
643
|
-
/* @__PURE__ */ (0,
|
|
644
|
-
user.name && /* @__PURE__ */ (0,
|
|
645
|
-
user.email && /* @__PURE__ */ (0,
|
|
813
|
+
(user?.name || user?.email) && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
814
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "px-2 py-1.5", children: [
|
|
815
|
+
user.name && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "truncate text-sm font-medium", children: user.name }),
|
|
816
|
+
user.email && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
646
817
|
] }),
|
|
647
|
-
/* @__PURE__ */ (0,
|
|
818
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" })
|
|
648
819
|
] }),
|
|
649
820
|
items.map(
|
|
650
|
-
(item) => item.href ? /* @__PURE__ */ (0,
|
|
821
|
+
(item) => item.href ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenu2.Item, { asChild: true, children: renderLink({ href: item.href, className: itemClass, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
651
822
|
item.icon,
|
|
652
823
|
item.label
|
|
653
|
-
] }) }) }, item.label) : /* @__PURE__ */ (0,
|
|
824
|
+
] }) }) }, item.label) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DropdownMenu2.Item, { className: itemClass, onClick: item.onClick, children: [
|
|
654
825
|
item.icon,
|
|
655
826
|
item.label
|
|
656
827
|
] }, item.label)
|
|
657
828
|
),
|
|
658
|
-
onLogout && /* @__PURE__ */ (0,
|
|
659
|
-
items.length > 0 && /* @__PURE__ */ (0,
|
|
660
|
-
/* @__PURE__ */ (0,
|
|
661
|
-
/* @__PURE__ */ (0,
|
|
829
|
+
onLogout && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
830
|
+
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" }),
|
|
831
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DropdownMenu2.Item, { className: cn(itemClass, "text-destructive focus:bg-destructive/10"), onClick: onLogout, children: [
|
|
832
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react3.LogOut, { className: "h-4 w-4" }),
|
|
662
833
|
logoutLabel
|
|
663
834
|
] })
|
|
664
835
|
] })
|
|
@@ -669,7 +840,7 @@ function UserMenu({
|
|
|
669
840
|
}
|
|
670
841
|
|
|
671
842
|
// src/components/app-shell.tsx
|
|
672
|
-
var
|
|
843
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
673
844
|
function AppShell({
|
|
674
845
|
brand,
|
|
675
846
|
brandCollapsed,
|
|
@@ -688,7 +859,7 @@ function AppShell({
|
|
|
688
859
|
}) {
|
|
689
860
|
const [collapsed, setCollapsed] = (0, import_react3.useState)(defaultCollapsed);
|
|
690
861
|
const [mobileOpen, setMobileOpen] = (0, import_react3.useState)(false);
|
|
691
|
-
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */ (0,
|
|
862
|
+
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
692
863
|
SidebarNav,
|
|
693
864
|
{
|
|
694
865
|
items: navItems,
|
|
@@ -700,8 +871,8 @@ function AppShell({
|
|
|
700
871
|
onNavigate
|
|
701
872
|
}
|
|
702
873
|
);
|
|
703
|
-
return /* @__PURE__ */ (0,
|
|
704
|
-
/* @__PURE__ */ (0,
|
|
874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex h-screen overflow-hidden bg-background", children: [
|
|
875
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
705
876
|
"aside",
|
|
706
877
|
{
|
|
707
878
|
className: cn(
|
|
@@ -709,22 +880,22 @@ function AppShell({
|
|
|
709
880
|
collapsed ? "w-16" : "w-60"
|
|
710
881
|
),
|
|
711
882
|
children: [
|
|
712
|
-
/* @__PURE__ */ (0,
|
|
713
|
-
/* @__PURE__ */ (0,
|
|
714
|
-
collapsible && /* @__PURE__ */ (0,
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(collapsed) }),
|
|
885
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "border-t p-2", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
715
886
|
"button",
|
|
716
887
|
{
|
|
717
888
|
type: "button",
|
|
718
889
|
onClick: () => setCollapsed((v) => !v),
|
|
719
890
|
className: "flex w-full items-center justify-center rounded-md px-2 py-2 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
720
891
|
"aria-label": collapsed ? "Expandir menu" : "Recolher menu",
|
|
721
|
-
children: collapsed ? /* @__PURE__ */ (0,
|
|
892
|
+
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react4.ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react4.ChevronLeft, { className: "h-4 w-4" })
|
|
722
893
|
}
|
|
723
894
|
) })
|
|
724
895
|
]
|
|
725
896
|
}
|
|
726
897
|
),
|
|
727
|
-
/* @__PURE__ */ (0,
|
|
898
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
728
899
|
"div",
|
|
729
900
|
{
|
|
730
901
|
className: cn(
|
|
@@ -733,8 +904,8 @@ function AppShell({
|
|
|
733
904
|
),
|
|
734
905
|
onClick: () => setMobileOpen(false),
|
|
735
906
|
children: [
|
|
736
|
-
/* @__PURE__ */ (0,
|
|
737
|
-
/* @__PURE__ */ (0,
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute inset-0 bg-black/50" }),
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
738
909
|
"div",
|
|
739
910
|
{
|
|
740
911
|
className: cn(
|
|
@@ -743,40 +914,40 @@ function AppShell({
|
|
|
743
914
|
),
|
|
744
915
|
onClick: (e) => e.stopPropagation(),
|
|
745
916
|
children: [
|
|
746
|
-
/* @__PURE__ */ (0,
|
|
747
|
-
/* @__PURE__ */ (0,
|
|
917
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: brand }),
|
|
918
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(false, () => setMobileOpen(false)) })
|
|
748
919
|
]
|
|
749
920
|
}
|
|
750
921
|
)
|
|
751
922
|
]
|
|
752
923
|
}
|
|
753
924
|
),
|
|
754
|
-
/* @__PURE__ */ (0,
|
|
755
|
-
/* @__PURE__ */ (0,
|
|
756
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("header", { className: "flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4", children: [
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
757
928
|
"button",
|
|
758
929
|
{
|
|
759
930
|
type: "button",
|
|
760
931
|
onClick: () => setMobileOpen(true),
|
|
761
932
|
className: "inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground md:hidden",
|
|
762
933
|
"aria-label": "Abrir menu",
|
|
763
|
-
children: /* @__PURE__ */ (0,
|
|
934
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react4.Menu, { className: "h-4 w-4" })
|
|
764
935
|
}
|
|
765
936
|
),
|
|
766
|
-
/* @__PURE__ */ (0,
|
|
937
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
767
938
|
headerActions,
|
|
768
|
-
(user || onLogout) && /* @__PURE__ */ (0,
|
|
939
|
+
(user || onLogout) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(UserMenu, { user, items: userMenuItems, onLogout, renderLink })
|
|
769
940
|
] })
|
|
770
941
|
] }),
|
|
771
|
-
/* @__PURE__ */ (0,
|
|
942
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("main", { className: "flex-1 overflow-y-auto", children })
|
|
772
943
|
] })
|
|
773
944
|
] });
|
|
774
945
|
}
|
|
775
946
|
|
|
776
947
|
// src/components/row-actions-menu.tsx
|
|
777
948
|
var DropdownMenu3 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
778
|
-
var
|
|
779
|
-
var
|
|
949
|
+
var import_lucide_react5 = require("lucide-react");
|
|
950
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
780
951
|
var itemClass2 = "flex w-full cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
|
|
781
952
|
function RowActionsMenu({
|
|
782
953
|
actions,
|
|
@@ -786,18 +957,18 @@ function RowActionsMenu({
|
|
|
786
957
|
renderLink = defaultRenderLink
|
|
787
958
|
}) {
|
|
788
959
|
if (actions.length === 0) return null;
|
|
789
|
-
return /* @__PURE__ */ (0,
|
|
790
|
-
/* @__PURE__ */ (0,
|
|
960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenu3.Root, { children: [
|
|
961
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
791
962
|
"button",
|
|
792
963
|
{
|
|
793
964
|
type: "button",
|
|
794
965
|
disabled,
|
|
795
966
|
"aria-label": label,
|
|
796
967
|
className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
797
|
-
children: /* @__PURE__ */ (0,
|
|
968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.MoreVertical, { className: "h-4 w-4" })
|
|
798
969
|
}
|
|
799
970
|
) }),
|
|
800
|
-
/* @__PURE__ */ (0,
|
|
971
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu3.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
801
972
|
DropdownMenu3.Content,
|
|
802
973
|
{
|
|
803
974
|
align,
|
|
@@ -805,14 +976,14 @@ function RowActionsMenu({
|
|
|
805
976
|
className: "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
|
|
806
977
|
children: actions.map((action) => {
|
|
807
978
|
const cls = cn(itemClass2, action.destructive && "text-destructive focus:bg-destructive/10");
|
|
808
|
-
return action.href ? /* @__PURE__ */ (0,
|
|
979
|
+
return action.href ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu3.Item, { asChild: true, disabled: action.disabled, children: renderLink({
|
|
809
980
|
href: action.href,
|
|
810
981
|
className: cls,
|
|
811
|
-
children: /* @__PURE__ */ (0,
|
|
982
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
812
983
|
action.icon,
|
|
813
984
|
action.label
|
|
814
985
|
] })
|
|
815
|
-
}) }, action.label) : /* @__PURE__ */ (0,
|
|
986
|
+
}) }, action.label) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
816
987
|
DropdownMenu3.Item,
|
|
817
988
|
{
|
|
818
989
|
className: cls,
|
|
@@ -882,17 +1053,20 @@ function useCustomToast() {
|
|
|
882
1053
|
ConfirmDialog,
|
|
883
1054
|
DataTableWrapper,
|
|
884
1055
|
EmptyState,
|
|
1056
|
+
FormDialog,
|
|
885
1057
|
FormDialogLayout,
|
|
886
1058
|
FormField,
|
|
887
1059
|
MobileCardList,
|
|
888
1060
|
ModeToggle,
|
|
889
1061
|
PageHeader,
|
|
890
1062
|
Pagination,
|
|
1063
|
+
ProgressBar,
|
|
891
1064
|
ResponsiveDataView,
|
|
892
1065
|
RowActionsMenu,
|
|
893
1066
|
SearchInput,
|
|
894
1067
|
SidebarNav,
|
|
895
1068
|
StatCard,
|
|
1069
|
+
StatusBadge,
|
|
896
1070
|
StatusDot,
|
|
897
1071
|
TableSkeleton,
|
|
898
1072
|
ThemeProvider,
|