simon | 26e79f7 | 2022-10-05 22:16:08 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 Savoir-faire Linux Inc. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Affero General Public License as |
| 6 | * published by the Free Software Foundation; either version 3 of the |
| 7 | * License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU Affero General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Affero General Public |
| 15 | * License along with this program. If not, see |
| 16 | * <https://www.gnu.org/licenses/>. |
| 17 | */ |
Michelle Sepkap Sime | f5ebc2e | 2022-10-27 18:30:53 -0400 | [diff] [blame] | 18 | import { createTheme, SimplePaletteColorOptions } from '@mui/material'; |
| 19 | |
| 20 | declare module '@mui/material/styles' { |
| 21 | interface Theme { |
| 22 | InfoTooltip: { |
| 23 | backgroundColor: SimplePaletteColorOptions; |
| 24 | color: SimplePaletteColorOptions; |
| 25 | }; |
| 26 | } |
| 27 | |
| 28 | interface ThemeOptions { |
| 29 | InfoTooltip: { |
| 30 | backgroundColor: SimplePaletteColorOptions; |
| 31 | color: SimplePaletteColorOptions; |
| 32 | }; |
| 33 | } |
| 34 | } |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 35 | |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 36 | const theme = createTheme({ |
| 37 | palette: { |
| 38 | primary: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 39 | light: '#E5EEF5', // same as "#0056991A" |
| 40 | main: '#0071C9', |
| 41 | dark: '#005699', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 42 | }, |
| 43 | error: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 44 | main: '#CC0022', |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 45 | dark: '#720013', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 46 | }, |
| 47 | success: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 48 | main: '#009980', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 49 | }, |
Michelle Sepkap Sime | 51c0045 | 2022-10-31 21:26:38 -0400 | [diff] [blame] | 50 | secondary: { |
| 51 | main: '#A3C2DA', |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 52 | dark: '#06493F', |
Michelle Sepkap Sime | 51c0045 | 2022-10-31 21:26:38 -0400 | [diff] [blame] | 53 | }, |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 54 | }, |
Michelle Sepkap Sime | f5ebc2e | 2022-10-27 18:30:53 -0400 | [diff] [blame] | 55 | InfoTooltip: { |
| 56 | backgroundColor: { |
| 57 | main: '#FFFFFF', |
| 58 | }, |
| 59 | color: { |
| 60 | main: '#292929', |
| 61 | }, |
| 62 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 63 | typography: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 64 | fontFamily: 'Ubuntu', |
idillon | 24fe8d8 | 2022-08-29 16:55:20 -0400 | [diff] [blame] | 65 | allVariants: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 66 | color: 'black', |
idillon | 24fe8d8 | 2022-08-29 16:55:20 -0400 | [diff] [blame] | 67 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 68 | h1: { |
| 69 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 70 | fontSize: '26px', |
| 71 | lineHeight: '36px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 72 | }, |
| 73 | h2: { |
| 74 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 75 | fontSize: '22px', |
| 76 | lineHeight: '30px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 77 | }, |
| 78 | h3: { |
| 79 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 80 | fontSize: '18px', |
| 81 | lineHeight: '26px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 82 | }, |
| 83 | h4: { |
| 84 | fontWeight: 500, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 85 | fontSize: '15px', |
| 86 | lineHeight: '22px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 87 | }, |
| 88 | h5: { |
| 89 | fontWeight: 500, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 90 | fontSize: '13px', |
| 91 | lineHeight: '19px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 92 | }, |
| 93 | body1: { |
| 94 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 95 | fontSize: '15px', |
| 96 | lineHeight: '22px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 97 | }, |
| 98 | body2: { |
| 99 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 100 | fontSize: '13px', |
| 101 | lineHeight: '19px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 102 | }, |
| 103 | caption: { |
| 104 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 105 | fontSize: '12px', |
| 106 | lineHeight: '16px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 107 | }, |
| 108 | }, |
| 109 | components: { |
idillon | 760b7fb | 2022-08-29 14:32:38 -0400 | [diff] [blame] | 110 | MuiCssBaseline: { |
| 111 | styleOverrides: ` |
| 112 | @font-face { |
| 113 | font-family: "Ubuntu"; |
| 114 | src: url("./fonts/Ubuntu-Th.ttf"); |
| 115 | font-weight: 100; |
| 116 | font-style: normal; |
| 117 | } |
| 118 | @font-face { |
| 119 | font-family: "Ubuntu"; |
| 120 | src: url("./fonts/Ubuntu-L.ttf"); |
| 121 | font-weight: 300; |
| 122 | font-style: normal; |
| 123 | } |
| 124 | @font-face { |
| 125 | font-family: "Ubuntu"; |
| 126 | src: url("./fonts/Ubuntu-LI.ttf"); |
| 127 | font-weight: 300; |
| 128 | font-style: italic; |
| 129 | } |
| 130 | @font-face { |
| 131 | font-family: "Ubuntu"; |
| 132 | src: url("./fonts/Ubuntu-R.ttf"); |
| 133 | font-weight: 400; |
| 134 | font-style: normal; |
| 135 | } |
| 136 | @font-face { |
| 137 | font-family: "Ubuntu"; |
| 138 | src: url("./fonts/Ubuntu-RI.ttf"); |
| 139 | font-weight: 400; |
| 140 | font-style: italic; |
| 141 | } |
| 142 | @font-face { |
| 143 | font-family: "Ubuntu"; |
| 144 | src: url("./fonts/Ubuntu-M.ttf"); |
| 145 | font-weight: 500; |
| 146 | font-style: normal; |
| 147 | } |
| 148 | @font-face { |
| 149 | font-family: "Ubuntu"; |
| 150 | src: url("./fonts/Ubuntu-MI.ttf"); |
| 151 | font-weight: 500; |
| 152 | font-style: italic; |
| 153 | } |
| 154 | @font-face { |
| 155 | font-family: "Ubuntu"; |
| 156 | src: url("./fonts/Ubuntu-B.ttf"); |
| 157 | font-weight: 700; |
| 158 | font-style: normal; |
| 159 | } |
| 160 | @font-face { |
| 161 | font-family: "Ubuntu"; |
| 162 | src: url("./fonts/Ubuntu-BI.ttf"); |
| 163 | font-weight: 700; |
| 164 | font-style: italic; |
| 165 | } |
| 166 | `, |
| 167 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 168 | }, |
| 169 | }); |
idillon | 760b7fb | 2022-08-29 14:32:38 -0400 | [diff] [blame] | 170 | |
| 171 | export default createTheme(theme, { |
| 172 | components: { |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 173 | MuiButton: { |
| 174 | styleOverrides: { |
| 175 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 176 | height: '46px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 177 | fontWeight: 700, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 178 | fontSize: '15px', |
| 179 | lineHeight: '17px', |
| 180 | textTransform: 'none', |
| 181 | borderRadius: '5px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 182 | }, |
| 183 | sizeSmall: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 184 | height: '36px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 185 | }, |
| 186 | contained: { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 187 | background: theme.palette.primary.dark, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 188 | '&:hover': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 189 | background: theme.palette.primary.main, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 190 | }, |
| 191 | }, |
| 192 | outlined: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 193 | background: '#FFF', |
| 194 | borderColor: '#0056995C', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 195 | color: theme.palette.primary.dark, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 196 | '&:hover': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 197 | background: theme.palette.primary.light, |
| 198 | borderColor: theme.palette.primary.dark, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 199 | }, |
| 200 | }, |
| 201 | text: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 202 | background: '#fff', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 203 | color: theme.palette.primary.dark, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 204 | '&:hover': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 205 | background: theme.palette.primary.light, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 206 | }, |
| 207 | }, |
| 208 | }, |
| 209 | }, |
idillon | ef9ab81 | 2022-11-18 13:46:24 -0500 | [diff] [blame] | 210 | MuiDialog: { |
| 211 | styleOverrides: { |
| 212 | paper: { |
| 213 | padding: '16px', |
| 214 | boxShadow: '3px 3px 7px #00000029', |
| 215 | borderRadius: '20px', |
| 216 | }, |
| 217 | }, |
| 218 | }, |
| 219 | MuiDialogActions: { |
| 220 | styleOverrides: { |
| 221 | root: { |
| 222 | padding: '0px', |
| 223 | }, |
| 224 | }, |
| 225 | }, |
| 226 | MuiDialogContent: { |
| 227 | styleOverrides: { |
| 228 | root: { |
| 229 | padding: '0px', |
| 230 | margin: '16px 0px', |
| 231 | minWidth: '500px', |
| 232 | }, |
| 233 | }, |
| 234 | }, |
| 235 | MuiDialogTitle: { |
| 236 | styleOverrides: { |
| 237 | root: { |
| 238 | padding: '0px', |
| 239 | }, |
| 240 | }, |
| 241 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 242 | MuiSwitch: { |
| 243 | defaultProps: { |
| 244 | disableRipple: true, |
| 245 | }, |
| 246 | styleOverrides: { |
| 247 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 248 | width: '60px', |
| 249 | height: '30px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 250 | padding: 0, |
| 251 | }, |
| 252 | switchBase: { |
| 253 | padding: 0, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 254 | '&.Mui-checked': { |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 255 | transform: `translateX(30px)`, |
| 256 | }, |
| 257 | }, |
| 258 | thumb: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 259 | width: '28px', |
| 260 | height: '28px', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 261 | border: `1px solid ${theme.palette.primary.dark}`, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 262 | '.Mui-checked.Mui-checked &': { |
| 263 | width: '30px', |
| 264 | height: '30px', |
| 265 | border: 'none', |
| 266 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 267 | }, |
| 268 | track: { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 269 | backgroundColor: theme.palette.primary.light, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 270 | borderRadius: '30px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 271 | opacity: 1, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 272 | '.Mui-checked.Mui-checked + &': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 273 | backgroundColor: theme.palette.primary.light, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 274 | opacity: 1, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 275 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 276 | }, |
| 277 | colorPrimary: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 278 | color: '#fff', |
| 279 | '&.Mui-checked': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 280 | color: theme.palette.primary.dark, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 281 | }, |
| 282 | }, |
| 283 | }, |
| 284 | }, |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 285 | MuiInput: { |
| 286 | styleOverrides: { |
| 287 | root: { |
| 288 | color: theme.palette.primary.dark, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 289 | '&.Mui-error': { |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 290 | color: theme.palette.error.main, |
| 291 | }, |
| 292 | }, |
| 293 | underline: { |
| 294 | /* |
| 295 | Material UI uses "before" for the regular underline. |
| 296 | There is a second underline called "after" placed over "before" |
| 297 | */ |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 298 | '&:before': { |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 299 | borderBottom: `2px solid ${theme.palette.primary.dark}`, |
| 300 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 301 | '&:hover:not(.Mui-disabled, .Mui-error):before': { |
| 302 | borderBottom: '2px solid #03B9E9', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 303 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 304 | '&:after': { |
| 305 | borderBottom: '2px solid #03B9E9', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 306 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 307 | '&:hover:not(.Mui-error):after': { |
| 308 | borderBottom: '2px solid #03B9E9', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 309 | }, |
| 310 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 311 | }, |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 312 | }, |
| 313 | MuiFormControl: { |
| 314 | styleOverrides: { |
| 315 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 316 | height: '90px', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 317 | }, |
| 318 | }, |
| 319 | }, |
| 320 | MuiFormHelperText: { |
| 321 | styleOverrides: { |
| 322 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 323 | position: 'absolute', |
| 324 | bottom: '0px', |
| 325 | fontSize: '15px', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 326 | }, |
| 327 | }, |
| 328 | }, |
| 329 | MuiInputLabel: { |
| 330 | styleOverrides: { |
| 331 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 332 | color: 'black', |
| 333 | fontSize: '15px', |
| 334 | left: '50%', |
| 335 | transform: 'translate(-50%, 20px)', |
| 336 | transition: 'left .2s, transform .2s', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 337 | }, |
| 338 | shrink: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 339 | color: 'black', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 340 | left: 0, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 341 | transform: 'translate(0, 50px) scale(0.75)', |
| 342 | transition: 'left .2s, transform .2s', |
| 343 | '&.Mui-focused, &.Mui-error': { |
| 344 | color: 'black', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 345 | }, |
| 346 | }, |
| 347 | }, |
| 348 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 349 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 350 | }); |