@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
@@ -0,0 +1,14 @@
1
+ import { MouseEvent, ChangeEvent, CSSProperties } from "react";
2
+ export interface TablePaginationActionsProps {
3
+ count: number;
4
+ page: number;
5
+ rowsPerPage: number;
6
+ onPageChange: (event: MouseEvent<HTMLButtonElement> | null, newPage: number) => void;
7
+ }
8
+ export interface TablePaginationProps extends TablePaginationActionsProps {
9
+ colSpan: number;
10
+ rowsPerPageOptions?: Array<number>;
11
+ onRowsPerPageChange: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
12
+ primaryColor?: CSSProperties["color"];
13
+ secondaryColor?: CSSProperties["color"];
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import { MouseEvent } from "react";
2
+ interface InteractionProps {
3
+ count: number;
4
+ page: number;
5
+ rowsPerPage: number;
6
+ onPageChange: (event: MouseEvent<HTMLButtonElement> | null, newPage: number) => void;
7
+ }
8
+ declare function useInteractions(props: InteractionProps): {
9
+ onBackButtonClick: (event: MouseEvent<HTMLButtonElement>) => void;
10
+ onNextButtonClick: (event: MouseEvent<HTMLButtonElement>) => void;
11
+ onLastPageButtonClick: (event: MouseEvent<HTMLButtonElement>) => void;
12
+ onFirstPageButtonClick: (event: MouseEvent<HTMLButtonElement>) => void;
13
+ };
14
+ export default useInteractions;
@@ -0,0 +1,23 @@
1
+ import { useCallback } from "react";
2
+ function useInteractions(props) {
3
+ var count = props.count, page = props.page, rowsPerPage = props.rowsPerPage, onPageChange = props.onPageChange;
4
+ var onFirstPageButtonClick = useCallback(function (event) {
5
+ onPageChange(event, 0);
6
+ }, [onPageChange]);
7
+ var onBackButtonClick = useCallback(function (event) {
8
+ onPageChange(event, page - 1);
9
+ }, [onPageChange, page]);
10
+ var onNextButtonClick = useCallback(function (event) {
11
+ onPageChange(event, page + 1);
12
+ }, [onPageChange, page]);
13
+ var onLastPageButtonClick = useCallback(function (event) {
14
+ onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
15
+ }, [count, onPageChange, rowsPerPage]);
16
+ return {
17
+ onBackButtonClick: onBackButtonClick,
18
+ onNextButtonClick: onNextButtonClick,
19
+ onLastPageButtonClick: onLastPageButtonClick,
20
+ onFirstPageButtonClick: onFirstPageButtonClick,
21
+ };
22
+ }
23
+ export default useInteractions;
@@ -1,12 +1,13 @@
1
- /// <reference types="react" />
1
+ import { CSSProperties } from "react";
2
2
  import { TextFieldProps } from "@mui/material/TextField";
3
- declare type TextProps = Omit<TextFieldProps, "onChange">;
4
- export interface TextInputProps {
3
+ export interface TextInputProps extends Omit<TextFieldProps, "onChange"> {
5
4
  onChange: (value: string) => void;
6
5
  value: string;
7
6
  tooltip?: TextFieldProps;
8
7
  maxLength?: number;
9
8
  minLength?: number;
9
+ primaryColor?: CSSProperties["color"];
10
+ secondaryColor?: CSSProperties["color"];
10
11
  }
11
- declare const TextInput: (props: TextInputProps & TextProps) => JSX.Element;
12
+ declare const TextInput: (props: TextInputProps) => JSX.Element;
12
13
  export default TextInput;
@@ -23,13 +23,26 @@ 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
  var TextInput = function (props) {
28
- var _a = props.type, type = _a === void 0 ? "text" : _a, onChange = props.onChange, value = props.value, _b = props.size, size = _b === void 0 ? "small" : _b, tooltip = props.tooltip, _c = props.maxLength, maxLength = _c === void 0 ? 999 : _c, _d = props.minLength, minLength = _d === void 0 ? 0 : _d, rest = __rest(props, ["type", "onChange", "value", "size", "tooltip", "maxLength", "minLength"]);
30
+ var _a = props.type, type = _a === void 0 ? "text" : _a, onChange = props.onChange, value = props.value, _b = props.size, size = _b === void 0 ? "small" : _b, tooltip = props.tooltip, _c = props.maxLength, maxLength = _c === void 0 ? 999 : _c, _d = props.minLength, minLength = _d === void 0 ? 0 : _d, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onBlur = props.onBlur, onFocus = props.onFocus, rest = __rest(props, ["type", "onChange", "value", "size", "tooltip", "maxLength", "minLength", "primaryColor", "secondaryColor", "onBlur", "onFocus"]);
31
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
29
32
  var _e = useInteractions(), tooltipOpen = _e.tooltipOpen, onOpenTooltip = _e.onOpenTooltip, onCloseTooltip = _e.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: type, value: value, onFocus: onOpenTooltip, onBlur: onCloseTooltip, onChange: function (event) {
31
- event.preventDefault();
32
- onChange(event.target.value);
33
- }, inputProps: { maxLength: maxLength, minLength: minLength } }, rest), void 0) }), void 0));
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: type, value: value, onFocus: function (event) {
34
+ onOpenTooltip();
35
+ if (onFocus) {
36
+ onFocus(event);
37
+ }
38
+ }, onBlur: function (event) {
39
+ onCloseTooltip();
40
+ if (onBlur) {
41
+ onBlur(event);
42
+ }
43
+ }, onChange: function (event) {
44
+ event.preventDefault();
45
+ onChange(event.target.value);
46
+ }, inputProps: { maxLength: maxLength, minLength: minLength } }, rest)) })) })));
34
47
  };
