@mui/docs 6.0.0-alpha.6 → 6.0.0-alpha.8

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.
@@ -1,6 +1,3 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
- import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["className", "renderedMarkdown"];
4
1
  import * as React from 'react';
5
2
  import clsx from 'clsx';
6
3
  import { alpha, darken, styled } from '@mui/material/styles';
@@ -8,7 +5,8 @@ import { brandingDarkTheme as darkTheme, brandingLightTheme as lightTheme } from
8
5
  import { jsx as _jsx } from "react/jsx-runtime";
9
6
  const Root = styled('div')(({
10
7
  theme
11
- }) => _extends({}, lightTheme.typography.body1, {
8
+ }) => ({
9
+ ...lightTheme.typography.body1,
12
10
  lineHeight: 1.6,
13
11
  // Increased compared to the 1.5 default to make the docs easier to read.
14
12
  color: `var(--muidocs-palette-text-primary, ${lightTheme.palette.text.primary})`,
@@ -41,11 +39,12 @@ const Root = styled('div')(({
41
39
  maxWidth: 'calc(100vw - 32px - 16px)'
42
40
  }
43
41
  },
44
- '& code': _extends({}, lightTheme.typography.body2, {
42
+ '& code': {
43
+ ...lightTheme.typography.body2,
45
44
  fontFamily: lightTheme.typography.fontFamilyCode,
46
45
  fontWeight: 400,
47
46
  WebkitFontSmoothing: 'subpixel-antialiased'
48
- }),
47
+ },
49
48
  '& pre > code': {
50
49
  // Reset for Safari
51
50
  // https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
@@ -63,47 +62,53 @@ const Root = styled('div')(({
63
62
  direction: 'ltr /*! @noflip */',
64
63
  boxDecorationBreak: 'clone'
65
64
  },
66
- '& h1': _extends({}, lightTheme.typography.h3, {
65
+ '& h1': {
66
+ ...lightTheme.typography.h3,
67
67
  fontSize: lightTheme.typography.pxToRem(36),
68
68
  fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
69
69
  margin: '10px 0',
70
70
  color: `var(--muidocs-palette-primaryDark-900, ${lightTheme.palette.primaryDark[900]})`,
71
71
  fontWeight: 600,
72
72
  letterSpacing: -0.2
73
- }),
74
- '& .description': _extends({}, lightTheme.typography.subtitle1, {
73
+ },
74
+ '& .description': {
75
+ ...lightTheme.typography.subtitle1,
75
76
  fontWeight: 400,
76
77
  margin: '0 0 24px'
77
- }),
78
+ },
78
79
  '& .component-tabs': {
79
80
  margin: '0 0 40px'
80
81
  },
81
- '& h2': _extends({}, lightTheme.typography.h5, {
82
+ '& h2': {
83
+ ...lightTheme.typography.h5,
82
84
  fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
83
85
  fontSize: theme.typography.pxToRem(26),
84
86
  fontWeight: lightTheme.typography.fontWeightSemiBold,
85
87
  color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
86
88
  margin: '40px 0 4px'
87
- }),
88
- '& h3': _extends({}, lightTheme.typography.h6, {
89
+ },
90
+ '& h3': {
91
+ ...lightTheme.typography.h6,
89
92
  fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
90
93
  fontSize: theme.typography.pxToRem(20),
91
94
  fontWeight: lightTheme.typography.fontWeightSemiBold,
92
95
  color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
93
96
  margin: '24px 0 4px'
94
- }),
95
- '& h4': _extends({}, lightTheme.typography.subtitle1, {
97
+ },
98
+ '& h4': {
99
+ ...lightTheme.typography.subtitle1,
96
100
  fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
97
101
  fontWeight: lightTheme.typography.fontWeightSemiBold,
98
102
  color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
99
103
  margin: '20px 0 6px'
100
- }),
101
- '& h5': _extends({}, lightTheme.typography.subtitle2, {
104
+ },
105
+ '& h5': {
106
+ ...lightTheme.typography.subtitle2,
102
107
  fontFamily: `"General Sans", ${lightTheme.typography.fontFamilySystem}`,
103
108
  fontWeight: lightTheme.typography.fontWeightSemiBold,
104
109
  color: `var(--muidocs-palette-grey-900, ${lightTheme.palette.grey[900]})`,
105
110
  margin: '20px 0 8px'
106
- }),
111
+ },
107
112
  '& p': {
108
113
  marginTop: 0,
109
114
  marginBottom: 16,
@@ -231,13 +236,14 @@ const Root = styled('div')(({
231
236
  borderBottom: `1px dotted var(--muidocs-palette-divider, ${lightTheme.palette.divider})`
232
237
  }
233
238
  },
234
- '& td': _extends({}, theme.typography.body2, {
239
+ '& td': {
240
+ ...theme.typography.body2,
235
241
  borderBottom: `1px solid var(--muidocs-palette-divider, ${lightTheme.palette.divider})`,
236
242
  paddingRight: 20,
237
243
  paddingTop: 16,
238
244
  paddingBottom: 16,
239
245
  color: `var(--muidocs-palette-text-secondary, ${lightTheme.palette.text.secondary})`
240
- }),
246
+ },
241
247
  '& td code': {
242
248
  lineHeight: 1.6
243
249
  },
@@ -526,45 +532,35 @@ const Root = styled('div')(({
526
532
  top: 0
527
533
  },
528
534
  '& .MuiCode-copy': {
529
- display: 'inline-flex',
530
- flexDirection: 'row-reverse',
531
- alignItems: 'center',
532
- width: 26,
533
- height: 26,
534
535
  cursor: 'pointer',
535
536
  position: 'absolute',
536
537
  top: 12,
537
538
  right: 12,
539
+ display: 'inline-flex',
540
+ flexDirection: 'row-reverse',
541
+ alignItems: 'center',
542
+ height: 24,
538
543
  padding: theme.spacing(0.5),
539
- fontFamily: 'inherit',
540
- fontWeight: 500,
544
+ paddingBottom: '5px',
545
+ // optical alignment
546
+ fontFamily: lightTheme.typography.fontFamily,
547
+ fontWeight: lightTheme.typography.fontWeightMedium,
548
+ fontSize: lightTheme.typography.pxToRem(12),
541
549
  borderRadius: 6,
542
- border: 'none',
543
- backgroundColor: 'hsl(210, 35%, 9%)',
544
- // using the code block one-off background color (defined in line 23)
545
- color: '#FFF',
550
+ border: '1px solid',
551
+ borderColor: alpha(lightTheme.palette.primaryDark[600], 0.5),
552
+ backgroundColor: alpha(lightTheme.palette.primaryDark[800], 0.5),
553
+ color: `var(--muidocs-palette-grey-200, ${lightTheme.palette.grey[200]})`,
546
554
  transition: theme.transitions.create(['background', 'borderColor', 'display'], {
547
555
  duration: theme.transitions.duration.shortest
548
556
  }),
549
- '& svg': {
550
- userSelect: 'none',
551
- width: theme.typography.pxToRem(16),
552
- height: theme.typography.pxToRem(16),
553
- display: 'inline-block',
554
- fill: 'currentcolor',
555
- flexShrink: 0,
556
- fontSize: '18px',
557
- margin: 'auto',
558
- opacity: 0.5
559
- },
560
- '& .MuiCode-copied-icon': {
557
+ '& .MuiCode-copied-label': {
561
558
  display: 'none'
562
559
  },
563
560
  '&:hover, &:focus': {
564
- backgroundColor: lightTheme.palette.primaryDark[600],
565
- '& svg': {
566
- opacity: 1
567
- },
561
+ borderColor: `var(--muidocs-palette-primaryDark-400, ${lightTheme.palette.primaryDark[400]})`,
562
+ backgroundColor: `var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
563
+ color: '#FFF',
568
564
  '& .MuiCode-copyKeypress': {
569
565
  display: 'block',
570
566
  // Approximate no hover capabilities with no keyboard
@@ -577,17 +573,19 @@ const Root = styled('div')(({
577
573
  '& .MuiCode-copyKeypress': {
578
574
  display: 'none',
579
575
  position: 'absolute',
580
- right: 26
576
+ right: 34
581
577
  },
582
578
  '&[data-copied]': {
583
- // style of the button when it is in copied state.
584
- borderColor: lightTheme.palette.primary[700],
579
+ borderColor: `var(--muidocs-palette-primaryDark-400, ${lightTheme.palette.primaryDark[400]})`,
580
+ backgroundColor: `var(--muidocs-palette-primaryDark-700, ${lightTheme.palette.primaryDark[700]})`,
585
581
  color: '#fff',
586
- backgroundColor: lightTheme.palette.primaryDark[600],
587
- '& .MuiCode-copy-icon': {
582
+ '& .MuiCode-copyKeypress': {
583
+ opacity: 0
584
+ },
585
+ '& .MuiCode-copy-label': {
588
586
  display: 'none'
589
587
  },
590
- '& .MuiCode-copied-icon': {
588
+ '& .MuiCode-copied-label': {
591
589
  display: 'block'
592
590
  }
593
591
  }
@@ -806,10 +804,10 @@ const Root = styled('div')(({
806
804
  }));
807
805
  export const MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownElement(props, ref) {
808
806
  const {
809
- className,
810
- renderedMarkdown
811
- } = props,
812
- other = _objectWithoutPropertiesLoose(props, _excluded);
807
+ className,
808
+ renderedMarkdown,
809
+ ...other
810
+ } = props;
813
811
  const more = {};
814
812
  if (typeof renderedMarkdown === 'string') {
815
813
  // workaround for https://github.com/facebook/react/issues/17170
@@ -818,9 +816,10 @@ export const MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownEl
818
816
  __html: renderedMarkdown
819
817
  };
820
818
  }
821
- return /*#__PURE__*/_jsx(Root, _extends({
822
- className: clsx('markdown-body', className)
823
- }, more, other, {
819
+ return /*#__PURE__*/_jsx(Root, {
820
+ className: clsx('markdown-body', className),
821
+ ...more,
822
+ ...other,
824
823
  ref: ref
825
- }));
824
+ });
826
825
  });
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import * as React from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import NProgress from 'nprogress';
@@ -38,7 +37,7 @@ function NProgressBar(props) {
38
37
  return /*#__PURE__*/_jsxs(NoSsr, {
39
38
  children: [props.children, /*#__PURE__*/_jsx(GlobalStyles, {
40
39
  styles: theme => ({
41
- '#nprogress': _extends({
40
+ '#nprogress': {
42
41
  direction: 'ltr',
43
42
  pointerEvents: 'none',
44
43
  position: 'fixed',
@@ -47,10 +46,10 @@ function NProgressBar(props) {
47
46
  right: 0,
48
47
  height: 2,
49
48
  zIndex: (theme.vars || theme).zIndex.tooltip,
50
- backgroundColor: (theme.vars || theme).palette.primary[200]
51
- }, theme.applyDarkStyles({
52
- backgroundColor: (theme.vars || theme).palette.primary[700]
53
- }), {
49
+ backgroundColor: (theme.vars || theme).palette.primary[200],
50
+ ...theme.applyDarkStyles({
51
+ backgroundColor: (theme.vars || theme).palette.primary[700]
52
+ }),
54
53
  '& .nprogress-bar': {
55
54
  position: 'fixed',
56
55
  backgroundColor: (theme.vars || theme).palette.primary.main,
@@ -79,7 +78,7 @@ function NProgressBar(props) {
79
78
  right: -80,
80
79
  clip: 'rect(-6px,90px,14px,-6px)'
81
80
  }
82
- })
81
+ }
83
82
  })
84
83
  })]
85
84
  });
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export interface SectionTitleProps {
3
+ title: string;
4
+ hash: string;
5
+ level?: 'h2' | 'h3' | 'h4';
6
+ }
7
+ export declare function SectionTitle(props: SectionTitleProps): React.JSX.Element;
@@ -0,0 +1,30 @@
1
+ var _span;
2
+ import * as React from 'react';
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ export function SectionTitle(props) {
5
+ const {
6
+ title,
7
+ hash,
8
+ level: Level = 'h2'
9
+ } = props;
10
+ return /*#__PURE__*/_jsx(Level, {
11
+ id: hash,
12
+ style: {
13
+ flexGrow: 1
14
+ },
15
+ children: /*#__PURE__*/_jsxs("a", {
16
+ "aria-labelledby": hash,
17
+ className: "title-link-to-anchor",
18
+ href: `#${hash}`,
19
+ tabIndex: -1,
20
+ children: [title, _span || (_span = /*#__PURE__*/_jsx("span", {
21
+ className: "anchor-icon",
22
+ children: /*#__PURE__*/_jsx("svg", {
23
+ children: /*#__PURE__*/_jsx("use", {
24
+ xlinkHref: "#anchor-link-icon"
25
+ })
26
+ })
27
+ }))]
28
+ })
29
+ });
30
+ }
@@ -0,0 +1 @@
1
+ export * from './SectionTitle';
@@ -0,0 +1 @@
1
+ export * from './SectionTitle';
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/SectionTitle/index.js",
5
+ "types": "./index.d.ts"
6
+ }