@symply.io/basic-components 1.0.0-alpha.8 → 1.0.0-beta.1

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 (123) hide show
  1. package/AlertDialog/index.d.ts +0 -1
  2. package/AlertDialog/index.js +2 -2
  3. package/Autocomplete/index.d.ts +4 -0
  4. package/Autocomplete/index.js +38 -0
  5. package/Autocomplete/types.d.ts +15 -0
  6. package/Autocomplete/types.js +1 -0
  7. package/Autocomplete/useInteractions.d.ts +5 -0
  8. package/Autocomplete/useInteractions.js +9 -0
  9. package/AutocompleteWithFilter/index.d.ts +4 -0
  10. package/AutocompleteWithFilter/index.js +54 -0
  11. package/AutocompleteWithFilter/types.d.ts +16 -0
  12. package/AutocompleteWithFilter/types.js +1 -0
  13. package/BasicModal/Content.d.ts +0 -1
  14. package/BasicModal/Content.js +1 -1
  15. package/BasicModal/index.d.ts +0 -1
  16. package/BasicModal/index.js +3 -6
  17. package/BreadCrumbs/index.d.ts +4 -0
  18. package/BreadCrumbs/index.js +37 -0
  19. package/BreadCrumbs/types.d.ts +9 -0
  20. package/BreadCrumbs/types.js +1 -0
  21. package/CheckBox/CheckBox.d.ts +3 -0
  22. package/CheckBox/CheckBox.js +36 -0
  23. package/CheckBox/CheckBoxGroup.d.ts +3 -0
  24. package/CheckBox/CheckBoxGroup.js +30 -0
  25. package/CheckBox/index.d.ts +3 -0
  26. package/CheckBox/index.js +3 -0
  27. package/CheckBox/types.d.ts +12 -0
  28. package/CheckBox/types.js +1 -0
  29. package/Copyright/index.d.ts +4 -0
  30. package/Copyright/index.js +25 -0
  31. package/Copyright/types.d.ts +5 -0
  32. package/Copyright/types.js +1 -0
  33. package/DateInput/FullDateInput/index.d.ts +5 -0
  34. package/DateInput/FullDateInput/index.js +66 -0
  35. package/DateInput/FullDateInput/types.d.ts +14 -0
  36. package/DateInput/FullDateInput/types.js +1 -0
  37. package/DateInput/FullDateInput/useInteractions.d.ts +8 -0
  38. package/DateInput/FullDateInput/useInteractions.js +20 -0
  39. package/DateInput/MonthDayInput/index.d.ts +5 -0
  40. package/DateInput/MonthDayInput/index.js +54 -0
  41. package/DateInput/MonthDayInput/types.d.ts +14 -0
  42. package/DateInput/MonthDayInput/types.js +1 -0
  43. package/DateInput/MonthDayInput/useInteractions.d.ts +8 -0
  44. package/DateInput/MonthDayInput/useInteractions.js +19 -0
  45. package/DateInput/MonthYearInput/index.d.ts +5 -0
  46. package/DateInput/MonthYearInput/index.js +55 -0
  47. package/DateInput/MonthYearInput/types.d.ts +14 -0
  48. package/DateInput/MonthYearInput/types.js +1 -0
  49. package/DateInput/MonthYearInput/useInteractions.d.ts +8 -0
  50. package/DateInput/MonthYearInput/useInteractions.js +19 -0
  51. package/DateInput/index.d.ts +6 -0
  52. package/DateInput/index.js +6 -0
  53. package/DigitInput/index.d.ts +1 -4
  54. package/DigitInput/index.js +3 -3
  55. package/DigitInput/types.d.ts +2 -1
  56. package/DynamicHeaderBar/HeaderBar.js +1 -1
  57. package/DynamicHeaderBar/HeaderButtons.d.ts +0 -1
  58. package/DynamicHeaderBar/HeaderButtons.js +5 -5
  59. package/DynamicHeaderBar/HeaderLine.js +1 -1
  60. package/DynamicHeaderBar/index.js +2 -2
  61. package/FeinInput/index.d.ts +6 -0
  62. package/FeinInput/index.js +73 -0
  63. package/FeinInput/types.d.ts +9 -0
  64. package/FeinInput/types.js +1 -0
  65. package/FeinInput/useInteractions.d.ts +8 -0
  66. package/FeinInput/useInteractions.js +16 -0
  67. package/FormRadioGroup/index.d.ts +0 -1
  68. package/FormRadioGroup/index.js +3 -3
  69. package/FormSelector/MultipleSelector.d.ts +0 -1
  70. package/FormSelector/MultipleSelector.js +14 -3
  71. package/FormSelector/SimpleSelector.d.ts +0 -1
  72. package/FormSelector/SimpleSelector.js +3 -3
  73. package/FormSelector/types.d.ts +2 -7
  74. package/HelpCaption/index.js +2 -2
  75. package/LoadingModal/index.d.ts +0 -1
  76. package/LoadingModal/index.js +1 -1
  77. package/MenuButtonGroup/MenuItem.d.ts +0 -1
  78. package/MenuButtonGroup/MenuItem.js +1 -1
  79. package/MenuButtonGroup/index.js +2 -2
  80. package/NumberInput/index.d.ts +2 -3
  81. package/NumberInput/index.js +1 -1
  82. package/PasswordInput/ConfirmPassword.d.ts +2 -3
  83. package/PasswordInput/ConfirmPassword.js +1 -1
  84. package/PasswordInput/Password.d.ts +3 -4
  85. package/PasswordInput/Password.js +2 -2
  86. package/PhoneNumberInput/index.d.ts +2 -3
  87. package/PhoneNumberInput/index.js +2 -2
  88. package/README.md +380 -14
  89. package/Sidebar/SidebarItem.d.ts +3 -0
  90. package/Sidebar/SidebarItem.js +62 -0
  91. package/Sidebar/SidebarItemsGroup.d.ts +5 -0
  92. package/Sidebar/SidebarItemsGroup.js +38 -0
  93. package/Sidebar/SidebarLink.d.ts +3 -0
  94. package/Sidebar/SidebarLink.js +37 -0
  95. package/Sidebar/index.d.ts +7 -0
  96. package/Sidebar/index.js +30 -0
  97. package/Sidebar/types.d.ts +31 -0
  98. package/Sidebar/types.js +1 -0
  99. package/SocialInput/index.d.ts +6 -0
  100. package/SocialInput/index.js +76 -0
  101. package/SocialInput/types.d.ts +9 -0
  102. package/SocialInput/types.js +1 -0
  103. package/SocialInput/useInteractions.d.ts +10 -0
  104. package/SocialInput/useInteractions.js +26 -0
  105. package/TabGroup/index.js +10 -5
  106. package/TablePagination/Actions.d.ts +3 -0
  107. package/TablePagination/Actions.js +27 -0
  108. package/TablePagination/index.d.ts +4 -0
  109. package/TablePagination/index.js +30 -0
  110. package/TablePagination/types.d.ts +14 -0
  111. package/TablePagination/types.js +1 -0
  112. package/TablePagination/useInteractions.d.ts +14 -0
  113. package/TablePagination/useInteractions.js +23 -0
  114. package/TextInput/index.d.ts +2 -3
  115. package/TextInput/index.js +13 -3
  116. package/ToastPrompt/Presentation.js +3 -3
  117. package/ToastPrompt/index.js +1 -1
  118. package/VideoPlayerModal/index.d.ts +1 -3
  119. package/VideoPlayerModal/index.js +2 -2
  120. package/VideoPlayerModal/types.d.ts +2 -1
  121. package/index.d.ts +18 -0
  122. package/index.js +18 -0
  123. package/package.json +8 -2
