@symply.io/basic-components 1.3.11-alpha.9 → 1.4.0-alpha.10

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 (127) hide show
  1. package/AlertDialog/index.d.ts +2 -2
  2. package/AlertDialog/index.js +30 -9
  3. package/AlertDialog/types.d.ts +3 -3
  4. package/Autocomplete/index.d.ts +2 -2
  5. package/Autocomplete/index.js +32 -11
  6. package/Autocomplete/types.d.ts +2 -2
  7. package/Autocomplete/useInteractions.js +3 -3
  8. package/AutocompleteWithFilter/index.d.ts +2 -2
  9. package/AutocompleteWithFilter/index.js +35 -13
  10. package/AutocompleteWithFilter/types.d.ts +5 -5
  11. package/BasicModal/Content.js +16 -5
  12. package/BasicModal/index.d.ts +2 -2
  13. package/BasicModal/index.js +31 -10
  14. package/BasicModal/types.d.ts +2 -2
  15. package/BreadCrumbs/index.d.ts +2 -2
  16. package/BreadCrumbs/index.js +19 -9
  17. package/BreadCrumbs/types.d.ts +1 -1
  18. package/CheckBox/index.d.ts +4 -3
  19. package/CheckBox/index.js +36 -3
  20. package/CheckBox/types.d.ts +2 -6
  21. package/CheckBoxGroup/index.d.ts +4 -0
  22. package/CheckBoxGroup/index.js +30 -0
  23. package/CheckBoxGroup/types.d.ts +5 -0
  24. package/CheckBoxGroup/types.js +1 -0
  25. package/ConfirmPasswordInput/index.d.ts +4 -0
  26. package/ConfirmPasswordInput/index.js +42 -0
  27. package/ConfirmPasswordInput/types.d.ts +9 -0
  28. package/ConfirmPasswordInput/types.js +1 -0
  29. package/Copyright/index.d.ts +2 -2
  30. package/Copyright/index.js +14 -4
  31. package/Copyright/types.d.ts +1 -1
  32. package/DataTable/TableBody.js +24 -2
  33. package/DataTable/TableBodyRow.js +52 -41
  34. package/DataTable/TableFooter.js +41 -30
  35. package/DataTable/TableHeader.js +47 -36
  36. package/DataTable/index.d.ts +2 -1
  37. package/DataTable/index.js +30 -18
  38. package/DataTable/useTable.js +54 -46
  39. package/DateInput/FullDateInput/index.js +42 -20
  40. package/DateInput/FullDateInput/useInteractions.js +10 -10
  41. package/DateInput/MonthDayInput/index.js +36 -14
  42. package/DateInput/MonthDayInput/useInteractions.js +9 -9
  43. package/DateInput/MonthYearInput/index.js +36 -14
  44. package/DateInput/MonthYearInput/useInteractions.js +9 -9
  45. package/DateInput/index.d.ts +4 -3
  46. package/DateInput/index.js +4 -3
  47. package/DigitInput/index.d.ts +2 -2
  48. package/DigitInput/index.js +28 -7
  49. package/DigitInput/types.d.ts +3 -3
  50. package/DigitInput/useInteractions.js +9 -9
  51. package/DynamicHeaderBar/HeaderBar.d.ts +1 -13
  52. package/DynamicHeaderBar/HeaderBar.js +17 -6
  53. package/DynamicHeaderBar/HeaderButtons.d.ts +1 -1
  54. package/DynamicHeaderBar/HeaderButtons.js +24 -13
  55. package/DynamicHeaderBar/HeaderLine.d.ts +1 -6
  56. package/DynamicHeaderBar/HeaderLine.js +2 -2
  57. package/DynamicHeaderBar/index.d.ts +1 -17
  58. package/DynamicHeaderBar/index.js +26 -18
  59. package/DynamicHeaderBar/types.d.ts +33 -5
  60. package/FeinInput/index.d.ts +2 -2
  61. package/FeinInput/index.js +38 -17
  62. package/FeinInput/types.d.ts +2 -2
  63. package/FeinInput/useInteractions.js +9 -9
  64. package/FileUploader/index.d.ts +2 -2
  65. package/FileUploader/index.js +33 -12
  66. package/FileUploader/useInteractions.js +44 -29
  67. package/FormRadioGroup/index.d.ts +2 -2
  68. package/FormRadioGroup/index.js +29 -5
  69. package/FormRadioGroup/types.d.ts +3 -4
  70. package/FormSelector/MultipleSelector.js +32 -9
  71. package/FormSelector/SimpleSelector.js +32 -9
  72. package/FormSelector/useInteractions.js +7 -7
  73. package/HelpCaption/index.d.ts +2 -2
  74. package/HelpCaption/index.js +17 -6
  75. package/HelpCaption/useInteractions.js +2 -2
  76. package/LoadingModal/Modal.js +15 -4
  77. package/LoadingModal/index.d.ts +2 -1
  78. package/LoadingModal/index.js +3 -1
  79. package/LoadingModal/useLoadingModal.d.ts +1 -1
  80. package/LoadingModal/useLoadingModal.js +34 -16
  81. package/MenuButtonGroup/MenuItem.js +14 -3
  82. package/MenuButtonGroup/index.js +82 -14
  83. package/NumberInput/index.js +27 -5
  84. package/NumberInput/useInteractions.js +17 -17
  85. package/PasswordInput/index.d.ts +6 -4
  86. package/PasswordInput/index.js +79 -4
  87. package/PasswordInput/{Password.d.ts → types.d.ts} +3 -6
  88. package/PasswordInput/types.js +1 -0
  89. package/PhoneNumberInput/index.js +39 -17
  90. package/PhoneNumberInput/useInteractions.js +10 -10
  91. package/README.md +4 -8
  92. package/Sidebar/SidebarItem.js +17 -6
  93. package/Sidebar/SidebarItemsGroup.js +21 -10
  94. package/Sidebar/SidebarLink.js +27 -5
  95. package/Sidebar/index.js +17 -6
  96. package/SocialInput/index.d.ts +2 -2
  97. package/SocialInput/index.js +40 -19
  98. package/SocialInput/useInteractions.js +14 -14
  99. package/TabGroup/index.d.ts +2 -2
  100. package/TabGroup/index.js +25 -15
  101. package/TablePagination/Actions.js +15 -4
  102. package/TablePagination/index.d.ts +2 -2
  103. package/TablePagination/index.js +14 -4
  104. package/TablePagination/useInteractions.js +9 -9
  105. package/TextInput/index.d.ts +1 -1
  106. package/TextInput/index.js +31 -9
  107. package/TextInput/useInteractions.js +4 -4
  108. package/ToastPrompt/Prompt.d.ts +4 -2
  109. package/ToastPrompt/Prompt.js +23 -55
  110. package/ToastPrompt/index.js +22 -8
  111. package/ToastPrompt/types.d.ts +10 -17
  112. package/ToastPrompt/useInteractions.d.ts +8 -8
  113. package/ToastPrompt/useInteractions.js +23 -16
  114. package/VideoPlayerModal/index.d.ts +2 -2
  115. package/VideoPlayerModal/index.js +27 -6
  116. package/index.d.ts +6 -0
  117. package/index.js +6 -0
  118. package/package.json +1 -2
  119. package/useCustomTheme.js +16 -11
  120. package/utils/uuid.js +11 -10
  121. package/CheckBox/CheckBox.d.ts +0 -3
  122. package/CheckBox/CheckBox.js +0 -14
  123. package/CheckBox/CheckBoxGroup.d.ts +0 -3
  124. package/CheckBox/CheckBoxGroup.js +0 -8
  125. package/PasswordInput/ConfirmPassword.d.ts +0 -11
  126. package/PasswordInput/ConfirmPassword.js +0 -20
  127. package/PasswordInput/Password.js +0 -56
