@vendorflow/components 1.1.26 → 2.0.0

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.
Files changed (43) hide show
  1. package/lib/components/material-ui/Button/Button.d.ts +3 -4
  2. package/lib/components/material-ui/Button/Button.js +11 -14
  3. package/lib/components/material-ui/Button/Button.story.d.ts +0 -1
  4. package/lib/components/material-ui/ButtonMenu/ButtonMenu.d.ts +5 -5
  5. package/lib/components/material-ui/ButtonMenu/ButtonMenu.js +4 -4
  6. package/lib/components/material-ui/ButtonMenu/ButtonMenu.story.d.ts +0 -1
  7. package/lib/components/material-ui/ChatInterface/ChatInterface.d.ts +0 -1
  8. package/lib/components/material-ui/ChatInterface/ChatInterface.js +1 -0
  9. package/lib/components/material-ui/ChatInterface/ChatInterface.story.d.ts +0 -1
  10. package/lib/components/material-ui/ChatInterface/ChatInterface.story.js +1 -0
  11. package/lib/components/material-ui/ChatInterface/MessageInput.js +5 -4
  12. package/lib/components/material-ui/ChatInterface/MessageItem.d.ts +0 -1
  13. package/lib/components/material-ui/ChatInterface/MessageItem.js +1 -0
  14. package/lib/components/material-ui/ChatInterface/MessageThread.js +1 -0
  15. package/lib/components/material-ui/InputCheckboxGroup/InputCheckboxGroup.d.ts +0 -1
  16. package/lib/components/material-ui/InputCheckboxGroup/InputCheckboxGroup.js +6 -6
  17. package/lib/components/material-ui/InputCheckboxGroup/InputCheckboxGroup.story.d.ts +0 -1
  18. package/lib/components/material-ui/InputDate/InputDate.d.ts +7 -6
  19. package/lib/components/material-ui/InputDate/InputDate.js +6 -5
  20. package/lib/components/material-ui/InputDate/InputDate.story.d.ts +0 -1
  21. package/lib/components/material-ui/InputDate/InputDate.story.js +3 -3
  22. package/lib/components/material-ui/InputDateTime/InputDateTime.d.ts +7 -6
  23. package/lib/components/material-ui/InputDateTime/InputDateTime.js +6 -5
  24. package/lib/components/material-ui/InputDateTime/InputDateTime.story.d.ts +0 -1
  25. package/lib/components/material-ui/InputDateTime/InputDateTime.story.js +3 -3
  26. package/lib/components/material-ui/InputGroup/InputGroup.d.ts +3 -4
  27. package/lib/components/material-ui/InputGroup/InputGroup.js +6 -5
  28. package/lib/components/material-ui/InputGroup/InputGroup.story.d.ts +0 -1
  29. package/lib/components/material-ui/InputRadioGroup/InputRadioGroup.d.ts +0 -1
  30. package/lib/components/material-ui/InputRadioGroup/InputRadioGroup.js +7 -7
  31. package/lib/components/material-ui/InputRadioGroup/InputRadioGroup.story.d.ts +0 -1
  32. package/lib/components/material-ui/InputSearchDropdown/InputSearchDropdown.d.ts +8 -8
  33. package/lib/components/material-ui/InputSearchDropdown/InputSearchDropdown.js +19 -19
  34. package/lib/components/material-ui/InputSearchDropdown/InputSearchDropdown.story.d.ts +0 -1
  35. package/lib/components/material-ui/InputTime/InputTime.d.ts +7 -7
  36. package/lib/components/material-ui/InputTime/InputTime.js +6 -5
  37. package/lib/components/material-ui/InputTime/InputTime.story.d.ts +0 -1
  38. package/lib/components/material-ui/InputTime/InputTime.story.js +3 -3
  39. package/lib/components/material-ui/Modal/Modal.d.ts +1 -1
  40. package/lib/components/material-ui/Modal/Modal.js +18 -14
  41. package/lib/components/material-ui/Modal/Modal.story.d.ts +0 -1
  42. package/lib/types/Component.types.d.ts +2 -1
  43. package/package.json +28 -31
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
- import { ButtonProps } from '@material-ui/core';
3
- declare type Props = ButtonProps & {
1
+ import { ButtonProps } from '@mui/material';
2
+ declare type Props = {
4
3
  loading?: boolean;
5
4
  progressClasses?: any;
6
- };
5
+ } & ButtonProps;
7
6
  export default function Button(props: Props): JSX.Element;
