@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 CHANGED
@@ -313,7 +313,7 @@ interface StandardSnackbarProps {
313
313
  type: "success" | "error" | "disabled";
314
314
  show: boolean;
315
315
  icon?: ReactNode;
316
- setShow: (show: boolean) => void;
316
+ toggleShow: (on: boolean) => void;
317
317
  horryAlign?: "left" | "right" | "center";
318
318
  vertyAlign?: "top" | "bottom";
319
319
  durationSb?: number;
@@ -321,6 +321,12 @@ interface StandardSnackbarProps {
321
321
  message?: string | ReactNode;
322
322
  customVertyAlign?: string;
323
323
  }
324
- declare const WavelengthStandardSnackbar: (props: StandardSnackbarProps) => React__default.JSX.Element;
324
+ declare function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign, durationSb, width, message, customVertyAlign, toggleShow }: StandardSnackbarProps): React__default.JSX.Element;
325
+
326
+ interface TestProps {
327
+ openProp: boolean;
328
+ toggleOpen: React__default.Dispatch<React__default.SetStateAction<boolean>>;
329
+ }
330
+ declare function TestSnackbar({ openProp, toggleOpen }: TestProps): React__default.JSX.Element;
325
331
 
326
- export { AceOfSpadesComponent, AppLogo, ArrowIcon, BomberBeeIcon, ButtonIcon, ButtonMenu, DefaultIcon, ManyPlanesComponent, NotAvailablePage, Old563EWSLogo, PortalIcon, RapidrefIcon, type SearchResult, SearchTextField, SquadronIcon, SwarmIcon, type ThemeProperties, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBannerHeader, WavelengthBox, WavelengthButton, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFooter, WavelengthIcon, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthSearch, WavelengthSideBar, WavelengthSnackbar, WavelengthStandardSnackbar, WavelengthTitleBar, add, concat, findBestStringMatch, type menuItemProps, useThemeContext };
332
+ export { AceOfSpadesComponent, AppLogo, ArrowIcon, BomberBeeIcon, ButtonIcon, ButtonMenu, DefaultIcon, ManyPlanesComponent, NotAvailablePage, Old563EWSLogo, PortalIcon, RapidrefIcon, type SearchResult, SearchTextField, SquadronIcon, SwarmIcon, TestSnackbar, type ThemeProperties, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBannerHeader, WavelengthBox, WavelengthButton, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFooter, WavelengthIcon, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthSearch, WavelengthSideBar, WavelengthSnackbar, WavelengthStandardSnackbar, WavelengthTitleBar, add, concat, findBestStringMatch, type menuItemProps, useThemeContext };
package/dist/index.d.ts CHANGED
@@ -313,7 +313,7 @@ interface StandardSnackbarProps {
313
313
  type: "success" | "error" | "disabled";
314
314
  show: boolean;
315
315
  icon?: ReactNode;
316
- setShow: (show: boolean) => void;
316
+ toggleShow: (on: boolean) => void;
317
317
  horryAlign?: "left" | "right" | "center";
318
318
  vertyAlign?: "top" | "bottom";
319
319
  durationSb?: number;
@@ -321,6 +321,12 @@ interface StandardSnackbarProps {
321
321
  message?: string | ReactNode;
322
322
  customVertyAlign?: string;
323
323
  }
324
- declare const WavelengthStandardSnackbar: (props: StandardSnackbarProps) => React__default.JSX.Element;
324
+ declare function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign, durationSb, width, message, customVertyAlign, toggleShow }: StandardSnackbarProps): React__default.JSX.Element;
325
+
326
+ interface TestProps {
327
+ openProp: boolean;
328
+ toggleOpen: React__default.Dispatch<React__default.SetStateAction<boolean>>;
329
+ }
330
+ declare function TestSnackbar({ openProp, toggleOpen }: TestProps): React__default.JSX.Element;
325
331
 
