Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

427 linhas
14 KiB

  1. import {createTheme} from "@mui/material";
  2. import Palette from "./palette";
  3. import Typography from "./typography";
  4. import {alpha} from "@mui/material/styles";
  5. import {GENERAL_TABLE_BOARDER_COLOR, TABLE_HEADER_TEXT_COLOR} from "./colorConst";
  6. const FONT_SIZE = '1.1rem';
  7. const TABLE_FONT_SIZE = '1.0rem';
  8. const HELPER_FONT_SIZE = '0.9rem';
  9. const ROW_HEIGHT = '46px';
  10. const theme = Palette('light', 'default');
  11. export const CARD_MAX_WIDTH = "98%"
  12. const themeTypography = Typography(
  13. `'Public Sans', sans-serif`,
  14. );
  15. export const PNSPS_THEME = createTheme({
  16. palette: theme.palette,
  17. typography: themeTypography,
  18. components: {
  19. MuiImage: {
  20. root: {
  21. position: 'relative',
  22. '&:hover': {
  23. '&::after': {
  24. content: '""',
  25. position: 'absolute',
  26. top: 0,
  27. left: 0,
  28. width: '100%',
  29. height: '100%',
  30. background: 'rgba(0, 0, 0, 0.5)',
  31. opacity: 0,
  32. transition: 'opacity 0.3s ease',
  33. },
  34. '&:hover::after': {
  35. opacity: 1,
  36. },
  37. },
  38. },
  39. },
  40. MuiInputAdornment: {
  41. styleOverrides: {
  42. root: {
  43. marginLeft: '-1px',
  44. //marginRight: '0px',
  45. },
  46. },
  47. },
  48. MuiFormHelperText: {
  49. styleOverrides: {
  50. root: {
  51. fontSize: HELPER_FONT_SIZE, // Adjust the font size as needed
  52. },
  53. },
  54. },
  55. MuiPickersBasePicker: {
  56. styleOverrides: {
  57. toolbar: {
  58. height: ROW_HEIGHT // Set the desired height value here
  59. }
  60. }
  61. },
  62. MuiPickersDay: {
  63. root:{
  64. height: ROW_HEIGHT,
  65. },
  66. day: {
  67. padding: '20px', // Set the desired padding value here
  68. },
  69. },
  70. MuiButtonBase:{
  71. styleOverrides:{
  72. root:{
  73. '&.MuiChip-root.Mui-disabled':{
  74. opacity: 0.75,
  75. },
  76. '&.MuiButton-root':{
  77. fontSize: '1.2rem',
  78. fontWeight: '600',
  79. alignItems: 'center',
  80. },
  81. }
  82. }
  83. },
  84. MuiIconButton: {
  85. styleOverrides: {
  86. root: {
  87. marginRight: '-2px',
  88. borderRadius: 3
  89. },
  90. marginRight: '-3px',
  91. sizeLarge: {
  92. width: theme.spacing(5.5),
  93. height: theme.spacing(5.5),
  94. fontSize: '1.25rem'
  95. },
  96. sizeMedium: {
  97. width: theme.spacing(4.5),
  98. height: theme.spacing(4.5),
  99. fontSize: '1rem'
  100. },
  101. sizeSmall: {
  102. width: theme.spacing(3.75),
  103. height: theme.spacing(3.75),
  104. fontSize: '0.75rem'
  105. }
  106. }
  107. },
  108. MuiInputLabel: {
  109. styleOverrides: {
  110. root: {
  111. color: 'rgba(0, 0, 0, 0.8)',
  112. fontSize: '1.15rem',
  113. },
  114. },
  115. },
  116. MuiChip:{
  117. styleOverrides: {
  118. label: {
  119. lineHeight: 'normal',
  120. whiteSpace: "inherit",
  121. paddingTop: '2px',
  122. paddingBottom: '2px'
  123. },
  124. },
  125. },
  126. MuiAutocomplete: {
  127. styleOverrides: {
  128. tag: {
  129. height: 'auto',
  130. whiteSpace: 'normal',
  131. },
  132. inputRoot: {
  133. maxHeight: '30vh', // Set the desired height value here
  134. },
  135. root: {
  136. minHeight: ROW_HEIGHT,
  137. '&:MuiAutocomplete-input': {
  138. display: 'flex',
  139. alignItems: 'center',
  140. },
  141. },
  142. popupIndicator: {
  143. height: '30px',
  144. width: '30px',
  145. },
  146. endAdornment: {
  147. root: {
  148. height: '30px',
  149. width: '30px',
  150. marginRight: '-2px',
  151. marginBottom: '3px',
  152. borderRadius: 3
  153. },
  154. marginRight: '-3px',
  155. sizeLarge: {
  156. width: theme.spacing(5.5),
  157. height: theme.spacing(5.5),
  158. fontSize: '1.25rem'
  159. },
  160. sizeMedium: {
  161. width: theme.spacing(3.75),
  162. height: theme.spacing(3.75),
  163. fontSize: '1rem'
  164. },
  165. sizeSmall: {
  166. width: theme.spacing(3.75),
  167. height: theme.spacing(3.75),
  168. fontSize: '0.75rem'
  169. },
  170. top: "auto"
  171. },
  172. },
  173. },
  174. MuiInputBase: {
  175. root: {
  176. padding: '2px', // Set the desired padding value here
  177. },
  178. },
  179. MuiOutlinedInput: {
  180. styleOverrides: {
  181. input: {
  182. padding: '10.5px 14px 10.5px 12px',
  183. '&.MuiOutlinedInput-input.Mui-disabled': {
  184. WebkitTextFillColor: 'rgba(0, 0, 0, 1)',
  185. },
  186. color: 'rgba(0, 0, 0, 0.85)'
  187. },
  188. root: {
  189. '&:hover .MuiOutlinedInput-notchedOutline': {
  190. borderColor: theme.palette.primary.light
  191. },
  192. '&.Mui-focused': {
  193. boxShadow: `0 0 0 2px ${alpha(theme.palette.primary.main, 0.2)}`,
  194. '& .MuiOutlinedInput-notchedOutline': {
  195. border: `1px solid ${theme.palette.primary.light}`
  196. }
  197. },
  198. '&.Mui-error': {
  199. '&:hover .MuiOutlinedInput-notchedOutline': {
  200. borderColor: theme.palette.error.light
  201. },
  202. '&.Mui-focused': {
  203. boxShadow: `0 0 0 2px ${alpha(theme.palette.error.main, 0.2)}`,
  204. '& .MuiOutlinedInput-notchedOutline': {
  205. border: `1px solid ${theme.palette.error.light}`
  206. }
  207. }
  208. },
  209. height: ROW_HEIGHT
  210. },
  211. inputSizeSmall: {
  212. padding: '7.5px 8px 7.5px 12px'
  213. },
  214. inputMultiline: {
  215. root:{
  216. minHeight: ROW_HEIGHT,
  217. maxHeight: '50vh'
  218. },
  219. padding: '7.5px 8px 7.5px 12px'
  220. }
  221. }
  222. },
  223. MuiTextField: {
  224. styleOverrides: {
  225. root: {
  226. '& .MuiInputBase-input': {
  227. fontSize: FONT_SIZE,
  228. display: 'flex',
  229. alignItems: 'center',
  230. color: 'rgba(0, 0, 0, 0.85)'
  231. },
  232. '& .MuiInputBase-root': {
  233. //height: '40px',
  234. minHeight: ROW_HEIGHT,
  235. maxHeight: ROW_HEIGHT,
  236. boxSizing: 'border-box', // Ensure the background shape follows the size of the TextField
  237. //padding: '1px', // Adjust the padding as needed
  238. },
  239. '& .MuiInputBase-input:disabled': {
  240. color: 'rgba(0, 0, 0, 1)',
  241. backgroundColor: "#f8f8f8",
  242. //backgroundColor: '#777777', // Set background color to #777777 for disabled state
  243. //color: '#010101', // Set text color to #111111 for disabled state
  244. },
  245. '& .Mui-focused.MuiAutocomplete-input': {
  246. color: "red"
  247. },
  248. },
  249. },
  250. },
  251. MuiTableCell: {
  252. styleOverrides: {
  253. root: {
  254. fontSize: TABLE_FONT_SIZE,
  255. borderColor: theme.palette.divider
  256. },
  257. head: {
  258. fontWeight: 600,
  259. paddingTop: 3,
  260. paddingBottom: 3
  261. }
  262. }
  263. },
  264. MuiTablePagination:{
  265. styleOverrides:{
  266. root:{
  267. fontSize: HELPER_FONT_SIZE,
  268. },
  269. selectLabel:{
  270. fontSize: HELPER_FONT_SIZE,
  271. },
  272. displayedRows:{
  273. fontSize: HELPER_FONT_SIZE,
  274. }
  275. }
  276. },
  277. MuiDataGrid: {
  278. styleOverrides: {
  279. '&>.MuiDataGrid-main': {
  280. '&>.MuiDataGrid-columnHeaders': {
  281. borderBottom: 'none',
  282. fontWeight: '900',
  283. },
  284. },
  285. root: {
  286. fontSize: TABLE_FONT_SIZE, // Set the font size
  287. maxWidth: '98vw',
  288. border: 'none !important',
  289. '& .MuiDataGrid-cell': {
  290. whiteSpace: 'normal', // Enable auto-wrapping
  291. wordBreak: 'break-word', // Break words if needed
  292. },
  293. },
  294. footerContainer:{
  295. maxHeight: "40px",
  296. minHeight: "40px",
  297. },
  298. editInputCell:{
  299. fontSize: TABLE_FONT_SIZE,
  300. },
  301. cell: {
  302. fontSize: TABLE_FONT_SIZE,
  303. borderBottom: 'none',
  304. '& .MuiDataGrid-cellValue': {
  305. whiteSpace: 'normal', // Enable auto-wrapping
  306. wordBreak: 'break-word', // Break words if needed
  307. },
  308. },
  309. columnHeaderCell: {
  310. '&:focus': {
  311. outline: 'none', // Remove the outline on focus
  312. },
  313. },
  314. columnHeaders: {
  315. borderBottom: '1px solid ' + GENERAL_TABLE_BOARDER_COLOR + ' !important',
  316. },
  317. columnHeader: {
  318. color: TABLE_HEADER_TEXT_COLOR,
  319. fontSize: TABLE_FONT_SIZE,
  320. '&:focus': {
  321. outline: 'none', // Remove the outline on focus
  322. },
  323. '&:not(:last-child)': {
  324. borderRight: 'none', // Remove the border between column headers
  325. },
  326. fontWeight: '900',
  327. },
  328. row: {
  329. borderBottom: 'none',
  330. },
  331. pagination: {
  332. borderTop: 'none !important',
  333. fontSize: TABLE_FONT_SIZE,
  334. "& .MuiTablePagination-actions": {
  335. border: 'none', // Remove the border around the pagination actions
  336. }
  337. },
  338. '& .MuiPaginationItem-root': {
  339. borderRadius: 0,
  340. },
  341. },
  342. },
  343. MuiCssBaseline: {
  344. styleOverrides: {
  345. '.MuiDataGrid-root .MuiDataGrid-row': {
  346. borderBottom: 'none', // Disable the border under each record
  347. },
  348. '.MuiDataGrid-root .MuiDataGrid-columnHeader': {
  349. borderBottom: 'none', // Disable the border near the column headers
  350. },
  351. },
  352. },
  353. MuiTab: {
  354. styleOverrides: {
  355. root: {
  356. fontSize: TABLE_FONT_SIZE,
  357. minHeight: 46,
  358. color: theme.palette.text.primary
  359. }
  360. }
  361. },
  362. MuiTabs: {
  363. styleOverrides: {
  364. vertical: {
  365. overflow: 'visible'
  366. }
  367. }
  368. },
  369. MuiFormLabel: {
  370. styleOverrides: {
  371. root:{
  372. color: "#000000"
  373. }
  374. }
  375. },
  376. MuiTabPanel:{
  377. styleOverrides:{
  378. root:{
  379. padding: 0
  380. }
  381. }
  382. }
  383. },
  384. });
  385. export const ARS_NAV_THEME = createTheme({
  386. typography: {
  387. fontSize: 14,
  388. },
  389. });
  390. export const ARS_LOGIN_THEME = createTheme({
  391. components: {
  392. MuiFormHelperText: {
  393. styleOverrides: {
  394. root: {
  395. fontSize: HELPER_FONT_SIZE, // Adjust the font size as needed
  396. },
  397. },
  398. },
  399. MuiInputLabel: {
  400. styleOverrides: {
  401. root: {
  402. fontSize: '1.15rem',
  403. },
  404. },
  405. },
  406. MuiTextField: {
  407. styleOverrides: {
  408. root: {
  409. '& .MuiInputBase-input': {
  410. fontSize: '1.3rem',
  411. display: 'flex',
  412. alignItems: 'flex-end',
  413. },
  414. '& .MuiInputBase-root': {
  415. height: '50px',
  416. },
  417. },
  418. },
  419. },
  420. },
  421. });