@@ -1,4 +1,4 @@
1
- import { AlertDialogProps } from "./types";
1
+ import type { AlertDialogProps } from "./types";
2
2
  declare const AlertDialog: (props: AlertDialogProps) => JSX.Element;
3
3
  export default AlertDialog;
4
- export * from "./types";
4
+ export type { AlertDialogProps };
@@ -1,3 +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
+ 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
+ };
1
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
24
  import { forwardRef, cloneElement } from "react";
3
25
  import ThemeProvider from "@mui/material/styles/ThemeProvider";
@@ -9,18 +31,17 @@ import DialogContent from "@mui/material/DialogContent";
9
31
  import useMediaQuery from "@mui/material/useMediaQuery";
10
32
  import Slide from "@mui/material/Slide";
11
33
  import useCustomTheme from "../useCustomTheme";
12
- const Transition = forwardRef(function Transition(props, ref) {
13
- return _jsx(Slide, { direction: "up", ...props, ref: ref });
34
+ var Transition = forwardRef(function Transition(props, ref) {
35
+ return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }));
14
36
  });
15
- const AlertDialog = (props) => {
16
- const { title = "Info", maxWidth = "md", children, open, onClose, DialogButtons, primaryColor, secondaryColor, ...rest } = props;
17
- const theme = useCustomTheme({ primaryColor, secondaryColor });
18
- const fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
19
- return (_jsx(ThemeProvider, { theme: theme, children: _jsxs(Dialog, { maxWidth: maxWidth, fullScreen: fullScreen, TransitionComponent: Transition, open: open, onClose: (_, reason) => {
37
+ var AlertDialog = function (props) {
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 });
40
+ var fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
41
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsxs(Dialog, __assign({ maxWidth: maxWidth, fullScreen: fullScreen, TransitionComponent: Transition, open: open, onClose: function (_, reason) {
20
42
  if (reason !== "backdropClick") {
21
43
  onClose();
22
44
  }
23
- }, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description", ...rest, children: [_jsx(DialogTitle, { id: "alert-dialog-title", children: title }), _jsx(DialogContent, { children: children }), _jsx(DialogActions, { children: DialogButtons ? (cloneElement(DialogButtons)) : (_jsx(Button, { onClick: onClose, color: "primary", children: "OK" })) })] }) }));
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" }))) })] })) })));
24
46
  };
25
47
  export default AlertDialog;
26
- export * from "./types";
@@ -1,6 +1,6 @@
1
- import { ReactElement, CSSProperties } from "react";
2
- import { DialogProps } from "@mui/material/Dialog";
3
- import { DialogContentProps } from "@mui/material/DialogContent";
1
+ import type { ReactElement, CSSProperties } from "react";
2
+ import type { DialogProps } from "@mui/material/Dialog";
3
+ import type { DialogContentProps } from "@mui/material/DialogContent";
4
4
  export interface AlertDialogProps {
5
5
  title?: string;
6
6
  maxWidth?: DialogProps["maxWidth"];
@@ -1,4 +1,4 @@
1
- import { AutocompleteProps } from "./types";
1
+ import type { AutocompleteProps, AutocompleteValueType, AutocompleteOptionType } from "./types";
2
2
  declare function CustomAutocomplete<T, multiple extends boolean | undefined = false>(props: AutocompleteProps<T, multiple>): JSX.Element;
3
3
  export default CustomAutocomplete;
4
- export * from "./types";
4
+ export type { AutocompleteProps, AutocompleteValueType, AutocompleteOptionType };
@@ -1,3 +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
+ 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
+ };
1
23
  import { jsx as _jsx } from "react/jsx-runtime";
2
24
  import ThemeProvider from "@mui/material/styles/ThemeProvider";
3
25
  import Autocomplete from "@mui/material/Autocomplete";
@@ -5,13 +27,16 @@ import TextField from "@mui/material/TextField";
5
27
  import useInteractions from "./useInteractions";
6
28
  import useCustomTheme from "../useCustomTheme";
7
29
  function CustomAutocomplete(props) {
8
- const { size, value, loading, options, multiple, disabled, primaryColor, secondaryColor, onChange, required, limitTags, ...rest } = props;
9
- const theme = useCustomTheme({ primaryColor, secondaryColor });
10
- const { inputValue, onInputChange } = useInteractions();
11
- return (_jsx(ThemeProvider, { theme: theme, children: _jsx(Autocomplete, { size: size, fullWidth: true, loading: loading, disabled: disabled, limitTags: limitTags ?? -1, options: options, multiple: multiple, onChange: (event, val) => {
30
+ var size = props.size, value = props.value, loading = props.loading, options = props.options, multiple = props.multiple, disabled = props.disabled, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onChange = props.onChange, required = props.required, limitTags = props.limitTags, rest = __rest(props, ["size", "value", "loading", "options", "multiple", "disabled", "primaryColor", "secondaryColor", "onChange", "required", "limitTags"]);
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, loading: loading, disabled: disabled, limitTags: limitTags !== null && limitTags !== void 0 ? limitTags : -1, options: options, multiple: multiple, onChange: function (event, val) {
12
34
  event.preventDefault();
13
35
  onChange(val);
14
- }, getOptionLabel: option => option.label || "", renderOption: (props, option) => (_jsx("li", { ...{ ...props, key: option.value ?? option.label ?? option }, children: option.label || "" })), isOptionEqualToValue: (opt, val) => {
36
+ }, getOptionLabel: function (option) { return option.label || ""; }, renderOption: function (props, option) {
37
+ var _a, _b;
38
+ return (_jsx("li", __assign({}, __assign(__assign({}, props), { key: (_b = (_a = option.value) !== null && _a !== void 0 ? _a : option.label) !== null && _b !== void 0 ? _b : option }), { children: option.label || "" })));
39
+ }, isOptionEqualToValue: function (opt, val) {
15
40
  if (typeof opt === "string") {
16
41
  return opt === val;
17
42
  }
@@ -19,12 +44,8 @@ function CustomAutocomplete(props) {
19
44
  return String(opt.value) === String(val.value);
20
45
  }
21
46
  return opt.label === val.label;
22
- }, value: value, inputValue: inputValue, onInputChange: (event, val) => {
47
+ }, value: value, inputValue: inputValue, onInputChange: function (event, val) {
23
48
  onInputChange(val);
24
- }, renderInput: params => (_jsx(TextField, { ...params, ...rest, required: required, size: size, inputProps: {
25
- ...params.inputProps,
26
- required: required && (Array.isArray(value) ? value.length === 0 : !value)
27
- } })) }) }));
49
+ }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, rest, { required: required, size: size, inputProps: __assign(__assign({}, params.inputProps), { required: required && (Array.isArray(value) ? value.length === 0 : !value) }) }))); } }) })));
28
50
  }
