Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

383 lignes
8.1 KiB

  1. import { ThemeOptions, createTheme } from "@mui/material";
  2. import palette from "./palette";
  3. // Used only to create transitions
  4. const muiTheme = createTheme();
  5. const components: ThemeOptions["components"] = {
  6. MuiAppBar: {
  7. styleOverrides: {
  8. colorDefault: {
  9. backgroundColor: palette.background.paper,
  10. },
  11. },
  12. },
  13. MuiAvatar: {
  14. styleOverrides: {
  15. root: {
  16. fontSize: 14,
  17. fontWeight: 600,
  18. letterSpacing: 0,
  19. },
  20. },
  21. },
  22. MuiButton: {
  23. styleOverrides: {
  24. root: {
  25. borderRadius: "12px",
  26. textTransform: "none",
  27. },
  28. sizeSmall: {
  29. padding: "6px 16px",
  30. },
  31. sizeMedium: {
  32. padding: "8px 20px",
  33. },
  34. sizeLarge: {
  35. padding: "11px 24px",
  36. },
  37. textSizeSmall: {
  38. padding: "7px 12px",
  39. },
  40. textSizeMedium: {
  41. padding: "9px 16px",
  42. },
  43. textSizeLarge: {
  44. padding: "12px 16px",
  45. },
  46. },
  47. },
  48. MuiPaper: {
  49. styleOverrides: {
  50. rounded: {
  51. borderRadius: 20,
  52. [`&.MuiPaper-elevation1`]: {
  53. boxShadow:
  54. "0px 5px 22px rgba(0, 0, 0, 0.04), 0px 0px 0px 0.5px rgba(0, 0, 0, 0.03)",
  55. },
  56. },
  57. outlined: {
  58. borderStyle: "solid",
  59. borderWidth: 1,
  60. overflow: "hidden",
  61. borderColor: palette.neutral[200],
  62. "&.MuiPaper-rounded": {
  63. borderRadius: 8,
  64. },
  65. },
  66. },
  67. },
  68. MuiCard: {
  69. styleOverrides: {
  70. root: {
  71. borderRadius: 20,
  72. [`&.MuiPaper-elevation1`]: {
  73. boxShadow:
  74. "0px 5px 22px rgba(0, 0, 0, 0.04), 0px 0px 0px 0.5px rgba(0, 0, 0, 0.03)",
  75. },
  76. },
  77. },
  78. },
  79. MuiCardContent: {
  80. styleOverrides: {
  81. root: {
  82. padding: "32px 24px",
  83. "&:last-child": {
  84. paddingBottom: "32px",
  85. },
  86. },
  87. },
  88. },
  89. MuiCardHeader: {
  90. defaultProps: {
  91. titleTypographyProps: {
  92. variant: "h6",
  93. },
  94. subheaderTypographyProps: {
  95. variant: "body2",
  96. },
  97. },
  98. styleOverrides: {
  99. root: {
  100. padding: "32px 24px 16px",
  101. },
  102. },
  103. },
  104. MuiCssBaseline: {
  105. styleOverrides: {
  106. "*": {
  107. boxSizing: "border-box",
  108. },
  109. html: {
  110. MozOsxFontSmoothing: "grayscale",
  111. WebkitFontSmoothing: "antialiased",
  112. display: "flex",
  113. flexDirection: "column",
  114. minHeight: "100%",
  115. width: "100%",
  116. },
  117. body: {
  118. display: "flex",
  119. flex: "1 1 auto",
  120. flexDirection: "column",
  121. minHeight: "100%",
  122. width: "100%",
  123. },
  124. "#__next": {
  125. display: "flex",
  126. flex: "1 1 auto",
  127. flexDirection: "column",
  128. height: "100%",
  129. width: "100%",
  130. },
  131. "#nprogress": {
  132. pointerEvents: "none",
  133. },
  134. "#nprogress .bar": {
  135. backgroundColor: palette.primary.main,
  136. height: 3,
  137. left: 0,
  138. position: "fixed",
  139. top: 0,
  140. width: "100%",
  141. zIndex: 2000,
  142. },
  143. },
  144. },
  145. MuiInputBase: {
  146. styleOverrides: {
  147. input: {
  148. "&::placeholder": {
  149. opacity: 1,
  150. },
  151. },
  152. },
  153. },
  154. MuiInput: {
  155. styleOverrides: {
  156. input: {
  157. fontSize: 14,
  158. fontWeight: 500,
  159. lineHeight: "24px",
  160. "&::placeholder": {
  161. color: palette.text.secondary,
  162. },
  163. },
  164. },
  165. },
  166. MuiFilledInput: {
  167. styleOverrides: {
  168. root: {
  169. backgroundColor: "transparent",
  170. borderRadius: 8,
  171. borderStyle: "solid",
  172. borderWidth: 1,
  173. overflow: "hidden",
  174. borderColor: palette.neutral[200],
  175. transition: muiTheme.transitions.create(["border-color", "box-shadow"]),
  176. "&:hover": {
  177. backgroundColor: palette.action.hover,
  178. },
  179. "&:before": {
  180. display: "none",
  181. },
  182. "&:after": {
  183. display: "none",
  184. },
  185. [`&.Mui-disabled`]: {
  186. backgroundColor: "transparent",
  187. },
  188. [`&.Mui-focused`]: {
  189. backgroundColor: "transparent",
  190. borderColor: palette.primary.main,
  191. boxShadow: `${palette.primary.main} 0 0 0 2px`,
  192. },
  193. [`&.Mui-error`]: {
  194. borderColor: palette.error.main,
  195. boxShadow: `${palette.error.main} 0 0 0 2px`,
  196. },
  197. },
  198. input: {
  199. fontSize: 14,
  200. fontWeight: 500,
  201. lineHeight: "24px",
  202. },
  203. },
  204. },
  205. MuiOutlinedInput: {
  206. styleOverrides: {
  207. root: {
  208. "&:hover": {
  209. backgroundColor: palette.action.hover,
  210. [`& .MuiOutlinedInput-notchedOutline`]: {
  211. borderColor: palette.neutral[200],
  212. },
  213. },
  214. [`&.Mui-focused`]: {
  215. backgroundColor: "transparent",
  216. [`& .MuiOutlinedInput-notchedOutline`]: {
  217. borderColor: palette.primary.main,
  218. boxShadow: `${palette.primary.main} 0 0 0 2px`,
  219. },
  220. },
  221. [`&.Mui-error`]: {
  222. [`& .MuiOutlinedInput-notchedOutline`]: {
  223. borderColor: palette.error.main,
  224. boxShadow: `${palette.error.main} 0 0 0 2px`,
  225. },
  226. },
  227. },
  228. input: {
  229. fontSize: 14,
  230. fontWeight: 500,
  231. lineHeight: "24px",
  232. },
  233. notchedOutline: {
  234. borderColor: palette.neutral[200],
  235. transition: muiTheme.transitions.create(["border-color", "box-shadow"]),
  236. legend: { width: 0 },
  237. },
  238. },
  239. },
  240. MuiFormLabel: {
  241. styleOverrides: {
  242. root: {
  243. fontSize: 14,
  244. fontWeight: 500,
  245. [`&.MuiInputLabel-filled`]: {
  246. transform: "translate(12px, 18px) scale(1)",
  247. },
  248. [`&.MuiInputLabel-shrink`]: {
  249. [`&.MuiInputLabel-standard`]: {
  250. transform: "translate(0, -1.5px) scale(0.85)",
  251. },
  252. [`&.MuiInputLabel-filled`]: {
  253. transform: "translate(12px, 6px) scale(0.85)",
  254. },
  255. [`&.MuiInputLabel-outlined`]: {
  256. transform: "translate(14px, -9px) scale(0.85)",
  257. padding: "0 0.25rem",
  258. background: palette.primary.contrastText,
  259. },
  260. },
  261. },
  262. },
  263. },
  264. MuiTab: {
  265. styleOverrides: {
  266. root: {
  267. fontSize: 14,
  268. fontWeight: 500,
  269. lineHeight: 1.71,
  270. minWidth: "auto",
  271. paddingLeft: 0,
  272. paddingRight: 0,
  273. textTransform: "none",
  274. "& + &": {
  275. marginLeft: 24,
  276. },
  277. },
  278. },
  279. },
  280. MuiTableCell: {
  281. styleOverrides: {
  282. root: {
  283. borderBottomColor: palette.divider,
  284. padding: "15px 16px",
  285. },
  286. },
  287. },
  288. MuiTableHead: {
  289. styleOverrides: {
  290. root: {
  291. borderBottom: "none",
  292. [`& .MuiTableCell-root`]: {
  293. borderBottom: "none",
  294. backgroundColor: palette.neutral[50],
  295. color: palette.neutral[700],
  296. fontSize: 12,
  297. fontWeight: 600,
  298. lineHeight: 2,
  299. letterSpacing: 0.5,
  300. textTransform: "uppercase",
  301. },
  302. [`& .MuiTableCell-paddingCheckbox`]: {
  303. paddingTop: 4,
  304. paddingBottom: 4,
  305. },
  306. },
  307. },
  308. },
  309. MuiTextField: {
  310. defaultProps: {
  311. variant: "filled",
  312. },
  313. },
  314. MuiMenu: {
  315. styleOverrides: {
  316. list: {
  317. padding: 0,
  318. },
  319. },
  320. },
  321. MuiMenuItem: {
  322. styleOverrides: {
  323. root: {
  324. margin: "0.5rem",
  325. borderRadius: 8,
  326. },
  327. },
  328. },
  329. MuiList: {
  330. styleOverrides: {
  331. padding: {
  332. paddingBlock: "1rem",
  333. paddingInline: "1rem",
  334. },
  335. },
  336. },
  337. MuiListItem: {
  338. styleOverrides: {
  339. root: {
  340. ":hover": {
  341. backgroundColor: palette.neutral[100],
  342. },
  343. },
  344. },
  345. },
  346. MuiListItemButton: {
  347. styleOverrides: {
  348. root: {
  349. borderRadius: 8,
  350. marginBlockEnd: "0.5rem",
  351. },
  352. },
  353. },
  354. MuiListItemText: {
  355. styleOverrides: {
  356. root: {
  357. marginInlineEnd: "2rem",
  358. },
  359. primary: {
  360. fontWeight: 500,
  361. },
  362. },
  363. },
  364. MuiListItemIcon: {
  365. styleOverrides: {
  366. root: {
  367. color: "inherit",
  368. },
  369. },
  370. },
  371. MuiSelect: {
  372. styleOverrides: {
  373. select: {
  374. borderRadius: 8,
  375. },
  376. },
  377. },
  378. };
  379. export default components;