Proyectos de Subversion LeadersLinked - SPA

Rev

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