@wavelengthusaf/components 1.3.0 → 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/LICENSE +21 -0
- package/README.md +4 -0
- package/dist/index.d.mts +30 -4
- package/dist/index.d.ts +30 -4
- package/dist/index.js +131 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +128 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1354,7 +1354,7 @@ function getPalette() {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
|
|
1356
1356
|
// src/components/buttons/WavelengthButton/WavelengthButton.tsx
|
|
1357
|
-
function WavelengthButton({ id, variant, colorOne, colorTwo, margin: margin2, padding: padding2, autoFocus, disabled, onClick, children, borderRadius: borderRadius2 }) {
|
|
1357
|
+
function WavelengthButton({ id, variant, colorOne, colorTwo, margin: margin2, padding: padding2, autoFocus, disabled, onClick, children, borderRadius: borderRadius2, mySx }) {
|
|
1358
1358
|
const palette2 = getPalette();
|
|
1359
1359
|
const WLContainedButton = {
|
|
1360
1360
|
margin: { margin: margin2 },
|
|
@@ -1402,6 +1402,9 @@ function WavelengthButton({ id, variant, colorOne, colorTwo, margin: margin2, pa
|
|
|
1402
1402
|
if (variant === "outlined") {
|
|
1403
1403
|
return /* @__PURE__ */ React.createElement(Button, { variant: "outlined", id, autoFocus, disabled, onClick, sx: WLOutlinedButton }, children);
|
|
1404
1404
|
}
|
|
1405
|
+
if (variant === "custom") {
|
|
1406
|
+
return /* @__PURE__ */ React.createElement(Button, { id, autoFocus, disabled, onClick, sx: mySx }, children);
|
|
1407
|
+
}
|
|
1405
1408
|
return /* @__PURE__ */ React.createElement(Button, { variant: "text", id, autoFocus, disabled, onClick, sx: WLTextButton }, children);
|
|
1406
1409
|
}
|
|
1407
1410
|
|
|
@@ -2989,7 +2992,7 @@ function WavelengthFileDownloader({ fileLoc, fileURL, fileName, button }) {
|
|
|
2989
2992
|
// src/components/containers/WavelengthBox/WavelengthBox.tsx
|
|
2990
2993
|
import React5 from "react";
|
|
2991
2994
|
import Grid from "@mui/material/Grid";
|
|
2992
|
-
function WavelengthBox({ width: width2, height: height2, children }) {
|
|
2995
|
+
function WavelengthBox({ width: width2, height: height2, children, borderBottomRadius, borderTopRadius }) {
|
|
2993
2996
|
const palette2 = getPalette();
|
|
2994
2997
|
return (
|
|
2995
2998
|
// <div
|
|
@@ -3013,7 +3016,10 @@ function WavelengthBox({ width: width2, height: height2, children }) {
|
|
|
3013
3016
|
sx: {
|
|
3014
3017
|
width: { width: width2 },
|
|
3015
3018
|
height: { height: height2 },
|
|
3016
|
-
|
|
3019
|
+
borderTopLeftRadius: borderTopRadius,
|
|
3020
|
+
borderTopRightRadius: borderTopRadius,
|
|
3021
|
+
borderBottomLeftRadius: borderBottomRadius,
|
|
3022
|
+
borderBottomRightRadius: borderBottomRadius,
|
|
3017
3023
|
borderColor: "#70714B",
|
|
3018
3024
|
bgcolor: palette2.primary,
|
|
3019
3025
|
border: "1px solid grey"
|
|
@@ -5015,8 +5021,110 @@ function WavelengthPopUpMenu({ menuItems, customIcon = false, width: width2, men
|
|
|
5015
5021
|
));
|
|
5016
5022
|
}
|
|
5017
5023
|
|
|
5018
|
-
// src/components/
|
|
5024
|
+
// src/components/modals/WavelengthDropdown.tsx
|
|
5019
5025
|
import React33 from "react";
|
|
5026
|
+
import { Menu as MuiMenu } from "@mui/material";
|
|
5027
|
+
import { MenuItem as MuiMenuItem, styled as styled5 } from "@mui/material";
|
|
5028
|
+
import Grow from "@mui/material/Grow";
|
|
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
|
+
}
|
|
5073
|
+
const MenuItem2 = styled5(MuiMenuItem)({
|
|
5074
|
+
"&.MuiMenuItem-root": {
|
|
5075
|
+
"&.Mui-selected": {
|
|
5076
|
+
backgroundColor: `${myMenusx.backgroundColor}`
|
|
5077
|
+
},
|
|
5078
|
+
"&:hover": {
|
|
5079
|
+
backgroundColor: `${myMenusx.hoverColor}`
|
|
5080
|
+
}
|
|
5081
|
+
}
|
|
5082
|
+
});
|
|
5083
|
+
const MyMenu = styled5(MuiMenu)({
|
|
5084
|
+
top: "-7px",
|
|
5085
|
+
left: "0px",
|
|
5086
|
+
boxSizing: "border-box",
|
|
5087
|
+
"& .MuiMenu-paper": {
|
|
5088
|
+
borderBottomLeftRadius: "8px",
|
|
5089
|
+
borderBottomRightRadius: "8px",
|
|
5090
|
+
borderTopRightRadius: "0px",
|
|
5091
|
+
borderTopLeftRadius: "0px",
|
|
5092
|
+
width: myMenusx.width,
|
|
5093
|
+
backgroundColor: `${myMenusx.backgroundColor}`
|
|
5094
|
+
},
|
|
5095
|
+
"& .MuiMenu-list": {
|
|
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}`
|
|
5103
|
+
}
|
|
5104
|
+
});
|
|
5105
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(WavelengthButton, { variant: "custom", mySx: myButtonSx, onClick: handleClick }, buttonText), /* @__PURE__ */ React33.createElement(
|
|
5106
|
+
MyMenu,
|
|
5107
|
+
{
|
|
5108
|
+
id,
|
|
5109
|
+
anchorEl,
|
|
5110
|
+
open,
|
|
5111
|
+
onClose: handleClose,
|
|
5112
|
+
MenuListProps: {
|
|
5113
|
+
"aria-labelledby": "basic-button"
|
|
5114
|
+
},
|
|
5115
|
+
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
5116
|
+
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
5117
|
+
TransitionComponent: Grow
|
|
5118
|
+
},
|
|
5119
|
+
options.map((item, index) => {
|
|
5120
|
+
return /* @__PURE__ */ React33.createElement(MenuItem2, { key: index, onClick: item.onClick }, item.option);
|
|
5121
|
+
})
|
|
5122
|
+
));
|
|
5123
|
+
}
|
|
5124
|
+
var WavelengthDropdownStyled = styled5(WavelengthDropdown)``;
|
|
5125
|
+
|
|
5126
|
+
// src/components/snackbars/WavelengthSnackbar.tsx
|
|
5127
|
+
import React34 from "react";
|
|
5020
5128
|
import Snackbar from "@mui/material/Snackbar";
|
|
5021
5129
|
import SnackbarContent from "@mui/material/SnackbarContent";
|
|
5022
5130
|
function WavelengthSnackbar(props) {
|
|
@@ -5026,7 +5134,7 @@ function WavelengthSnackbar(props) {
|
|
|
5026
5134
|
};
|
|
5027
5135
|
const palette2 = getPalette();
|
|
5028
5136
|
const durationMs = props.durationSb ? props.durationSb * 1e3 : 4e3;
|
|
5029
|
-
return /* @__PURE__ */
|
|
5137
|
+
return /* @__PURE__ */ React34.createElement(
|
|
5030
5138
|
Snackbar,
|
|
5031
5139
|
{
|
|
5032
5140
|
open: show,
|
|
@@ -5037,7 +5145,7 @@ function WavelengthSnackbar(props) {
|
|
|
5037
5145
|
horizontal: props.horryAlign ? props.horryAlign : "center"
|
|
5038
5146
|
}
|
|
5039
5147
|
},
|
|
5040
|
-
/* @__PURE__ */
|
|
5148
|
+
/* @__PURE__ */ React34.createElement(
|
|
5041
5149
|
SnackbarContent,
|
|
5042
5150
|
{
|
|
5043
5151
|
style: {
|
|
@@ -5046,15 +5154,15 @@ function WavelengthSnackbar(props) {
|
|
|
5046
5154
|
display: "flex",
|
|
5047
5155
|
width: props.width
|
|
5048
5156
|
},
|
|
5049
|
-
message: /* @__PURE__ */
|
|
5050
|
-
action: /* @__PURE__ */
|
|
5157
|
+
message: /* @__PURE__ */ React34.createElement("div", null, /* @__PURE__ */ React34.createElement("span", null, props.icon), /* @__PURE__ */ React34.createElement("span", { id: "snackbar" }, props.message ? props.message : "Insert Message Here")),
|
|
5158
|
+
action: /* @__PURE__ */ React34.createElement("div", { style: { display: "flex", justifyContent: "center" }, onClick: handleClose }, props.closeIcon)
|
|
5051
5159
|
}
|
|
5052
5160
|
)
|
|
5053
5161
|
);
|
|
5054
5162
|
}
|
|
5055
5163
|
|
|
5056
5164
|
// src/components/snackbars/WavelengthStandardSnackbar.tsx
|
|
5057
|
-
import
|
|
5165
|
+
import React35 from "react";
|
|
5058
5166
|
import Snackbar2 from "@mui/material/Snackbar";
|
|
5059
5167
|
import SnackbarContent2 from "@mui/material/SnackbarContent";
|
|
5060
5168
|
function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign, durationSb, width: width2, message, customVertyAlign, toggleShow, closeIcon }) {
|
|
@@ -5071,7 +5179,7 @@ function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign,
|
|
|
5071
5179
|
bgColor = "#737373";
|
|
5072
5180
|
}
|
|
5073
5181
|
const sIcon = icon ? icon : "";
|
|
5074
|
-
return /* @__PURE__ */
|
|
5182
|
+
return /* @__PURE__ */ React35.createElement(
|
|
5075
5183
|
Snackbar2,
|
|
5076
5184
|
{
|
|
5077
5185
|
sx: { marginTop: customVertyAlign ? `${customVertyAlign}` : "", zIndex: 1400 },
|
|
@@ -5083,7 +5191,7 @@ function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign,
|
|
|
5083
5191
|
horizontal: horryAlign ? horryAlign : "center"
|
|
5084
5192
|
}
|
|
5085
5193
|
},
|
|
5086
|
-
/* @__PURE__ */
|
|
5194
|
+
/* @__PURE__ */ React35.createElement(
|
|
5087
5195
|
SnackbarContent2,
|
|
5088
5196
|
{
|
|
5089
5197
|
style: {
|
|
@@ -5092,7 +5200,7 @@ function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign,
|
|
|
5092
5200
|
//color: props.textColor ? props.textColor : palette.secondary,
|
|
5093
5201
|
},
|
|
5094
5202
|
sx: { paddingTop: "0px", paddingBottom: "0px" },
|
|
5095
|
-
message: /* @__PURE__ */
|
|
5203
|
+
message: /* @__PURE__ */ React35.createElement(
|
|
5096
5204
|
"div",
|
|
5097
5205
|
{
|
|
5098
5206
|
style: {
|
|
@@ -5101,8 +5209,8 @@ function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign,
|
|
|
5101
5209
|
width: width2
|
|
5102
5210
|
}
|
|
5103
5211
|
},
|
|
5104
|
-
/* @__PURE__ */
|
|
5105
|
-
/* @__PURE__ */
|
|
5212
|
+
/* @__PURE__ */ React35.createElement("div", { style: { marginTop: 4, gridColumnStart: 2, gridColumnEnd: 5, textAlign: "center", display: "flex", flexDirection: "row", justifyContent: "center" }, id: "snackbar" }, /* @__PURE__ */ React35.createElement("div", null, sIcon), /* @__PURE__ */ React35.createElement("div", { style: { fontSize: "1rem", marginLeft: "10px" } }, message ? message : "Insert Message Here")),
|
|
5213
|
+
/* @__PURE__ */ React35.createElement("div", { style: { gridColumnStart: 6 }, onClick: handleClose }, closeIcon)
|
|
5106
5214
|
)
|
|
5107
5215
|
}
|
|
5108
5216
|
)
|
|
@@ -5112,7 +5220,7 @@ function WavelengthStandardSnackbar({ type, show, icon, horryAlign, vertyAlign,
|
|
|
5112
5220
|
// src/components/snackbars/TestSnackbar.tsx
|
|
5113
5221
|
import Box5 from "@mui/material/Box";
|
|
5114
5222
|
import Button5 from "@mui/material/Button";
|
|
5115
|
-
import
|
|
5223
|
+
import React36, { useEffect, useRef as useRef2 } from "react";
|
|
5116
5224
|
var useOutsideClick = (callback) => {
|
|
5117
5225
|
const ref = useRef2(null);
|
|
5118
5226
|
useEffect(() => {
|
|
@@ -5142,7 +5250,7 @@ function TestSnackbar({ isPopUpOpen, toggleOpen, type, message, customVertyAlign
|
|
|
5142
5250
|
} else if (type == "disabled") {
|
|
5143
5251
|
bgColor = "#737373";
|
|
5144
5252
|
}
|
|
5145
|
-
return /* @__PURE__ */
|
|
5253
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, isPopUpOpen && /* @__PURE__ */ React36.createElement(
|
|
5146
5254
|
Box5,
|
|
5147
5255
|
{
|
|
5148
5256
|
sx: { position: "fixed", right: "auto", top: "24px", left: "50%", transform: "translateX(-50%)" },
|
|
@@ -5161,9 +5269,9 @@ function TestSnackbar({ isPopUpOpen, toggleOpen, type, message, customVertyAlign
|
|
|
5161
5269
|
marginTop: customVertyAlign ? `${customVertyAlign}` : ""
|
|
5162
5270
|
}
|
|
5163
5271
|
},
|
|
5164
|
-
/* @__PURE__ */
|
|
5165
|
-
/* @__PURE__ */
|
|
5166
|
-
/* @__PURE__ */
|
|
5272
|
+
/* @__PURE__ */ React36.createElement("div", { style: { backgroundColor: "red" } }),
|
|
5273
|
+
/* @__PURE__ */ React36.createElement("div", { style: { color: "white", fontSize: "1rem" } }, message),
|
|
5274
|
+
/* @__PURE__ */ React36.createElement(
|
|
5167
5275
|
Button5,
|
|
5168
5276
|
{
|
|
5169
5277
|
variant: "text",
|
|
@@ -5200,6 +5308,7 @@ export {
|
|
|
5200
5308
|
WavelengthConfirmationModal,
|
|
5201
5309
|
WavelengthContentModal,
|
|
5202
5310
|
WavelengthContentPlaceholder,
|
|
5311
|
+
WavelengthDropdown,
|
|
5203
5312
|
WavelengthDropdownButton,
|
|
5204
5313
|
WavelengthExampleComponent,
|
|
5205
5314
|
WavelengthFileDownloader,
|