argous 1.2.247 → 1.3.3

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 (226) hide show
  1. package/dist/api/WebSocket.d.ts +18 -10
  2. package/dist/api/WebSocket.js +26 -18
  3. package/dist/api/index.js +54 -43
  4. package/dist/api/ws.d.ts +1 -1
  5. package/dist/api/ws.js +44 -3
  6. package/dist/components/Alert/Alert.js +17 -7
  7. package/dist/components/ArgousAction/ArgousAction.js +17 -7
  8. package/dist/components/ArgousAvatar/ArgousAvatar.d.ts +1 -1
  9. package/dist/components/ArgousAvatar/ArgousAvatar.js +44 -60
  10. package/dist/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +1 -1
  11. package/dist/components/ArgousComplexPagination/ArgousComplexPagination.js +107 -81
  12. package/dist/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -1
  13. package/dist/components/ArgousComplexTable/ArgousComplexTable.js +39 -52
  14. package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +1 -1
  15. package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.js +119 -97
  16. package/dist/components/ArgousComplexTableBody/DragAndDrop.d.ts +37 -0
  17. package/dist/components/ArgousComplexTableBody/DragAndDrop.js +156 -0
  18. package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.js +64 -47
  19. package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +55 -37
  20. package/dist/components/ArgousInput/ArgousInput.js +19 -9
  21. package/dist/components/ArgousPagination/ArgousPagination.js +18 -11
  22. package/dist/components/ArgousProgressBar/ArgousProgressBar.js +64 -74
  23. package/dist/components/ArgousSimpleTable/ArgousSimpleTable.js +28 -22
  24. package/dist/components/AutoComplete/AutoComplete.js +18 -9
  25. package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +3 -4
  26. package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +226 -174
  27. package/dist/components/BarChart/BarChart.js +17 -7
  28. package/dist/components/BarraFerramentas/BarraFerramentas.js +119 -105
  29. package/dist/components/Button/Button.js +17 -7
  30. package/dist/components/Cabecalho/Cabecalho.js +17 -7
  31. package/dist/components/Calendar/Calendar.js +24 -41
  32. package/dist/components/Cam/Cam.js +19 -9
  33. package/dist/components/Carousel/Carousel.js +113 -103
  34. package/dist/components/CartaoUsuario/CartaoUsuario.js +36 -26
  35. package/dist/components/Collapse/Collapse.d.ts +3 -3
  36. package/dist/components/Collapse/Collapse.js +121 -71
  37. package/dist/components/Compartilhar/Compartilhar.js +70 -65
  38. package/dist/components/ConfirmModal/BasicModal.d.ts +1 -1
  39. package/dist/components/ConfirmModal/BasicModal.js +8 -8
  40. package/dist/components/ConfirmModal/ModalProvider.d.ts +12 -1
  41. package/dist/components/ConfirmModal/ModalProvider.js +17 -7
  42. package/dist/components/ConfirmModal/WrapperModal.d.ts +2 -2
  43. package/dist/components/ConfirmModal/WrapperModal.js +5 -5
  44. package/dist/components/ContactValidationInput/ContactValidationInput.d.ts +1 -1
  45. package/dist/components/ContactValidationInput/ContactValidationInput.js +105 -80
  46. package/dist/components/ContactValidationInput/SealModal.d.ts +1 -1
  47. package/dist/components/ContactValidationInput/SealModal.js +13 -20
  48. package/dist/components/Document/Icons.d.ts +2 -2
  49. package/dist/components/Document/Icons.js +33 -16
  50. package/dist/components/Document/ModalVisualizacaoDocumentos.d.ts +1 -1
  51. package/dist/components/Document/ModalVisualizacaoDocumentos.js +33 -17
  52. package/dist/components/Document/Visualizacao.d.ts +1 -1
  53. package/dist/components/Document/Visualizacao.js +48 -34
  54. package/dist/components/DropArea/DropArea.js +27 -12
  55. package/dist/components/DropArea/Html5FileSelector.js +6 -7
  56. package/dist/components/Editor/ScriptLoader2.d.ts +1 -1
  57. package/dist/components/Editor/ScriptLoader2.js +2 -2
  58. package/dist/components/Editor/Utils.d.ts +3 -3
  59. package/dist/components/Editor/Utils.js +2 -2
  60. package/dist/components/Editor/components/Editor.d.ts +1 -1
  61. package/dist/components/Editor/components/Editor.js +18 -9
  62. package/dist/components/Editor/components/EditorPropTypes.js +17 -7
  63. package/dist/components/FilePreparer/FilePreparer.d.ts +1 -1
  64. package/dist/components/FilePreparer/FilePreparer.js +105 -88
  65. package/dist/components/FileUploader/FileUploader.js +33 -22
  66. package/dist/components/FormVisualizer/FormVisualizer.d.ts +5 -7
  67. package/dist/components/FormVisualizer/FormVisualizer.js +92 -61
  68. package/dist/components/HalfGauge/HalfGauge.js +87 -135
  69. package/dist/components/Highlight/Highlight.js +23 -12
  70. package/dist/components/ImageResize/ImageResize.d.ts +1 -1
  71. package/dist/components/ImageResize/ImageResize.js +79 -85
  72. package/dist/components/ImageResizeButton/ImageResizeButton.d.ts +1 -1
  73. package/dist/components/ImageResizeButton/ImageResizeButton.js +19 -9
  74. package/dist/components/Input/Input.js +19 -9
  75. package/dist/components/InputTags/InputTags.js +22 -13
  76. package/dist/components/ListSelect/ListSelect.js +17 -7
  77. package/dist/components/MaterialButton/MaterialButton.d.ts +2 -4
  78. package/dist/components/MaterialButton/MaterialButton.js +56 -125
  79. package/dist/components/MenuBar/MenuBar.js +17 -7
  80. package/dist/components/MonthPicker/MonthPicker.js +20 -10
  81. package/dist/components/MultipleSelect/MultipleSelect.js +17 -7
  82. package/dist/components/OtpInput/OtpInput.d.ts +1 -1
  83. package/dist/components/OtpInput/OtpInput.js +71 -58
  84. package/dist/components/OutputText/OutputText.js +17 -7
  85. package/dist/components/Pagination/Pagination.js +17 -7
  86. package/dist/components/PercentageDisplay/PercentageDisplay.d.ts +1 -1
  87. package/dist/components/PercentageDisplay/PercentageDisplay.js +24 -92
  88. package/dist/components/Programa/PageCodeEasterEgg.d.ts +5 -4
  89. package/dist/components/Programa/PageCodeEasterEgg.js +41 -32
  90. package/dist/components/Programa/Programa.d.ts +2 -2
  91. package/dist/components/Programa/Programa.js +50 -28
  92. package/dist/components/Programa/Tab.d.ts +2 -2
  93. package/dist/components/Programa/TabNavigationRail.d.ts +3 -3
  94. package/dist/components/Programa/TabNavigationRail.js +13 -55
  95. package/dist/components/ProgressBar/ProgressBar.js +17 -7
  96. package/dist/components/Select/Select.js +17 -7
  97. package/dist/components/SimpleTable/SimpleTable.js +17 -7
  98. package/dist/components/Stepper/Stepper.d.ts +1 -1
  99. package/dist/components/Stepper/Stepper.js +194 -179
  100. package/dist/components/TablePicker/TablePicker.js +37 -12
  101. package/dist/components/Tabs/Tabs.js +17 -7
  102. package/dist/components/TextArea/TextArea.js +17 -7
  103. package/dist/components/TextToHtml/Cursor.d.ts +1 -1
  104. package/dist/components/TextToHtml/Cursor.js +17 -7
  105. package/dist/components/TextToHtml/TextStyles.d.ts +1 -1
  106. package/dist/components/TextToHtml/TextStyles.js +51 -44
  107. package/dist/components/TextToHtml/TextToHtml.js +37 -17
  108. package/dist/components/ThreadLog/ThreadLog.js +19 -9
  109. package/dist/components/UserCard/UserCard.js +36 -26
  110. package/dist/components/UtilAutoComplete/UtilAutoComplete.d.ts +3 -4
  111. package/dist/components/UtilAutoComplete/UtilAutoComplete.js +26 -16
  112. package/dist/components/UtilTextField/UtilTextField.d.ts +1 -1
  113. package/dist/components/UtilTextField/UtilTextField.js +26 -14
  114. package/dist/components/Zoom/Zoom.js +23 -24
  115. package/dist/fieldsRedux/createField.js +17 -7
  116. package/dist/fieldsRedux/fieldsRedux.js +19 -9
  117. package/dist/fieldsRedux/passFields.js +17 -7
  118. package/dist/reducers/index.d.ts +98 -2
  119. package/dist/utils/api.js +32 -15
  120. package/dist/utils/config.js +2 -3
  121. package/dist/utils/index.d.ts +3 -3
  122. package/dist/utils/index.js +68 -54
  123. package/dist/utils/store.js +2 -3
  124. package/lib/api/WebSocket.js +11 -12
  125. package/lib/api/index.js +14 -14
  126. package/lib/api/ws.js +48 -4
  127. package/lib/components/ArgousAvatar/ArgousAvatar.d.ts +1 -1
  128. package/lib/components/ArgousAvatar/ArgousAvatar.js +20 -54
  129. package/lib/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +1 -1
  130. package/lib/components/ArgousComplexPagination/ArgousComplexPagination.js +50 -25
  131. package/lib/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -1
  132. package/lib/components/ArgousComplexTable/ArgousComplexTable.js +15 -15
  133. package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +1 -1
  134. package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.js +121 -106
  135. package/lib/components/ArgousComplexTableBody/DragAndDrop.js +85 -0
  136. package/lib/components/ArgousComplexTableHead/ArgousComplexTableHead.js +60 -51
  137. package/lib/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +21 -12
  138. package/lib/components/ArgousInput/ArgousInput.js +2 -2
  139. package/lib/components/ArgousPagination/ArgousPagination.js +12 -4
  140. package/lib/components/ArgousProgressBar/ArgousProgressBar.js +67 -78
  141. package/lib/components/ArgousSimpleTable/ArgousSimpleTable.js +12 -18
  142. package/lib/components/AutoComplete/AutoComplete.js +2 -3
  143. package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +3 -4
  144. package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.js +174 -108
  145. package/lib/components/BarraFerramentas/BarraFerramentas.js +32 -21
  146. package/lib/components/Calendar/Calendar.js +7 -42
  147. package/lib/components/Carousel/Carousel.js +42 -27
  148. package/lib/components/CartaoUsuario/CartaoUsuario.js +6 -6
  149. package/lib/components/Collapse/Collapse.d.ts +3 -3
  150. package/lib/components/Collapse/Collapse.js +92 -57
  151. package/lib/components/Compartilhar/Compartilhar.js +47 -46
  152. package/lib/components/ConfirmModal/BasicModal.tsx +1 -1
  153. package/lib/components/ConfirmModal/WrapperModal.tsx +2 -2
  154. package/lib/components/ContactValidationInput/ContactValidationInput.d.ts +1 -1
  155. package/lib/components/ContactValidationInput/ContactValidationInput.js +248 -213
  156. package/lib/components/ContactValidationInput/SealModal.js +38 -32
  157. package/lib/components/Document/Icons.js +14 -6
  158. package/lib/components/Document/ModalVisualizacaoDocumentos.js +9 -2
  159. package/lib/components/Document/Visualizacao.js +31 -25
  160. package/lib/components/DropArea/DropArea.js +9 -3
  161. package/lib/components/Editor/ScriptLoader2.ts +3 -3
  162. package/lib/components/Editor/Utils.ts +3 -3
  163. package/lib/components/Editor/components/Editor.tsx +1 -1
  164. package/lib/components/Editor/tinymce/README.md +73 -0
  165. package/lib/components/Editor/tinymce/langs/README.md +3 -0
  166. package/lib/components/Editor/tinymce/models/dom/model.min.js +1 -1
  167. package/lib/components/Editor/tinymce/plugins/accordion/plugin.min.js +1 -1
  168. package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +1 -1
  169. package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +1 -1
  170. package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +1 -1
  171. package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +1 -1
  172. package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +1 -1
  173. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +1 -1
  174. package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +1 -1
  175. package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +1 -1
  176. package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +1 -1
  177. package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +1 -1
  178. package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +1 -1
  179. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +1 -1
  180. package/lib/components/Editor/tinymce/plugins/table/plugin.js +3 -3
  181. package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +1 -1
  182. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +1 -1
  183. package/lib/components/Editor/tinymce/themes/silver/theme.js +38 -38
  184. package/lib/components/Editor/tinymce/themes/silver/theme.min.js +1 -1
  185. package/lib/components/Editor/tinymce/tinymce.js +12 -12
  186. package/lib/components/Editor/tinymce/tinymce.min.js +1 -1
  187. package/lib/components/FilePreparer/FilePreparer.d.ts +1 -1
  188. package/lib/components/FilePreparer/FilePreparer.js +112 -108
  189. package/lib/components/FileUploader/FileUploader.js +8 -7
  190. package/lib/components/FormVisualizer/FormVisualizer.d.ts +5 -7
  191. package/lib/components/FormVisualizer/FormVisualizer.js +59 -46
  192. package/lib/components/HalfGauge/HalfGauge.js +87 -85
  193. package/lib/components/Highlight/Highlight.js +4 -4
  194. package/lib/components/ImageResize/ImageResize.d.ts +1 -1
  195. package/lib/components/ImageResize/ImageResize.js +123 -118
  196. package/lib/components/ImageResizeButton/ImageResizeButton.d.ts +1 -1
  197. package/lib/components/ImageResizeButton/ImageResizeButton.js +1 -1
  198. package/lib/components/Input/Input.js +2 -2
  199. package/lib/components/InputTags/InputTags.js +6 -7
  200. package/lib/components/MaterialButton/MaterialButton.d.ts +2 -4
  201. package/lib/components/MaterialButton/MaterialButton.js +50 -125
  202. package/lib/components/MonthPicker/MonthPicker.js +2 -2
  203. package/lib/components/OtpInput/OtpInput.tsx +77 -69
  204. package/lib/components/PercentageDisplay/PercentageDisplay.d.ts +1 -1
  205. package/lib/components/PercentageDisplay/PercentageDisplay.js +29 -54
  206. package/lib/components/Programa/PageCodeEasterEgg.js +41 -40
  207. package/lib/components/Programa/Programa.d.ts +2 -2
  208. package/lib/components/Programa/Programa.js +21 -5
  209. package/lib/components/Programa/Tab.ts +4 -2
  210. package/lib/components/Programa/TabNavigationRail.js +9 -31
  211. package/lib/components/Stepper/Stepper.d.ts +1 -1
  212. package/lib/components/Stepper/Stepper.js +222 -190
  213. package/lib/components/TablePicker/TablePicker.js +11 -6
  214. package/lib/components/TextToHtml/TextStyles.js +42 -42
  215. package/lib/components/TextToHtml/TextToHtml.js +102 -92
  216. package/lib/components/ThreadLog/ThreadLog.js +1 -1
  217. package/lib/components/UserCard/UserCard.js +6 -6
  218. package/lib/components/UtilAutoComplete/UtilAutoComplete.d.ts +3 -4
  219. package/lib/components/UtilAutoComplete/UtilAutoComplete.js +67 -9
  220. package/lib/components/UtilTextField/UtilTextField.d.ts +1 -1
  221. package/lib/components/UtilTextField/UtilTextField.js +18 -16
  222. package/lib/components/Zoom/Zoom.js +6 -3
  223. package/lib/utils/api.ts +1 -1
  224. package/lib/utils/index.ts +10 -8
  225. package/package.json +56 -56
  226. package/.gitlab-ci.yml +0 -21