35
48
  export default TextInput;
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import Typography from "@mui/material/Typography";
25
- import useTheme from "@mui/material/styles/useTheme";
25
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
26
26
  import Slide from "@mui/material/Slide";
27
27
  import SnackbarContent from "@mui/material/SnackbarContent";
28
28
  import Snackbar from "@mui/material/Snackbar";
@@ -31,50 +31,51 @@ import ErrorIcon from "@mui/icons-material/Error";
31
31
  import WarningIcon from "@mui/icons-material/Warning";
32
32
  import SuccessIcon from "@mui/icons-material/CheckCircle";
33
33
  import { green, amber, red, blue } from "@mui/material/colors";
34
+ import useCustomTheme from "../useCustomTheme";
34
35
  var ToastPrompt = function (props) {
35
36
  var _a;
36
- var _b = props.open, open = _b === void 0 ? false : _b, _c = props.vertical, vertical = _c === void 0 ? "top" : _c, _d = props.horizontal, horizontal = _d === void 0 ? "center" : _d, _e = props.timeout, timeout = _e === void 0 ? 3000 : _e, onClose = props.onClose, _f = props.transitionDirection, transitionDirection = _f === void 0 ? "down" : _f, _g = props.message, message = _g === void 0 ? "Unknown message" : _g, _h = props.icon, icon = _h === void 0 ? _jsx(_Fragment, {}, void 0) : _h, _j = props.variant, variant = _j === void 0 ? "info" : _j, other = __rest(props, ["open", "vertical", "horizontal", "timeout", "onClose", "transitionDirection", "message", "icon", "variant"]);
37
- var theme = useTheme();
37
+ var _b = props.open, open = _b === void 0 ? false : _b, _c = props.vertical, vertical = _c === void 0 ? "top" : _c, _d = props.horizontal, horizontal = _d === void 0 ? "center" : _d, _e = props.timeout, timeout = _e === void 0 ? 3000 : _e, onClose = props.onClose, _f = props.transitionDirection, transitionDirection = _f === void 0 ? "down" : _f, _g = props.message, message = _g === void 0 ? "Unknown message" : _g, _h = props.icon, icon = _h === void 0 ? _jsx(_Fragment, {}) : _h, _j = props.variant, variant = _j === void 0 ? "info" : _j, other = __rest(props, ["open", "vertical", "horizontal", "timeout", "onClose", "transitionDirection", "message", "icon", "variant"]);
38
+ var theme = useCustomTheme();
38
39
  var styles = {
39
40
  success: {
40
- backgroundColor: green[600],
41
+ backgroundColor: green[600]
41
42
  },
42
43
  error: {
43
- backgroundColor: red[700],
44
+ backgroundColor: red[700]
44
45
  },
45
46
  info: {
46
- backgroundColor: blue[600],
47
+ backgroundColor: blue[600]
47
48
  },
48
49
  warning: {
49
- backgroundColor: amber[900],
50
- },
50
+ backgroundColor: amber[900]
51
+ }
51
52
  };
