Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3719 | | Comparar con el anterior | Ultima modificación | Ver Log |

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