@symply.io/basic-components 1.0.0-alpha.2 → 1.0.0-alpha.20

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 (99) hide show
  1. package/AlertDialog/index.d.ts +0 -1
  2. package/AlertDialog/index.js +10 -9
  3. package/AlertDialog/types.d.ts +3 -1
  4. package/Autocomplete/index.d.ts +4 -0
  5. package/Autocomplete/index.js +38 -0
  6. package/Autocomplete/types.d.ts +15 -0
  7. package/Autocomplete/types.js +1 -0
  8. package/Autocomplete/useInteractions.d.ts +5 -0
  9. package/Autocomplete/useInteractions.js +9 -0
  10. package/AutocompleteWithFilter/index.d.ts +4 -0
  11. package/AutocompleteWithFilter/index.js +54 -0
  12. package/AutocompleteWithFilter/types.d.ts +16 -0
  13. package/AutocompleteWithFilter/types.js +1 -0
  14. package/BasicModal/Content.d.ts +0 -1
  15. package/BasicModal/Content.js +1 -1
  16. package/BasicModal/index.d.ts +0 -1
  17. package/BasicModal/index.js +16 -18
  18. package/BasicModal/types.d.ts +3 -1
  19. package/BreadCrumbs/index.d.ts +4 -0
  20. package/BreadCrumbs/index.js +37 -0
  21. package/BreadCrumbs/types.d.ts +9 -0
  22. package/BreadCrumbs/types.js +1 -0
  23. package/CheckBox/CheckBox.d.ts +3 -0
  24. package/CheckBox/CheckBox.js +36 -0
  25. package/CheckBox/CheckBoxGroup.d.ts +3 -0
  26. package/CheckBox/CheckBoxGroup.js +30 -0
  27. package/CheckBox/index.d.ts +3 -0
  28. package/CheckBox/index.js +3 -0
  29. package/CheckBox/types.d.ts +12 -0
  30. package/CheckBox/types.js +1 -0
  31. package/Copyright/index.d.ts +4 -0
  32. package/Copyright/index.js +25 -0
  33. package/Copyright/types.d.ts +5 -0
  34. package/Copyright/types.js +1 -0
  35. package/DigitInput/index.d.ts +1 -4
  36. package/DigitInput/index.js +7 -4
  37. package/DigitInput/types.d.ts +5 -1
  38. package/DynamicHeaderBar/HeaderBar.d.ts +2 -0
  39. package/DynamicHeaderBar/HeaderBar.js +7 -6
  40. package/DynamicHeaderBar/HeaderButtons.d.ts +0 -1
  41. package/DynamicHeaderBar/HeaderButtons.js +20 -19
  42. package/DynamicHeaderBar/HeaderLine.js +4 -4
  43. package/DynamicHeaderBar/index.js +2 -2
  44. package/FeinInput/index.d.ts +6 -0
  45. package/FeinInput/index.js +73 -0
  46. package/FeinInput/types.d.ts +9 -0
  47. package/FeinInput/types.js +1 -0
  48. package/FeinInput/useInteractions.d.ts +8 -0
  49. package/FeinInput/useInteractions.js +16 -0
  50. package/FormRadioGroup/index.d.ts +0 -1
  51. package/FormRadioGroup/index.js +15 -12
  52. package/FormRadioGroup/types.d.ts +3 -0
  53. package/FormSelector/MultipleSelector.d.ts +0 -1
  54. package/FormSelector/MultipleSelector.js +25 -11
  55. package/FormSelector/SimpleSelector.d.ts +0 -1
  56. package/FormSelector/SimpleSelector.js +25 -11
  57. package/FormSelector/types.d.ts +7 -8
  58. package/HelpCaption/index.d.ts +3 -1
  59. package/HelpCaption/index.js +15 -14
  60. package/LoadingModal/index.d.ts +0 -1
  61. package/LoadingModal/index.js +8 -5
  62. package/LoadingModal/types.d.ts +3 -0
  63. package/MenuButtonGroup/MenuItem.d.ts +1 -3
  64. package/MenuButtonGroup/MenuItem.js +5 -3
  65. package/MenuButtonGroup/index.d.ts +3 -1
  66. package/MenuButtonGroup/index.js +9 -6
  67. package/NumberInput/index.d.ts +5 -4
  68. package/NumberInput/index.js +8 -5
  69. package/PasswordInput/ConfirmPassword.d.ts +5 -4
  70. package/PasswordInput/ConfirmPassword.js +10 -7
  71. package/PasswordInput/Password.d.ts +5 -4
  72. package/PasswordInput/Password.js +18 -10
  73. package/PhoneNumberInput/index.d.ts +6 -4
  74. package/PhoneNumberInput/index.js +25 -7
  75. package/PhoneNumberInput/useInteractions.d.ts +0 -1
  76. package/PhoneNumberInput/useInteractions.js +1 -14
  77. package/README.md +261 -45
  78. package/TabGroup/index.js +26 -20
  79. package/TabGroup/types.d.ts +3 -0
  80. package/TablePagination/Actions.d.ts +3 -0
  81. package/TablePagination/Actions.js +27 -0
  82. package/TablePagination/index.d.ts +4 -0
  83. package/TablePagination/index.js +30 -0
  84. package/TablePagination/types.d.ts +14 -0
  85. package/TablePagination/types.js +1 -0
  86. package/TablePagination/useInteractions.d.ts +14 -0
  87. package/TablePagination/useInteractions.js +23 -0
  88. package/TextInput/index.d.ts +5 -4
  89. package/TextInput/index.js +18 -5
  90. package/ToastPrompt/Presentation.js +28 -27
  91. package/ToastPrompt/index.js +1 -1
  92. package/VideoPlayerModal/index.d.ts +1 -3
  93. package/VideoPlayerModal/index.js +8 -7
  94. package/VideoPlayerModal/types.d.ts +5 -1
  95. package/index.d.ts +13 -0
  96. package/index.js +13 -0
  97. package/package.json +9 -2
  98. package/useCustomTheme.d.ts +6 -0
  99. package/useCustomTheme.js +51 -0
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AlertDialogProps } from "./types";
3
2
  declare const AlertDialog: (props: AlertDialogProps) => JSX.Element;