52
53
  var Transition = function (args) {
53
- return _jsx(Slide, __assign({}, args, { direction: transitionDirection }), void 0);
54
+ return _jsx(Slide, __assign({}, args, { direction: transitionDirection }));
54
55
  };
55
56
  var VariantIcon = {
56
57
  success: SuccessIcon,
57
58
  warning: WarningIcon,
58
59
  error: ErrorIcon,
59
- info: InfoIcon,
60
+ info: InfoIcon
60
61
  };
61
62
  var Icon = VariantIcon[variant];
62
- return (_jsx(Snackbar, __assign({ anchorOrigin: { vertical: vertical, horizontal: horizontal }, open: open, onClose: onClose, autoHideDuration: timeout, TransitionComponent: Transition, sx: {
63
- zIndex: 99999,
64
- marginTop: "3vh",
65
- } }, { children: _jsx(SnackbarContent, __assign({ sx: __assign(__assign({}, styles[variant]), { root: (_a = {},
66
- _a[theme.breakpoints.down("sm")] = {
67
- maxWidth: "320px",
68
- borderRadius: "4px",
69
- },
70
- _a) }), "aria-describedby": "Toast", message: _jsxs(Typography, __assign({ id: "Toast", component: "span", sx: {
71
- fontSize: 14,
72
- display: "flex",
73
- alignItems: "center",
74
- } }, { children: [variant ? (_jsx(Icon, { sx: {
75
- fontSize: 20,
76
- opacity: 0.9,
77
- marginRight: theme.spacing(1),
78
- } }, void 0)) : (_jsx(_Fragment, { children: icon }, void 0)), message] }), void 0) }, other), void 0) }), "".concat(Date.now() * Math.round(Math.random()))));
63
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Snackbar, __assign({ anchorOrigin: { vertical: vertical, horizontal: horizontal }, open: open, onClose: onClose, autoHideDuration: timeout, TransitionComponent: Transition, sx: {
64
+ zIndex: 99999,
65
+ marginTop: "3vh"
66
+ } }, { children: _jsx(SnackbarContent, __assign({ sx: __assign(__assign({}, styles[variant]), { root: (_a = {},
67
+ _a[theme.breakpoints.down("sm")] = {
68
+ maxWidth: "320px",
69
+ borderRadius: "4px"
70
+ },
71
+ _a) }), "aria-describedby": "Toast", message: _jsxs(Typography, __assign({ id: "Toast", component: "span", sx: {
72
+ fontSize: 14,
73
+ display: "flex",
74
+ alignItems: "center"
75
+ } }, { children: [variant ? (_jsx(Icon, { sx: {
76
+ fontSize: 20,
77
+ opacity: 0.9,
78
+ marginRight: theme.spacing(1)
79
+ } })) : (_jsx(_Fragment, { children: icon })), message] })) }, other)) }), "".concat(Date.now() * Math.round(Math.random()))) })));
79
80
  };
80
81
  export default ToastPrompt;
@@ -22,7 +22,7 @@ export var PromptProvider = function (props) {
22
22
  var _a = ((toastRef === null || toastRef === void 0 ? void 0 : toastRef.current) || {}).show, show = _a === void 0 ? function () { } : _a;
23
23
  show(type, message, timeout);
24
24
  }
25
- return (_jsx(PromptContext.Provider, __assign({ value: { showPrompt: showPrompt } }, { children: _jsxs(_Fragment, { children: [children, _jsx(Logics, __assign({ ref: toastRef }, { children: _jsx(ToastPrompt, {}, void 0) }), void 0)] }, void 0) }), void 0));
25
+ return (_jsx(PromptContext.Provider, __assign({ value: { showPrompt: showPrompt } }, { children: _jsxs(_Fragment, { children: [children, _jsx(Logics, __assign({ ref: toastRef }, { children: _jsx(ToastPrompt, {}) }))] }) })));
26
26
  };
