@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/README.md CHANGED
@@ -14,6 +14,10 @@ npm install @wavelengthusaf/components
14
14
 
15
15
  ## Release Notes
16
16
 
17
+ ## 1.3.1
18
+
19
+ -Updated WavelengthBox Component, and Wavelength Button Component. Created new Dropdown Component called Wavelength Dropdown.
20
+
17
21
  ## 1.3.0
18
22
 
19
23
  - Updated Footer and Snackbar component, added a basic File Download component.
package/dist/index.d.mts CHANGED
@@ -326,21 +326,24 @@ declare function WavelengthPopUpMenu({ menuItems, customIcon, width, menuDirecti
326
326
 
327
327
  interface DropdownProps {
328
328
  id?: string;
329
- button: React__default.ReactNode;
329
+ palette: "brewery" | "custom";
330
330
  width: string;
331
- borderColor?: string;
332
- backgroundColor?: string;
333
- hoverColor?: string;
334
331
  options: menuOptions[];
335
- anchor: HTMLElement | null;
336
- handleClose: () => void;
337
- mySx?: SxProps$1<Theme$1> | undefined;
332
+ buttonSx?: SxProps$1<Theme$1> | undefined;
333
+ menuSx?: MenuSxProps;
334
+ buttonText: string | ReactNode;
338
335
  }
339
336
  interface menuOptions {
340
337
  option: React__default.ReactNode;
341
338
  onClick?: React__default.MouseEventHandler<HTMLLIElement> | undefined;
342
339
  }
343
- declare function WavelengthDropdown({ id, width, options, borderColor, backgroundColor, anchor, handleClose, button, mySx, hoverColor }: DropdownProps): React__default.JSX.Element;
340
+ interface MenuSxProps {
341
+ backgroundColor?: string;
342
+ borderColor?: string;
343
+ hoverColor?: string;
344
+ width?: string;
345
+ }
346
+ declare function WavelengthDropdown({ id, options, buttonSx, width, buttonText, menuSx, palette }: DropdownProps): React__default.JSX.Element;
344
347
 
345
348
  interface ConfirmationSnackbarProps {
346
349
  show: boolean;
package/dist/index.d.ts CHANGED
@@ -326,21 +326,24 @@ declare function WavelengthPopUpMenu({ menuItems, customIcon, width, menuDirecti
326
326
 
327
327
  interface DropdownProps {
328
328
  id?: string;
329
- button: React__default.ReactNode;
329
+ palette: "brewery" | "custom";
330
330
  width: string;
331
- borderColor?: string;
332
- backgroundColor?: string;
333
- hoverColor?: string;
334
331
  options: menuOptions[];
335
- anchor: HTMLElement | null;
336
- handleClose: () => void;
337
- mySx?: SxProps$1<Theme$1> | undefined;
332
+ buttonSx?: SxProps$1<Theme$1> | undefined;
333
+ menuSx?: MenuSxProps;
334
+ buttonText: string | ReactNode;
338
335
  }
339
336
  interface menuOptions {
340
337
  option: React__default.ReactNode;
341
338
  onClick?: React__default.MouseEventHandler<HTMLLIElement> | undefined;
342
339
  }
343
- declare function WavelengthDropdown({ id, width, options, borderColor, backgroundColor, anchor, handleClose, button, mySx, hoverColor }: DropdownProps): React__default.JSX.Element;
340
+ interface MenuSxProps {
341
+ backgroundColor?: string;
342
+ borderColor?: string;
343
+ hoverColor?: string;
344
+ width?: string;
345
+ }
346
+ declare function WavelengthDropdown({ id, options, buttonSx, width, buttonText, menuSx, palette }: DropdownProps): React__default.JSX.Element;
344
347
 
345
348
  interface ConfirmationSnackbarProps {
346
349
  show: boolean;
package/dist/index.js CHANGED
@@ -5082,41 +5082,87 @@ var import_react37 = __toESM(require("react"));
5082
5082
  var import_material = require("@mui/material");
5083
5083
  var import_material2 = require("@mui/material");
5084
5084
  var import_Grow = __toESM(require("@mui/material/Grow"));
5085
- function WavelengthDropdown({ id, width: width2, options, borderColor: borderColor2, backgroundColor: backgroundColor2, anchor, handleClose, button, mySx, hoverColor }) {
5086
- const open = Boolean(anchor);
5085
+ function WavelengthDropdown({ id, options, buttonSx, width: width2, buttonText, menuSx, palette: palette2 }) {
5086
+ const [anchorEl, setAnchorEl] = import_react37.default.useState(null);
5087
+ const open = Boolean(anchorEl);
5088
+ const handleClick = (event) => {
5089
+ setAnchorEl(event.currentTarget);
5090
+ };
5091
+ const handleClose = () => {
5092
+ setAnchorEl(null);
5093
+ };
5094
+ const breweryStyleButton = {
5095
+ backgroundColor: "#d16a2f",
5096
+ color: "white",
5097
+ padding: "12px 16px",
5098
+ width: width2,
5099
+ fontSize: "18px",
5100
+ minWidth: "min-content",
5101
+ borderTopRightRadius: "8px",
5102
+ borderTopLeftRadius: "8px",
5103
+ "&:hover": {
5104
+ backgroundColor: "rgba(228, 119, 57, 1)"
5105
+ }
5106
+ };
5107
+ const breweryDropDownStyle = {
5108
+ backgroundColor: "#FCFAF8",
5109
+ borderColor: "#d16a2f",
5110
+ hoverColor: "rgba(209, 106, 47, 0.1)",
5111
+ width: width2
5112
+ };
5113
+ const defaultDropdownSx = {
5114
+ backgroundColor: "white",
5115
+ borderColor: "blue",
5116
+ hoverColor: "#d4d4e3",
5117
+ width: width2
5118
+ };
5119
+ const defaultsx = menuSx ? __spreadValues(__spreadValues({}, defaultDropdownSx), menuSx) : defaultDropdownSx;
5120
+ let myButtonSx;
5121
+ let myMenusx;
5122
+ if (palette2 === "brewery") {
5123
+ myButtonSx = __spreadValues(__spreadValues({}, breweryStyleButton), buttonSx);
5124
+ myMenusx = __spreadValues(__spreadValues({}, breweryDropDownStyle), menuSx);
5125
+ } else {
5126
+ myButtonSx = buttonSx;
5127
+ myMenusx = defaultsx;
5128
+ }
5087
5129
  const MenuItem2 = (0, import_material2.styled)(import_material2.MenuItem)({
5088
5130
  "&.MuiMenuItem-root": {
5089
5131
  "&.Mui-selected": {
5090
- backgroundColor: `${backgroundColor2}`
5132
+ backgroundColor: `${myMenusx.backgroundColor}`
5091
5133
  },
5092
5134
  "&:hover": {
5093
- backgroundColor: `${hoverColor}`
5135
+ backgroundColor: `${myMenusx.hoverColor}`
5094
5136
  }
5095
5137
  }
5096
5138
  });
5097
5139
  const MyMenu = (0, import_material2.styled)(import_material.Menu)({
5140
+ top: "-7px",
5141
+ left: "0px",
5142
+ boxSizing: "border-box",
5098
5143
  "& .MuiMenu-paper": {
5099
5144
  borderBottomLeftRadius: "8px",
5100
5145
  borderBottomRightRadius: "8px",
5101
5146
  borderTopRightRadius: "0px",
5102
5147
  borderTopLeftRadius: "0px",
5103
- backgroundColor: `${backgroundColor2}`
5148
+ width: myMenusx.width,
5149
+ backgroundColor: `${myMenusx.backgroundColor}`
5104
5150
  },
5105
5151
  "& .MuiMenu-list": {
5106
- width: width2,
5107
- borderLeft: `1px solid ${borderColor2}`,
5108
- borderRight: `1px solid ${borderColor2}`,
5109
- borderBottom: `1px solid ${borderColor2}`,
5110
- paddingTop: "6px",
5111
- paddingBottom: "6px"
5152
+ // paddingTop: "6px",
5153
+ // paddingBottom: "6px",
5154
+ borderBottomLeftRadius: "8px",
5155
+ borderBottomRightRadius: "8px",
5156
+ borderLeft: `1px solid ${myMenusx.borderColor}`,
5157
+ borderRight: `1px solid ${myMenusx.borderColor}`,
5158
+ borderBottom: `1px solid ${myMenusx.borderColor}`
5112
5159
  }
5113
5160
  });
5114
- return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, /* @__PURE__ */ import_react37.default.createElement("div", null, button), /* @__PURE__ */ import_react37.default.createElement(
5161
+ return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, /* @__PURE__ */ import_react37.default.createElement(WavelengthButton, { variant: "custom", mySx: myButtonSx, onClick: handleClick }, buttonText), /* @__PURE__ */ import_react37.default.createElement(
5115
5162
  MyMenu,
5116
5163
  {
5117
5164
  id,
5118
- sx: mySx,
5119
- anchorEl: anchor,
5165
+ anchorEl,
5120
5166
  open,
5121
5167
  onClose: handleClose,
5122
5168
  MenuListProps: {