4
3
  export default AlertDialog;
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import { forwardRef, cloneElement } from "react";
25
- import useTheme from "@mui/material/styles/useTheme";
25
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
26
26
  import Button from "@mui/material/Button";
27
27
  import Dialog from "@mui/material/Dialog";
28
28
  import DialogTitle from "@mui/material/DialogTitle";
@@ -30,18 +30,19 @@ import DialogActions from "@mui/material/DialogActions";
30
30
  import DialogContent from "@mui/material/DialogContent";
31
31
  import useMediaQuery from "@mui/material/useMediaQuery";
32
32
  import Slide from "@mui/material/Slide";
33
+ import useCustomTheme from "../useCustomTheme";
33
34
  var Transition = forwardRef(function Transition(props, ref) {
34
- return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }), void 0);
35
+ return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }));
35
36
  });
36
37
  var AlertDialog = function (props) {
37
- var _a = props.title, title = _a === void 0 ? "Info" : _a, _b = props.maxWidth, maxWidth = _b === void 0 ? "md" : _b, children = props.children, open = props.open, onClose = props.onClose, DialogButtons = props.DialogButtons, rest = __rest(props, ["title", "maxWidth", "children", "open", "onClose", "DialogButtons"]);
38
- var theme = useTheme();
38
+ var _a = props.title, title = _a === void 0 ? "Info" : _a, _b = props.maxWidth, maxWidth = _b === void 0 ? "md" : _b, children = props.children, open = props.open, onClose = props.onClose, DialogButtons = props.DialogButtons, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, rest = __rest(props, ["title", "maxWidth", "children", "open", "onClose", "DialogButtons", "primaryColor", "secondaryColor"]);
39
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
39
40
  var fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
40
- return (_jsxs(Dialog, __assign({ maxWidth: maxWidth, fullScreen: fullScreen, TransitionComponent: Transition, open: open, onClose: function (_, reason) {
41
- if (reason !== "backdropClick") {
42
- onClose();
43
- }
44
- }, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description" }, rest, { children: [_jsx(DialogTitle, __assign({ id: "alert-dialog-title" }, { children: title }), void 0), _jsx(DialogContent, { children: children }, void 0), _jsx(DialogActions, { children: DialogButtons ? (cloneElement(DialogButtons)) : (_jsx(Button, __assign({ onClick: onClose, color: "primary" }, { children: "OK" }), void 0)) }, void 0)] }), void 0));
41
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsxs(Dialog, __assign({ maxWidth: maxWidth, fullScreen: fullScreen, TransitionComponent: Transition, open: open, onClose: function (_, reason) {
42
+ if (reason !== "backdropClick") {
43
+ onClose();
44
+ }
45
+ }, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description" }, rest, { children: [_jsx(DialogTitle, __assign({ id: "alert-dialog-title" }, { children: title })), _jsx(DialogContent, { children: children }), _jsx(DialogActions, { children: DialogButtons ? (cloneElement(DialogButtons)) : (_jsx(Button, __assign({ onClick: onClose, color: "primary" }, { children: "OK" }))) })] })) })));
45
46
  };
46
47
  export default AlertDialog;
47
48
  export * from "./types";
@@ -1,4 +1,4 @@
1
- import { ReactElement } from "react";
1
+ import { ReactElement, CSSProperties } from "react";
2
2
  import { DialogProps } from "@mui/material/Dialog";
3
3
  import { DialogContentProps } from "@mui/material/DialogContent";
4
4
  export interface AlertDialogProps {
@@ -8,4 +8,6 @@ export interface AlertDialogProps {
8
8
  open: boolean;
9
9
  onClose: () => void;
10
10
  DialogButtons?: ReactElement;
11
+ primaryColor?: CSSProperties["color"];
12
+ secondaryColor?: CSSProperties["color"];
11
13
  }
@@ -0,0 +1,4 @@
1
+ import { CustomAutocompleteProps } from "./types";
2
+ declare function CustomAutocomplete(props: CustomAutocompleteProps): JSX.Element;
3
+ export default CustomAutocomplete;
4
+ export * from "./types";
@@ -0,0 +1,38 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
25
+ import Autocomplete from "@mui/material/Autocomplete";
26
+ import TextField from "@mui/material/TextField";
27
+ import useInteractions from "./useInteractions";
28
+ import useCustomTheme from "../useCustomTheme";
29
+ function CustomAutocomplete(props) {
30
+ var size = props.size, value = props.value, options = props.options, multiple = props.multiple, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onChange = props.onChange, rest = __rest(props, ["size", "value", "options", "multiple", "primaryColor", "secondaryColor", "onChange"]);
31
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
32
+ var _a = useInteractions(), inputValue = _a.inputValue, onInputChange = _a.onInputChange;
33
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Autocomplete, { size: size, fullWidth: true, options: options, multiple: multiple, onChange: function (_, value) {
34
+ onChange(value);
35
+ }, inputValue: inputValue, onInputChange: onInputChange, renderInput: function (params) { return _jsx(TextField, __assign({}, params, rest, { size: size })); } }) })));
36
+ }
37
+ export default CustomAutocomplete;
38
+ export * from "./types";
@@ -0,0 +1,15 @@
1
+ import { CSSProperties } from "react";
2
+ import { TextFieldProps } from "@mui/material/TextField";
3
+ export interface IAutocompleteOption {
4
+ label: string;
5
+ [name: string]: unknown;
6
+ }
7
+ export declare type AutocompleteOptionType = IAutocompleteOption | string;
8
+ export interface CustomAutocompleteProps extends Omit<TextFieldProps, "onChange"> {
9
+ multiple?: boolean;
10
+ options: Array<AutocompleteOptionType>;
11
+ value: Array<AutocompleteOptionType> | AutocompleteOptionType | null;
12
+ primaryColor?: CSSProperties["color"];
13
+ secondaryColor?: CSSProperties["color"];
14
+ onChange: (value: Array<AutocompleteOptionType> | AutocompleteOptionType | null) => void;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ declare function useInteractions(): {
2
+ inputValue: string;
3
+ onInputChange: (_: object, value: string) => void;
4
+ };
5
+ export default useInteractions;
@@ -0,0 +1,9 @@
1
+ import { useState, useCallback } from "react";
2
+ function useInteractions() {
3
+ var _a = useState(""), inputValue = _a[0], setInputValue = _a[1];
4
+ var onInputChange = useCallback(function (_, value) {
5
+ setInputValue(value);
6
+ }, []);
7
+ return { inputValue: inputValue, onInputChange: onInputChange };
8
+ }
9
+ export default useInteractions;
@@ -0,0 +1,4 @@
1
+ import { AutoCompleteWithFilterProps } from "./types";
2
+ declare function AutocompleteWithFilter(props: AutoCompleteWithFilterProps): JSX.Element;
3
+ export default AutocompleteWithFilter;
4
+ export * from "./types";
@@ -0,0 +1,54 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
25
+ import Checkbox from "@mui/material/Checkbox";
26
+ import TextField from "@mui/material/TextField";
27
+ import Autocomplete, { createFilterOptions } from "@mui/material/Autocomplete";
28
+ import CheckBoxOutlineBlankIcon from "@mui/icons-material/CheckBoxOutlineBlank";
29
+ import CheckBoxIcon from "@mui/icons-material/CheckBox";
30
+ import useCustomTheme from "../useCustomTheme";
31
+ var icon = _jsx(CheckBoxOutlineBlankIcon, { fontSize: "small" });
32
+ var checkedIcon = _jsx(CheckBoxIcon, { fontSize: "small" });
33
+ function AutocompleteWithFilter(props) {
34
+ var size = props.size, value = props.value, options = props.options, multiple = props.multiple, disableCloseOnSelect = props.disableCloseOnSelect, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onChange = props.onChange, rest = __rest(props, ["size", "value", "options", "multiple", "disableCloseOnSelect", "primaryColor", "secondaryColor", "onChange"]);
35
+ var filter = createFilterOptions({
36
+ ignoreCase: true,
37
+ ignoreAccents: true,
38
+ trim: true,
39
+ stringify: function (option) {
40
+ return typeof option === "string" ? option : option.label;
41
+ }
42
+ });
43
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
44
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Autocomplete, { size: size, fullWidth: true, limitTags: 1, options: options, multiple: multiple, filterOptions: filter, onChange: function (_, value) {
45
+ onChange(value);
46
+ }, disableCloseOnSelect: disableCloseOnSelect || multiple, getOptionLabel: function (option) {
47
+ return typeof option === "string" ? option || "" : option.label || "";
48
+ }, renderOption: function (props, option, _a) {
49
+ var selected = _a.selected;
50
+ return (_jsxs("li", __assign({}, props, { children: [_jsx(Checkbox, { icon: icon, color: "primary", checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), typeof option === "string" ? option || "" : option.label || ""] })));
51
+ }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, rest, { variant: "outlined" }))); } }) })));
52
+ }
53
+ export default AutocompleteWithFilter;
54
+ export * from "./types";
@@ -0,0 +1,16 @@
1
+ import { CSSProperties } from "react";
2
+ import { TextFieldProps } from "@mui/material/TextField";
3
+ export interface IAutoCompleteWithFilterOption {
4
+ label: string;
5
+ [name: string]: unknown;
6
+ }
7
+ export declare type AutoCompleteWithFilterOptionType = IAutoCompleteWithFilterOption | string;
8
+ export interface AutoCompleteWithFilterProps extends Omit<TextFieldProps, "onChange"> {
9
+ multiple?: boolean;
10
+ value: Array<AutoCompleteWithFilterOptionType> | AutoCompleteWithFilterOptionType | null;
11
+ options: Array<AutoCompleteWithFilterOptionType>;
12
+ disableCloseOnSelect?: boolean;
13
+ primaryColor?: CSSProperties["color"];
14
+ secondaryColor?: CSSProperties["color"];
15
+ onChange: (value: Array<AutoCompleteWithFilterOptionType> | AutoCompleteWithFilterOptionType | null) => void;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BasicModalContentProps } from "./types";
3
2
  declare function Content(props: BasicModalContentProps): JSX.Element;
