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