@mui/docs 6.0.0-alpha.0 → 6.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +591 -6
  2. package/CodeCopy/CodeCopy.d.ts +20 -0
  3. package/CodeCopy/CodeCopy.js +172 -0
  4. package/CodeCopy/CodeCopyButton.d.ts +5 -0
  5. package/CodeCopy/CodeCopyButton.js +41 -0
  6. package/CodeCopy/index.d.ts +3 -0
  7. package/CodeCopy/index.js +3 -0
  8. package/CodeCopy/package.json +6 -0
  9. package/CodeCopy/useClipboardCopy.d.ts +4 -0
  10. package/CodeCopy/useClipboardCopy.js +21 -0
  11. package/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
  12. package/ComponentLinkHeader/ComponentLinkHeader.js +179 -0
  13. package/ComponentLinkHeader/index.d.ts +2 -0
  14. package/ComponentLinkHeader/index.js +2 -0
  15. package/ComponentLinkHeader/package.json +6 -0
  16. package/HighlightedCode/HighlightedCode.d.ts +14 -0
  17. package/HighlightedCode/HighlightedCode.js +68 -0
  18. package/HighlightedCode/index.d.ts +1 -0
  19. package/HighlightedCode/index.js +1 -0
  20. package/HighlightedCode/package.json +6 -0
  21. package/InfoCard/InfoCard.d.ts +20 -0
  22. package/InfoCard/InfoCard.js +87 -0
  23. package/InfoCard/index.d.ts +1 -0
  24. package/InfoCard/index.js +1 -0
  25. package/InfoCard/package.json +6 -0
  26. package/Link/Link.js +40 -38
  27. package/MarkdownElement/MarkdownElement.d.ts +6 -0
  28. package/MarkdownElement/MarkdownElement.js +825 -0
  29. package/MarkdownElement/index.d.ts +1 -0
  30. package/MarkdownElement/index.js +1 -0
  31. package/MarkdownElement/package.json +6 -0
  32. package/NProgressBar/NProgressBar.js +6 -7
  33. package/SectionTitle/SectionTitle.d.ts +7 -0
  34. package/SectionTitle/SectionTitle.js +30 -0
  35. package/SectionTitle/index.d.ts +1 -0
  36. package/SectionTitle/index.js +1 -0
  37. package/SectionTitle/package.json +6 -0
  38. package/branding/BrandingProvider.d.ts +9 -0
  39. package/branding/BrandingProvider.js +17 -0
  40. package/branding/brandingTheme.d.ts +152 -0
  41. package/branding/brandingTheme.js +1346 -0
  42. package/branding/index.d.ts +2 -0
  43. package/branding/index.js +2 -0
  44. package/branding/package.json +6 -0
  45. package/node/CodeCopy/CodeCopy.js +188 -0
  46. package/node/CodeCopy/CodeCopyButton.js +50 -0
  47. package/node/CodeCopy/index.js +40 -0
  48. package/node/CodeCopy/useClipboardCopy.js +30 -0
  49. package/node/ComponentLinkHeader/ComponentLinkHeader.js +189 -0
  50. package/node/ComponentLinkHeader/index.js +24 -0
  51. package/node/HighlightedCode/HighlightedCode.js +77 -0
  52. package/node/HighlightedCode/index.js +16 -0
  53. package/node/InfoCard/InfoCard.js +97 -0
  54. package/node/InfoCard/index.js +16 -0
  55. package/node/Link/Link.js +43 -40
  56. package/node/MarkdownElement/MarkdownElement.js +837 -0
  57. package/node/MarkdownElement/index.js +16 -0
  58. package/node/NProgressBar/NProgressBar.js +6 -7
  59. package/node/SectionTitle/SectionTitle.js +38 -0
  60. package/node/SectionTitle/index.js +16 -0
  61. package/node/branding/BrandingProvider.js +25 -0
  62. package/node/branding/brandingTheme.js +1357 -0
  63. package/node/branding/index.js +27 -0
  64. package/node/svgIcons/AdobeXDIcon.js +22 -0
  65. package/node/svgIcons/BundleSizeIcon.js +22 -0
  66. package/node/svgIcons/FigmaIcon.js +31 -0
  67. package/node/svgIcons/FileDownload.js +3 -3
  68. package/node/svgIcons/JavaScript.js +3 -3
  69. package/node/svgIcons/MaterialDesignIcon.js +27 -0
  70. package/node/svgIcons/SketchIcon.js +36 -0
  71. package/node/svgIcons/TypeScript.js +3 -3
  72. package/node/svgIcons/W3CIcon.js +24 -0
  73. package/node/translations/translations.json +216 -0
  74. package/package.json +11 -8
  75. package/svgIcons/AdobeXDIcon.d.ts +4 -0
  76. package/svgIcons/AdobeXDIcon.js +14 -0
  77. package/svgIcons/BundleSizeIcon.d.ts +4 -0
  78. package/svgIcons/BundleSizeIcon.js +14 -0
  79. package/svgIcons/FigmaIcon.d.ts +4 -0
  80. package/svgIcons/FigmaIcon.js +23 -0
  81. package/svgIcons/FileDownload.d.ts +7 -0
  82. package/svgIcons/FileDownload.js +3 -3
  83. package/svgIcons/JavaScript.d.ts +7 -0
  84. package/svgIcons/JavaScript.js +3 -3
  85. package/svgIcons/MaterialDesignIcon.d.ts +4 -0
  86. package/svgIcons/MaterialDesignIcon.js +19 -0
  87. package/svgIcons/SketchIcon.d.ts +4 -0
  88. package/svgIcons/SketchIcon.js +28 -0
  89. package/svgIcons/TypeScript.d.ts +7 -0
  90. package/svgIcons/TypeScript.js +3 -3
  91. package/svgIcons/W3CIcon.d.ts +4 -0
  92. package/svgIcons/W3CIcon.js +16 -0
  93. package/translations/translations.json +4 -2
  94. package/tsconfig.build.tsbuildinfo +1 -1
  95. package/legacy/DocsProvider/DocsProvider.js +0 -25
  96. package/legacy/DocsProvider/index.js +0 -1
  97. package/legacy/Link/Link.js +0 -101
  98. package/legacy/Link/index.js +0 -1
  99. package/legacy/NProgressBar/NProgressBar.js +0 -80
  100. package/legacy/NProgressBar/index.js +0 -1
  101. package/legacy/i18n/i18n.js +0 -105
  102. package/legacy/i18n/index.js +0 -1
  103. package/legacy/svgIcons/FileDownload.js +0 -14
  104. package/legacy/svgIcons/JavaScript.js +0 -14
  105. package/legacy/svgIcons/TypeScript.js +0 -14
  106. package/legacy/translations/index.js +0 -4