4
3
  export default Content;
@@ -32,6 +32,6 @@ function Content(props) {
32
32
  right: 8,
33
33
  top: 8,
34
34
  color: theme.palette.grey[500],
35
- } }, { children: _jsx(CloseIcon, {}, void 0) }), void 0)) : null] }), void 0), _jsxs(DialogContent, __assign({ sx: { paddingTop: theme.spacing(1.25) } }, { children: [desc && _jsx(DialogContentText, { children: desc }, void 0), Boolean(children) && cloneElement(children)] }), void 0), !hideBottomButtons && (_jsx(DialogActions, __assign({ sx: { padding: theme.spacing(1.25) } }, { children: _jsx(Grid, __assign({ container: true, spacing: 2, justifyContent: "flex-end", alignItems: "center", sx: { margin: 0 } }, { children: buttons || (_jsxs(_Fragment, { children: [_jsx(Grid, __assign({ item: true, xs: 12, md: 3, xl: 2 }, { children: _jsx(Button, __assign({ onClick: onClose, variant: "outlined", color: color, disabled: loading, fullWidth: true }, { children: cancelText }), void 0) }), void 0), _jsx(Grid, __assign({ item: true, xs: 12, md: 3, xl: 2 }, { children: _jsx(Button, __assign({ type: noForm ? "button" : "submit", onClick: noForm ? onSubmit : undefined, variant: "contained", color: color, disabled: loading || disabled, fullWidth: true }, { children: submitText }), void 0) }), void 0)] }, void 0)) }), void 0) }), void 0))] }, void 0));
35
+ } }, { children: _jsx(CloseIcon, {}) }))) : null] })), _jsxs(DialogContent, __assign({ sx: { paddingTop: theme.spacing(1.25) } }, { children: [desc && _jsx(DialogContentText, { children: desc }), Boolean(children) && cloneElement(children)] })), !hideBottomButtons && (_jsx(DialogActions, __assign({ sx: { padding: theme.spacing(1.25) } }, { children: _jsx(Grid, __assign({ container: true, spacing: 2, justifyContent: "flex-end", alignItems: "center", sx: { margin: 0 } }, { children: buttons || (_jsxs(_Fragment, { children: [_jsx(Grid, __assign({ item: true, xs: 12, md: 3, xl: 2 }, { children: _jsx(Button, __assign({ onClick: onClose, variant: "outlined", color: color, disabled: loading, fullWidth: true }, { children: cancelText })) })), _jsx(Grid, __assign({ item: true, xs: 12, md: 3, xl: 2 }, { children: _jsx(Button, __assign({ type: noForm ? "button" : "submit", onClick: noForm ? onSubmit : undefined, variant: "contained", color: color, disabled: loading || disabled, fullWidth: true }, { children: submitText })) }))] })) })) })))] }));
36
36
  }
