@mui/docs 6.0.0-alpha.9 → 6.0.0-beta.0

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.
@@ -8,6 +8,7 @@ exports.MarkdownElement = void 0;
8
8
  var React = _interopRequireWildcard(require("react"));
9
9
  var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _styles = require("@mui/material/styles");
11
+ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
11
12
  var _branding = require("../branding");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
@@ -18,8 +19,8 @@ const Root = (0, _styles.styled)('div')(({
18
19
  var _theme$shape$borderRa, _theme$shape, _theme$shape$borderRa2, _theme$shape2, _theme$shape$borderRa3, _theme$shape3;
19
20
  return {
20
21
  ..._branding.brandingLightTheme.typography.body1,
21
- lineHeight: 1.6,
22
- // Increased compared to the 1.5 default to make the docs easier to read.
22
+ lineHeight: 1.625,
23
+ // Rounds up to 26px-increased compared to the 1.5 default to make the docs easier to read.
23
24
  color: `var(--muidocs-palette-text-primary, ${_branding.brandingLightTheme.palette.text.primary})`,
24
25
  '& :focus-visible': {
25
26
  outline: `3px solid ${(0, _styles.alpha)(_branding.brandingLightTheme.palette.primary[500], 0.5)}`,
@@ -34,7 +35,7 @@ const Root = (0, _styles.styled)('div')(({
34
35
  // Developers like when the code is dense.
35
36
  margin: theme.spacing(2, 'auto'),
36
37
  padding: theme.spacing(2),
37
- backgroundColor: 'hsl(210, 35%, 9%)',
38
+ backgroundColor: 'hsl(210, 25%, 9%)',
38
39
  // a special, one-off, color tailored for the code blocks using MUI's branding theme blue palette as the starting point. It has a less saturaded color but still maintaining a bit of the blue tint.
39
40
  color: 'hsl(60, 30%, 96%)',
40
41
  colorScheme: 'dark',
@@ -133,6 +134,44 @@ const Root = (0, _styles.styled)('div')(({
133
134
  marginBottom: 6
134
135
  }
135
136
  },
137
+ '& a[target="_blank"]::after': {
138
+ content: '""',
139
+ maskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' focusable='false' aria-hidden='true' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z'%3E%3C/path%3E%3C/svg%3E")`,
140
+ display: 'inline-flex',
141
+ width: '1em',
142
+ height: '1em',
143
+ color: 'inherit',
144
+ backgroundColor: 'currentColor',
145
+ transform: 'translate(0, 2px)',
146
+ transition: 'transform 0.3s cubic-bezier(0.1, 0.8, 0.3, 1)',
147
+ // bounce effect
148
+ opacity: 0.8
149
+ },
150
+ '& a[target="_blank"]:hover::after': {
151
+ opacity: 1,
152
+ transform: 'translate(1px, 0)'
153
+ },
154
+ '& a.remove-link-arrow::after': {
155
+ // Allows to remove link arrows for images
156
+ display: 'none'
157
+ },
158
+ '& .Ad-root a::after': {
159
+ // Remove link arrow for ads
160
+ display: 'none'
161
+ },
162
+ '& a': {
163
+ // Style taken from the Link component
164
+ color: `var(--muidocs-palette-primary-600, ${_branding.brandingLightTheme.palette.primary[600]})`,
165
+ fontWeight: theme.typography.fontWeightMedium,
166
+ textDecoration: 'underline',
167
+ textDecorationColor: (0, _styles.alpha)(_branding.brandingLightTheme.palette.primary.main, 0.4),
168
+ '&:hover': {
169
+ textDecorationColor: 'inherit'
170
+ }
171
+ },
172
+ '& a code': {
173
+ color: (0, _styles.darken)(_branding.brandingLightTheme.palette.primary.main, 0.2)
174
+ },
136
175
  '& h1, & h2, & h3, & h4': {
137
176
  display: 'flex',
138
177
  alignItems: 'center',
@@ -146,9 +185,12 @@ const Root = (0, _styles.styled)('div')(({
146
185
  '& .title-link-to-anchor': {
147
186
  color: 'inherit',
148
187
  textDecoration: 'none',
188
+ boxShadow: 'none',
189
+ fontWeight: 'inherit',
149
190
  position: 'relative',
150
191
  display: 'flex',
151
- alignItems: 'center'
192
+ alignItems: 'center',
193
+ userSelect: 'text'
152
194
  },
153
195
  '& .anchor-icon': {
154
196
  // To prevent the link to get the focus.
@@ -156,12 +198,6 @@ const Root = (0, _styles.styled)('div')(({
156
198
  alignItems: 'center',
157
199
  visibility: 'hidden'
158
200
  },
159
- '& a:not(.title-link-to-anchor):hover': {
160
- color: 'currentColor',
161
- border: 'none',
162
- boxShadow: '0 1px 0 0 currentColor',
163
- textDecoration: 'none'
164
- },
165
201
  '& .anchor-icon, & .comment-link': {
166
202
  padding: 0,
167
203
  cursor: 'pointer',
@@ -172,11 +208,13 @@ const Root = (0, _styles.styled)('div')(({
172
208
  marginLeft: 8,
173
209
  height: 26,
174
210
  width: 26,
175
- backgroundColor: `var(--muidocs-palette-primary-50, ${_branding.brandingLightTheme.palette.grey[50]})`,
176
211
  color: `var(--muidocs-palette-grey-600, ${_branding.brandingLightTheme.palette.grey[600]})`,
177
- border: '1px solid',
178
- borderColor: `var(--muidocs-palette-divider, ${_branding.brandingLightTheme.palette.divider})`,
212
+ backgroundColor: 'transparent',
213
+ border: '1px solid transparent',
179
214
  borderRadius: 8,
215
+ transition: theme.transitions.create(['visibility', 'background-color', 'color', 'border-color'], {
216
+ duration: theme.transitions.duration.shortest
217
+ }),
180
218
  '&:hover': {
181
219
  backgroundColor: (0, _styles.alpha)(_branding.brandingLightTheme.palette.primary[100], 0.4),
182
220
  borderColor: `var(--muidocs-palette-primary-100, ${_branding.brandingLightTheme.palette.primary[100]})`,
@@ -197,7 +235,7 @@ const Root = (0, _styles.styled)('div')(({
197
235
  display: 'none',
198
236
  // So we can have the comment button opt-in.
199
237
  marginLeft: 'auto',
200
- transition: theme.transitions.create('opacity', {
238
+ transition: theme.transitions.create(['background-color', 'color', 'border-color'], {
201
239
  duration: theme.transitions.duration.shortest
202
240
  }),
203
241
  '& svg': {
@@ -295,44 +333,58 @@ const Root = (0, _styles.styled)('div')(({
295
333
  },
296
334
  '& .MuiCallout-root': {
297
335
  display: 'flex',
298
- gap: 12,
299
- padding: '16px',
336
+ gap: '8px',
337
+ padding: '12px',
300
338
  margin: '16px 0',
301
339
  border: '1px solid',
302
340
  color: `var(--muidocs-palette-text-secondary, ${_branding.brandingLightTheme.palette.text.secondary})`,
303
341
  borderColor: `var(--muidocs-palette-grey-100, ${_branding.brandingLightTheme.palette.grey[100]})`,
304
342
  borderRadius: `var(--muidocs-shape-borderRadius, ${(_theme$shape$borderRa2 = (_theme$shape2 = theme.shape) == null ? void 0 : _theme$shape2.borderRadius) != null ? _theme$shape$borderRa2 : _branding.brandingLightTheme.shape.borderRadius}px)`,
305
- '& > code': {
343
+ '& .MuiCallout-content': {
344
+ minWidth: 0,
345
+ // Allows content to shrink. Useful when callout contains code block
346
+ flexGrow: 1
347
+ },
348
+ '& code': {
306
349
  height: 'fit-content',
307
350
  backgroundColor: `var(--muidocs-palette-grey-100, ${_branding.brandingLightTheme.palette.grey[100]})`,
308
351
  borderColor: `var(--muidocs-palette-grey-300, ${_branding.brandingLightTheme.palette.grey[300]})`
309
352
  },
310
- '& .MuiCallout-content': {
311
- minWidth: 0,
312
- // Allows content to shrink. Useful when callout contains code block
313
- flexGrow: 1,
353
+ '& p': {
354
+ marginBottom: '8px',
314
355
  '& > p:last-child, & > ul:last-child': {
315
356
  // Avoid margin on last child
316
357
  marginBottom: 0
317
358
  },
318
- '& .MuiCode-root': {
319
- '& > pre': {
320
- margin: 0,
321
- marginTop: 4
322
- }
323
- },
324
359
  '& > ul': {
325
360
  // Because of the gap left by the icon, we visually need less padding
326
361
  paddingLeft: 22
327
362
  }
328
363
  },
329
- '& > svg': {
330
- marginTop: 2,
331
- width: 20,
332
- height: 20,
333
- flexShrink: 0
364
+ '& .MuiCode-root': {
365
+ '& pre': {
366
+ margin: '4px 0 0 0',
367
+ borderRadius: '12px 12px 6px 12px',
368
+ borderColor: (0, _styles.alpha)(_branding.brandingLightTheme.palette.primaryDark[600], 0.6),
369
+ '& code': {
370
+ backgroundColor: 'transparent'
371
+ }
372
+ }
373
+ },
374
+ '& .MuiCallout-icon-container': {
375
+ width: 26,
376
+ // to match text's line-height
377
+ height: 26,
378
+ display: 'flex',
379
+ alignItems: 'center',
380
+ justifyContent: 'center',
381
+ flexShrink: 0,
382
+ '& svg': {
383
+ width: 18,
384
+ height: 18
385
+ }
334
386
  },
335
- '& > ul, & > p': {
387
+ '& ul, & p': {
336
388
  '&:last-child': {
337
389
  margin: 0
338
390
  }
@@ -347,7 +399,7 @@ const Root = (0, _styles.styled)('div')(({
347
399
  '& strong': {
348
400
  color: `var(--muidocs-palette-error-800, ${_branding.brandingLightTheme.palette.error[800]})`
349
401
  },
350
- '& > svg': {
402
+ '& svg': {
351
403
  fill: `var(--muidocs-palette-error-500, ${_branding.brandingLightTheme.palette.error[600]})`
352
404
  },
353
405
  '& a': {
@@ -365,7 +417,7 @@ const Root = (0, _styles.styled)('div')(({
365
417
  '& strong': {
366
418
  color: `var(--muidocs-palette-primary-800, ${_branding.brandingLightTheme.palette.primary[800]})`
367
419
  },
368
- '& > svg': {
420
+ '& svg': {
369
421
  fill: `var(--muidocs-palette-grey-600, ${_branding.brandingLightTheme.palette.grey[600]})`
370
422
  }
371
423
  },
@@ -376,7 +428,7 @@ const Root = (0, _styles.styled)('div')(({
376
428
  '& strong': {
377
429
  color: `var(--muidocs-palette-success-900, ${_branding.brandingLightTheme.palette.success[900]})`
378
430
  },
379
- '& > svg': {
431
+ '& svg': {
380
432
  fill: `var(--muidocs-palette-success-600, ${_branding.brandingLightTheme.palette.success[600]})`
381
433
  },
382
434
  '& a': {
@@ -394,7 +446,7 @@ const Root = (0, _styles.styled)('div')(({
394
446
  '& strong': {
395
447
  color: `var(--muidocs-palette-warning-800, ${_branding.brandingLightTheme.palette.warning[800]})`
396
448
  },
397
- '& > svg': {
449
+ '& svg': {
398
450
  fill: `var(--muidocs-palette-warning-600, ${_branding.brandingLightTheme.palette.warning[600]})`
399
451
  },
400
452
  '& a': {
@@ -406,47 +458,6 @@ const Root = (0, _styles.styled)('div')(({
406
458
  }
407
459
  }
408
460
  },
409
- '& a[target="_blank"]::after': {
410
- content: '""',
411
- maskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' focusable='false' aria-hidden='true' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z'%3E%3C/path%3E%3C/svg%3E")`,
412
- display: 'inline-flex',
413
- width: '1em',
414
- height: '1em',
415
- color: 'inherit',
416
- backgroundColor: 'currentColor',
417
- transform: 'translate(0, 2px)',
418
- transition: 'transform 0.3s cubic-bezier(0.1, 0.8, 0.3, 1)',
419
- // bounce effect
420
- opacity: 0.8
421
- },
422
- '& a[target="_blank"]:hover::after': {
423
- opacity: 1,
424
- transform: 'translate(1px, 0)'
425
- },
426
- '& a.remove-link-arrow::after': {
427
- // Allows to remove link arrows for images
428
- display: 'none'
429
- },
430
- '& .Ad-root a::after': {
431
- // Remove link arrow for ads
432
- display: 'none'
433
- },
434
- '& a:not(.title-link-to-anchor), & a:not(.title-link-to-anchor) code': {
435
- // Style taken from the Link component
436
- color: `var(--muidocs-palette-primary-600, ${_branding.brandingLightTheme.palette.primary[600]})`,
437
- fontWeight: theme.typography.fontWeightMedium,
438
- textDecoration: 'underline',
439
- textDecorationColor: (0, _styles.alpha)(_branding.brandingLightTheme.palette.primary.main, 0.4),
440
- '&:hover': {
441
- textDecorationColor: 'inherit'
442
- }
443
- },
444
- '& a code': {
445
- color: (0, _styles.darken)(_branding.brandingLightTheme.palette.primary.main, 0.04)
446
- },
447
- '& a:not(.title-link-to-anchor) code': {
448
- color: (0, _styles.darken)(_branding.brandingLightTheme.palette.primary.main, 0.2)
449
- },
450
461
  '& img, & video': {
451
462
  // Use !important so that inline style on <img> or <video> can't win.
452
463
  // This avoid horizontal overflows on mobile.
@@ -550,7 +561,6 @@ const Root = (0, _styles.styled)('div')(({
550
561
  display: 'inline-flex',
551
562
  flexDirection: 'row-reverse',
552
563
  alignItems: 'center',
553
- height: 24,
554
564
  padding: theme.spacing(0.5),
555
565
  paddingBottom: '5px',
556
566
  // optical alignment
@@ -561,7 +571,7 @@ const Root = (0, _styles.styled)('div')(({
561
571
  border: '1px solid',
562
572
  borderColor: (0, _styles.alpha)(_branding.brandingLightTheme.palette.primaryDark[600], 0.5),
563
573
  backgroundColor: (0, _styles.alpha)(_branding.brandingLightTheme.palette.primaryDark[800], 0.5),
564
- color: `var(--muidocs-palette-grey-200, ${_branding.brandingLightTheme.palette.grey[200]})`,
574
+ color: `var(--muidocs-palette-grey-300, ${_branding.brandingLightTheme.palette.grey[300]})`,
565
575
  transition: theme.transitions.create(['background', 'borderColor', 'display'], {
566
576
  duration: theme.transitions.duration.shortest
567
577
  }),
@@ -675,24 +685,26 @@ const Root = (0, _styles.styled)('div')(({
675
685
  '& hr': {
676
686
  backgroundColor: `var(--muidocs-palette-divider, ${_branding.brandingDarkTheme.palette.divider})`
677
687
  },
678
- '& h1, & h2, & h3, & h4, & h5': {
679
- color: `var(--muidocs-palette-grey-50, ${_branding.brandingDarkTheme.palette.grey[50]})`
688
+ '& a': {
689
+ color: `var(--muidocs-palette-primary-300, ${_branding.brandingDarkTheme.palette.primary[300]})`
680
690
  },
681
- '& p, & ul, & ol': {
682
- color: `var(--muidocs-palette-grey-400, ${_branding.brandingDarkTheme.palette.grey[400]})`
691
+ '& a code': {
692
+ color: `var(--muidocs-palette-primary-light, ${_branding.brandingDarkTheme.palette.primary.light})`
683
693
  },
684
- '& h1, & h2, & h3, & h4': {
685
- '&:hover .anchor-icon, & .comment-link': {
686
- color: `var(--muidocs-palette-primary-300, ${_branding.brandingDarkTheme.palette.primaryDark[300]})`,
687
- borderColor: `var(--muidocs-palette-divider, ${_branding.brandingDarkTheme.palette.divider})`,
688
- backgroundColor: (0, _styles.alpha)(_branding.brandingDarkTheme.palette.primaryDark[700], 0.5),
694
+ '& h1, & h2, & h3, & h4, & h5': {
695
+ color: `var(--muidocs-palette-grey-50, ${_branding.brandingDarkTheme.palette.grey[50]})`,
696
+ '& .anchor-icon, & .comment-link': {
697
+ color: `var(--muidocs-palette-primary-300, ${_branding.brandingDarkTheme.palette.primaryDark[400]})`,
689
698
  '&:hover': {
699
+ color: `var(--muidocs-palette-primary-100, ${_branding.brandingDarkTheme.palette.primary[100]})`,
690
700
  borderColor: `var(--muidocs-palette-primary-900, ${_branding.brandingDarkTheme.palette.primary[900]})`,
691
- backgroundColor: (0, _styles.alpha)(_branding.brandingDarkTheme.palette.primary[900], 0.6),
692
- color: `var(--muidocs-palette-primary-100, ${_branding.brandingDarkTheme.palette.primary[100]})`
701
+ backgroundColor: (0, _styles.alpha)(_branding.brandingDarkTheme.palette.primary[900], 0.6)
693
702
  }
694
703
  }
695
704
  },
705
+ '& p, & ul, & ol': {
706
+ color: `var(--muidocs-palette-grey-400, ${_branding.brandingDarkTheme.palette.grey[400]})`
707
+ },
696
708
  '& h1 code, & h2 code, & h3 code': {
697
709
  color: `var(--muidocs-palette-grey-100, ${_branding.brandingDarkTheme.palette.grey[100]})`
698
710
  },
@@ -726,8 +738,7 @@ const Root = (0, _styles.styled)('div')(({
726
738
  },
727
739
  '& .MuiCallout-root': {
728
740
  borderColor: `var(--muidocs-palette-primaryDark-700, ${_branding.brandingDarkTheme.palette.primaryDark[700]})`,
729
- '& > code': {
730
- height: 'fit-content',
741
+ '& code': {
731
742
  backgroundColor: `var(--muidocs-palette-primaryDark-600, ${_branding.brandingDarkTheme.palette.primaryDark[600]})`,
732
743
  borderColor: `var(--muidocs-palette-primaryDark-500, ${_branding.brandingDarkTheme.palette.primaryDark[500]})`
733
744
  },
@@ -738,7 +749,7 @@ const Root = (0, _styles.styled)('div')(({
738
749
  '& strong': {
739
750
  color: `var(--muidocs-palette-error-300, ${_branding.brandingDarkTheme.palette.error[300]})`
740
751
  },
741
- '& > svg': {
752
+ '& svg': {
742
753
  fill: `var(--muidocs-palette-error-500, ${_branding.brandingDarkTheme.palette.error[500]})`
743
754
  },
744
755
  '& a': {
@@ -752,7 +763,7 @@ const Root = (0, _styles.styled)('div')(({
752
763
  '& strong': {
753
764
  color: `var(--muidocs-palette-primary-200, ${_branding.brandingDarkTheme.palette.primary[200]})`
754
765
  },
755
- '& > svg': {
766
+ '& svg': {
756
767
  fill: `var(--muidocs-palette-grey-400, ${_branding.brandingDarkTheme.palette.grey[400]})`
757
768
  }
758
769
  },
@@ -763,7 +774,7 @@ const Root = (0, _styles.styled)('div')(({
763
774
  '& strong': {
764
775
  color: `var(--muidocs-palette-success-200, ${_branding.brandingDarkTheme.palette.success[200]})`
765
776
  },
766
- '& > svg': {
777
+ '& svg': {
767
778
  fill: `var(--muidocs-palette-success-500, ${_branding.brandingDarkTheme.palette.success[500]})`
768
779
  },
769
780
  '& a': {
@@ -777,7 +788,7 @@ const Root = (0, _styles.styled)('div')(({
777
788
  '& strong': {
778
789
  color: `var(--muidocs-palette-warning-200, ${_branding.brandingDarkTheme.palette.warning[200]})`
779
790
  },
780
- '& > svg': {
791
+ '& svg': {
781
792
  fill: `var(--muidocs-palette-warning-400, ${_branding.brandingDarkTheme.palette.warning[400]})`
782
793
  },
783
794
  '& a': {
@@ -785,12 +796,6 @@ const Root = (0, _styles.styled)('div')(({
785
796
  }
786
797
  }
787
798
  },
788
- '& a:not(.title-link-to-anchor), & a:not(.title-link-to-anchor) code': {
789
- color: `var(--muidocs-palette-primary-300, ${_branding.brandingDarkTheme.palette.primary[300]})`
790
- },
791
- '& a:not(.title-link-to-anchor) code': {
792
- color: `var(--muidocs-palette-primary-light, ${_branding.brandingDarkTheme.palette.primary.light})`
793
- },
794
799
  '& kbd.key': {
795
800
  color: `var(--muidocs-palette-text-primary, ${_branding.brandingDarkTheme.palette.text.primary})`,
796
801
  backgroundColor: `var(--muidocs-palette-primaryDark-800, ${_branding.brandingDarkTheme.palette.primaryDark[800]})`,
@@ -814,12 +819,32 @@ const Root = (0, _styles.styled)('div')(({
814
819
  }
815
820
  }
816
821
  }));
822
+ function handleHeaderClick(event) {
823
+ const selection = document.getSelection();
824
+ if (selection === null) {
825
+ return;
826
+ }
827
+ if (selection.type === 'Range') {
828
+ // Disable the <a> behavior to be able to select text.
829
+ event.preventDefault();
830
+ }
831
+ }
817
832
  const MarkdownElement = exports.MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownElement(props, ref) {
818
833
  const {
819
834
  className,
820
835
  renderedMarkdown,
821
836
  ...other
822
837
  } = props;
838
+ const rootRef = React.useRef(null);
839
+ const handleRef = (0, _useForkRef.default)(rootRef, ref);
840
+ React.useEffect(() => {
841
+ const elements = rootRef.current.getElementsByClassName('title-link-to-anchor');
842
+ for (let i = 0; i < elements.length; i += 1) {
843
+ // More reliable than `-webkit-user-drag` (https://caniuse.com/webkit-user-drag)
844
+ elements[i].setAttribute('draggable', 'false');
845
+ elements[i].addEventListener('click', handleHeaderClick);
846
+ }
847
+ }, []);
823
848
  const more = {};
824
849
  if (typeof renderedMarkdown === 'string') {
825
850
  // workaround for https://github.com/facebook/react/issues/17170
@@ -832,6 +857,6 @@ const MarkdownElement = exports.MarkdownElement = /*#__PURE__*/React.forwardRef(
832
857
  className: (0, _clsx.default)('markdown-body', className),
833
858
  ...more,
834
859
  ...other,
835
- ref: ref
860
+ ref: handleRef
836
861
  });
837
862
  });
@@ -451,7 +451,7 @@ function getThemedComponents() {
451
451
  ...theme.typography.body1,
452
452
  lineHeight: 21 / 16,
453
453
  padding: theme.spacing('8px', '10px', '10px', '12px'),
454
- fontWeight: theme.typography.fontWeightSemiBold,
454
+ fontWeight: theme.typography.fontWeightMedium,
455
455
  borderRadius: 10,
456
456
  '& > span': {
457
457
  transition: '0.2s',
@@ -464,7 +464,7 @@ function getThemedComponents() {
464
464
  ...(ownerState.size === 'medium' && {
465
465
  fontSize: defaultTheme.typography.pxToRem(15),
466
466
  padding: theme.spacing('8px', '12px', '8px', '14px'),
467
- fontWeight: theme.typography.fontWeightSemiBold,
467
+ fontWeight: theme.typography.fontWeightMedium,
468
468
  borderRadius: 8,
469
469
  '& > span': {
470
470
  transition: '0.2s',
@@ -475,10 +475,10 @@ function getThemedComponents() {
475
475
  }
476
476
  }),
477
477
  ...(ownerState.size === 'small' && {
478
- padding: theme.spacing('6px', 1.5),
478
+ padding: '6px 8px',
479
479
  fontFamily: theme.typography.fontFamily,
480
480
  fontSize: defaultTheme.typography.pxToRem(13),
481
- fontWeight: theme.typography.fontWeightSemiBold,
481
+ fontWeight: theme.typography.fontWeightMedium,
482
482
  borderRadius: 8,
483
483
  '& .MuiButton-startIcon': {
484
484
  transition: '0.15s',
@@ -715,6 +715,15 @@ function getThemedComponents() {
715
715
  ownerState
716
716
  }) => ({
717
717
  borderRadius: theme.shape.borderRadius,
718
+ transition: 'all 100ms ease-in',
719
+ '&:hover': {
720
+ borderColor: (theme.vars || theme).palette.grey[300],
721
+ background: (theme.vars || theme).palette.grey[50],
722
+ ...theme.applyDarkStyles({
723
+ borderColor: (theme.vars || theme).palette.primaryDark[600],
724
+ background: (0, _styles.alpha)(theme.palette.primaryDark[700], 0.8)
725
+ })
726
+ },
718
727
  ...(ownerState.size === 'small' && {
719
728
  height: 32,
720
729
  width: 32,
@@ -731,11 +740,10 @@ function getThemedComponents() {
731
740
  style: ({
732
741
  theme
733
742
  }) => [{
734
- border: `1px solid`,
735
743
  color: (theme.vars || theme).palette.primary.main,
736
744
  backgroundColor: (0, _styles.alpha)(theme.palette.primaryDark[50], 0.1),
737
- borderColor: (theme.vars || theme).palette.primaryDark[100],
738
- boxShadow: `${(0, _styles.alpha)(theme.palette.grey[200], 0.5)} 0 1px 0 inset, ${(0, _styles.alpha)(theme.palette.grey[100], 0.4)} 0 -1px 0 inset, ${(0, _styles.alpha)(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
745
+ border: `1px solid ${(theme.vars || theme).palette.primaryDark[100]}`,
746
+ boxShadow: `#FFF 0 1px 0 inset, ${(0, _styles.alpha)(theme.palette.grey[200], 0.4)} 0 -1px 0 inset, ${(0, _styles.alpha)(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
739
747
  '&:hover': {
740
748
  borderColor: (theme.vars || theme).palette.grey[300],
741
749
  background: (theme.vars || theme).palette.grey[50]
@@ -757,25 +765,22 @@ function getThemedComponents() {
757
765
  style: ({
758
766
  theme
759
767
  }) => [{
760
- color: (theme.vars || theme).palette.text.tertiary,
761
- borderRadius: theme.shape.borderRadius,
762
- border: `1px solid`,
768
+ color: (theme.vars || theme).palette.text.secondary,
763
769
  backgroundColor: (0, _styles.alpha)(theme.palette.primaryDark[50], 0.1),
764
- borderColor: (theme.vars || theme).palette.primaryDark[100],
765
- boxShadow: `${(0, _styles.alpha)(theme.palette.grey[50], 0.4)} 0 1px 0 inset, ${(0, _styles.alpha)(theme.palette.grey[100], 0.5)} 0 -1px 0 inset, ${(0, _styles.alpha)(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
770
+ border: `1px solid ${(theme.vars || theme).palette.primaryDark[100]}`,
771
+ boxShadow: `#FFF 0 1px 0 inset, ${(0, _styles.alpha)(theme.palette.grey[200], 0.4)} 0 -1px 0 inset, ${(0, _styles.alpha)(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
766
772
  '&:hover': {
767
- color: (theme.vars || theme).palette.primary.main,
773
+ color: (theme.vars || theme).palette.text.primary,
768
774
  borderColor: (theme.vars || theme).palette.grey[300],
769
775
  background: (theme.vars || theme).palette.grey[50]
770
776
  }
771
777
  }, theme.applyDarkStyles({
772
778
  borderColor: (0, _styles.alpha)(theme.palette.primaryDark[600], 0.5),
773
779
  backgroundColor: (0, _styles.alpha)(theme.palette.primaryDark[700], 0.2),
774
- boxShadow: `${(0, _styles.alpha)(theme.palette.primaryDark[600], 0.2)} 0 1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 -1px 0 inset, ${(theme.vars || theme).palette.common.black} 0 1px 2px 0`,
780
+ boxShadow: `${(0, _styles.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`,
775
781
  '&:hover': {
776
- color: (theme.vars || theme).palette.primary[400],
777
- borderColor: (theme.vars || theme).palette.primaryDark[500],
778
- background: (0, _styles.alpha)(theme.palette.primaryDark[700], 0.4)
782
+ borderColor: (theme.vars || theme).palette.primaryDark[600],
783
+ background: (0, _styles.alpha)(theme.palette.primaryDark[700], 0.8)
779
784
  }
780
785
  })]
781
786
  }]
@@ -801,11 +806,11 @@ function getThemedComponents() {
801
806
  }
802
807
  },
803
808
  '& .MuiMenuItem-root': {
804
- padding: '6px 12px',
809
+ padding: '6px 8px',
805
810
  borderRadius: '6px',
806
811
  fontSize: theme.typography.pxToRem(14),
807
812
  fontWeight: theme.typography.fontWeightMedium,
808
- '&:hover, &:focus': {
813
+ '&:hover': {
809
814
  backgroundColor: (theme.vars || theme).palette.grey[100],
810
815
  color: (theme.vars || theme).palette.text.primary
811
816
  },
@@ -822,7 +827,7 @@ function getThemedComponents() {
822
827
  backgroundColor: (theme.vars || theme).palette.primaryDark[900],
823
828
  borderColor: (theme.vars || theme).palette.primaryDark[700],
824
829
  '& .MuiMenuItem-root': {
825
- '&:hover, &:focus': {
830
+ '&:hover': {
826
831
  backgroundColor: (theme.vars || theme).palette.primaryDark[700]
827
832
  },
828
833
  '&.Mui-selected': {
@@ -1220,11 +1225,20 @@ function getThemedComponents() {
1220
1225
  }
1221
1226
  },
1222
1227
  MuiTooltip: {
1228
+ defaultProps: {
1229
+ arrow: true
1230
+ },
1223
1231
  styleOverrides: {
1224
- tooltip: {
1232
+ tooltip: ({
1233
+ theme
1234
+ }) => ({
1235
+ padding: '6px 8px',
1225
1236
  borderRadius: 6,
1226
- padding: '6px 12px'
1227
- }
1237
+ backgroundColor: (theme.vars || theme).palette.grey[800],
1238
+ '& .MuiTooltip-arrow': {
1239
+ color: (theme.vars || theme).palette.grey[800]
1240
+ }
1241
+ })
1228
1242
  }
1229
1243
  },
1230
1244
  MuiSwitch: {
@@ -1235,7 +1249,7 @@ function getThemedComponents() {
1235
1249
  padding: 0,
1236
1250
  '& .MuiSwitch-switchBase': {
1237
1251
  '&.Mui-checked': {
1238
- transform: 'translateX(11px)',
1252
+ transform: 'translateX(12px)',
1239
1253
  color: '#fff'
1240
1254
  }
1241
1255
  }
@@ -1266,6 +1280,25 @@ function getThemedComponents() {
1266
1280
  }
1267
1281
  }
1268
1282
  },
1283
+ MuiSnackbar: {
1284
+ styleOverrides: {
1285
+ root: ({
1286
+ theme
1287
+ }) => ({
1288
+ '& .MuiSnackbarContent-root': {
1289
+ backgroundColor: '#FFF',
1290
+ color: (theme.vars || theme).palette.text.primary,
1291
+ fontWeight: theme.typography.fontWeightMedium,
1292
+ border: `1px solid ${(theme.vars || theme).palette.divider}`,
1293
+ boxShadow: `0 4px 16px ${(0, _styles.alpha)(theme.palette.grey[400], 0.2)}`,
1294
+ ...theme.applyDarkStyles({
1295
+ backgroundColor: (theme.vars || theme).palette.primaryDark[800],
1296
+ boxShadow: '0 4px 16px hsl(0, 100%, 1%)'
1297
+ })
1298
+ }
1299
+ })
1300
+ }
1301
+ },
1269
1302
  MuiPaginationItem: {
1270
1303
  styleOverrides: {
1271
1304
  root: ({
package/node/i18n/i18n.js CHANGED
@@ -73,6 +73,14 @@ function useSetUserLanguage() {
73
73
  return React.useContext(UserLanguageContext).setUserLanguage;
74
74
  }
75
75
  const warnedOnce = {};
76
+ const warn = (userLanguage, key, ignoreWarning) => {
77
+ const fullKey = `${userLanguage}:${key}`;
78
+ // No warnings in CI env
79
+ if (!ignoreWarning && !warnedOnce[fullKey] && typeof window !== 'undefined') {
80
+ console.warn(`Missing translation for ${fullKey}`);
81
+ warnedOnce[fullKey] = true;
82
+ }
83
+ };
76
84
  function useTranslate() {
77
85
  const userLanguage = useUserLanguage();
78
86
  const translations = React.useContext(TranslationsContext);
@@ -87,12 +95,7 @@ function useTranslate() {
87
95
  }
88
96
  const translation = getPath(wordings, key);
89
97
  if (!translation) {
90
- const fullKey = `${userLanguage}:${key}`;
91
- // No warnings in CI env
92
- if (!ignoreWarning && !warnedOnce[fullKey] && typeof window !== 'undefined') {
93
- console.error(`Missing translation for ${fullKey}`);
94
- warnedOnce[fullKey] = true;
95
- }
98
+ warn(userLanguage, key, ignoreWarning);
96
99
  return getPath(translations.en, key);
97
100
  }
98
101
  return translation;
@@ -99,7 +99,7 @@
99
99
  "decreaseSpacing": "decrease spacing",
100
100
  "demoToolbarLabel": "demo source",
101
101
  "demoStylingSelectSystem": "MUI System",
102
- "demoStylingSelectTailwind": "Tailwind CSS",
102
+ "demoStylingSelectTailwind": "Tailwind CSS",
103
103
  "demoStylingSelectCSS": "Plain CSS",
104
104
  "diamondSponsors": "Diamond sponsors",
105
105
  "becomeADiamondSponsor": "Become a Diamond sponsor",