@wavelengthusaf/components 1.2.2 → 1.2.4
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 +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +32 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4995,33 +4995,30 @@ import Snackbar2 from "@mui/material/Snackbar";
|
|
|
4995
4995
|
import IconButton5 from "@mui/material/IconButton";
|
|
4996
4996
|
import CloseIcon3 from "@mui/icons-material/Close";
|
|
4997
4997
|
import SnackbarContent2 from "@mui/material/SnackbarContent";
|
|
4998
|
-
|
|
4999
|
-
console.log(props.show);
|
|
5000
|
-
const show = props.show;
|
|
5001
|
-
const setShow = props.setShow;
|
|
4998
|
+
function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign, durationSb, width: width2, message, customVertyAlign, toggleShow }) {
|
|
5002
4999
|
const handleClose = () => {
|
|
5003
|
-
|
|
5000
|
+
toggleShow(false);
|
|
5004
5001
|
};
|
|
5005
|
-
const durationMs =
|
|
5002
|
+
const durationMs = durationSb ? durationSb * 1e3 : 4e3;
|
|
5006
5003
|
let bgColor = "";
|
|
5007
|
-
if (
|
|
5004
|
+
if (type == "success") {
|
|
5008
5005
|
bgColor = "#25ab21";
|
|
5009
|
-
} else if (
|
|
5006
|
+
} else if (type == "error") {
|
|
5010
5007
|
bgColor = "#FF4646";
|
|
5011
|
-
} else if (
|
|
5008
|
+
} else if (type == "disabled") {
|
|
5012
5009
|
bgColor = "#737373";
|
|
5013
5010
|
}
|
|
5014
|
-
const sIcon =
|
|
5011
|
+
const sIcon = icon ? icon : "";
|
|
5015
5012
|
return /* @__PURE__ */ React31.createElement(
|
|
5016
5013
|
Snackbar2,
|
|
5017
5014
|
{
|
|
5018
|
-
sx: { marginTop:
|
|
5015
|
+
sx: { marginTop: customVertyAlign ? `${customVertyAlign}` : "", zIndex: 1400 },
|
|
5019
5016
|
open: show,
|
|
5020
5017
|
onClose: handleClose,
|
|
5021
5018
|
autoHideDuration: durationMs,
|
|
5022
5019
|
anchorOrigin: {
|
|
5023
|
-
vertical:
|
|
5024
|
-
horizontal:
|
|
5020
|
+
vertical: vertyAlign ? vertyAlign : "top",
|
|
5021
|
+
horizontal: horryAlign ? horryAlign : "center"
|
|
5025
5022
|
}
|
|
5026
5023
|
},
|
|
5027
5024
|
/* @__PURE__ */ React31.createElement(
|
|
@@ -5039,16 +5036,32 @@ var WavelengthStandardSnackbar = (props) => {
|
|
|
5039
5036
|
style: {
|
|
5040
5037
|
display: "grid",
|
|
5041
5038
|
gridTemplateColumns: "1fr 1fr 1fr 1fr 1fr",
|
|
5042
|
-
width:
|
|
5039
|
+
width: width2
|
|
5043
5040
|
}
|
|
5044
5041
|
},
|
|
5045
|
-
/* @__PURE__ */ React31.createElement("div", { style: { marginTop: 4, gridColumnStart: 2, gridColumnEnd: 5, textAlign: "center", display: "flex", flexDirection: "row", justifyContent: "center" }, id: "snackbar" }, /* @__PURE__ */ React31.createElement("div", null, sIcon), /* @__PURE__ */ React31.createElement("div", { style: { fontSize: "1rem", marginLeft: "10px" } },
|
|
5046
|
-
/* @__PURE__ */ React31.createElement("div", { style: { gridColumnStart: 6 } }, " ", /* @__PURE__ */ React31.createElement(IconButton5, { size: "small", "aria-label": "close", color: "inherit"
|
|
5042
|
+
/* @__PURE__ */ React31.createElement("div", { style: { marginTop: 4, gridColumnStart: 2, gridColumnEnd: 5, textAlign: "center", display: "flex", flexDirection: "row", justifyContent: "center" }, id: "snackbar" }, /* @__PURE__ */ React31.createElement("div", null, sIcon), /* @__PURE__ */ React31.createElement("div", { style: { fontSize: "1rem", marginLeft: "10px" } }, message ? message : "Insert Message Here")),
|
|
5043
|
+
/* @__PURE__ */ React31.createElement("div", { style: { gridColumnStart: 6 } }, " ", /* @__PURE__ */ React31.createElement(IconButton5, { size: "small", "aria-label": "close", color: "inherit" }, /* @__PURE__ */ React31.createElement(CloseIcon3, { fontSize: "small" })))
|
|
5047
5044
|
)
|
|
5048
5045
|
}
|
|
5049
5046
|
)
|
|
5050
5047
|
);
|
|
5051
|
-
}
|
|
5048
|
+
}
|
|
5049
|
+
|
|
5050
|
+
// src/components/snackbars/TestSnackbar.tsx
|
|
5051
|
+
import { Button as Button5, IconButton as IconButton6, Snackbar as Snackbar3 } from "@mui/material";
|
|
5052
|
+
import React32 from "react";
|
|
5053
|
+
import CloseIcon4 from "@mui/icons-material/Close";
|
|
5054
|
+
function TestSnackbar({ openProp, toggleOpen }) {
|
|
5055
|
+
const [open, setOpen] = React32.useState(openProp);
|
|
5056
|
+
const handleClose = (event, reason) => {
|
|
5057
|
+
if (reason === "clickaway") {
|
|
5058
|
+
return;
|
|
5059
|
+
}
|
|
5060
|
+
toggleOpen(false);
|
|
5061
|
+
};
|
|
5062
|
+
const action = /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Button5, { color: "secondary", size: "small", onClick: handleClose }, "UNDO"), /* @__PURE__ */ React32.createElement(IconButton6, { size: "small", "aria-label": "close", color: "inherit", onClick: handleClose }, /* @__PURE__ */ React32.createElement(CloseIcon4, { fontSize: "small" })));
|
|
5063
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Snackbar3, { open: openProp, autoHideDuration: 6e3, onClose: handleClose, message: "Note archived", action }));
|
|
5064
|
+
}
|
|
5052
5065
|
export {
|
|
5053
5066
|
AceOfSpadesComponent,
|
|
5054
5067
|
AppLogo,
|
|
@@ -5065,6 +5078,7 @@ export {
|
|
|
5065
5078
|
SearchTextField,
|
|
5066
5079
|
SquadronIcon,
|
|
5067
5080
|
SwarmIcon,
|
|
5081
|
+
TestSnackbar,
|
|
5068
5082
|
WavelengthAppTheme,
|
|
5069
5083
|
WavelengthAutocomplete,
|
|
5070
5084
|
WavelengthBannerHeader,
|