@@ -1,6 +1,5 @@
1
1
  import { createField } from '../../fieldsRedux';
2
- import { Chip, Grid, TextField } from '@material-ui/core';
3
- import { Autocomplete } from '@material-ui/lab';
2
+ import { Chip, Grid, TextField, Autocomplete } from '@mui/material';
4
3
  import { isArray } from 'lodash';
5
4
  import PropTypes from 'prop-types';
6
5
  import React, { Component } from 'react';
@@ -47,13 +46,13 @@ class InputTags extends Component {
47
46
  const { handleChange, handleDelete, tags, handleInputChange, label, placeholder, suggestions, ...props } = this.checkProps();
48
47
 
49
48
  return (
50
- <Grid container spacing={1}>
51
- <Grid item xs={12}>
49
+ <Grid container spacing={1}>
50
+ <Grid size={12}>
52
51
  {tags.map((item, index) => (
53
52
  <Chip key={index} label={item.text} onDelete={handleDelete(index)} />
54
53
  ))}
55
- </Grid>
56
- <Grid item xs={12}>
54
+ </Grid>
55
+ <Grid size={12}>
57
56
  <Autocomplete
58
57
  onInputChange={(_, value) => handleInputChange(value)}
59
58
  multiple
@@ -65,7 +64,7 @@ class InputTags extends Component {
65
64
  onChange={handleChange}
66
65
  noOptionsText='Não Encontrado'
67
66
  size='small'
68
- renderTags={() => null}
67
+ renderValue={() => null}
69
68
  renderInput={params => (
70
69
  <TextField
71
70
  fullWidth
@@ -1,6 +1,4 @@
1
- import { ButtonProps } from '@material-ui/core';
2
- import * as React from 'react';
3
-
1
+ import { ButtonProps } from '@mui/material';
4
2
  export interface MaterialButtonProps extends Omit<ButtonProps, 'color'> {
5
3
  /**
6
4
  * Cor Aplicada ao botão
@@ -10,4 +8,4 @@ export interface MaterialButtonProps extends Omit<ButtonProps, 'color'> {
10
8
 
11
9
  declare function MaterialButton(props: MaterialButtonProps): JSX.Element
12
10
 
13
- export default MaterialButton;
11
+ export default MaterialButton;
@@ -1,135 +1,59 @@
1
- import { makeStyles, capitalize, alpha } from '@material-ui/core';
2
- import MaterialButton from '@material-ui/core/Button';
3
- import clsx from 'clsx';
1
+ import MaterialButton from '@mui/material/Button';
2
+ import { alpha } from '@mui/material/styles';
4
3
  import PropTypes from 'prop-types';
5
4
  import React from 'react';
6
5
 
7
- const useStyles = makeStyles(theme => ({
8
- containedInfo: {
9
- color: theme.palette.info.contrastText,
10
- backgroundColor: theme.palette.info.main,
11
- '&:hover': {
12
- backgroundColor: theme.palette.info.dark,
13
- '@media (hover: none)': {
14
- backgroundColor: theme.palette.info.main,
15
- },
16
- }
17
- },
18
- outlinedInfo: {
19
- color: theme.palette.info.main,
20
- border: `1px solid ${alpha(theme.palette.info.main, 0.5)}`,
21
- '&:hover': {
22
- border: `1px solid ${theme.palette.info.main}`,
23
- backgroundColor: alpha(theme.palette.info.main, theme.palette.action.hoverOpacity),
24
- '@media (hover: none)': {
25
- backgroundColor: 'transparent',
26
- },
27
- }
28
- },
29
- textInfo: {
30
- color: theme.palette.info.main,
31
- '&:hover': {
32
- backgroundColor: alpha(theme.palette.info.main, theme.palette.action.hoverOpacity),
33
- '@media (hover: none)': {
34
- backgroundColor: 'transparent',
35
- },
36
- }
37
- },
38
- containedSuccess: {
39
- color: theme.palette.success.contrastText,
40
- backgroundColor: theme.palette.success.main,
41
- '&:hover': {
42
- backgroundColor: theme.palette.success.dark,
43
- '@media (hover: none)': {
44
- backgroundColor: theme.palette.success.main,
45
- },
46
- }
47
- },
48
- outlinedSuccess: {
49
- color: theme.palette.success.main,
50
- border: `1px solid ${alpha(theme.palette.success.main, 0.5)}`,
51
- '&:hover': {
52
- border: `1px solid ${theme.palette.success.main}`,
53
- backgroundColor: alpha(theme.palette.success.main, theme.palette.action.hoverOpacity),
54
- '@media (hover: none)': {
55
- backgroundColor: 'transparent',
56
- },
57
- }
58
- },
59
- textSuccess: {
60
- color: theme.palette.success.main,
61
- '&:hover': {
62
- backgroundColor: alpha(theme.palette.success.main, theme.palette.action.hoverOpacity),
63
- '@media (hover: none)': {
64
- backgroundColor: 'transparent',
65
- },
66
- }
67
- },
68
- containedWarning: {
69
- color: theme.palette.warning.contrastText,
70
- backgroundColor: theme.palette.warning.main,
71
- '&:hover': {
72
- backgroundColor: theme.palette.warning.dark,
73
- '@media (hover: none)': {
74
- backgroundColor: theme.palette.warning.main,
75
- },
76
- }
77
- },
78
- outlinedWarning: {
79
- color: theme.palette.warning.main,
80
- border: `1px solid ${alpha(theme.palette.warning.main, 0.5)}`,
81
- '&:hover': {
82
- border: `1px solid ${theme.palette.warning.main}`,
83
- backgroundColor: alpha(theme.palette.warning.main, theme.palette.action.hoverOpacity),
84
- '@media (hover: none)': {
85
- backgroundColor: 'transparent',
86
- },
87
- }
88
- },
89
- textWarning: {
90
- color: theme.palette.warning.main,
91
- '&:hover': {
92
- backgroundColor: alpha(theme.palette.warning.main, theme.palette.action.hoverOpacity),
93
- '@media (hover: none)': {
94
- backgroundColor: 'transparent',
95
- },
96
- }
97
- },
98
- containedDanger: {
99
- color: theme.palette.error.contrastText,
100
- backgroundColor: theme.palette.error.main,
101
- '&:hover': {
102
- backgroundColor: theme.palette.error.dark,
103
- '@media (hover: none)': {
104
- backgroundColor: theme.palette.error.main,
105
- },
106
- }
107
- },
108
- outlinedDanger: {
109
- color: theme.palette.error.main,
110
- border: `1px solid ${alpha(theme.palette.error.main, 0.5)}`,
111
- '&:hover': {
112
- border: `1px solid ${theme.palette.error.main}`,
113
- backgroundColor: alpha(theme.palette.error.main, theme.palette.action.hoverOpacity),
114
- '@media (hover: none)': {
115
- backgroundColor: 'transparent',
116
- },
117
- }
118
- },
119
- textDanger: {
120
- color: theme.palette.error.main,
6
+ const muiColorMap = {
7
+ info: 'info',
8
+ success: 'success',
9
+ warning: 'warning',
10
+ danger: 'error',
11
+ };
12
+
13
+ const normalizeSx = sx => sx ? (Array.isArray(sx) ? sx : [sx]) : [];
14
+
15
+ const getCustomColorSx = (color, variant) => theme => {
16
+ const paletteKey = muiColorMap[color];
17
+ if (!paletteKey) return {};
18
+
19
+ const palette = theme.palette[paletteKey];
20
+ if (variant === 'contained') {
21
+ return {
22
+ color: palette.contrastText,
23
+ backgroundColor: palette.main,
24
+ '&:hover': {
25
+ backgroundColor: palette.dark,
26
+ '@media (hover: none)': {
27
+ backgroundColor: palette.main,
28
+ },
29
+ }
30
+ };
31
+ }
32
+ if (variant === 'outlined') {
33
+ return {
34
+ color: palette.main,
35
+ border: `1px solid ${alpha(palette.main, 0.5)}`,
36
+ '&:hover': {
37
+ border: `1px solid ${palette.main}`,
38
+ backgroundColor: alpha(palette.main, theme.palette.action.hoverOpacity),
39
+ '@media (hover: none)': {
40
+ backgroundColor: 'transparent',
41
+ },
42
+ }
43
+ };
44
+ }
45
+ return {
46
+ color: palette.main,
121
47
  '&:hover': {
122
- backgroundColor: alpha(theme.palette.error.main, theme.palette.action.hoverOpacity),
48
+ backgroundColor: alpha(palette.main, theme.palette.action.hoverOpacity),
123
49
  '@media (hover: none)': {
124
50
  backgroundColor: 'transparent',
125
51
  },
126
52
  }
127
- },
128
- }));
129
-
130
- export default function Button({ color = 'default', variant = 'text', className, ...props }) {
53
+ };
54
+ };
131
55
 
132
- const classes = useStyles();
56
+ export default function Button({ color = 'default', variant = 'text', className, sx, ...props }) {
133
57
 
134
58
  function checarCor() {
135
59
  switch (color) {
@@ -148,7 +72,8 @@ export default function Button({ color = 'default', variant = 'text', className,
148
72
  <MaterialButton
149
73
  variant={variant}
150
74
  color={checarCor()}
151
- className={clsx(classes[variant], { [classes[`${variant}${capitalize(color)}`]]: color !== 'default' && color !== 'inherit' && color !== 'primary' && color !== 'secondary', }, className)}
75
+ className={className}
76
+ sx={[getCustomColorSx(color, variant), ...normalizeSx(sx)]}
152
77
  {...props}
153
78
  >
154
79
  {props.children}
@@ -174,4 +99,4 @@ Button.propTypes = {
174
99
  startIcon: PropTypes.node,
175
100
  type: PropTypes.string,
176
101
  variant: PropTypes.oneOf(['text', 'outlined', 'contained']),
177
- };
102
+ };
@@ -1,7 +1,7 @@
1
1
  import { createField, setField, getField, fieldChangeListener } from '../../fieldsRedux';
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { Component } from 'react';
4
- import MaskedInput from 'react-maskedinput';
4
+ import MaskedInput from '@mona-health/react-input-mask';
5
5
 
6
6
  /**
7
7
  * @deprecated
@@ -247,7 +247,7 @@ class MonthPicker extends Component {
247
247
  const values = getField(field, 'value');
248
248
  const inputValue = getField(field, 'inputValue');
249
249
 
250
- const mask = type === 'single' ? '11/1111' : '11/1111 à 11/1111';
250
+ const mask = type === 'single' ? '99/9999' : '99/9999 à 99/9999';
251
251
 
252
252
  return (
253
253
  <div className='monthPickermaxwidth'>
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
3
  import { useUpdateEffect } from '../../utils';
4
- import { Box, makeStyles, OutlinedTextFieldProps, TextField } from '@material-ui/core';
4
+ import { Box, OutlinedTextFieldProps, TextField } from '@mui/material';
5
5
  import React, { useState, useEffect, useRef } from 'react';
6
6
 
7
7
  // keyCode constants
@@ -28,47 +28,46 @@ export interface SingleProps extends Partial<Omit<Props, 'onChange'>> {
28
28
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
29
29
  }
30
30
 
31
- const useStyles = makeStyles(theme => ({
32
- field: {
33
- '& [class*="MuiInputBase-root"]': {
34
- height: '100%',
35
- fontSize: 'inherit'
36
- },
37
- [theme.breakpoints.up('xs')]: {
38
- margin: theme.spacing(0),
39
- width: '1em',
40
- height: '1em',
41
- fontSize: '.6em'
42
- },
43
- [theme.breakpoints.up('sm')]: {
44
- margin: theme.spacing(1),
45
- width: '1em',
46
- height: '1em',
47
- fontSize: '.6em'
48
- },
49
- [theme.breakpoints.up('md')]: {
50
- margin: theme.spacing(1),
51
- width: '1.2em',
52
- height: '1.2em',
53
- fontSize: '.8em'
54
- },
55
- [theme.breakpoints.up('lg')]: {
56
- margin: theme.spacing(2),
57
- width: '1.5em',
58
- height: '1.5em',
59
- },
60
- [theme.breakpoints.up('xl')]: {
61
- margin: theme.spacing(2),
62
- width: '1.6em',
63
- height: '1.6em',
64
- },
31
+ const fieldSx = theme => ({
32
+ '& [class*="MuiInputBase-root"]': {
33
+ height: '100%',
34
+ fontSize: 'inherit'
65
35
  },
66
- input: {
67
- textAlign: 'center',
68
- textTransform: 'uppercase',
69
- padding: 0
70
- }
71
- }));
36
+ [theme.breakpoints.up('xs')]: {
37
+ margin: theme.spacing(0),
38
+ width: '1em',
39
+ height: '1em',
40
+ fontSize: '.6em'
41
+ },
42
+ [theme.breakpoints.up('sm')]: {
43
+ margin: theme.spacing(1),
44
+ width: '1em',
45
+ height: '1em',
46
+ fontSize: '.6em'
47
+ },
48
+ [theme.breakpoints.up('md')]: {
49
+ margin: theme.spacing(1),
50
+ width: '1.2em',
51
+ height: '1.2em',
52
+ fontSize: '.8em'
53
+ },
54
+ [theme.breakpoints.up('lg')]: {
55
+ margin: theme.spacing(2),
56
+ width: '1.5em',
57
+ height: '1.5em',
58
+ },
59
+ [theme.breakpoints.up('xl')]: {
60
+ margin: theme.spacing(2),
61
+ width: '1.6em',
62
+ height: '1.6em',
63
+ },
64
+ });
65
+
66
+ const inputStyle = {
67
+ textAlign: 'center' as const,
68
+ textTransform: 'uppercase' as const,
69
+ padding: 0
70
+ };
72
71
 
73
72
  const SingleOtpInput = ({
74
73
  separator,
@@ -80,8 +79,7 @@ const SingleOtpInput = ({
80
79
  placeholder,
81
80
  ...props
82
81
  }: SingleProps) => {
83
- const classes = useStyles();
84
- const inputRef = useRef<any>();
82
+ const inputRef = useRef<any>(null);
85
83
 
86
84
  // Focus on first render
87
85
  // Only when autoFocus is true
@@ -98,23 +96,33 @@ const SingleOtpInput = ({
98
96
  }
99
97
  }, [focus]);
100
98
 
101
- return <>
102
- <TextField
103
- className={classes.field}
104
- variant='outlined'
105
- inputProps={{
106
- ...props.inputProps,
107
- className: classes.input,
108
- autoComplete: 'off',
109
- maxLength: '1',
110
- ref: inputRef,
111
- }}
112
- value={value || ''}
113
- placeholder={placeholder && placeholder[index]}
114
- {...props}
115
- />
116
- {!isLastChild && separator}
117
- </>;
99
+ return (
100
+ <>
101
+ <TextField
102
+ sx={fieldSx}
103
+ variant='outlined'
104
+ value={value || ''}
105
+ placeholder={placeholder && placeholder[index]}
106
+ {...props}
107
+ slotProps={{
108
+ ...props.slotProps,
109
+ htmlInput: ownerState => {
110
+ const htmlInputProps = typeof props.slotProps?.htmlInput === 'function'
111
+ ? props.slotProps.htmlInput(ownerState)
112
+ : props.slotProps?.htmlInput;
113
+
114
+ return {
115
+ ...htmlInputProps,
116
+ style: { ...inputStyle, ...htmlInputProps?.style },
117
+ autoComplete: 'off',
118
+ maxLength: 1,
119
+ ref: inputRef,
120
+ };
121
+ },
122
+ }} />
123
+ {!isLastChild && separator}
124
+ </>
125
+ );
118
126
  };
119
127
 
120
128
  const OtpInput = ({
@@ -134,16 +142,16 @@ const OtpInput = ({
134
142
  setLocalValue(otp);
135
143
  onChange(otp.join('')?.toUpperCase());
136
144
  };
137
-
145
+
138
146
  // Focus on input by index
139
147
  const focusInput = (input: number) => setActiveInput(Math.max(Math.min(numInputs - 1, input), 0));
140
-
148
+
141
149
  // Focus on next input
142
150
  const focusNextInput = () => focusInput(activeInput + 1);
143
-
151
+
144
152
  // Focus on previous input
145
153
  const focusPrevInput = () => focusInput(activeInput - 1);
146
-
154
+
147
155
  // Change OTP value at focused input
148
156
  const changeCodeAtFocus = (value: string) => {
149
157
  const otp = otpValue;
@@ -159,7 +167,7 @@ const OtpInput = ({
159
167
  const { disabled } = props;
160
168
 
161
169
  if (disabled) return;
162
-
170
+
163
171
  const otp = otpValue;
164
172
  let nextActiveInput = activeInput;
165
173
 
@@ -185,8 +193,8 @@ const OtpInput = ({
185
193
  }, 0);
186
194
  };
187
195
 
188
- const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => changeCodeAtFocus(e.target.value);
189
-
196
+ const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => changeCodeAtFocus(e.target.value);
197
+
190
198
  // Handle cases of backspace, delete, left arrow, right arrow, space
191
199
  const handleOnKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
192
200
  if (e.keyCode === BACKSPACE || e.key === 'Backspace') {
@@ -220,7 +228,7 @@ const OtpInput = ({
220
228
  const handleBlur = () => setActiveInput(-1);
221
229
 
222
230
  return (
223
- <Box display='flex' alignItems='center' justifyContent='center' fontSize='8em'>
231
+ <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '8em' }}>
224
232
  {Array(numInputs).fill(0).map((_, i) => (
225
233
  <SingleOtpInput
226
234
  {...props}
@@ -241,4 +249,4 @@ const OtpInput = ({
241
249
  );
242
250
  };
243
251
 
244
- export default OtpInput;
252
+ export default OtpInput;
@@ -1,4 +1,4 @@
1
- import { TypographyVariant } from '@material-ui/core';
1
+ import { TypographyVariant } from '@mui/material';
2
2
 
3
3
 
4
4
  export interface PercentageDisplayProps {
@@ -1,36 +1,5 @@
1
- import { makeStyles, Typography } from '@material-ui/core';
2
- import React, { useCallback, useEffect } from 'react';
3
-
4
-
5
- const useStyles = makeStyles({
6
- container: {
7
- display: 'grid',
8
- placeItems: 'center'
9
- },
10
- circularProgress: {
11
- height: ({ size }) => size,
12
- width: ({ size }) => size,
13
- backgroundColor: ({ barBackgroundColor }) => barBackgroundColor,
14
- borderRadius: '50%',
15
- display: 'grid',
16
- placeItems: 'center',
17
- '&::before': {
18
- content: '""',
19
- position: 'absolute',
20
- height: ({ progressBarWidth }) => progressBarWidth,
21
- width: ({ progressBarWidth }) => progressBarWidth,
22
- borderRadius: '50%',
23
- backgroundColor: ({ backgroundColor }) => backgroundColor
24
- }
25
- },
26
- valueContainer: {
27
- position: 'relative'
28
- },
29
- typography: {
30
- color: ({ color }) => color,
31
- fontSize: ({ fontSize }) => fontSize
32
- }
33
- });
1
+ import { Box, Typography } from '@mui/material';
2
+ import React from 'react';
34
3
 
35
4
 
36
5
  const PercentageDisplay = ({
@@ -46,32 +15,38 @@ const PercentageDisplay = ({
46
15
  barBackgroundColor = '#00995d26'
47
16
  }) => {
48
17
 
18
+ const porcentagem = parseInt(percentage);
49
19
  const progressBarWidth = size - barWidth;
50
- const classes = useStyles({ color, backgroundColor, barColor, barBackgroundColor, size, progressBarWidth, fontSize });
51
20
  const percentageDisplayProgressId = `${id}-percentageDisplayProgress`;
52
21
 
53
- const createProgress = useCallback(() => {
54
- const porcentagem = parseInt(percentage);
55
- const progressBar = document.getElementById(percentageDisplayProgressId);
56
- if (!progressBar) return;
57
- progressBar.style.background = `conic-gradient(${barColor} ${porcentagem * 3.6}deg, ${barBackgroundColor} ${porcentagem * 3.6}deg)`;
58
- }, [barBackgroundColor, barColor, percentage, percentageDisplayProgressId]);
59
-
60
- useEffect(() => {
61
- createProgress();
62
- }, [percentage, createProgress]);
63
-
64
-
65
- return <div className={classes.container}>
66
- <div id={percentageDisplayProgressId} className={classes.circularProgress}>
67
- <div className={classes.valueContainer}>
68
- <Typography variant={typographyVariant} className={classes.typography}>
22
+ return <Box sx={{ display: 'grid', placeItems: 'center' }}>
23
+ <Box
24
+ id={percentageDisplayProgressId}
25
+ sx={{
26
+ height: size,
27
+ width: size,
28
+ background: `conic-gradient(${barColor} ${porcentagem * 3.6}deg, ${barBackgroundColor} ${porcentagem * 3.6}deg)`,
29
+ borderRadius: '50%',
30
+ display: 'grid',
31
+ placeItems: 'center',
32
+ '&::before': {
33
+ content: '""',
34
+ position: 'absolute',
35
+ height: progressBarWidth,
36
+ width: progressBarWidth,
37
+ borderRadius: '50%',
38
+ backgroundColor
39
+ }
40
+ }}
41
+ >
42
+ <Box sx={{ position: 'relative' }}>
43
+ <Typography variant={typographyVariant} sx={{ color, fontSize }}>
69
44
  {`${percentage}%`}
70
45
  </Typography>
71
- </div>
72
- </div>
73
- </div>;
46
+ </Box>
47
+ </Box>
48
+ </Box>;
74
49
  };
75
50
 
76
51
 
77
- export default PercentageDisplay;
52
+ export default PercentageDisplay;