29
51
  export default CustomAutocomplete;
30
- export * from "./types";
@@ -1,5 +1,5 @@
1
- import { CSSProperties } from "react";
2
- import { TextFieldProps } from "@mui/material/TextField";
1
+ import type { CSSProperties } from "react";
2
+ import type { TextFieldProps } from "@mui/material/TextField";
3
3
  export declare type AutocompleteOptionType<T = {
4
4
  [name: string]: unknown;
5
5
  }> = T & {
@@ -1,9 +1,9 @@
1
1
  import { useState, useCallback } from "react";
2
2
  function useInteractions() {
3
- const [inputValue, setInputValue] = useState("");
4
- const onInputChange = useCallback((value) => {
3
+ var _a = useState(""), inputValue = _a[0], setInputValue = _a[1];
4
+ var onInputChange = useCallback(function (value) {
5
5
  setInputValue(value);
6
6
  }, []);
7
- return { inputValue, onInputChange };
7
+ return { inputValue: inputValue, onInputChange: onInputChange };
8
8
  }
9
9
  export default useInteractions;
@@ -1,4 +1,4 @@
1
- import { AutocompleteWithFilterProps } from "./types";
1
+ import type { AutocompleteWithFilterProps, AutocompleteWithFilterValueType, AutocompleteWithFilterOptionType } from "./types";
2
2
  declare function AutocompleteWithFilter<T, multiple extends boolean | undefined = false>(props: AutocompleteWithFilterProps<T, multiple>): JSX.Element;
3
3
  export default AutocompleteWithFilter;
4
- export * from "./types";
4
+ export type { AutocompleteWithFilterProps, AutocompleteWithFilterValueType, AutocompleteWithFilterOptionType };
@@ -1,3 +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
+ 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
+ };
1
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
24
  import ThemeProvider from "@mui/material/styles/ThemeProvider";
3
25
  import Checkbox from "@mui/material/Checkbox";
@@ -6,21 +28,21 @@ import Autocomplete, { createFilterOptions } from "@mui/material/Autocomplete";
6
28
  import CheckBoxOutlineBlankIcon from "@mui/icons-material/CheckBoxOutlineBlank";
7
29
  import CheckBoxIcon from "@mui/icons-material/CheckBox";
8
30
  import useCustomTheme from "../useCustomTheme";
9
- const icon = _jsx(CheckBoxOutlineBlankIcon, { fontSize: "small" });
10
- const checkedIcon = _jsx(CheckBoxIcon, { fontSize: "small" });
31
+ var icon = _jsx(CheckBoxOutlineBlankIcon, { fontSize: "small" });
32
+ var checkedIcon = _jsx(CheckBoxIcon, { fontSize: "small" });
11
33
  function AutocompleteWithFilter(props) {
12
- const { size, value, options, loading, multiple, disabled, disableCloseOnSelect, primaryColor, secondaryColor, onChange, required, limitTags, ...rest } = props;
13
- const filter = createFilterOptions({
34
+ var size = props.size, value = props.value, options = props.options, loading = props.loading, multiple = props.multiple, disabled = props.disabled, disableCloseOnSelect = props.disableCloseOnSelect, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onChange = props.onChange, required = props.required, limitTags = props.limitTags, rest = __rest(props, ["size", "value", "options", "loading", "multiple", "disabled", "disableCloseOnSelect", "primaryColor", "secondaryColor", "onChange", "required", "limitTags"]);
35
+ var filter = createFilterOptions({
14
36
  ignoreCase: true,
15
37
  ignoreAccents: true,
16
38
  trim: true,
17
- stringify: (option) => option.label
39
+ stringify: function (option) { return option.label; }
18
40
  });
19
- const theme = useCustomTheme({ primaryColor, secondaryColor });
20
- return (_jsx(ThemeProvider, { theme: theme, children: _jsx(Autocomplete, { size: size, fullWidth: true, loading: loading, limitTags: limitTags ?? -1, options: options, disabled: disabled, multiple: multiple, filterOptions: filter, onChange: (event, val) => {
41
+ var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
42
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Autocomplete, { size: size, fullWidth: true, loading: loading, limitTags: limitTags !== null && limitTags !== void 0 ? limitTags : -1, options: options, disabled: disabled, multiple: multiple, filterOptions: filter, onChange: function (event, val) {
21
43
  event.preventDefault();
22
44
  onChange(val);
23
- }, value: value, disableCloseOnSelect: disableCloseOnSelect || multiple, getOptionLabel: option => option.label, isOptionEqualToValue: (opt, val) => {
45
+ }, value: value, disableCloseOnSelect: disableCloseOnSelect || multiple, getOptionLabel: function (option) { return option.label; }, isOptionEqualToValue: function (opt, val) {
24
46
  if (typeof opt === "string") {
25
47
  return opt === val;
26
48
  }
@@ -28,10 +50,10 @@ function AutocompleteWithFilter(props) {
28
50
  return String(opt.value) === String(val.value);
29
51
  }
30
52
  return opt.label === val.label;
31
- }, renderOption: (props, option, { selected }) => (_jsxs("li", { ...{ ...props, key: option.value ?? option.label ?? option }, children: [_jsx(Checkbox, { icon: icon, color: "primary", checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), option.label || ""] })), renderInput: params => (_jsx(TextField, { ...params, ...rest, variant: "outlined", required: required, inputProps: {
32
- ...params.inputProps,
33
- required: required && (Array.isArray(value) ? value.length === 0 : !value)
34
- } })) }) }));
53
+ }, renderOption: function (props, option, _a) {
54
+ var _b, _c;
55
+ var selected = _a.selected;
56
+ return (_jsxs("li", __assign({}, __assign(__assign({}, props), { key: (_c = (_b = option.value) !== null && _b !== void 0 ? _b : option.label) !== null && _c !== void 0 ? _c : option }), { children: [_jsx(Checkbox, { icon: icon, color: "primary", checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), option.label || ""] })));
57
+ }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, rest, { variant: "outlined", required: required, inputProps: __assign(__assign({}, params.inputProps), { required: required && (Array.isArray(value) ? value.length === 0 : !value) }) }))); } }) })));
35
58
  }