27
27
  export function usePrompt() {
28
28
  return useContext(PromptContext);
@@ -1,6 +1,4 @@
1
- /// <reference types="react" />
2
- import { ReactPlayerProps } from "react-player";
3
1
  import { VideoPlayerModalProps } from "./types";
4
- declare function VideoPlayerModal(props: VideoPlayerModalProps & ReactPlayerProps): JSX.Element;
2
+ declare function VideoPlayerModal(props: VideoPlayerModalProps): JSX.Element;
5
3
  export default VideoPlayerModal;
6
4
  export * from "./types";
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import ReactPlayer from "react-player";
25
25
  import Grid from "@mui/material/Grid";
26
26
  import Dialog from "@mui/material/Dialog";
@@ -28,15 +28,16 @@ import DialogTitle from "@mui/material/DialogTitle";
28
28
  import DialogContent from "@mui/material/DialogContent";
29
29
  import DialogActions from "@mui/material/DialogActions";
30
30
  import Button from "@mui/material/Button";
31
- import useTheme from "@mui/material/styles/useTheme";
32
31
  import useMediaQuery from "@mui/material/useMediaQuery";
32
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
33
+ import useCustomTheme from "../useCustomTheme";
33
34
  function VideoPlayerModal(props) {
34
- var url = props.url, _a = props.pip, pip = _a === void 0 ? false : _a, _b = props.open, open = _b === void 0 ? false : _b, title = props.title, onClose = props.onClose, _c = props.extraButtons, extraButtons = _c === void 0 ? [] : _c, playerProps = __rest(props, ["url", "pip", "open", "title", "onClose", "extraButtons"]);
35
- var theme = useTheme();
35
+ var url = props.url, _a = props.pip, pip = _a === void 0 ? false : _a, _b = props.open, open = _b === void 0 ? false : _b, title = props.title, onClose = props.onClose, _c = props.extraButtons, extraButtons = _c === void 0 ? [] : _c, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, playerProps = __rest(props, ["url", "pip", "open", "title", "onClose", "extraButtons", "primaryColor", "secondaryColor"]);
36
+ var theme = useCustomTheme();
36
37
  var fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
37
- return (_jsx(_Fragment, { children: _jsxs(Dialog, __assign({ open: open, fullScreen: fullScreen, onClose: onClose, fullWidth: true, maxWidth: "lg", "aria-labelledby": "react-video-dialog" }, { children: [title && _jsx(DialogTitle, { children: title }, void 0), _jsx(DialogContent, { children: _jsx(ReactPlayer, __assign({ controls: true, url: url, style: { minHeight: "480px" }, width: "100%", config: {
38
- file: { attributes: { disablePictureInPicture: !pip } },
39
- } }, playerProps), void 0) }, void 0), _jsxs(DialogActions, { children: [extraButtons.map(function (buttonProps, index) { return (_jsx(Grid, __assign({ item: true, xs: 12, md: 3, lg: 2 }, { children: _jsx(Button, __assign({}, buttonProps), void 0) }), "extraButton_".concat(index))); }), _jsx(Button, __assign({ variant: "outlined", color: "secondary", onClick: onClose }, { children: "Close" }), void 0)] }, void 0)] }), void 0) }, void 0));
38
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsxs(Dialog, __assign({ open: open, fullScreen: fullScreen, onClose: onClose, fullWidth: true, maxWidth: "lg", "aria-labelledby": "react-video-dialog" }, { children: [title && _jsx(DialogTitle, { children: title }), _jsx(DialogContent, { children: _jsx(ReactPlayer, __assign({ controls: true, url: url, style: { minHeight: "480px" }, width: "100%", config: {
39
+ file: { attributes: { disablePictureInPicture: !pip } }
40
+ } }, playerProps)) }), _jsxs(DialogActions, { children: [extraButtons.map(function (buttonProps, index) { return (_jsx(Grid, __assign({ item: true, xs: 12, md: 3, lg: 2 }, { children: _jsx(Button, __assign({}, buttonProps)) }), "extraButton_".concat(index))); }), _jsx(Button, __assign({ variant: "outlined", color: "secondary", onClick: onClose }, { children: "Close" }))] })] })) })));
40
41
  }
41
42
  export default VideoPlayerModal;
42
43
  export * from "./types";
@@ -1,8 +1,12 @@
1
+ import { CSSProperties } from "react";
1
2
  import { ButtonProps } from "@mui/material/Button";
