25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

584 satır
19 KiB

  1. import {createTheme} from "@mui/material";
  2. import Palette from "./palette";
  3. import Typography from "./typography";
  4. import {GENERAL_TABLE_BOARDER_COLOR, TABLE_HEADER_TEXT_COLOR, CONTAINED_PRIMARY_BLUE, VALIDATION_ERROR_COLOR} from "./colorConst";
  5. const FONT_SIZE = '1.1rem';
  6. const TABLE_FONT_SIZE = '1.0rem';
  7. const HELPER_FONT_SIZE = '0.9rem';
  8. const ROW_HEIGHT = '46px';
  9. const theme = Palette('light', 'default');
  10. export const CARD_MAX_WIDTH = "98%"
  11. const themeTypography = Typography(
  12. `'Public Sans', sans-serif`,
  13. );
  14. export const PNSPS_THEME = createTheme({
  15. palette: theme.palette,
  16. typography: themeTypography,
  17. cancel: {
  18. main: '#424242', // dark gray, WCAG safe
  19. contrastText: '#FFFFFF'
  20. },
  21. components: {
  22. MuiImage: {
  23. root: {
  24. position: 'relative',
  25. '&:hover': {
  26. '&::after': {
  27. content: '""',
  28. position: 'absolute',
  29. top: 0,
  30. left: 0,
  31. width: '100%',
  32. height: '100%',
  33. background: 'rgba(0, 0, 0, 0.5)',
  34. opacity: 0,
  35. transition: 'opacity 0.3s ease',
  36. },
  37. '&:hover::after': {
  38. opacity: 1,
  39. },
  40. },
  41. },
  42. },
  43. MuiButton: {
  44. defaultProps: {
  45. disableRipple: true,
  46. },
  47. styleOverrides: {
  48. root: ({ ownerState }) => ({
  49. ...(ownerState.color === "cancel" && {
  50. borderColor: "#9E9E9E",
  51. }),
  52. textTransform: 'none',
  53. '&:active': {
  54. boxShadow: 'none',
  55. transform: 'none',
  56. },
  57. }),
  58. contained: ({ theme, ownerState }) => ({
  59. ...(ownerState.color === "cancel" && {
  60. border: "2px solid #9E9E9E",
  61. boxShadow: "none",
  62. }),
  63. '&:active': {
  64. backgroundColor: theme.palette[ownerState.color]?.main ?? theme.palette.primary.main,
  65. boxShadow: 'none',
  66. },
  67. }),
  68. outlined: {
  69. '&:active': {
  70. backgroundColor: 'transparent',
  71. },
  72. },
  73. },
  74. },
  75. MuiInputAdornment: {
  76. styleOverrides: {
  77. root: {
  78. marginLeft: '-1px',
  79. //marginRight: '0px',
  80. },
  81. },
  82. },
  83. MuiFormHelperText: {
  84. styleOverrides: {
  85. root: {
  86. fontSize: HELPER_FONT_SIZE, // Adjust the font size as needed
  87. },
  88. },
  89. },
  90. MuiPickersBasePicker: {
  91. styleOverrides: {
  92. toolbar: {
  93. height: ROW_HEIGHT // Set the desired height value here
  94. }
  95. }
  96. },
  97. MuiPickersDay: {
  98. root:{
  99. height: ROW_HEIGHT,
  100. },
  101. day: {
  102. padding: '20px', // Set the desired padding value here
  103. },
  104. },
  105. MuiButtonBase:{
  106. styleOverrides:{
  107. root:{
  108. '&.MuiChip-root.Mui-disabled':{
  109. opacity: 0.75,
  110. },
  111. '&.MuiButton-root':{
  112. fontSize: '1.2rem',
  113. fontWeight: '600',
  114. alignItems: 'center',
  115. },
  116. }
  117. }
  118. },
  119. MuiIconButton: {
  120. styleOverrides: {
  121. root: {
  122. marginRight: '-2px',
  123. borderRadius: 3
  124. },
  125. marginRight: '-3px',
  126. sizeLarge: {
  127. width: theme.spacing(5.5),
  128. height: theme.spacing(5.5),
  129. fontSize: '1.25rem'
  130. },
  131. sizeMedium: {
  132. width: theme.spacing(4.5),
  133. height: theme.spacing(4.5),
  134. fontSize: '1rem'
  135. },
  136. sizeSmall: {
  137. width: theme.spacing(3.75),
  138. height: theme.spacing(3.75),
  139. fontSize: '0.75rem'
  140. }
  141. }
  142. },
  143. MuiInputLabel: {
  144. styleOverrides: {
  145. root: {
  146. color: 'rgba(0, 0, 0, 0.8)',
  147. fontSize: '1.15rem',
  148. '&.Mui-focused': {
  149. color: CONTAINED_PRIMARY_BLUE,
  150. },
  151. '&.Mui-error': {
  152. color: VALIDATION_ERROR_COLOR,
  153. },
  154. '&.Mui-focused.Mui-error': {
  155. color: VALIDATION_ERROR_COLOR,
  156. },
  157. },
  158. },
  159. },
  160. MuiChip:{
  161. styleOverrides: {
  162. label: {
  163. lineHeight: 'normal',
  164. whiteSpace: "inherit",
  165. paddingTop: '2px',
  166. paddingBottom: '2px'
  167. },
  168. },
  169. },
  170. MuiAutocomplete: {
  171. styleOverrides: {
  172. tag: {
  173. height: 'auto',
  174. whiteSpace: 'normal',
  175. },
  176. inputRoot: {
  177. maxHeight: '30vh', // Set the desired height value here
  178. },
  179. root: {
  180. minHeight: ROW_HEIGHT,
  181. '&:MuiAutocomplete-input': {
  182. display: 'flex',
  183. alignItems: 'center',
  184. },
  185. },
  186. popupIndicator: {
  187. height: '30px',
  188. width: '30px',
  189. },
  190. endAdornment: {
  191. root: {
  192. height: '30px',
  193. width: '30px',
  194. marginRight: '-2px',
  195. marginBottom: '3px',
  196. borderRadius: 3
  197. },
  198. marginRight: '-3px',
  199. sizeLarge: {
  200. width: theme.spacing(5.5),
  201. height: theme.spacing(5.5),
  202. fontSize: '1.25rem'
  203. },
  204. sizeMedium: {
  205. width: theme.spacing(3.75),
  206. height: theme.spacing(3.75),
  207. fontSize: '1rem'
  208. },
  209. sizeSmall: {
  210. width: theme.spacing(3.75),
  211. height: theme.spacing(3.75),
  212. fontSize: '0.75rem'
  213. },
  214. top: "auto"
  215. },
  216. },
  217. },
  218. MuiInputBase: {
  219. root: {
  220. padding: '2px', // Set the desired padding value here
  221. },
  222. },
  223. MuiOutlinedInput: {
  224. styleOverrides: {
  225. input: {
  226. padding: '10.5px 14px 10.5px 12px',
  227. '&.MuiOutlinedInput-input.Mui-disabled': {
  228. WebkitTextFillColor: 'rgba(0, 0, 0, 1)',
  229. },
  230. color: 'rgba(0, 0, 0, 0.85)',
  231. },
  232. root: {
  233. /* =============================
  234. Issue 1: Input boundary contrast
  235. ============================= */
  236. '& .MuiOutlinedInput-notchedOutline': {
  237. borderColor: '#767676', // >= 3:1 on white
  238. borderWidth: 1,
  239. },
  240. '&:hover .MuiOutlinedInput-notchedOutline': {
  241. borderColor: '#767676',
  242. },
  243. '&.Mui-focused .MuiOutlinedInput-notchedOutline': {
  244. borderColor: CONTAINED_PRIMARY_BLUE,
  245. borderWidth: 3, // thick focus indicator
  246. },
  247. /* Prevent “shrinking” of inner area when border gets thicker */
  248. '&.Mui-focused .MuiOutlinedInput-input': {
  249. padding: '8.5px 12px 8.5px 10px', // 10.5-2, 14-2, 10.5-2, 12-2
  250. },
  251. '&.Mui-focused.MuiInputBase-sizeSmall .MuiOutlinedInput-input': {
  252. padding: '5.5px 6px 5.5px 10px', // 7.5-2, 8-2, 7.5-2, 12-2
  253. },
  254. /* Error state — same red as FormHelperText (#B00020) */
  255. '&.Mui-error .MuiOutlinedInput-notchedOutline': {
  256. borderColor: VALIDATION_ERROR_COLOR,
  257. borderWidth: 1,
  258. },
  259. '&.Mui-error:hover .MuiOutlinedInput-notchedOutline': {
  260. borderColor: VALIDATION_ERROR_COLOR,
  261. },
  262. '&.Mui-error.Mui-focused .MuiOutlinedInput-notchedOutline': {
  263. borderColor: VALIDATION_ERROR_COLOR,
  264. borderWidth: 3,
  265. },
  266. height: ROW_HEIGHT,
  267. },
  268. inputSizeSmall: {
  269. padding: '7.5px 8px 7.5px 12px',
  270. },
  271. inputMultiline: {
  272. root: {
  273. minHeight: ROW_HEIGHT,
  274. maxHeight: '50vh',
  275. },
  276. padding: '7.5px 8px 7.5px 12px',
  277. },
  278. },
  279. },
  280. MuiCheckbox: {
  281. defaultProps: {
  282. disableRipple: true,
  283. },
  284. styleOverrides: {
  285. root: {
  286. /* Default (unchecked) state — darker */
  287. color: '#595959', // >= 3:1 on white
  288. /* Hover (keep contrast) */
  289. '&:hover': {
  290. backgroundColor: 'transparent',
  291. },
  292. '&:active': {
  293. backgroundColor: 'transparent',
  294. },
  295. /* Checked state — same blue as applyPublicNotice button */
  296. '&.Mui-checked': {
  297. color: CONTAINED_PRIMARY_BLUE,
  298. },
  299. /* Focus-visible */
  300. '&.Mui-focusVisible': {
  301. boxShadow: `0 0 0 3px ${CONTAINED_PRIMARY_BLUE}`,
  302. },
  303. },
  304. },
  305. },
  306. MuiRadio: {
  307. defaultProps: {
  308. disableRipple: true,
  309. },
  310. styleOverrides: {
  311. root: {
  312. color: '#595959',
  313. '&:hover': {
  314. backgroundColor: 'transparent',
  315. },
  316. '&:active': {
  317. backgroundColor: 'transparent',
  318. },
  319. '&.Mui-checked': {
  320. color: CONTAINED_PRIMARY_BLUE,
  321. },
  322. '&.Mui-focusVisible': {
  323. boxShadow: `0 0 0 3px ${CONTAINED_PRIMARY_BLUE}`,
  324. },
  325. },
  326. },
  327. },
  328. MuiTextField: {
  329. styleOverrides: {
  330. root: {
  331. '& .MuiInputBase-input': {
  332. fontSize: FONT_SIZE,
  333. display: 'flex',
  334. alignItems: 'center',
  335. color: 'rgba(0, 0, 0, 0.85)'
  336. },
  337. '& .MuiInputBase-root': {
  338. //height: '40px',
  339. minHeight: ROW_HEIGHT,
  340. maxHeight: ROW_HEIGHT,
  341. boxSizing: 'border-box', // Ensure the background shape follows the size of the TextField
  342. //padding: '1px', // Adjust the padding as needed
  343. },
  344. '& .MuiInputBase-input:disabled': {
  345. color: 'rgba(0, 0, 0, 1)',
  346. backgroundColor: "#f8f8f8",
  347. //backgroundColor: '#777777', // Set background color to #777777 for disabled state
  348. //color: '#010101', // Set text color to #111111 for disabled state
  349. },
  350. '& .Mui-focused.MuiAutocomplete-input': {
  351. color: "red"
  352. },
  353. },
  354. },
  355. },
  356. MuiTableCell: {
  357. styleOverrides: {
  358. root: {
  359. fontSize: TABLE_FONT_SIZE,
  360. borderColor: theme.palette.divider
  361. },
  362. head: {
  363. fontWeight: 600,
  364. paddingTop: 3,
  365. paddingBottom: 3
  366. }
  367. }
  368. },
  369. MuiTablePagination:{
  370. styleOverrides:{
  371. root:{
  372. fontSize: HELPER_FONT_SIZE,
  373. },
  374. selectLabel:{
  375. fontSize: HELPER_FONT_SIZE,
  376. },
  377. displayedRows:{
  378. fontSize: HELPER_FONT_SIZE,
  379. }
  380. }
  381. },
  382. MuiDataGrid: {
  383. styleOverrides: {
  384. '&>.MuiDataGrid-main': {
  385. '&>.MuiDataGrid-columnHeaders': {
  386. borderBottom: 'none',
  387. fontWeight: '900',
  388. },
  389. },
  390. root: {
  391. fontSize: TABLE_FONT_SIZE, // Set the font size
  392. maxWidth: '98vw',
  393. border: 'none !important',
  394. '& .MuiDataGrid-cell': {
  395. whiteSpace: 'normal', // Enable auto-wrapping
  396. wordBreak: 'break-word', // Break words if needed
  397. },
  398. },
  399. footerContainer:{
  400. maxHeight: "40px",
  401. minHeight: "40px",
  402. },
  403. editInputCell:{
  404. fontSize: TABLE_FONT_SIZE,
  405. },
  406. cell: {
  407. fontSize: TABLE_FONT_SIZE,
  408. borderBottom: 'none',
  409. '& .MuiDataGrid-cellValue': {
  410. whiteSpace: 'normal', // Enable auto-wrapping
  411. wordBreak: 'break-word', // Break words if needed
  412. },
  413. },
  414. columnHeaderCell: {
  415. '&:focus': {
  416. outline: 'none', // Remove the outline on focus
  417. },
  418. },
  419. columnHeaders: {
  420. borderBottom: '1px solid ' + GENERAL_TABLE_BOARDER_COLOR + ' !important',
  421. },
  422. columnHeader: {
  423. color: TABLE_HEADER_TEXT_COLOR,
  424. fontSize: TABLE_FONT_SIZE,
  425. '&:focus': {
  426. outline: 'none', // Remove the outline on focus
  427. },
  428. '&:not(:last-child)': {
  429. borderRight: 'none', // Remove the border between column headers
  430. },
  431. fontWeight: '900',
  432. },
  433. row: {
  434. borderBottom: 'none',
  435. },
  436. pagination: {
  437. borderTop: 'none !important',
  438. fontSize: TABLE_FONT_SIZE,
  439. "& .MuiTablePagination-actions": {
  440. border: 'none', // Remove the border around the pagination actions
  441. }
  442. },
  443. '& .MuiPaginationItem-root': {
  444. borderRadius: 0,
  445. },
  446. },
  447. },
  448. MuiCssBaseline: {
  449. styleOverrides: {
  450. '.MuiDataGrid-root .MuiDataGrid-row': {
  451. borderBottom: 'none', // Disable the border under each record
  452. },
  453. '.MuiDataGrid-root .MuiDataGrid-columnHeader': {
  454. borderBottom: 'none', // Disable the border near the column headers
  455. },
  456. },
  457. },
  458. MuiTab: {
  459. defaultProps: {
  460. disableRipple: true,
  461. },
  462. styleOverrides: {
  463. root: {
  464. fontSize: TABLE_FONT_SIZE, // ✅ unchanged
  465. minHeight: 46,
  466. textTransform: 'none',
  467. // Unselected tab text on white – AA compliant
  468. color: '#424242',
  469. // Selected tab text – AA compliant blue
  470. '&.Mui-selected': {
  471. color: '#1565C0',
  472. },
  473. // Hover (optional but consistent)
  474. '&:hover': {
  475. color: '#1565C0',
  476. },
  477. '&:active': {
  478. backgroundColor: 'transparent',
  479. },
  480. '&:active:not(.Mui-selected)': {
  481. color: '#424242',
  482. },
  483. // ✅ Keyboard TAB focus (visible & accessible)
  484. '&.Mui-focusVisible': {
  485. outline: `3px solid ${CONTAINED_PRIMARY_BLUE}`,
  486. outlineOffset: '3px',
  487. borderRadius: '6px',
  488. },
  489. },
  490. },
  491. },
  492. MuiTabs: {
  493. styleOverrides: {
  494. vertical: {
  495. overflow: 'visible',
  496. },
  497. // ✅ Selected tab indicator – AA compliant blue
  498. indicator: {
  499. backgroundColor: '#1565C0',
  500. height: '3px',
  501. },
  502. },
  503. },
  504. MuiFormLabel: {
  505. styleOverrides: {
  506. root:{
  507. color: "#000000"
  508. }
  509. }
  510. },
  511. MuiTabPanel:{
  512. styleOverrides:{
  513. root:{
  514. padding: 0
  515. }
  516. }
  517. }
  518. },
  519. });
  520. export const ARS_NAV_THEME = createTheme({
  521. typography: {
  522. fontSize: 14,
  523. },
  524. });
  525. export const ARS_LOGIN_THEME = createTheme({
  526. components: {
  527. MuiFormHelperText: {
  528. styleOverrides: {
  529. root: {
  530. fontSize: HELPER_FONT_SIZE, // Adjust the font size as needed
  531. },
  532. },
  533. },
  534. MuiInputLabel: {
  535. styleOverrides: {
  536. root: {
  537. fontSize: '1.15rem',
  538. },
  539. },
  540. },
  541. MuiTextField: {
  542. styleOverrides: {
  543. root: {
  544. '& .MuiInputBase-input': {
  545. fontSize: '1.3rem',
  546. display: 'flex',
  547. alignItems: 'flex-end',
  548. },
  549. '& .MuiInputBase-root': {
  550. height: '50px',
  551. },
  552. },
  553. },
  554. },
  555. },
  556. });