@wavelengthusaf/components 1.3.1 → 1.3.2

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
@@ -5026,41 +5026,87 @@ import React33 from "react";
5026
5026
  import { Menu as MuiMenu } from "@mui/material";
5027
5027
  import { MenuItem as MuiMenuItem, styled as styled5 } from "@mui/material";
5028
5028
  import Grow from "@mui/material/Grow";
5029
- function WavelengthDropdown({ id, width: width2, options, borderColor: borderColor2, backgroundColor: backgroundColor2, anchor, handleClose, button, mySx, hoverColor }) {
5030
- const open = Boolean(anchor);
5029
+ function WavelengthDropdown({ id, options, buttonSx, width: width2, buttonText, menuSx, palette: palette2 }) {
5030
+ const [anchorEl, setAnchorEl] = React33.useState(null);
5031
+ const open = Boolean(anchorEl);
5032
+ const handleClick = (event) => {
5033
+ setAnchorEl(event.currentTarget);
5034
+ };
5035
+ const handleClose = () => {
5036
+ setAnchorEl(null);
5037
+ };
5038
+ const breweryStyleButton = {
5039
+ backgroundColor: "#d16a2f",
5040
+ color: "white",
5041
+ padding: "12px 16px",
5042
+ width: width2,
5043
+ fontSize: "18px",
5044
+ minWidth: "min-content",
5045
+ borderTopRightRadius: "8px",
5046
+ borderTopLeftRadius: "8px",
5047
+ "&:hover": {
5048
+ backgroundColor: "rgba(228, 119, 57, 1)"
5049
+ }
5050
+ };
5051
+ const breweryDropDownStyle = {
5052
+ backgroundColor: "#FCFAF8",
5053
+ borderColor: "#d16a2f",
5054
+ hoverColor: "rgba(209, 106, 47, 0.1)",
5055
+ width: width2
5056
+ };
5057
+ const defaultDropdownSx = {
5058
+ backgroundColor: "white",
5059
+ borderColor: "blue",
5060
+ hoverColor: "#d4d4e3",
5061
+ width: width2
5062
+ };
5063
+ const defaultsx = menuSx ? __spreadValues(__spreadValues({}, defaultDropdownSx), menuSx) : defaultDropdownSx;
5064
+ let myButtonSx;
5065
+ let myMenusx;
5066
+ if (palette2 === "brewery") {
5067
+ myButtonSx = __spreadValues(__spreadValues({}, breweryStyleButton), buttonSx);
5068
+ myMenusx = __spreadValues(__spreadValues({}, breweryDropDownStyle), menuSx);
5069
+ } else {
5070
+ myButtonSx = buttonSx;
5071
+ myMenusx = defaultsx;
5072
+ }
5031
5073
  const MenuItem2 = styled5(MuiMenuItem)({
5032
5074
  "&.MuiMenuItem-root": {
5033
5075
  "&.Mui-selected": {
5034
- backgroundColor: `${backgroundColor2}`
5076
+ backgroundColor: `${myMenusx.backgroundColor}`
5035
5077
  },
5036
5078
  "&:hover": {
5037
- backgroundColor: `${hoverColor}`
5079
+ backgroundColor: `${myMenusx.hoverColor}`
5038
5080
  }
5039
5081
  }
5040
5082
  });
5041
5083
  const MyMenu = styled5(MuiMenu)({
5084
+ top: "-7px",
5085
+ left: "0px",
5086
+ boxSizing: "border-box",
5042
5087
  "& .MuiMenu-paper": {
5043
5088
  borderBottomLeftRadius: "8px",
5044
5089
  borderBottomRightRadius: "8px",
5045
5090
  borderTopRightRadius: "0px",
5046
5091
  borderTopLeftRadius: "0px",
5047
- backgroundColor: `${backgroundColor2}`
5092
+ width: myMenusx.width,
5093
+ backgroundColor: `${myMenusx.backgroundColor}`
5048
5094
  },
5049
5095
  "& .MuiMenu-list": {
5050
- width: width2,
5051
- borderLeft: `1px solid ${borderColor2}`,
5052
- borderRight: `1px solid ${borderColor2}`,
5053
- borderBottom: `1px solid ${borderColor2}`,
5054
- paddingTop: "6px",
5055
- paddingBottom: "6px"
5096
+ // paddingTop: "6px",
5097
+ // paddingBottom: "6px",
5098
+ borderBottomLeftRadius: "8px",
5099
+ borderBottomRightRadius: "8px",
5100
+ borderLeft: `1px solid ${myMenusx.borderColor}`,
5101
+ borderRight: `1px solid ${myMenusx.borderColor}`,
5102
+ borderBottom: `1px solid ${myMenusx.borderColor}`
5056
5103
  }
5057
5104
  });
5058
- return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", null, button), /* @__PURE__ */ React33.createElement(
5105
+ return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(WavelengthButton, { variant: "custom", mySx: myButtonSx, onClick: handleClick }, buttonText), /* @__PURE__ */ React33.createElement(
5059
5106
  MyMenu,
5060
5107
  {
5061
5108
  id,
5062
- sx: mySx,
5063
- anchorEl: anchor,
5109
+ anchorEl,
5064
5110
  open,
5065
5111
  onClose: handleClose,
5066
5112
  MenuListProps: {