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