@andreagiugni/tailwind-dashboard-ui 0.1.0 → 0.2.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 +2 -0
- package/dist/index.cjs +226 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +225 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -157,6 +157,7 @@ Legend: **(+native)** = also extends the element's native HTML attributes.
|
|
|
157
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
|
|
package/dist/index.cjs
CHANGED
|
@@ -966,6 +966,230 @@ var ThemeToggleButton = ({
|
|
|
966
966
|
}
|
|
967
967
|
);
|
|
968
968
|
};
|
|
969
|
+
var Card = ({
|
|
970
|
+
title,
|
|
971
|
+
description,
|
|
972
|
+
icon,
|
|
973
|
+
image,
|
|
974
|
+
imageAlt = "",
|
|
975
|
+
horizontal = false,
|
|
976
|
+
footer,
|
|
977
|
+
children,
|
|
978
|
+
className,
|
|
979
|
+
bgColor,
|
|
980
|
+
textColor,
|
|
981
|
+
borderColor,
|
|
982
|
+
style,
|
|
983
|
+
...rest
|
|
984
|
+
}) => {
|
|
985
|
+
const cover = image ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
986
|
+
"img",
|
|
987
|
+
{
|
|
988
|
+
src: image,
|
|
989
|
+
alt: imageAlt,
|
|
990
|
+
className: chunkYERNSNT4_cjs.cn(
|
|
991
|
+
"object-cover",
|
|
992
|
+
horizontal ? "h-full w-full sm:w-2/5 sm:max-w-[16rem]" : "h-48 w-full"
|
|
993
|
+
)
|
|
994
|
+
}
|
|
995
|
+
) : null;
|
|
996
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
997
|
+
"div",
|
|
998
|
+
{
|
|
999
|
+
className: chunkYERNSNT4_cjs.cn(
|
|
1000
|
+
"overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03]",
|
|
1001
|
+
horizontal && image && "flex flex-col sm:flex-row",
|
|
1002
|
+
className
|
|
1003
|
+
),
|
|
1004
|
+
style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
|
|
1005
|
+
...rest,
|
|
1006
|
+
children: [
|
|
1007
|
+
cover,
|
|
1008
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 p-5 sm:p-6", children: [
|
|
1009
|
+
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 }),
|
|
1010
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-gray-800 dark:text-white/90", children: title }),
|
|
1011
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: description }),
|
|
1012
|
+
children,
|
|
1013
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: footer })
|
|
1014
|
+
] })
|
|
1015
|
+
]
|
|
1016
|
+
}
|
|
1017
|
+
);
|
|
1018
|
+
};
|
|
1019
|
+
var toastIcons = {
|
|
1020
|
+
success: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1021
|
+
"svg",
|
|
1022
|
+
{
|
|
1023
|
+
className: "fill-current",
|
|
1024
|
+
width: "20",
|
|
1025
|
+
height: "20",
|
|
1026
|
+
viewBox: "0 0 24 24",
|
|
1027
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1028
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1029
|
+
"path",
|
|
1030
|
+
{
|
|
1031
|
+
fillRule: "evenodd",
|
|
1032
|
+
clipRule: "evenodd",
|
|
1033
|
+
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"
|
|
1034
|
+
}
|
|
1035
|
+
)
|
|
1036
|
+
}
|
|
1037
|
+
),
|
|
1038
|
+
danger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1039
|
+
"svg",
|
|
1040
|
+
{
|
|
1041
|
+
className: "fill-current",
|
|
1042
|
+
width: "20",
|
|
1043
|
+
height: "20",
|
|
1044
|
+
viewBox: "0 0 24 24",
|
|
1045
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1046
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1047
|
+
"path",
|
|
1048
|
+
{
|
|
1049
|
+
fillRule: "evenodd",
|
|
1050
|
+
clipRule: "evenodd",
|
|
1051
|
+
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"
|
|
1052
|
+
}
|
|
1053
|
+
)
|
|
1054
|
+
}
|
|
1055
|
+
),
|
|
1056
|
+
warning: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1057
|
+
"svg",
|
|
1058
|
+
{
|
|
1059
|
+
className: "fill-current",
|
|
1060
|
+
width: "20",
|
|
1061
|
+
height: "20",
|
|
1062
|
+
viewBox: "0 0 24 24",
|
|
1063
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1064
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1065
|
+
"path",
|
|
1066
|
+
{
|
|
1067
|
+
fillRule: "evenodd",
|
|
1068
|
+
clipRule: "evenodd",
|
|
1069
|
+
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"
|
|
1070
|
+
}
|
|
1071
|
+
)
|
|
1072
|
+
}
|
|
1073
|
+
),
|
|
1074
|
+
info: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1075
|
+
"svg",
|
|
1076
|
+
{
|
|
1077
|
+
className: "fill-current",
|
|
1078
|
+
width: "20",
|
|
1079
|
+
height: "20",
|
|
1080
|
+
viewBox: "0 0 24 24",
|
|
1081
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1082
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1083
|
+
"path",
|
|
1084
|
+
{
|
|
1085
|
+
fillRule: "evenodd",
|
|
1086
|
+
clipRule: "evenodd",
|
|
1087
|
+
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"
|
|
1088
|
+
}
|
|
1089
|
+
)
|
|
1090
|
+
}
|
|
1091
|
+
)
|
|
1092
|
+
};
|
|
1093
|
+
var ToastCloseIcon = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1094
|
+
"svg",
|
|
1095
|
+
{
|
|
1096
|
+
width: "18",
|
|
1097
|
+
height: "18",
|
|
1098
|
+
viewBox: "0 0 24 24",
|
|
1099
|
+
fill: "none",
|
|
1100
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1101
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1102
|
+
"path",
|
|
1103
|
+
{
|
|
1104
|
+
fillRule: "evenodd",
|
|
1105
|
+
clipRule: "evenodd",
|
|
1106
|
+
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",
|
|
1107
|
+
fill: "currentColor"
|
|
1108
|
+
}
|
|
1109
|
+
)
|
|
1110
|
+
}
|
|
1111
|
+
);
|
|
1112
|
+
var variantStyles = {
|
|
1113
|
+
success: {
|
|
1114
|
+
iconWrap: "bg-success-50 text-success-600 dark:bg-success-500/15 dark:text-success-500",
|
|
1115
|
+
bar: "bg-success-500"
|
|
1116
|
+
},
|
|
1117
|
+
danger: {
|
|
1118
|
+
iconWrap: "bg-error-50 text-error-600 dark:bg-error-500/15 dark:text-error-500",
|
|
1119
|
+
bar: "bg-error-500"
|
|
1120
|
+
},
|
|
1121
|
+
warning: {
|
|
1122
|
+
iconWrap: "bg-warning-50 text-warning-600 dark:bg-warning-500/15 dark:text-orange-400",
|
|
1123
|
+
bar: "bg-warning-500"
|
|
1124
|
+
},
|
|
1125
|
+
info: {
|
|
1126
|
+
iconWrap: "bg-blue-light-50 text-blue-light-500 dark:bg-blue-light-500/15 dark:text-blue-light-500",
|
|
1127
|
+
bar: "bg-blue-light-500"
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1130
|
+
var Toast = ({
|
|
1131
|
+
variant = "success",
|
|
1132
|
+
title,
|
|
1133
|
+
message,
|
|
1134
|
+
icon,
|
|
1135
|
+
hideIcon = false,
|
|
1136
|
+
showCloseButton = true,
|
|
1137
|
+
onClose,
|
|
1138
|
+
hideAccentBar = false,
|
|
1139
|
+
className,
|
|
1140
|
+
bgColor,
|
|
1141
|
+
textColor,
|
|
1142
|
+
borderColor,
|
|
1143
|
+
style,
|
|
1144
|
+
...rest
|
|
1145
|
+
}) => {
|
|
1146
|
+
const styles = variantStyles[variant];
|
|
1147
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1148
|
+
"div",
|
|
1149
|
+
{
|
|
1150
|
+
role: "alert",
|
|
1151
|
+
className: chunkYERNSNT4_cjs.cn(
|
|
1152
|
+
"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]",
|
|
1153
|
+
className
|
|
1154
|
+
),
|
|
1155
|
+
style: { ...styleOverride({ bgColor, textColor, borderColor }), ...style },
|
|
1156
|
+
...rest,
|
|
1157
|
+
children: [
|
|
1158
|
+
!hideIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1159
|
+
"span",
|
|
1160
|
+
{
|
|
1161
|
+
className: chunkYERNSNT4_cjs.cn(
|
|
1162
|
+
"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",
|
|
1163
|
+
styles.iconWrap
|
|
1164
|
+
),
|
|
1165
|
+
children: icon ?? toastIcons[variant]
|
|
1166
|
+
}
|
|
1167
|
+
),
|
|
1168
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1169
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-gray-800 dark:text-white/90", children: title }),
|
|
1170
|
+
message && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-sm text-gray-500 dark:text-gray-400", children: message })
|
|
1171
|
+
] }),
|
|
1172
|
+
showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1173
|
+
"button",
|
|
1174
|
+
{
|
|
1175
|
+
type: "button",
|
|
1176
|
+
"aria-label": "Close",
|
|
1177
|
+
onClick: onClose,
|
|
1178
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 transition hover:text-gray-700 dark:hover:text-gray-200",
|
|
1179
|
+
children: ToastCloseIcon
|
|
1180
|
+
}
|
|
1181
|
+
),
|
|
1182
|
+
!hideAccentBar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1183
|
+
"span",
|
|
1184
|
+
{
|
|
1185
|
+
className: chunkYERNSNT4_cjs.cn("absolute inset-x-0 bottom-0 h-1", styles.bar),
|
|
1186
|
+
"aria-hidden": "true"
|
|
1187
|
+
}
|
|
1188
|
+
)
|
|
1189
|
+
]
|
|
1190
|
+
}
|
|
1191
|
+
);
|
|
1192
|
+
};
|
|
969
1193
|
var AccordionContext = React5__default.default.createContext(null);
|
|
970
1194
|
var ChevronIcon2 = ({ open }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
971
1195
|
"svg",
|
|
@@ -2853,6 +3077,7 @@ exports.AvatarText = AvatarText;
|
|
|
2853
3077
|
exports.Badge = Badge;
|
|
2854
3078
|
exports.Breadcrumb = Breadcrumb;
|
|
2855
3079
|
exports.Button = Button;
|
|
3080
|
+
exports.Card = Card;
|
|
2856
3081
|
exports.Checkbox = Checkbox;
|
|
2857
3082
|
exports.Chip = Chip;
|
|
2858
3083
|
exports.Code = Code;
|
|
@@ -2890,6 +3115,7 @@ exports.TableRow = TableRow;
|
|
|
2890
3115
|
exports.Tabs = Tabs;
|
|
2891
3116
|
exports.TextArea = TextArea;
|
|
2892
3117
|
exports.ThemeToggleButton = ThemeToggleButton;
|
|
3118
|
+
exports.Toast = Toast;
|
|
2893
3119
|
exports.Tooltip = Tooltip;
|
|
2894
3120
|
exports.styleOverride = styleOverride;
|
|
2895
3121
|
//# sourceMappingURL=index.cjs.map
|