36
59
  export default AutocompleteWithFilter;
37
- export * from "./types";
@@ -1,12 +1,12 @@
1
- import { CSSProperties } from "react";
2
- import { TextFieldProps } from "@mui/material/TextField";
1
+ import type { CSSProperties } from "react";
2
+ import type { TextFieldProps } from "@mui/material/TextField";
3
3
  export declare type AutocompleteWithFilterOptionType<T> = T & {
4
4
  label: string;
5
5
  value?: string | number;
6
6
  };
7
- export declare type AutocompleteWithFilterlValueType<T, multiple extends boolean | undefined> = multiple extends false | undefined ? AutocompleteWithFilterOptionType<T> | null : Array<AutocompleteWithFilterOptionType<T>>;
7
+ export declare type AutocompleteWithFilterValueType<T, multiple extends boolean | undefined> = multiple extends false | undefined ? AutocompleteWithFilterOptionType<T> | null : Array<AutocompleteWithFilterOptionType<T>>;
8
8
  export interface AutocompleteWithFilterProps<T, multiple extends boolean | undefined> extends Omit<TextFieldProps, "onChange" | "value" | "disabled"> {
9
- value: AutocompleteWithFilterlValueType<T, multiple>;
9
+ value: AutocompleteWithFilterValueType<T, multiple>;
10
10
  options: Array<AutocompleteWithFilterOptionType<T>>;
11
11
  disableCloseOnSelect?: boolean;
12
12
  limitTags?: number;
@@ -15,5 +15,5 @@ export interface AutocompleteWithFilterProps<T, multiple extends boolean | undef
15
15
  loading?: boolean;
16
16
  primaryColor?: CSSProperties["color"];
17
17
  secondaryColor?: CSSProperties["color"];
18
- onChange: (value: AutocompleteWithFilterlValueType<T, multiple>) => void;
18
+ onChange: (value: AutocompleteWithFilterValueType<T, multiple>) => void;
19
19
  }
