@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.mjs CHANGED
@@ -5002,6 +5002,150 @@ var DataTable = ({
5002
5002
  return /* @__PURE__ */ React.createElement(MaterialReactTable, { table });
5003
5003
  };
5004
5004
  var data_table_default = DataTable;
5005
+
5006
+ // src/custom-toast/index.tsx
5007
+ import { Box as Box24, IconButton as IconButton10, useTheme as useTheme8 } from "@mui/material";
5008
+ import { IoClose as IoClose3 } from "react-icons/io5";
5009
+ import toast2 from "react-hot-toast";
5010
+ var CustomToast = ({ type, message }) => {
5011
+ const theme2 = useTheme8();
5012
+ const isDarkMode = theme2.palette.mode === "dark";
5013
+ const colors = type === "success" ? { main: "#61d345", bg: "rgba(97, 211, 69, 0.2)" } : { main: "#ff4b4b", bg: "rgba(255, 75, 75, 0.2)" };
5014
+ const iconPath = type === "success" ? "M10 3L4.5 8.5L2 6" : "M9 3L3 9M3 3L9 9";
5015
+ const iconAnimation = type === "success" ? "@keyframes checkmarkDraw { 0% { stroke-dashoffset: -16; } 100% { stroke-dashoffset: 0; } }" : "@keyframes xDraw { 0% { stroke-dashoffset: 12; } 100% { stroke-dashoffset: 0; } }";
5016
+ return /* @__PURE__ */ React.createElement(
5017
+ Box24,
5018
+ {
5019
+ sx: {
5020
+ background: isDarkMode ? "#1e1e1e" : "#fff",
5021
+ color: isDarkMode ? "#e0e0e0" : "#363636",
5022
+ lineHeight: 1.3,
5023
+ willChange: "transform",
5024
+ 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)",
5025
+ maxWidth: "350px",
5026
+ pointerEvents: "auto",
5027
+ padding: "10px 10px",
5028
+ borderRadius: "8px",
5029
+ display: "flex",
5030
+ alignItems: "center",
5031
+ gap: "12px",
5032
+ position: "relative",
5033
+ overflow: "hidden",
5034
+ transition: "opacity 0.3s ease-in-out"
5035
+ }
5036
+ },
5037
+ /* @__PURE__ */ React.createElement("style", null, iconAnimation),
5038
+ /* @__PURE__ */ React.createElement(
5039
+ Box24,
5040
+ {
5041
+ sx: {
5042
+ width: "20px",
5043
+ height: "20px",
5044
+ borderRadius: "50%",
5045
+ background: colors.main,
5046
+ display: "flex",
5047
+ alignItems: "center",
5048
+ justifyContent: "center",
5049
+ flexShrink: 0,
5050
+ transform: "scale(0.95)",
5051
+ 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",
5052
+ "@keyframes iconPop": {
5053
+ "0%": { transform: "scale(0.8)", opacity: 0 },
5054
+ "60%": { transform: "scale(1.08)", opacity: 1 },
5055
+ "100%": { transform: "scale(1)" }
5056
+ },
5057
+ "@keyframes iconPulse": {
5058
+ "0%": { transform: "scale(1)" },
5059
+ "50%": { transform: "scale(1.06)" },
5060
+ "100%": { transform: "scale(1)" }
5061
+ },
5062
+ "@keyframes iconShake": {
5063
+ "0%, 100%": { transform: "rotate(0deg)" },
5064
+ "25%": { transform: "rotate(-10deg)" },
5065
+ "75%": { transform: "rotate(10deg)" }
5066
+ }
5067
+ }
5068
+ },
5069
+ /* @__PURE__ */ React.createElement(
5070
+ "svg",
5071
+ {
5072
+ width: "12",
5073
+ height: "12",
5074
+ viewBox: "0 0 12 12",
5075
+ fill: "none",
5076
+ xmlns: "http://www.w3.org/2000/svg"
5077
+ },
5078
+ /* @__PURE__ */ React.createElement(
5079
+ "path",
5080
+ {
5081
+ d: iconPath,
5082
+ stroke: "#fff",
5083
+ strokeWidth: "1.5",
5084
+ strokeLinecap: "round",
5085
+ strokeLinejoin: "round",
5086
+ style: {
5087
+ strokeDasharray: 16,
5088
+ strokeDashoffset: type === "success" ? -16 : 12,
5089
+ 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"
5090
+ }
5091
+ }
5092
+ )
5093
+ )
5094
+ ),
5095
+ /* @__PURE__ */ React.createElement(Box24, { sx: { flex: 1, fontSize: "14px" } }, message),
5096
+ /* @__PURE__ */ React.createElement(
5097
+ IconButton10,
5098
+ {
5099
+ size: "small",
5100
+ onClick: () => toast2.dismiss(),
5101
+ sx: {
5102
+ color: isDarkMode ? "#e0e0e0" : "#363636",
5103
+ padding: "2px",
5104
+ minWidth: "unset",
5105
+ "&:hover": {
5106
+ background: isDarkMode ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)"
5107
+ }
5108
+ }
5109
+ },
5110
+ /* @__PURE__ */ React.createElement(IoClose3, { size: 18 })
5111
+ ),
5112
+ /* @__PURE__ */ React.createElement(
5113
+ Box24,
5114
+ {
5115
+ sx: {
5116
+ position: "absolute",
5117
+ bottom: 0,
5118
+ left: 0,
5119
+ height: "3px",
5120
+ background: colors.bg,
5121
+ width: "100%",
5122
+ borderRadius: "0 0 8px 8px"
5123
+ }
5124
+ },
5125
+ /* @__PURE__ */ React.createElement(
5126
+ Box24,
5127
+ {
5128
+ sx: {
5129
+ height: "100%",
5130
+ background: colors.main,
5131
+ borderRadius: "0 0 0 8px",
5132
+ animation: "progress 4s linear forwards",
5133
+ "@keyframes progress": {
5134
+ from: { width: "100%" },
5135
+ to: { width: "0%" }
5136
+ }
5137
+ }
5138
+ }
5139
+ )
5140
+ )
5141
+ );
5142
+ };
5143
+ var showToast = (type, message) => {
5144
+ toast2.custom(/* @__PURE__ */ React.createElement(CustomToast, { type, message }), {
5145
+ duration: 4e3
5146
+ });
5147
+ };
5148
+ var custom_toast_default = { showToast };
5005
5149
  export {
5006
5150
  Page as Accordion,
5007
5151
  AdvancedSearchButton,
@@ -5035,6 +5179,7 @@ export {
5035
5179
  SonarSpinner,
5036
5180
  switch_button_default as SwitchButton,
5037
5181
  table_default as Table,
5038
- upload_image_default as UploadImage
5182
+ upload_image_default as UploadImage,
5183
+ custom_toast_default as showToast
5039
5184
  };
5040
5185
  //# sourceMappingURL=index.mjs.map