@motor-hero/ui-kit 0.25.1 → 0.27.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/base-dialog.d.ts +45 -0
- package/dist/components/base-dialog.d.ts.map +1 -0
- package/dist/components/form-dialog.d.ts +8 -26
- package/dist/components/form-dialog.d.ts.map +1 -1
- package/dist/index.cjs +310 -301
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +309 -301
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/base-dialog.tsx +126 -0
- package/src/components/form-dialog.tsx +20 -108
- package/src/index.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -369,10 +369,27 @@ function FormField({ label, htmlFor, error, required, children, className }) {
|
|
|
369
369
|
] });
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
-
// src/components/
|
|
372
|
+
// src/components/base-dialog.tsx
|
|
373
373
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
374
374
|
import { X } from "lucide-react";
|
|
375
|
+
import * as React2 from "react";
|
|
376
|
+
|
|
377
|
+
// src/hooks/use-is-desktop.ts
|
|
375
378
|
import * as React from "react";
|
|
379
|
+
var DESKTOP_QUERY = "(min-width: 640px)";
|
|
380
|
+
function useIsDesktop() {
|
|
381
|
+
const [isDesktop, setIsDesktop] = React.useState(
|
|
382
|
+
() => typeof window !== "undefined" ? window.matchMedia(DESKTOP_QUERY).matches : true
|
|
383
|
+
);
|
|
384
|
+
React.useEffect(() => {
|
|
385
|
+
const mql = window.matchMedia(DESKTOP_QUERY);
|
|
386
|
+
const onChange = () => setIsDesktop(mql.matches);
|
|
387
|
+
onChange();
|
|
388
|
+
mql.addEventListener("change", onChange);
|
|
389
|
+
return () => mql.removeEventListener("change", onChange);
|
|
390
|
+
}, []);
|
|
391
|
+
return isDesktop;
|
|
392
|
+
}
|
|
376
393
|
|
|
377
394
|
// src/lib/utils.ts
|
|
378
395
|
import { clsx } from "clsx";
|
|
@@ -381,43 +398,8 @@ function cn(...inputs) {
|
|
|
381
398
|
return twMerge(clsx(inputs));
|
|
382
399
|
}
|
|
383
400
|
|
|
384
|
-
// src/components/
|
|
401
|
+
// src/components/base-dialog.tsx
|
|
385
402
|
import { Fragment, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
386
|
-
function FormDialogLayout({
|
|
387
|
-
title,
|
|
388
|
-
children,
|
|
389
|
-
onSubmit,
|
|
390
|
-
submitLabel = "Salvar",
|
|
391
|
-
cancelLabel = "Cancelar",
|
|
392
|
-
onCancel,
|
|
393
|
-
isSubmitting = false,
|
|
394
|
-
isDisabled = false
|
|
395
|
-
}) {
|
|
396
|
-
return /* @__PURE__ */ jsxs9("form", { onSubmit, children: [
|
|
397
|
-
/* @__PURE__ */ jsx10("div", { className: "flex flex-col space-y-1.5 text-center sm:text-left", children: /* @__PURE__ */ jsx10("h2", { className: "text-lg font-semibold leading-none tracking-tight", children: title }) }),
|
|
398
|
-
/* @__PURE__ */ jsx10("div", { className: "space-y-4 py-4", children }),
|
|
399
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
400
|
-
/* @__PURE__ */ jsx10(
|
|
401
|
-
"button",
|
|
402
|
-
{
|
|
403
|
-
type: "button",
|
|
404
|
-
onClick: onCancel,
|
|
405
|
-
className: "inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
406
|
-
children: cancelLabel
|
|
407
|
-
}
|
|
408
|
-
),
|
|
409
|
-
/* @__PURE__ */ jsx10(
|
|
410
|
-
"button",
|
|
411
|
-
{
|
|
412
|
-
type: "submit",
|
|
413
|
-
disabled: isSubmitting || isDisabled,
|
|
414
|
-
className: "inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
415
|
-
children: isSubmitting ? "Salvando..." : submitLabel
|
|
416
|
-
}
|
|
417
|
-
)
|
|
418
|
-
] })
|
|
419
|
-
] });
|
|
420
|
-
}
|
|
421
403
|
var sizeClasses2 = {
|
|
422
404
|
sm: "sm:max-w-sm",
|
|
423
405
|
md: "sm:max-w-md",
|
|
@@ -425,18 +407,20 @@ var sizeClasses2 = {
|
|
|
425
407
|
xl: "sm:max-w-xl",
|
|
426
408
|
"2xl": "sm:max-w-2xl"
|
|
427
409
|
};
|
|
428
|
-
function
|
|
410
|
+
function BaseDialog({
|
|
429
411
|
open,
|
|
430
412
|
onOpenChange,
|
|
431
413
|
title,
|
|
432
414
|
description,
|
|
433
415
|
children,
|
|
434
416
|
footer,
|
|
435
|
-
onSubmit,
|
|
436
417
|
size = "lg",
|
|
437
|
-
className
|
|
418
|
+
className,
|
|
419
|
+
modal,
|
|
420
|
+
contentWrapper = (content) => content
|
|
438
421
|
}) {
|
|
439
|
-
|
|
422
|
+
const isDesktop = useIsDesktop();
|
|
423
|
+
React2.useEffect(() => {
|
|
440
424
|
if (open) return;
|
|
441
425
|
const id = window.setTimeout(() => {
|
|
442
426
|
if (document.body.style.pointerEvents === "none") {
|
|
@@ -463,7 +447,7 @@ function FormDialog({
|
|
|
463
447
|
/* @__PURE__ */ jsx10("div", { className: "min-h-0 flex-1 overflow-y-auto px-6 py-4", children }),
|
|
464
448
|
footer && /* @__PURE__ */ jsx10("div", { className: "flex shrink-0 flex-col-reverse gap-2 border-t px-6 py-3 sm:flex-row sm:justify-end", children: footer })
|
|
465
449
|
] });
|
|
466
|
-
return /* @__PURE__ */ jsx10(Dialog.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs9(Dialog.Portal, { children: [
|
|
450
|
+
return /* @__PURE__ */ jsx10(Dialog.Root, { open, onOpenChange, modal: modal ?? !isDesktop, children: /* @__PURE__ */ jsxs9(Dialog.Portal, { children: [
|
|
467
451
|
/* @__PURE__ */ jsx10(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" }),
|
|
468
452
|
/* @__PURE__ */ jsx10(
|
|
469
453
|
Dialog.Content,
|
|
@@ -479,37 +463,77 @@ function FormDialog({
|
|
|
479
463
|
sizeClasses2[size],
|
|
480
464
|
className
|
|
481
465
|
),
|
|
482
|
-
children:
|
|
483
|
-
"form",
|
|
484
|
-
{
|
|
485
|
-
onSubmit,
|
|
486
|
-
className: "flex min-h-0 flex-1 flex-col",
|
|
487
|
-
children: body
|
|
488
|
-
}
|
|
489
|
-
) : body
|
|
466
|
+
children: contentWrapper(body)
|
|
490
467
|
}
|
|
491
468
|
)
|
|
492
469
|
] }) });
|
|
493
470
|
}
|
|
494
471
|
|
|
495
|
-
// src/components/
|
|
472
|
+
// src/components/form-dialog.tsx
|
|
496
473
|
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
474
|
+
function FormDialogLayout({
|
|
475
|
+
title,
|
|
476
|
+
children,
|
|
477
|
+
onSubmit,
|
|
478
|
+
submitLabel = "Salvar",
|
|
479
|
+
cancelLabel = "Cancelar",
|
|
480
|
+
onCancel,
|
|
481
|
+
isSubmitting = false,
|
|
482
|
+
isDisabled = false
|
|
483
|
+
}) {
|
|
484
|
+
return /* @__PURE__ */ jsxs10("form", { onSubmit, children: [
|
|
485
|
+
/* @__PURE__ */ jsx11("div", { className: "flex flex-col space-y-1.5 text-center sm:text-left", children: /* @__PURE__ */ jsx11("h2", { className: "text-lg font-semibold leading-none tracking-tight", children: title }) }),
|
|
486
|
+
/* @__PURE__ */ jsx11("div", { className: "space-y-4 py-4", children }),
|
|
487
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
488
|
+
/* @__PURE__ */ jsx11(
|
|
489
|
+
"button",
|
|
490
|
+
{
|
|
491
|
+
type: "button",
|
|
492
|
+
onClick: onCancel,
|
|
493
|
+
className: "inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
494
|
+
children: cancelLabel
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
/* @__PURE__ */ jsx11(
|
|
498
|
+
"button",
|
|
499
|
+
{
|
|
500
|
+
type: "submit",
|
|
501
|
+
disabled: isSubmitting || isDisabled,
|
|
502
|
+
className: "inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
503
|
+
children: isSubmitting ? "Salvando..." : submitLabel
|
|
504
|
+
}
|
|
505
|
+
)
|
|
506
|
+
] })
|
|
507
|
+
] });
|
|
508
|
+
}
|
|
509
|
+
function FormDialog({ onSubmit, ...rest }) {
|
|
510
|
+
return /* @__PURE__ */ jsx11(
|
|
511
|
+
BaseDialog,
|
|
512
|
+
{
|
|
513
|
+
...rest,
|
|
514
|
+
contentWrapper: onSubmit ? (content) => /* @__PURE__ */ jsx11("form", { onSubmit, className: "flex min-h-0 flex-1 flex-col", children: content }) : void 0
|
|
515
|
+
}
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// src/components/auth-card.tsx
|
|
520
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
497
521
|
function AuthCard({ title, description, children, footer }) {
|
|
498
|
-
return /* @__PURE__ */
|
|
499
|
-
/* @__PURE__ */
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
-
description && /* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ jsx12("div", { className: "flex min-h-screen items-center justify-center px-4", children: /* @__PURE__ */ jsxs11("div", { className: "w-full max-w-sm rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
523
|
+
/* @__PURE__ */ jsxs11("div", { className: "mb-6 text-center", children: [
|
|
524
|
+
/* @__PURE__ */ jsx12("h1", { className: "text-2xl font-semibold tracking-tight", children: title }),
|
|
525
|
+
description && /* @__PURE__ */ jsx12("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
|
|
502
526
|
] }),
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
footer && /* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ jsx12("div", { className: "space-y-4", children }),
|
|
528
|
+
footer && /* @__PURE__ */ jsx12("div", { className: "mt-4", children: footer })
|
|
505
529
|
] }) });
|
|
506
530
|
}
|
|
507
531
|
|
|
508
532
|
// src/components/pagination.tsx
|
|
509
|
-
import { jsx as
|
|
533
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
510
534
|
function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, className }) {
|
|
511
|
-
return /* @__PURE__ */
|
|
512
|
-
/* @__PURE__ */
|
|
535
|
+
return /* @__PURE__ */ jsxs12("div", { className: `flex items-center justify-end gap-4 ${className ?? ""}`, children: [
|
|
536
|
+
/* @__PURE__ */ jsx13(
|
|
513
537
|
"button",
|
|
514
538
|
{
|
|
515
539
|
type: "button",
|
|
@@ -519,11 +543,11 @@ function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, classNam
|
|
|
519
543
|
children: "Anterior"
|
|
520
544
|
}
|
|
521
545
|
),
|
|
522
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ jsxs12("span", { className: "text-sm text-muted-foreground", children: [
|
|
523
547
|
"P\xE1gina ",
|
|
524
548
|
page
|
|
525
549
|
] }),
|
|
526
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ jsx13(
|
|
527
551
|
"button",
|
|
528
552
|
{
|
|
529
553
|
type: "button",
|
|
@@ -537,18 +561,18 @@ function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, classNam
|
|
|
537
561
|
}
|
|
538
562
|
|
|
539
563
|
// src/components/table-skeleton.tsx
|
|
540
|
-
import { Fragment as Fragment2, jsx as
|
|
564
|
+
import { Fragment as Fragment2, jsx as jsx14 } from "react/jsx-runtime";
|
|
541
565
|
function TableSkeleton({ rows = 5, columns = 4 }) {
|
|
542
|
-
return /* @__PURE__ */
|
|
566
|
+
return /* @__PURE__ */ jsx14(Fragment2, { children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsx14("tr", { className: "border-b transition-colors", children: Array.from({ length: columns }).map((_2, j) => /* @__PURE__ */ jsx14("td", { className: "p-4 align-middle", children: /* @__PURE__ */ jsx14("div", { className: "h-5 w-full animate-pulse rounded bg-muted" }) }, j)) }, i)) });
|
|
543
567
|
}
|
|
544
568
|
|
|
545
569
|
// src/components/search-input.tsx
|
|
546
|
-
import * as
|
|
547
|
-
import { jsx as
|
|
548
|
-
var SearchInput =
|
|
570
|
+
import * as React3 from "react";
|
|
571
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
572
|
+
var SearchInput = React3.forwardRef(
|
|
549
573
|
({ containerClassName, className, ...props }, ref) => {
|
|
550
|
-
return /* @__PURE__ */
|
|
551
|
-
/* @__PURE__ */
|
|
574
|
+
return /* @__PURE__ */ jsxs13("div", { className: `relative flex-1 ${containerClassName ?? ""}`, children: [
|
|
575
|
+
/* @__PURE__ */ jsxs13(
|
|
552
576
|
"svg",
|
|
553
577
|
{
|
|
554
578
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -562,12 +586,12 @@ var SearchInput = React2.forwardRef(
|
|
|
562
586
|
strokeLinejoin: "round",
|
|
563
587
|
className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",
|
|
564
588
|
children: [
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
589
|
+
/* @__PURE__ */ jsx15("circle", { cx: "11", cy: "11", r: "8" }),
|
|
590
|
+
/* @__PURE__ */ jsx15("path", { d: "m21 21-4.3-4.3" })
|
|
567
591
|
]
|
|
568
592
|
}
|
|
569
593
|
),
|
|
570
|
-
/* @__PURE__ */
|
|
594
|
+
/* @__PURE__ */ jsx15(
|
|
571
595
|
"input",
|
|
572
596
|
{
|
|
573
597
|
ref,
|
|
@@ -583,12 +607,12 @@ SearchInput.displayName = "SearchInput";
|
|
|
583
607
|
|
|
584
608
|
// src/components/password-input.tsx
|
|
585
609
|
import { Eye, EyeOff } from "lucide-react";
|
|
586
|
-
import * as
|
|
587
|
-
import { jsx as
|
|
588
|
-
var PasswordInput =
|
|
589
|
-
const [visible, setVisible] =
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
610
|
+
import * as React4 from "react";
|
|
611
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
612
|
+
var PasswordInput = React4.forwardRef(({ containerClassName, className, ...props }, ref) => {
|
|
613
|
+
const [visible, setVisible] = React4.useState(false);
|
|
614
|
+
return /* @__PURE__ */ jsxs14("div", { className: `relative ${containerClassName ?? ""}`, children: [
|
|
615
|
+
/* @__PURE__ */ jsx16(
|
|
592
616
|
"input",
|
|
593
617
|
{
|
|
594
618
|
ref,
|
|
@@ -597,7 +621,7 @@ var PasswordInput = React3.forwardRef(({ containerClassName, className, ...props
|
|
|
597
621
|
...props
|
|
598
622
|
}
|
|
599
623
|
),
|
|
600
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ jsx16(
|
|
601
625
|
"button",
|
|
602
626
|
{
|
|
603
627
|
type: "button",
|
|
@@ -605,7 +629,7 @@ var PasswordInput = React3.forwardRef(({ containerClassName, className, ...props
|
|
|
605
629
|
"aria-label": visible ? "Ocultar senha" : "Mostrar senha",
|
|
606
630
|
tabIndex: -1,
|
|
607
631
|
className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground",
|
|
608
|
-
children: visible ? /* @__PURE__ */
|
|
632
|
+
children: visible ? /* @__PURE__ */ jsx16(EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx16(Eye, { className: "h-4 w-4" })
|
|
609
633
|
}
|
|
610
634
|
)
|
|
611
635
|
] });
|
|
@@ -620,21 +644,21 @@ import * as React6 from "react";
|
|
|
620
644
|
import { Drawer as DrawerPrimitive } from "vaul";
|
|
621
645
|
|
|
622
646
|
// src/hooks/use-infinite-scroll-sentinel.ts
|
|
623
|
-
import * as
|
|
647
|
+
import * as React5 from "react";
|
|
624
648
|
function useInfiniteScrollSentinel({
|
|
625
649
|
enabled,
|
|
626
650
|
loading,
|
|
627
651
|
onLoadMore
|
|
628
652
|
}) {
|
|
629
|
-
const listRef =
|
|
630
|
-
const sentinelRef =
|
|
631
|
-
const loadingRef =
|
|
632
|
-
const onLoadMoreRef =
|
|
633
|
-
|
|
653
|
+
const listRef = React5.useRef(null);
|
|
654
|
+
const sentinelRef = React5.useRef(null);
|
|
655
|
+
const loadingRef = React5.useRef(loading);
|
|
656
|
+
const onLoadMoreRef = React5.useRef(onLoadMore);
|
|
657
|
+
React5.useEffect(() => {
|
|
634
658
|
loadingRef.current = loading;
|
|
635
659
|
onLoadMoreRef.current = onLoadMore;
|
|
636
660
|
});
|
|
637
|
-
|
|
661
|
+
React5.useEffect(() => {
|
|
638
662
|
if (!enabled) return;
|
|
639
663
|
const root = listRef.current;
|
|
640
664
|
const sentinel = sentinelRef.current;
|
|
@@ -653,25 +677,8 @@ function useInfiniteScrollSentinel({
|
|
|
653
677
|
return { listRef, sentinelRef };
|
|
654
678
|
}
|
|
655
679
|
|
|
656
|
-
// src/hooks/use-is-desktop.ts
|
|
657
|
-
import * as React5 from "react";
|
|
658
|
-
var DESKTOP_QUERY = "(min-width: 640px)";
|
|
659
|
-
function useIsDesktop() {
|
|
660
|
-
const [isDesktop, setIsDesktop] = React5.useState(
|
|
661
|
-
() => typeof window !== "undefined" ? window.matchMedia(DESKTOP_QUERY).matches : true
|
|
662
|
-
);
|
|
663
|
-
React5.useEffect(() => {
|
|
664
|
-
const mql = window.matchMedia(DESKTOP_QUERY);
|
|
665
|
-
const onChange = () => setIsDesktop(mql.matches);
|
|
666
|
-
onChange();
|
|
667
|
-
mql.addEventListener("change", onChange);
|
|
668
|
-
return () => mql.removeEventListener("change", onChange);
|
|
669
|
-
}, []);
|
|
670
|
-
return isDesktop;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
680
|
// src/components/combobox.tsx
|
|
674
|
-
import { jsx as
|
|
681
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
675
682
|
function Combobox({
|
|
676
683
|
options,
|
|
677
684
|
value,
|
|
@@ -718,7 +725,7 @@ function Combobox({
|
|
|
718
725
|
loading,
|
|
719
726
|
onLoadMore
|
|
720
727
|
});
|
|
721
|
-
const trigger = /* @__PURE__ */
|
|
728
|
+
const trigger = /* @__PURE__ */ jsxs15(
|
|
722
729
|
"button",
|
|
723
730
|
{
|
|
724
731
|
type: "button",
|
|
@@ -733,20 +740,20 @@ function Combobox({
|
|
|
733
740
|
className
|
|
734
741
|
),
|
|
735
742
|
children: [
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ jsx17("span", { className: cn("truncate", !selected && "text-muted-foreground"), children: selected ? selected.label : placeholder }),
|
|
744
|
+
/* @__PURE__ */ jsx17(ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
738
745
|
]
|
|
739
746
|
}
|
|
740
747
|
);
|
|
741
|
-
const command = /* @__PURE__ */
|
|
748
|
+
const command = /* @__PURE__ */ jsxs15(
|
|
742
749
|
CommandPrimitive,
|
|
743
750
|
{
|
|
744
751
|
shouldFilter: !isServer,
|
|
745
752
|
className: "flex h-full w-full flex-col overflow-hidden",
|
|
746
753
|
children: [
|
|
747
|
-
/* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center border-b px-3", children: [
|
|
755
|
+
/* @__PURE__ */ jsx17(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
756
|
+
/* @__PURE__ */ jsx17(
|
|
750
757
|
CommandPrimitive.Input,
|
|
751
758
|
{
|
|
752
759
|
placeholder: searchPlaceholder,
|
|
@@ -755,28 +762,28 @@ function Combobox({
|
|
|
755
762
|
}
|
|
756
763
|
)
|
|
757
764
|
] }),
|
|
758
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ jsxs15(
|
|
759
766
|
CommandPrimitive.List,
|
|
760
767
|
{
|
|
761
768
|
ref: listRef,
|
|
762
769
|
className: "max-h-[50vh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60",
|
|
763
770
|
children: [
|
|
764
|
-
!isServer && !showCreate && /* @__PURE__ */
|
|
765
|
-
showCreate && /* @__PURE__ */
|
|
771
|
+
!isServer && !showCreate && /* @__PURE__ */ jsx17(CommandPrimitive.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
|
|
772
|
+
showCreate && /* @__PURE__ */ jsxs15(
|
|
766
773
|
CommandPrimitive.Item,
|
|
767
774
|
{
|
|
768
775
|
value: trimmedSearch,
|
|
769
776
|
onSelect: () => handleSelect(trimmedSearch),
|
|
770
777
|
className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground sm:py-1.5",
|
|
771
778
|
children: [
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ jsx17(Plus, { className: "h-4 w-4 shrink-0" }),
|
|
780
|
+
/* @__PURE__ */ jsx17("span", { className: "truncate", children: (formatCreateLabel ?? ((text) => `Usar "${text}"`))(
|
|
774
781
|
trimmedSearch
|
|
775
782
|
) })
|
|
776
783
|
]
|
|
777
784
|
}
|
|
778
785
|
),
|
|
779
|
-
options.map((option) => /* @__PURE__ */
|
|
786
|
+
options.map((option) => /* @__PURE__ */ jsxs15(
|
|
780
787
|
CommandPrimitive.Item,
|
|
781
788
|
{
|
|
782
789
|
value: isServer ? option.value : option.label,
|
|
@@ -784,7 +791,7 @@ function Combobox({
|
|
|
784
791
|
onSelect: () => handleSelect(option.value),
|
|
785
792
|
className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 sm:py-1.5",
|
|
786
793
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ jsx17(
|
|
788
795
|
Check,
|
|
789
796
|
{
|
|
790
797
|
className: cn(
|
|
@@ -793,14 +800,14 @@ function Combobox({
|
|
|
793
800
|
)
|
|
794
801
|
}
|
|
795
802
|
),
|
|
796
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ jsx17("span", { className: "truncate", children: option.label })
|
|
797
804
|
]
|
|
798
805
|
},
|
|
799
806
|
option.value
|
|
800
807
|
)),
|
|
801
|
-
isServer && !loading && options.length === 0 && /* @__PURE__ */
|
|
802
|
-
isServer && loading && /* @__PURE__ */
|
|
803
|
-
isServer && hasMore && /* @__PURE__ */
|
|
808
|
+
isServer && !loading && options.length === 0 && /* @__PURE__ */ jsx17("div", { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
|
|
809
|
+
isServer && loading && /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center py-6", children: /* @__PURE__ */ jsx17(Loader2, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }),
|
|
810
|
+
isServer && hasMore && /* @__PURE__ */ jsx17("div", { ref: sentinelRef, "aria-hidden": true, className: "h-1" })
|
|
804
811
|
]
|
|
805
812
|
}
|
|
806
813
|
)
|
|
@@ -808,9 +815,9 @@ function Combobox({
|
|
|
808
815
|
}
|
|
809
816
|
);
|
|
810
817
|
if (isDesktop) {
|
|
811
|
-
return /* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ jsxs15(PopoverPrimitive.Root, { open, onOpenChange: handleOpenChange, children: [
|
|
819
|
+
/* @__PURE__ */ jsx17(PopoverPrimitive.Trigger, { asChild: true, children: trigger }),
|
|
820
|
+
/* @__PURE__ */ jsx17(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx17(
|
|
814
821
|
PopoverPrimitive.Content,
|
|
815
822
|
{
|
|
816
823
|
align: "start",
|
|
@@ -822,13 +829,13 @@ function Combobox({
|
|
|
822
829
|
) })
|
|
823
830
|
] });
|
|
824
831
|
}
|
|
825
|
-
return /* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
828
|
-
/* @__PURE__ */
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ jsxs15(DrawerPrimitive.Root, { open, onOpenChange: handleOpenChange, children: [
|
|
833
|
+
/* @__PURE__ */ jsx17(DrawerPrimitive.Trigger, { asChild: true, children: trigger }),
|
|
834
|
+
/* @__PURE__ */ jsxs15(DrawerPrimitive.Portal, { children: [
|
|
835
|
+
/* @__PURE__ */ jsx17(DrawerPrimitive.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
836
|
+
/* @__PURE__ */ jsxs15(DrawerPrimitive.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85vh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
|
|
837
|
+
/* @__PURE__ */ jsx17(DrawerPrimitive.Title, { className: "sr-only", children: placeholder }),
|
|
838
|
+
/* @__PURE__ */ jsx17("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
832
839
|
command
|
|
833
840
|
] })
|
|
834
841
|
] })
|
|
@@ -841,7 +848,7 @@ import { Command as CommandPrimitive2 } from "cmdk";
|
|
|
841
848
|
import { Check as Check2, ChevronsUpDown as ChevronsUpDown2, Loader2 as Loader22, Search as Search2, X as X2 } from "lucide-react";
|
|
842
849
|
import * as React7 from "react";
|
|
843
850
|
import { Drawer as DrawerPrimitive2 } from "vaul";
|
|
844
|
-
import { jsx as
|
|
851
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
845
852
|
function MultiCombobox({
|
|
846
853
|
options,
|
|
847
854
|
value,
|
|
@@ -882,7 +889,7 @@ function MultiCombobox({
|
|
|
882
889
|
const removeValue = (optionValue) => {
|
|
883
890
|
onChange(value.filter((v) => v !== optionValue));
|
|
884
891
|
};
|
|
885
|
-
const trigger = /* @__PURE__ */
|
|
892
|
+
const trigger = /* @__PURE__ */ jsxs16(
|
|
886
893
|
"div",
|
|
887
894
|
{
|
|
888
895
|
id,
|
|
@@ -904,13 +911,13 @@ function MultiCombobox({
|
|
|
904
911
|
className
|
|
905
912
|
),
|
|
906
913
|
children: [
|
|
907
|
-
selected.length === 0 ? /* @__PURE__ */
|
|
914
|
+
selected.length === 0 ? /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: placeholder }) : selected.map((option) => /* @__PURE__ */ jsxs16(
|
|
908
915
|
"span",
|
|
909
916
|
{
|
|
910
917
|
className: "inline-flex items-center gap-1 rounded bg-secondary px-1.5 py-0.5 text-xs text-secondary-foreground",
|
|
911
918
|
children: [
|
|
912
919
|
option.label,
|
|
913
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ jsx18(
|
|
914
921
|
"button",
|
|
915
922
|
{
|
|
916
923
|
type: "button",
|
|
@@ -922,26 +929,26 @@ function MultiCombobox({
|
|
|
922
929
|
},
|
|
923
930
|
onPointerDown: (event) => event.stopPropagation(),
|
|
924
931
|
className: "rounded-sm opacity-60 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
925
|
-
children: /* @__PURE__ */
|
|
932
|
+
children: /* @__PURE__ */ jsx18(X2, { className: "h-3 w-3" })
|
|
926
933
|
}
|
|
927
934
|
)
|
|
928
935
|
]
|
|
929
936
|
},
|
|
930
937
|
option.value
|
|
931
938
|
)),
|
|
932
|
-
/* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ jsx18(ChevronsUpDown2, { className: "ml-auto h-4 w-4 shrink-0 opacity-50" })
|
|
933
940
|
]
|
|
934
941
|
}
|
|
935
942
|
);
|
|
936
|
-
const command = /* @__PURE__ */
|
|
943
|
+
const command = /* @__PURE__ */ jsxs16(
|
|
937
944
|
CommandPrimitive2,
|
|
938
945
|
{
|
|
939
946
|
shouldFilter: !isServer,
|
|
940
947
|
className: "flex h-full w-full flex-col overflow-hidden",
|
|
941
948
|
children: [
|
|
942
|
-
/* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */
|
|
944
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center border-b px-3", children: [
|
|
950
|
+
/* @__PURE__ */ jsx18(Search2, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
951
|
+
/* @__PURE__ */ jsx18(
|
|
945
952
|
CommandPrimitive2.Input,
|
|
946
953
|
{
|
|
947
954
|
placeholder: searchPlaceholder,
|
|
@@ -950,14 +957,14 @@ function MultiCombobox({
|
|
|
950
957
|
}
|
|
951
958
|
)
|
|
952
959
|
] }),
|
|
953
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ jsxs16(
|
|
954
961
|
CommandPrimitive2.List,
|
|
955
962
|
{
|
|
956
963
|
ref: listRef,
|
|
957
964
|
className: "max-h-[50vh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60",
|
|
958
965
|
children: [
|
|
959
|
-
!isServer && /* @__PURE__ */
|
|
960
|
-
options.map((option) => /* @__PURE__ */
|
|
966
|
+
!isServer && /* @__PURE__ */ jsx18(CommandPrimitive2.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
|
|
967
|
+
options.map((option) => /* @__PURE__ */ jsxs16(
|
|
961
968
|
CommandPrimitive2.Item,
|
|
962
969
|
{
|
|
963
970
|
value: isServer ? option.value : option.label,
|
|
@@ -965,7 +972,7 @@ function MultiCombobox({
|
|
|
965
972
|
onSelect: () => toggleValue(option.value),
|
|
966
973
|
className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 sm:py-1.5",
|
|
967
974
|
children: [
|
|
968
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ jsx18(
|
|
969
976
|
Check2,
|
|
970
977
|
{
|
|
971
978
|
className: cn(
|
|
@@ -974,14 +981,14 @@ function MultiCombobox({
|
|
|
974
981
|
)
|
|
975
982
|
}
|
|
976
983
|
),
|
|
977
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ jsx18("span", { className: "truncate", children: option.label })
|
|
978
985
|
]
|
|
979
986
|
},
|
|
980
987
|
option.value
|
|
981
988
|
)),
|
|
982
|
-
isServer && !loading && options.length === 0 && /* @__PURE__ */
|
|
983
|
-
isServer && loading && /* @__PURE__ */
|
|
984
|
-
isServer && hasMore && /* @__PURE__ */
|
|
989
|
+
isServer && !loading && options.length === 0 && /* @__PURE__ */ jsx18("div", { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
|
|
990
|
+
isServer && loading && /* @__PURE__ */ jsx18("div", { className: "flex items-center justify-center py-6", children: /* @__PURE__ */ jsx18(Loader22, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }),
|
|
991
|
+
isServer && hasMore && /* @__PURE__ */ jsx18("div", { ref: sentinelRef, "aria-hidden": true, className: "h-1" })
|
|
985
992
|
]
|
|
986
993
|
}
|
|
987
994
|
)
|
|
@@ -989,9 +996,9 @@ function MultiCombobox({
|
|
|
989
996
|
}
|
|
990
997
|
);
|
|
991
998
|
if (isDesktop) {
|
|
992
|
-
return /* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ jsxs16(PopoverPrimitive2.Root, { open, onOpenChange: setOpen, children: [
|
|
1000
|
+
/* @__PURE__ */ jsx18(PopoverPrimitive2.Trigger, { asChild: true, disabled, children: trigger }),
|
|
1001
|
+
/* @__PURE__ */ jsx18(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx18(
|
|
995
1002
|
PopoverPrimitive2.Content,
|
|
996
1003
|
{
|
|
997
1004
|
align: "start",
|
|
@@ -1003,13 +1010,13 @@ function MultiCombobox({
|
|
|
1003
1010
|
) })
|
|
1004
1011
|
] });
|
|
1005
1012
|
}
|
|
1006
|
-
return /* @__PURE__ */
|
|
1007
|
-
/* @__PURE__ */
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
/* @__PURE__ */
|
|
1010
|
-
/* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
+
return /* @__PURE__ */ jsxs16(DrawerPrimitive2.Root, { open, onOpenChange: setOpen, children: [
|
|
1014
|
+
/* @__PURE__ */ jsx18(DrawerPrimitive2.Trigger, { asChild: true, disabled, children: trigger }),
|
|
1015
|
+
/* @__PURE__ */ jsxs16(DrawerPrimitive2.Portal, { children: [
|
|
1016
|
+
/* @__PURE__ */ jsx18(DrawerPrimitive2.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
1017
|
+
/* @__PURE__ */ jsxs16(DrawerPrimitive2.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85vh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
|
|
1018
|
+
/* @__PURE__ */ jsx18(DrawerPrimitive2.Title, { className: "sr-only", children: placeholder }),
|
|
1019
|
+
/* @__PURE__ */ jsx18("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
1013
1020
|
command
|
|
1014
1021
|
] })
|
|
1015
1022
|
] })
|
|
@@ -1021,7 +1028,7 @@ import * as PopoverPrimitive3 from "@radix-ui/react-popover";
|
|
|
1021
1028
|
import { ChevronsUpDown as ChevronsUpDown3 } from "lucide-react";
|
|
1022
1029
|
import * as React8 from "react";
|
|
1023
1030
|
import { HexColorInput, HexColorPicker } from "react-colorful";
|
|
1024
|
-
import { jsx as
|
|
1031
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1025
1032
|
function ColorPicker({
|
|
1026
1033
|
value,
|
|
1027
1034
|
onChange,
|
|
@@ -1034,8 +1041,8 @@ function ColorPicker({
|
|
|
1034
1041
|
}) {
|
|
1035
1042
|
const [open, setOpen] = React8.useState(false);
|
|
1036
1043
|
const color = value || "";
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
/* @__PURE__ */
|
|
1044
|
+
return /* @__PURE__ */ jsxs17(PopoverPrimitive3.Root, { open, onOpenChange: setOpen, children: [
|
|
1045
|
+
/* @__PURE__ */ jsx19(PopoverPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs17(
|
|
1039
1046
|
"button",
|
|
1040
1047
|
{
|
|
1041
1048
|
type: "button",
|
|
@@ -1048,8 +1055,8 @@ function ColorPicker({
|
|
|
1048
1055
|
className
|
|
1049
1056
|
),
|
|
1050
1057
|
children: [
|
|
1051
|
-
/* @__PURE__ */
|
|
1052
|
-
/* @__PURE__ */
|
|
1058
|
+
/* @__PURE__ */ jsxs17("span", { className: "flex items-center gap-2 truncate", children: [
|
|
1059
|
+
/* @__PURE__ */ jsx19(
|
|
1053
1060
|
"span",
|
|
1054
1061
|
{
|
|
1055
1062
|
"aria-hidden": true,
|
|
@@ -1062,23 +1069,23 @@ function ColorPicker({
|
|
|
1062
1069
|
}
|
|
1063
1070
|
}
|
|
1064
1071
|
),
|
|
1065
|
-
/* @__PURE__ */
|
|
1072
|
+
/* @__PURE__ */ jsx19("span", { className: cn("truncate", !color && "text-muted-foreground"), children: color || placeholder })
|
|
1066
1073
|
] }),
|
|
1067
|
-
/* @__PURE__ */
|
|
1074
|
+
/* @__PURE__ */ jsx19(ChevronsUpDown3, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
1068
1075
|
]
|
|
1069
1076
|
}
|
|
1070
1077
|
) }),
|
|
1071
|
-
/* @__PURE__ */
|
|
1078
|
+
/* @__PURE__ */ jsx19(PopoverPrimitive3.Portal, { children: /* @__PURE__ */ jsx19(
|
|
1072
1079
|
PopoverPrimitive3.Content,
|
|
1073
1080
|
{
|
|
1074
1081
|
align: "start",
|
|
1075
1082
|
sideOffset: 4,
|
|
1076
1083
|
className: "z-50 w-56 rounded-md border bg-popover p-3 text-popover-foreground shadow-md",
|
|
1077
|
-
children: /* @__PURE__ */
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
/* @__PURE__ */
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
/* @__PURE__ */
|
|
1084
|
+
children: /* @__PURE__ */ jsxs17("div", { className: "mh-color-picker flex flex-col gap-3", children: [
|
|
1085
|
+
/* @__PURE__ */ jsx19(HexColorPicker, { color, onChange }),
|
|
1086
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
|
|
1087
|
+
/* @__PURE__ */ jsx19("span", { className: "text-sm text-muted-foreground", children: "#" }),
|
|
1088
|
+
/* @__PURE__ */ jsx19(
|
|
1082
1089
|
HexColorInput,
|
|
1083
1090
|
{
|
|
1084
1091
|
color,
|
|
@@ -1095,30 +1102,30 @@ function ColorPicker({
|
|
|
1095
1102
|
}
|
|
1096
1103
|
|
|
1097
1104
|
// src/components/stat-card.tsx
|
|
1098
|
-
import { jsx as
|
|
1105
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1099
1106
|
function StatCard({ label, value, detail, icon, isLoading }) {
|
|
1100
1107
|
if (isLoading) {
|
|
1101
|
-
return /* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1108
|
+
return /* @__PURE__ */ jsxs18("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
1109
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between pb-2", children: [
|
|
1110
|
+
/* @__PURE__ */ jsx20("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
1111
|
+
/* @__PURE__ */ jsx20("div", { className: "h-4 w-4 animate-pulse rounded bg-muted" })
|
|
1105
1112
|
] }),
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ jsx20("div", { className: "mt-2 h-7 w-16 animate-pulse rounded bg-muted" }),
|
|
1114
|
+
/* @__PURE__ */ jsx20("div", { className: "mt-1 h-4 w-20 animate-pulse rounded bg-muted" })
|
|
1108
1115
|
] });
|
|
1109
1116
|
}
|
|
1110
|
-
return /* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
icon && /* @__PURE__ */
|
|
1117
|
+
return /* @__PURE__ */ jsxs18("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
1118
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between pb-2", children: [
|
|
1119
|
+
/* @__PURE__ */ jsx20("span", { className: "text-sm font-medium text-muted-foreground", children: label }),
|
|
1120
|
+
icon && /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: icon })
|
|
1114
1121
|
] }),
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
detail && /* @__PURE__ */
|
|
1122
|
+
/* @__PURE__ */ jsx20("div", { className: "text-2xl font-bold", children: value }),
|
|
1123
|
+
detail && /* @__PURE__ */ jsx20("p", { className: "text-xs text-muted-foreground", children: detail })
|
|
1117
1124
|
] });
|
|
1118
1125
|
}
|
|
1119
1126
|
|
|
1120
1127
|
// src/components/data-table-wrapper.tsx
|
|
1121
|
-
import { jsx as
|
|
1128
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1122
1129
|
function DataTableWrapper({
|
|
1123
1130
|
children,
|
|
1124
1131
|
isEmpty,
|
|
@@ -1131,15 +1138,15 @@ function DataTableWrapper({
|
|
|
1131
1138
|
hasNextPage = false,
|
|
1132
1139
|
hasPreviousPage = false
|
|
1133
1140
|
}) {
|
|
1134
|
-
return /* @__PURE__ */
|
|
1135
|
-
/* @__PURE__ */
|
|
1136
|
-
!isLoading && isEmpty && /* @__PURE__ */
|
|
1137
|
-
emptyIcon && /* @__PURE__ */
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
emptyDescription && /* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ jsxs19("div", { className: "space-y-4", children: [
|
|
1142
|
+
/* @__PURE__ */ jsx21("div", { className: "overflow-x-auto rounded-md border", children }),
|
|
1143
|
+
!isLoading && isEmpty && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
1144
|
+
emptyIcon && /* @__PURE__ */ jsx21("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
1145
|
+
/* @__PURE__ */ jsx21("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
1146
|
+
emptyDescription && /* @__PURE__ */ jsx21("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
1140
1147
|
] }),
|
|
1141
|
-
page !== void 0 && onPageChange && /* @__PURE__ */
|
|
1142
|
-
/* @__PURE__ */
|
|
1148
|
+
page !== void 0 && onPageChange && /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-end gap-4", children: [
|
|
1149
|
+
/* @__PURE__ */ jsx21(
|
|
1143
1150
|
"button",
|
|
1144
1151
|
{
|
|
1145
1152
|
type: "button",
|
|
@@ -1149,11 +1156,11 @@ function DataTableWrapper({
|
|
|
1149
1156
|
children: "Anterior"
|
|
1150
1157
|
}
|
|
1151
1158
|
),
|
|
1152
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ jsxs19("span", { className: "text-sm text-muted-foreground", children: [
|
|
1153
1160
|
"P\xE1gina ",
|
|
1154
1161
|
page
|
|
1155
1162
|
] }),
|
|
1156
|
-
/* @__PURE__ */
|
|
1163
|
+
/* @__PURE__ */ jsx21(
|
|
1157
1164
|
"button",
|
|
1158
1165
|
{
|
|
1159
1166
|
type: "button",
|
|
@@ -1169,7 +1176,7 @@ function DataTableWrapper({
|
|
|
1169
1176
|
|
|
1170
1177
|
// src/components/mobile-card-list.tsx
|
|
1171
1178
|
import { useRef as useRef2 } from "react";
|
|
1172
|
-
import { jsx as
|
|
1179
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1173
1180
|
var SCROLL_THRESHOLD = 8;
|
|
1174
1181
|
function MobileCardList({
|
|
1175
1182
|
data,
|
|
@@ -1200,26 +1207,26 @@ function MobileCardList({
|
|
|
1200
1207
|
}
|
|
1201
1208
|
};
|
|
1202
1209
|
if (isLoading) {
|
|
1203
|
-
return /* @__PURE__ */
|
|
1204
|
-
/* @__PURE__ */
|
|
1205
|
-
/* @__PURE__ */
|
|
1206
|
-
/* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ jsx22("div", { className: `space-y-3 ${className ?? ""}`, children: Array.from({ length: loadingCount }).map((_, i) => /* @__PURE__ */ jsx22("div", { className: "rounded-xl border p-4", children: /* @__PURE__ */ jsxs20("div", { className: "space-y-3", children: [
|
|
1211
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex justify-between", children: [
|
|
1212
|
+
/* @__PURE__ */ jsx22("div", { className: "h-5 w-32 animate-pulse rounded bg-muted" }),
|
|
1213
|
+
/* @__PURE__ */ jsx22("div", { className: "h-5 w-16 animate-pulse rounded bg-muted" })
|
|
1207
1214
|
] }),
|
|
1208
|
-
/* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1215
|
+
/* @__PURE__ */ jsx22("div", { className: "h-4 w-48 animate-pulse rounded bg-muted" }),
|
|
1216
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex justify-between", children: [
|
|
1217
|
+
/* @__PURE__ */ jsx22("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
1218
|
+
/* @__PURE__ */ jsx22("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" })
|
|
1212
1219
|
] })
|
|
1213
1220
|
] }) }, i)) });
|
|
1214
1221
|
}
|
|
1215
|
-
return /* @__PURE__ */
|
|
1222
|
+
return /* @__PURE__ */ jsx22(
|
|
1216
1223
|
"div",
|
|
1217
1224
|
{
|
|
1218
1225
|
className: `space-y-3 ${className ?? ""}`,
|
|
1219
1226
|
onTouchStart,
|
|
1220
1227
|
onTouchMove,
|
|
1221
1228
|
onClickCapture,
|
|
1222
|
-
children: data.map((item, index) => /* @__PURE__ */
|
|
1229
|
+
children: data.map((item, index) => /* @__PURE__ */ jsx22(
|
|
1223
1230
|
"div",
|
|
1224
1231
|
{
|
|
1225
1232
|
className: "rounded-xl border p-4 transition-all duration-150 hover:border-foreground/20 active:scale-[0.99]",
|
|
@@ -1232,7 +1239,7 @@ function MobileCardList({
|
|
|
1232
1239
|
}
|
|
1233
1240
|
|
|
1234
1241
|
// src/components/responsive-data-view.tsx
|
|
1235
|
-
import { jsx as
|
|
1242
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1236
1243
|
function ResponsiveDataView({
|
|
1237
1244
|
table,
|
|
1238
1245
|
cards,
|
|
@@ -1243,13 +1250,13 @@ function ResponsiveDataView({
|
|
|
1243
1250
|
emptyDescription,
|
|
1244
1251
|
pagination
|
|
1245
1252
|
}) {
|
|
1246
|
-
return /* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
!isLoading && isEmpty && /* @__PURE__ */
|
|
1250
|
-
emptyIcon && /* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
emptyDescription && /* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ jsxs21("div", { className: "space-y-4", children: [
|
|
1254
|
+
/* @__PURE__ */ jsx23("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
|
|
1255
|
+
/* @__PURE__ */ jsx23("div", { className: "md:hidden", children: cards }),
|
|
1256
|
+
!isLoading && isEmpty && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
1257
|
+
emptyIcon && /* @__PURE__ */ jsx23("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
1258
|
+
/* @__PURE__ */ jsx23("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
1259
|
+
emptyDescription && /* @__PURE__ */ jsx23("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
1253
1260
|
] }),
|
|
1254
1261
|
pagination
|
|
1255
1262
|
] });
|
|
@@ -1257,10 +1264,10 @@ function ResponsiveDataView({
|
|
|
1257
1264
|
|
|
1258
1265
|
// src/components/toaster.tsx
|
|
1259
1266
|
import { Toaster as Sonner } from "sonner";
|
|
1260
|
-
import { jsx as
|
|
1267
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1261
1268
|
function Toaster(props) {
|
|
1262
1269
|
const { theme = "system" } = useTheme();
|
|
1263
|
-
return /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ jsx24(
|
|
1264
1271
|
Sonner,
|
|
1265
1272
|
{
|
|
1266
1273
|
theme,
|
|
@@ -1288,11 +1295,11 @@ import { useState as useState9 } from "react";
|
|
|
1288
1295
|
import { Fragment as Fragment3 } from "react";
|
|
1289
1296
|
|
|
1290
1297
|
// src/components/types.tsx
|
|
1291
|
-
import { jsx as
|
|
1292
|
-
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */
|
|
1298
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1299
|
+
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */ jsx25("a", { ...props, children });
|
|
1293
1300
|
|
|
1294
1301
|
// src/components/sidebar-nav.tsx
|
|
1295
|
-
import { Fragment as Fragment4, jsx as
|
|
1302
|
+
import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1296
1303
|
function defaultIsActive(item, activePath) {
|
|
1297
1304
|
if (item.href === "/") return activePath === "/";
|
|
1298
1305
|
return activePath === item.href || activePath.startsWith(item.href + "/");
|
|
@@ -1307,7 +1314,7 @@ function SidebarNav({
|
|
|
1307
1314
|
onNavigate
|
|
1308
1315
|
}) {
|
|
1309
1316
|
const visible = items.filter((item) => !item.adminOnly || isAdmin);
|
|
1310
|
-
return /* @__PURE__ */
|
|
1317
|
+
return /* @__PURE__ */ jsx26("nav", { className: "flex flex-col gap-1", children: visible.map((item) => {
|
|
1311
1318
|
const active = isActive(item, activePath);
|
|
1312
1319
|
const link = renderLink({
|
|
1313
1320
|
href: item.href,
|
|
@@ -1319,12 +1326,12 @@ function SidebarNav({
|
|
|
1319
1326
|
active ? "bg-accent text-accent-foreground font-semibold" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
1320
1327
|
isCollapsed && "justify-center px-2"
|
|
1321
1328
|
),
|
|
1322
|
-
children: /* @__PURE__ */
|
|
1323
|
-
item.icon && /* @__PURE__ */
|
|
1324
|
-
!isCollapsed && /* @__PURE__ */
|
|
1329
|
+
children: /* @__PURE__ */ jsxs22(Fragment4, { children: [
|
|
1330
|
+
item.icon && /* @__PURE__ */ jsx26("span", { className: "shrink-0", children: item.icon }),
|
|
1331
|
+
!isCollapsed && /* @__PURE__ */ jsx26("span", { className: "truncate", children: item.label })
|
|
1325
1332
|
] })
|
|
1326
1333
|
});
|
|
1327
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ jsx26(Fragment3, { children: link }, item.href);
|
|
1328
1335
|
}) });
|
|
1329
1336
|
}
|
|
1330
1337
|
|
|
@@ -1333,7 +1340,7 @@ import * as DropdownMenu2 from "@radix-ui/react-dropdown-menu";
|
|
|
1333
1340
|
import { LogOut, User } from "lucide-react";
|
|
1334
1341
|
import { useState as useState8 } from "react";
|
|
1335
1342
|
import { Drawer as DrawerPrimitive3 } from "vaul";
|
|
1336
|
-
import { Fragment as Fragment5, jsx as
|
|
1343
|
+
import { Fragment as Fragment5, jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1337
1344
|
function initials(user) {
|
|
1338
1345
|
const source = user?.name?.trim() || user?.email?.trim();
|
|
1339
1346
|
if (!source) return "";
|
|
@@ -1354,50 +1361,50 @@ function UserMenu({
|
|
|
1354
1361
|
const isDesktop = useIsDesktop();
|
|
1355
1362
|
const [open, setOpen] = useState8(false);
|
|
1356
1363
|
const label = initials(user);
|
|
1357
|
-
const trigger = /* @__PURE__ */
|
|
1364
|
+
const trigger = /* @__PURE__ */ jsx27(
|
|
1358
1365
|
"button",
|
|
1359
1366
|
{
|
|
1360
1367
|
type: "button",
|
|
1361
1368
|
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-2 focus-visible:ring-ring",
|
|
1362
1369
|
"aria-label": "Menu do usu\xE1rio",
|
|
1363
1370
|
"data-testid": "user-menu",
|
|
1364
|
-
children: user?.avatarUrl ? /* @__PURE__ */
|
|
1371
|
+
children: user?.avatarUrl ? /* @__PURE__ */ jsx27(
|
|
1365
1372
|
"img",
|
|
1366
1373
|
{
|
|
1367
1374
|
src: user.avatarUrl,
|
|
1368
1375
|
alt: user.name ?? user.email ?? "Avatar",
|
|
1369
1376
|
className: "h-full w-full object-cover"
|
|
1370
1377
|
}
|
|
1371
|
-
) : label ? /* @__PURE__ */
|
|
1378
|
+
) : label ? /* @__PURE__ */ jsx27("span", { children: label }) : /* @__PURE__ */ jsx27(User, { className: "h-4 w-4" })
|
|
1372
1379
|
}
|
|
1373
1380
|
);
|
|
1374
|
-
const userInfo = (user?.name || user?.email) && /* @__PURE__ */
|
|
1375
|
-
user.name && /* @__PURE__ */
|
|
1376
|
-
user.email && /* @__PURE__ */
|
|
1381
|
+
const userInfo = (user?.name || user?.email) && /* @__PURE__ */ jsxs23("div", { className: "px-2 py-1.5", children: [
|
|
1382
|
+
user.name && /* @__PURE__ */ jsx27("p", { className: "truncate text-sm font-medium", children: user.name }),
|
|
1383
|
+
user.email && /* @__PURE__ */ jsx27("p", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
1377
1384
|
] });
|
|
1378
1385
|
if (isDesktop) {
|
|
1379
|
-
return /* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1386
|
+
return /* @__PURE__ */ jsxs23(DropdownMenu2.Root, { open, onOpenChange: setOpen, children: [
|
|
1387
|
+
/* @__PURE__ */ jsx27(DropdownMenu2.Trigger, { asChild: true, children: trigger }),
|
|
1388
|
+
/* @__PURE__ */ jsx27(DropdownMenu2.Portal, { children: /* @__PURE__ */ jsxs23(
|
|
1382
1389
|
DropdownMenu2.Content,
|
|
1383
1390
|
{
|
|
1384
1391
|
align,
|
|
1385
1392
|
sideOffset: 6,
|
|
1386
1393
|
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",
|
|
1387
1394
|
children: [
|
|
1388
|
-
userInfo && /* @__PURE__ */
|
|
1395
|
+
userInfo && /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
1389
1396
|
userInfo,
|
|
1390
|
-
/* @__PURE__ */
|
|
1397
|
+
/* @__PURE__ */ jsx27(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" })
|
|
1391
1398
|
] }),
|
|
1392
1399
|
items.map(
|
|
1393
|
-
(item) => item.href ? /* @__PURE__ */
|
|
1400
|
+
(item) => item.href ? /* @__PURE__ */ jsx27(DropdownMenu2.Item, { asChild: true, children: renderLink({
|
|
1394
1401
|
href: item.href,
|
|
1395
1402
|
className: itemClass,
|
|
1396
|
-
children: /* @__PURE__ */
|
|
1403
|
+
children: /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
1397
1404
|
item.icon,
|
|
1398
1405
|
item.label
|
|
1399
1406
|
] })
|
|
1400
|
-
}) }, item.label) : /* @__PURE__ */
|
|
1407
|
+
}) }, item.label) : /* @__PURE__ */ jsxs23(
|
|
1401
1408
|
DropdownMenu2.Item,
|
|
1402
1409
|
{
|
|
1403
1410
|
className: itemClass,
|
|
@@ -1410,9 +1417,9 @@ function UserMenu({
|
|
|
1410
1417
|
item.label
|
|
1411
1418
|
)
|
|
1412
1419
|
),
|
|
1413
|
-
onLogout && /* @__PURE__ */
|
|
1414
|
-
items.length > 0 && /* @__PURE__ */
|
|
1415
|
-
/* @__PURE__ */
|
|
1420
|
+
onLogout && /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
1421
|
+
items.length > 0 && /* @__PURE__ */ jsx27(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" }),
|
|
1422
|
+
/* @__PURE__ */ jsxs23(
|
|
1416
1423
|
DropdownMenu2.Item,
|
|
1417
1424
|
{
|
|
1418
1425
|
className: cn(
|
|
@@ -1421,7 +1428,7 @@ function UserMenu({
|
|
|
1421
1428
|
),
|
|
1422
1429
|
onClick: onLogout,
|
|
1423
1430
|
children: [
|
|
1424
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__PURE__ */ jsx27(LogOut, { className: "h-4 w-4" }),
|
|
1425
1432
|
logoutLabel
|
|
1426
1433
|
]
|
|
1427
1434
|
}
|
|
@@ -1432,19 +1439,19 @@ function UserMenu({
|
|
|
1432
1439
|
) })
|
|
1433
1440
|
] });
|
|
1434
1441
|
}
|
|
1435
|
-
return /* @__PURE__ */
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
/* @__PURE__ */
|
|
1439
|
-
/* @__PURE__ */
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1442
|
-
userInfo && /* @__PURE__ */
|
|
1442
|
+
return /* @__PURE__ */ jsxs23(DrawerPrimitive3.Root, { open, onOpenChange: setOpen, children: [
|
|
1443
|
+
/* @__PURE__ */ jsx27(DrawerPrimitive3.Trigger, { asChild: true, children: trigger }),
|
|
1444
|
+
/* @__PURE__ */ jsxs23(DrawerPrimitive3.Portal, { children: [
|
|
1445
|
+
/* @__PURE__ */ jsx27(DrawerPrimitive3.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
1446
|
+
/* @__PURE__ */ jsxs23(DrawerPrimitive3.Content, { className: "fixed inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl border bg-popover p-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] text-popover-foreground outline-none", children: [
|
|
1447
|
+
/* @__PURE__ */ jsx27(DrawerPrimitive3.Title, { className: "sr-only", children: "Menu do usu\xE1rio" }),
|
|
1448
|
+
/* @__PURE__ */ jsx27("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
1449
|
+
userInfo && /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
1443
1450
|
userInfo,
|
|
1444
|
-
/* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ jsx27("div", { className: "-mx-1 my-1 h-px bg-border" })
|
|
1445
1452
|
] }),
|
|
1446
1453
|
items.map(
|
|
1447
|
-
(item) => item.href ? /* @__PURE__ */
|
|
1454
|
+
(item) => item.href ? /* @__PURE__ */ jsx27(
|
|
1448
1455
|
"span",
|
|
1449
1456
|
{
|
|
1450
1457
|
onClick: () => setOpen(false),
|
|
@@ -1452,14 +1459,14 @@ function UserMenu({
|
|
|
1452
1459
|
children: renderLink({
|
|
1453
1460
|
href: item.href,
|
|
1454
1461
|
className: sheetItemClass,
|
|
1455
|
-
children: /* @__PURE__ */
|
|
1462
|
+
children: /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
1456
1463
|
item.icon,
|
|
1457
1464
|
item.label
|
|
1458
1465
|
] })
|
|
1459
1466
|
})
|
|
1460
1467
|
},
|
|
1461
1468
|
item.label
|
|
1462
|
-
) : /* @__PURE__ */
|
|
1469
|
+
) : /* @__PURE__ */ jsxs23(
|
|
1463
1470
|
"button",
|
|
1464
1471
|
{
|
|
1465
1472
|
type: "button",
|
|
@@ -1476,9 +1483,9 @@ function UserMenu({
|
|
|
1476
1483
|
item.label
|
|
1477
1484
|
)
|
|
1478
1485
|
),
|
|
1479
|
-
onLogout && /* @__PURE__ */
|
|
1480
|
-
items.length > 0 && /* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1486
|
+
onLogout && /* @__PURE__ */ jsxs23(Fragment5, { children: [
|
|
1487
|
+
items.length > 0 && /* @__PURE__ */ jsx27("div", { className: "-mx-1 my-1 h-px bg-border" }),
|
|
1488
|
+
/* @__PURE__ */ jsxs23(
|
|
1482
1489
|
"button",
|
|
1483
1490
|
{
|
|
1484
1491
|
type: "button",
|
|
@@ -1488,7 +1495,7 @@ function UserMenu({
|
|
|
1488
1495
|
setOpen(false);
|
|
1489
1496
|
},
|
|
1490
1497
|
children: [
|
|
1491
|
-
/* @__PURE__ */
|
|
1498
|
+
/* @__PURE__ */ jsx27(LogOut, { className: "h-4 w-4" }),
|
|
1492
1499
|
logoutLabel
|
|
1493
1500
|
]
|
|
1494
1501
|
}
|
|
@@ -1500,7 +1507,7 @@ function UserMenu({
|
|
|
1500
1507
|
}
|
|
1501
1508
|
|
|
1502
1509
|
// src/components/app-shell.tsx
|
|
1503
|
-
import { jsx as
|
|
1510
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1504
1511
|
function AppShell({
|
|
1505
1512
|
brand,
|
|
1506
1513
|
brandCollapsed,
|
|
@@ -1519,7 +1526,7 @@ function AppShell({
|
|
|
1519
1526
|
}) {
|
|
1520
1527
|
const [collapsed, setCollapsed] = useState9(defaultCollapsed);
|
|
1521
1528
|
const [mobileOpen, setMobileOpen] = useState9(false);
|
|
1522
|
-
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */
|
|
1529
|
+
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */ jsx28(
|
|
1523
1530
|
SidebarNav,
|
|
1524
1531
|
{
|
|
1525
1532
|
items: navItems,
|
|
@@ -1531,8 +1538,8 @@ function AppShell({
|
|
|
1531
1538
|
onNavigate
|
|
1532
1539
|
}
|
|
1533
1540
|
);
|
|
1534
|
-
return /* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1541
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex h-screen overflow-hidden bg-background", children: [
|
|
1542
|
+
/* @__PURE__ */ jsxs24(
|
|
1536
1543
|
"aside",
|
|
1537
1544
|
{
|
|
1538
1545
|
className: cn(
|
|
@@ -1540,22 +1547,22 @@ function AppShell({
|
|
|
1540
1547
|
collapsed ? "w-16" : "w-60"
|
|
1541
1548
|
),
|
|
1542
1549
|
children: [
|
|
1543
|
-
/* @__PURE__ */
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
collapsible && /* @__PURE__ */
|
|
1550
|
+
/* @__PURE__ */ jsx28("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
1551
|
+
/* @__PURE__ */ jsx28("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(collapsed) }),
|
|
1552
|
+
collapsible && /* @__PURE__ */ jsx28("div", { className: "border-t p-2", children: /* @__PURE__ */ jsx28(
|
|
1546
1553
|
"button",
|
|
1547
1554
|
{
|
|
1548
1555
|
type: "button",
|
|
1549
1556
|
onClick: () => setCollapsed((v) => !v),
|
|
1550
1557
|
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",
|
|
1551
1558
|
"aria-label": collapsed ? "Expandir menu" : "Recolher menu",
|
|
1552
|
-
children: collapsed ? /* @__PURE__ */
|
|
1559
|
+
children: collapsed ? /* @__PURE__ */ jsx28(ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx28(ChevronLeft, { className: "h-4 w-4" })
|
|
1553
1560
|
}
|
|
1554
1561
|
) })
|
|
1555
1562
|
]
|
|
1556
1563
|
}
|
|
1557
1564
|
),
|
|
1558
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ jsxs24(
|
|
1559
1566
|
"div",
|
|
1560
1567
|
{
|
|
1561
1568
|
className: cn(
|
|
@@ -1564,8 +1571,8 @@ function AppShell({
|
|
|
1564
1571
|
),
|
|
1565
1572
|
onClick: () => setMobileOpen(false),
|
|
1566
1573
|
children: [
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1574
|
+
/* @__PURE__ */ jsx28("div", { className: "absolute inset-0 bg-black/50" }),
|
|
1575
|
+
/* @__PURE__ */ jsxs24(
|
|
1569
1576
|
"div",
|
|
1570
1577
|
{
|
|
1571
1578
|
className: cn(
|
|
@@ -1574,32 +1581,32 @@ function AppShell({
|
|
|
1574
1581
|
),
|
|
1575
1582
|
onClick: (e) => e.stopPropagation(),
|
|
1576
1583
|
children: [
|
|
1577
|
-
/* @__PURE__ */
|
|
1578
|
-
/* @__PURE__ */
|
|
1584
|
+
/* @__PURE__ */ jsx28("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: brand }),
|
|
1585
|
+
/* @__PURE__ */ jsx28("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(false, () => setMobileOpen(false)) })
|
|
1579
1586
|
]
|
|
1580
1587
|
}
|
|
1581
1588
|
)
|
|
1582
1589
|
]
|
|
1583
1590
|
}
|
|
1584
1591
|
),
|
|
1585
|
-
/* @__PURE__ */
|
|
1586
|
-
/* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */
|
|
1592
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1593
|
+
/* @__PURE__ */ jsxs24("header", { className: "flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4", children: [
|
|
1594
|
+
/* @__PURE__ */ jsx28(
|
|
1588
1595
|
"button",
|
|
1589
1596
|
{
|
|
1590
1597
|
type: "button",
|
|
1591
1598
|
onClick: () => setMobileOpen(true),
|
|
1592
1599
|
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",
|
|
1593
1600
|
"aria-label": "Abrir menu",
|
|
1594
|
-
children: /* @__PURE__ */
|
|
1601
|
+
children: /* @__PURE__ */ jsx28(Menu, { className: "h-4 w-4" })
|
|
1595
1602
|
}
|
|
1596
1603
|
),
|
|
1597
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ jsxs24("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
1598
1605
|
headerActions,
|
|
1599
|
-
(user || onLogout) && /* @__PURE__ */
|
|
1606
|
+
(user || onLogout) && /* @__PURE__ */ jsx28(UserMenu, { user, items: userMenuItems, onLogout, renderLink })
|
|
1600
1607
|
] })
|
|
1601
1608
|
] }),
|
|
1602
|
-
/* @__PURE__ */
|
|
1609
|
+
/* @__PURE__ */ jsx28("main", { className: "flex-1 overflow-y-auto", children })
|
|
1603
1610
|
] })
|
|
1604
1611
|
] });
|
|
1605
1612
|
}
|
|
@@ -1609,7 +1616,7 @@ import * as DropdownMenu3 from "@radix-ui/react-dropdown-menu";
|
|
|
1609
1616
|
import { MoreVertical } from "lucide-react";
|
|
1610
1617
|
import { useState as useState10 } from "react";
|
|
1611
1618
|
import { Drawer as DrawerPrimitive4 } from "vaul";
|
|
1612
|
-
import { Fragment as Fragment6, jsx as
|
|
1619
|
+
import { Fragment as Fragment6, jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1613
1620
|
var triggerClass = "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-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
|
|
1614
1621
|
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";
|
|
1615
1622
|
var sheetItemClass2 = "flex w-full cursor-pointer select-none items-center gap-3 rounded-md px-3 py-3 text-base outline-none transition-colors hover:bg-accent active:bg-accent disabled:pointer-events-none disabled:opacity-50";
|
|
@@ -1623,20 +1630,20 @@ function RowActionsMenu({
|
|
|
1623
1630
|
const isDesktop = useIsDesktop();
|
|
1624
1631
|
const [open, setOpen] = useState10(false);
|
|
1625
1632
|
if (actions.length === 0) return null;
|
|
1626
|
-
const trigger = /* @__PURE__ */
|
|
1633
|
+
const trigger = /* @__PURE__ */ jsx29(
|
|
1627
1634
|
"button",
|
|
1628
1635
|
{
|
|
1629
1636
|
type: "button",
|
|
1630
1637
|
disabled,
|
|
1631
1638
|
"aria-label": label,
|
|
1632
1639
|
className: triggerClass,
|
|
1633
|
-
children: /* @__PURE__ */
|
|
1640
|
+
children: /* @__PURE__ */ jsx29(MoreVertical, { className: "h-4 w-4" })
|
|
1634
1641
|
}
|
|
1635
1642
|
);
|
|
1636
1643
|
if (isDesktop) {
|
|
1637
|
-
return /* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ jsxs25(DropdownMenu3.Root, { open, onOpenChange: setOpen, modal: false, children: [
|
|
1645
|
+
/* @__PURE__ */ jsx29(DropdownMenu3.Trigger, { asChild: true, children: trigger }),
|
|
1646
|
+
/* @__PURE__ */ jsx29(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx29(
|
|
1640
1647
|
DropdownMenu3.Content,
|
|
1641
1648
|
{
|
|
1642
1649
|
align,
|
|
@@ -1647,7 +1654,7 @@ function RowActionsMenu({
|
|
|
1647
1654
|
itemClass2,
|
|
1648
1655
|
action.destructive && "text-destructive focus:bg-destructive/10"
|
|
1649
1656
|
);
|
|
1650
|
-
return action.href ? /* @__PURE__ */
|
|
1657
|
+
return action.href ? /* @__PURE__ */ jsx29(
|
|
1651
1658
|
DropdownMenu3.Item,
|
|
1652
1659
|
{
|
|
1653
1660
|
asChild: true,
|
|
@@ -1655,14 +1662,14 @@ function RowActionsMenu({
|
|
|
1655
1662
|
children: renderLink({
|
|
1656
1663
|
href: action.href,
|
|
1657
1664
|
className: cls,
|
|
1658
|
-
children: /* @__PURE__ */
|
|
1665
|
+
children: /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
1659
1666
|
action.icon,
|
|
1660
1667
|
action.label
|
|
1661
1668
|
] })
|
|
1662
1669
|
})
|
|
1663
1670
|
},
|
|
1664
1671
|
action.label
|
|
1665
|
-
) : /* @__PURE__ */
|
|
1672
|
+
) : /* @__PURE__ */ jsxs25(
|
|
1666
1673
|
DropdownMenu3.Item,
|
|
1667
1674
|
{
|
|
1668
1675
|
className: cls,
|
|
@@ -1680,23 +1687,23 @@ function RowActionsMenu({
|
|
|
1680
1687
|
) })
|
|
1681
1688
|
] });
|
|
1682
1689
|
}
|
|
1683
|
-
return /* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
/* @__PURE__ */
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
/* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ jsxs25(DrawerPrimitive4.Root, { open, onOpenChange: setOpen, children: [
|
|
1691
|
+
/* @__PURE__ */ jsx29(DrawerPrimitive4.Trigger, { asChild: true, children: trigger }),
|
|
1692
|
+
/* @__PURE__ */ jsxs25(DrawerPrimitive4.Portal, { children: [
|
|
1693
|
+
/* @__PURE__ */ jsx29(DrawerPrimitive4.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
1694
|
+
/* @__PURE__ */ jsxs25(DrawerPrimitive4.Content, { className: "fixed inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl border bg-popover p-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] text-popover-foreground outline-none", children: [
|
|
1695
|
+
/* @__PURE__ */ jsx29(DrawerPrimitive4.Title, { className: "sr-only", children: label }),
|
|
1696
|
+
/* @__PURE__ */ jsx29("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
1690
1697
|
actions.map((action) => {
|
|
1691
1698
|
const cls = cn(
|
|
1692
1699
|
sheetItemClass2,
|
|
1693
1700
|
action.destructive && "text-destructive"
|
|
1694
1701
|
);
|
|
1695
|
-
const inner = /* @__PURE__ */
|
|
1702
|
+
const inner = /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
1696
1703
|
action.icon,
|
|
1697
1704
|
action.label
|
|
1698
1705
|
] });
|
|
1699
|
-
return action.href ? /* @__PURE__ */
|
|
1706
|
+
return action.href ? /* @__PURE__ */ jsx29(
|
|
1700
1707
|
"span",
|
|
1701
1708
|
{
|
|
1702
1709
|
onClick: () => setOpen(false),
|
|
@@ -1708,7 +1715,7 @@ function RowActionsMenu({
|
|
|
1708
1715
|
})
|
|
1709
1716
|
},
|
|
1710
1717
|
action.label
|
|
1711
|
-
) : /* @__PURE__ */
|
|
1718
|
+
) : /* @__PURE__ */ jsx29(
|
|
1712
1719
|
"button",
|
|
1713
1720
|
{
|
|
1714
1721
|
type: "button",
|
|
@@ -1775,6 +1782,7 @@ function useCustomToast() {
|
|
|
1775
1782
|
export {
|
|
1776
1783
|
AppShell,
|
|
1777
1784
|
AuthCard,
|
|
1785
|
+
BaseDialog,
|
|
1778
1786
|
ColorPicker,
|
|
1779
1787
|
Combobox,
|
|
1780
1788
|
ConfirmDialog,
|