@@ -1,3 +1,14 @@
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
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
13
  import { cloneElement } from "react";
3
14
  import useTheme from "@mui/material/styles/useTheme";
@@ -10,17 +21,17 @@ import IconButton from "@mui/material/IconButton";
10
21
  import CloseIcon from "@mui/icons-material/Close";
11
22
  import Grid from "@mui/material/Grid";
12
23
  function Content(props) {
13
- const { children, title, desc, color = "primary", loading, disabled, buttons, submitText = "Save", cancelText = "Cancel", showTopRightCloseButton = false, hideBottomButtons = false, noForm = false, onClose, onSubmit } = props;
14
- const theme = useTheme();
15
- return (_jsxs(_Fragment, { children: [_jsxs(DialogTitle, { sx: {
24
+ var children = props.children, title = props.title, desc = props.desc, _a = props.color, color = _a === void 0 ? "primary" : _a, loading = props.loading, disabled = props.disabled, buttons = props.buttons, _b = props.submitText, submitText = _b === void 0 ? "Save" : _b, _c = props.cancelText, cancelText = _c === void 0 ? "Cancel" : _c, _d = props.showTopRightCloseButton, showTopRightCloseButton = _d === void 0 ? false : _d, _e = props.hideBottomButtons, hideBottomButtons = _e === void 0 ? false : _e, _f = props.noForm, noForm = _f === void 0 ? false : _f, onClose = props.onClose, onSubmit = props.onSubmit;
25
+ var theme = useTheme();
26
+ return (_jsxs(_Fragment, { children: [_jsxs(DialogTitle, __assign({ sx: {
16
27
  "& > span": {
17
28
  fontWeight: "700!important"
18
29
  }
19
- }, children: [_jsx("span", { children: title }), showTopRightCloseButton ? (_jsx(IconButton, { "aria-label": "close", onClick: onClose, sx: {
30
+ } }, { children: [_jsx("span", { children: title }), showTopRightCloseButton ? (_jsx(IconButton, __assign({ "aria-label": "close", onClick: onClose, sx: {
20
31
  position: "absolute",
21
32
  right: 8,
22
33
  top: 8,
23
34
  color: theme.palette.grey[500]
24
- }, children: _jsx(CloseIcon, {}) })) : null] }), _jsxs(DialogContent, { sx: { paddingTop: theme.spacing(1.25) }, children: [desc && _jsx(DialogContentText, { children: desc }), Boolean(children) && cloneElement(children)] }), !hideBottomButtons && (_jsx(DialogActions, { sx: { padding: theme.spacing(1.25) }, children: _jsx(Grid, { container: true, spacing: 2, justifyContent: "flex-end", alignItems: "center", sx: { margin: 0 }, children: buttons || (_jsxs(_Fragment, { children: [_jsx(Grid, { item: true, xs: 12, md: 3, xl: 2, children: _jsx(Button, { onClick: onClose, variant: "outlined", color: color, disabled: loading, fullWidth: true, children: cancelText }) }), _jsx(Grid, { item: true, xs: 12, md: 3, xl: 2, children: _jsx(Button, { type: noForm ? "button" : "submit", onClick: noForm ? onSubmit : undefined, variant: "contained", color: color, disabled: loading || disabled, fullWidth: true, children: submitText }) })] })) }) }))] }));
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 })) }))] })) })) })))] }));
25
36
  }
