Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3679 | Rev 3699 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3596 stevensc 1
import { createTheme } from '@mui/material';
2
 
3
import { accordionStyles } from './components/accordion';
4
import { globalStyles } from './components/global';
5
import { listStyles } from './components/list';
6
import {
7
  fontFamilyPrimary,
8
  heading1Styles,
9
  heading2Styles,
10
  heading3Styles,
11
  heading4Styles,
12
  overlineStyles,
13
  paragraphStyles,
14
  typographyStyles
15
} from './components/typography';
16
import { menuStyles } from './components/menu';
17
import { tabsStyles } from './components/tabs';
18
import { inputStyles } from './components/input';
19
 
20
import colors from './config/colors';
21
import { rootSelectStyles, selectSelectStyles } from './components/select';
22
 
23
export const defaultTheme = createTheme({
24
  typography: {
25
    htmlFontSize: 14,
26
    fontFamily: fontFamilyPrimary,
27
    h1: heading1Styles,
28
    h2: heading2Styles,
29
    h3: heading3Styles,
30
    h4: heading4Styles,
31
    body1: paragraphStyles,
32
    body2: paragraphStyles,
33
    overline: overlineStyles
34
  },
35
  shape: { borderRadius: 10 },
36
  shadows: { 1: 'rgba(0, 0, 0, 0.2) 1px 1px 1px -1px, rgba(0, 0, 0, 0.2) 1px 2px 4px' },
37
  spacing: 12,
38
  components: {
39
    MuiFormControl: {
40
      styleOverrides: {
41
        root: {
3697 stevensc 42
          '&:not(:last-child)': {
3596 stevensc 43
            marginBottom: '1rem'
44
          }
45
        }
46
      }
47
    },
48
    MuiCssBaseline: {
49
      styleOverrides: globalStyles
50
    },
51
 
52
    MuiButton: {
53
      styleOverrides: {
54
        root: ({ theme }) => ({
55
          display: 'flex',
56
          alignItems: 'center',
57
          justifyContent: 'center',
58
          gap: theme.spacing(0.5),
59
          padding: theme.spacing(0.33, 1),
60
          lineHeight: 1.25,
61
          borderWidth: 0,
62
          borderRadius: '30px',
63
          color: colors.font.primary,
64
          cursor: 'pointer',
65
          textAlign: 'center',
66
          textTransform: 'capitalize',
67
          '&:disabled': {
68
            cursor: 'no-drop',
69
            backgroundColor: '#dddddd',
70
            color: '#a3a1a1'
71
          },
72
          '&>svg': {
73
            color: 'currentColor',
74
            fontSize: '1.3rem'
75
          }
76
        }),
77
        containedPrimary: {
78
          backgroundColor: colors.button.background.primary,
79
          color: colors.button.text.primary,
80
          ':hover': {
81
            backgroundColor: colors.button.background.primary,
82
            opacity: 0.9
83
          }
84
        },
85
        containedSecondary: {
86
          backgroundColor: colors.button.background.secondary,
87
          color: colors.button.text.secondary,
88
          ':hover': {
89
            backgroundColor: colors.button.background.secondary,
90
            opacity: 0.9
91
          }
92
        },
93
        containedInfo: {
94
          backgroundColor: colors.button.background.tertiary,
95
          color: colors.button.text.tertiary,
96
          ':hover': {
97
            backgroundColor: colors.button.background.tertiary,
98
            opacity: 0.9
99
          }
100
        },
101
        containedInherit: {
102
          backgroundColor: 'transparent',
103
          color: 'rgba(0, 0, 0, 0.54)',
104
          ':hover': {
105
            backgroundColor: 'rgba(0, 0, 0, 0.04)'
106
          }
107
        }
108
      },
109
      defaultProps: { variant: 'contained', color: 'inherit' }
110
    },
111
    MuiDrawer: {
112
      styleOverrides: {
113
        paper: {
114
          backgroundColor: colors.main
115
        }
116
      }
117
    },
118
    MuiPaper: {
119
      styleOverrides: {
120
        root: ({ theme }) => ({
121
          boxShadow: theme.shadows[1],
122
          backgroundColor: colors.main
123
        })
124
      }
125
    },
126
    MuiAccordion: {
127
      styleOverrides: {
128
        root: accordionStyles
129
      }
130
    },
131
    MuiFormLabel: {
132
      styleOverrides: {
133
        root: {
134
          fontWeight: 'bold',
135
          color: colors.font.primary
136
        }
137
      }
138
    },
139
    MuiInputLabel: {
140
      styleOverrides: {
141
        root: {
142
          position: 'relative',
143
          top: 'auto',
144
          left: 'auto',
145
          transform: 'none'
146
        }
147
      }
148
    },
149
    MuiInputBase: {
150
      styleOverrides: {
151
        root: inputStyles,
152
        colorSecondary: {
153
          backgroundColor: colors.main
154
        }
155
      },
156
      variants: [
157
        {
158
          props: { variant: 'search' },
159
          style: { borderRadius: 20 }
160
        }
161
      ],
162
      defaultProps: {
163
        size: 'small'
164
      }
165
    },
166
    MuiSelect: {
167
      styleOverrides: {
168
        root: rootSelectStyles,
169
        select: selectSelectStyles
170
      }
171
    },
172
    MuiOutlinedInput: {
173
      styleOverrides: {
174
        notchedOutline: {
175
          display: 'none'
176
        }
177
      }
178
    },
179
    MuiTypography: {
180
      styleOverrides: {
181
        root: typographyStyles
182
      }
183
    },
184
    MuiList: {
185
      styleOverrides: {
186
        root: listStyles
187
      }
188
    },
189
    MuiMenu: {
190
      styleOverrides: {
191
        root: menuStyles
192
      }
193
    },
194
    MuiSvgIcon: {
195
      defaultProps: { fontSize: 'small' }
196
    },
197
    MuiAppBar: {
198
      styleOverrides: {
199
        root: {
200
          backgroundColor: colors.main,
201
          boxShadow: 1,
202
          zIndex: 50
203
        }
204
      }
205
    },
206
    MuiCard: {
207
      styleOverrides: {
208
        root: {
209
          boxShadow: 'none',
210
          position: 'relative',
211
          borderRadius: {
212
            xs: 0,
213
            sm: 10
214
          },
215
          backgroundColor: colors.main
216
        }
217
      }
218
    },
219
    MuiIconButton: {
220
      styleOverrides: {
221
        root: {
222
          color: colors.icon.primary
223
        }
224
      }
225
    },
226
    MuiLinearProgress: {
227
      styleOverrides: {
228
        root: {
229
          backgroundColor: colors.main,
230
          borderRadius: 10,
231
          flex: 1,
232
          '& .MuiLinearProgress-bar': {
233
            backgroundColor: colors.button.background.primary,
234
            borderRadius: 10
235
          }
236
        }
237
      }
238
    },
239
    MuiCardActions: {
240
      styleOverrides: {
241
        root: {
242
          padding: '0.5rem',
243
          justifyContent: 'space-around',
244
          gap: '0.5rem',
245
          '& > button': { flex: 1, flexWrap: 'wrap' },
246
          borderTop: `1px solid ${colors.border.primary}`
247
        }
248
      }
249
    },
250
    MuiCardHeader: {
251
      styleOverrides: {
252
        avatar: ({ theme }) => ({
253
          marginRight: theme.spacing(0.5)
254
        })
255
      }
256
    },
257
    MuiAvatarGroup: {
258
      styleOverrides: {
259
        root: {
260
          flexDirection: 'row',
261
          '& .MuiAvatar-root:last-child': {
262
            marginLeft: '-8px'
263
          }
264
        }
265
      }
266
    },
267
    MuiChip: {
268
      styleOverrides: {
269
        root: {
270
          backgroundColor: colors.button.background.primary
271
        },
272
        label: {
273
          color: colors.button.text.primary
274
        }
275
      }
276
    },
277
    MuiTabs: {
278
      styleOverrides: {
279
        root: tabsStyles
280
      }
281
    }
282
  }
283
});