37
37
  export default Content;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BasicModalProps } from "./types";
3
2
  declare function BasicModal(props: BasicModalProps): JSX.Element;
4
3
  export default BasicModal;
@@ -26,29 +26,27 @@ import Grid from "@mui/material/Grid";
26
26
  import Dialog from "@mui/material/Dialog";
27
27
  import Slide from "@mui/material/Slide";
28
28
  import useMediaQuery from "@mui/material/useMediaQuery";
29
- import useTheme from "@mui/material/styles/useTheme";
29
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
30
30
  import Content from "./Content";
31
+ import useCustomTheme from "../useCustomTheme";
31
32
  var Transition = forwardRef(function Transition(props, ref) {
32
- return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }), void 0);
33
+ return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }));
33
34
  });
34
35
  function BasicModal(props) {
35
- var onClose = props.onClose, onSubmit = props.onSubmit, _a = props.maxWidth, maxWidth = _a === void 0 ? "sm" : _a, _b = props.open, open = _b === void 0 ? false : _b, _c = props.noForm, noForm = _c === void 0 ? false : _c, rest = __rest(props, ["onClose", "onSubmit", "maxWidth", "open", "noForm"]);
36
- var theme = useTheme();
36
+ var onClose = props.onClose, onSubmit = props.onSubmit, _a = props.maxWidth, maxWidth = _a === void 0 ? "sm" : _a, _b = props.open, open = _b === void 0 ? false : _b, _c = props.noForm, noForm = _c === void 0 ? false : _c, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, rest = __rest(props, ["onClose", "onSubmit", "maxWidth", "open", "noForm", "primaryColor", "secondaryColor"]);
37
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
37
38
  var fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
38
- return (_jsx(Dialog, __assign({ open: open, onClose: function (_, reason) {
39
- if (reason !== "backdropClick") {
40
- onClose();
41
- }
42
- }, maxWidth: maxWidth, fullWidth: true, TransitionComponent: Transition, "aria-labelledby": "form-dialog-title", fullScreen: fullScreen, disableEscapeKeyDown: true }, { children: _jsx(Grid, __assign({ container: true, direction: "column", sx: {
43
- height: "100%",
44
- overflowY: "hidden",
45
- }, component: noForm ? "div" : "form", onSubmit: noForm
46
- ? undefined
47
- : function (e) {
48
- e.preventDefault();
49
- e.stopPropagation();
50
- onSubmit();
51
- } }, { children: _jsx(Content, __assign({}, rest, { noForm: noForm, onClose: onClose, onSubmit: onSubmit }), void 0) }), void 0) }), void 0));
39
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Dialog, __assign({ open: open, onClose: function (_, reason) {
40
+ if (reason !== "backdropClick") {
41
+ onClose();
42
+ }
43
+ }, maxWidth: maxWidth, fullWidth: true, TransitionComponent: Transition, "aria-labelledby": "form-dialog-title", fullScreen: fullScreen, disableEscapeKeyDown: true }, { children: _jsx(Grid, __assign({ component: noForm ? "div" : "form", onSubmit: noForm
44
+ ? undefined
45
+ : function (e) {
46
+ e.preventDefault();
47
+ e.stopPropagation();
48
+ onSubmit();
49
+ } }, { children: _jsx(Content, __assign({}, rest, { noForm: noForm, onClose: onClose, onSubmit: onSubmit })) })) })) })));
52
50
  }
