Proyectos de Subversion LeadersLinked - SPA

Rev

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