@@ -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;
@@ -32,7 +32,7 @@ import useMediaQuery from "@mui/material/useMediaQuery";
32
32
  import Slide from "@mui/material/Slide";
33
33
  import useCustomTheme from "../useCustomTheme";
34
34
  var Transition = forwardRef(function Transition(props, ref) {
35
- return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }), void 0);
35
+ return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }));
36
36
  });
37
37
  var AlertDialog = function (props) {
38
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"]);
@@ -42,7 +42,7 @@ var AlertDialog = function (props) {
42
42
  if (reason !== "backdropClick") {
43
43
  onClose();
44
44
  }
45
- }, "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) }), void 0));
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" }))) })] })) })));
46
46
  };
47
47
  export default AlertDialog;
48
48
  export * from "./types";
@@ -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;
@@ -30,7 +30,7 @@ import ThemeProvider from "@mui/material/styles/ThemeProvider";
30
30
  import Content from "./Content";
31
31
  import useCustomTheme from "../useCustomTheme";
32
32
  var Transition = forwardRef(function Transition(props, ref) {
33
- return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }), void 0);
33
+ return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }));
34
34
  });
35
35
  function BasicModal(props) {
36
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"]);
@@ -40,16 +40,13 @@ function BasicModal(props) {
40
40
  if (reason !== "backdropClick") {
41
41
  onClose();
42
42
  }
43
- }, maxWidth: maxWidth, fullWidth: true, TransitionComponent: Transition, "aria-labelledby": "form-dialog-title", fullScreen: fullScreen, disableEscapeKeyDown: true }, { children: _jsx(Grid, __assign({ container: true, direction: "column", sx: {
44
- height: "100%",
45
- overflowY: "hidden"
46
- }, component: noForm ? "div" : "form", onSubmit: noForm
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
47
44
  ? undefined
48
45
  : function (e) {
49
46
  e.preventDefault();
50
47
  e.stopPropagation();
51
48
  onSubmit();
52
- } }, { children: _jsx(Content, __assign({}, rest, { noForm: noForm, onClose: onClose, onSubmit: onSubmit }), void 0) }), void 0) }), void 0) }), void 0));
49
+ } }, { children: _jsx(Content, __assign({}, rest, { noForm: noForm, onClose: onClose, onSubmit: onSubmit })) })) })) })));
53
50
  }