26
37
  export default Content;
@@ -1,4 +1,4 @@
1
- import { BasicModalProps } from "./types";
1
+ import type { BasicModalProps } from "./types";
2
2
  declare function BasicModal(props: BasicModalProps): JSX.Element;
3
3
  export default BasicModal;
4
- export * from "./types";
4
+ export type { BasicModalProps };
@@ -1,3 +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
+ 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
+ };
1
23
  import { jsx as _jsx } from "react/jsx-runtime";
2
24
  import { forwardRef } from "react";
3
25
  import Grid from "@mui/material/Grid";
@@ -7,24 +29,23 @@ import useMediaQuery from "@mui/material/useMediaQuery";
7
29
  import ThemeProvider from "@mui/material/styles/ThemeProvider";
8
30
  import Content from "./Content";
9
31
  import useCustomTheme from "../useCustomTheme";
10
- const Transition = forwardRef(function Transition(props, ref) {
11
- return _jsx(Slide, { direction: "up", ...props, ref: ref });
32
+ var Transition = forwardRef(function Transition(props, ref) {
33
+ return _jsx(Slide, __assign({ direction: "up" }, props, { ref: ref }));
12
34
  });
13
35
  function BasicModal(props) {
14
- const { onClose, onSubmit, maxWidth = "sm", open = false, noForm = false, primaryColor, secondaryColor, ...rest } = props;
15
- const theme = useCustomTheme({ primaryColor, secondaryColor });
16
- const fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
17
- return (_jsx(ThemeProvider, { theme: theme, children: _jsx(Dialog, { disableEnforceFocus: true, open: open, onClose: (_, reason) => {
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 });
38
+ var fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
39
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Dialog, __assign({ disableEnforceFocus: true, open: open, onClose: function (_, reason) {
18
40
  if (reason !== "backdropClick") {
19
41
  onClose();
20
42
  }
21
- }, maxWidth: maxWidth, fullWidth: true, TransitionComponent: Transition, "aria-labelledby": "form-dialog-title", fullScreen: fullScreen, disableEscapeKeyDown: true, children: _jsx(Grid, { 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
22
44
  ? undefined
23
- : (e) => {
45
+ : function (e) {
24
46
  e.preventDefault();
25
47
  e.stopPropagation();
26
48
  onSubmit();
27
- }, children: _jsx(Content, { ...rest, noForm: noForm, onClose: onClose, onSubmit: onSubmit }) }) }) }));
49
+ } }, { children: _jsx(Content, __assign({}, rest, { noForm: noForm, onClose: onClose, onSubmit: onSubmit })) })) })) })));
28
50
  }