53
51
  export default BasicModal;
54
52
  export * from "./types";
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { ReactNode, CSSProperties } from "react";
2
2
  import { ButtonProps } from "@mui/material/Button";
3
3
  export interface BasicModalContentProps {
4
4
  children: ReactNode;
@@ -19,4 +19,6 @@ export interface BasicModalContentProps {
19
19
  export interface BasicModalProps extends BasicModalContentProps {
20
20
  open?: boolean;
21
21
  maxWidth?: "xs" | "sm" | "md" | "lg" | "xl";
22
+ primaryColor?: CSSProperties["color"];
23
+ secondaryColor?: CSSProperties["color"];
22
24
  }
@@ -0,0 +1,4 @@
1
+ import { BreadCrumbsProps } from "./types";
2
+ declare function Crumbs(props: BreadCrumbsProps): JSX.Element;
3
+ export default Crumbs;
4
+ export * from "./types";
@@ -0,0 +1,37 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useCallback } from "react";
14
+ import { navigate } from "@reach/router";
15
+ import Breadcrumbs from "@mui/material/Breadcrumbs";
16
+ import Typography from "@mui/material/Typography";
17
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
18
+ import NavigateNextIcon from "@mui/icons-material/NavigateNext";
19
+ import useCustomTheme from "../useCustomTheme";
20
+ function Crumbs(props) {
21
+ var routes = props.routes, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor;
22
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
23
+ var onNavigateTo = useCallback(function (url) {
24
+ navigate(url, { replace: true });
25
+ }, []);
26
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsxs(Breadcrumbs, __assign({ "aria-label": "breadcrumb", separator: _jsx(NavigateNextIcon, { fontSize: "small" }) }, { children: [_jsx(Typography, {}), routes.map(function (route) {
27
+ var href = route.href, label = route.label;
28
+ return href ? (_jsx(Typography, __assign({ variant: "body2", color: "inherit", sx: {
29
+ "&:hover": {
30
+ cursor: "pointer",
31
+ color: theme.palette.primary.light,
32
+ },
33
+ }, onClick: function () { return onNavigateTo(href); } }, { children: label }), label)) : (_jsx(Typography, __assign({ variant: "body2", color: "primary" }, { children: label }), label));
34
+ })] })) })));
35
+ }
36
+ export default Crumbs;
37
+ export * from "./types";
@@ -0,0 +1,9 @@
1
+ import { CSSProperties } from "react";
2
+ export interface BreadCrumbsProps {
3
+ routes: Array<{
4
+ href?: string;
5
+ label: string;
6
+ }>;
7
+ primaryColor?: CSSProperties["color"];
8
+ secondaryColor?: CSSProperties["color"];
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { CheckBoxProps } from "./types";
2
+ export declare function CheckBox(props: CheckBoxProps): JSX.Element;
3
+ export default CheckBox;
@@ -0,0 +1,36 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import Checkbox from "@mui/material/Checkbox";
25
+ import FormControlLabel from "@mui/material/FormControlLabel";
26
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
27
+ import useCustomTheme from "../useCustomTheme";
28
+ export function CheckBox(props) {
29
+ var label = props.label, onChange = props.onChange, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, rest = __rest(props, ["label", "onChange", "primaryColor", "secondaryColor"]);
30
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
31
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, __assign({ onChange: function (event) {
32
+ event.stopPropagation();
33
+ onChange(event.target.checked);
34
+ } }, rest)), label: label }) })));
35
+ }
36
+ export default CheckBox;
@@ -0,0 +1,3 @@
1
+ import { CheckBoxGroupProps } from "./types";
2
+ export declare function CheckBoxGroup(props: CheckBoxGroupProps): JSX.Element;
3
+ export default CheckBoxGroup;
@@ -0,0 +1,30 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import FormGroup from "@mui/material/FormGroup";
25
+ import CheckBox from "./CheckBox";
26
+ export function CheckBoxGroup(props) {
27
+ var checkboxes = props.checkboxes, rest = __rest(props, ["checkboxes"]);
28
+ return (_jsx(FormGroup, __assign({}, rest, { children: checkboxes.map(function (checkbox, index) { return (_jsx(CheckBox, __assign({}, checkbox), index)); }) })));
29
+ }
30
+ export default CheckBoxGroup;
@@ -0,0 +1,3 @@
1
+ export { default as CheckBox } from "./CheckBox";
2
+ export { default as CheckBoxGroup } from "./CheckBoxGroup";
3
+ export * from "./types";
@@ -0,0 +1,3 @@
1
+ export { default as CheckBox } from "./CheckBox";
2
+ export { default as CheckBoxGroup } from "./CheckBoxGroup";
3
+ export * from "./types";
@@ -0,0 +1,12 @@
1
+ import { CSSProperties, ReactNode } from "react";
2
+ import { CheckboxProps } from "@mui/material/Checkbox";
3
+ import { FormGroupProps } from "@mui/material/FormGroup";
4
+ export interface CheckBoxProps extends Omit<CheckboxProps, "onChange"> {
5
+ label: string | ReactNode;
6
+ onChange: (val: boolean) => void;
7
+ primaryColor?: CSSProperties["color"];
8
+ secondaryColor?: CSSProperties["color"];
9
+ }
10
+ export interface CheckBoxGroupProps extends FormGroupProps {
11
+ checkboxes: Array<CheckBoxProps>;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { CopyrightProps } from "./types";
2
+ declare function Copyright(props: CopyrightProps): JSX.Element;
3
+ export default Copyright;
4
+ export * from "./types";
@@ -0,0 +1,25 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Link from "@mui/material/Link";
14
+ import Typography from "@mui/material/Typography";
15
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
16
+ import useCustomTheme from "../useCustomTheme";
17
+ function Copyright(props) {
18
+ var primaryColor = props.primaryColor, secondaryColor = props.secondaryColor;
19
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
20
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsxs(Typography, __assign({ variant: "body2", color: "textSecondary", align: "center" }, { children: ["Copyright © ", _jsx(Link, __assign({ color: "inherit", href: "https://symply.io/" }, { children: "Symply Software Inc" })), "\u00A0", new Date().getFullYear() > 2020
21
+ ? "2020-".concat(new Date().getFullYear())
22
+ : new Date().getFullYear(), "."] })) })));
23
+ }
24
+ export default Copyright;
25
+ export * from "./types";
@@ -0,0 +1,5 @@
1
+ import { CSSProperties } from "react";
2
+ export interface CopyrightProps {
3
+ primaryColor?: CSSProperties["color"];
4
+ secondaryColor?: CSSProperties["color"];
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,4 @@
1
- /// <reference types="react" />
2
- import { TextFieldProps } from "@mui/material/TextField";
3
1
  import { DigitInputProps } from "./types";
4
- declare type TextProps = Omit<TextFieldProps, "onChange">;
5
- declare function DigitInput(props: DigitInputProps & TextProps): JSX.Element;
2
+ declare function DigitInput(props: DigitInputProps): JSX.Element;
6
3
  export default DigitInput;
7
4
  export * from "./types";
@@ -23,13 +23,16 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import Tooltip from "@mui/material/Tooltip";
25
25
  import Field from "@mui/material/TextField";
26
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
26
27
  import useInteractions from "./useInteractions";
28
+ import useCustomTheme from "../useCustomTheme";
27
29
  function DigitInput(props) {
28
- var onChange = props.onChange, value = props.value, _a = props.size, size = _a === void 0 ? "small" : _a, tooltip = props.tooltip, error = props.error, helperText = props.helperText, _b = props.maxLength, maxLength = _b === void 0 ? 999 : _b, _c = props.minLength, minLength = _c === void 0 ? 0 : _c, endAdornment = props.endAdornment, rest = __rest(props, ["onChange", "value", "size", "tooltip", "error", "helperText", "maxLength", "minLength", "endAdornment"]);
30
+ var onChange = props.onChange, value = props.value, _a = props.size, size = _a === void 0 ? "small" : _a, tooltip = props.tooltip, _b = props.maxLength, maxLength = _b === void 0 ? 999 : _b, _c = props.minLength, minLength = _c === void 0 ? 0 : _c, endAdornment = props.endAdornment, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, rest = __rest(props, ["onChange", "value", "size", "tooltip", "maxLength", "minLength", "endAdornment", "primaryColor", "secondaryColor"]);
29
31
  var _d = useInteractions({ onChange: onChange }), tooltipOpen = _d.tooltipOpen, handleChange = _d.handleChange, onOpenTooltip = _d.onOpenTooltip, onCloseTooltip = _d.onCloseTooltip;
30
- return (_jsx(Tooltip, __assign({ title: tooltip !== null && tooltip !== void 0 ? tooltip : "", open: !!tooltip && tooltipOpen }, { children: _jsx(Field, __assign({ size: size, margin: "dense", type: "number", value: value === undefined || value === null ? "" : value, onFocus: onOpenTooltip, onBlur: onCloseTooltip, inputProps: { maxLength: maxLength, minLength: minLength }, InputProps: {
31
- endAdornment: endAdornment,
32
- }, onChange: handleChange }, rest), void 0) }), void 0));
32
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
33
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Tooltip, __assign({ title: tooltip !== null && tooltip !== void 0 ? tooltip : "", open: !!tooltip && tooltipOpen }, { children: _jsx(Field, __assign({ size: size, margin: "dense", type: "text", value: value === undefined || value === null ? "" : value, onFocus: onOpenTooltip, onBlur: onCloseTooltip, inputProps: { maxLength: maxLength, minLength: minLength }, InputProps: {
34
+ endAdornment: endAdornment
35
+ }, onChange: handleChange }, rest)) })) })));
33
36
  }
