analytica-frontend-lib 1.2.21 → 1.2.22
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/AlertManager/index.css +0 -3
- package/dist/AlertManager/index.css.map +1 -1
- package/dist/AlertManagerView/index.js +347 -159
- package/dist/AlertManagerView/index.js.map +1 -1
- package/dist/AlertManagerView/index.mjs +346 -159
- package/dist/AlertManagerView/index.mjs.map +1 -1
- package/dist/Radio/index.d.mts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Table/index.d.mts +23 -24
- package/dist/Table/index.d.ts +23 -24
- package/dist/Table/index.js +328 -140
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs +323 -136
- package/dist/Table/index.mjs.map +1 -1
- package/dist/TableProvider/index.css +0 -3
- package/dist/TableProvider/index.css.map +1 -1
- package/dist/TableProvider/index.d.mts +1 -1
- package/dist/TableProvider/index.d.ts +1 -1
- package/dist/TableProvider/index.js +826 -629
- package/dist/TableProvider/index.js.map +1 -1
- package/dist/TableProvider/index.mjs +737 -541
- package/dist/TableProvider/index.mjs.map +1 -1
- package/dist/{TableProvider-D4Ak7ofz.d.ts → TableProvider-48a6wb7j.d.ts} +43 -4
- package/dist/{TableProvider-CDcL1tDj.d.mts → TableProvider-DyhwEkPT.d.mts} +43 -4
- package/dist/index.css +0 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +643 -598
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +601 -557
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +0 -3
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
|
@@ -383,13 +383,12 @@ var Divider_default = Divider;
|
|
|
383
383
|
|
|
384
384
|
// src/components/Table/Table.tsx
|
|
385
385
|
import {
|
|
386
|
-
forwardRef,
|
|
386
|
+
forwardRef as forwardRef2,
|
|
387
387
|
useState,
|
|
388
388
|
useMemo,
|
|
389
389
|
useEffect as useEffect2,
|
|
390
390
|
Children,
|
|
391
|
-
isValidElement
|
|
392
|
-
cloneElement
|
|
391
|
+
isValidElement
|
|
393
392
|
} from "react";
|
|
394
393
|
import { CaretUp, CaretDown } from "phosphor-react";
|
|
395
394
|
|
|
@@ -422,123 +421,311 @@ var NoSearchResult = ({ image, title, description }) => {
|
|
|
422
421
|
};
|
|
423
422
|
var NoSearchResult_default = NoSearchResult;
|
|
424
423
|
|
|
425
|
-
// src/components/
|
|
424
|
+
// src/components/Skeleton/Skeleton.tsx
|
|
425
|
+
import { forwardRef } from "react";
|
|
426
426
|
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
427
|
-
var
|
|
427
|
+
var SKELETON_ANIMATION_CLASSES = {
|
|
428
|
+
pulse: "animate-pulse",
|
|
429
|
+
none: ""
|
|
430
|
+
};
|
|
431
|
+
var SKELETON_VARIANT_CLASSES = {
|
|
432
|
+
text: "h-4 bg-background-200 rounded",
|
|
433
|
+
circular: "bg-background-200 rounded-full",
|
|
434
|
+
rectangular: "bg-background-200",
|
|
435
|
+
rounded: "bg-background-200 rounded-lg"
|
|
436
|
+
};
|
|
437
|
+
var SPACING_CLASSES = {
|
|
438
|
+
none: "",
|
|
439
|
+
small: "space-y-1",
|
|
440
|
+
medium: "space-y-2",
|
|
441
|
+
large: "space-y-3"
|
|
442
|
+
};
|
|
443
|
+
var Skeleton = forwardRef(
|
|
428
444
|
({
|
|
429
|
-
variant = "
|
|
430
|
-
|
|
445
|
+
variant = "text",
|
|
446
|
+
width,
|
|
447
|
+
height,
|
|
448
|
+
animation = "pulse",
|
|
449
|
+
lines = 1,
|
|
450
|
+
spacing = "none",
|
|
451
|
+
className = "",
|
|
431
452
|
children,
|
|
432
|
-
searchTerm,
|
|
433
|
-
noSearchResultImage,
|
|
434
|
-
noSearchResultTitle = "Nenhum resultado encontrado",
|
|
435
|
-
noSearchResultDescription = "N\xE3o encontramos nenhum resultado com esse nome. Tente revisar a busca ou usar outra palavra-chave.",
|
|
436
|
-
emptyStateMessage = "Nenhum dado dispon\xEDvel no momento.",
|
|
437
|
-
emptyStateButtonText = "Adicionar item",
|
|
438
|
-
onEmptyStateButtonClick,
|
|
439
453
|
...props
|
|
440
454
|
}, ref) => {
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
return foundBody ? empty : false;
|
|
454
|
-
}, [children]);
|
|
455
|
-
const columnCount = useMemo(() => {
|
|
456
|
-
let count = 0;
|
|
457
|
-
Children.forEach(children, (child) => {
|
|
458
|
-
if (isValidElement(child) && child.type === TableHeader) {
|
|
459
|
-
const headerProps = child.props;
|
|
460
|
-
Children.forEach(headerProps.children, (row) => {
|
|
461
|
-
if (isValidElement(row) && row.type === TableRow) {
|
|
462
|
-
const rowProps = row.props;
|
|
463
|
-
count = Children.count(rowProps.children);
|
|
464
|
-
}
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
return count || 1;
|
|
469
|
-
}, [children]);
|
|
470
|
-
const hasSearchTerm = searchTerm && searchTerm.trim() !== "";
|
|
471
|
-
const showNoSearchResult = hasSearchTerm && isTableBodyEmpty;
|
|
472
|
-
const showEmptyState = !hasSearchTerm && isTableBodyEmpty;
|
|
473
|
-
if (showNoSearchResult) {
|
|
474
|
-
return /* @__PURE__ */ jsxs4(
|
|
455
|
+
const animationClass = SKELETON_ANIMATION_CLASSES[animation];
|
|
456
|
+
const variantClass = SKELETON_VARIANT_CLASSES[variant];
|
|
457
|
+
const spacingClass = SPACING_CLASSES[spacing];
|
|
458
|
+
const style = {
|
|
459
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
460
|
+
height: typeof height === "number" ? `${height}px` : height
|
|
461
|
+
};
|
|
462
|
+
if (variant === "text" && lines > 1) {
|
|
463
|
+
return /* @__PURE__ */ jsx6(
|
|
475
464
|
"div",
|
|
476
465
|
{
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
)
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
{
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
className
|
|
489
|
-
),
|
|
490
|
-
...props,
|
|
491
|
-
children: Children.map(children, (child) => {
|
|
492
|
-
if (isValidElement(child) && (child.type === TableCaption || child.type === TableHeader)) {
|
|
493
|
-
return child;
|
|
494
|
-
}
|
|
495
|
-
return null;
|
|
496
|
-
})
|
|
497
|
-
}
|
|
498
|
-
),
|
|
499
|
-
/* @__PURE__ */ jsx6("div", { className: "py-8 flex justify-center", children: noSearchResultImage ? /* @__PURE__ */ jsx6(
|
|
500
|
-
NoSearchResult_default,
|
|
501
|
-
{
|
|
502
|
-
image: noSearchResultImage,
|
|
503
|
-
title: noSearchResultTitle,
|
|
504
|
-
description: noSearchResultDescription
|
|
505
|
-
}
|
|
506
|
-
) : /* @__PURE__ */ jsxs4("div", { className: "text-center", children: [
|
|
507
|
-
/* @__PURE__ */ jsx6("p", { className: "text-text-600 text-lg font-semibold mb-2", children: noSearchResultTitle }),
|
|
508
|
-
/* @__PURE__ */ jsx6("p", { className: "text-text-500 text-sm", children: noSearchResultDescription })
|
|
509
|
-
] }) })
|
|
510
|
-
]
|
|
466
|
+
ref,
|
|
467
|
+
className: cn("flex flex-col", spacingClass, className),
|
|
468
|
+
...props,
|
|
469
|
+
children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ jsx6(
|
|
470
|
+
"div",
|
|
471
|
+
{
|
|
472
|
+
className: cn(variantClass, animationClass),
|
|
473
|
+
style: index === lines - 1 ? { width: "60%" } : void 0
|
|
474
|
+
},
|
|
475
|
+
index
|
|
476
|
+
))
|
|
511
477
|
}
|
|
512
478
|
);
|
|
513
479
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
variant: "solid",
|
|
523
|
-
action: "primary",
|
|
524
|
-
size: "medium",
|
|
525
|
-
onClick: onEmptyStateButtonClick,
|
|
526
|
-
children: emptyStateButtonText
|
|
527
|
-
}
|
|
528
|
-
)
|
|
529
|
-
] }) }) })
|
|
530
|
-
});
|
|
480
|
+
return /* @__PURE__ */ jsx6(
|
|
481
|
+
"div",
|
|
482
|
+
{
|
|
483
|
+
ref,
|
|
484
|
+
className: cn(variantClass, animationClass, className),
|
|
485
|
+
style,
|
|
486
|
+
...props,
|
|
487
|
+
children
|
|
531
488
|
}
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
var SkeletonText = forwardRef(
|
|
493
|
+
(props, ref) => /* @__PURE__ */ jsx6(Skeleton, { ref, variant: "text", ...props })
|
|
494
|
+
);
|
|
495
|
+
var SkeletonCircle = forwardRef((props, ref) => /* @__PURE__ */ jsx6(Skeleton, { ref, variant: "circular", ...props }));
|
|
496
|
+
var SkeletonRectangle = forwardRef((props, ref) => /* @__PURE__ */ jsx6(Skeleton, { ref, variant: "rectangular", ...props }));
|
|
497
|
+
var SkeletonRounded = forwardRef((props, ref) => /* @__PURE__ */ jsx6(Skeleton, { ref, variant: "rounded", ...props }));
|
|
498
|
+
var SkeletonCard = forwardRef(
|
|
499
|
+
({
|
|
500
|
+
showAvatar = true,
|
|
501
|
+
showTitle = true,
|
|
502
|
+
showDescription = true,
|
|
503
|
+
showActions = true,
|
|
504
|
+
lines = 2,
|
|
505
|
+
className = "",
|
|
506
|
+
...props
|
|
507
|
+
}, ref) => {
|
|
508
|
+
return /* @__PURE__ */ jsxs4(
|
|
509
|
+
"div",
|
|
510
|
+
{
|
|
511
|
+
ref,
|
|
512
|
+
className: cn(
|
|
513
|
+
"w-full p-4 bg-background border border-border-200 rounded-lg",
|
|
514
|
+
className
|
|
515
|
+
),
|
|
516
|
+
...props,
|
|
517
|
+
children: [
|
|
518
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-start space-x-3", children: [
|
|
519
|
+
showAvatar && /* @__PURE__ */ jsx6(SkeletonCircle, { width: 40, height: 40 }),
|
|
520
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex-1 space-y-2", children: [
|
|
521
|
+
showTitle && /* @__PURE__ */ jsx6(SkeletonText, { width: "60%", height: 20 }),
|
|
522
|
+
showDescription && /* @__PURE__ */ jsx6(SkeletonText, { lines, spacing: "small" })
|
|
523
|
+
] })
|
|
524
|
+
] }),
|
|
525
|
+
showActions && /* @__PURE__ */ jsxs4("div", { className: "flex justify-end space-x-2 mt-4", children: [
|
|
526
|
+
/* @__PURE__ */ jsx6(SkeletonRectangle, { width: 80, height: 32 }),
|
|
527
|
+
/* @__PURE__ */ jsx6(SkeletonRectangle, { width: 80, height: 32 })
|
|
528
|
+
] })
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
);
|
|
534
|
+
var SkeletonList = forwardRef(
|
|
535
|
+
({
|
|
536
|
+
items = 3,
|
|
537
|
+
showAvatar = true,
|
|
538
|
+
showTitle = true,
|
|
539
|
+
showDescription = true,
|
|
540
|
+
lines = 1,
|
|
541
|
+
className = "",
|
|
542
|
+
...props
|
|
543
|
+
}, ref) => {
|
|
544
|
+
return /* @__PURE__ */ jsx6("div", { ref, className: cn("space-y-3", className), ...props, children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ jsxs4("div", { className: "flex items-start space-x-3 p-3", children: [
|
|
545
|
+
showAvatar && /* @__PURE__ */ jsx6(SkeletonCircle, { width: 32, height: 32 }),
|
|
546
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex-1 space-y-2", children: [
|
|
547
|
+
showTitle && /* @__PURE__ */ jsx6(SkeletonText, { width: "40%", height: 16 }),
|
|
548
|
+
showDescription && /* @__PURE__ */ jsx6(SkeletonText, { lines, spacing: "small" })
|
|
549
|
+
] })
|
|
550
|
+
] }, index)) });
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
var SkeletonTable = forwardRef(
|
|
554
|
+
({ rows = 5, columns = 4, showHeader = true, className = "", ...props }, ref) => {
|
|
555
|
+
return /* @__PURE__ */ jsxs4("div", { ref, className: cn("w-full", className), ...props, children: [
|
|
556
|
+
showHeader && /* @__PURE__ */ jsx6("div", { className: "flex space-x-2 mb-3", children: Array.from({ length: columns }, (_, index) => /* @__PURE__ */ jsx6(
|
|
557
|
+
SkeletonText,
|
|
558
|
+
{
|
|
559
|
+
width: `${100 / columns}%`,
|
|
560
|
+
height: 20
|
|
561
|
+
},
|
|
562
|
+
index
|
|
563
|
+
)) }),
|
|
564
|
+
/* @__PURE__ */ jsx6("div", { className: "space-y-2", children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ jsx6("div", { className: "flex space-x-2", children: Array.from({ length: columns }, (_2, colIndex) => /* @__PURE__ */ jsx6(
|
|
565
|
+
SkeletonText,
|
|
566
|
+
{
|
|
567
|
+
width: `${100 / columns}%`,
|
|
568
|
+
height: 16
|
|
569
|
+
},
|
|
570
|
+
colIndex
|
|
571
|
+
)) }, rowIndex)) })
|
|
572
|
+
] });
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
|
|
576
|
+
// src/components/Table/Table.tsx
|
|
577
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
578
|
+
var renderHeaderElements = (children) => {
|
|
579
|
+
return Children.map(children, (child) => {
|
|
580
|
+
if (isValidElement(child) && (child.type === TableCaption || child.type === TableHeader)) {
|
|
532
581
|
return child;
|
|
533
|
-
}
|
|
534
|
-
return
|
|
582
|
+
}
|
|
583
|
+
return null;
|
|
584
|
+
});
|
|
585
|
+
};
|
|
586
|
+
var getNoSearchResultContent = (config, defaultTitle, defaultDescription) => {
|
|
587
|
+
if (config.component) {
|
|
588
|
+
return config.component;
|
|
589
|
+
}
|
|
590
|
+
if (config.image) {
|
|
591
|
+
return /* @__PURE__ */ jsx7(
|
|
592
|
+
NoSearchResult_default,
|
|
593
|
+
{
|
|
594
|
+
image: config.image,
|
|
595
|
+
title: config.title || defaultTitle,
|
|
596
|
+
description: config.description || defaultDescription
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
return /* @__PURE__ */ jsxs5("div", { className: "text-center", children: [
|
|
601
|
+
/* @__PURE__ */ jsx7("p", { className: "text-text-600 text-lg font-semibold mb-2", children: config.title || defaultTitle }),
|
|
602
|
+
/* @__PURE__ */ jsx7("p", { className: "text-text-500 text-sm", children: config.description || defaultDescription })
|
|
603
|
+
] });
|
|
604
|
+
};
|
|
605
|
+
var getEmptyStateContent = (config, defaultMessage, defaultButtonText, onButtonClick) => {
|
|
606
|
+
if (config?.component) {
|
|
607
|
+
return config.component;
|
|
608
|
+
}
|
|
609
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center justify-center gap-4", children: [
|
|
610
|
+
config?.image && /* @__PURE__ */ jsx7(
|
|
611
|
+
"img",
|
|
612
|
+
{
|
|
613
|
+
src: config.image,
|
|
614
|
+
alt: "Empty state",
|
|
615
|
+
className: "w-auto h-auto max-w-full"
|
|
616
|
+
}
|
|
617
|
+
),
|
|
618
|
+
/* @__PURE__ */ jsx7("p", { className: "text-text-600 text-base font-normal", children: config?.message || defaultMessage }),
|
|
619
|
+
(config?.onButtonClick || onButtonClick) && /* @__PURE__ */ jsx7(
|
|
620
|
+
Button_default,
|
|
621
|
+
{
|
|
622
|
+
variant: "solid",
|
|
623
|
+
action: "primary",
|
|
624
|
+
size: "medium",
|
|
625
|
+
onClick: config?.onButtonClick || onButtonClick,
|
|
626
|
+
children: config?.buttonText || defaultButtonText
|
|
627
|
+
}
|
|
628
|
+
)
|
|
629
|
+
] });
|
|
630
|
+
};
|
|
631
|
+
var renderTableWrapper = (variant, tableRef, className, children, stateContent, tableProps) => {
|
|
632
|
+
return /* @__PURE__ */ jsxs5(
|
|
633
|
+
"div",
|
|
634
|
+
{
|
|
635
|
+
className: cn(
|
|
636
|
+
"relative w-full overflow-x-auto",
|
|
637
|
+
variant === "default" && "border border-border-200 rounded-xl"
|
|
638
|
+
),
|
|
639
|
+
children: [
|
|
640
|
+
/* @__PURE__ */ jsx7(
|
|
641
|
+
"table",
|
|
642
|
+
{
|
|
643
|
+
ref: tableRef,
|
|
644
|
+
className: cn(
|
|
645
|
+
"analytica-table w-full caption-bottom text-sm border-separate border-spacing-0",
|
|
646
|
+
className
|
|
647
|
+
),
|
|
648
|
+
...tableProps,
|
|
649
|
+
children: renderHeaderElements(children)
|
|
650
|
+
}
|
|
651
|
+
),
|
|
652
|
+
/* @__PURE__ */ jsx7("div", { className: "py-8 flex justify-center", children: stateContent })
|
|
653
|
+
]
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
};
|
|
657
|
+
var Table = forwardRef2(
|
|
658
|
+
({
|
|
659
|
+
variant = "default",
|
|
660
|
+
className,
|
|
661
|
+
children,
|
|
662
|
+
showLoading = false,
|
|
663
|
+
loadingState,
|
|
664
|
+
showNoSearchResult = false,
|
|
665
|
+
noSearchResultState,
|
|
666
|
+
showEmpty = false,
|
|
667
|
+
emptyState,
|
|
668
|
+
...props
|
|
669
|
+
}, ref) => {
|
|
670
|
+
const defaultNoSearchResultState = {
|
|
671
|
+
title: "Nenhum resultado encontrado",
|
|
672
|
+
description: "N\xE3o encontramos nenhum resultado com esse nome. Tente revisar a busca ou usar outra palavra-chave."
|
|
673
|
+
};
|
|
674
|
+
const defaultEmptyState = {
|
|
675
|
+
message: "Nenhum dado dispon\xEDvel no momento.",
|
|
676
|
+
buttonText: "Adicionar item"
|
|
677
|
+
};
|
|
678
|
+
const finalNoSearchResultState = noSearchResultState || defaultNoSearchResultState;
|
|
679
|
+
const finalEmptyState = emptyState || defaultEmptyState;
|
|
680
|
+
if (showLoading) {
|
|
681
|
+
const loadingContent = loadingState?.component || /* @__PURE__ */ jsx7(SkeletonTable, { rows: 5, columns: 4, showHeader: false });
|
|
682
|
+
return renderTableWrapper(
|
|
683
|
+
variant,
|
|
684
|
+
ref,
|
|
685
|
+
className,
|
|
686
|
+
children,
|
|
687
|
+
loadingContent,
|
|
688
|
+
props
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
if (showNoSearchResult) {
|
|
692
|
+
const noSearchContent = getNoSearchResultContent(
|
|
693
|
+
finalNoSearchResultState,
|
|
694
|
+
defaultNoSearchResultState.title || "",
|
|
695
|
+
defaultNoSearchResultState.description || ""
|
|
696
|
+
);
|
|
697
|
+
return renderTableWrapper(
|
|
698
|
+
variant,
|
|
699
|
+
ref,
|
|
700
|
+
className,
|
|
701
|
+
children,
|
|
702
|
+
noSearchContent,
|
|
703
|
+
props
|
|
704
|
+
);
|
|
705
|
+
}
|
|
706
|
+
if (showEmpty) {
|
|
707
|
+
const emptyContent = getEmptyStateContent(
|
|
708
|
+
finalEmptyState,
|
|
709
|
+
defaultEmptyState.message || "Nenhum dado dispon\xEDvel no momento.",
|
|
710
|
+
defaultEmptyState.buttonText || "Adicionar item"
|
|
711
|
+
);
|
|
712
|
+
return renderTableWrapper(
|
|
713
|
+
variant,
|
|
714
|
+
ref,
|
|
715
|
+
className,
|
|
716
|
+
children,
|
|
717
|
+
emptyContent,
|
|
718
|
+
props
|
|
719
|
+
);
|
|
720
|
+
}
|
|
721
|
+
return /* @__PURE__ */ jsx7(
|
|
535
722
|
"div",
|
|
536
723
|
{
|
|
537
724
|
className: cn(
|
|
538
725
|
"relative w-full overflow-x-auto",
|
|
539
726
|
variant === "default" && "border border-border-200 rounded-xl"
|
|
540
727
|
),
|
|
541
|
-
children: /* @__PURE__ */
|
|
728
|
+
children: /* @__PURE__ */ jsxs5(
|
|
542
729
|
"table",
|
|
543
730
|
{
|
|
544
731
|
ref,
|
|
@@ -552,8 +739,8 @@ var Table = forwardRef(
|
|
|
552
739
|
children: [
|
|
553
740
|
!Children.toArray(children).some(
|
|
554
741
|
(child) => isValidElement(child) && child.type === TableCaption
|
|
555
|
-
) && /* @__PURE__ */
|
|
556
|
-
|
|
742
|
+
) && /* @__PURE__ */ jsx7("caption", { className: "sr-only", children: "My Table" }),
|
|
743
|
+
children
|
|
557
744
|
]
|
|
558
745
|
}
|
|
559
746
|
)
|
|
@@ -562,7 +749,7 @@ var Table = forwardRef(
|
|
|
562
749
|
}
|
|
563
750
|
);
|
|
564
751
|
Table.displayName = "Table";
|
|
565
|
-
var TableHeader =
|
|
752
|
+
var TableHeader = forwardRef2(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
566
753
|
"thead",
|
|
567
754
|
{
|
|
568
755
|
ref,
|
|
@@ -571,8 +758,8 @@ var TableHeader = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
571
758
|
}
|
|
572
759
|
));
|
|
573
760
|
TableHeader.displayName = "TableHeader";
|
|
574
|
-
var TableBody =
|
|
575
|
-
({ className, variant = "default", ...props }, ref) => /* @__PURE__ */
|
|
761
|
+
var TableBody = forwardRef2(
|
|
762
|
+
({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
576
763
|
"tbody",
|
|
577
764
|
{
|
|
578
765
|
ref,
|
|
@@ -586,8 +773,8 @@ var TableBody = forwardRef(
|
|
|
586
773
|
)
|
|
587
774
|
);
|
|
588
775
|
TableBody.displayName = "TableBody";
|
|
589
|
-
var TableFooter =
|
|
590
|
-
({ variant = "default", className, ...props }, ref) => /* @__PURE__ */
|
|
776
|
+
var TableFooter = forwardRef2(
|
|
777
|
+
({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
591
778
|
"tfoot",
|
|
592
779
|
{
|
|
593
780
|
ref,
|
|
@@ -623,7 +810,7 @@ var VARIANT_STATES_ROW = {
|
|
|
623
810
|
borderless: "bg-background-50 opacity-50 cursor-not-allowed"
|
|
624
811
|
}
|
|
625
812
|
};
|
|
626
|
-
var TableRow =
|
|
813
|
+
var TableRow = forwardRef2(
|
|
627
814
|
({
|
|
628
815
|
variant = "default",
|
|
629
816
|
state = "default",
|
|
@@ -631,7 +818,7 @@ var TableRow = forwardRef(
|
|
|
631
818
|
className,
|
|
632
819
|
...props
|
|
633
820
|
}, ref) => {
|
|
634
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ jsx7(
|
|
635
822
|
"tr",
|
|
636
823
|
{
|
|
637
824
|
ref,
|
|
@@ -649,7 +836,7 @@ var TableRow = forwardRef(
|
|
|
649
836
|
}
|
|
650
837
|
);
|
|
651
838
|
TableRow.displayName = "TableRow";
|
|
652
|
-
var TableHead =
|
|
839
|
+
var TableHead = forwardRef2(
|
|
653
840
|
({
|
|
654
841
|
className,
|
|
655
842
|
sortable = true,
|
|
@@ -663,7 +850,7 @@ var TableHead = forwardRef(
|
|
|
663
850
|
onSort();
|
|
664
851
|
}
|
|
665
852
|
};
|
|
666
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ jsx7(
|
|
667
854
|
"th",
|
|
668
855
|
{
|
|
669
856
|
ref,
|
|
@@ -674,11 +861,11 @@ var TableHead = forwardRef(
|
|
|
674
861
|
),
|
|
675
862
|
onClick: handleClick,
|
|
676
863
|
...props,
|
|
677
|
-
children: /* @__PURE__ */
|
|
864
|
+
children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
678
865
|
children,
|
|
679
|
-
sortable && /* @__PURE__ */
|
|
680
|
-
sortDirection === "asc" && /* @__PURE__ */
|
|
681
|
-
sortDirection === "desc" && /* @__PURE__ */
|
|
866
|
+
sortable && /* @__PURE__ */ jsxs5("div", { className: "flex flex-col", children: [
|
|
867
|
+
sortDirection === "asc" && /* @__PURE__ */ jsx7(CaretUp, { size: 16, weight: "fill", className: "text-text-800" }),
|
|
868
|
+
sortDirection === "desc" && /* @__PURE__ */ jsx7(CaretDown, { size: 16, weight: "fill", className: "text-text-800" })
|
|
682
869
|
] })
|
|
683
870
|
] })
|
|
684
871
|
}
|
|
@@ -686,7 +873,7 @@ var TableHead = forwardRef(
|
|
|
686
873
|
}
|
|
687
874
|
);
|
|
688
875
|
TableHead.displayName = "TableHead";
|
|
689
|
-
var TableCell =
|
|
876
|
+
var TableCell = forwardRef2(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
690
877
|
"td",
|
|
691
878
|
{
|
|
692
879
|
ref,
|
|
@@ -698,7 +885,7 @@ var TableCell = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx
|
|
|
698
885
|
}
|
|
699
886
|
));
|
|
700
887
|
TableCell.displayName = "TableCell";
|
|
701
|
-
var TableCaption =
|
|
888
|
+
var TableCaption = forwardRef2(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
702
889
|
"caption",
|
|
703
890
|
{
|
|
704
891
|
ref,
|
|
@@ -714,7 +901,7 @@ var Table_default = Table;
|
|
|
714
901
|
|
|
715
902
|
// src/components/Badge/Badge.tsx
|
|
716
903
|
import { Bell } from "phosphor-react";
|
|
717
|
-
import { jsx as
|
|
904
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
718
905
|
var VARIANT_ACTION_CLASSES2 = {
|
|
719
906
|
solid: {
|
|
720
907
|
error: "bg-error-background text-error-700 focus-visible:outline-none",
|
|
@@ -776,14 +963,14 @@ var Badge = ({
|
|
|
776
963
|
const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
|
|
777
964
|
const baseClassesIcon = "flex items-center";
|
|
778
965
|
if (variant === "notification") {
|
|
779
|
-
return /* @__PURE__ */
|
|
966
|
+
return /* @__PURE__ */ jsxs6(
|
|
780
967
|
"div",
|
|
781
968
|
{
|
|
782
969
|
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
783
970
|
...props,
|
|
784
971
|
children: [
|
|
785
|
-
/* @__PURE__ */
|
|
786
|
-
notificationActive && /* @__PURE__ */
|
|
972
|
+
/* @__PURE__ */ jsx8(Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
|
|
973
|
+
notificationActive && /* @__PURE__ */ jsx8(
|
|
787
974
|
"span",
|
|
788
975
|
{
|
|
789
976
|
"data-testid": "notification-dot",
|
|
@@ -794,15 +981,15 @@ var Badge = ({
|
|
|
794
981
|
}
|
|
795
982
|
);
|
|
796
983
|
}
|
|
797
|
-
return /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ jsxs6(
|
|
798
985
|
"div",
|
|
799
986
|
{
|
|
800
987
|
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
801
988
|
...props,
|
|
802
989
|
children: [
|
|
803
|
-
iconLeft && /* @__PURE__ */
|
|
990
|
+
iconLeft && /* @__PURE__ */ jsx8("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
|
|
804
991
|
children,
|
|
805
|
-
iconRight && /* @__PURE__ */
|
|
992
|
+
iconRight && /* @__PURE__ */ jsx8("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
|
|
806
993
|
]
|
|
807
994
|
}
|
|
808
995
|
);
|
|
@@ -811,7 +998,7 @@ var Badge_default = Badge;
|
|
|
811
998
|
|
|
812
999
|
// src/components/AlertManagerView/AlertsManagerView.tsx
|
|
813
1000
|
import { CaretLeft, CaretRight, User } from "phosphor-react";
|
|
814
|
-
import { Fragment, jsx as
|
|
1001
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
815
1002
|
var AlertsManagerView = ({
|
|
816
1003
|
alertData,
|
|
817
1004
|
isOpen = false,
|
|
@@ -840,7 +1027,7 @@ var AlertsManagerView = ({
|
|
|
840
1027
|
year: "numeric"
|
|
841
1028
|
});
|
|
842
1029
|
};
|
|
843
|
-
return /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ jsx9(
|
|
844
1031
|
Modal_default,
|
|
845
1032
|
{
|
|
846
1033
|
isOpen,
|
|
@@ -848,59 +1035,59 @@ var AlertsManagerView = ({
|
|
|
848
1035
|
title: alertData.title,
|
|
849
1036
|
size: "md",
|
|
850
1037
|
contentClassName: "p-0",
|
|
851
|
-
children: /* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
(imageLink || alertData.image || defaultImage) && /* @__PURE__ */
|
|
1038
|
+
children: /* @__PURE__ */ jsx9("div", { className: "flex flex-col h-[calc(100vh-8rem)] max-h-[700px]", children: /* @__PURE__ */ jsxs7("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: [
|
|
1039
|
+
/* @__PURE__ */ jsxs7("div", { className: "bg-background-50 px-5 py-6 flex flex-col items-center gap-4 rounded-xl mb-4", children: [
|
|
1040
|
+
(imageLink || alertData.image || defaultImage) && /* @__PURE__ */ jsx9(
|
|
854
1041
|
"img",
|
|
855
1042
|
{
|
|
856
1043
|
src: imageLink || alertData.image || defaultImage || void 0,
|
|
857
1044
|
alt: alertData.title || "Imagem do alerta"
|
|
858
1045
|
}
|
|
859
1046
|
),
|
|
860
|
-
/* @__PURE__ */
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center text-center gap-3", children: [
|
|
1048
|
+
/* @__PURE__ */ jsx9(Text_default, { size: "lg", weight: "semibold", children: alertData.title || "Sem T\xEDtulo" }),
|
|
1049
|
+
/* @__PURE__ */ jsx9(Text_default, { size: "sm", weight: "normal", className: "text-text-500", children: alertData.message || "Sem mensagem" })
|
|
863
1050
|
] })
|
|
864
1051
|
] }),
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ jsx9(Divider_default, { className: "my-4" }),
|
|
1053
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
1054
|
+
/* @__PURE__ */ jsx9(Text_default, { size: "sm", weight: "bold", className: "text-text-700", children: "Enviado em" }),
|
|
1055
|
+
/* @__PURE__ */ jsx9(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children: formatDate(alertData.sentAt) })
|
|
869
1056
|
] }),
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ jsx9(Divider_default, { className: "my-4" }),
|
|
1058
|
+
/* @__PURE__ */ jsx9("div", { className: "mb-4", children: /* @__PURE__ */ jsxs7(Table_default, { variant: "borderless", className: "table-fixed", children: [
|
|
1059
|
+
/* @__PURE__ */ jsx9(TableHeader, { children: /* @__PURE__ */ jsxs7(TableRow, { variant: "borderless", children: [
|
|
1060
|
+
/* @__PURE__ */ jsx9(TableHead, { className: "py-2 px-3.5 text-start", children: "Destinat\xE1rio" }),
|
|
1061
|
+
/* @__PURE__ */ jsx9(TableHead, { className: "py-2 px-3.5 w-[120px] text-start", children: "Status" })
|
|
875
1062
|
] }) }),
|
|
876
|
-
/* @__PURE__ */
|
|
877
|
-
/* @__PURE__ */
|
|
878
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ jsx9(TableBody, { variant: "borderless", children: paginatedRecipients.map((recipient) => /* @__PURE__ */ jsxs7(TableRow, { children: [
|
|
1064
|
+
/* @__PURE__ */ jsxs7(TableCell, { className: "py-2 px-3.5 flex flex-row gap-2 text-start truncate", children: [
|
|
1065
|
+
/* @__PURE__ */ jsx9("div", { className: "rounded-full size-6 bg-primary-100 flex items-center justify-center", children: /* @__PURE__ */ jsx9(User, { className: "text-primary-950", size: 18 }) }),
|
|
879
1066
|
recipient.name
|
|
880
1067
|
] }),
|
|
881
|
-
/* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ jsx9(TableCell, { className: "py-2 px-3.5 text-center", children: /* @__PURE__ */ jsx9("div", { className: "flex justify-center items-center gap-1", children: recipient.status === "viewed" ? /* @__PURE__ */ jsx9(Badge_default, { variant: "solid", action: "success", children: "Visualizado" }) : /* @__PURE__ */ jsx9(Badge_default, { variant: "solid", action: "error", children: "Pendente" }) }) })
|
|
882
1069
|
] }, recipient.id)) })
|
|
883
1070
|
] }) }),
|
|
884
|
-
totalPages > 1 && /* @__PURE__ */
|
|
885
|
-
/* @__PURE__ */
|
|
1071
|
+
totalPages > 1 && /* @__PURE__ */ jsxs7("div", { className: "flex justify-end items-center gap-2 bg-background-50 border border-border-200 py-3.5 px-2 rounded-b-2xl", children: [
|
|
1072
|
+
/* @__PURE__ */ jsxs7(Text_default, { size: "sm", className: "text-text-600", children: [
|
|
886
1073
|
"P\xE1gina ",
|
|
887
1074
|
effectiveCurrentPage,
|
|
888
1075
|
" de ",
|
|
889
1076
|
totalPages
|
|
890
1077
|
] }),
|
|
891
|
-
/* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
1078
|
+
/* @__PURE__ */ jsx9("div", { className: "flex gap-2", children: onPageChange ? /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1079
|
+
/* @__PURE__ */ jsx9(
|
|
893
1080
|
Button_default,
|
|
894
1081
|
{
|
|
895
1082
|
variant: "link",
|
|
896
1083
|
size: "extra-small",
|
|
897
1084
|
onClick: () => onPageChange(Math.max(1, effectiveCurrentPage - 1)),
|
|
898
1085
|
disabled: effectiveCurrentPage === 1,
|
|
899
|
-
iconLeft: /* @__PURE__ */
|
|
1086
|
+
iconLeft: /* @__PURE__ */ jsx9(CaretLeft, {}),
|
|
900
1087
|
children: "Anterior"
|
|
901
1088
|
}
|
|
902
1089
|
),
|
|
903
|
-
/* @__PURE__ */
|
|
1090
|
+
/* @__PURE__ */ jsx9(
|
|
904
1091
|
Button_default,
|
|
905
1092
|
{
|
|
906
1093
|
variant: "link",
|
|
@@ -909,28 +1096,28 @@ var AlertsManagerView = ({
|
|
|
909
1096
|
Math.min(totalPages, effectiveCurrentPage + 1)
|
|
910
1097
|
),
|
|
911
1098
|
disabled: effectiveCurrentPage === totalPages,
|
|
912
|
-
iconRight: /* @__PURE__ */
|
|
1099
|
+
iconRight: /* @__PURE__ */ jsx9(CaretRight, {}),
|
|
913
1100
|
children: "Pr\xF3ximo"
|
|
914
1101
|
}
|
|
915
1102
|
)
|
|
916
|
-
] }) : /* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
1103
|
+
] }) : /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1104
|
+
/* @__PURE__ */ jsx9(
|
|
918
1105
|
Button_default,
|
|
919
1106
|
{
|
|
920
1107
|
variant: "link",
|
|
921
1108
|
size: "extra-small",
|
|
922
1109
|
disabled: effectiveCurrentPage === 1,
|
|
923
|
-
iconLeft: /* @__PURE__ */
|
|
1110
|
+
iconLeft: /* @__PURE__ */ jsx9(CaretLeft, {}),
|
|
924
1111
|
children: "Anterior"
|
|
925
1112
|
}
|
|
926
1113
|
),
|
|
927
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ jsx9(
|
|
928
1115
|
Button_default,
|
|
929
1116
|
{
|
|
930
1117
|
variant: "link",
|
|
931
1118
|
size: "extra-small",
|
|
932
1119
|
disabled: effectiveCurrentPage === totalPages,
|
|
933
|
-
iconRight: /* @__PURE__ */
|
|
1120
|
+
iconRight: /* @__PURE__ */ jsx9(CaretRight, {}),
|
|
934
1121
|
children: "Pr\xF3ximo"
|
|
935
1122
|
}
|
|
936
1123
|
)
|