326
- export { AceOfSpadesComponent, AppLogo, ArrowIcon, BomberBeeIcon, ButtonIcon, ButtonMenu, DefaultIcon, ManyPlanesComponent, NotAvailablePage, Old563EWSLogo, PortalIcon, RapidrefIcon, type SearchResult, SearchTextField, SquadronIcon, SwarmIcon, type ThemeProperties, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBannerHeader, WavelengthBox, WavelengthButton, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFooter, WavelengthIcon, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthSearch, WavelengthSideBar, WavelengthSnackbar, WavelengthStandardSnackbar, WavelengthTitleBar, add, concat, findBestStringMatch, type menuItemProps, useThemeContext };
332
+ export { AceOfSpadesComponent, AppLogo, ArrowIcon, BomberBeeIcon, ButtonIcon, ButtonMenu, DefaultIcon, ManyPlanesComponent, NotAvailablePage, Old563EWSLogo, PortalIcon, RapidrefIcon, type SearchResult, SearchTextField, SquadronIcon, SwarmIcon, TestSnackbar, type ThemeProperties, WavelengthAppTheme, WavelengthAutocomplete, WavelengthBannerHeader, WavelengthBox, WavelengthButton, WavelengthConfirmationModal, WavelengthContentModal, WavelengthContentPlaceholder, WavelengthDropdownButton, WavelengthExampleComponent, WavelengthFooter, WavelengthIcon, WavelengthPlaneTrail, WavelengthPopUpMenu, WavelengthSearch, WavelengthSideBar, WavelengthSnackbar, WavelengthStandardSnackbar, WavelengthTitleBar, add, concat, findBestStringMatch, type menuItemProps, useThemeContext };
package/dist/index.js CHANGED
@@ -1318,6 +1318,7 @@ __export(src_exports, {
1318
1318
  SearchTextField: () => SearchTextField,
1319
1319
  SquadronIcon: () => SquadronIcon,
1320
1320
  SwarmIcon: () => SwarmIcon,
1321
+ TestSnackbar: () => TestSnackbar,
1321
1322
  WavelengthAppTheme: () => WavelengthAppTheme,
1322
1323
  WavelengthAutocomplete: () => WavelengthAutocomplete,
1323
1324
  WavelengthBannerHeader: () => WavelengthBannerHeader,
@@ -5036,33 +5037,30 @@ var import_Snackbar = __toESM(require("@mui/material/Snackbar"));
5036
5037
  var import_IconButton2 = __toESM(require("@mui/material/IconButton"));
5037
5038
  var import_Close3 = __toESM(require("@mui/icons-material/Close"));
5038
5039
  var import_SnackbarContent = __toESM(require("@mui/material/SnackbarContent"));
5039
- var WavelengthStandardSnackbar = (props) => {
5040
- console.log(props.show);
5041
- const show = props.show;
5042
- const setShow = props.setShow;
5040
+ function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign, durationSb, width: width2, message, customVertyAlign, toggleShow }) {
5043
5041
  const handleClose = () => {
5044
- setShow(false);
5042
+ toggleShow(false);
5045
5043
  };
5046
- const durationMs = props.durationSb ? props.durationSb * 1e3 : 4e3;
5044
+ const durationMs = durationSb ? durationSb * 1e3 : 4e3;
5047
5045
  let bgColor = "";
5048
- if (props.type == "success") {
5046
+ if (type == "success") {
5049
5047
  bgColor = "#25ab21";
5050
- } else if (props.type == "error") {
5048
+ } else if (type == "error") {
5051
5049
  bgColor = "#FF4646";
5052
- } else if (props.type == "disabled") {
5050
+ } else if (type == "disabled") {
5053
5051
  bgColor = "#737373";
5054
5052
  }
5055
- const sIcon = props.icon ? props.icon : "";
5053
+ const sIcon = icon ? icon : "";
5056
5054
  return /* @__PURE__ */ import_react35.default.createElement(
5057
5055
  import_Snackbar.default,
5058
5056
  {
5059
- sx: { marginTop: props.customVertyAlign ? `${props.customVertyAlign}` : "", zIndex: 1400 },
5057
+ sx: { marginTop: customVertyAlign ? `${customVertyAlign}` : "", zIndex: 1400 },
5060
5058
  open: show,
5061
5059
  onClose: handleClose,
5062
5060
  autoHideDuration: durationMs,
5063
5061
  anchorOrigin: {
5064
- vertical: props.vertyAlign ? props.vertyAlign : "top",
5065
- horizontal: props.horryAlign ? props.horryAlign : "center"
5062
+ vertical: vertyAlign ? vertyAlign : "top",
5063
+ horizontal: horryAlign ? horryAlign : "center"
5066
5064
  }
5067
5065
  },
5068
5066
  /* @__PURE__ */ import_react35.default.createElement(
@@ -5080,16 +5078,32 @@ var WavelengthStandardSnackbar = (props) => {
5080
5078
  style: {
5081
5079
  display: "grid",
5082
5080
  gridTemplateColumns: "1fr 1fr 1fr 1fr 1fr",
5083
- width: props.width
5081
+ width: width2
5084
5082
  }
5085
5083
  },
5086
- /* @__PURE__ */ import_react35.default.createElement("div", { style: { marginTop: 4, gridColumnStart: 2, gridColumnEnd: 5, textAlign: "center", display: "flex", flexDirection: "row", justifyContent: "center" }, id: "snackbar" }, /* @__PURE__ */ import_react35.default.createElement("div", null, sIcon), /* @__PURE__ */ import_react35.default.createElement("div", { style: { fontSize: "1rem", marginLeft: "10px" } }, props.message ? props.message : "Insert Message Here")),
5087
- /* @__PURE__ */ import_react35.default.createElement("div", { style: { gridColumnStart: 6 } }, " ", /* @__PURE__ */ import_react35.default.createElement(import_IconButton2.default, { size: "small", "aria-label": "close", color: "inherit", onClick: handleClose }, /* @__PURE__ */ import_react35.default.createElement(import_Close3.default, { fontSize: "small" })))
5084
+ /* @__PURE__ */ import_react35.default.createElement("div", { style: { marginTop: 4, gridColumnStart: 2, gridColumnEnd: 5, textAlign: "center", display: "flex", flexDirection: "row", justifyContent: "center" }, id: "snackbar" }, /* @__PURE__ */ import_react35.default.createElement("div", null, sIcon), /* @__PURE__ */ import_react35.default.createElement("div", { style: { fontSize: "1rem", marginLeft: "10px" } }, message ? message : "Insert Message Here")),
5085
+ /* @__PURE__ */ import_react35.default.createElement("div", { style: { gridColumnStart: 6 } }, " ", /* @__PURE__ */ import_react35.default.createElement(import_IconButton2.default, { size: "small", "aria-label": "close", color: "inherit" }, /* @__PURE__ */ import_react35.default.createElement(import_Close3.default, { fontSize: "small" })))
5088
5086
  )
5089
5087
  }
5090
5088
  )
5091
5089
  );
5092
- };
5090
+ }
5091
+
5092
+ // src/components/snackbars/TestSnackbar.tsx
5093
+ var import_material15 = require("@mui/material");
5094
+ var import_react36 = __toESM(require("react"));
5095
+ var import_Close4 = __toESM(require("@mui/icons-material/Close"));
5096
+ function TestSnackbar({ openProp, toggleOpen }) {
5097
+ const [open, setOpen] = import_react36.default.useState(openProp);
5098
+ const handleClose = (event, reason) => {
5099
+ if (reason === "clickaway") {
5100
+ return;
5101
+ }
5102
+ toggleOpen(false);
5103
+ };
5104
+ const action = /* @__PURE__ */ import_react36.default.createElement(import_react36.default.Fragment, null, /* @__PURE__ */ import_react36.default.createElement(import_material15.Button, { color: "secondary", size: "small", onClick: handleClose }, "UNDO"), /* @__PURE__ */ import_react36.default.createElement(import_material15.IconButton, { size: "small", "aria-label": "close", color: "inherit", onClick: handleClose }, /* @__PURE__ */ import_react36.default.createElement(import_Close4.default, { fontSize: "small" })));
5105
+ return /* @__PURE__ */ import_react36.default.createElement(import_react36.default.Fragment, null, /* @__PURE__ */ import_react36.default.createElement(import_material15.Snackbar, { open: openProp, autoHideDuration: 6e3, onClose: handleClose, message: "Note archived", action }));
5106
+ }
5093
5107
  // Annotate the CommonJS export names for ESM import in node:
5094
5108
  0 && (module.exports = {
5095
5109
  AceOfSpadesComponent,
@@ -5107,6 +5121,7 @@ var WavelengthStandardSnackbar = (props) => {
5107
5121
  SearchTextField,
5108
5122
  SquadronIcon,
5109
5123
  SwarmIcon,
5124
+ TestSnackbar,
5110
5125
  WavelengthAppTheme,
5111
5126
  WavelengthAutocomplete,
5112
5127
  WavelengthBannerHeader,