Proyectos de Subversion LeadersLinked - SPA

Rev

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