8
7
  export {};
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
2
6
  var __assign = (this && this.__assign) || function () {
3
7
  __assign = Object.assign || function(t) {
4
8
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -21,21 +25,14 @@ var __rest = (this && this.__rest) || function (s, e) {
21
25
  }
22
26
  return t;
23
27
  };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
28
  Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
29
- var core_1 = require("@material-ui/core");
30
- var styles_1 = require("@material-ui/core/styles");
31
- var useStyles = (0, styles_1.makeStyles)({
32
- root: {
33
- color: 'white',
34
- },
35
- });
29
+ /** @jsxRuntime classic */
30
+ /** @jsx jsx */
31
+ var react_1 = require("@emotion/react");
32
+ var material_1 = require("@mui/material");
36
33
  function Button(props) {
37
- var classes = useStyles();
38
- var children = props.children, disabled = props.disabled, loading = props.loading, progressClasses = props.progressClasses, _a = props.variant, variant = _a === void 0 ? 'contained' : _a, restOfProps = __rest(props, ["children", "disabled", "loading", "progressClasses", "variant"]);
39
- return (react_1.default.createElement(core_1.Button, __assign({ disabled: disabled || loading, variant: variant }, restOfProps), loading ? react_1.default.createElement(core_1.CircularProgress, { size: "1.6rem", classes: progressClasses || classes }) : children));
34
+ var children = props.children, disabled = props.disabled, loading = props.loading, _a = props.variant, variant = _a === void 0 ? 'contained' : _a, restOfProps = __rest(props, ["children", "disabled", "loading", "variant"]);
35
+ return ((0, react_1.jsx)(material_1.Button, __assign({ disabled: disabled || loading, variant: variant }, restOfProps), loading ? ((0, react_1.jsx)(material_1.CircularProgress, { css: (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n && {\n color: white;\n }\n "], ["\n && {\n color: white;\n }\n "]))), size: "1.6rem" })) : (children)));
40
36
  }
41
37
  exports.default = Button;
38
+ var templateObject_1;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Button: () => JSX.Element;
@@ -1,17 +1,17 @@
1
1
  import { ReactNode } from 'react';
2
- import { MenuProps } from '@material-ui/core';
3
- import { Color, MenuItem as MenuItemType } from 'types/Component.types';
2
+ import { ButtonProps, MenuProps } from '@mui/material';
3
+ import { MenuItem as MenuItemType } from 'types/Component.types';
4
4
  declare type Variant = 'text' | 'contained' | 'outlined' | undefined;
5
- interface Props extends Omit<MenuProps, 'open'> {
5
+ declare type Props = {
6
6
  buttonRenderer?: ReactNode | (() => ReactNode);
7
7
  button?: {
8
8
  text: string;
9
9
  variant?: Variant;
10
- color?: Color;
10
+ color?: ButtonProps['color'];
11
11
  classes?: any;
12
12
  };
13
13
  id: string;
14
14
  menuItems: MenuItemType[];
15
- }
15
+ } & Omit<MenuProps, 'open'>;
16
16
  export default function ButtonMenu(props: Props): JSX.Element;
17
17
  export {};
@@ -43,7 +43,7 @@ var __rest = (this && this.__rest) || function (s, e) {
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
44
  var react_1 = __importStar(require("react"));
45
45
  var lodash_1 = require("lodash");
46
- var core_1 = require("@material-ui/core");
46
+ var material_1 = require("@mui/material");
47
47
  function ButtonMenu(props) {
48
48
  var buttonRenderer = props.buttonRenderer, button = props.button, id = props.id, menuItems = props.menuItems, _a = props.anchorOrigin, anchorOrigin = _a === void 0 ? { vertical: 'bottom', horizontal: 'left' } : _a, _b = props.transformOrigin, transformOrigin = _b === void 0 ? { vertical: 'top', horizontal: 'left' } : _b, restOfProps = __rest(props, ["buttonRenderer", "button", "id", "menuItems", "anchorOrigin", "transformOrigin"]);
49
49
  var _c = (0, react_1.useState)(null), anchorEl = _c[0], setAnchorEl = _c[1];
@@ -54,7 +54,7 @@ function ButtonMenu(props) {
54
54
  function renderDefaultButton() {
55
55
  if (!!button) {
56
56
  var _a = button.text, text = _a === void 0 ? '' : _a, _b = button.variant, variant = _b === void 0 ? 'contained' : _b, _c = button.color, color = _c === void 0 ? 'primary' : _c, classes = button.classes;
57
- return (react_1.default.createElement(core_1.Button, { "aria-controls": id, "aria-haspopup": "true", classes: classes, color: color, variant: variant, onClick: onHandleOpen }, text));
57
+ return (react_1.default.createElement(material_1.Button, { "aria-controls": id, "aria-haspopup": "true", classes: classes, color: color, variant: variant, onClick: onHandleOpen }, text));
58
58
  }
59
59
  return null;
60
60
  }
@@ -91,11 +91,11 @@ function ButtonMenu(props) {
91
91
  item.onClick();
92
92
  setAnchorEl(null);
93
93
  }
94
- return (react_1.default.createElement(core_1.MenuItem, { key: id + "-menu-item-" + index, onClick: handleItemClick }, item.content));
94
+ return (react_1.default.createElement(material_1.MenuItem, { key: id + "-menu-item-" + index, onClick: handleItemClick }, item.content));
95
95
  });
96
96
  }
97
97
  function renderMenu() {
98
- return (react_1.default.createElement(core_1.Menu, __assign({}, restOfProps, { id: id, anchorEl: anchorEl, elevation: 4, keepMounted: true, open: open, getContentAnchorEl: null, onClose: function () { return setAnchorEl(null); }, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin }), renderMenuItems()));
98
+ return (react_1.default.createElement(material_1.Menu, __assign({}, restOfProps, { id: id, anchorEl: anchorEl, elevation: 4, keepMounted: true, open: open, onClose: function () { return setAnchorEl(null); }, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin }), renderMenuItems()));
99
99
  }
100
100
  return (react_1.default.createElement(react_1.default.Fragment, null,
101
101
  renderButton(),
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  export declare const ButtonMenuUsingDefault: () => JSX.Element;
3
2
  export declare const ButtonMenuUsingCustom: () => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface Message {
3
2
  id: string;
4
3
  userId: string;
@@ -43,6 +43,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
43
43
  return (mod && mod.__esModule) ? mod : { "default": mod };
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
+ /** @jsxRuntime classic */
46
47
  /** @jsx jsx */
47
48
  var react_1 = require("@emotion/react");
48
49
  var react_2 = require("react");
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function ChatInterface(): JSX.Element;
@@ -17,6 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.ChatInterface = void 0;
20
+ /** @jsxRuntime classic */
20
21
  /** @jsx jsx */
21
22
  var react_1 = require("@emotion/react");
22
23
  var react_2 = require("react");
@@ -7,11 +7,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
7
7
  return (mod && mod.__esModule) ? mod : { "default": mod };
8
8
  };
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
+ /** @jsxRuntime classic */
10
11
  /** @jsx jsx */
11
12
  var react_1 = require("@emotion/react");
12
13
  var react_textarea_autosize_1 = __importDefault(require("react-textarea-autosize"));
13
- var core_1 = require("@material-ui/core");
14
- var icons_1 = require("@material-ui/icons");
14
+ var material_1 = require("@mui/material");
15
+ var icons_material_1 = require("@mui/icons-material");
15
16
  function MessageInput(_a) {
16
17
  var measureRef = _a.measureRef, handleClickSend = _a.handleClickSend, message = _a.message, setMessage = _a.setMessage, submitting = _a.submitting;
17
18
  function handleOnChange(_a) {
@@ -37,8 +38,8 @@ function MessageInput(_a) {
37
38
  }
38
39
  return ((0, react_1.jsx)("div", { ref: measureRef, css: (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n background-color: white;\n bottom: 0;\n left: 0;\n position: absolute;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n "], ["\n width: 100%;\n background-color: white;\n bottom: 0;\n left: 0;\n position: absolute;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n "]))) },
39
40
  (0, react_1.jsx)(react_textarea_autosize_1.default, { css: (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',\n 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n border: none;\n resize: none;\n width: calc(100% - 2.5rem);\n outline: 0 none transparent;\n font-size: 16px;\n\n &:focus {\n border: none;\n }\n &:focus-visible {\n border: none;\n }\n "], ["\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',\n 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n border: none;\n resize: none;\n width: calc(100% - 2.5rem);\n outline: 0 none transparent;\n font-size: 16px;\n\n &:focus {\n border: none;\n }\n &:focus-visible {\n border: none;\n }\n "]))), placeholder: "Type your message here...", value: message, onChange: handleOnChange, onKeyDown: handleOnKeyDown, minRows: 3, maxRows: 8 }),
40
- (0, react_1.jsx)("div", { css: (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 2rem;\n width: 2rem;\n padding-right: ", ";\n "], ["\n height: 2rem;\n width: 2rem;\n padding-right: ", ";\n "])), submitting ? '0.5rem' : '0.25rem') }, submitting ? ((0, react_1.jsx)(core_1.CircularProgress, { size: "2rem" })) : ((0, react_1.jsx)(core_1.IconButton, { css: (0, react_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n "], ["\n height: 100%;\n width: 100%;\n "]))), onClick: handleOnClickSend, disabled: submitting },
41
- (0, react_1.jsx)(icons_1.Send, null))))));
41
+ (0, react_1.jsx)("div", { css: (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 2rem;\n width: 2rem;\n padding-right: ", ";\n "], ["\n height: 2rem;\n width: 2rem;\n padding-right: ", ";\n "])), submitting ? '0.5rem' : '0.25rem') }, submitting ? ((0, react_1.jsx)(material_1.CircularProgress, { size: "2rem" })) : ((0, react_1.jsx)(material_1.IconButton, { css: (0, react_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n "], ["\n height: 100%;\n width: 100%;\n "]))), onClick: handleOnClickSend, disabled: submitting },
42
+ (0, react_1.jsx)(icons_material_1.Send, null))))));
42
43
  }
43
44
  exports.default = MessageInput;
44
45
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Message } from './ChatInterface';
3
2
  interface Props {
4
3
  userId: string;
@@ -4,6 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
4
4
  return cooked;
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ /** @jsxRuntime classic */
7
8
  /** @jsx jsx */
8
9
  var react_1 = require("@emotion/react");
9
10
  var date_fns_1 = require("date-fns");
@@ -7,6 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
7
7
  return (mod && mod.__esModule) ? mod : { "default": mod };
8
8
  };
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
+ /** @jsxRuntime classic */
10
11
  /** @jsx jsx */
11
12
  var react_1 = require("@emotion/react");
12
13
  var MessageItem_1 = __importDefault(require("./MessageItem"));
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BasicOption, Color, SimpleEventHandler } from 'types';
3
2
  interface Props {
4
3
  className?: string;
@@ -25,7 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
25
25
  var react_1 = __importStar(require("react"));
26
26
  var immer_1 = __importDefault(require("immer"));
27
27
  var lodash_1 = require("lodash");
28
- var core_1 = require("@material-ui/core");
28
+ var material_1 = require("@mui/material");
29
29
  function InputCheckboxGroup(props) {
30
30
  var className = props.className, style = props.style, _a = props.color, color = _a === void 0 ? 'primary' : _a, disabled = props.disabled, error = props.error, helperText = props.helperText, label = props.label, name = props.name, onChange = props.onChange, options = props.options, _b = props.multi, multi = _b === void 0 ? true : _b;
31
31
  var _c = (0, react_1.useState)({}), values = _c[0], setValues = _c[1];
@@ -72,12 +72,12 @@ function InputCheckboxGroup(props) {
72
72
  function renderOptions() {
73
73
  return options.map(function (_a) {
74
74
  var label = _a.label, value = _a.value;
75
- return (react_1.default.createElement(core_1.FormControlLabel, { key: label, label: label, control: react_1.default.createElement(core_1.Checkbox, { color: color, disabled: disabled, onChange: handleOnChange, checked: values[value] || false, name: label }) }));
75
+ return (react_1.default.createElement(material_1.FormControlLabel, { key: label, label: label, control: react_1.default.createElement(material_1.Checkbox, { color: color, disabled: disabled, onChange: handleOnChange, checked: values[value] || false, name: label }) }));
76
76
  });
77
77
  }
78
- return (react_1.default.createElement(core_1.FormControl, { className: className, style: style, component: "fieldset", error: error },
79
- react_1.default.createElement(core_1.FormLabel, { component: "legend" }, label),
80
- react_1.default.createElement(core_1.FormGroup, null, !(0, lodash_1.isEmpty)(options) ? renderOptions() : react_1.default.createElement("div", null)),
81
- react_1.default.createElement(core_1.FormHelperText, null, helperText)));
78
+ return (react_1.default.createElement(material_1.FormControl, { className: className, style: style, component: "fieldset", error: error },
79
+ react_1.default.createElement(material_1.FormLabel, { component: "legend" }, label),
80
+ react_1.default.createElement(material_1.FormGroup, null, !(0, lodash_1.isEmpty)(options) ? renderOptions() : react_1.default.createElement("div", null)),
81
+ react_1.default.createElement(material_1.FormHelperText, null, helperText)));
82
82
  }
83
83
  exports.default = InputCheckboxGroup;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const InputCheckboxGroup: () => JSX.Element;
@@ -1,8 +1,9 @@
1
- /// <reference types="react" />
2
- import { KeyboardDatePickerProps } from '@material-ui/pickers';
1
+ import React from 'react';
2
+ import { DatePickerProps } from '@mui/lab';
3
3
  import { SimpleEventHandler } from 'types';
4
- declare type Props<T> = Omit<KeyboardDatePickerProps, 'onChange'> & {
5
- onChange: SimpleEventHandler<T>;
6
- };
7
- export default function InputDate(props: Props<string>): JSX.Element;
4
+ declare type Props = {
5
+ name?: string;
6
+ onChange: SimpleEventHandler<string>;
7
+ } & Omit<DatePickerProps, 'onChange' | 'renderInput' | 'date' | 'rawValue' | 'openPicker'> & React.RefAttributes<HTMLDivElement>;
8
+ export default function InputDate(props: Props): JSX.Element;
8
9
  export {};
@@ -43,21 +43,22 @@ var __rest = (this && this.__rest) || function (s, e) {
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
44
  var react_1 = __importStar(require("react"));
45
45
  var date_fns_1 = require("date-fns");
46
- var pickers_1 = require("@material-ui/pickers");
46
+ var lab_1 = require("@mui/lab");
47
+ var material_1 = require("@mui/material");
47
48
  function InputDate(props) {
48
- var _a = props.autoOk, autoOk = _a === void 0 ? true : _a, _b = props.clearable, clearable = _b === void 0 ? true : _b, _c = props.format, format = _c === void 0 ? 'MM/dd/yyyy' : _c, _d = props.inputVariant, inputVariant = _d === void 0 ? 'outlined' : _d, label = props.label, name = props.name, onChange = props.onChange, _e = props.variant, variant = _e === void 0 ? 'inline' : _e, restOfProps = __rest(props, ["autoOk", "clearable", "format", "inputVariant", "label", "name", "onChange", "variant"]);
49
- var _f = (0, react_1.useState)(null), value = _f[0], setValue = _f[1];
49
+ var _a = props.clearable, clearable = _a === void 0 ? true : _a, label = props.label, name = props.name, onChange = props.onChange, _b = props.inputFormat, inputFormat = _b === void 0 ? 'MM/dd/yyyy' : _b, restOfProps = __rest(props, ["clearable", "label", "name", "onChange", "inputFormat"]);
50
+ var _c = (0, react_1.useState)(null), value = _c[0], setValue = _c[1];
50
51
  (0, react_1.useEffect)(function () {
51
52
  if (props.value !== value) {
52
53
  setValue(props.value);
53
54
  }
54
- }, [props.value]); // eslint-disable-line
55
+ }, [props.value]);
55
56
  function handleOnChange(date) {
56
57
  setValue(date);
57
58
  if (date === null || (0, date_fns_1.isValid)(date)) {
58
59
  onChange({ target: { name: name, value: date ? (0, date_fns_1.formatISO)(date) : null } });
59
60
  }
60
61
  }
61
- return (react_1.default.createElement(pickers_1.KeyboardDatePicker, __assign({}, restOfProps, { autoOk: autoOk, clearable: clearable, format: format, inputVariant: inputVariant, label: label, name: name, onChange: handleOnChange, value: value, variant: variant })));
62
+ return (react_1.default.createElement(lab_1.DatePicker, __assign({}, restOfProps, { clearable: clearable, inputFormat: inputFormat, renderInput: function (params) { return react_1.default.createElement(material_1.TextField, __assign({}, params)); }, label: label, onChange: handleOnChange, value: value })));
62
63
  }
63
64
  exports.default = InputDate;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const InputDate: () => JSX.Element;
@@ -24,12 +24,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.InputDate = void 0;
26
26
  var react_1 = __importStar(require("react"));
27
- var pickers_1 = require("@material-ui/pickers");
28
- var date_fns_1 = __importDefault(require("@date-io/date-fns"));
27
+ var lab_1 = require("@mui/lab");
28
+ var AdapterDateFns_1 = __importDefault(require("@mui/lab/AdapterDateFns"));
29
29
  var InputDate_1 = __importDefault(require("components/material-ui/InputDate"));
30
30
  var InputDate = function () {
31
31
  var _a = (0, react_1.useState)(null), value = _a[0], setValue = _a[1];
32
- return (react_1.default.createElement(pickers_1.MuiPickersUtilsProvider, { utils: date_fns_1.default },
32
+ return (react_1.default.createElement(lab_1.LocalizationProvider, { dateAdapter: AdapterDateFns_1.default },
33
33
  react_1.default.createElement(InputDate_1.default, { label: "Bedtime", value: value, onChange: function (_a) {
34
34
  var value = _a.target.value;
35
35
  return setValue(value);
@@ -1,8 +1,9 @@
1
- /// <reference types="react" />
2
- import { KeyboardDateTimePickerProps } from '@material-ui/pickers';
1
+ import React from 'react';
2
+ import { DateTimePickerProps } from '@mui/lab';
3
3
  import { SimpleEventHandler } from 'types';
4
- declare type Props<T> = Omit<KeyboardDateTimePickerProps, 'onChange'> & {
5
- onChange: SimpleEventHandler<T>;
6
- };
7
- export default function InputDateTime(props: Props<string>): JSX.Element;
4
+ declare type Props = {
5
+ name?: string;
6
+ onChange: SimpleEventHandler<string>;
7
+ } & Omit<DateTimePickerProps, 'onChange' | 'renderInput' | 'date' | 'rawValue' | 'openPicker'> & React.RefAttributes<HTMLDivElement>;
8
+ export default function InputDateTime(props: Props): JSX.Element;
8
9
  export {};
@@ -43,21 +43,22 @@ var __rest = (this && this.__rest) || function (s, e) {
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
44
  var react_1 = __importStar(require("react"));
45
45
  var date_fns_1 = require("date-fns");
46
- var pickers_1 = require("@material-ui/pickers");
46
+ var lab_1 = require("@mui/lab");
47
+ var material_1 = require("@mui/material");
47
48
  function InputDateTime(props) {
48
- var _a = props.autoOk, autoOk = _a === void 0 ? true : _a, _b = props.clearable, clearable = _b === void 0 ? true : _b, _c = props.format, format = _c === void 0 ? 'MM/dd/yyyy HH:mm' : _c, _d = props.inputVariant, inputVariant = _d === void 0 ? 'outlined' : _d, label = props.label, name = props.name, onChange = props.onChange, _e = props.variant, variant = _e === void 0 ? 'inline' : _e, restOfProps = __rest(props, ["autoOk", "clearable", "format", "inputVariant", "label", "name", "onChange", "variant"]);
49
- var _f = (0, react_1.useState)(null), value = _f[0], setValue = _f[1];
49
+ var _a = props.clearable, clearable = _a === void 0 ? true : _a, _b = props.inputFormat, inputFormat = _b === void 0 ? 'MM/dd/yyyy HH:mm' : _b, label = props.label, name = props.name, onChange = props.onChange, restOfProps = __rest(props, ["clearable", "inputFormat", "label", "name", "onChange"]);
50
+ var _c = (0, react_1.useState)(null), value = _c[0], setValue = _c[1];
50
51
  (0, react_1.useEffect)(function () {
51
52
  if (props.value !== value) {
52
53
  setValue(props.value);
53
54
  }
54
- }, [props.value]); // eslint-disable-line
55
+ }, [props.value]);
55
56
  function handleOnChange(date) {
56
57
  setValue(date);
57
58
  if (date === null || (0, date_fns_1.isValid)(date)) {
58
59
  onChange({ target: { name: name, value: date ? (0, date_fns_1.formatISO)(date) : null } });
59
60
  }
60
61
  }
61
- return (react_1.default.createElement(pickers_1.KeyboardDateTimePicker, __assign({}, restOfProps, { autoOk: autoOk, clearable: clearable, format: format, inputVariant: inputVariant, label: label, name: name, onChange: handleOnChange, value: value, variant: variant })));
62
+ return (react_1.default.createElement(lab_1.DateTimePicker, __assign({}, restOfProps, { clearable: clearable, inputFormat: inputFormat, label: label, onChange: handleOnChange, renderInput: function (params) { return react_1.default.createElement(material_1.TextField, __assign({}, params)); }, value: value })));
62
63
  }
63
64
  exports.default = InputDateTime;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const InputDateTime: () => JSX.Element;
@@ -24,12 +24,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.InputDateTime = void 0;
26
26
  var react_1 = __importStar(require("react"));
27
- var pickers_1 = require("@material-ui/pickers");
28
- var date_fns_1 = __importDefault(require("@date-io/date-fns"));
27
+ var lab_1 = require("@mui/lab");
29
28
  var InputDateTime_1 = __importDefault(require("components/material-ui/InputDateTime"));
29
+ var AdapterDateFns_1 = __importDefault(require("@mui/lab/AdapterDateFns"));
30
30
  var InputDateTime = function () {
31
31
  var _a = (0, react_1.useState)(null), value = _a[0], setValue = _a[1];
32
- return (react_1.default.createElement(pickers_1.MuiPickersUtilsProvider, { utils: date_fns_1.default },
32
+ return (react_1.default.createElement(lab_1.LocalizationProvider, { dateAdapter: AdapterDateFns_1.default },
33
33
  react_1.default.createElement(InputDateTime_1.default, { label: "Appointment", value: value, onChange: function (_a) {
34
34
  var value = _a.target.value;
35
35
  return setValue(value);
@@ -1,11 +1,10 @@
1
- /// <reference types="react" />
2
- import { TextFieldProps } from '@material-ui/core';
3
- declare type Props = TextFieldProps & {
1
+ import { TextFieldProps } from '@mui/material';
2
+ declare type Props = {
4
3
  value: string | null;
5
4
  charLimit?: number;
6
5
  hideCharCounter?: boolean;
7
6
  enableDebouncedOnChange?: boolean;
8
7
  changeValidator?: (value: string) => boolean;
9
- };
8
+ } & TextFieldProps;
10
9
  export default function InputGroup(props: Props): JSX.Element;
11
10
  export {};
@@ -26,11 +26,12 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  return t;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ /** @jsxRuntime classic */
29
30
  /** @jsx jsx */
30
31
  var react_1 = require("@emotion/react");
31
32
  var react_2 = require("react");
32
33
  var lodash_1 = require("lodash");
33
- var core_1 = require("@material-ui/core");
34
+ var material_1 = require("@mui/material");
34
35
  function InputGroup(props) {
35
36
  var changeValidator = props.changeValidator, charLimit = props.charLimit, className = props.className, hideCharCounter = props.hideCharCounter, _a = props.enableDebouncedOnChange, enableDebouncedOnChange = _a === void 0 ? true : _a, multiline = props.multiline, error = props.error, label = props.label, name = props.name, onChange = props.onChange, placeholder = props.placeholder, helperText = props.helperText, _b = props.variant, variant = _b === void 0 ? 'outlined' : _b, style = props.style, propsValue = props.value, restOfProps = __rest(props, ["changeValidator", "charLimit", "className", "hideCharCounter", "enableDebouncedOnChange", "multiline", "error", "label", "name", "onChange", "placeholder", "helperText", "variant", "style", "value"]);
36
37
  var _c = (0, react_2.useState)(''), value = _c[0], setValue = _c[1];
@@ -38,7 +39,7 @@ function InputGroup(props) {
38
39
  if (propsValue !== value) {
39
40
  setValue(propsValue || '');
40
41
  }
41
- }, [propsValue]); // eslint-disable-line
42
+ }, [propsValue]);
42
43
  var debouncedOnChangeHandler = (0, react_2.useCallback)((0, lodash_1.debounce)(function (evt) {
43
44
  if (onChange) {
44
45
  onChange(evt);
@@ -60,10 +61,10 @@ function InputGroup(props) {
60
61
  }
61
62
  }
62
63
  return ((0, react_1.jsx)("div", { className: className, style: style },
63
- (0, react_1.jsx)(core_1.TextField, __assign({ error: error, label: label, name: name, onChange: handleOnChange, placeholder: placeholder, value: value, variant: variant, multiline: multiline }, restOfProps)),
64
+ (0, react_1.jsx)(material_1.TextField, __assign({ error: error, label: label, name: name, onChange: handleOnChange, placeholder: placeholder, value: value, variant: variant, multiline: multiline }, restOfProps)),
64
65
  (0, react_1.jsx)("div", null,
65
- helperText && ((0, react_1.jsx)(core_1.Typography, { css: (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "], ["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "caption" }, helperText)),
66
- charLimit !== undefined && !hideCharCounter && ((0, react_1.jsx)(core_1.Typography, { css: (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "], ["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "subtitle1" },
66
+ helperText && ((0, react_1.jsx)(material_1.Typography, { css: (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "], ["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "caption" }, helperText)),
67
+ charLimit !== undefined && !hideCharCounter && ((0, react_1.jsx)(material_1.Typography, { css: (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "], ["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "subtitle1" },
67
68
  value.length,
68
69
  "/",
69
70
  charLimit)))));
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const InputGroup: () => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Color, BasicOption, SimpleEventHandler } from 'types/Component.types';
3
2
  interface Props {
4
3
  className?: string;
@@ -42,7 +42,7 @@ var __rest = (this && this.__rest) || function (s, e) {
42
42
  };
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
44
  var react_1 = __importStar(require("react"));
45
- var core_1 = require("@material-ui/core");
45
+ var material_1 = require("@mui/material");
46
46
  function InputRadioGroup(props) {
47
47
  var _a = props.color, color = _a === void 0 ? 'primary' : _a, disabled = props.disabled, error = props.error, helperText = props.helperText, label = props.label, name = props.name, onChange = props.onChange, options = props.options, _b = props.row, row = _b === void 0 ? false : _b, restOfProps = __rest(props, ["color", "disabled", "error", "helperText", "label", "name", "onChange", "options", "row"]);
48
48
  var _c = (0, react_1.useState)(null), value = _c[0], setValue = _c[1];
@@ -50,17 +50,17 @@ function InputRadioGroup(props) {
50
50
  if (props.value !== value) {
51
51
  setValue(props.value);
52
52
  }
53
- }, [props.value]); // eslint-disable-line
53
+ }, [props.value]);
54
54
  function handleOnChange(_, value) {
55
55
  setValue(value);
56
56
  onChange({ target: { name: name, value: value } });
57
57
  }
58
58
  function renderOptions() {
59
- return options.map(function (option) { return (react_1.default.createElement(core_1.FormControlLabel, { key: option.label, value: option.value, label: option.label, control: react_1.default.createElement(core_1.Radio, { color: color, disabled: disabled }) })); });
59
+ return options.map(function (option) { return (react_1.default.createElement(material_1.FormControlLabel, { key: option.label, value: option.value, label: option.label, control: react_1.default.createElement(material_1.Radio, { color: color, disabled: disabled }) })); });
60
60
  }
61
- return (react_1.default.createElement(core_1.FormControl, __assign({ component: "fieldset", error: error }, restOfProps),
62
- react_1.default.createElement(core_1.FormLabel, { component: "legend" }, label),
63
- react_1.default.createElement(core_1.RadioGroup, { name: name, value: value, onChange: handleOnChange, row: row }, renderOptions()),
64
- react_1.default.createElement(core_1.FormHelperText, null, helperText)));
61
+ return (react_1.default.createElement(material_1.FormControl, __assign({ component: "fieldset", error: error }, restOfProps),
62
+ react_1.default.createElement(material_1.FormLabel, { component: "legend" }, label),
63
+ react_1.default.createElement(material_1.RadioGroup, { name: name, value: value, onChange: handleOnChange, row: row }, renderOptions()),
64
+ react_1.default.createElement(material_1.FormHelperText, null, helperText)));
65
65
  }
66
66
  exports.default = InputRadioGroup;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const InputRadioGroup: () => JSX.Element;
@@ -1,20 +1,20 @@
1
- import { ReactNode } from 'react';
2
- import { AutocompleteProps, RenderInputParams, UseAutocompleteProps } from '@material-ui/lab';
3
- import { Variant, DropdownEvent } from 'types/Component.types';
4
- declare type Props<T> = Omit<UseAutocompleteProps<T>, 'onChange'> & Omit<AutocompleteProps<T>, 'renderInput'> & {
1
+ import { ChangeEvent, ReactNode } from 'react';
2
+ import { AutocompleteProps, AutocompleteChangeReason, AutocompleteRenderInputParams } from '@mui/material';
3
+ import { Variant } from 'types/Component.types';
4
+ declare type MaybeBoolean = boolean | undefined;
5
+ declare type Props<T> = {
5
6
  error?: boolean;
6
7
  errors?: boolean[];
7
8
  label?: string;
8
9
  helperText?: string;
9
10
  name?: string;
10
11
  value: any;
11
- onChange: (evt: DropdownEvent) => void;
12
- onBlur?: (evt: DropdownEvent) => void;
13
- renderInput?: ((params: RenderInputParams) => ReactNode) | null | undefined;
12
+ renderInput?: ((params: AutocompleteRenderInputParams) => ReactNode) | null | undefined;
14
13
  variant?: Variant;
15
14
  disableFilter?: boolean;
16
15
  max?: number;
17
16
  count?: number;
18
- };
17
+ onChange: (event: ChangeEvent<any>, value: any, reason: AutocompleteChangeReason) => void;
18
+ } & Omit<AutocompleteProps<T, MaybeBoolean, MaybeBoolean, MaybeBoolean, any>, 'onChange' | 'renderInput'>;
19
19
  export default function InputSearchDropdown<T>(props: Props<T>): JSX.Element;
20
20
  export {};
@@ -26,20 +26,19 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  return t;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ /** @jsxRuntime classic */
29
30
  /** @jsx jsx */
30
31
  var react_1 = require("@emotion/react");
31
32
  var react_2 = require("react");
32
- var styles_1 = require("@material-ui/core/styles");
33
- var Autocomplete_1 = require("@material-ui/lab/Autocomplete");
34
- var core_1 = require("@material-ui/core");
35
- var lab_1 = require("@material-ui/lab");
33
+ var styles_1 = require("@mui/styles");
34
+ var material_1 = require("@mui/material");
36
35
  var useStyles = (0, styles_1.makeStyles)({
37
36
  option: {
38
37
  '&[data-focus="true"]': { backgroundColor: '#5789ff', color: 'white' },
39
38
  },
40
39
  });
41
40
  function InputSearchDropdown(props) {
42
- var _a = props.autoHighlight, autoHighlight = _a === void 0 ? true : _a, _b = props.clearOnEscape, clearOnEscape = _b === void 0 ? true : _b, count = props.count, disableFilter = props.disableFilter, error = props.error, errors = props.errors, filterOptions = props.filterOptions, _c = props.filterSelectedOptions, filterSelectedOptions = _c === void 0 ? true : _c, label = props.label, helperText = props.helperText, name = props.name, onBlur = props.onBlur, onChange = props.onChange, _d = props.openOnFocus, openOnFocus = _d === void 0 ? true : _d, _e = props.renderInput, renderInput = _e === void 0 ? null : _e, renderTags = props.renderTags, _f = props.selectOnFocus, selectOnFocus = _f === void 0 ? true : _f, _g = props.variant, variant = _g === void 0 ? 'outlined' : _g, multiple = props.multiple, max = props.max, restOfProps = __rest(props, ["autoHighlight", "clearOnEscape", "count", "disableFilter", "error", "errors", "filterOptions", "filterSelectedOptions", "label", "helperText", "name", "onBlur", "onChange", "openOnFocus", "renderInput", "renderTags", "selectOnFocus", "variant", "multiple", "max"]);
41
+ var _a = props.autoHighlight, autoHighlight = _a === void 0 ? true : _a, _b = props.clearOnEscape, clearOnEscape = _b === void 0 ? true : _b, count = props.count, disableFilter = props.disableFilter, error = props.error, errors = props.errors, filterOptions = props.filterOptions, _c = props.filterSelectedOptions, filterSelectedOptions = _c === void 0 ? true : _c, label = props.label, helperText = props.helperText, name = props.name, onChange = props.onChange, _d = props.openOnFocus, openOnFocus = _d === void 0 ? true : _d, _e = props.renderInput, renderInput = _e === void 0 ? null : _e, renderTags = props.renderTags, _f = props.selectOnFocus, selectOnFocus = _f === void 0 ? true : _f, _g = props.variant, variant = _g === void 0 ? 'outlined' : _g, multiple = props.multiple, max = props.max, restOfProps = __rest(props, ["autoHighlight", "clearOnEscape", "count", "disableFilter", "error", "errors", "filterOptions", "filterSelectedOptions", "label", "helperText", "name", "onChange", "openOnFocus", "renderInput", "renderTags", "selectOnFocus", "variant", "multiple", "max"]);
43
42
  var _h = (0, react_2.useState)(null), value = _h[0], setValue = _h[1];
44
43
  var mainStyles = useStyles();
45
44
  (0, react_2.useEffect)(function () {
@@ -76,26 +75,27 @@ function InputSearchDropdown(props) {
76
75
  }
77
76
  }
78
77
  setValue(newValue);
79
- onChange({ target: { name: name, value: newValue, reason: reason } });
80
- if (onBlur) {
81
- onBlur({ target: { name: name, value: newValue, reason: reason } });
82
- }
78
+ onChange({ target: { name: name, value: newValue } }, newValue, reason);
83
79
  }
84
80
  function handleOptionFilter() {
85
- return (0, Autocomplete_1.createFilterOptions)({
81
+ return (0, material_1.createFilterOptions)({
86
82
  matchFrom: 'any',
87
83
  stringify: props.getOptionLabel,
88
84
  });
89
85
  }
90
86
  function renderDefaultInput(params) {
91
- return (0, react_1.jsx)(core_1.TextField, __assign({}, params, { error: error || !!(errors === null || errors === void 0 ? void 0 : errors.length), label: label, variant: variant }));
87
+ return (0, react_1.jsx)(material_1.TextField, __assign({}, params, { error: error || !!(errors === null || errors === void 0 ? void 0 : errors.length), label: label, variant: variant }));
92
88
  }
93
89
  function renderDefaultTags(values, getTagProps) {
94
- return values.map(function (value, index) { return ((0, react_1.jsx)(core_1.Chip, __assign({ key: "chip-" + (typeof value === 'string'
95
- ? value
96
- : props.getOptionLabel !== undefined
97
- ? props.getOptionLabel(value)
98
- : JSON.stringify(value)), css: (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-color: ", ";\n "], ["\n border-color: ", ";\n "])), errors && errors[index] ? 'red' : 'initial'), variant: "outlined", label: props.getOptionLabel ? props.getOptionLabel(value) : value, size: "small" }, getTagProps({ index: index })))); });
90
+ return values.map(function (value, index) {
91
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
92
+ var _a = getTagProps({ index: index }), key = _a.key, tagProps = __rest(_a, ["key"]);
93
+ return ((0, react_1.jsx)(material_1.Chip, __assign({ key: "chip-" + (typeof value === 'string'
94
+ ? value
95
+ : props.getOptionLabel !== undefined
96
+ ? props.getOptionLabel(value)
97
+ : JSON.stringify(value)), css: (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-color: ", ";\n "], ["\n border-color: ", ";\n "])), errors && errors[index] ? 'red' : 'initial'), variant: "outlined", label: props.getOptionLabel ? props.getOptionLabel(value) : value, size: "small" }, tagProps)));
98
+ });
99
99
  }
100
100
  function getCount() {
101
101
  var _a;
@@ -105,10 +105,10 @@ function InputSearchDropdown(props) {
105
105
  return ((_a = value) === null || _a === void 0 ? void 0 : _a.length) || 0;
106
106
  }
107
107
  return ((0, react_1.jsx)("div", null,
108
- (0, react_1.jsx)(lab_1.Autocomplete, __assign({ autoHighlight: autoHighlight, clearOnEscape: clearOnEscape, filterOptions: !disableFilter ? filterOptions || handleOptionFilter() : function (options) { return options; }, filterSelectedOptions: filterSelectedOptions, onChange: handleOnChange, openOnFocus: openOnFocus, renderInput: renderInput || renderDefaultInput, renderTags: renderTags || renderDefaultTags, selectOnFocus: selectOnFocus, multiple: multiple, classes: mainStyles }, restOfProps, { value: getValue() })),
108
+ (0, react_1.jsx)(material_1.Autocomplete, __assign({ autoHighlight: autoHighlight, clearOnEscape: clearOnEscape, filterOptions: !disableFilter ? filterOptions || handleOptionFilter() : function (options) { return options; }, filterSelectedOptions: filterSelectedOptions, onChange: handleOnChange, openOnFocus: openOnFocus, renderInput: renderInput || renderDefaultInput, renderTags: renderTags || renderDefaultTags, selectOnFocus: selectOnFocus, multiple: multiple, classes: mainStyles }, restOfProps, { value: getValue() })),
109
109
  (0, react_1.jsx)("div", null,
110
- helperText && ((0, react_1.jsx)(core_1.Typography, { css: (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "], ["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "caption" }, helperText)),
111
- multiple && max && ((0, react_1.jsx)(core_1.Typography, { css: (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "], ["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "subtitle1" },
110
+ helperText && ((0, react_1.jsx)(material_1.Typography, { css: (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "], ["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "caption" }, helperText)),
111
+ multiple && max && ((0, react_1.jsx)(material_1.Typography, { css: (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "], ["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "subtitle1" },
112
112
  getCount(),
113
113
  "/",
114
114
  max)))));
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  export declare const InputSearchDropdownSingle: () => JSX.Element;
3
2
  export declare const InputSearchDropdownMulti: () => JSX.Element;
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
2
- import { KeyboardTimePickerProps } from '@material-ui/pickers';
3
- import { SimpleEventHandler } from 'types';
4
- declare type Props<T> = Omit<KeyboardTimePickerProps, 'onChange'> & {
5
- onChange: SimpleEventHandler<T>;
6
- };
7
- export default function InputTime(props: Props<string>): JSX.Element;
1
+ import { TimePickerProps } from '@mui/lab';
2
+ import { SimpleEventHandler, ParsableDate } from 'types';
3
+ declare type Props = {
4
+ name?: string;
5
+ onChange: SimpleEventHandler<ParsableDate>;
6
+ } & Omit<TimePickerProps, 'onChange' | 'renderInput' | 'openPicker' | 'rawValue'>;
7
+ export default function InputTime(props: Props): JSX.Element;
8
8
  export {};
@@ -43,21 +43,22 @@ var __rest = (this && this.__rest) || function (s, e) {
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
44
  var react_1 = __importStar(require("react"));
45
45
  var date_fns_1 = require("date-fns");
46
- var pickers_1 = require("@material-ui/pickers");
46
+ var lab_1 = require("@mui/lab");
47
+ var material_1 = require("@mui/material");
47
48
  function InputTime(props) {
48
- var _a = props.autoOk, autoOk = _a === void 0 ? true : _a, _b = props.clearable, clearable = _b === void 0 ? true : _b, _c = props.format, format = _c === void 0 ? 'HH:mm' : _c, _d = props.inputVariant, inputVariant = _d === void 0 ? 'outlined' : _d, label = props.label, name = props.name, onChange = props.onChange, _e = props.variant, variant = _e === void 0 ? 'inline' : _e, restOfProps = __rest(props, ["autoOk", "clearable", "format", "inputVariant", "label", "name", "onChange", "variant"]);
49
- var _f = (0, react_1.useState)(null), value = _f[0], setValue = _f[1];
49
+ var _a = props.clearable, clearable = _a === void 0 ? true : _a, _b = props.inputFormat, inputFormat = _b === void 0 ? 'HH:mm' : _b, label = props.label, name = props.name, onChange = props.onChange, restOfProps = __rest(props, ["clearable", "inputFormat", "label", "name", "onChange"]);
50
+ var _c = (0, react_1.useState)(null), value = _c[0], setValue = _c[1];
50
51
  (0, react_1.useEffect)(function () {
51
52
  if (props.value) {
52
53
  setValue(props.value);
53
54
  }
54
- }, []); // eslint-disable-line
55
+ }, []);
55
56
  function handleOnChange(date) {
56
57
  setValue(date);
57
58
  if (date === null || (0, date_fns_1.isValid)(date)) {
58
59
  onChange({ target: { name: name, value: date ? (0, date_fns_1.formatISO)(date) : null } });
59
60
  }
60
61
  }
61
- return (react_1.default.createElement(pickers_1.KeyboardTimePicker, __assign({}, restOfProps, { autoOk: autoOk, clearable: clearable, format: format, inputVariant: inputVariant, label: label, name: name, onChange: handleOnChange, value: value, variant: variant })));
62
+ return (react_1.default.createElement(lab_1.TimePicker, __assign({}, restOfProps, { clearable: clearable, inputFormat: inputFormat, label: label, onChange: handleOnChange, renderInput: function (params) { return react_1.default.createElement(material_1.TextField, __assign({}, params)); }, value: value })));
62
63
  }
63
64
  exports.default = InputTime;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const InputTime: () => JSX.Element;
@@ -24,12 +24,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.InputTime = void 0;
26
26
  var react_1 = __importStar(require("react"));
27
- var pickers_1 = require("@material-ui/pickers");
28
- var date_fns_1 = __importDefault(require("@date-io/date-fns"));
27
+ var lab_1 = require("@mui/lab");
29
28
  var InputTime_1 = __importDefault(require("components/material-ui/InputTime"));
29
+ var AdapterDateFns_1 = __importDefault(require("@mui/lab/AdapterDateFns"));
30
30
  var InputTime = function () {
31
31
  var _a = (0, react_1.useState)(null), value = _a[0], setValue = _a[1];
32
- return (react_1.default.createElement(pickers_1.MuiPickersUtilsProvider, { utils: date_fns_1.default },
32
+ return (react_1.default.createElement(lab_1.LocalizationProvider, { dateAdapter: AdapterDateFns_1.default },
33
33
  react_1.default.createElement(InputTime_1.default, { label: "Bedtime", value: value, onChange: function (_a) {
34
34
  var value = _a.target.value;
35
35
  return setValue(value);
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { DialogProps } from '@material-ui/core';
2
+ import { DialogProps } from '@mui/material';
3
3
  declare type Props = DialogProps & {
4
4
  children: ReactNode;
5
5
  classes?: any;
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
2
6
  var __assign = (this && this.__assign) || function () {
3
7
  __assign = Object.assign || function(t) {
4
8
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -25,22 +29,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
30
  };
27
31
  Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
29
- var core_1 = require("@material-ui/core");
32
+ /** @jsxRuntime classic */
33
+ /** @jsx jsx */
34
+ var react_1 = require("@emotion/react");
35
+ var material_1 = require("@mui/material");
30
36
  var Button_1 = __importDefault(require("../Button"));
31
- var useSubmitBtnStyles = (0, core_1.makeStyles)({
32
- root: {
33
- color: '#3f51b5',
34
- },
35
- });
36
37
  function Modal(props) {
37
38
  var children = props.children, classes = props.classes, cancelButton = props.cancelButton, okayButton = props.okayButton, onClose = props.onClose, submitting = props.submitting, open = props.open, title = props.title, restOfProps = __rest(props, ["children", "classes", "cancelButton", "okayButton", "onClose", "submitting", "open", "title"]);
38
- var submitBtnStyles = useSubmitBtnStyles();
39
- return (react_1.default.createElement(core_1.Dialog, __assign({}, restOfProps, { classes: classes, open: open, onClose: onClose }),
40
- react_1.default.createElement(core_1.DialogTitle, null, title),
41
- react_1.default.createElement(core_1.DialogContent, null, typeof children === 'string' ? react_1.default.createElement(core_1.DialogContentText, null, children) : children),
42
- react_1.default.createElement(core_1.DialogActions, null,
43
- cancelButton && (react_1.default.createElement(Button_1.default, { color: "default", variant: "text", disabled: cancelButton.disabled || submitting, onClick: cancelButton.onClick }, cancelButton.text)),
44
- okayButton && (react_1.default.createElement(Button_1.default, { color: "primary", progressClasses: submitting ? submitBtnStyles : undefined, variant: "text", disabled: okayButton.disabled, onClick: okayButton.onClick, loading: submitting }, okayButton.text)))));
39
+ return ((0, react_1.jsx)(material_1.Dialog, __assign({}, restOfProps, { classes: classes, open: open, onClose: onClose }),
40
+ (0, react_1.jsx)(material_1.DialogTitle, null, title),
41
+ (0, react_1.jsx)(material_1.DialogContent, null, typeof children === 'string' ? (0, react_1.jsx)(material_1.DialogContentText, null, children) : children),
42
+ (0, react_1.jsx)(material_1.DialogActions, null,
43
+ cancelButton && ((0, react_1.jsx)(Button_1.default, { variant: "text", disabled: cancelButton.disabled || submitting, onClick: cancelButton.onClick }, cancelButton.text)),
44
+ okayButton && ((0, react_1.jsx)(Button_1.default, { css: function (theme) {
45
+ var _a, _b;
46
+ return (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &&.MuiButton-root .MuiCircularProgress-root {\n color: ", ";\n }\n "], ["\n &&.MuiButton-root .MuiCircularProgress-root {\n color: ", ";\n }\n "])), ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main) || 'hsl(321, 53%, 31%)');
47
+ }, color: "primary", variant: "text", disabled: okayButton.disabled, onClick: okayButton.onClick, loading: submitting }, okayButton.text)))));
45
48
  }
46
49
  exports.default = Modal;
50
+ var templateObject_1;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Modal: () => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { AutocompleteChangeReason } from '@material-ui/lab';
1
+ import { AutocompleteChangeReason } from '@mui/material';
2
2
  import { ReactNode } from 'react';
3
3
  export declare type Variant = 'standard' | 'outlined' | 'filled' | undefined;
4
4
  export declare type Color = 'default' | 'primary' | 'secondary' | undefined;
@@ -27,3 +27,4 @@ export declare type MenuItem = {
27
27
  content: ReactNode;
28
28
  onClick: () => void;
29
29
  };
30
+ export declare type ParsableDate = string | number | Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendorflow/components",
3
- "version": "1.1.26",
3
+ "version": "2.0.0",
4
4
  "description": "React components for vendorflow",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -41,36 +41,33 @@
41
41
  ]
42
42
  },
43
43
  "dependencies": {
44
- "@babel/core": "7.9.0",
45
- "@blueprintjs/core": "^3.26.0",
46
- "@blueprintjs/datetime": "^3.16.1",
47
- "@blueprintjs/icons": "^3.15.1",
48
- "@blueprintjs/select": "^3.12.2",
49
- "@blueprintjs/table": "^3.8.4",
50
- "@blueprintjs/timezone": "^3.6.2",
44
+ "@babel/core": "^7.15.8",
51
45
  "@date-io/date-fns": "1.x",
52
46
  "@emotion/babel-plugin": "^11.3.0",
53
47
  "@emotion/react": "^11.4.0",
54
48
  "@emotion/styled": "^11.3.0",
55
- "@material-ui/core": "^4.9.12",
56
- "@material-ui/icons": "^4.9.1",
57
- "@material-ui/lab": "^4.0.0-alpha.51",
58
- "@material-ui/pickers": "^3.2.10",
49
+ "@mui/icons-material": "^5.0.3",
50
+ "@mui/lab": "^5.0.0-alpha.50",
51
+ "@mui/material": "^5.0.3",
52
+ "@mui/styles": "^5.0.1",
59
53
  "@svgr/webpack": "4.3.3",
60
54
  "@testing-library/jest-dom": "^4.2.4",
61
55
  "@testing-library/react": "^9.3.2",
62
56
  "@testing-library/user-event": "^7.1.2",
63
57
  "@types/jest": "^24.0.0",
64
58
  "@types/node": "^12.0.0",
65
- "@types/react": "^16.9.0",
66
- "@types/react-dom": "^16.9.0",
59
+ "@types/react": "^17.0.27",
60
+ "@types/react-dom": "^17.0.9",
67
61
  "@typescript-eslint/eslint-plugin": "^4.32.0",
68
62
  "@typescript-eslint/parser": "^4.32.0",
69
63
  "babel-eslint": "10.1.0",
70
64
  "babel-jest": "^24.9.0",
71
- "babel-loader": "8.1.0",
65
+ "babel-loader": "^8.2.2",
72
66
  "babel-plugin-named-asset-import": "^0.3.6",
73
- "babel-preset-react-app": "^9.1.2",
67
+ "babel-plugin-polyfill-corejs2": "^0.2.2",
68
+ "babel-plugin-polyfill-corejs3": "^0.2.5",
69
+ "babel-plugin-polyfill-regenerator": "^0.2.2",
70
+ "babel-preset-react-app": "^10.0.0",
74
71
  "camelcase": "^5.3.1",
75
72
  "case-sensitive-paths-webpack-plugin": "2.3.0",
76
73
  "classnames": "^2.2.6",
@@ -78,14 +75,14 @@
78
75
  "date-fns": "^2.12.0",
79
76
  "dotenv": "8.2.0",
80
77
  "dotenv-expand": "5.1.0",
81
- "eslint": "^6.6.0",
82
- "eslint-config-react-app": "^5.2.1",
78
+ "eslint": "^7.32.0",
79
+ "eslint-config-react-app": "^6.0.0",
83
80
  "eslint-loader": "3.0.3",
84
81
  "eslint-plugin-flowtype": "4.6.0",
85
- "eslint-plugin-import": "2.20.1",
86
- "eslint-plugin-jsx-a11y": "6.2.3",
87
- "eslint-plugin-react": "7.19.0",
88
- "eslint-plugin-react-hooks": "^1.6.1",
82
+ "eslint-plugin-import": "^2.24.2",
83
+ "eslint-plugin-jsx-a11y": "^6.4.1",
84
+ "eslint-plugin-react": "^7.26.1",
85
+ "eslint-plugin-react-hooks": "^4.2.0",
89
86
  "file-loader": "4.3.0",
90
87
  "fs-extra": "^8.1.0",
91
88
  "html-webpack-plugin": "4.0.0-beta.11",
@@ -103,12 +100,12 @@
103
100
  "postcss-normalize": "8.0.1",
104
101
  "postcss-preset-env": "6.7.0",
105
102
  "postcss-safe-parser": "4.0.1",
106
- "react": "^16.13.1",
103
+ "react": "^17.0.2",
107
104
  "react-app-polyfill": "^1.0.6",
108
105
  "react-dev-utils": "^10.2.1",
109
- "react-dom": "^16.13.1",
106
+ "react-dom": "^17.0.2",
110
107
  "react-measure": "^2.5.2",
111
- "react-scripts": "^3.4.1",
108
+ "react-scripts": "^4.0.3",
112
109
  "react-text-mask": "^5.4.3",
113
110
  "react-textarea-autosize": "^8.3.3",
114
111
  "resolve": "1.15.0",
@@ -126,14 +123,14 @@
126
123
  "workbox-webpack-plugin": "4.3.1"
127
124
  },
128
125
  "devDependencies": {
129
- "@babel/cli": "^7.8.4",
126
+ "@babel/cli": "^7.15.7",
130
127
  "@babel/preset-react": "^7.9.4",
131
- "@storybook/addon-actions": "^5.3.18",
132
- "@storybook/addon-knobs": "^5.3.18",
133
- "@storybook/addon-links": "^5.3.18",
134
- "@storybook/addons": "^5.3.18",
128
+ "@storybook/addon-actions": "^6.3.10",
129
+ "@storybook/addon-knobs": "^6.3.1",
130
+ "@storybook/addon-links": "^6.3.10",
131
+ "@storybook/addons": "^6.3.10",
135
132
  "@storybook/preset-create-react-app": "^2.1.1",
136
- "@storybook/react": "^5.3.18",
133
+ "@storybook/react": "^6.3.10",
137
134
  "@types/lodash": "^4.14.150",
138
135
  "@types/react-measure": "^2.0.7",
139
136
  "@types/react-text-mask": "^5.4.6",