@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/README.md
CHANGED
|
@@ -152,11 +152,12 @@ Legend: **(+native)** = also extends the element's native HTML attributes.
|
|
|
152
152
|
| `Dropdown` | `isOpen`, `onClose`, `children`, (+native div) |
|
|
153
153
|
| `DropdownItem` | `variant` (default/primary/outline, like Button), `bgColor`/`textColor`/`borderColor` overrides, `tag` (a/button), `href`, `onClick`, `onItemClick`, `baseClassName` (full override) |
|
|
154
154
|
| `Modal` | `isOpen`, `onClose`, `showCloseButton`, `isFullscreen`, `closeOnBackdrop?`, `closeOnEsc?`; **alert preset** → `variant` (`success`/`info`/`warning`/`danger`) + `title`, `description`, `actionText?`, `onAction?`; (+native div) |
|
|
155
|
-
| `Table`
|
|
155
|
+
| `Table` (composable) | `TableHeader` / `TableBody` / `TableRow` / `TableCell` with `children`, `isHeader` (cell), (+native table elements; `onClick` / `onDoubleClick` on rows & cells) |
|
|
156
|
+
| `Table` (data-driven) | pass `data` + `columns` (`key`, `header`, `sortable?`, `align?`, `render?`, `className?`) to get search + per-column sort + pagination: `rowsPerPage?` (max rows/page, default 10), `rowsPerPageOptions?`, `searchKeys?` (**search box shown only when provided**), `searchPlaceholder?`, `defaultSortKey?` / `defaultSortDirection?`, `pagination?`, `showSizeSelector?`, `onRowClick?`, `getRowId?`, `emptyContent?` |
|
|
156
157
|
| `Pagination` | `currentPage`, `totalPages`, `onPageChange` |
|
|
157
|
-
| `DataTable` | `data`, `columns` (`key`, `header`, `sortable?`, `align?`, `render?`), `rowsPerPage?`, `rowsPerPageOptions?`, `searchable?`, `searchKeys?`, `defaultSortKey?` / `defaultSortDirection?`, `pagination?`, `showSizeSelector?`, `onRowClick?`, `getRowId?`, `emptyContent?` — generic, search + per-column sort + pagination built in |
|
|
158
158
|
| `Breadcrumb` | `pageTitle`, `items?`, (+native) |
|
|
159
159
|
| `ThemeToggleButton` | `theme?` (controlled), `onToggle?`, (+native button) |
|
|
160
|
+
| `Card` | `title?`, `description?`, `icon?`, `image?`, `imageAlt?`, `horizontal?`, `footer?`, `children?`, (+native div) (+override) |
|
|
160
161
|
| `Accordion` / `AccordionItem` | `selectionMode` (single/multiple), `expandedKeys` / `defaultExpandedKeys`, `onExpandedChange`; item: `itemKey`, `title`, `startContent?`, `disabled` |
|
|
161
162
|
| `Tabs` / `Tab` | `variant` (underline/solid/pill), `selectedKey` / `defaultSelectedKey`, `onSelectionChange`, `color?`; tab: `tabKey`, `title`, `disabled` |
|
|
162
163
|
| `Chip` | `color`, `variant` (light/solid), `size`, `startIcon`, `endIcon`, `avatar?`, `onClose?`, (+native span) (+override) |
|
|
@@ -165,6 +166,7 @@ Legend: **(+native)** = also extends the element's native HTML attributes.
|
|
|
165
166
|
| `Progress` | `value`, `maxValue?`, `color`, `size` (sm/md/lg), `label?`, `showValueLabel?`, `isIndeterminate?` |
|
|
166
167
|
| `Spinner` | `size` (sm/md/lg), `color`, `label?` |
|
|
167
168
|
| `Skeleton` | `isLoaded`, `width?`, `height?`, `className`, `children?` |
|
|
169
|
+
| `Toast` | `variant` (success/danger/warning/info), `title`, `message?`, `icon?`, `hideIcon?`, `showCloseButton?`, `onClose?`, `hideAccentBar?`, (+native div) (+override) |
|
|
168
170
|
|
|
169
171
|
### Overlays
|
|
170
172
|
|
|
@@ -230,14 +232,18 @@ const Editor = dynamic(
|
|
|
230
232
|
/>
|
|
231
233
|
```
|
|
232
234
|
|
|
233
|
-
##
|
|
235
|
+
## Table
|
|
234
236
|
|
|
235
|
-
`
|
|
236
|
-
|
|
237
|
-
|
|
237
|
+
`Table` has **two modes**, both under the same component:
|
|
238
|
+
|
|
239
|
+
1. **Composable** — use `Table` / `TableHeader` / `TableBody` / `TableRow` / `TableCell` as thin,
|
|
240
|
+
styled wrappers around the native table elements when you want full control over the markup.
|
|
241
|
+
2. **Data-driven** — pass a `data` array and a `columns` definition and you get live search,
|
|
242
|
+
per-column click-to-sort, a "Show N entries" selector and pagination out of the box. The mode
|
|
243
|
+
switches on automatically as soon as `columns` is provided.
|
|
238
244
|
|
|
239
245
|
```tsx
|
|
240
|
-
import {
|
|
246
|
+
import { Table, type TableColumn } from '@andreagiugni/tailwind-dashboard-ui';
|
|
241
247
|
|
|
242
248
|
type Person = { name: string; office: string; salary: number };
|
|
243
249
|
|
|
@@ -247,7 +253,7 @@ const people: Person[] = [
|
|
|
247
253
|
// …
|
|
248
254
|
];
|
|
249
255
|
|
|
250
|
-
const columns:
|
|
256
|
+
const columns: TableColumn<Person>[] = [
|
|
251
257
|
{ key: 'name', header: 'User', sortable: true },
|
|
252
258
|
{ key: 'office', header: 'Office', sortable: true },
|
|
253
259
|
{
|
|
@@ -259,23 +265,25 @@ const columns: DataTableColumn<Person>[] = [
|
|
|
259
265
|
},
|
|
260
266
|
];
|
|
261
267
|
|
|
262
|
-
<
|
|
268
|
+
<Table
|
|
263
269
|
data={people}
|
|
264
270
|
columns={columns}
|
|
265
|
-
rowsPerPage={5}
|
|
271
|
+
rowsPerPage={5} // max rows per page (default 10)
|
|
266
272
|
rowsPerPageOptions={[5, 10, 25]}
|
|
267
273
|
defaultSortKey="name"
|
|
268
|
-
searchKeys={['name', 'office']}
|
|
274
|
+
searchKeys={['name', 'office']} // omit to hide the search box
|
|
269
275
|
onRowClick={(row) => console.log(row)}
|
|
270
276
|
/>
|
|
271
277
|
```
|
|
272
278
|
|
|
273
|
-
Key props: `data`, `columns` (each: `key`, `header`, `sortable?`, `align?`, `render?`,
|
|
279
|
+
Key data-driven props: `data`, `columns` (each: `key`, `header`, `sortable?`, `align?`, `render?`,
|
|
274
280
|
`className?`), `rowsPerPage` (default 10), `rowsPerPageOptions` (default `[5,10,25,50]`),
|
|
275
|
-
`
|
|
276
|
-
`
|
|
277
|
-
|
|
278
|
-
|
|
281
|
+
`searchKeys` / `searchPlaceholder`, `defaultSortKey` / `defaultSortDirection`, `pagination`,
|
|
282
|
+
`showSizeSelector`, `onRowClick`, `getRowId`, `emptyContent`.
|
|
283
|
+
|
|
284
|
+
> **Search visibility:** the search input renders **only** when you pass a non-empty `searchKeys`
|
|
285
|
+
> array — those are also the exact fields the query matches. Omit `searchKeys` (or pass `[]`) to
|
|
286
|
+
> hide search entirely.
|
|
279
287
|
|
|
280
288
|
## License
|
|
281
289
|
|
package/dist/index.cjs
CHANGED
|
@@ -552,19 +552,6 @@ var Dropzone = ({
|
|
|
552
552
|
}
|
|
553
553
|
);
|
|
554
554
|
};
|
|
555
|
-
var Table = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("table", { className: chunkYERNSNT4_cjs.cn("min-w-full", className), ...rest, children });
|
|
556
|
-
var TableHeader = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("thead", { className, ...rest, children });
|
|
557
|
-
var TableBody = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { className, ...rest, children });
|
|
558
|
-
var TableRow = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("tr", { className, ...rest, children });
|
|
559
|
-
var TableCell = ({
|
|
560
|
-
children,
|
|
561
|
-
isHeader = false,
|
|
562
|
-
className,
|
|
563
|
-
...rest
|
|
564
|
-
}) => {
|
|
565
|
-
const Tag = isHeader ? "th" : "td";
|
|
566
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag, { className, ...rest, children });
|
|
567
|
-
};
|
|
568
555
|
var Pagination = ({
|
|
569
556
|
currentPage,
|
|
570
557
|
totalPages,
|
|
@@ -654,6 +641,18 @@ var Input = ({
|
|
|
654
641
|
hint && /* @__PURE__ */ jsxRuntime.jsx("p", { className: chunkYERNSNT4_cjs.cn("mt-1.5 text-xs", error ? "text-error-500" : success ? "text-success-500" : "text-gray-500"), children: hint })
|
|
655
642
|
] });
|
|
656
643
|
};
|
|
644
|
+
var TableHeader = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("thead", { className, ...rest, children });
|
|
645
|
+
var TableBody = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { className, ...rest, children });
|
|
646
|
+
var TableRow = ({ children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("tr", { className, ...rest, children });
|
|
647
|
+
var TableCell = ({
|
|
648
|
+
children,
|
|
649
|
+
isHeader = false,
|
|
650
|
+
className,
|
|
651
|
+
...rest
|
|
652
|
+
}) => {
|
|
653
|
+
const Tag = isHeader ? "th" : "td";
|
|
654
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag, { className, ...rest, children });
|
|
655
|
+
};
|
|
657
656
|
var alignClass = {
|
|
658
657
|
left: "text-left",
|
|
659
658
|
center: "text-center",
|
|
@@ -670,16 +669,15 @@ function SortIcon({
|
|
|
670
669
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "10", height: "6", viewBox: "0 0 10 6", fill: "currentColor", "aria-hidden": "true", className: active && direction === "desc" ? on : off, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 6 1 1h8z" }) })
|
|
671
670
|
] });
|
|
672
671
|
}
|
|
673
|
-
function
|
|
672
|
+
function DataDrivenTable({
|
|
674
673
|
data,
|
|
675
674
|
columns,
|
|
676
675
|
rowsPerPage = 10,
|
|
677
676
|
rowsPerPageOptions = [5, 10, 25, 50],
|
|
678
677
|
pagination = true,
|
|
679
678
|
showSizeSelector = true,
|
|
680
|
-
searchable = true,
|
|
681
|
-
searchPlaceholder = "Search...",
|
|
682
679
|
searchKeys,
|
|
680
|
+
searchPlaceholder = "Search...",
|
|
683
681
|
defaultSortKey,
|
|
684
682
|
defaultSortDirection = "asc",
|
|
685
683
|
getRowId,
|
|
@@ -692,13 +690,13 @@ function DataTable({
|
|
|
692
690
|
const [sortKey, setSortKey] = React5.useState(defaultSortKey);
|
|
693
691
|
const [sortDir, setSortDir] = React5.useState(defaultSortDirection);
|
|
694
692
|
const [page, setPage] = React5.useState(1);
|
|
693
|
+
const showSearch = !!(searchKeys && searchKeys.length > 0);
|
|
695
694
|
const filtered = React5.useMemo(() => {
|
|
696
|
-
const keys = searchKeys ?? columns.map((c) => c.key);
|
|
697
695
|
const q = search.trim().toLowerCase();
|
|
698
696
|
let rows = data;
|
|
699
|
-
if (
|
|
697
|
+
if (showSearch && q) {
|
|
700
698
|
rows = rows.filter(
|
|
701
|
-
(row) =>
|
|
699
|
+
(row) => searchKeys.some((k) => String(row[k] ?? "").toLowerCase().includes(q))
|
|
702
700
|
);
|
|
703
701
|
}
|
|
704
702
|
if (sortKey) {
|
|
@@ -710,7 +708,7 @@ function DataTable({
|
|
|
710
708
|
});
|
|
711
709
|
}
|
|
712
710
|
return rows;
|
|
713
|
-
}, [data,
|
|
711
|
+
}, [data, search, showSearch, searchKeys, sortKey, sortDir]);
|
|
714
712
|
const total = filtered.length;
|
|
715
713
|
const totalPages = pagination ? Math.max(1, Math.ceil(total / pageSize)) : 1;
|
|
716
714
|
const current = Math.min(page, totalPages);
|
|
@@ -727,7 +725,7 @@ function DataTable({
|
|
|
727
725
|
};
|
|
728
726
|
const sizeOptions = rowsPerPageOptions.length ? rowsPerPageOptions : [];
|
|
729
727
|
const showSelector = pagination && showSizeSelector && sizeOptions.length > 1;
|
|
730
|
-
const showControls =
|
|
728
|
+
const showControls = showSearch || showSelector;
|
|
731
729
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
732
730
|
"div",
|
|
733
731
|
{
|
|
@@ -754,7 +752,7 @@ function DataTable({
|
|
|
754
752
|
),
|
|
755
753
|
"entries"
|
|
756
754
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
757
|
-
|
|
755
|
+
showSearch && /* @__PURE__ */ jsxRuntime.jsx(
|
|
758
756
|
Input,
|
|
759
757
|
{
|
|
760
758
|
type: "search",
|
|
@@ -769,7 +767,7 @@ function DataTable({
|
|
|
769
767
|
}
|
|
770
768
|
)
|
|
771
769
|
] }),
|
|
772
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto border-y border-gray-100 dark:border-white/[0.05]", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
770
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto border-y border-gray-100 dark:border-white/[0.05]", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "min-w-full", children: [
|
|
773
771
|
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: "border-b border-gray-100 bg-gray-50 dark:border-white/[0.05] dark:bg-white/[0.06]", children: /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: columns.map((col) => {
|
|
774
772
|
const isActive = sortKey === col.key;
|
|
775
773
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -834,6 +832,47 @@ function DataTable({
|
|
|
834
832
|
}
|
|
835
833
|
);
|
|
836
834
|
}
|
|
835
|
+
function Table({
|
|
836
|
+
children,
|
|
837
|
+
data,
|
|
838
|
+
columns,
|
|
839
|
+
rowsPerPage,
|
|
840
|
+
rowsPerPageOptions,
|
|
841
|
+
pagination,
|
|
842
|
+
showSizeSelector,
|
|
843
|
+
searchKeys,
|
|
844
|
+
searchPlaceholder,
|
|
845
|
+
defaultSortKey,
|
|
846
|
+
defaultSortDirection,
|
|
847
|
+
getRowId,
|
|
848
|
+
onRowClick,
|
|
849
|
+
emptyContent,
|
|
850
|
+
className,
|
|
851
|
+
...rest
|
|
852
|
+
}) {
|
|
853
|
+
if (columns && data) {
|
|
854
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
855
|
+
DataDrivenTable,
|
|
856
|
+
{
|
|
857
|
+
data,
|
|
858
|
+
columns,
|
|
859
|
+
rowsPerPage,
|
|
860
|
+
rowsPerPageOptions,
|
|
861
|
+
pagination,
|
|
862
|
+
showSizeSelector,
|
|
863
|
+
searchKeys,
|
|
864
|
+
searchPlaceholder,
|
|
865
|
+
defaultSortKey,
|
|
866
|
+
defaultSortDirection,
|
|
867
|
+
getRowId,
|
|
868
|
+
onRowClick,
|
|
869
|
+
emptyContent,
|
|
870
|
+
className
|
|
871
|
+
}
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
return /* @__PURE__ */ jsxRuntime.jsx("table", { className: chunkYERNSNT4_cjs.cn("min-w-full", className), ...rest, children });
|
|
875
|
+
}
|
|
837
876
|
var ChevronIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
838
877
|
"svg",
|
|
839
878
|
{
|
|
@@ -966,6 +1005,230 @@ var ThemeToggleButton = ({
|
|
|
966
1005
|
}
|
|
967
1006
|
);
|
|
968
1007
|
};
|
|
1008
|
+
var Card = ({
|
|
1009
|
+
title,
|
|
1010
|
+
description,
|
|
1011
|
+
icon,
|
|
1012
|
+
image,
|
|
1013
|
+
imageAlt = "",
|
|
1014
|
+
horizontal = false,
|
|
1015
|
+
footer,
|
|
1016
|
+
children,
|
|
1017
|
+
className,
|
|
1018
|
+
bgColor,
|
|
1019
|
+
textColor,
|
|
1020
|
+
borderColor,
|
|
1021
|
+
style,
|
|
1022
|
+
...rest
|
|
1023
|
+
}) => {
|
|
1024
|
+
const cover = image ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1025
|
+
"img",
|
|
1026
|
+
{
|
|
1027
|
+
src: image,
|
|
1028
|
+
alt: imageAlt,
|
|
1029
|
+
className: chunkYERNSNT4_cjs.cn(
|
|
1030
|
+
"object-cover",
|
|
1031
|
+
horizontal ? "h-full w-full sm:w-2/5 sm:max-w-[16rem]" : "h-48 w-full"
|
|
1032
|
+
)
|
|
1033
|
+
}
|
|
1034
|
+
) : null;
|
|
1035
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1036
|
+
"div",
|
|
1037
|
+
{
|
|
1038
|
+
className: chunkYERNSNT4_cjs.cn(
|
|
1039
|
+
"overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03]",
|
|
1040
|
+
horizontal && image && "flex flex-col sm:flex-row",
|
|
1041
|
+
className
|
|
1042
|
+
),
|
|
1043
|
+
style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
|
|
1044
|
+
...rest,
|
|
1045
|
+
children: [
|
|
1046
|
+
cover,
|
|
1047
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 p-5 sm:p-6", children: [
|
|
1048
|
+
icon && /* @__PURE__ */ jsxRuntime.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 }),
|
|
1049
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-gray-800 dark:text-white/90", children: title }),
|
|
1050
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: description }),
|
|
1051
|
+
children,
|
|
1052
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: footer })
|
|
1053
|
+
] })
|
|
1054
|
+
]
|
|
1055
|
+
}
|
|
1056
|
+
);
|
|
1057
|
+
};
|
|
1058
|
+
var toastIcons = {
|
|
1059
|
+
success: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1060
|
+
"svg",
|
|
1061
|
+
{
|
|
1062
|
+
className: "fill-current",
|
|
1063
|
+
width: "20",
|
|
1064
|
+
height: "20",
|
|
1065
|
+
viewBox: "0 0 24 24",
|
|
1066
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1067
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1068
|
+
"path",
|
|
1069
|
+
{
|
|
1070
|
+
fillRule: "evenodd",
|
|
1071
|
+
clipRule: "evenodd",
|
|
1072
|
+
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"
|
|
1073
|
+
}
|
|
1074
|
+
)
|
|
1075
|
+
}
|
|
1076
|
+
),
|
|
1077
|
+
danger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1078
|
+
"svg",
|
|
1079
|
+
{
|
|
1080
|
+
className: "fill-current",
|
|
1081
|
+
width: "20",
|
|
1082
|
+
height: "20",
|
|
1083
|
+
viewBox: "0 0 24 24",
|
|
1084
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1085
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1086
|
+
"path",
|
|
1087
|
+
{
|
|
1088
|
+
fillRule: "evenodd",
|
|
1089
|
+
clipRule: "evenodd",
|
|
1090
|
+
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"
|
|
1091
|
+
}
|
|
1092
|
+
)
|
|
1093
|
+
}
|
|
1094
|
+
),
|
|
1095
|
+
warning: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1096
|
+
"svg",
|
|
1097
|
+
{
|
|
1098
|
+
className: "fill-current",
|
|
1099
|
+
width: "20",
|
|
1100
|
+
height: "20",
|
|
1101
|
+
viewBox: "0 0 24 24",
|
|
1102
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1103
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1104
|
+
"path",
|
|
1105
|
+
{
|
|
1106
|
+
fillRule: "evenodd",
|
|
1107
|
+
clipRule: "evenodd",
|
|
1108
|
+
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"
|
|
1109
|
+
}
|
|
1110
|
+
)
|
|
1111
|
+
}
|
|
1112
|
+
),
|
|
1113
|
+
info: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1114
|
+
"svg",
|
|
1115
|
+
{
|
|
1116
|
+
className: "fill-current",
|
|
1117
|
+
width: "20",
|
|
1118
|
+
height: "20",
|
|
1119
|
+
viewBox: "0 0 24 24",
|
|
1120
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1121
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1122
|
+
"path",
|
|
1123
|
+
{
|
|
1124
|
+
fillRule: "evenodd",
|
|
1125
|
+
clipRule: "evenodd",
|
|
1126
|
+
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"
|
|
1127
|
+
}
|
|
1128
|
+
)
|
|
1129
|
+
}
|
|
1130
|
+
)
|
|
1131
|
+
};
|
|
1132
|
+
var ToastCloseIcon = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1133
|
+
"svg",
|
|
1134
|
+
{
|
|
1135
|
+
width: "18",
|
|
1136
|
+
height: "18",
|
|
1137
|
+
viewBox: "0 0 24 24",
|
|
1138
|
+
fill: "none",
|
|
1139
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1140
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1141
|
+
"path",
|
|
1142
|
+
{
|
|
1143
|
+
fillRule: "evenodd",
|
|
1144
|
+
clipRule: "evenodd",
|
|
1145
|
+
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",
|
|
1146
|
+
fill: "currentColor"
|
|
1147
|
+
}
|
|
1148
|
+
)
|
|
1149
|
+
}
|
|
1150
|
+
);
|
|
1151
|
+
var variantStyles = {
|
|
1152
|
+
success: {
|
|
1153
|
+
iconWrap: "bg-success-50 text-success-600 dark:bg-success-500/15 dark:text-success-500",
|
|
1154
|
+
bar: "bg-success-500"
|
|
1155
|
+
},
|
|
1156
|
+
danger: {
|
|
1157
|
+
iconWrap: "bg-error-50 text-error-600 dark:bg-error-500/15 dark:text-error-500",
|
|
1158
|
+
bar: "bg-error-500"
|
|
1159
|
+
},
|
|
1160
|
+
warning: {
|
|
1161
|
+
iconWrap: "bg-warning-50 text-warning-600 dark:bg-warning-500/15 dark:text-orange-400",
|
|
1162
|
+
bar: "bg-warning-500"
|
|
1163
|
+
},
|
|
1164
|
+
info: {
|
|
1165
|
+
iconWrap: "bg-blue-light-50 text-blue-light-500 dark:bg-blue-light-500/15 dark:text-blue-light-500",
|
|
1166
|
+
bar: "bg-blue-light-500"
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
var Toast = ({
|
|
1170
|
+
variant = "success",
|
|
1171
|
+
title,
|
|
1172
|
+
message,
|
|
1173
|
+
icon,
|
|
1174
|
+
hideIcon = false,
|
|
1175
|
+
showCloseButton = true,
|
|
1176
|
+
onClose,
|
|
1177
|
+
hideAccentBar = false,
|
|
1178
|
+
className,
|
|
1179
|
+
bgColor,
|
|
1180
|
+
textColor,
|
|
1181
|
+
borderColor,
|
|
1182
|
+
style,
|
|
1183
|
+
...rest
|
|
1184
|
+
}) => {
|
|
1185
|
+
const styles = variantStyles[variant];
|
|
1186
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1187
|
+
"div",
|
|
1188
|
+
{
|
|
1189
|
+
role: "alert",
|
|
1190
|
+
className: chunkYERNSNT4_cjs.cn(
|
|
1191
|
+
"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]",
|
|
1192
|
+
className
|
|
1193
|
+
),
|
|
1194
|
+
style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
|
|
1195
|
+
...rest,
|
|
1196
|
+
children: [
|
|
1197
|
+
!hideIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1198
|
+
"span",
|
|
1199
|
+
{
|
|
1200
|
+
className: chunkYERNSNT4_cjs.cn(
|
|
1201
|
+
"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",
|
|
1202
|
+
styles.iconWrap
|
|
1203
|
+
),
|
|
1204
|
+
children: icon ?? toastIcons[variant]
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1208
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-gray-800 dark:text-white/90", children: title }),
|
|
1209
|
+
message && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-sm text-gray-500 dark:text-gray-400", children: message })
|
|
1210
|
+
] }),
|
|
1211
|
+
showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1212
|
+
"button",
|
|
1213
|
+
{
|
|
1214
|
+
type: "button",
|
|
1215
|
+
"aria-label": "Close",
|
|
1216
|
+
onClick: onClose,
|
|
1217
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 transition hover:text-gray-700 dark:hover:text-gray-200",
|
|
1218
|
+
children: ToastCloseIcon
|
|
1219
|
+
}
|
|
1220
|
+
),
|
|
1221
|
+
!hideAccentBar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1222
|
+
"span",
|
|
1223
|
+
{
|
|
1224
|
+
className: chunkYERNSNT4_cjs.cn("absolute inset-x-0 bottom-0 h-1", styles.bar),
|
|
1225
|
+
"aria-hidden": "true"
|
|
1226
|
+
}
|
|
1227
|
+
)
|
|
1228
|
+
]
|
|
1229
|
+
}
|
|
1230
|
+
);
|
|
1231
|
+
};
|
|
969
1232
|
var AccordionContext = React5__default.default.createContext(null);
|
|
970
1233
|
var ChevronIcon2 = ({ open }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
971
1234
|
"svg",
|
|
@@ -2853,10 +3116,10 @@ exports.AvatarText = AvatarText;
|
|
|
2853
3116
|
exports.Badge = Badge;
|
|
2854
3117
|
exports.Breadcrumb = Breadcrumb;
|
|
2855
3118
|
exports.Button = Button;
|
|
3119
|
+
exports.Card = Card;
|
|
2856
3120
|
exports.Checkbox = Checkbox;
|
|
2857
3121
|
exports.Chip = Chip;
|
|
2858
3122
|
exports.Code = Code;
|
|
2859
|
-
exports.DataTable = DataTable;
|
|
2860
3123
|
exports.DatePicker = DatePicker;
|
|
2861
3124
|
exports.DateTimePicker = DateTimePicker;
|
|
2862
3125
|
exports.Drawer = Drawer;
|
|
@@ -2890,6 +3153,7 @@ exports.TableRow = TableRow;
|
|
|
2890
3153
|
exports.Tabs = Tabs;
|
|
2891
3154
|
exports.TextArea = TextArea;
|
|
2892
3155
|
exports.ThemeToggleButton = ThemeToggleButton;
|
|
3156
|
+
exports.Toast = Toast;
|
|
2893
3157
|
exports.Tooltip = Tooltip;
|
|
2894
3158
|
exports.styleOverride = styleOverride;
|
|
2895
3159
|
//# sourceMappingURL=index.cjs.map
|