54
51
  export default BasicModal;
55
52
  export * from "./types";
@@ -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 {};
@@ -0,0 +1,5 @@
1
+ import { DateInputprops } from "./types";
2
+ export declare function MonthDayYearFormat(str: string): string;
3
+ export declare function verifyDate(dateString: string): boolean;
4
+ declare function FullDateInput(props: DateInputprops): JSX.Element;
5
+ export default FullDateInput;
@@ -0,0 +1,66 @@
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 } from "react/jsx-runtime";
13
+ import { useRifm } from "rifm";
14
+ import TextField from "@mui/material/TextField";
15
+ import ThemeProvider from "@mui/material/styles/ThemeProvider";
16
+ import useInteractions from "./useInteractions";
17
+ import useCustomTheme from "../../useCustomTheme";
18
+ export function MonthDayYearFormat(str) {
19
+ var digits = (str.match(/\d+/g) || []).join("");
20
+ var chars = digits.split("");
21
+ return chars.reduce(function (prev, curr, index) {
22
+ if (index === 2) {
23
+ return "".concat(prev, " / ").concat(curr);
24
+ }
25
+ else if (index === 4) {
26
+ return "".concat(prev, " / ").concat(curr);
27
+ }
28
+ else {
29
+ return "".concat(prev).concat(curr);
30
+ }
31
+ }, "");
32
+ }
33
+ export function verifyDate(dateString) {
34
+ var reg = /^((((0[1,3,5,7,8]{1})|(1[0,2]{1}))\s?\/\s?((0[1-9]{1})|([1-2]{1}\d{1})|(3[0-1]{1})))|(((0[4,6,9]{1})|(11))\s?\/\s?((0[1-9]{1})|([1-2]{1}\d{1})|(30)))|((02)\s?\/\s?(0[1-9]{1}|[1-2]{1}\d{1})))\s?\/\s?\d{4}$/g;
35
+ if (reg.test(dateString)) {
36
+ var tmpArr = dateString.split("/");
37
+ var month = parseInt(tmpArr[0].trim(), 10);
38
+ var day = parseInt(tmpArr[1].trim(), 10);
39
+ var year = parseInt(tmpArr[2].trim(), 10);
40
+ var verifyLeapYear = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
41
+ if (month === 2 && !verifyLeapYear) {
42
+ return day < 29;
43
+ }
44
+ return true;
45
+ }
46
+ return false;
47
+ }
48
+ function FullDateInput(props) {
49
+ var name = props.name, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, value = props.value, _a = props.margin, margin = _a === void 0 ? "normal" : _a, error = props.error, _b = props.helperText, helperText = _b === void 0 ? "Please enter a valid date" : _b, verifyFn = props.verifyFn, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor;
50
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
51
+ var _c = useInteractions({ value: value }), valLength = _c.valLength, addMask = _c.addMask;
52
+ var rifm = useRifm({
53
+ mask: true,
54
+ value: String(value),
55
+ onChange: onChange,
56
+ replace: addMask,
57
+ format: MonthDayYearFormat
58
+ });
59
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(TextField, { placeholder: "MM / DD / YYYY", error: error ||
60
+ (valLength > 0 && (verifyFn ? !verifyFn(value) : !verifyDate(value))), margin: margin, name: name, value: rifm.value, onChange: rifm.onChange, helperText: valLength > 0 && (verifyFn ? !verifyFn(value) : !verifyDate(value))
61
+ ? helperText
62
+ : "", onFocus: onFocus, onBlur: onBlur, InputLabelProps: {
63
+ shrink: true
64
+ } }) })));
65
+ }
66
+ export default FullDateInput;
@@ -0,0 +1,14 @@
1
+ import { CSSProperties } from "react";
2
+ export interface DateInputprops {
3
+ name: string;
4
+ onChange: (value: string) => void;
5
+ onFocus?: () => void;
6
+ onBlur?: () => void;
7
+ verifyFn?: (value?: string) => boolean;
8
+ helperText?: string;
9
+ margin?: "none" | "normal" | "dense" | undefined;
10
+ error?: boolean;
11
+ value: string;
12
+ primaryColor?: CSSProperties["color"];
13
+ secondaryColor?: CSSProperties["color"];
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ interface InteractionProps {
2
+ value: string;
3
+ }
4
+ declare function useInteractions(props: InteractionProps): {
5
+ valLength: number;
6
+ addMask: (str: string) => string;
7
+ };
8
+ export default useInteractions;
@@ -0,0 +1,20 @@
1
+ import { useCallback, useMemo } from "react";
2
+ function useInteractions(props) {
3
+ var value = props.value;
4
+ var addMask = useCallback(function (str) {
5
+ var digits = (str.match(/\d+/g) || []).join("");
6
+ var month = digits.slice(0, 2).padEnd(2, "_");
7
+ var day = digits.slice(2, 4).padEnd(2, "_");
8
+ var Year = digits.slice(4, 8).padEnd(4, "_");
9
+ if (digits) {
10
+ return "".concat(month, " / ").concat(day, " / ").concat(Year);
11
+ }
12
+ return "";
13
+ }, []);
14
+ var valLength = useMemo(function () {
15
+ var digitsArr = String(value).match(/\d/g);
16
+ return digitsArr ? digitsArr.length : 0;
17
+ }, [value]);
18
+ return { valLength: valLength, addMask: addMask };
19
+ }
20
+ export default useInteractions;
@@ -0,0 +1,5 @@
1
+ import { DateInputprops } from "./types";
2
+ export declare function MonthDayFormat(str: string): string;
3
+ export declare function verifyMonthDayDate(monthDayString: string): boolean;
4
+ declare function MonthDayInput(props: DateInputprops): JSX.Element;
5
+ export default MonthDayInput;