@motor-hero/ui-kit 0.10.1 → 0.11.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 +1 -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 +229 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +227 -135
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- 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 +3 -0
package/dist/index.cjs
CHANGED
|
@@ -41,11 +41,13 @@ __export(index_exports, {
|
|
|
41
41
|
ModeToggle: () => ModeToggle,
|
|
42
42
|
PageHeader: () => PageHeader,
|
|
43
43
|
Pagination: () => Pagination,
|
|
44
|
+
ProgressBar: () => ProgressBar,
|
|
44
45
|
ResponsiveDataView: () => ResponsiveDataView,
|
|
45
46
|
RowActionsMenu: () => RowActionsMenu,
|
|
46
47
|
SearchInput: () => SearchInput,
|
|
47
48
|
SidebarNav: () => SidebarNav,
|
|
48
49
|
StatCard: () => StatCard,
|
|
50
|
+
StatusBadge: () => StatusBadge,
|
|
49
51
|
StatusDot: () => StatusDot,
|
|
50
52
|
TableSkeleton: () => TableSkeleton,
|
|
51
53
|
ThemeProvider: () => ThemeProvider,
|
|
@@ -220,13 +222,19 @@ function ConfirmDialog({
|
|
|
220
222
|
// src/components/page-header.tsx
|
|
221
223
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
222
224
|
function PageHeader({ title, description, action, className }) {
|
|
223
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
226
|
+
"div",
|
|
227
|
+
{
|
|
228
|
+
className: `flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between ${className ?? ""}`,
|
|
229
|
+
children: [
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "min-w-0", children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { className: "truncate text-2xl font-semibold tracking-tight", children: title }),
|
|
232
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-muted-foreground", children: description })
|
|
233
|
+
] }),
|
|
234
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "shrink-0", children: action })
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
);
|
|
230
238
|
}
|
|
231
239
|
|
|
232
240
|
// src/components/status-dot.tsx
|
|
@@ -243,28 +251,112 @@ function StatusDot({ active, label, className }) {
|
|
|
243
251
|
] });
|
|
244
252
|
}
|
|
245
253
|
|
|
246
|
-
// src/components/
|
|
254
|
+
// src/components/status-badge.tsx
|
|
247
255
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
256
|
+
var variantClasses = {
|
|
257
|
+
neutral: {
|
|
258
|
+
badge: "bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300",
|
|
259
|
+
dot: "bg-gray-400"
|
|
260
|
+
},
|
|
261
|
+
info: {
|
|
262
|
+
badge: "bg-blue-100 text-blue-700 dark:bg-blue-950 dark:text-blue-400",
|
|
263
|
+
dot: "bg-blue-500"
|
|
264
|
+
},
|
|
265
|
+
success: {
|
|
266
|
+
badge: "bg-green-100 text-green-700 dark:bg-green-950 dark:text-green-400",
|
|
267
|
+
dot: "bg-green-500"
|
|
268
|
+
},
|
|
269
|
+
danger: {
|
|
270
|
+
badge: "bg-red-100 text-red-700 dark:bg-red-950 dark:text-red-400",
|
|
271
|
+
dot: "bg-red-500"
|
|
272
|
+
},
|
|
273
|
+
warning: {
|
|
274
|
+
badge: "bg-amber-100 text-amber-700 dark:bg-amber-950 dark:text-amber-400",
|
|
275
|
+
dot: "bg-amber-500"
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
function StatusBadge({
|
|
279
|
+
variant = "neutral",
|
|
280
|
+
dot = true,
|
|
281
|
+
className,
|
|
282
|
+
children
|
|
283
|
+
}) {
|
|
284
|
+
const classes = variantClasses[variant];
|
|
285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
286
|
+
"span",
|
|
287
|
+
{
|
|
288
|
+
className: `inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 text-xs font-medium ${classes.badge} ${className ?? ""}`,
|
|
289
|
+
children: [
|
|
290
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
291
|
+
"span",
|
|
292
|
+
{
|
|
293
|
+
className: `inline-block h-1.5 w-1.5 shrink-0 rounded-full ${classes.dot}`
|
|
294
|
+
}
|
|
295
|
+
),
|
|
296
|
+
children
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// src/components/progress-bar.tsx
|
|
303
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
304
|
+
var sizeClasses = {
|
|
305
|
+
sm: "h-1.5",
|
|
306
|
+
md: "h-2"
|
|
307
|
+
};
|
|
308
|
+
function ProgressBar({
|
|
309
|
+
value,
|
|
310
|
+
size = "md",
|
|
311
|
+
label,
|
|
312
|
+
valueLabel,
|
|
313
|
+
className,
|
|
314
|
+
indicatorClassName
|
|
315
|
+
}) {
|
|
316
|
+
const clamped = Math.min(100, Math.max(0, value));
|
|
317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `space-y-1.5 ${className ?? ""}`, children: [
|
|
318
|
+
(label || valueLabel) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
319
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm text-muted-foreground", children: label }),
|
|
320
|
+
valueLabel && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm font-semibold", children: valueLabel })
|
|
321
|
+
] }),
|
|
322
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
323
|
+
"div",
|
|
324
|
+
{
|
|
325
|
+
className: `w-full overflow-hidden rounded-full bg-muted ${sizeClasses[size]}`,
|
|
326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
327
|
+
"div",
|
|
328
|
+
{
|
|
329
|
+
className: `h-full rounded-full transition-all duration-300 ${indicatorClassName ?? "bg-primary"}`,
|
|
330
|
+
style: { width: `${clamped}%` }
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
}
|
|
334
|
+
)
|
|
335
|
+
] });
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// src/components/form-field.tsx
|
|
339
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
248
340
|
function FormField({ label, htmlFor, error, required, children, className }) {
|
|
249
|
-
return /* @__PURE__ */ (0,
|
|
250
|
-
/* @__PURE__ */ (0,
|
|
341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `space-y-2 ${className ?? ""}`, children: [
|
|
342
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
251
343
|
"label",
|
|
252
344
|
{
|
|
253
345
|
htmlFor,
|
|
254
346
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
255
347
|
children: [
|
|
256
348
|
label,
|
|
257
|
-
required && /* @__PURE__ */ (0,
|
|
349
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ml-1 text-destructive", children: "*" })
|
|
258
350
|
]
|
|
259
351
|
}
|
|
260
352
|
),
|
|
261
353
|
children,
|
|
262
|
-
error && /* @__PURE__ */ (0,
|
|
354
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm text-destructive", children: error })
|
|
263
355
|
] });
|
|
264
356
|
}
|
|
265
357
|
|
|
266
358
|
// src/components/form-dialog.tsx
|
|
267
|
-
var
|
|
359
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
268
360
|
function FormDialogLayout({
|
|
269
361
|
title,
|
|
270
362
|
children,
|
|
@@ -275,11 +367,11 @@ function FormDialogLayout({
|
|
|
275
367
|
isSubmitting = false,
|
|
276
368
|
isDisabled = false
|
|
277
369
|
}) {
|
|
278
|
-
return /* @__PURE__ */ (0,
|
|
279
|
-
/* @__PURE__ */ (0,
|
|
280
|
-
/* @__PURE__ */ (0,
|
|
281
|
-
/* @__PURE__ */ (0,
|
|
282
|
-
/* @__PURE__ */ (0,
|
|
370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { onSubmit, children: [
|
|
371
|
+
/* @__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 }) }),
|
|
372
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-4 py-4", children }),
|
|
373
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
374
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
283
375
|
"button",
|
|
284
376
|
{
|
|
285
377
|
type: "button",
|
|
@@ -288,7 +380,7 @@ function FormDialogLayout({
|
|
|
288
380
|
children: cancelLabel
|
|
289
381
|
}
|
|
290
382
|
),
|
|
291
|
-
/* @__PURE__ */ (0,
|
|
383
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
292
384
|
"button",
|
|
293
385
|
{
|
|
294
386
|
type: "submit",
|
|
@@ -302,23 +394,23 @@ function FormDialogLayout({
|
|
|
302
394
|
}
|
|
303
395
|
|
|
304
396
|
// src/components/auth-card.tsx
|
|
305
|
-
var
|
|
397
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
306
398
|
function AuthCard({ title, description, children, footer }) {
|
|
307
|
-
return /* @__PURE__ */ (0,
|
|
308
|
-
/* @__PURE__ */ (0,
|
|
309
|
-
/* @__PURE__ */ (0,
|
|
310
|
-
description && /* @__PURE__ */ (0,
|
|
399
|
+
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: [
|
|
400
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "mb-6 text-center", children: [
|
|
401
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h1", { className: "text-2xl font-semibold tracking-tight", children: title }),
|
|
402
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
|
|
311
403
|
] }),
|
|
312
|
-
/* @__PURE__ */ (0,
|
|
313
|
-
footer && /* @__PURE__ */ (0,
|
|
404
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "space-y-4", children }),
|
|
405
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "mt-4", children: footer })
|
|
314
406
|
] }) });
|
|
315
407
|
}
|
|
316
408
|
|
|
317
409
|
// src/components/pagination.tsx
|
|
318
|
-
var
|
|
410
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
319
411
|
function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, className }) {
|
|
320
|
-
return /* @__PURE__ */ (0,
|
|
321
|
-
/* @__PURE__ */ (0,
|
|
412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `flex items-center justify-end gap-4 ${className ?? ""}`, children: [
|
|
413
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
322
414
|
"button",
|
|
323
415
|
{
|
|
324
416
|
type: "button",
|
|
@@ -328,11 +420,11 @@ function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, classNam
|
|
|
328
420
|
children: "Anterior"
|
|
329
421
|
}
|
|
330
422
|
),
|
|
331
|
-
/* @__PURE__ */ (0,
|
|
423
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "text-sm text-muted-foreground", children: [
|
|
332
424
|
"P\xE1gina ",
|
|
333
425
|
page
|
|
334
426
|
] }),
|
|
335
|
-
/* @__PURE__ */ (0,
|
|
427
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
336
428
|
"button",
|
|
337
429
|
{
|
|
338
430
|
type: "button",
|
|
@@ -346,18 +438,18 @@ function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, classNam
|
|
|
346
438
|
}
|
|
347
439
|
|
|
348
440
|
// src/components/table-skeleton.tsx
|
|
349
|
-
var
|
|
441
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
350
442
|
function TableSkeleton({ rows = 5, columns = 4 }) {
|
|
351
|
-
return /* @__PURE__ */ (0,
|
|
443
|
+
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
444
|
}
|
|
353
445
|
|
|
354
446
|
// src/components/search-input.tsx
|
|
355
447
|
var React = __toESM(require("react"), 1);
|
|
356
|
-
var
|
|
448
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
357
449
|
var SearchInput = React.forwardRef(
|
|
358
450
|
({ containerClassName, className, ...props }, ref) => {
|
|
359
|
-
return /* @__PURE__ */ (0,
|
|
360
|
-
/* @__PURE__ */ (0,
|
|
451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: `relative flex-1 ${containerClassName ?? ""}`, children: [
|
|
452
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
361
453
|
"svg",
|
|
362
454
|
{
|
|
363
455
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -371,12 +463,12 @@ var SearchInput = React.forwardRef(
|
|
|
371
463
|
strokeLinejoin: "round",
|
|
372
464
|
className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",
|
|
373
465
|
children: [
|
|
374
|
-
/* @__PURE__ */ (0,
|
|
375
|
-
/* @__PURE__ */ (0,
|
|
466
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
|
|
467
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "m21 21-4.3-4.3" })
|
|
376
468
|
]
|
|
377
469
|
}
|
|
378
470
|
),
|
|
379
|
-
/* @__PURE__ */ (0,
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
380
472
|
"input",
|
|
381
473
|
{
|
|
382
474
|
ref,
|
|
@@ -391,30 +483,30 @@ var SearchInput = React.forwardRef(
|
|
|
391
483
|
SearchInput.displayName = "SearchInput";
|
|
392
484
|
|
|
393
485
|
// src/components/stat-card.tsx
|
|
394
|
-
var
|
|
486
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
395
487
|
function StatCard({ label, value, detail, icon, isLoading }) {
|
|
396
488
|
if (isLoading) {
|
|
397
|
-
return /* @__PURE__ */ (0,
|
|
398
|
-
/* @__PURE__ */ (0,
|
|
399
|
-
/* @__PURE__ */ (0,
|
|
400
|
-
/* @__PURE__ */ (0,
|
|
489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
490
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between pb-2", children: [
|
|
491
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
492
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "h-4 w-4 animate-pulse rounded bg-muted" })
|
|
401
493
|
] }),
|
|
402
|
-
/* @__PURE__ */ (0,
|
|
403
|
-
/* @__PURE__ */ (0,
|
|
494
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mt-2 h-7 w-16 animate-pulse rounded bg-muted" }),
|
|
495
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mt-1 h-4 w-20 animate-pulse rounded bg-muted" })
|
|
404
496
|
] });
|
|
405
497
|
}
|
|
406
|
-
return /* @__PURE__ */ (0,
|
|
407
|
-
/* @__PURE__ */ (0,
|
|
408
|
-
/* @__PURE__ */ (0,
|
|
409
|
-
icon && /* @__PURE__ */ (0,
|
|
498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
499
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between pb-2", children: [
|
|
500
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-sm font-medium text-muted-foreground", children: label }),
|
|
501
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-muted-foreground", children: icon })
|
|
410
502
|
] }),
|
|
411
|
-
/* @__PURE__ */ (0,
|
|
412
|
-
detail && /* @__PURE__ */ (0,
|
|
503
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "text-2xl font-bold", children: value }),
|
|
504
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-muted-foreground", children: detail })
|
|
413
505
|
] });
|
|
414
506
|
}
|
|
415
507
|
|
|
416
508
|
// src/components/data-table-wrapper.tsx
|
|
417
|
-
var
|
|
509
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
418
510
|
function DataTableWrapper({
|
|
419
511
|
children,
|
|
420
512
|
isEmpty,
|
|
@@ -427,15 +519,15 @@ function DataTableWrapper({
|
|
|
427
519
|
hasNextPage = false,
|
|
428
520
|
hasPreviousPage = false
|
|
429
521
|
}) {
|
|
430
|
-
return /* @__PURE__ */ (0,
|
|
431
|
-
/* @__PURE__ */ (0,
|
|
432
|
-
!isLoading && isEmpty && /* @__PURE__ */ (0,
|
|
433
|
-
emptyIcon && /* @__PURE__ */ (0,
|
|
434
|
-
/* @__PURE__ */ (0,
|
|
435
|
-
emptyDescription && /* @__PURE__ */ (0,
|
|
522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-4", children: [
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "overflow-x-auto rounded-md border", children }),
|
|
524
|
+
!isLoading && isEmpty && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
525
|
+
emptyIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
526
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
527
|
+
emptyDescription && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
436
528
|
] }),
|
|
437
|
-
page !== void 0 && onPageChange && /* @__PURE__ */ (0,
|
|
438
|
-
/* @__PURE__ */ (0,
|
|
529
|
+
page !== void 0 && onPageChange && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-end gap-4", children: [
|
|
530
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
439
531
|
"button",
|
|
440
532
|
{
|
|
441
533
|
type: "button",
|
|
@@ -445,11 +537,11 @@ function DataTableWrapper({
|
|
|
445
537
|
children: "Anterior"
|
|
446
538
|
}
|
|
447
539
|
),
|
|
448
|
-
/* @__PURE__ */ (0,
|
|
540
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "text-sm text-muted-foreground", children: [
|
|
449
541
|
"P\xE1gina ",
|
|
450
542
|
page
|
|
451
543
|
] }),
|
|
452
|
-
/* @__PURE__ */ (0,
|
|
544
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
453
545
|
"button",
|
|
454
546
|
{
|
|
455
547
|
type: "button",
|
|
@@ -464,7 +556,7 @@ function DataTableWrapper({
|
|
|
464
556
|
}
|
|
465
557
|
|
|
466
558
|
// src/components/mobile-card-list.tsx
|
|
467
|
-
var
|
|
559
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
468
560
|
function MobileCardList({
|
|
469
561
|
data,
|
|
470
562
|
renderCard,
|
|
@@ -474,19 +566,19 @@ function MobileCardList({
|
|
|
474
566
|
className
|
|
475
567
|
}) {
|
|
476
568
|
if (isLoading) {
|
|
477
|
-
return /* @__PURE__ */ (0,
|
|
478
|
-
/* @__PURE__ */ (0,
|
|
479
|
-
/* @__PURE__ */ (0,
|
|
480
|
-
/* @__PURE__ */ (0,
|
|
569
|
+
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: [
|
|
570
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between", children: [
|
|
571
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-5 w-32 animate-pulse rounded bg-muted" }),
|
|
572
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-5 w-16 animate-pulse rounded bg-muted" })
|
|
481
573
|
] }),
|
|
482
|
-
/* @__PURE__ */ (0,
|
|
483
|
-
/* @__PURE__ */ (0,
|
|
484
|
-
/* @__PURE__ */ (0,
|
|
485
|
-
/* @__PURE__ */ (0,
|
|
574
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-4 w-48 animate-pulse rounded bg-muted" }),
|
|
575
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between", children: [
|
|
576
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
577
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" })
|
|
486
578
|
] })
|
|
487
579
|
] }) }, i)) });
|
|
488
580
|
}
|
|
489
|
-
return /* @__PURE__ */ (0,
|
|
581
|
+
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
582
|
"div",
|
|
491
583
|
{
|
|
492
584
|
className: "rounded-xl border p-4 transition-all duration-150 hover:border-foreground/20 active:scale-[0.99]",
|
|
@@ -497,7 +589,7 @@ function MobileCardList({
|
|
|
497
589
|
}
|
|
498
590
|
|
|
499
591
|
// src/components/responsive-data-view.tsx
|
|
500
|
-
var
|
|
592
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
501
593
|
function ResponsiveDataView({
|
|
502
594
|
table,
|
|
503
595
|
cards,
|
|
@@ -508,13 +600,13 @@ function ResponsiveDataView({
|
|
|
508
600
|
emptyDescription,
|
|
509
601
|
pagination
|
|
510
602
|
}) {
|
|
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,
|
|
603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-4", children: [
|
|
604
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
|
|
605
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "md:hidden", children: cards }),
|
|
606
|
+
!isLoading && isEmpty && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
607
|
+
emptyIcon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
608
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
609
|
+
emptyDescription && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
518
610
|
] }),
|
|
519
611
|
pagination
|
|
520
612
|
] });
|
|
@@ -522,10 +614,10 @@ function ResponsiveDataView({
|
|
|
522
614
|
|
|
523
615
|
// src/components/toaster.tsx
|
|
524
616
|
var import_sonner = require("sonner");
|
|
525
|
-
var
|
|
617
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
526
618
|
function Toaster(props) {
|
|
527
619
|
const { theme = "system" } = useTheme();
|
|
528
|
-
return /* @__PURE__ */ (0,
|
|
620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
529
621
|
import_sonner.Toaster,
|
|
530
622
|
{
|
|
531
623
|
theme,
|
|
@@ -560,11 +652,11 @@ function cn(...inputs) {
|
|
|
560
652
|
var import_react2 = require("react");
|
|
561
653
|
|
|
562
654
|
// src/components/types.tsx
|
|
563
|
-
var
|
|
564
|
-
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */ (0,
|
|
655
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
656
|
+
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("a", { ...props, children });
|
|
565
657
|
|
|
566
658
|
// src/components/sidebar-nav.tsx
|
|
567
|
-
var
|
|
659
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
568
660
|
function defaultIsActive(item, activePath) {
|
|
569
661
|
if (item.href === "/") return activePath === "/";
|
|
570
662
|
return activePath === item.href || activePath.startsWith(item.href + "/");
|
|
@@ -579,7 +671,7 @@ function SidebarNav({
|
|
|
579
671
|
onNavigate
|
|
580
672
|
}) {
|
|
581
673
|
const visible = items.filter((item) => !item.adminOnly || isAdmin);
|
|
582
|
-
return /* @__PURE__ */ (0,
|
|
674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("nav", { className: "flex flex-col gap-1", children: visible.map((item) => {
|
|
583
675
|
const active = isActive(item, activePath);
|
|
584
676
|
const link = renderLink({
|
|
585
677
|
href: item.href,
|
|
@@ -591,19 +683,19 @@ function SidebarNav({
|
|
|
591
683
|
active ? "bg-accent text-accent-foreground font-semibold" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
592
684
|
isCollapsed && "justify-center px-2"
|
|
593
685
|
),
|
|
594
|
-
children: /* @__PURE__ */ (0,
|
|
595
|
-
item.icon && /* @__PURE__ */ (0,
|
|
596
|
-
!isCollapsed && /* @__PURE__ */ (0,
|
|
686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
687
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "shrink-0", children: item.icon }),
|
|
688
|
+
!isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "truncate", children: item.label })
|
|
597
689
|
] })
|
|
598
690
|
});
|
|
599
|
-
return /* @__PURE__ */ (0,
|
|
691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react2.Fragment, { children: link }, item.href);
|
|
600
692
|
}) });
|
|
601
693
|
}
|
|
602
694
|
|
|
603
695
|
// src/components/user-menu.tsx
|
|
604
696
|
var DropdownMenu2 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
605
697
|
var import_lucide_react2 = require("lucide-react");
|
|
606
|
-
var
|
|
698
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
607
699
|
function initials(user) {
|
|
608
700
|
const source = user?.name?.trim() || user?.email?.trim();
|
|
609
701
|
if (!source) return "";
|
|
@@ -621,44 +713,44 @@ function UserMenu({
|
|
|
621
713
|
align = "end"
|
|
622
714
|
}) {
|
|
623
715
|
const label = initials(user);
|
|
624
|
-
return /* @__PURE__ */ (0,
|
|
625
|
-
/* @__PURE__ */ (0,
|
|
716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DropdownMenu2.Root, { children: [
|
|
717
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenu2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
626
718
|
"button",
|
|
627
719
|
{
|
|
628
720
|
type: "button",
|
|
629
721
|
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
722
|
"aria-label": "Menu do usu\xE1rio",
|
|
631
723
|
"data-testid": "user-menu",
|
|
632
|
-
children: user?.avatarUrl ? /* @__PURE__ */ (0,
|
|
724
|
+
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_react2.User, { className: "h-4 w-4" })
|
|
633
725
|
}
|
|
634
726
|
) }),
|
|
635
|
-
/* @__PURE__ */ (0,
|
|
727
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenu2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
636
728
|
DropdownMenu2.Content,
|
|
637
729
|
{
|
|
638
730
|
align,
|
|
639
731
|
sideOffset: 6,
|
|
640
732
|
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
733
|
children: [
|
|
642
|
-
(user?.name || user?.email) && /* @__PURE__ */ (0,
|
|
643
|
-
/* @__PURE__ */ (0,
|
|
644
|
-
user.name && /* @__PURE__ */ (0,
|
|
645
|
-
user.email && /* @__PURE__ */ (0,
|
|
734
|
+
(user?.name || user?.email) && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
735
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "px-2 py-1.5", children: [
|
|
736
|
+
user.name && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "truncate text-sm font-medium", children: user.name }),
|
|
737
|
+
user.email && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
646
738
|
] }),
|
|
647
|
-
/* @__PURE__ */ (0,
|
|
739
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" })
|
|
648
740
|
] }),
|
|
649
741
|
items.map(
|
|
650
|
-
(item) => item.href ? /* @__PURE__ */ (0,
|
|
742
|
+
(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
743
|
item.icon,
|
|
652
744
|
item.label
|
|
653
|
-
] }) }) }, item.label) : /* @__PURE__ */ (0,
|
|
745
|
+
] }) }) }, item.label) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DropdownMenu2.Item, { className: itemClass, onClick: item.onClick, children: [
|
|
654
746
|
item.icon,
|
|
655
747
|
item.label
|
|
656
748
|
] }, item.label)
|
|
657
749
|
),
|
|
658
|
-
onLogout && /* @__PURE__ */ (0,
|
|
659
|
-
items.length > 0 && /* @__PURE__ */ (0,
|
|
660
|
-
/* @__PURE__ */ (0,
|
|
661
|
-
/* @__PURE__ */ (0,
|
|
750
|
+
onLogout && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
751
|
+
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" }),
|
|
752
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DropdownMenu2.Item, { className: cn(itemClass, "text-destructive focus:bg-destructive/10"), onClick: onLogout, children: [
|
|
753
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react2.LogOut, { className: "h-4 w-4" }),
|
|
662
754
|
logoutLabel
|
|
663
755
|
] })
|
|
664
756
|
] })
|
|
@@ -669,7 +761,7 @@ function UserMenu({
|
|
|
669
761
|
}
|
|
670
762
|
|
|
671
763
|
// src/components/app-shell.tsx
|
|
672
|
-
var
|
|
764
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
673
765
|
function AppShell({
|
|
674
766
|
brand,
|
|
675
767
|
brandCollapsed,
|
|
@@ -688,7 +780,7 @@ function AppShell({
|
|
|
688
780
|
}) {
|
|
689
781
|
const [collapsed, setCollapsed] = (0, import_react3.useState)(defaultCollapsed);
|
|
690
782
|
const [mobileOpen, setMobileOpen] = (0, import_react3.useState)(false);
|
|
691
|
-
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */ (0,
|
|
783
|
+
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
692
784
|
SidebarNav,
|
|
693
785
|
{
|
|
694
786
|
items: navItems,
|
|
@@ -700,8 +792,8 @@ function AppShell({
|
|
|
700
792
|
onNavigate
|
|
701
793
|
}
|
|
702
794
|
);
|
|
703
|
-
return /* @__PURE__ */ (0,
|
|
704
|
-
/* @__PURE__ */ (0,
|
|
795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex h-screen overflow-hidden bg-background", children: [
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
705
797
|
"aside",
|
|
706
798
|
{
|
|
707
799
|
className: cn(
|
|
@@ -709,22 +801,22 @@ function AppShell({
|
|
|
709
801
|
collapsed ? "w-16" : "w-60"
|
|
710
802
|
),
|
|
711
803
|
children: [
|
|
712
|
-
/* @__PURE__ */ (0,
|
|
713
|
-
/* @__PURE__ */ (0,
|
|
714
|
-
collapsible && /* @__PURE__ */ (0,
|
|
804
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(collapsed) }),
|
|
806
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "border-t p-2", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
715
807
|
"button",
|
|
716
808
|
{
|
|
717
809
|
type: "button",
|
|
718
810
|
onClick: () => setCollapsed((v) => !v),
|
|
719
811
|
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
812
|
"aria-label": collapsed ? "Expandir menu" : "Recolher menu",
|
|
721
|
-
children: collapsed ? /* @__PURE__ */ (0,
|
|
813
|
+
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react3.ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react3.ChevronLeft, { className: "h-4 w-4" })
|
|
722
814
|
}
|
|
723
815
|
) })
|
|
724
816
|
]
|
|
725
817
|
}
|
|
726
818
|
),
|
|
727
|
-
/* @__PURE__ */ (0,
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
728
820
|
"div",
|
|
729
821
|
{
|
|
730
822
|
className: cn(
|
|
@@ -733,8 +825,8 @@ function AppShell({
|
|
|
733
825
|
),
|
|
734
826
|
onClick: () => setMobileOpen(false),
|
|
735
827
|
children: [
|
|
736
|
-
/* @__PURE__ */ (0,
|
|
737
|
-
/* @__PURE__ */ (0,
|
|
828
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute inset-0 bg-black/50" }),
|
|
829
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
738
830
|
"div",
|
|
739
831
|
{
|
|
740
832
|
className: cn(
|
|
@@ -743,32 +835,32 @@ function AppShell({
|
|
|
743
835
|
),
|
|
744
836
|
onClick: (e) => e.stopPropagation(),
|
|
745
837
|
children: [
|
|
746
|
-
/* @__PURE__ */ (0,
|
|
747
|
-
/* @__PURE__ */ (0,
|
|
838
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: brand }),
|
|
839
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(false, () => setMobileOpen(false)) })
|
|
748
840
|
]
|
|
749
841
|
}
|
|
750
842
|
)
|
|
751
843
|
]
|
|
752
844
|
}
|
|
753
845
|
),
|
|
754
|
-
/* @__PURE__ */ (0,
|
|
755
|
-
/* @__PURE__ */ (0,
|
|
756
|
-
/* @__PURE__ */ (0,
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
847
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("header", { className: "flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4", children: [
|
|
848
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
757
849
|
"button",
|
|
758
850
|
{
|
|
759
851
|
type: "button",
|
|
760
852
|
onClick: () => setMobileOpen(true),
|
|
761
853
|
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
854
|
"aria-label": "Abrir menu",
|
|
763
|
-
children: /* @__PURE__ */ (0,
|
|
855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react3.Menu, { className: "h-4 w-4" })
|
|
764
856
|
}
|
|
765
857
|
),
|
|
766
|
-
/* @__PURE__ */ (0,
|
|
858
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
767
859
|
headerActions,
|
|
768
|
-
(user || onLogout) && /* @__PURE__ */ (0,
|
|
860
|
+
(user || onLogout) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(UserMenu, { user, items: userMenuItems, onLogout, renderLink })
|
|
769
861
|
] })
|
|
770
862
|
] }),
|
|
771
|
-
/* @__PURE__ */ (0,
|
|
863
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("main", { className: "flex-1 overflow-y-auto", children })
|
|
772
864
|
] })
|
|
773
865
|
] });
|
|
774
866
|
}
|
|
@@ -776,7 +868,7 @@ function AppShell({
|
|
|
776
868
|
// src/components/row-actions-menu.tsx
|
|
777
869
|
var DropdownMenu3 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
778
870
|
var import_lucide_react4 = require("lucide-react");
|
|
779
|
-
var
|
|
871
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
780
872
|
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
873
|
function RowActionsMenu({
|
|
782
874
|
actions,
|
|
@@ -786,18 +878,18 @@ function RowActionsMenu({
|
|
|
786
878
|
renderLink = defaultRenderLink
|
|
787
879
|
}) {
|
|
788
880
|
if (actions.length === 0) return null;
|
|
789
|
-
return /* @__PURE__ */ (0,
|
|
790
|
-
/* @__PURE__ */ (0,
|
|
881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenu3.Root, { children: [
|
|
882
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
791
883
|
"button",
|
|
792
884
|
{
|
|
793
885
|
type: "button",
|
|
794
886
|
disabled,
|
|
795
887
|
"aria-label": label,
|
|
796
888
|
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,
|
|
889
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react4.MoreVertical, { className: "h-4 w-4" })
|
|
798
890
|
}
|
|
799
891
|
) }),
|
|
800
|
-
/* @__PURE__ */ (0,
|
|
892
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu3.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
801
893
|
DropdownMenu3.Content,
|
|
802
894
|
{
|
|
803
895
|
align,
|
|
@@ -805,14 +897,14 @@ function RowActionsMenu({
|
|
|
805
897
|
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
898
|
children: actions.map((action) => {
|
|
807
899
|
const cls = cn(itemClass2, action.destructive && "text-destructive focus:bg-destructive/10");
|
|
808
|
-
return action.href ? /* @__PURE__ */ (0,
|
|
900
|
+
return action.href ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu3.Item, { asChild: true, disabled: action.disabled, children: renderLink({
|
|
809
901
|
href: action.href,
|
|
810
902
|
className: cls,
|
|
811
|
-
children: /* @__PURE__ */ (0,
|
|
903
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
812
904
|
action.icon,
|
|
813
905
|
action.label
|
|
814
906
|
] })
|
|
815
|
-
}) }, action.label) : /* @__PURE__ */ (0,
|
|
907
|
+
}) }, action.label) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
816
908
|
DropdownMenu3.Item,
|
|
817
909
|
{
|
|
818
910
|
className: cls,
|
|
@@ -888,11 +980,13 @@ function useCustomToast() {
|
|
|
888
980
|
ModeToggle,
|
|
889
981
|
PageHeader,
|
|
890
982
|
Pagination,
|
|
983
|
+
ProgressBar,
|
|
891
984
|
ResponsiveDataView,
|
|
892
985
|
RowActionsMenu,
|
|
893
986
|
SearchInput,
|
|
894
987
|
SidebarNav,
|
|
895
988
|
StatCard,
|
|
989
|
+
StatusBadge,
|
|
896
990
|
StatusDot,
|
|
897
991
|
TableSkeleton,
|
|
898
992
|
ThemeProvider,
|