2
- export interface VideoPlayerModalProps {
3
+ import { ReactPlayerProps } from "react-player";
4
+ export interface VideoPlayerModalProps extends ReactPlayerProps {
3
5
  title?: string;
4
6
  open: boolean;
5
7
  pip?: boolean;
6
8
  extraButtons?: Array<ButtonProps>;
9
+ primaryColor?: CSSProperties["color"];
10
+ secondaryColor?: CSSProperties["color"];
7
11
  onClose: () => void;
8
12
  }
package/index.d.ts CHANGED
@@ -1,7 +1,13 @@
1
1
  export * from "./AlertDialog";
2
+ export * from "./Autocomplete";
3
+ export * from "./AutocompleteWithFilter";
2
4
  export * from "./BasicModal";
5
+ export * from "./BreadCrumbs";
6
+ export * from "./CheckBox";
7
+ export * from "./Copyright";
3
8
  export * from "./DigitInput";
4
9
  export * from "./DynamicHeaderBar";
10
+ export * from "./FeinInput";
5
11
  export * from "./FormRadioGroup";
6
12
  export * from "./FormSelector";
7
13
  export * from "./HelpCaption";
@@ -11,13 +17,19 @@ export * from "./NumberInput";
11
17
  export * from "./PasswordInput";
12
18
  export * from "./PhoneNumberInput";
13
19
  export * from "./TabGroup";
20
+ export * from "./TablePagination";
14
21
  export * from "./TextInput";
15
22
  export * from "./ToastPrompt";
16
23
  export * from "./VideoPlayerModal";
17
24
  export { default as AlertDialog } from "./AlertDialog";
25
+ export { default as Autocomplete } from "./Autocomplete";
26
+ export { default as AutocompleteWithFilter } from "./AutocompleteWithFilter";
18
27
  export { default as BasicModal } from "./BasicModal";
28
+ export { default as BreadCrumbs } from "./BreadCrumbs";
29
+ export { default as Copyright } from "./Copyright";
19
30
  export { default as DigitInput } from "./DigitInput";
20
31
  export { default as DynamicHeaderBar } from "./DynamicHeaderBar";
32
+ export { default as FeinInput } from "./FeinInput";
21
33
  export { default as FormRadioGroup } from "./FormRadioGroup";
22
34
  export { default as HelpCaption } from "./HelpCaption";
23
35
  export { default as LoadingModal } from "./LoadingModal";
@@ -25,5 +37,6 @@ export { default as MenuButtonGroup } from "./MenuButtonGroup";
25
37
  export { default as NumberInput } from "./NumberInput";
26
38
  export { default as PhoneNumberInput } from "./PhoneNumberInput";
27
39
  export { default as TabGroup } from "./TabGroup";
40
+ export { default as TablePagination } from "./TablePagination";
28
41
  export { default as TextInput } from "./TextInput";
29
42
  export { default as VideoPlayerModal } from "./VideoPlayerModal";
package/index.js CHANGED
@@ -1,7 +1,13 @@
1
1
  export * from "./AlertDialog";
2
+ export * from "./Autocomplete";
3
+ export * from "./AutocompleteWithFilter";
2
4
  export * from "./BasicModal";
5
+ export * from "./BreadCrumbs";
6
+ export * from "./CheckBox";
7
+ export * from "./Copyright";
3
8
  export * from "./DigitInput";
4
9
  export * from "./DynamicHeaderBar";
10
+ export * from "./FeinInput";
5
11
  export * from "./FormRadioGroup";
6
12
  export * from "./FormSelector";
7
13
  export * from "./HelpCaption";
@@ -11,13 +17,19 @@ export * from "./NumberInput";
11
17
  export * from "./PasswordInput";
12
18
  export * from "./PhoneNumberInput";
13
19
  export * from "./TabGroup";
20
+ export * from "./TablePagination";
14
21
  export * from "./TextInput";
15
22
  export * from "./ToastPrompt";
16
23
  export * from "./VideoPlayerModal";
17
24
  export { default as AlertDialog } from "./AlertDialog";
25
+ export { default as Autocomplete } from "./Autocomplete";
26
+ export { default as AutocompleteWithFilter } from "./AutocompleteWithFilter";
18
27
  export { default as BasicModal } from "./BasicModal";
28
+ export { default as BreadCrumbs } from "./BreadCrumbs";
29
+ export { default as Copyright } from "./Copyright";
19
30
  export { default as DigitInput } from "./DigitInput";
20
31
  export { default as DynamicHeaderBar } from "./DynamicHeaderBar";
32
+ export { default as FeinInput } from "./FeinInput";
21
33
  export { default as FormRadioGroup } from "./FormRadioGroup";
22
34
  export { default as HelpCaption } from "./HelpCaption";
23
35
  export { default as LoadingModal } from "./LoadingModal";
@@ -25,5 +37,6 @@ export { default as MenuButtonGroup } from "./MenuButtonGroup";
25
37
  export { default as NumberInput } from "./NumberInput";
26
38
  export { default as PhoneNumberInput } from "./PhoneNumberInput";
27
39
  export { default as TabGroup } from "./TabGroup";
40
+ export { default as TablePagination } from "./TablePagination";
28
41
  export { default as TextInput } from "./TextInput";
29
42
  export { default as VideoPlayerModal } from "./VideoPlayerModal";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symply.io/basic-components",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.20",
4
4
  "description": "Basic and reusable components for all frontend of Symply apps",
5
5
  "keywords": [
6
6
  "react",
@@ -44,10 +44,11 @@
44
44
  ],
45
45
  "devDependencies": {
46
46
  "@types/body-parser": "^1.19.2",
47
+ "@types/reach__router": "^1.3.10",
47
48
  "@types/react": "^17.0.27",
48
49
  "@types/react-dom": "^17.0.9",
49
50
  "babel-loader": "^8.2.2",
50
- "typescript": "^4.5.5"
51
+ "typescript": "~4.6.3"
51
52
  },
52
53
  "dependencies": {
53
54
  "@emotion/react": "^11.7.1",
@@ -55,9 +56,15 @@
55
56
  "@mui/icons-material": "^5.4.2",
56
57
  "@mui/material": "^5.4.2",
57
58
  "@mui/system": "^5.4.2",
59
+ "@reach/router": "^1.3.4",
60
+ "color-alpha": "^1.1.3",
58
61
  "react-player": "^2.9.0",
59
62
  "rifm": "^0.12.1"
60
63
  },
64
+ "resolutions": {
65
+ "@types/react": "17.0.27",
66
+ "@types/react-dom": "17.0.9"
67
+ },
61
68
  "scripts": {
62
69
  "build": "./node_modules/.bin/tsc"
63
70
  },
@@ -0,0 +1,6 @@
1
+ import { CSSProperties } from "react";
2
+ declare function useCustomTheme(props?: {
3
+ primaryColor?: CSSProperties["color"];
4
+ secondaryColor?: CSSProperties["color"];
5
+ }): import("@mui/material/styles").Theme;
6
+ export default useCustomTheme;
@@ -0,0 +1,51 @@
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 colorAlpha from "color-alpha";
13
+ import { createTheme } from "@mui/material/styles";
14
+ function useCustomTheme(props) {
15
+ var _a = props || {}, primaryColor = _a.primaryColor, secondaryColor = _a.secondaryColor;
16
+ var themeOptions = {
17
+ components: {
18
+ MuiButton: {
19
+ styleOverrides: {
20
+ root: {
21
+ whiteSpace: "nowrap",
22
+ fontWeight: 600,
23
+ fontFamily: "Dinpro"
24
+ }
25
+ }
26
+ }
27
+ },
28
+ typography: {
29
+ fontFamily: "Dinpro"
30
+ }
31
+ };
32
+ if (primaryColor) {
33
+ themeOptions = __assign(__assign({}, themeOptions), { palette: {
34
+ primary: {
35
+ main: primaryColor,
36
+ light: colorAlpha(primaryColor, 0.08)
37
+ }
38
+ } });
39
+ }
40
+ if (secondaryColor) {
41
+ themeOptions = __assign(__assign({}, themeOptions), { palette: {
42
+ secondary: {
43
+ main: secondaryColor,
44
+ light: colorAlpha(secondaryColor, 0.08)
45
+ }
46
+ } });
47
+ }
48
+ var theme = createTheme(themeOptions);
49
+ return theme;
50
+ }
51
+ export default useCustomTheme;