29
51
  export default BasicModal;
30
- export * from "./types";
@@ -1,5 +1,5 @@
1
- import { ReactNode, CSSProperties } from "react";
2
- import { ButtonProps } from "@mui/material/Button";
1
+ import type { ReactNode, CSSProperties } from "react";
2
+ import type { ButtonProps } from "@mui/material/Button";
3
3
  export interface BasicModalContentProps {
4
4
  children: ReactNode;
5
5
  color?: ButtonProps["color"];
@@ -1,4 +1,4 @@
1
- import { BreadCrumbsProps } from "./types";
1
+ import type { BreadCrumbsProps } from "./types";
2
2
  declare function Crumbs(props: BreadCrumbsProps): JSX.Element;
3
3
  export default Crumbs;
4
- export * from "./types";
4
+ export type { BreadCrumbsProps };
@@ -1,3 +1,14 @@
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
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import { useCallback } from "react";
3
14
  import { navigate } from "@reach/router";
@@ -7,22 +18,21 @@ import ThemeProvider from "@mui/material/styles/ThemeProvider";
7
18
  import NavigateNextIcon from "@mui/icons-material/NavigateNext";
8
19
  import useCustomTheme from "../useCustomTheme";
9
20
  function Crumbs(props) {
10
- const { routes, primaryColor, secondaryColor } = props;
11
- const theme = useCustomTheme({ primaryColor, secondaryColor });
12
- const onNavigateTo = useCallback((url) => {
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) {
13
24
  navigate(url, { replace: true });
14
25
  }, []);
15
- return (_jsx(ThemeProvider, { theme: theme, children: _jsxs(Breadcrumbs, { "aria-label": "breadcrumb", separator: _jsx(NavigateNextIcon, { fontSize: "small" }), children: [_jsx(Typography, {}), routes.map(route => {
16
- const { href, label } = route;
17
- return href ? (_jsx(Typography, { color: "inherit", sx: {
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({ color: "inherit", sx: {
18
29
  fontSize: 16,
19
30
  fontWeight: 500,
20
31
  "&:hover": {
21
32
  cursor: "pointer",
22
33
  color: theme.palette.primary.light
23
34
  }
24
- }, onClick: () => onNavigateTo(href), children: label }, label)) : (_jsx(Typography, { sx: { fontSize: 16, fontWeight: 500 }, color: "primary", children: label }, label));
25
- })] }) }));
35
+ }, onClick: function () { return onNavigateTo(href); } }, { children: label }), label)) : (_jsx(Typography, __assign({ sx: { fontSize: 16, fontWeight: 500 }, color: "primary" }, { children: label }), label));
36
+ })] })) })));
26
37
  }
