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