@andreagiugni/tailwind-dashboard-ui 0.1.0 → 0.3.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/README.md +24 -16
- package/dist/index.cjs +288 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -36
- package/dist/index.d.ts +75 -36
- package/dist/index.js +288 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { Editor } from './chunk-4OETC46A.js';
|
|
|
7
7
|
import { cn } from './chunk-ZLIYUUA4.js';
|
|
8
8
|
export { cn } from './chunk-ZLIYUUA4.js';
|
|
9
9
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
10
|
-
import React5, { useRef, useEffect, useState,
|
|
10
|
+
import React5, { useRef, useEffect, useState, useCallback, useId, useMemo } from 'react';
|
|
11
11
|
import flatpickr from 'flatpickr';
|
|
12
12
|
import 'flatpickr/dist/flatpickr.css';
|
|
13
13
|
|
|
@@ -546,19 +546,6 @@ var Dropzone = ({
|
|
|
546
546
|
}
|
|
547
547
|
);
|
|
548
548
|
};
|
|
549
|
-
var Table = ({ children, className, ...rest }) => /* @__PURE__ */ jsx("table", { className: cn("min-w-full", className), ...rest, children });
|
|
550
|
-
var TableHeader = ({ children, className, ...rest }) => /* @__PURE__ */ jsx("thead", { className, ...rest, children });
|
|
551
|
-
var TableBody = ({ children, className, ...rest }) => /* @__PURE__ */ jsx("tbody", { className, ...rest, children });
|
|
552
|
-
var TableRow = ({ children, className, ...rest }) => /* @__PURE__ */ jsx("tr", { className, ...rest, children });
|
|
553
|
-
var TableCell = ({
|
|
554
|
-
children,
|
|
555
|
-
isHeader = false,
|
|
556
|
-
className,
|
|
557
|
-
...rest
|
|
558
|
-
}) => {
|
|
559
|
-
const Tag = isHeader ? "th" : "td";
|
|
560
|
-
return /* @__PURE__ */ jsx(Tag, { className, ...rest, children });
|
|
561
|
-
};
|
|
562
549
|
var Pagination = ({
|
|
563
550
|
currentPage,
|
|
564
551
|
totalPages,
|
|
@@ -648,6 +635,18 @@ var Input = ({
|
|
|
648
635
|
hint && /* @__PURE__ */ jsx("p", { className: cn("mt-1.5 text-xs", error ? "text-error-500" : success ? "text-success-500" : "text-gray-500"), children: hint })
|
|
649
636
|
] });
|
|
650
637
|
};
|
|
638
|
+
var TableHeader = ({ children, className, ...rest }) => /* @__PURE__ */ jsx("thead", { className, ...rest, children });
|
|
639
|
+
var TableBody = ({ children, className, ...rest }) => /* @__PURE__ */ jsx("tbody", { className, ...rest, children });
|
|
640
|
+
var TableRow = ({ children, className, ...rest }) => /* @__PURE__ */ jsx("tr", { className, ...rest, children });
|
|
641
|
+
var TableCell = ({
|
|
642
|
+
children,
|
|
643
|
+
isHeader = false,
|
|
644
|
+
className,
|
|
645
|
+
...rest
|
|
646
|
+
}) => {
|
|
647
|
+
const Tag = isHeader ? "th" : "td";
|
|
648
|
+
return /* @__PURE__ */ jsx(Tag, { className, ...rest, children });
|
|
649
|
+
};
|
|
651
650
|
var alignClass = {
|
|
652
651
|
left: "text-left",
|
|
653
652
|
center: "text-center",
|
|
@@ -664,16 +663,15 @@ function SortIcon({
|
|
|
664
663
|
/* @__PURE__ */ jsx("svg", { width: "10", height: "6", viewBox: "0 0 10 6", fill: "currentColor", "aria-hidden": "true", className: active && direction === "desc" ? on : off, children: /* @__PURE__ */ jsx("path", { d: "M5 6 1 1h8z" }) })
|
|
665
664
|
] });
|
|
666
665
|
}
|
|
667
|
-
function
|
|
666
|
+
function DataDrivenTable({
|
|
668
667
|
data,
|
|
669
668
|
columns,
|
|
670
669
|
rowsPerPage = 10,
|
|
671
670
|
rowsPerPageOptions = [5, 10, 25, 50],
|
|
672
671
|
pagination = true,
|
|
673
672
|
showSizeSelector = true,
|
|
674
|
-
searchable = true,
|
|
675
|
-
searchPlaceholder = "Search...",
|
|
676
673
|
searchKeys,
|
|
674
|
+
searchPlaceholder = "Search...",
|
|
677
675
|
defaultSortKey,
|
|
678
676
|
defaultSortDirection = "asc",
|
|
679
677
|
getRowId,
|
|
@@ -686,13 +684,13 @@ function DataTable({
|
|
|
686
684
|
const [sortKey, setSortKey] = useState(defaultSortKey);
|
|
687
685
|
const [sortDir, setSortDir] = useState(defaultSortDirection);
|
|
688
686
|
const [page, setPage] = useState(1);
|
|
687
|
+
const showSearch = !!(searchKeys && searchKeys.length > 0);
|
|
689
688
|
const filtered = useMemo(() => {
|
|
690
|
-
const keys = searchKeys ?? columns.map((c) => c.key);
|
|
691
689
|
const q = search.trim().toLowerCase();
|
|
692
690
|
let rows = data;
|
|
693
|
-
if (
|
|
691
|
+
if (showSearch && q) {
|
|
694
692
|
rows = rows.filter(
|
|
695
|
-
(row) =>
|
|
693
|
+
(row) => searchKeys.some((k) => String(row[k] ?? "").toLowerCase().includes(q))
|
|
696
694
|
);
|
|
697
695
|
}
|
|
698
696
|
if (sortKey) {
|
|
@@ -704,7 +702,7 @@ function DataTable({
|
|
|
704
702
|
});
|
|
705
703
|
}
|
|
706
704
|
return rows;
|
|
707
|
-
}, [data,
|
|
705
|
+
}, [data, search, showSearch, searchKeys, sortKey, sortDir]);
|
|
708
706
|
const total = filtered.length;
|
|
709
707
|
const totalPages = pagination ? Math.max(1, Math.ceil(total / pageSize)) : 1;
|
|
710
708
|
const current = Math.min(page, totalPages);
|
|
@@ -721,7 +719,7 @@ function DataTable({
|
|
|
721
719
|
};
|
|
722
720
|
const sizeOptions = rowsPerPageOptions.length ? rowsPerPageOptions : [];
|
|
723
721
|
const showSelector = pagination && showSizeSelector && sizeOptions.length > 1;
|
|
724
|
-
const showControls =
|
|
722
|
+
const showControls = showSearch || showSelector;
|
|
725
723
|
return /* @__PURE__ */ jsxs(
|
|
726
724
|
"div",
|
|
727
725
|
{
|
|
@@ -748,7 +746,7 @@ function DataTable({
|
|
|
748
746
|
),
|
|
749
747
|
"entries"
|
|
750
748
|
] }) : /* @__PURE__ */ jsx("span", {}),
|
|
751
|
-
|
|
749
|
+
showSearch && /* @__PURE__ */ jsx(
|
|
752
750
|
Input,
|
|
753
751
|
{
|
|
754
752
|
type: "search",
|
|
@@ -763,7 +761,7 @@ function DataTable({
|
|
|
763
761
|
}
|
|
764
762
|
)
|
|
765
763
|
] }),
|
|
766
|
-
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto border-y border-gray-100 dark:border-white/[0.05]", children: /* @__PURE__ */ jsxs(
|
|
764
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto border-y border-gray-100 dark:border-white/[0.05]", children: /* @__PURE__ */ jsxs("table", { className: "min-w-full", children: [
|
|
767
765
|
/* @__PURE__ */ jsx(TableHeader, { className: "border-b border-gray-100 bg-gray-50 dark:border-white/[0.05] dark:bg-white/[0.06]", children: /* @__PURE__ */ jsx(TableRow, { children: columns.map((col) => {
|
|
768
766
|
const isActive = sortKey === col.key;
|
|
769
767
|
return /* @__PURE__ */ jsx(
|
|
@@ -828,6 +826,47 @@ function DataTable({
|
|
|
828
826
|
}
|
|
829
827
|
);
|
|
830
828
|
}
|
|
829
|
+
function Table({
|
|
830
|
+
children,
|
|
831
|
+
data,
|
|
832
|
+
columns,
|
|
833
|
+
rowsPerPage,
|
|
834
|
+
rowsPerPageOptions,
|
|
835
|
+
pagination,
|
|
836
|
+
showSizeSelector,
|
|
837
|
+
searchKeys,
|
|
838
|
+
searchPlaceholder,
|
|
839
|
+
defaultSortKey,
|
|
840
|
+
defaultSortDirection,
|
|
841
|
+
getRowId,
|
|
842
|
+
onRowClick,
|
|
843
|
+
emptyContent,
|
|
844
|
+
className,
|
|
845
|
+
...rest
|
|
846
|
+
}) {
|
|
847
|
+
if (columns && data) {
|
|
848
|
+
return /* @__PURE__ */ jsx(
|
|
849
|
+
DataDrivenTable,
|
|
850
|
+
{
|
|
851
|
+
data,
|
|
852
|
+
columns,
|
|
853
|
+
rowsPerPage,
|
|
854
|
+
rowsPerPageOptions,
|
|
855
|
+
pagination,
|
|
856
|
+
showSizeSelector,
|
|
857
|
+
searchKeys,
|
|
858
|
+
searchPlaceholder,
|
|
859
|
+
defaultSortKey,
|
|
860
|
+
defaultSortDirection,
|
|
861
|
+
getRowId,
|
|
862
|
+
onRowClick,
|
|
863
|
+
emptyContent,
|
|
864
|
+
className
|
|
865
|
+
}
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
return /* @__PURE__ */ jsx("table", { className: cn("min-w-full", className), ...rest, children });
|
|
869
|
+
}
|
|
831
870
|
var ChevronIcon = () => /* @__PURE__ */ jsx(
|
|
832
871
|
"svg",
|
|
833
872
|
{
|
|
@@ -960,6 +999,230 @@ var ThemeToggleButton = ({
|
|
|
960
999
|
}
|
|
961
1000
|
);
|
|
962
1001
|
};
|
|
1002
|
+
var Card = ({
|
|
1003
|
+
title,
|
|
1004
|
+
description,
|
|
1005
|
+
icon,
|
|
1006
|
+
image,
|
|
1007
|
+
imageAlt = "",
|
|
1008
|
+
horizontal = false,
|
|
1009
|
+
footer,
|
|
1010
|
+
children,
|
|
1011
|
+
className,
|
|
1012
|
+
bgColor,
|
|
1013
|
+
textColor,
|
|
1014
|
+
borderColor,
|
|
1015
|
+
style,
|
|
1016
|
+
...rest
|
|
1017
|
+
}) => {
|
|
1018
|
+
const cover = image ? /* @__PURE__ */ jsx(
|
|
1019
|
+
"img",
|
|
1020
|
+
{
|
|
1021
|
+
src: image,
|
|
1022
|
+
alt: imageAlt,
|
|
1023
|
+
className: cn(
|
|
1024
|
+
"object-cover",
|
|
1025
|
+
horizontal ? "h-full w-full sm:w-2/5 sm:max-w-[16rem]" : "h-48 w-full"
|
|
1026
|
+
)
|
|
1027
|
+
}
|
|
1028
|
+
) : null;
|
|
1029
|
+
return /* @__PURE__ */ jsxs(
|
|
1030
|
+
"div",
|
|
1031
|
+
{
|
|
1032
|
+
className: cn(
|
|
1033
|
+
"overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03]",
|
|
1034
|
+
horizontal && image && "flex flex-col sm:flex-row",
|
|
1035
|
+
className
|
|
1036
|
+
),
|
|
1037
|
+
style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
|
|
1038
|
+
...rest,
|
|
1039
|
+
children: [
|
|
1040
|
+
cover,
|
|
1041
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 p-5 sm:p-6", children: [
|
|
1042
|
+
icon && /* @__PURE__ */ jsx("div", { className: "mb-5 flex h-12 w-12 items-center justify-center rounded-xl bg-brand-50 text-brand-500 dark:bg-brand-500/15 dark:text-brand-400", children: icon }),
|
|
1043
|
+
title && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-800 dark:text-white/90", children: title }),
|
|
1044
|
+
description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: description }),
|
|
1045
|
+
children,
|
|
1046
|
+
footer && /* @__PURE__ */ jsx("div", { className: "mt-4", children: footer })
|
|
1047
|
+
] })
|
|
1048
|
+
]
|
|
1049
|
+
}
|
|
1050
|
+
);
|
|
1051
|
+
};
|
|
1052
|
+
var toastIcons = {
|
|
1053
|
+
success: /* @__PURE__ */ jsx(
|
|
1054
|
+
"svg",
|
|
1055
|
+
{
|
|
1056
|
+
className: "fill-current",
|
|
1057
|
+
width: "20",
|
|
1058
|
+
height: "20",
|
|
1059
|
+
viewBox: "0 0 24 24",
|
|
1060
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1061
|
+
children: /* @__PURE__ */ jsx(
|
|
1062
|
+
"path",
|
|
1063
|
+
{
|
|
1064
|
+
fillRule: "evenodd",
|
|
1065
|
+
clipRule: "evenodd",
|
|
1066
|
+
d: "M3.70186 12.0001C3.70186 7.41711 7.41711 3.70186 12.0001 3.70186C16.5831 3.70186 20.2984 7.41711 20.2984 12.0001C20.2984 16.5831 16.5831 20.2984 12.0001 20.2984C7.41711 20.2984 3.70186 16.5831 3.70186 12.0001ZM12.0001 1.90186C6.423 1.90186 1.90186 6.423 1.90186 12.0001C1.90186 17.5772 6.423 22.0984 12.0001 22.0984C17.5772 22.0984 22.0984 17.5772 22.0984 12.0001C22.0984 6.423 17.5772 1.90186 12.0001 1.90186ZM15.6197 10.7395C15.9712 10.388 15.9712 9.81819 15.6197 9.46672C15.2683 9.11525 14.6984 9.11525 14.347 9.46672L11.1894 12.6243L9.6533 11.0883C9.30183 10.7368 8.73198 10.7368 8.38051 11.0883C8.02904 11.4397 8.02904 12.0096 8.38051 12.3611L10.553 14.5335C10.7217 14.7023 10.9507 14.7971 11.1894 14.7971C11.428 14.7971 11.657 14.7023 11.8257 14.5335L15.6197 10.7395Z"
|
|
1067
|
+
}
|
|
1068
|
+
)
|
|
1069
|
+
}
|
|
1070
|
+
),
|
|
1071
|
+
danger: /* @__PURE__ */ jsx(
|
|
1072
|
+
"svg",
|
|
1073
|
+
{
|
|
1074
|
+
className: "fill-current",
|
|
1075
|
+
width: "20",
|
|
1076
|
+
height: "20",
|
|
1077
|
+
viewBox: "0 0 24 24",
|
|
1078
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1079
|
+
children: /* @__PURE__ */ jsx(
|
|
1080
|
+
"path",
|
|
1081
|
+
{
|
|
1082
|
+
fillRule: "evenodd",
|
|
1083
|
+
clipRule: "evenodd",
|
|
1084
|
+
d: "M20.3499 12.0004C20.3499 16.612 16.6115 20.3504 11.9999 20.3504C7.38832 20.3504 3.6499 16.612 3.6499 12.0004C3.6499 7.38881 7.38833 3.65039 11.9999 3.65039C16.6115 3.65039 20.3499 7.38881 20.3499 12.0004ZM11.9999 22.1504C17.6056 22.1504 22.1499 17.6061 22.1499 12.0004C22.1499 6.3947 17.6056 1.85039 11.9999 1.85039C6.39421 1.85039 1.8499 6.3947 1.8499 12.0004C1.8499 17.6061 6.39421 22.1504 11.9999 22.1504ZM13.0008 16.4753C13.0008 15.923 12.5531 15.4753 12.0008 15.4753L11.9998 15.4753C11.4475 15.4753 10.9998 15.923 10.9998 16.4753C10.9998 17.0276 11.4475 17.4753 11.9998 17.4753L12.0008 17.4753C12.5531 17.4753 13.0008 17.0276 13.0008 16.4753ZM11.9998 6.62898C12.414 6.62898 12.7498 6.96476 12.7498 7.37898L12.7498 13.0555C12.7498 13.4697 12.414 13.8055 11.9998 13.8055C11.5856 13.8055 11.2498 13.4697 11.2498 13.0555L11.2498 7.37898C11.2498 6.96476 11.5856 6.62898 11.9998 6.62898Z"
|
|
1085
|
+
}
|
|
1086
|
+
)
|
|
1087
|
+
}
|
|
1088
|
+
),
|
|
1089
|
+
warning: /* @__PURE__ */ jsx(
|
|
1090
|
+
"svg",
|
|
1091
|
+
{
|
|
1092
|
+
className: "fill-current",
|
|
1093
|
+
width: "20",
|
|
1094
|
+
height: "20",
|
|
1095
|
+
viewBox: "0 0 24 24",
|
|
1096
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1097
|
+
children: /* @__PURE__ */ jsx(
|
|
1098
|
+
"path",
|
|
1099
|
+
{
|
|
1100
|
+
fillRule: "evenodd",
|
|
1101
|
+
clipRule: "evenodd",
|
|
1102
|
+
d: "M3.6501 12.0001C3.6501 7.38852 7.38852 3.6501 12.0001 3.6501C16.6117 3.6501 20.3501 7.38852 20.3501 12.0001C20.3501 16.6117 16.6117 20.3501 12.0001 20.3501C7.38852 20.3501 3.6501 16.6117 3.6501 12.0001ZM12.0001 1.8501C6.39441 1.8501 1.8501 6.39441 1.8501 12.0001C1.8501 17.6058 6.39441 22.1501 12.0001 22.1501C17.6058 22.1501 22.1501 17.6058 22.1501 12.0001C22.1501 6.39441 17.6058 1.8501 12.0001 1.8501ZM10.9992 7.52517C10.9992 8.07746 11.4469 8.52517 11.9992 8.52517H12.0002C12.5525 8.52517 13.0002 8.07746 13.0002 7.52517C13.0002 6.97289 12.5525 6.52517 12.0002 6.52517H11.9992C11.4469 6.52517 10.9992 6.97289 10.9992 7.52517ZM12.0002 17.3715C11.586 17.3715 11.2502 17.0357 11.2502 16.6215V10.945C11.2502 10.5308 11.586 10.195 12.0002 10.195C12.4144 10.195 12.7502 10.5308 12.7502 10.945V16.6215C12.7502 17.0357 12.4144 17.3715 12.0002 17.3715Z"
|
|
1103
|
+
}
|
|
1104
|
+
)
|
|
1105
|
+
}
|
|
1106
|
+
),
|
|
1107
|
+
info: /* @__PURE__ */ jsx(
|
|
1108
|
+
"svg",
|
|
1109
|
+
{
|
|
1110
|
+
className: "fill-current",
|
|
1111
|
+
width: "20",
|
|
1112
|
+
height: "20",
|
|
1113
|
+
viewBox: "0 0 24 24",
|
|
1114
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1115
|
+
children: /* @__PURE__ */ jsx(
|
|
1116
|
+
"path",
|
|
1117
|
+
{
|
|
1118
|
+
fillRule: "evenodd",
|
|
1119
|
+
clipRule: "evenodd",
|
|
1120
|
+
d: "M3.6501 11.9996C3.6501 7.38803 7.38852 3.64961 12.0001 3.64961C16.6117 3.64961 20.3501 7.38803 20.3501 11.9996C20.3501 16.6112 16.6117 20.3496 12.0001 20.3496C7.38852 20.3496 3.6501 16.6112 3.6501 11.9996ZM12.0001 1.84961C6.39441 1.84961 1.8501 6.39392 1.8501 11.9996C1.8501 17.6053 6.39441 22.1496 12.0001 22.1496C17.6058 22.1496 22.1501 17.6053 22.1501 11.9996C22.1501 6.39392 17.6058 1.84961 12.0001 1.84961ZM10.9992 7.52468C10.9992 8.07697 11.4469 8.52468 11.9992 8.52468H12.0002C12.5525 8.52468 13.0002 8.07697 13.0002 7.52468C13.0002 6.9724 12.5525 6.52468 12.0002 6.52468H11.9992C11.4469 6.52468 10.9992 6.9724 10.9992 7.52468ZM12.0002 17.371C11.586 17.371 11.2502 17.0352 11.2502 16.621V10.9445C11.2502 10.5303 11.586 10.1945 12.0002 10.1945C12.4144 10.1945 12.7502 10.5303 12.7502 10.9445V16.621C12.7502 17.0352 12.4144 17.371 12.0002 17.371Z"
|
|
1121
|
+
}
|
|
1122
|
+
)
|
|
1123
|
+
}
|
|
1124
|
+
)
|
|
1125
|
+
};
|
|
1126
|
+
var ToastCloseIcon = /* @__PURE__ */ jsx(
|
|
1127
|
+
"svg",
|
|
1128
|
+
{
|
|
1129
|
+
width: "18",
|
|
1130
|
+
height: "18",
|
|
1131
|
+
viewBox: "0 0 24 24",
|
|
1132
|
+
fill: "none",
|
|
1133
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1134
|
+
children: /* @__PURE__ */ jsx(
|
|
1135
|
+
"path",
|
|
1136
|
+
{
|
|
1137
|
+
fillRule: "evenodd",
|
|
1138
|
+
clipRule: "evenodd",
|
|
1139
|
+
d: "M6.04 16.54a.9.9 0 0 0 1.27 1.27L12 13.14l4.69 4.67a.9.9 0 1 0 1.27-1.27L13.27 11.87l4.69-4.68a.9.9 0 1 0-1.27-1.27L12 10.6 7.31 5.92a.9.9 0 0 0-1.27 1.27l4.69 4.68-4.69 4.67Z",
|
|
1140
|
+
fill: "currentColor"
|
|
1141
|
+
}
|
|
1142
|
+
)
|
|
1143
|
+
}
|
|
1144
|
+
);
|
|
1145
|
+
var variantStyles = {
|
|
1146
|
+
success: {
|
|
1147
|
+
iconWrap: "bg-success-50 text-success-600 dark:bg-success-500/15 dark:text-success-500",
|
|
1148
|
+
bar: "bg-success-500"
|
|
1149
|
+
},
|
|
1150
|
+
danger: {
|
|
1151
|
+
iconWrap: "bg-error-50 text-error-600 dark:bg-error-500/15 dark:text-error-500",
|
|
1152
|
+
bar: "bg-error-500"
|
|
1153
|
+
},
|
|
1154
|
+
warning: {
|
|
1155
|
+
iconWrap: "bg-warning-50 text-warning-600 dark:bg-warning-500/15 dark:text-orange-400",
|
|
1156
|
+
bar: "bg-warning-500"
|
|
1157
|
+
},
|
|
1158
|
+
info: {
|
|
1159
|
+
iconWrap: "bg-blue-light-50 text-blue-light-500 dark:bg-blue-light-500/15 dark:text-blue-light-500",
|
|
1160
|
+
bar: "bg-blue-light-500"
|
|
1161
|
+
}
|
|
1162
|
+
};
|
|
1163
|
+
var Toast = ({
|
|
1164
|
+
variant = "success",
|
|
1165
|
+
title,
|
|
1166
|
+
message,
|
|
1167
|
+
icon,
|
|
1168
|
+
hideIcon = false,
|
|
1169
|
+
showCloseButton = true,
|
|
1170
|
+
onClose,
|
|
1171
|
+
hideAccentBar = false,
|
|
1172
|
+
className,
|
|
1173
|
+
bgColor,
|
|
1174
|
+
textColor,
|
|
1175
|
+
borderColor,
|
|
1176
|
+
style,
|
|
1177
|
+
...rest
|
|
1178
|
+
}) => {
|
|
1179
|
+
const styles = variantStyles[variant];
|
|
1180
|
+
return /* @__PURE__ */ jsxs(
|
|
1181
|
+
"div",
|
|
1182
|
+
{
|
|
1183
|
+
role: "alert",
|
|
1184
|
+
className: cn(
|
|
1185
|
+
"relative flex items-center gap-3 overflow-hidden rounded-xl border border-gray-200 bg-white px-4 py-3.5 pr-10 shadow-theme-sm dark:border-gray-800 dark:bg-white/[0.03]",
|
|
1186
|
+
className
|
|
1187
|
+
),
|
|
1188
|
+
style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
|
|
1189
|
+
...rest,
|
|
1190
|
+
children: [
|
|
1191
|
+
!hideIcon && /* @__PURE__ */ jsx(
|
|
1192
|
+
"span",
|
|
1193
|
+
{
|
|
1194
|
+
className: cn(
|
|
1195
|
+
"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",
|
|
1196
|
+
styles.iconWrap
|
|
1197
|
+
),
|
|
1198
|
+
children: icon ?? toastIcons[variant]
|
|
1199
|
+
}
|
|
1200
|
+
),
|
|
1201
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1202
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-gray-800 dark:text-white/90", children: title }),
|
|
1203
|
+
message && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-sm text-gray-500 dark:text-gray-400", children: message })
|
|
1204
|
+
] }),
|
|
1205
|
+
showCloseButton && /* @__PURE__ */ jsx(
|
|
1206
|
+
"button",
|
|
1207
|
+
{
|
|
1208
|
+
type: "button",
|
|
1209
|
+
"aria-label": "Close",
|
|
1210
|
+
onClick: onClose,
|
|
1211
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 transition hover:text-gray-700 dark:hover:text-gray-200",
|
|
1212
|
+
children: ToastCloseIcon
|
|
1213
|
+
}
|
|
1214
|
+
),
|
|
1215
|
+
!hideAccentBar && /* @__PURE__ */ jsx(
|
|
1216
|
+
"span",
|
|
1217
|
+
{
|
|
1218
|
+
className: cn("absolute inset-x-0 bottom-0 h-1", styles.bar),
|
|
1219
|
+
"aria-hidden": "true"
|
|
1220
|
+
}
|
|
1221
|
+
)
|
|
1222
|
+
]
|
|
1223
|
+
}
|
|
1224
|
+
);
|
|
1225
|
+
};
|
|
963
1226
|
var AccordionContext = React5.createContext(null);
|
|
964
1227
|
var ChevronIcon2 = ({ open }) => /* @__PURE__ */ jsx(
|
|
965
1228
|
"svg",
|
|
@@ -2811,6 +3074,6 @@ var Slider = ({
|
|
|
2811
3074
|
] });
|
|
2812
3075
|
};
|
|
2813
3076
|
|
|
2814
|
-
export { Accordion, AccordionItem, Alert, Avatar, AvatarText, Badge, Breadcrumb, Button, Checkbox, Chip, Code,
|
|
3077
|
+
export { Accordion, AccordionItem, Alert, Avatar, AvatarText, Badge, Breadcrumb, Button, Card, Checkbox, Chip, Code, DatePicker, DateTimePicker, Drawer, Dropdown, DropdownItem, Dropzone, FileInput, Form, Input, Label, MultiSelect, Pagination, PasswordInput, Popover, Progress, Radio, RadioSm, Ribbon, Select, Skeleton, Slider, Snippet, Spinner, Switch, Tab, Table, TableBody, TableCell, TableHeader, TableRow, Tabs, TextArea, ThemeToggleButton, Toast, Tooltip, styleOverride };
|
|
2815
3078
|
//# sourceMappingURL=index.js.map
|
|
2816
3079
|
//# sourceMappingURL=index.js.map
|