@@ -0,0 +1,1346 @@
1
+ import ArrowDropDownRounded from '@mui/icons-material/ArrowDropDownRounded';
2
+ import { createTheme, Theme, alpha } from '@mui/material/styles';
3
+ // TODO: enable this once types conflict is fixed
4
+ // declare module '@mui/material/Button' {
5
+ // interface ButtonPropsVariantOverrides {
6
+ // code: true;
7
+ // }
8
+ // }
9
+
10
+ const defaultTheme = createTheme();
11
+ export const blue = {
12
+ 50: 'hsl(210, 100%, 96%)',
13
+ 100: 'hsl(210, 100%, 90%)',
14
+ 200: 'hsl(210, 100%, 80%)',
15
+ 300: 'hsl(210, 100%, 70%)',
16
+ 400: 'hsl(210, 100%, 60%)',
17
+ main: 'hsl(210, 100%, 45%)',
18
+ 500: 'hsl(210, 100%, 45%)',
19
+ 600: 'hsl(210, 100%, 42%)',
20
+ 700: 'hsl(210, 100%, 38%)',
21
+ 800: 'hsl(210, 100%, 30%)',
22
+ 900: 'hsl(210, 100%, 23%)'
23
+ };
24
+ export const blueDark = {
25
+ 50: 'hsl(210, 14%, 92%)',
26
+ 100: 'hsl(210, 14%, 87%)',
27
+ 200: 'hsl(210, 14%, 72%)',
28
+ 300: 'hsl(210, 14%, 56%)',
29
+ main: 'hsl(210, 14%, 56%)',
30
+ 400: 'hsl(210, 14%, 36%)',
31
+ 500: 'hsl(210, 14%, 28%)',
32
+ 600: 'hsl(210, 14%, 22%)',
33
+ 700: 'hsl(210, 14%, 13%)',
34
+ 800: 'hsl(210, 14%, 9%)',
35
+ 900: 'hsl(210, 14%, 7%)'
36
+ };
37
+ export const grey = {
38
+ 50: 'hsl(215, 15%, 97%)',
39
+ 100: 'hsl(215, 15%, 92%)',
40
+ 200: 'hsl(215, 15%, 89%)',
41
+ 300: 'hsl(215, 15%, 82%)',
42
+ 400: 'hsl(215, 15%, 75%)',
43
+ 500: 'hsl(215, 15%, 65%)',
44
+ 600: 'hsl(215, 15%, 50%)',
45
+ 700: 'hsl(215, 15%, 40%)',
46
+ 800: 'hsl(215, 15%, 22%)',
47
+ 900: 'hsl(215, 15%, 12%)'
48
+ };
49
+ export const error = {
50
+ 50: 'hsl(355, 98%, 97%)',
51
+ 100: 'hsl(355, 98%, 93%)',
52
+ 200: 'hsl(355, 98%, 87%)',
53
+ 300: 'hsl(355, 98%, 80%)',
54
+ 400: 'hsl(355, 98%, 74%)',
55
+ 500: 'hsl(355, 98%, 66%)',
56
+ main: 'hsl(355, 98%, 66%)',
57
+ 600: 'hsl(355, 98%, 46%)',
58
+ 700: 'hsl(355, 98%, 39%)',
59
+ 800: 'hsl(355, 98%, 29%)',
60
+ 900: 'hsl(355, 98%, 17%)'
61
+ };
62
+ export const success = {
63
+ 50: 'hsl(144, 72%, 95%)',
64
+ 100: 'hsl(144, 72%, 87%)',
65
+ 200: 'hsl(144, 72%, 77%)',
66
+ 300: 'hsl(144, 72%, 66%)',
67
+ 400: 'hsl(144, 72%, 56%)',
68
+ 500: 'hsl(144, 72%, 46%)',
69
+ 600: 'hsl(144, 72%, 41%)',
70
+ 700: 'hsl(144, 72%, 37%)',
71
+ 800: 'hsl(144, 72%, 32%)',
72
+ 900: 'hsl(144, 72%, 21%)'
73
+ };
74
+ export const warning = {
75
+ 50: 'hsl(48, 100%, 96%)',
76
+ 100: 'hsl(48, 100%, 88%)',
77
+ 200: 'hsl(48, 100%, 82%)',
78
+ 300: 'hsl(48, 100%, 64%)',
79
+ 400: 'hsl(48, 100%, 48%)',
80
+ 500: 'hsl(48, 100%, 44%)',
81
+ main: 'hsl(48, 100%, 44%)',
82
+ 600: 'hsl(40, 100%, 40%)',
83
+ 700: 'hsl(36, 100%, 34%)',
84
+ 800: 'hsl(36, 100%, 27%)',
85
+ 900: 'hsl(36, 100%, 18%)'
86
+ };
87
+ const systemFont = ['-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'];
88
+ export const getMetaThemeColor = mode => {
89
+ const themeColor = {
90
+ light: blue[600],
91
+ dark: blueDark[900]
92
+ };
93
+ return themeColor[mode];
94
+ };
95
+ export const getDesignTokens = mode => ({
96
+ palette: {
97
+ primary: {
98
+ ...blue,
99
+ ...(mode === 'dark' && {
100
+ main: blue[400]
101
+ })
102
+ },
103
+ secondary: {
104
+ ...grey,
105
+ ...(mode === 'light' && {
106
+ main: blueDark[100],
107
+ contrastText: blueDark[600]
108
+ }),
109
+ ...(mode === 'dark' && {
110
+ main: blueDark[700],
111
+ contrastText: blueDark[600]
112
+ })
113
+ },
114
+ divider: mode === 'dark' ? alpha(blueDark[500], 0.3) : grey[100],
115
+ primaryDark: blueDark,
116
+ mode,
117
+ ...(mode === 'dark' && {
118
+ background: {
119
+ default: blueDark[900],
120
+ paper: alpha(blueDark[800], 0.8)
121
+ }
122
+ }),
123
+ common: {
124
+ black: 'hsl(200, 10%, 4%)'
125
+ },
126
+ text: {
127
+ ...(mode === 'light' && {
128
+ primary: grey[900],
129
+ secondary: grey[800],
130
+ tertiary: grey[700]
131
+ }),
132
+ ...(mode === 'dark' && {
133
+ primary: '#fff',
134
+ secondary: grey[400],
135
+ tertiary: grey[500]
136
+ })
137
+ },
138
+ grey: {
139
+ ...grey,
140
+ ...(mode === 'light' && {
141
+ main: grey[100],
142
+ contrastText: grey[600]
143
+ }),
144
+ ...(mode === 'dark' && {
145
+ main: grey[700],
146
+ contrastText: grey[600]
147
+ })
148
+ },
149
+ error,
150
+ success: {
151
+ ...success,
152
+ ...(mode === 'dark' && {
153
+ main: success[600]
154
+ }),
155
+ ...(mode === 'light' && {
156
+ main: success[700]
157
+ })
158
+ },
159
+ warning,
160
+ gradients: {
161
+ radioSubtle: mode === 'dark' ? `radial-gradient(100% 100% at 100% 100%, transparent 0, ${alpha(blue[900], 0.3)} 300%)` : `radial-gradient(100% 90% at 50% 0, transparent 0, ${alpha(blue[100], 0.3)} 300%)`,
162
+ linearSubtle: mode === 'dark' ? `linear-gradient(0deg, ${alpha(blue[900], 0.1)}, ${alpha(blueDark[900], 0.5)})` : `linear-gradient(0deg, ${alpha(blue[50], 0.4)}, ${alpha(grey[50], 0.1)})`
163
+ }
164
+ },
165
+ shape: {
166
+ borderRadius: 12
167
+ },
168
+ spacing: 8,
169
+ typography: {
170
+ fontFamily: ['"IBM Plex Sans"', ...systemFont].join(','),
171
+ // Match VS Code
172
+ // https://github.com/microsoft/vscode/blob/b38691f611d1ce3ef437c67a1b047c757b7b4e53/src/vs/editor/common/config/editorOptions.ts#L4578-L4580
173
+ // https://github.com/microsoft/vscode/blob/d950552131d7350a45dac8b59bf179469c36c2ac/src/vs/editor/standalone/browser/standalone-tokens.css#L10
174
+ fontFamilyCode: ['Menlo',
175
+ // macOS
176
+ 'Consolas',
177
+ // Windows
178
+ '"Droid Sans Mono"',
179
+ // Linux
180
+ 'monospace' // fallback
181
+ ].join(','),
182
+ fontFamilyTagline: ['"General Sans"', ...systemFont].join(','),
183
+ fontFamilySystem: systemFont.join(','),
184
+ fontWeightSemiBold: 600,
185
+ fontWeightExtraBold: 800,
186
+ h1: {
187
+ fontFamily: ['"General Sans"', ...systemFont].join(','),
188
+ fontSize: 'clamp(2.5rem, 1.125rem + 3.5vw, 3.5em)',
189
+ fontWeight: 600,
190
+ lineHeight: 78 / 70,
191
+ letterSpacing: -0.2,
192
+ ...(mode === 'light' && {
193
+ color: blueDark[900]
194
+ })
195
+ },
196
+ h2: {
197
+ fontFamily: ['"General Sans"', ...systemFont].join(','),
198
+ fontSize: 'clamp(1.5rem, 0.9643rem + 1.4286vw, 2.25rem)',
199
+ fontWeight: 600,
200
+ lineHeight: 44 / 36,
201
+ letterSpacing: -0.2,
202
+ color: mode === 'dark' ? grey[100] : blueDark[700]
203
+ },
204
+ h3: {
205
+ fontFamily: ['"General Sans"', ...systemFont].join(','),
206
+ fontSize: defaultTheme.typography.pxToRem(36),
207
+ lineHeight: 44 / 36,
208
+ letterSpacing: 0.2
209
+ },
210
+ h4: {
211
+ fontFamily: ['"General Sans"', ...systemFont].join(','),
212
+ fontSize: defaultTheme.typography.pxToRem(30),
213
+ lineHeight: 42 / 28,
214
+ letterSpacing: 0.2
215
+ },
216
+ h5: {
217
+ fontSize: defaultTheme.typography.pxToRem(24),
218
+ lineHeight: 36 / 24,
219
+ letterSpacing: 0.1,
220
+ color: mode === 'dark' ? blue[300] : blue.main
221
+ },
222
+ h6: {
223
+ fontSize: defaultTheme.typography.pxToRem(20),
224
+ lineHeight: 30 / 20
225
+ },
226
+ button: {
227
+ textTransform: 'initial',
228
+ fontWeight: 700,
229
+ letterSpacing: 0
230
+ },
231
+ subtitle1: {
232
+ fontSize: defaultTheme.typography.pxToRem(18),
233
+ lineHeight: 24 / 18,
234
+ letterSpacing: 0,
235
+ fontWeight: 500
236
+ },
237
+ body1: {
238
+ fontSize: defaultTheme.typography.pxToRem(16),
239
+ lineHeight: 24 / 16,
240
+ letterSpacing: 0
241
+ },
242
+ body2: {
243
+ fontSize: defaultTheme.typography.pxToRem(14),
244
+ lineHeight: 21 / 14,
245
+ letterSpacing: 0
246
+ },
247
+ caption: {
248
+ display: 'inline-block',
249
+ fontSize: defaultTheme.typography.pxToRem(12),
250
+ lineHeight: 18 / 12,
251
+ letterSpacing: 0,
252
+ fontWeight: 700
253
+ },
254
+ allVariants: {
255
+ scrollMarginTop: 'calc(var(--MuiDocs-header-height) + 32px)'
256
+ }
257
+ },
258
+ /**
259
+ * This utility exists to help transitioning to CSS variables page by page (prevent dark mode flicker).
260
+ * It will use the proper styling method based on the theme because the component might be on the page that does not support CSS variables yet.
261
+ *
262
+ * 😓 Without this utility:
263
+ * {
264
+ * ...theme.vars ? {
265
+ * color: theme.vars.palette.primary.main,
266
+ * [theme.getColorScheme('dark')]: {
267
+ * color: '#fff',
268
+ * }
269
+ * } : {
270
+ * color: theme.palette.mode === 'dark' ? '#fff' : theme.palette.primary.main,
271
+ * }
272
+ * }
273
+ *
274
+ * 🤩 Using the utility:
275
+ * {
276
+ * color: (theme.vars || theme).palette.primary.main,
277
+ * ...theme.applyDarkStyles({
278
+ * color: '#fff',
279
+ * }),
280
+ * }
281
+ *
282
+ * -------------------------------------------------------------------------------------------------
283
+ * 💡 This util should be used in an array if the styles contain pseudo classes or nested selectors:
284
+ *
285
+ * ❌ There is a chance that the upper selectors could be overridden
286
+ * {
287
+ * // the whole selector could be overridden
288
+ * '&::before': {
289
+ * color: ...
290
+ * },
291
+ * ...theme.applyDarkStyles({
292
+ * '&::before': {
293
+ * color: ...
294
+ * }
295
+ * })
296
+ * }
297
+ *
298
+ * ✅ use an array (supports in both emotion and styled-components)
299
+ * Only the `color` will be overridden in dark mode.
300
+ * [
301
+ * '&::before': {
302
+ * color: ...
303
+ * },
304
+ * theme.applyDarkStyles({
305
+ * '&::before': {
306
+ * color: ...
307
+ * }
308
+ * })
309
+ * ]
310
+ */
311
+ applyDarkStyles(css) {
312
+ return this.applyStyles('dark', css);
313
+ }
314
+ });
315
+ export function getThemedComponents() {
316
+ return {
317
+ components: {
318
+ MuiAlert: {
319
+ styleOverrides: {
320
+ root: {
321
+ padding: '16px',
322
+ gap: '12px',
323
+ fontSize: '1rem',
324
+ '& * ul': {
325
+ paddingLeft: '24px !important',
326
+ marginBottom: '0 !important'
327
+ },
328
+ // !important is used here to override the anchor tag color coming from MarkdownElement
329
+ '& .MuiAlert-icon': {
330
+ margin: 0,
331
+ marginTop: '2px',
332
+ padding: 0
333
+ },
334
+ '& .MuiAlert-message': {
335
+ padding: 0
336
+ }
337
+ },
338
+ icon: {
339
+ paddingTop: 10,
340
+ paddingBottom: 0
341
+ },
342
+ standardWarning: ({
343
+ theme
344
+ }) => [
345
+ // same styles from the MarkdownElement callout
346
+ {
347
+ backgroundColor: alpha(theme.palette.warning[50], 0.5),
348
+ color: (theme.vars || theme).palette.grey[900],
349
+ border: '1px solid',
350
+ borderColor: alpha(theme.palette.warning[700], 0.15),
351
+ '& .MuiAlert-icon': {
352
+ color: (theme.vars || theme).palette.warning[600]
353
+ },
354
+ '& * a': {
355
+ // !important is used here to override the anchor tag color coming from MarkdownElement
356
+ color: `${(theme.vars || theme).palette.warning[900]} !important`,
357
+ textDecorationColor: `${alpha(theme.palette.warning.main, 0.4)} !important`,
358
+ '&:hover': {
359
+ textDecorationColor: `${(theme.vars || theme).palette.warning[900]} !important`
360
+ }
361
+ }
362
+ }, theme.applyDarkStyles({
363
+ backgroundColor: alpha(theme.palette.warning[700], 0.12),
364
+ color: (theme.vars || theme).palette.warning[50],
365
+ '& .MuiAlert-icon': {
366
+ color: (theme.vars || theme).palette.warning[400]
367
+ },
368
+ '& * a': {
369
+ color: `${(theme.vars || theme).palette.warning[100]} !important`,
370
+ textDecorationColor: `${alpha(theme.palette.warning[600], 0.4)} !important`,
371
+ '&:hover': {
372
+ textDecorationColor: `${(theme.vars || theme).palette.warning[600]} !important`
373
+ }
374
+ }
375
+ })],
376
+ standardSuccess: ({
377
+ theme
378
+ }) => [
379
+ // same styles from the MarkdownElement callout
380
+ {
381
+ backgroundColor: alpha(theme.palette.success[50], 0.5),
382
+ color: (theme.vars || theme).palette.success[900],
383
+ border: `1px solid ${(theme.vars || theme).palette.success[100]}`,
384
+ '& .MuiAlert-icon': {
385
+ color: (theme.vars || theme).palette.success[600]
386
+ },
387
+ '& * a': {
388
+ // !important is used here to override the anchor tag color coming from MarkdownElement
389
+ color: `${(theme.vars || theme).palette.success[900]} !important`,
390
+ textDecorationColor: `${alpha(theme.palette.success.main, 0.4)} !important`,
391
+ '&:hover': {
392
+ textDecorationColor: `${(theme.vars || theme).palette.success[900]} !important`
393
+ }
394
+ }
395
+ }, theme.applyDarkStyles({
396
+ backgroundColor: alpha(theme.palette.success[700], 0.12),
397
+ color: (theme.vars || theme).palette.success[50],
398
+ borderColor: alpha(theme.palette.success[400], 0.1),
399
+ '& .MuiAlert-icon': {
400
+ color: (theme.vars || theme).palette.success[500]
401
+ },
402
+ '& * a': {
403
+ color: `${(theme.vars || theme).palette.success[100]} !important`,
404
+ textDecorationColor: `${alpha(theme.palette.success[600], 0.4)} !important`,
405
+ '&:hover': {
406
+ textDecorationColor: `${(theme.vars || theme).palette.success[600]} !important`
407
+ }
408
+ }
409
+ })]
410
+ }
411
+ },
412
+ MuiButtonBase: {
413
+ defaultProps: {
414
+ disableTouchRipple: true,
415
+ disableRipple: true
416
+ },
417
+ styleOverrides: {
418
+ root: ({
419
+ theme
420
+ }) => ({
421
+ transition: 'all 100ms ease-in',
422
+ '&:focus-visible': {
423
+ outline: `3px solid ${alpha(theme.palette.primary[500], 0.5)}`,
424
+ outlineOffset: '2px'
425
+ }
426
+ })
427
+ }
428
+ },
429
+ MuiButton: {
430
+ defaultProps: {
431
+ disableElevation: true
432
+ },
433
+ styleOverrides: {
434
+ root: ({
435
+ theme,
436
+ ownerState
437
+ }) => ({
438
+ transition: 'all 120ms ease-in',
439
+ ...(ownerState.size === 'large' && {
440
+ ...theme.typography.body1,
441
+ lineHeight: 21 / 16,
442
+ padding: theme.spacing('8px', '10px', '10px', '12px'),
443
+ fontWeight: theme.typography.fontWeightMedium,
444
+ borderRadius: 10,
445
+ '& > span': {
446
+ transition: '0.2s',
447
+ marginLeft: 4
448
+ },
449
+ '&:hover > span': {
450
+ transform: 'translateX(2px)'
451
+ }
452
+ }),
453
+ ...(ownerState.size === 'medium' && {
454
+ fontSize: defaultTheme.typography.pxToRem(15),
455
+ padding: theme.spacing('8px', '12px', '8px', '14px'),
456
+ fontWeight: theme.typography.fontWeightMedium,
457
+ borderRadius: 8,
458
+ '& > span': {
459
+ transition: '0.2s',
460
+ marginLeft: 4
461
+ },
462
+ '&:hover > span': {
463
+ transform: 'translateX(2px)'
464
+ }
465
+ }),
466
+ ...(ownerState.size === 'small' && {
467
+ padding: '6px 8px',
468
+ fontFamily: theme.typography.fontFamily,
469
+ fontSize: defaultTheme.typography.pxToRem(13),
470
+ fontWeight: theme.typography.fontWeightMedium,
471
+ borderRadius: 8,
472
+ '& .MuiButton-startIcon': {
473
+ transition: '0.15s',
474
+ marginRight: 4,
475
+ marginLeft: -1
476
+ },
477
+ '& .MuiButton-endIcon': {
478
+ transition: '0.15s',
479
+ marginLeft: 4
480
+ },
481
+ '&:hover': {
482
+ '& .MuiButton-startIcon': {
483
+ transform: 'translateX(-2px)'
484
+ },
485
+ '& .MuiButton-endIcon': {
486
+ transform: 'translateX(2px)'
487
+ }
488
+ }
489
+ }),
490
+ ...(ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
491
+ color: (theme.vars || theme).palette.text.primary,
492
+ backgroundColor: alpha(theme.palette.primaryDark[50], 0.1),
493
+ borderColor: (theme.vars || theme).palette.primaryDark[100],
494
+ boxShadow: `#FFF 0 1px 0 inset, ${alpha(theme.palette.grey[200], 0.4)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
495
+ '&:hover': {
496
+ backgroundColor: (theme.vars || theme).palette.grey[50]
497
+ },
498
+ ...theme.applyDarkStyles({
499
+ color: (theme.vars || theme).palette.primaryDark[100],
500
+ borderColor: alpha(theme.palette.primaryDark[600], 0.5),
501
+ backgroundColor: alpha(theme.palette.primaryDark[700], 0.2),
502
+ boxShadow: `${alpha(theme.palette.primaryDark[600], 0.3)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
503
+ '&:hover': {
504
+ backgroundColor: (theme.vars || theme).palette.primaryDark[700],
505
+ borderColor: (theme.vars || theme).palette.primaryDark[600]
506
+ }
507
+ })
508
+ }),
509
+ ...(ownerState.variant === 'outlined' && ownerState.color === 'primary' && {
510
+ color: (theme.vars || theme).palette.primary[600],
511
+ backgroundColor: alpha(theme.palette.primary[50], 0.2),
512
+ borderColor: (theme.vars || theme).palette.primary[100],
513
+ boxShadow: `${alpha(theme.palette.primary[50], 0.8)} 0 2px 0 inset, ${alpha(theme.palette.primary[100], 0.4)} 0 -2px 0 inset, ${alpha(theme.palette.primary[100], 0.5)} 0 1px 2px 0`,
514
+ '&:hover': {
515
+ backgroundColor: (theme.vars || theme).palette.primary[50],
516
+ borderColor: (theme.vars || theme).palette.primary[200]
517
+ },
518
+ ...theme.applyDarkStyles({
519
+ color: (theme.vars || theme).palette.primary[200],
520
+ borderColor: alpha(theme.palette.primary[900], 0.7),
521
+ backgroundColor: alpha(theme.palette.primary[900], 0.2),
522
+ boxShadow: `${alpha(theme.palette.primary[900], 0.2)} 0 2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
523
+ '&:hover': {
524
+ backgroundColor: (theme.vars || theme).palette.primary[900],
525
+ borderColor: (theme.vars || theme).palette.primary[700]
526
+ }
527
+ })
528
+ }),
529
+ ...(ownerState.variant === 'contained' && ownerState.color === 'primary' && {
530
+ color: '#fff',
531
+ textShadow: `0 1px 1px ${alpha(theme.palette.common.black, 0.6)}`,
532
+ backgroundColor: (theme.vars || theme).palette.primary[500],
533
+ backgroundImage: `linear-gradient(180deg, ${alpha(theme.palette.primary[500], 0.6)} 0%, ${theme.palette.primary[600]} 100%)`,
534
+ boxShadow: `${theme.palette.primary[400]} 0 2px 0 inset, ${theme.palette.primary[700]} 0 -2px 0 inset, ${alpha(theme.palette.common.black, 0.1)} 0 2px 4px 0`,
535
+ '&:hover': {
536
+ backgroundColor: (theme.vars || theme).palette.primary[700]
537
+ },
538
+ '&:active': {
539
+ backgroundColor: (theme.vars || theme).palette.primaryDark[700]
540
+ }
541
+ }),
542
+ ...(ownerState.variant === 'text' && ownerState.color === 'secondary' && {
543
+ color: (theme.vars || theme).palette.text.secondary,
544
+ '&:hover': {
545
+ backgroundColor: (theme.vars || theme).palette.grey[50]
546
+ },
547
+ '&:active': {
548
+ backgroundColor: (theme.vars || theme).palette.grey[200]
549
+ },
550
+ ...theme.applyDarkStyles({
551
+ '&:hover': {
552
+ backgroundColor: alpha(theme.palette.primaryDark[700], 0.5)
553
+ },
554
+ '&:active': {
555
+ backgroundColor: (theme.vars || theme).palette.primaryDark[700]
556
+ }
557
+ })
558
+ }),
559
+ ...(ownerState.variant === 'text' && ownerState.color === 'primary' && {
560
+ color: (theme.vars || theme).palette.primary[600],
561
+ ...theme.applyDarkStyles({
562
+ color: (theme.vars || theme).palette.primary[300]
563
+ })
564
+ })
565
+ })
566
+ },
567
+ variants: [{
568
+ // @ts-ignore internal repo module augmentation issue
569
+ props: {
570
+ variant: 'code'
571
+ },
572
+ style: ({
573
+ theme
574
+ }) => [{
575
+ cursor: 'copy',
576
+ padding: 0,
577
+ width: 'max-content',
578
+ backgroundColor: 'transparent',
579
+ color: (theme.vars || theme).palette.grey[600],
580
+ fontFamily: theme.typography.fontFamilyCode,
581
+ fontWeight: 400,
582
+ fontSize: defaultTheme.typography.pxToRem(12),
583
+ lineHeight: 21 / 14,
584
+ letterSpacing: 0,
585
+ WebkitFontSmoothing: 'subpixel-antialiased',
586
+ '& .MuiButton-startIcon': {
587
+ color: (theme.vars || theme).palette.grey[400]
588
+ },
589
+ '& .MuiButton-endIcon': {
590
+ display: 'inline-block',
591
+ position: 'absolute',
592
+ color: (theme.vars || theme).palette.primary.main,
593
+ right: -22,
594
+ top: -1,
595
+ opacity: 0,
596
+ transitionProperty: 'opacity',
597
+ transitionDuration: '100ms',
598
+ transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)'
599
+ },
600
+ '&:hover, &.Mui-focusVisible': {
601
+ backgroundColor: 'transparent',
602
+ color: (theme.vars || theme).palette.primary.main,
603
+ '& .MuiButton-endIcon': {
604
+ color: (theme.vars || theme).palette.primary.main,
605
+ opacity: 1
606
+ }
607
+ }
608
+ }, theme.applyDarkStyles({
609
+ '& .MuiButton-endIcon': {
610
+ color: (theme.vars || theme).palette.primary[300]
611
+ },
612
+ '&:hover, &.Mui-focusVisible': {
613
+ color: (theme.vars || theme).palette.primary[300],
614
+ '& .MuiButton-endIcon': {
615
+ opacity: 1
616
+ }
617
+ }
618
+ })]
619
+ }, {
620
+ // @ts-ignore internal repo module augmentation issue
621
+ props: {
622
+ variant: 'codeOutlined'
623
+ },
624
+ style: ({
625
+ theme
626
+ }) => [{
627
+ display: 'inline-block',
628
+ justifyContent: 'start',
629
+ overflowX: 'hidden',
630
+ whiteSpace: 'nowrap',
631
+ textOverflow: 'ellipsis',
632
+ position: 'relative',
633
+ border: '1px solid',
634
+ color: (theme.vars || theme).palette.grey[900],
635
+ backgroundColor: alpha(theme.palette.primary[50], 0.3),
636
+ borderColor: (theme.vars || theme).palette.grey[200],
637
+ boxShadow: `0px 2px 2px ${alpha(theme.palette.primary[100], 0.2)}, inset 0px 4px 4px ${alpha(theme.palette.primary[100], 0.2)}`,
638
+ fontFamily: theme.typography.fontFamilyCode,
639
+ fontWeight: 400,
640
+ fontSize: defaultTheme.typography.pxToRem(12),
641
+ lineHeight: 21 / 14,
642
+ letterSpacing: 0,
643
+ WebkitFontSmoothing: 'subpixel-antialiased',
644
+ '& .MuiButton-endIcon': {
645
+ display: 'inline-block',
646
+ position: 'absolute',
647
+ top: 12,
648
+ right: 0,
649
+ marginRight: 10,
650
+ color: (theme.vars || theme).palette.grey[600]
651
+ },
652
+ '&:hover, &.Mui-focusVisible': {
653
+ borderColor: (theme.vars || theme).palette.primary.main,
654
+ backgroundColor: (theme.vars || theme).palette.primary[50],
655
+ color: (theme.vars || theme).palette.primary[600],
656
+ '& .MuiButton-endIcon': {
657
+ color: (theme.vars || theme).palette.primary.main
658
+ }
659
+ }
660
+ }, theme.applyDarkStyles({
661
+ color: (theme.vars || theme).palette.grey[500],
662
+ borderColor: (theme.vars || theme).palette.primaryDark[600],
663
+ backgroundColor: (theme.vars || theme).palette.primaryDark[700],
664
+ boxShadow: '0px 2px 2px #0B0D0E, inset 0px 4px 4px rgba(20, 25, 31, 0.3)',
665
+ '& .MuiButton-endIcon': {
666
+ color: (theme.vars || theme).palette.grey[400]
667
+ },
668
+ '&:hover, &.Mui-focusVisible': {
669
+ backgroundColor: (theme.vars || theme).palette.primary[900],
670
+ color: (theme.vars || theme).palette.primary[100],
671
+ '& .MuiButton-endIcon': {
672
+ color: (theme.vars || theme).palette.primary[300]
673
+ }
674
+ }
675
+ })]
676
+ }, {
677
+ // @ts-ignore internal repo module augmentation issue
678
+ props: {
679
+ variant: 'link'
680
+ },
681
+ style: ({
682
+ theme
683
+ }) => ({
684
+ marginBottom: 1,
685
+ fontSize: theme.typography.pxToRem(14),
686
+ fontWeight: theme.typography.fontWeightBold,
687
+ color: (theme.vars || theme).palette.primary[600],
688
+ '&:hover': {
689
+ backgroundColor: (theme.vars || theme).palette.primary[50]
690
+ },
691
+ ...theme.applyDarkStyles({
692
+ color: (theme.vars || theme).palette.primary[300],
693
+ '&:hover': {
694
+ backgroundColor: alpha(theme.palette.primary[800], 0.3)
695
+ }
696
+ })
697
+ })
698
+ }]
699
+ },
700
+ MuiIconButton: {
701
+ styleOverrides: {
702
+ root: ({
703
+ theme,
704
+ ownerState
705
+ }) => ({
706
+ borderRadius: theme.shape.borderRadius,
707
+ transition: 'all 100ms ease-in',
708
+ '&:hover': {
709
+ borderColor: (theme.vars || theme).palette.grey[300],
710
+ background: (theme.vars || theme).palette.grey[50],
711
+ ...theme.applyDarkStyles({
712
+ borderColor: (theme.vars || theme).palette.primaryDark[600],
713
+ background: alpha(theme.palette.primaryDark[700], 0.8)
714
+ })
715
+ },
716
+ ...(ownerState.size === 'small' && {
717
+ height: 32,
718
+ width: 32,
719
+ '& .MuiSvgIcon-root': {
720
+ fontSize: defaultTheme.typography.pxToRem(18)
721
+ }
722
+ })
723
+ })
724
+ },
725
+ variants: [{
726
+ props: {
727
+ color: 'primary'
728
+ },
729
+ style: ({
730
+ theme
731
+ }) => [{
732
+ color: (theme.vars || theme).palette.primary.main,
733
+ backgroundColor: alpha(theme.palette.primaryDark[50], 0.1),
734
+ border: `1px solid ${(theme.vars || theme).palette.primaryDark[100]}`,
735
+ boxShadow: `#FFF 0 1px 0 inset, ${alpha(theme.palette.grey[200], 0.4)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
736
+ '&:hover': {
737
+ borderColor: (theme.vars || theme).palette.grey[300],
738
+ background: (theme.vars || theme).palette.grey[50]
739
+ }
740
+ }, theme.applyDarkStyles({
741
+ color: (theme.vars || theme).palette.primary[300],
742
+ borderColor: alpha(theme.palette.primaryDark[600], 0.5),
743
+ backgroundColor: alpha(theme.palette.primaryDark[700], 0.2),
744
+ boxShadow: `${alpha(theme.palette.primaryDark[600], 0.3)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
745
+ '&:hover': {
746
+ borderColor: (theme.vars || theme).palette.primaryDark[600],
747
+ background: alpha(theme.palette.primaryDark[700], 0.8)
748
+ }
749
+ })]
750
+ }, {
751
+ props: {
752
+ color: 'info'
753
+ },
754
+ style: ({
755
+ theme
756
+ }) => [{
757
+ color: (theme.vars || theme).palette.text.secondary,
758
+ backgroundColor: alpha(theme.palette.primaryDark[50], 0.1),
759
+ border: `1px solid ${(theme.vars || theme).palette.primaryDark[100]}`,
760
+ boxShadow: `#FFF 0 1px 0 inset, ${alpha(theme.palette.grey[200], 0.4)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
761
+ '&:hover': {
762
+ color: (theme.vars || theme).palette.text.primary,
763
+ borderColor: (theme.vars || theme).palette.grey[300],
764
+ background: (theme.vars || theme).palette.grey[50]
765
+ }
766
+ }, theme.applyDarkStyles({
767
+ borderColor: alpha(theme.palette.primaryDark[600], 0.5),
768
+ backgroundColor: alpha(theme.palette.primaryDark[700], 0.2),
769
+ boxShadow: `${alpha(theme.palette.primaryDark[600], 0.3)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
770
+ '&:hover': {
771
+ borderColor: (theme.vars || theme).palette.primaryDark[600],
772
+ background: alpha(theme.palette.primaryDark[700], 0.8)
773
+ }
774
+ })]
775
+ }]
776
+ },
777
+ MuiMenu: {
778
+ styleOverrides: {
779
+ paper: ({
780
+ theme
781
+ }) => [{
782
+ padding: '6px',
783
+ minWidth: 160,
784
+ color: (theme.vars || theme).palette.text.secondary,
785
+ backgroundImage: 'none',
786
+ border: '1px solid',
787
+ backgroundColor: (theme.vars || theme).palette.background.paper,
788
+ borderColor: (theme.vars || theme).palette.grey[200],
789
+ '& .MuiMenu-list': {
790
+ display: 'flex',
791
+ flexDirection: 'column',
792
+ gap: '2px',
793
+ '& .MuiDivider-root': {
794
+ margin: '4px -8px 4px -8px'
795
+ }
796
+ },
797
+ '& .MuiMenuItem-root': {
798
+ padding: '6px 8px',
799
+ borderRadius: '6px',
800
+ fontSize: theme.typography.pxToRem(14),
801
+ fontWeight: theme.typography.fontWeightMedium,
802
+ '&:hover': {
803
+ backgroundColor: (theme.vars || theme).palette.grey[100],
804
+ color: (theme.vars || theme).palette.text.primary
805
+ },
806
+ '&:focus-visible': {
807
+ outline: 'none'
808
+ },
809
+ '&.Mui-selected': {
810
+ fontWeight: 500,
811
+ color: (theme.vars || theme).palette.primary[600],
812
+ backgroundColor: alpha(theme.palette.primary[100], 0.6)
813
+ }
814
+ }
815
+ }, theme.applyDarkStyles({
816
+ backgroundColor: (theme.vars || theme).palette.primaryDark[900],
817
+ borderColor: (theme.vars || theme).palette.primaryDark[700],
818
+ '& .MuiMenuItem-root': {
819
+ '&:hover': {
820
+ backgroundColor: (theme.vars || theme).palette.primaryDark[700]
821
+ },
822
+ '&.Mui-selected': {
823
+ color: (theme.vars || theme).palette.primary[200],
824
+ backgroundColor: alpha(theme.palette.primary[900], 0.4)
825
+ }
826
+ }
827
+ })]
828
+ }
829
+ },
830
+ MuiPopover: {
831
+ styleOverrides: {
832
+ paper: ({
833
+ theme
834
+ }) => ({
835
+ boxShadow: '0px 4px 20px rgba(170, 180, 190, 0.3)',
836
+ ...theme.applyDarkStyles({
837
+ boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.5)'
838
+ })
839
+ })
840
+ }
841
+ },
842
+ MuiDivider: {
843
+ styleOverrides: {
844
+ root: ({
845
+ theme
846
+ }) => ({
847
+ borderColor: (theme.vars || theme).palette.divider
848
+ })
849
+ }
850
+ },
851
+ MuiLink: {
852
+ defaultProps: {
853
+ underline: 'none'
854
+ },
855
+ styleOverrides: {
856
+ root: ({
857
+ theme
858
+ }) => ({
859
+ display: 'inline-flex',
860
+ alignItems: 'center',
861
+ fontWeight: theme.typography.fontWeightSemiBold,
862
+ '&.MuiTypography-body1 > svg': {
863
+ marginTop: 2
864
+ },
865
+ '& svg:last-child': {
866
+ marginLeft: 2
867
+ },
868
+ '&:focus-visible': {
869
+ outline: `3px solid ${alpha(theme.palette.primary[500], 0.5)}`,
870
+ outlineOffset: '2px'
871
+ }
872
+ })
873
+ },
874
+ variants: [{
875
+ props: {
876
+ color: 'primary'
877
+ },
878
+ style: ({
879
+ theme
880
+ }) => [{
881
+ color: (theme.vars || theme).palette.primary[600],
882
+ '&:hover': {
883
+ color: (theme.vars || theme).palette.primary[700]
884
+ }
885
+ }, theme.applyDarkStyles({
886
+ color: (theme.vars || theme).palette.primary[300],
887
+ '&:hover': {
888
+ color: (theme.vars || theme).palette.primary[200]
889
+ }
890
+ })]
891
+ }]
892
+ },
893
+ MuiChip: {
894
+ styleOverrides: {
895
+ root: ({
896
+ ownerState: {
897
+ color,
898
+ variant
899
+ },
900
+ theme
901
+ }) => ({
902
+ fontWeight: theme.typography.fontWeightSemiBold,
903
+ paddingBottom: 0.2,
904
+ ...(variant === 'outlined' && color === 'default' && {
905
+ backgroundColor: alpha(theme.palette.grey[50], 0.5),
906
+ color: (theme.vars || theme).palette.grey[900],
907
+ borderColor: (theme.vars || theme).palette.grey[200],
908
+ '&:hover': {
909
+ backgroundColor: (theme.vars || theme).palette.grey[100],
910
+ color: (theme.vars || theme).palette.grey[900]
911
+ },
912
+ ...theme.applyDarkStyles({
913
+ backgroundColor: alpha(theme.palette.primaryDark[700], 0.4),
914
+ color: (theme.vars || theme).palette.grey[300],
915
+ borderColor: alpha(theme.palette.primaryDark[500], 0.5),
916
+ '&:hover': {
917
+ color: (theme.vars || theme).palette.grey[300],
918
+ backgroundColor: (theme.vars || theme).palette.primaryDark[700]
919
+ }
920
+ })
921
+ }),
922
+ ...(variant === 'outlined' && color === 'info' && {
923
+ backgroundColor: alpha(theme.palette.grey[50], 0.5),
924
+ color: (theme.vars || theme).palette.grey[900],
925
+ borderColor: (theme.vars || theme).palette.grey[200],
926
+ ...theme.applyDarkStyles({
927
+ color: (theme.vars || theme).palette.grey[300],
928
+ backgroundColor: alpha(theme.palette.primaryDark[700], 0.5),
929
+ borderColor: (theme.vars || theme).palette.primaryDark[600]
930
+ })
931
+ }),
932
+ ...(variant === 'outlined' && color === 'primary' && {
933
+ borderColor: (theme.vars || theme).palette.primary[100],
934
+ backgroundColor: alpha(theme.palette.primary[100], 0.2),
935
+ ...theme.applyDarkStyles({
936
+ color: (theme.vars || theme).palette.primary[300],
937
+ borderColor: alpha(theme.palette.primary[500], 0.2),
938
+ backgroundColor: alpha(theme.palette.primary[700], 0.2)
939
+ })
940
+ }),
941
+ ...(variant === 'outlined' && color === 'success' && {
942
+ borderColor: (theme.vars || theme).palette.success[100],
943
+ backgroundColor: (theme.vars || theme).palette.success[50],
944
+ color: (theme.vars || theme).palette.success[900],
945
+ ...theme.applyDarkStyles({
946
+ color: (theme.vars || theme).palette.success[300],
947
+ borderColor: alpha(theme.palette.success[300], 0.2),
948
+ background: alpha(theme.palette.success[800], 0.2)
949
+ })
950
+ }),
951
+ ...(variant === 'filled' && {
952
+ ...(color === 'default' && {
953
+ border: '1px solid transparent',
954
+ color: (theme.vars || theme).palette.primary[700],
955
+ backgroundColor: alpha(theme.palette.primary[100], 0.5),
956
+ '&:hover': {
957
+ backgroundColor: (theme.vars || theme).palette.primary[100]
958
+ },
959
+ ...theme.applyDarkStyles({
960
+ color: '#fff',
961
+ backgroundColor: alpha(theme.palette.primaryDark[500], 0.8),
962
+ '&:hover': {
963
+ backgroundColor: (theme.vars || theme).palette.primaryDark[600]
964
+ }
965
+ })
966
+ }),
967
+ ...(color === 'primary' && {
968
+ color: (theme.vars || theme).palette.primary[600],
969
+ backgroundColor: alpha(theme.palette.primary[100], 0.4),
970
+ '&:hover': {
971
+ backgroundColor: (theme.vars || theme).palette.primary[100]
972
+ },
973
+ '& .MuiChip-deleteIcon': {
974
+ color: (theme.vars || theme).palette.primary[600],
975
+ '&:hover': {
976
+ color: (theme.vars || theme).palette.primary[700]
977
+ }
978
+ },
979
+ '&.Mui-focusVisible': {
980
+ backgroundColor: (theme.vars || theme).palette.primary[200]
981
+ },
982
+ ...theme.applyDarkStyles({
983
+ color: (theme.vars || theme).palette.primary[100],
984
+ backgroundColor: alpha(theme.palette.primary[800], 0.5),
985
+ '&:hover': {
986
+ backgroundColor: alpha(theme.palette.primary[900], 0.5)
987
+ },
988
+ '& .MuiChip-deleteIcon': {
989
+ color: (theme.vars || theme).palette.primary[100],
990
+ '&:hover': {
991
+ color: (theme.vars || theme).palette.primary[50]
992
+ }
993
+ }
994
+ })
995
+ })
996
+ }),
997
+ // for labelling product in the search
998
+ // @ts-ignore internal repo module augmentation issue
999
+ ...(variant === 'light' && {
1000
+ ...(color === 'default' && {
1001
+ color: (theme.vars || theme).palette.primary[700],
1002
+ backgroundColor: alpha(theme.palette.primary[100], 0.3),
1003
+ ...theme.applyDarkStyles({
1004
+ color: (theme.vars || theme).palette.primary[200],
1005
+ backgroundColor: alpha(theme.palette.primaryDark[700], 0.5)
1006
+ })
1007
+ }),
1008
+ ...(color === 'warning' && {
1009
+ color: (theme.vars || theme).palette.warning[900],
1010
+ backgroundColor: (theme.vars || theme).palette.warning[100],
1011
+ ...theme.applyDarkStyles({
1012
+ color: '#fff',
1013
+ backgroundColor: (theme.vars || theme).palette.warning[900]
1014
+ })
1015
+ }),
1016
+ ...(color === 'success' && {
1017
+ color: (theme.vars || theme).palette.success[900],
1018
+ backgroundColor: (theme.vars || theme).palette.success[100],
1019
+ ...theme.applyDarkStyles({
1020
+ color: '#fff',
1021
+ backgroundColor: (theme.vars || theme).palette.success[900]
1022
+ })
1023
+ })
1024
+ })
1025
+ })
1026
+ }
1027
+ },
1028
+ MuiList: {
1029
+ styleOverrides: {
1030
+ root: {
1031
+ padding: 0
1032
+ }
1033
+ }
1034
+ },
1035
+ MuiListItemButton: {
1036
+ styleOverrides: {
1037
+ root: ({
1038
+ theme
1039
+ }) => [{
1040
+ padding: '8px',
1041
+ textTransform: 'none',
1042
+ fontWeight: 500,
1043
+ fontSize: theme.typography.pxToRem(14),
1044
+ color: theme.palette.grey[700],
1045
+ borderRadius: 0,
1046
+ '&:hover': {
1047
+ backgroundColor: theme.palette.grey[50]
1048
+ },
1049
+ '&.Mui-selected': {
1050
+ borderRadius: 10,
1051
+ border: '1px solid',
1052
+ color: (theme.vars || theme).palette.primary[500],
1053
+ borderColor: `${(theme.vars || theme).palette.primary[500]} !important`,
1054
+ backgroundColor: (theme.vars || theme).palette.primary[50],
1055
+ '&:hover': {
1056
+ backgroundColor: (theme.vars || theme).palette.primary[100]
1057
+ }
1058
+ }
1059
+ }, theme.applyDarkStyles({
1060
+ color: theme.palette.grey[300],
1061
+ '&:hover': {
1062
+ backgroundColor: alpha(theme.palette.primaryDark[700], 0.4)
1063
+ },
1064
+ '&.Mui-selected': {
1065
+ color: '#fff',
1066
+ borderColor: `${(theme.vars || theme).palette.primary[700]} !important`,
1067
+ backgroundColor: (theme.vars || theme).palette.primaryDark[700],
1068
+ '&:hover': {
1069
+ backgroundColor: (theme.vars || theme).palette.primaryDark[600]
1070
+ }
1071
+ }
1072
+ })]
1073
+ }
1074
+ },
1075
+ MuiSelect: {
1076
+ defaultProps: {
1077
+ IconComponent: ArrowDropDownRounded
1078
+ },
1079
+ styleOverrides: {
1080
+ iconFilled: {
1081
+ top: 'calc(50% - .25em)'
1082
+ }
1083
+ }
1084
+ },
1085
+ MuiTab: {
1086
+ defaultProps: {
1087
+ disableTouchRipple: true
1088
+ }
1089
+ },
1090
+ MuiPaper: {
1091
+ styleOverrides: {
1092
+ root: ({
1093
+ theme,
1094
+ ownerState
1095
+ }) => [{
1096
+ backgroundImage: 'none',
1097
+ backgroundColor: '#fff',
1098
+ '&[href]': {
1099
+ textDecorationLine: 'none'
1100
+ },
1101
+ transition: theme.transitions.create(['border', 'box-shadow'], {
1102
+ duration: theme.transitions.duration.shortest
1103
+ }),
1104
+ ...(ownerState.variant === 'outlined' && {
1105
+ display: 'block',
1106
+ borderColor: (theme.vars || theme).palette.grey[100],
1107
+ '&[href]': {
1108
+ textDecorationLine: 'none',
1109
+ boxShadow: `hsl(200, 0%, 100%) 0 2px 0 inset, ${alpha(theme.palette.grey[100], 0.3)} 0 -2px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
1110
+ '&:hover': {
1111
+ borderColor: (theme.vars || theme).palette.primary[200],
1112
+ boxShadow: `0px 2px 8px ${(theme.vars || theme).palette.primary[100]}`
1113
+ },
1114
+ '&:focus-visible': {
1115
+ outline: `3px solid ${alpha(theme.palette.primary[500], 0.5)}`,
1116
+ outlineOffset: '2px'
1117
+ }
1118
+ },
1119
+ ':is(a&), :is(button&)': {
1120
+ '&:hover': {
1121
+ borderColor: (theme.vars || theme).palette.primary[200],
1122
+ boxShadow: `0px 4px 16px ${(theme.vars || theme).palette.grey[200]}`
1123
+ }
1124
+ }
1125
+ })
1126
+ }, theme.applyDarkStyles({
1127
+ backgroundColor: (theme.vars || theme).palette.primaryDark[900],
1128
+ ...(ownerState.variant === 'outlined' && {
1129
+ borderColor: (theme.vars || theme).palette.primaryDark[700],
1130
+ backgroundColor: alpha(theme.palette.primaryDark[800], 0.6),
1131
+ '&[href]': {
1132
+ textDecorationLine: 'none',
1133
+ boxShadow: `${alpha(theme.palette.primaryDark[700], 0.4)} 0 2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -2px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
1134
+ '&:hover': {
1135
+ borderColor: alpha(theme.palette.primary[600], 0.5),
1136
+ boxShadow: `0px 2px 8px ${alpha(theme.palette.primary[900], 0.6)}`
1137
+ }
1138
+ },
1139
+ ':is(a&), :is(button&)': {
1140
+ '&:hover': {
1141
+ boxShadow: `0px 4px 24px ${(theme.vars || theme).palette.common.black}`
1142
+ }
1143
+ }
1144
+ })
1145
+ })]
1146
+ }
1147
+ },
1148
+ MuiTableCell: {
1149
+ styleOverrides: {
1150
+ root: ({
1151
+ theme,
1152
+ ownerState
1153
+ }) => ({
1154
+ padding: theme.spacing(1, 2),
1155
+ borderColor: (theme.vars || theme).palette.divider,
1156
+ ...(ownerState.variant === 'head' && {
1157
+ color: (theme.vars || theme).palette.text.primary,
1158
+ fontWeight: 700
1159
+ }),
1160
+ ...(ownerState.variant === 'body' && {
1161
+ color: (theme.vars || theme).palette.text.secondary
1162
+ })
1163
+ })
1164
+ }
1165
+ },
1166
+ MuiToggleButtonGroup: {
1167
+ styleOverrides: {
1168
+ root: ({
1169
+ theme
1170
+ }) => ({
1171
+ backgroundColor: '#fff',
1172
+ ...theme.applyDarkStyles({
1173
+ backgroundColor: (theme.vars || theme).palette.primaryDark[900]
1174
+ })
1175
+ })
1176
+ }
1177
+ },
1178
+ MuiToggleButton: {
1179
+ styleOverrides: {
1180
+ root: ({
1181
+ theme,
1182
+ ownerState
1183
+ }) => [{
1184
+ textTransform: 'none',
1185
+ fontWeight: theme.typography.fontWeightMedium,
1186
+ color: theme.palette.text.secondary,
1187
+ borderColor: theme.palette.grey[200],
1188
+ ...(ownerState.size === 'small' && {
1189
+ padding: '0.375rem 0.75rem'
1190
+ }),
1191
+ '&.Mui-selected': {
1192
+ color: (theme.vars || theme).palette.primary[700],
1193
+ borderColor: `${(theme.vars || theme).palette.primary[200]} !important`,
1194
+ backgroundColor: (theme.vars || theme).palette.primary[50],
1195
+ '&:hover': {
1196
+ backgroundColor: (theme.vars || theme).palette.primary[100]
1197
+ }
1198
+ }
1199
+ }, theme.applyDarkStyles({
1200
+ borderColor: theme.palette.primaryDark[700],
1201
+ '&:hover': {
1202
+ backgroundColor: alpha(theme.palette.primaryDark[600], 0.2)
1203
+ },
1204
+ '&.Mui-selected': {
1205
+ color: (theme.vars || theme).palette.primary[200],
1206
+ borderColor: `${(theme.vars || theme).palette.primary[800]} !important`,
1207
+ backgroundColor: alpha(theme.palette.primary[900], 0.4),
1208
+ '&:hover': {
1209
+ backgroundColor: alpha(theme.palette.primary[900], 0.8),
1210
+ borderColor: `${(theme.vars || theme).palette.primary[400]} !important`
1211
+ }
1212
+ }
1213
+ })]
1214
+ }
1215
+ },
1216
+ MuiTooltip: {
1217
+ defaultProps: {
1218
+ arrow: true
1219
+ },
1220
+ styleOverrides: {
1221
+ tooltip: ({
1222
+ theme
1223
+ }) => ({
1224
+ padding: '6px 8px',
1225
+ borderRadius: 6,
1226
+ backgroundColor: (theme.vars || theme).palette.grey[800],
1227
+ '& .MuiTooltip-arrow': {
1228
+ color: (theme.vars || theme).palette.grey[800]
1229
+ }
1230
+ })
1231
+ }
1232
+ },
1233
+ MuiSwitch: {
1234
+ styleOverrides: {
1235
+ root: {
1236
+ width: 32,
1237
+ height: 20,
1238
+ padding: 0,
1239
+ '& .MuiSwitch-switchBase': {
1240
+ '&.Mui-checked': {
1241
+ transform: 'translateX(11px)',
1242
+ color: '#fff'
1243
+ }
1244
+ }
1245
+ },
1246
+ switchBase: {
1247
+ height: 20,
1248
+ width: 20,
1249
+ padding: 0,
1250
+ color: '#fff',
1251
+ '&.Mui-checked + .MuiSwitch-track': {
1252
+ opacity: 1
1253
+ }
1254
+ },
1255
+ track: ({
1256
+ theme
1257
+ }) => ({
1258
+ opacity: 1,
1259
+ borderRadius: 32,
1260
+ backgroundColor: theme.palette.grey[400],
1261
+ ...theme.applyDarkStyles({
1262
+ backgroundColor: theme.palette.grey[800]
1263
+ })
1264
+ }),
1265
+ thumb: {
1266
+ flexShrink: 0,
1267
+ width: '14px',
1268
+ height: '14px'
1269
+ }
1270
+ }
1271
+ },
1272
+ MuiSnackbar: {
1273
+ styleOverrides: {
1274
+ root: ({
1275
+ theme
1276
+ }) => ({
1277
+ '& .MuiSnackbarContent-root': {
1278
+ backgroundColor: '#FFF',
1279
+ color: (theme.vars || theme).palette.text.primary,
1280
+ fontWeight: theme.typography.fontWeightMedium,
1281
+ border: `1px solid ${(theme.vars || theme).palette.divider}`,
1282
+ boxShadow: `0 4px 16px ${alpha(theme.palette.grey[400], 0.2)}`,
1283
+ ...theme.applyDarkStyles({
1284
+ backgroundColor: (theme.vars || theme).palette.primaryDark[800],
1285
+ boxShadow: '0 4px 16px hsl(0, 100%, 1%)'
1286
+ })
1287
+ }
1288
+ })
1289
+ }
1290
+ },
1291
+ MuiPaginationItem: {
1292
+ styleOverrides: {
1293
+ root: ({
1294
+ theme
1295
+ }) => [{
1296
+ textTransform: 'none',
1297
+ fontWeight: theme.typography.fontWeightSemiBold,
1298
+ color: theme.palette.grey[700],
1299
+ borderColor: theme.palette.grey[200],
1300
+ borderRadius: '8px',
1301
+ '&.Mui-selected': {
1302
+ color: (theme.vars || theme).palette.primary[500],
1303
+ borderColor: `${(theme.vars || theme).palette.primary[500]} !important`,
1304
+ backgroundColor: (theme.vars || theme).palette.primary[50],
1305
+ '&:hover': {
1306
+ backgroundColor: (theme.vars || theme).palette.primary[100]
1307
+ }
1308
+ }
1309
+ }, theme.applyDarkStyles({
1310
+ color: theme.palette.grey[200],
1311
+ borderColor: theme.palette.primaryDark[700],
1312
+ '&.Mui-selected': {
1313
+ color: theme.palette.primary[100],
1314
+ borderColor: `${(theme.vars || theme).palette.primary[700]} !important`,
1315
+ backgroundColor: alpha(theme.palette.primary[900], 0.5),
1316
+ '&:hover': {
1317
+ backgroundColor: alpha(theme.palette.primary[900], 0.8)
1318
+ }
1319
+ }
1320
+ })]
1321
+ }
1322
+ },
1323
+ MuiCssBaseline: {
1324
+ defaultProps: {
1325
+ enableColorScheme: true
1326
+ },
1327
+ styleOverrides: {
1328
+ html: {
1329
+ overflowY: 'scroll'
1330
+ // TODO add support for it,
1331
+ // https://github.com/mui/material-ui/issues/40748
1332
+ // scrollbarGutter: 'stable',
1333
+ }
1334
+ }
1335
+ }
1336
+ }
1337
+ };
1338
+ }
1339
+ export const brandingDarkTheme = createTheme({
1340
+ ...getDesignTokens('dark'),
1341
+ ...getThemedComponents()
1342
+ });
1343
+ export const brandingLightTheme = createTheme({
1344
+ ...getDesignTokens('light'),
1345
+ ...getThemedComponents()
1346
+ });