27
38
  export default Crumbs;
28
- export * from "./types";
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from "react";
1
+ import type { CSSProperties } from "react";
2
2
  export interface BreadCrumbsProps {
3
3
  routes: Array<{
4
4
  href?: string;
@@ -1,3 +1,4 @@
1
- export { default as CheckBox } from "./CheckBox";
2
- export { default as CheckBoxGroup } from "./CheckBoxGroup";
3
- export * from "./types";
1
+ import { CheckBoxProps } from "./types";
2
+ declare function CheckBox(props: CheckBoxProps): JSX.Element;
3
+ export default CheckBox;
4
+ export type { CheckBoxProps };
package/CheckBox/index.js CHANGED
@@ -1,3 +1,36 @@
1
- export { default as CheckBox } from "./CheckBox";
2
- export { default as CheckBoxGroup } from "./CheckBoxGroup";
3
- export * from "./types";
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
+ 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;
@@ -1,12 +1,8 @@
1
- import { CSSProperties, ReactElement } from "react";
2
- import { CheckboxProps } from "@mui/material/Checkbox";
3
- import { FormGroupProps } from "@mui/material/FormGroup";
1
+ import type { CSSProperties, ReactElement } from "react";
2
+ import type { CheckboxProps } from "@mui/material/Checkbox";
4
3
  export interface CheckBoxProps extends Omit<CheckboxProps, "onChange"> {
5
4
  label: string | ReactElement;
6
5
  onChange: (val: boolean) => void;
7
6
  primaryColor?: CSSProperties["color"];
8
7
  secondaryColor?: CSSProperties["color"];
9
8
  }
10
- export interface CheckBoxGroupProps extends FormGroupProps {
11
- checkboxes: Array<CheckBoxProps>;
12
- }
@@ -0,0 +1,4 @@
1
+ import type { CheckBoxGroupProps } from "./types";
2
+ declare function CheckBoxGroup(props: CheckBoxGroupProps): JSX.Element;
3
+ export default CheckBoxGroup;
4
+ export type { CheckBoxGroupProps };
@@ -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
+ 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,5 @@
1
+ import type { FormGroupProps } from "@mui/material/FormGroup";
2
+ import type { CheckBoxProps } from "../CheckBox";
3
+ export interface CheckBoxGroupProps extends FormGroupProps {
4
+ checkboxes: Array<CheckBoxProps>;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { ConfirmPasswordInputProps } from "./types";
2
+ declare function ConfirmPasswordInput(props: ConfirmPasswordInputProps): JSX.Element;
3
+ export default ConfirmPasswordInput;
4
+ export type { ConfirmPasswordInputProps };