34
37
  export default DigitInput;
35
38
  export * from "./types";
@@ -1,9 +1,13 @@
1
+ import { CSSProperties } from "react";
1
2
  import { InputProps } from "@mui/material/Input";
2
- export interface DigitInputProps {
3
+ import { TextFieldProps } from "@mui/material/TextField";
4
+ export interface DigitInputProps extends Omit<TextFieldProps, "onChange"> {
3
5
  onChange: (value: string) => void;
4
6
  value: string;
5
7
  tooltip?: string;
6
8
  maxLength?: number;
7
9
  minLength?: number;
8
10
  endAdornment?: InputProps["endAdornment"];
11
+ primaryColor?: CSSProperties["color"];
12
+ secondaryColor?: CSSProperties["color"];
9
13
  }
@@ -7,6 +7,8 @@ export interface HeaderBarProps {
7
7
  bottomEl?: ReactElement;
8
8
  buttons?: Array<HeaderButtonProps>;
9
9
  showBackButton?: boolean;
10
+ primaryColor?: CSSProperties["color"];
11
+ secondaryColor?: CSSProperties["color"];
10
12
  onBack?: () => void;
11
13
  }
12
14
  declare function HeaderBar(props: HeaderBarProps): JSX.Element;
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
13
  import { cloneElement, useMemo } from "react";
14
- import useTheme from "@mui/material/styles/useTheme";
14
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
15
15
  import useMediaQuery from "@mui/material/useMediaQuery";
16
16
  import Typography from "@mui/material/Typography";
17
17
  import Grid from "@mui/material/Grid";
@@ -19,13 +19,14 @@ import IconButton from "@mui/material/IconButton";
19
19
  import ArrowBackIcon from "@mui/icons-material/ArrowBack";
20
20
  import HeaderLine from "./HeaderLine";
21
21
  import HeaderButtons from "./HeaderButtons";
22
+ import useCustomTheme from "../useCustomTheme";
22
23
  function HeaderBar(props) {
23
- var title = props.title, color = props.color, subtitle = props.subtitle, bottomEl = props.bottomEl, _a = props.buttons, buttons = _a === void 0 ? [] : _a, showBackButton = props.showBackButton, onBack = props.onBack;
24
- var theme = useTheme();
24
+ var title = props.title, color = props.color, subtitle = props.subtitle, bottomEl = props.bottomEl, _a = props.buttons, buttons = _a === void 0 ? [] : _a, showBackButton = props.showBackButton, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onBack = props.onBack;
25
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
25
26
  var isLessThanSm = useMediaQuery(theme.breakpoints.down("sm"));
26
27
  var hasButtons = useMemo(function () { return buttons.length > 0; }, [buttons.length]);
27
- return (_jsxs(Grid, __assign({ sx: { mb: 1 } }, { children: [_jsxs(Grid, __assign({ container: true, direction: "row", justifyContent: "flex-start", alignItems: "center" }, { children: [_jsx(Grid, __assign({ item: true, xs: 12, sm: hasButtons ? 6 : 12, md: hasButtons ? 5 : 12, lg: hasButtons ? 4 : 12, xl: hasButtons ? 3 : 12 }, { children: _jsxs(Grid, __assign({ container: true, direction: "row", justifyContent: "flex-start", alignItems: "center" }, { children: [showBackButton && (_jsx(IconButton, __assign({ onClick: function () {
28
- onBack ? onBack() : window.history.back();
29
- } }, { children: _jsx(ArrowBackIcon, { fontSize: "small" }, void 0) }), void 0)), _jsx(Typography, __assign({ align: "left", variant: isLessThanSm ? "h6" : "h3", sx: { fontWeight: 600 } }, { children: title }), void 0)] }), void 0) }), void 0), hasButtons ? (_jsx(Grid, __assign({ item: true, xs: 12, sm: 6, md: 7, lg: 8, xl: 9 }, { children: _jsx(HeaderButtons, { buttons: buttons }, void 0) }), void 0)) : (_jsx(_Fragment, {}, void 0))] }), void 0), _jsx(Grid, __assign({ container: true, direction: "row" }, { children: _jsx(Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: _jsx(HeaderLine, { color: color }, void 0) }), void 0) }), void 0), subtitle && (_jsx(Grid, __assign({ container: true, direction: "row" }, { children: _jsx(Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: typeof subtitle === "string" ? (_jsx(Typography, { children: subtitle }, void 0)) : (cloneElement(subtitle)) }), void 0) }), void 0)), bottomEl && (_jsx(Grid, __assign({ container: true, direction: "row" }, { children: _jsx(Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: cloneElement(bottomEl) }), void 0) }), void 0))] }), void 0));
28
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsxs(Grid, __assign({ sx: { mb: 1 } }, { children: [_jsxs(Grid, __assign({ container: true, direction: "row", justifyContent: "flex-start", alignItems: "center" }, { children: [_jsx(Grid, __assign({ item: true, xs: 12, sm: hasButtons ? 6 : 12, md: hasButtons ? 5 : 12, lg: hasButtons ? 4 : 12, xl: hasButtons ? 3 : 12 }, { children: _jsxs(Grid, __assign({ container: true, direction: "row", justifyContent: "flex-start", alignItems: "center" }, { children: [showBackButton && (_jsx(IconButton, __assign({ onClick: function () {
29
+ onBack ? onBack() : window.history.back();
30
+ } }, { children: _jsx(ArrowBackIcon, { fontSize: "small" }) }))), _jsx(Typography, __assign({ align: "left", variant: isLessThanSm ? "h6" : "h3", sx: { fontWeight: 600 } }, { children: title }))] })) })), hasButtons ? (_jsx(Grid, __assign({ item: true, xs: 12, sm: 6, md: 7, lg: 8, xl: 9 }, { children: _jsx(HeaderButtons, { buttons: buttons }) }))) : (_jsx(_Fragment, {}))] })), _jsx(Grid, __assign({ container: true, direction: "row" }, { children: _jsx(Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: _jsx(HeaderLine, { color: color }) })) })), subtitle && (_jsx(Grid, __assign({ container: true, direction: "row" }, { children: _jsx(Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: typeof subtitle === "string" ? (_jsx(Typography, { children: subtitle })) : (cloneElement(subtitle)) })) }))), bottomEl && (_jsx(Grid, __assign({ container: true, direction: "row" }, { children: _jsx(Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: cloneElement(bottomEl) })) })))] })) })));
30
31
  }
31
32
  export default HeaderBar;