@mamrp/components 1.4.6 → 1.4.7
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/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +148 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +146 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -598,4 +598,8 @@ type DataTableProps<T extends Record<string, any>> = {
|
|
|
598
598
|
*/
|
|
599
599
|
declare const DataTable: <T extends Record<string, any>>({ data, columns, isLoading, isRefetching, pagination, onPaginationChange, totalRows, manualPagination, columnFilters, onColumnFiltersChange, manualFiltering, onClearFilters, showClearFiltersButton, sorting, onSortingChange, manualSorting, columnVisibility, onColumnVisibilityChange, columnOrder, onColumnOrderChange, enableStickyHeader, maxHeight, density, enableColumnOrdering, enableGlobalFilter, enableColumnFilterModes, enableRowSelection, showColumnFilters, onShowColumnFiltersChange, renderTopToolbarCustomActions, renderBottomToolbarCustomActions, tableOptions, localization, }: DataTableProps<T>) => React$1.JSX.Element;
|
|
600
600
|
|
|
601
|
-
|
|
601
|
+
declare const _default: {
|
|
602
|
+
showToast: (type: "success" | "error", message: string) => void;
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomTimePicker, DataTable, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage, _default as showToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -598,4 +598,8 @@ type DataTableProps<T extends Record<string, any>> = {
|
|
|
598
598
|
*/
|
|
599
599
|
declare const DataTable: <T extends Record<string, any>>({ data, columns, isLoading, isRefetching, pagination, onPaginationChange, totalRows, manualPagination, columnFilters, onColumnFiltersChange, manualFiltering, onClearFilters, showClearFiltersButton, sorting, onSortingChange, manualSorting, columnVisibility, onColumnVisibilityChange, columnOrder, onColumnOrderChange, enableStickyHeader, maxHeight, density, enableColumnOrdering, enableGlobalFilter, enableColumnFilterModes, enableRowSelection, showColumnFilters, onShowColumnFiltersChange, renderTopToolbarCustomActions, renderBottomToolbarCustomActions, tableOptions, localization, }: DataTableProps<T>) => React$1.JSX.Element;
|
|
600
600
|
|
|
601
|
-
|
|
601
|
+
declare const _default: {
|
|
602
|
+
showToast: (type: "success" | "error", message: string) => void;
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
export { Page as Accordion, AdvancedSearchButton, ConfirmationDialog$1 as ConfirmationDialog, ConnectToBasculeButton, CustomCheckbox, CustomTimePicker, DataTable, DateFilter, DateFilterRange, DateMonthPicker, JalaliDatePicker$2 as DatePicker, JalaliDatePicker$1 as DateTimePicker, JalaliDateTimeRangePicker as DateTimeRangePicker, DraggablePaper, UploadImage as EnhancedUploadImage, FormInputNumber, FormInputText, HorizontalStepper, LicensePlate, JalaliDatePicker as MobileDateTimePicker, ConfirmationDialog as Modal, NestedSelect as NestedSelectort, NoResult, PaginationList, PatternTextField, RadioButton, SearchLicensePlate, MultipleSelectChip as Selector, SkeletonCard, SonarSpinner, SwitchButton, Table, UploadImage$1 as UploadImage, _default as showToast };
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,8 @@ __export(src_exports, {
|
|
|
62
62
|
SonarSpinner: () => SonarSpinner,
|
|
63
63
|
SwitchButton: () => switch_button_default,
|
|
64
64
|
Table: () => table_default,
|
|
65
|
-
UploadImage: () => upload_image_default
|
|
65
|
+
UploadImage: () => upload_image_default,
|
|
66
|
+
showToast: () => custom_toast_default
|
|
66
67
|
});
|
|
67
68
|
module.exports = __toCommonJS(src_exports);
|
|
68
69
|
|
|
@@ -4994,6 +4995,150 @@ var DataTable = ({
|
|
|
4994
4995
|
return /* @__PURE__ */ React.createElement(import_material_react_table.MaterialReactTable, { table });
|
|
4995
4996
|
};
|
|
4996
4997
|
var data_table_default = DataTable;
|
|
4998
|
+
|
|
4999
|
+
// src/custom-toast/index.tsx
|
|
5000
|
+
var import_material31 = require("@mui/material");
|
|
5001
|
+
var import_io53 = require("react-icons/io5");
|
|
5002
|
+
var import_react_hot_toast2 = __toESM(require("react-hot-toast"));
|
|
5003
|
+
var CustomToast = ({ type, message }) => {
|
|
5004
|
+
const theme2 = (0, import_material31.useTheme)();
|
|
5005
|
+
const isDarkMode = theme2.palette.mode === "dark";
|
|
5006
|
+
const colors = type === "success" ? { main: "#61d345", bg: "rgba(97, 211, 69, 0.2)" } : { main: "#ff4b4b", bg: "rgba(255, 75, 75, 0.2)" };
|
|
5007
|
+
const iconPath = type === "success" ? "M10 3L4.5 8.5L2 6" : "M9 3L3 9M3 3L9 9";
|
|
5008
|
+
const iconAnimation = type === "success" ? "@keyframes checkmarkDraw { 0% { stroke-dashoffset: -16; } 100% { stroke-dashoffset: 0; } }" : "@keyframes xDraw { 0% { stroke-dashoffset: 12; } 100% { stroke-dashoffset: 0; } }";
|
|
5009
|
+
return /* @__PURE__ */ React.createElement(
|
|
5010
|
+
import_material31.Box,
|
|
5011
|
+
{
|
|
5012
|
+
sx: {
|
|
5013
|
+
background: isDarkMode ? "#1e1e1e" : "#fff",
|
|
5014
|
+
color: isDarkMode ? "#e0e0e0" : "#363636",
|
|
5015
|
+
lineHeight: 1.3,
|
|
5016
|
+
willChange: "transform",
|
|
5017
|
+
boxShadow: isDarkMode ? "0 3px 10px rgba(0, 0, 0, 0.4), 0 3px 3px rgba(0, 0, 0, 0.2)" : "0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05)",
|
|
5018
|
+
maxWidth: "350px",
|
|
5019
|
+
pointerEvents: "auto",
|
|
5020
|
+
padding: "10px 10px",
|
|
5021
|
+
borderRadius: "8px",
|
|
5022
|
+
display: "flex",
|
|
5023
|
+
alignItems: "center",
|
|
5024
|
+
gap: "12px",
|
|
5025
|
+
position: "relative",
|
|
5026
|
+
overflow: "hidden",
|
|
5027
|
+
transition: "opacity 0.3s ease-in-out"
|
|
5028
|
+
}
|
|
5029
|
+
},
|
|
5030
|
+
/* @__PURE__ */ React.createElement("style", null, iconAnimation),
|
|
5031
|
+
/* @__PURE__ */ React.createElement(
|
|
5032
|
+
import_material31.Box,
|
|
5033
|
+
{
|
|
5034
|
+
sx: {
|
|
5035
|
+
width: "20px",
|
|
5036
|
+
height: "20px",
|
|
5037
|
+
borderRadius: "50%",
|
|
5038
|
+
background: colors.main,
|
|
5039
|
+
display: "flex",
|
|
5040
|
+
alignItems: "center",
|
|
5041
|
+
justifyContent: "center",
|
|
5042
|
+
flexShrink: 0,
|
|
5043
|
+
transform: "scale(0.95)",
|
|
5044
|
+
animation: type === "success" ? "iconPop 360ms cubic-bezier(.2,.9,.3,1) forwards, iconPulse 2400ms ease-in-out 600ms infinite" : "iconPop 360ms cubic-bezier(.2,.9,.3,1) forwards, iconShake 0.5s ease-in-out 0.4s",
|
|
5045
|
+
"@keyframes iconPop": {
|
|
5046
|
+
"0%": { transform: "scale(0.8)", opacity: 0 },
|
|
5047
|
+
"60%": { transform: "scale(1.08)", opacity: 1 },
|
|
5048
|
+
"100%": { transform: "scale(1)" }
|
|
5049
|
+
},
|
|
5050
|
+
"@keyframes iconPulse": {
|
|
5051
|
+
"0%": { transform: "scale(1)" },
|
|
5052
|
+
"50%": { transform: "scale(1.06)" },
|
|
5053
|
+
"100%": { transform: "scale(1)" }
|
|
5054
|
+
},
|
|
5055
|
+
"@keyframes iconShake": {
|
|
5056
|
+
"0%, 100%": { transform: "rotate(0deg)" },
|
|
5057
|
+
"25%": { transform: "rotate(-10deg)" },
|
|
5058
|
+
"75%": { transform: "rotate(10deg)" }
|
|
5059
|
+
}
|
|
5060
|
+
}
|
|
5061
|
+
},
|
|
5062
|
+
/* @__PURE__ */ React.createElement(
|
|
5063
|
+
"svg",
|
|
5064
|
+
{
|
|
5065
|
+
width: "12",
|
|
5066
|
+
height: "12",
|
|
5067
|
+
viewBox: "0 0 12 12",
|
|
5068
|
+
fill: "none",
|
|
5069
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
5070
|
+
},
|
|
5071
|
+
/* @__PURE__ */ React.createElement(
|
|
5072
|
+
"path",
|
|
5073
|
+
{
|
|
5074
|
+
d: iconPath,
|
|
5075
|
+
stroke: "#fff",
|
|
5076
|
+
strokeWidth: "1.5",
|
|
5077
|
+
strokeLinecap: "round",
|
|
5078
|
+
strokeLinejoin: "round",
|
|
5079
|
+
style: {
|
|
5080
|
+
strokeDasharray: 16,
|
|
5081
|
+
strokeDashoffset: type === "success" ? -16 : 12,
|
|
5082
|
+
animation: type === "success" ? "checkmarkDraw 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.2s forwards" : "xDraw 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.2s forwards"
|
|
5083
|
+
}
|
|
5084
|
+
}
|
|
5085
|
+
)
|
|
5086
|
+
)
|
|
5087
|
+
),
|
|
5088
|
+
/* @__PURE__ */ React.createElement(import_material31.Box, { sx: { flex: 1, fontSize: "14px" } }, message),
|
|
5089
|
+
/* @__PURE__ */ React.createElement(
|
|
5090
|
+
import_material31.IconButton,
|
|
5091
|
+
{
|
|
5092
|
+
size: "small",
|
|
5093
|
+
onClick: () => import_react_hot_toast2.default.dismiss(),
|
|
5094
|
+
sx: {
|
|
5095
|
+
color: isDarkMode ? "#e0e0e0" : "#363636",
|
|
5096
|
+
padding: "2px",
|
|
5097
|
+
minWidth: "unset",
|
|
5098
|
+
"&:hover": {
|
|
5099
|
+
background: isDarkMode ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)"
|
|
5100
|
+
}
|
|
5101
|
+
}
|
|
5102
|
+
},
|
|
5103
|
+
/* @__PURE__ */ React.createElement(import_io53.IoClose, { size: 18 })
|
|
5104
|
+
),
|
|
5105
|
+
/* @__PURE__ */ React.createElement(
|
|
5106
|
+
import_material31.Box,
|
|
5107
|
+
{
|
|
5108
|
+
sx: {
|
|
5109
|
+
position: "absolute",
|
|
5110
|
+
bottom: 0,
|
|
5111
|
+
left: 0,
|
|
5112
|
+
height: "3px",
|
|
5113
|
+
background: colors.bg,
|
|
5114
|
+
width: "100%",
|
|
5115
|
+
borderRadius: "0 0 8px 8px"
|
|
5116
|
+
}
|
|
5117
|
+
},
|
|
5118
|
+
/* @__PURE__ */ React.createElement(
|
|
5119
|
+
import_material31.Box,
|
|
5120
|
+
{
|
|
5121
|
+
sx: {
|
|
5122
|
+
height: "100%",
|
|
5123
|
+
background: colors.main,
|
|
5124
|
+
borderRadius: "0 0 0 8px",
|
|
5125
|
+
animation: "progress 4s linear forwards",
|
|
5126
|
+
"@keyframes progress": {
|
|
5127
|
+
from: { width: "100%" },
|
|
5128
|
+
to: { width: "0%" }
|
|
5129
|
+
}
|
|
5130
|
+
}
|
|
5131
|
+
}
|
|
5132
|
+
)
|
|
5133
|
+
)
|
|
5134
|
+
);
|
|
5135
|
+
};
|
|
5136
|
+
var showToast = (type, message) => {
|
|
5137
|
+
import_react_hot_toast2.default.custom(/* @__PURE__ */ React.createElement(CustomToast, { type, message }), {
|
|
5138
|
+
duration: 4e3
|
|
5139
|
+
});
|
|
5140
|
+
};
|
|
5141
|
+
var custom_toast_default = { showToast };
|
|
4997
5142
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4998
5143
|
0 && (module.exports = {
|
|
4999
5144
|
Accordion,
|
|
@@ -5028,6 +5173,7 @@ var data_table_default = DataTable;
|
|
|
5028
5173
|
SonarSpinner,
|
|
5029
5174
|
SwitchButton,
|
|
5030
5175
|
Table,
|
|
5031
|
-
UploadImage
|
|
5176
|
+
UploadImage,
|
|
5177
|
+
showToast
|
|
5032
5178
|
});
|
|
5033
5179
|
//# sourceMappingURL=index.js.map
|