@mui/docs 6.0.0-alpha.4 → 6.0.0-alpha.6
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.
- package/CHANGELOG.md +86 -0
- package/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
- package/ComponentLinkHeader/ComponentLinkHeader.js +179 -0
- package/ComponentLinkHeader/index.d.ts +2 -0
- package/ComponentLinkHeader/index.js +2 -0
- package/ComponentLinkHeader/package.json +6 -0
- package/HighlightedCode/HighlightedCode.d.ts +3 -1
- package/HighlightedCode/HighlightedCode.js +27 -4
- package/InfoCard/InfoCard.d.ts +0 -1
- package/InfoCard/InfoCard.js +10 -8
- package/branding/brandingTheme.js +3 -5
- package/node/ComponentLinkHeader/ComponentLinkHeader.js +189 -0
- package/node/ComponentLinkHeader/index.js +24 -0
- package/node/HighlightedCode/HighlightedCode.js +27 -4
- package/node/InfoCard/InfoCard.js +10 -8
- package/node/branding/brandingTheme.js +3 -5
- package/node/svgIcons/AdobeXDIcon.js +22 -0
- package/node/svgIcons/BundleSizeIcon.js +22 -0
- package/node/svgIcons/FigmaIcon.js +31 -0
- package/node/svgIcons/MaterialDesignIcon.js +27 -0
- package/node/svgIcons/SketchIcon.js +36 -0
- package/node/svgIcons/W3CIcon.js +24 -0
- package/node/translations/translations.json +1 -0
- package/package.json +2 -2
- package/svgIcons/AdobeXDIcon.d.ts +4 -0
- package/svgIcons/AdobeXDIcon.js +14 -0
- package/svgIcons/BundleSizeIcon.d.ts +4 -0
- package/svgIcons/BundleSizeIcon.js +14 -0
- package/svgIcons/FigmaIcon.d.ts +4 -0
- package/svgIcons/FigmaIcon.js +23 -0
- package/svgIcons/FileDownload.d.ts +7 -0
- package/svgIcons/JavaScript.d.ts +7 -0
- package/svgIcons/MaterialDesignIcon.d.ts +4 -0
- package/svgIcons/MaterialDesignIcon.js +19 -0
- package/svgIcons/SketchIcon.d.ts +4 -0
- package/svgIcons/SketchIcon.js +28 -0
- package/svgIcons/TypeScript.d.ts +7 -0
- package/svgIcons/W3CIcon.d.ts +4 -0
- package/svgIcons/W3CIcon.js +16 -0
- package/translations/translations.json +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,91 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## v6.0.0-alpha.6
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.0.0-alpha.5..next -->
|
|
6
|
+
|
|
7
|
+
_May 8, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
### `@mui/material@6.0.0-alpha.6`
|
|
12
|
+
|
|
13
|
+
- [Chip] Add colorDefault class to chipClasses (#42067) @sai6855
|
|
14
|
+
- Migrate components to support CSS extraction (#42001) @siriwatknp
|
|
15
|
+
- [SpeedDial] Deprecate TransitionComponent (#40698) @harry-whorlow
|
|
16
|
+
|
|
17
|
+
### `@mui/codemod@6.0.0-alpha.6`
|
|
18
|
+
|
|
19
|
+
- Add `theme-v6` migration (#42056) @siriwatknp
|
|
20
|
+
|
|
21
|
+
### `@mui/icons-material@6.0.0-alpha.6`
|
|
22
|
+
|
|
23
|
+
- Add the Emergency icon (#42080) @danilo-leal
|
|
24
|
+
|
|
25
|
+
### Docs
|
|
26
|
+
|
|
27
|
+
- [autocomplete] Fix duplicate autocomplete id (#42086) @oliviertassinari
|
|
28
|
+
- Fix SEO redirection issues @oliviertassinari
|
|
29
|
+
- [material-ui] Fix broken link (#42142) @aarongarciah
|
|
30
|
+
- [material-ui][docs] Fix link on the Sync page (#42088) @danilo-leal
|
|
31
|
+
|
|
32
|
+
### Core
|
|
33
|
+
|
|
34
|
+
- [blog] Shorten title to fit @oliviertassinari
|
|
35
|
+
- [blog] Update Sync post OG image (#42114) @danilo-leal
|
|
36
|
+
- [blog] A few tweaks in introducing-sync-plugin (#42092) @oliviertassinari
|
|
37
|
+
- [code-infra] Add canary release scripts (#41949) @michaldudak
|
|
38
|
+
- [code-infra] Move ComponentLinkHeader to @mui/docs (#42061) @Janpot
|
|
39
|
+
- [code-infra] Bump node image used by CI in docker (#42079) @LukasTy
|
|
40
|
+
- [core] Restrict import path with ESLint (#41970) @oliviertassinari
|
|
41
|
+
- [docs-infra] Add design and formatting improvements (#42063) @danilo-leal
|
|
42
|
+
- [docs-infra] Fix HTML structure violations (#42085) @oliviertassinari
|
|
43
|
+
- [website] Componentize a few Careers page sections (#42102) @danilo-leal
|
|
44
|
+
- [website] Refine the InfoCard design (#42116) @danilo-leal
|
|
45
|
+
- [website] Fix home page slider's track position (#42141) @aarongarciah
|
|
46
|
+
- [website] Closing the survey @oliviertassinari
|
|
47
|
+
- [website] Remove Survey banner from website and Core docs (#42104) @joserodolfofreitas
|
|
48
|
+
|
|
49
|
+
All contributors of this release in alphabetical order: @aarongarciah, @danilo-leal, @harry-whorlow, @Janpot, @joserodolfofreitas, @LukasTy, @michaldudak, @oliviertassinari, @sai6855, @siriwatknp
|
|
50
|
+
|
|
51
|
+
## v6.0.0-alpha.5
|
|
52
|
+
|
|
53
|
+
<!-- generated comparing v6.0.0-alpha.4..next -->
|
|
54
|
+
|
|
55
|
+
_May 1, 2024_
|
|
56
|
+
|
|
57
|
+
A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
58
|
+
|
|
59
|
+
### `@mui/material@6.0.0-alpha.5`
|
|
60
|
+
|
|
61
|
+
- [FormControlLabel] Deprecate `componentsProps` (#41767) @sai6855
|
|
62
|
+
- [PaginationItem] Deprecate components prop (#41777) @sai6855
|
|
63
|
+
- [SvgIcon] Convert to support CSS extraction (#41779) @aarongarciah
|
|
64
|
+
|
|
65
|
+
### `@mui/base@5.0.0-beta.43`
|
|
66
|
+
|
|
67
|
+
- [TextareaAutosize] Fix resizing instability (#41638) @ZeeshanTamboli
|
|
68
|
+
|
|
69
|
+
### Docs
|
|
70
|
+
|
|
71
|
+
- Fix small SEO issues @oliviertassinari
|
|
72
|
+
- [material-ui] Fix minor spelling error in the "About the lab" page (#42073) @ryanhartwig
|
|
73
|
+
- [material-ui] Update Figma plugin name (#41967) @danilo-leal
|
|
74
|
+
- [material-ui][templates] Fix input props attributes in Landing Page template (#42013) @5-tom
|
|
75
|
+
- [system] Update typo on the sx prop page (#42035) @bricker
|
|
76
|
+
|
|
77
|
+
### Core
|
|
78
|
+
|
|
79
|
+
- [docs-infra] Clean up branding theme file and improve font-face readibility (#42023) @danilo-leal
|
|
80
|
+
- [docs-infra] Simplify docs demo (#42016) @oliviertassinari
|
|
81
|
+
- [website] Add content about the Sync plugin in the Material UI page (#40515) @danilo-leal
|
|
82
|
+
- [website] Sync career roles (#42058) @oliviertassinari
|
|
83
|
+
- [website] Add Nadja on the about page (#42021) @mnajdova
|
|
84
|
+
- [website] Fix code block design by changing the `MarkdownElement` import (#42022) @danilo-leal
|
|
85
|
+
- [wesbite] Remove duplicate MarkdownElement component (#42028) @danilo-leal
|
|
86
|
+
|
|
87
|
+
All contributors of this release in alphabetical order: @5-tom, @aarongarciah, @bricker, @danilo-leal, @mnajdova, @oliviertassinari, @ryanhartwig, @sai6855, @ZeeshanTamboli
|
|
88
|
+
|
|
3
89
|
## v6.0.0-alpha.4
|
|
4
90
|
|
|
5
91
|
<!-- generated comparing v6.0.0-alpha.3..next -->
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MarkdownHeaders } from '@mui/internal-markdown';
|
|
3
|
+
export interface ComponentLinkHeaderProps {
|
|
4
|
+
design?: boolean;
|
|
5
|
+
markdown: {
|
|
6
|
+
headers: MarkdownHeaders;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare function ComponentLinkHeader(props: ComponentLinkHeaderProps): React.JSX.Element;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
var _ChatRounded, _BundleSizeIcon, _W3CIcon, _MaterialDesignIcon, _li, _React$Fragment;
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import Chip from '@mui/material/Chip';
|
|
4
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
5
|
+
import ChatRounded from '@mui/icons-material/ChatRounded';
|
|
6
|
+
import { styled } from '@mui/material/styles';
|
|
7
|
+
import SketchIcon from '../svgIcons/SketchIcon';
|
|
8
|
+
import FigmaIcon from '../svgIcons/FigmaIcon';
|
|
9
|
+
import AdobeXDIcon from '../svgIcons/AdobeXDIcon';
|
|
10
|
+
import BundleSizeIcon from '../svgIcons/BundleSizeIcon';
|
|
11
|
+
import W3CIcon from '../svgIcons/W3CIcon';
|
|
12
|
+
import MaterialDesignIcon from '../svgIcons/MaterialDesignIcon';
|
|
13
|
+
import { useTranslate } from '../i18n';
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const Root = styled('ul')({
|
|
16
|
+
margin: 0,
|
|
17
|
+
padding: 0,
|
|
18
|
+
listStyle: 'none',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
flexWrap: 'wrap',
|
|
21
|
+
gap: 8,
|
|
22
|
+
'& .MuiChip-root': {
|
|
23
|
+
height: 26,
|
|
24
|
+
padding: '0 8px',
|
|
25
|
+
gap: 6,
|
|
26
|
+
'& .MuiChip-label': {
|
|
27
|
+
padding: 0
|
|
28
|
+
},
|
|
29
|
+
'& .MuiChip-iconSmall': {
|
|
30
|
+
margin: 0,
|
|
31
|
+
fontSize: 14
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const defaultPackageNames = {
|
|
36
|
+
'material-ui': '@mui/material',
|
|
37
|
+
'joy-ui': '@mui/joy',
|
|
38
|
+
'base-ui': '@mui/base',
|
|
39
|
+
system: '@mui/system'
|
|
40
|
+
};
|
|
41
|
+
export function ComponentLinkHeader(props) {
|
|
42
|
+
const {
|
|
43
|
+
markdown: {
|
|
44
|
+
headers
|
|
45
|
+
},
|
|
46
|
+
design
|
|
47
|
+
} = props;
|
|
48
|
+
const t = useTranslate();
|
|
49
|
+
const packageName = headers.packageName ?? defaultPackageNames[headers.productId] ?? '@mui/material';
|
|
50
|
+
return /*#__PURE__*/_jsxs(Root, {
|
|
51
|
+
children: [headers.githubLabel ? /*#__PURE__*/_jsx("li", {
|
|
52
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
53
|
+
clickable: true,
|
|
54
|
+
role: undefined,
|
|
55
|
+
component: "a",
|
|
56
|
+
size: "small",
|
|
57
|
+
variant: "outlined",
|
|
58
|
+
rel: "nofollow",
|
|
59
|
+
href: `${process.env.SOURCE_CODE_REPO}/labels/${encodeURIComponent(headers.githubLabel)}`,
|
|
60
|
+
icon: _ChatRounded || (_ChatRounded = /*#__PURE__*/_jsx(ChatRounded, {
|
|
61
|
+
color: "primary"
|
|
62
|
+
})),
|
|
63
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
64
|
+
"data-ga-event-action": "click",
|
|
65
|
+
"data-ga-event-label": t('githubLabel'),
|
|
66
|
+
"data-ga-event-split": "0.1",
|
|
67
|
+
label: t('githubLabel')
|
|
68
|
+
})
|
|
69
|
+
}) : null, /*#__PURE__*/_jsx("li", {
|
|
70
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
71
|
+
title: t('bundleSizeTooltip'),
|
|
72
|
+
describeChild: true,
|
|
73
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
74
|
+
clickable: true,
|
|
75
|
+
role: undefined,
|
|
76
|
+
component: "a",
|
|
77
|
+
size: "small",
|
|
78
|
+
variant: "outlined",
|
|
79
|
+
rel: "nofollow",
|
|
80
|
+
href: `https://bundlephobia.com/package/${packageName}@latest`,
|
|
81
|
+
icon: _BundleSizeIcon || (_BundleSizeIcon = /*#__PURE__*/_jsx(BundleSizeIcon, {
|
|
82
|
+
color: "primary"
|
|
83
|
+
})),
|
|
84
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
85
|
+
"data-ga-event-action": "click",
|
|
86
|
+
"data-ga-event-label": t('bundleSize'),
|
|
87
|
+
"data-ga-event-split": "0.1",
|
|
88
|
+
label: t('bundleSize')
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
}), headers.waiAria ? /*#__PURE__*/_jsx("li", {
|
|
92
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
93
|
+
clickable: true,
|
|
94
|
+
role: undefined,
|
|
95
|
+
component: "a",
|
|
96
|
+
size: "small",
|
|
97
|
+
variant: "outlined",
|
|
98
|
+
rel: "nofollow",
|
|
99
|
+
href: headers.waiAria,
|
|
100
|
+
icon: _W3CIcon || (_W3CIcon = /*#__PURE__*/_jsx(W3CIcon, {
|
|
101
|
+
color: "primary"
|
|
102
|
+
})),
|
|
103
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
104
|
+
"data-ga-event-action": "click",
|
|
105
|
+
"data-ga-event-label": "WAI-ARIA",
|
|
106
|
+
"data-ga-event-split": "0.1",
|
|
107
|
+
label: "WAI-ARIA"
|
|
108
|
+
})
|
|
109
|
+
}) : null, headers.materialDesign ? /*#__PURE__*/_jsx("li", {
|
|
110
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
111
|
+
clickable: true,
|
|
112
|
+
role: undefined,
|
|
113
|
+
component: "a",
|
|
114
|
+
size: "small",
|
|
115
|
+
variant: "outlined",
|
|
116
|
+
rel: "nofollow",
|
|
117
|
+
href: headers.materialDesign,
|
|
118
|
+
icon: _MaterialDesignIcon || (_MaterialDesignIcon = /*#__PURE__*/_jsx(MaterialDesignIcon, {})),
|
|
119
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
120
|
+
"data-ga-event-action": "click",
|
|
121
|
+
"data-ga-event-label": "Material Design",
|
|
122
|
+
"data-ga-event-split": "0.1",
|
|
123
|
+
label: "Material Design"
|
|
124
|
+
})
|
|
125
|
+
}) : null, design === false ? null : /*#__PURE__*/_jsxs(React.Fragment, {
|
|
126
|
+
children: [_li || (_li = /*#__PURE__*/_jsx("li", {
|
|
127
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
128
|
+
clickable: true,
|
|
129
|
+
role: undefined,
|
|
130
|
+
component: "a",
|
|
131
|
+
size: "small",
|
|
132
|
+
variant: "outlined",
|
|
133
|
+
rel: "nofollow",
|
|
134
|
+
href: "https://mui.com/store/items/figma-react/?utm_source=docs&utm_medium=referral&utm_campaign=component-link-header",
|
|
135
|
+
icon: /*#__PURE__*/_jsx(FigmaIcon, {}),
|
|
136
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
137
|
+
"data-ga-event-action": "click",
|
|
138
|
+
"data-ga-event-label": "Figma",
|
|
139
|
+
"data-ga-event-split": "0.1",
|
|
140
|
+
label: "Figma"
|
|
141
|
+
})
|
|
142
|
+
})), packageName === '@mui/joy' ? null : _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
143
|
+
children: [/*#__PURE__*/_jsx("li", {
|
|
144
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
145
|
+
clickable: true,
|
|
146
|
+
role: undefined,
|
|
147
|
+
component: "a",
|
|
148
|
+
size: "small",
|
|
149
|
+
variant: "outlined",
|
|
150
|
+
rel: "nofollow",
|
|
151
|
+
href: "https://mui.com/store/items/adobe-xd-react/?utm_source=docs&utm_medium=referral&utm_campaign=component-link-header",
|
|
152
|
+
icon: /*#__PURE__*/_jsx(AdobeXDIcon, {}),
|
|
153
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
154
|
+
"data-ga-event-action": "click",
|
|
155
|
+
"data-ga-event-label": "Adobe XD",
|
|
156
|
+
"data-ga-event-split": "0.1",
|
|
157
|
+
label: "Adobe"
|
|
158
|
+
})
|
|
159
|
+
}), /*#__PURE__*/_jsx("li", {
|
|
160
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
161
|
+
clickable: true,
|
|
162
|
+
role: undefined,
|
|
163
|
+
component: "a",
|
|
164
|
+
size: "small",
|
|
165
|
+
variant: "outlined",
|
|
166
|
+
rel: "nofollow",
|
|
167
|
+
href: "https://mui.com/store/items/sketch-react/?utm_source=docs&utm_medium=referral&utm_campaign=component-link-header",
|
|
168
|
+
icon: /*#__PURE__*/_jsx(SketchIcon, {}),
|
|
169
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
170
|
+
"data-ga-event-action": "click",
|
|
171
|
+
"data-ga-event-label": "Sketch",
|
|
172
|
+
"data-ga-event-split": "0.1",
|
|
173
|
+
label: "Sketch"
|
|
174
|
+
})
|
|
175
|
+
})]
|
|
176
|
+
}))]
|
|
177
|
+
})]
|
|
178
|
+
});
|
|
179
|
+
}
|
|
@@ -3,10 +3,12 @@ import { ButtonProps } from '@mui/material/Button';
|
|
|
3
3
|
import { SxProps } from '@mui/material/styles';
|
|
4
4
|
export interface HighlightedCodeProps {
|
|
5
5
|
code: string;
|
|
6
|
-
component?: React.ElementType;
|
|
7
6
|
copyButtonHidden?: boolean;
|
|
8
7
|
copyButtonProps?: ButtonProps;
|
|
9
8
|
language: string;
|
|
9
|
+
parentComponent?: React.ElementType;
|
|
10
|
+
preComponent?: React.ElementType;
|
|
11
|
+
plainStyle?: boolean;
|
|
10
12
|
sx?: SxProps;
|
|
11
13
|
}
|
|
12
14
|
export declare const HighlightedCode: React.ForwardRefExoticComponent<HighlightedCodeProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,19 +1,42 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["copyButtonHidden", "copyButtonProps", "code", "language", "plainStyle", "parentComponent", "preComponent"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import prism from '@mui/internal-markdown/prism';
|
|
6
6
|
import { NoSsr } from '@mui/base/NoSsr';
|
|
7
|
+
import { styled } from '@mui/material/styles';
|
|
7
8
|
import { useCodeCopy, CodeCopyButton } from '../CodeCopy';
|
|
8
9
|
import { MarkdownElement } from '../MarkdownElement';
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const Pre = styled('pre')(({
|
|
12
|
+
theme
|
|
13
|
+
}) => ({
|
|
14
|
+
margin: 0,
|
|
15
|
+
color: 'hsl(60deg 30% 96.08%)',
|
|
16
|
+
// fallback color until Prism's theme is loaded
|
|
17
|
+
WebkitOverflowScrolling: 'touch',
|
|
18
|
+
// iOS momentum scrolling.
|
|
19
|
+
maxWidth: 'calc(100vw - 32px)',
|
|
20
|
+
[theme.breakpoints.up('md')]: {
|
|
21
|
+
maxWidth: 'calc(100vw - 32px - 16px)'
|
|
22
|
+
},
|
|
23
|
+
'& code': _extends({}, theme.typography.caption, {
|
|
24
|
+
fontFamily: theme.typography.fontFamilyCode,
|
|
25
|
+
fontWeight: 400,
|
|
26
|
+
WebkitFontSmoothing: 'subpixel-antialiased'
|
|
27
|
+
// Reset for Safari
|
|
28
|
+
// https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
|
|
29
|
+
})
|
|
30
|
+
}));
|
|
10
31
|
export const HighlightedCode = /*#__PURE__*/React.forwardRef(function HighlightedCode(props, ref) {
|
|
11
32
|
const {
|
|
12
33
|
copyButtonHidden = false,
|
|
13
34
|
copyButtonProps,
|
|
14
35
|
code,
|
|
15
36
|
language,
|
|
16
|
-
|
|
37
|
+
plainStyle,
|
|
38
|
+
parentComponent: Component = plainStyle ? 'div' : MarkdownElement,
|
|
39
|
+
preComponent: PreComponent = plainStyle ? Pre : 'pre'
|
|
17
40
|
} = props,
|
|
18
41
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
19
42
|
const renderedCode = React.useMemo(() => {
|
|
@@ -30,7 +53,7 @@ export const HighlightedCode = /*#__PURE__*/React.forwardRef(function Highlighte
|
|
|
30
53
|
children: /*#__PURE__*/_jsx(CodeCopyButton, _extends({
|
|
31
54
|
code: code
|
|
32
55
|
}, copyButtonProps))
|
|
33
|
-
}), /*#__PURE__*/_jsx(
|
|
56
|
+
}), /*#__PURE__*/_jsx(PreComponent, {
|
|
34
57
|
children: /*#__PURE__*/_jsx("code", {
|
|
35
58
|
className: `language-${language}`
|
|
36
59
|
// eslint-disable-next-line react/no-danger
|
package/InfoCard/InfoCard.d.ts
CHANGED
package/InfoCard/InfoCard.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["classNameDescription", "classNameTitle", "
|
|
3
|
+
const _excluded = ["classNameDescription", "classNameTitle", "description", "icon", "link", "svg", "title", "titleProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { alpha } from '@mui/material/styles';
|
|
6
6
|
import Box from '@mui/material/Box';
|
|
@@ -13,8 +13,8 @@ export function GlowingIconContainer({
|
|
|
13
13
|
}) {
|
|
14
14
|
return /*#__PURE__*/_jsx(Box, {
|
|
15
15
|
sx: theme => _extends({
|
|
16
|
-
width:
|
|
17
|
-
height:
|
|
16
|
+
width: 36,
|
|
17
|
+
height: 36,
|
|
18
18
|
display: 'flex',
|
|
19
19
|
justifyContent: 'center',
|
|
20
20
|
alignItems: 'center',
|
|
@@ -23,10 +23,13 @@ export function GlowingIconContainer({
|
|
|
23
23
|
border: '1px solid',
|
|
24
24
|
borderColor: 'primary.200',
|
|
25
25
|
bgcolor: 'primary.50',
|
|
26
|
-
boxShadow: `0px 0 0 2px ${alpha(theme.palette.primary[500], 0.1)}, 0px 2px 12px 0px rgba(234, 237, 241, 0.3) inset
|
|
26
|
+
boxShadow: `0px 0 0 2px ${alpha(theme.palette.primary[500], 0.1)}, 0px 2px 12px 0px rgba(234, 237, 241, 0.3) inset`,
|
|
27
|
+
'& .MuiSvgIcon-root': {
|
|
28
|
+
fontSize: theme.typography.pxToRem(18)
|
|
29
|
+
}
|
|
27
30
|
}, theme.applyDarkStyles({
|
|
28
31
|
borderColor: alpha(theme.palette.primary[400], 0.25),
|
|
29
|
-
bgcolor: alpha(theme.palette.primary[900], 0.
|
|
32
|
+
bgcolor: alpha(theme.palette.primary[900], 0.2),
|
|
30
33
|
boxShadow: `0 0 0 2px ${alpha(theme.palette.primary[600], 0.1)}, 0px 2px 12px 0px rgba(0, 0, 0, 0.25) inset`
|
|
31
34
|
})),
|
|
32
35
|
children: icon
|
|
@@ -36,7 +39,6 @@ export function InfoCard(props) {
|
|
|
36
39
|
const {
|
|
37
40
|
classNameDescription,
|
|
38
41
|
classNameTitle,
|
|
39
|
-
dense,
|
|
40
42
|
description,
|
|
41
43
|
icon,
|
|
42
44
|
link,
|
|
@@ -55,7 +57,7 @@ export function InfoCard(props) {
|
|
|
55
57
|
prefetch: false
|
|
56
58
|
} : {}, {
|
|
57
59
|
sx: theme => _extends({
|
|
58
|
-
p:
|
|
60
|
+
p: 2.5,
|
|
59
61
|
height: '100%',
|
|
60
62
|
background: `${(theme.vars || theme).palette.gradients.linearSubtle}`
|
|
61
63
|
}, theme.applyDarkStyles({
|
|
@@ -67,7 +69,7 @@ export function InfoCard(props) {
|
|
|
67
69
|
children: [svg && svg, icon && /*#__PURE__*/_jsx(GlowingIconContainer, {
|
|
68
70
|
icon: icon
|
|
69
71
|
}), /*#__PURE__*/_jsx(Typography, _extends({
|
|
70
|
-
fontWeight: "
|
|
72
|
+
fontWeight: "semiBold",
|
|
71
73
|
component: "h3",
|
|
72
74
|
color: "text.primary",
|
|
73
75
|
variant: "body2",
|
|
@@ -218,20 +218,17 @@ export const getDesignTokens = mode => ({
|
|
|
218
218
|
},
|
|
219
219
|
body1: {
|
|
220
220
|
fontSize: defaultTheme.typography.pxToRem(16),
|
|
221
|
-
// 16px
|
|
222
221
|
lineHeight: 24 / 16,
|
|
223
222
|
letterSpacing: 0
|
|
224
223
|
},
|
|
225
224
|
body2: {
|
|
226
225
|
fontSize: defaultTheme.typography.pxToRem(14),
|
|
227
|
-
// 14px
|
|
228
226
|
lineHeight: 21 / 14,
|
|
229
227
|
letterSpacing: 0
|
|
230
228
|
},
|
|
231
229
|
caption: {
|
|
232
230
|
display: 'inline-block',
|
|
233
231
|
fontSize: defaultTheme.typography.pxToRem(12),
|
|
234
|
-
// 12px
|
|
235
232
|
lineHeight: 18 / 12,
|
|
236
233
|
letterSpacing: 0,
|
|
237
234
|
fontWeight: 700
|
|
@@ -380,7 +377,7 @@ export function getThemedComponents() {
|
|
|
380
377
|
transform: 'translateX(2px)'
|
|
381
378
|
}
|
|
382
379
|
}, ownerState.size === 'small' && {
|
|
383
|
-
padding: theme.spacing('6px', 1),
|
|
380
|
+
padding: theme.spacing('6px', 1.5),
|
|
384
381
|
fontFamily: theme.typography.fontFamily,
|
|
385
382
|
fontSize: defaultTheme.typography.pxToRem(13),
|
|
386
383
|
fontWeight: theme.typography.fontWeightSemiBold,
|
|
@@ -664,7 +661,8 @@ export function getThemedComponents() {
|
|
|
664
661
|
fontSize: theme.typography.pxToRem(14),
|
|
665
662
|
fontWeight: 500,
|
|
666
663
|
'&:hover, &:focus': {
|
|
667
|
-
backgroundColor: (theme.vars || theme).palette.grey[
|
|
664
|
+
backgroundColor: (theme.vars || theme).palette.grey[100],
|
|
665
|
+
color: (theme.vars || theme).palette.text.primary
|
|
668
666
|
},
|
|
669
667
|
'&:focus-visible': {
|
|
670
668
|
outline: 'none'
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ComponentLinkHeader = ComponentLinkHeader;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
10
|
+
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
11
|
+
var _ChatRounded2 = _interopRequireDefault(require("@mui/icons-material/ChatRounded"));
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
|
+
var _SketchIcon = _interopRequireDefault(require("../svgIcons/SketchIcon"));
|
|
14
|
+
var _FigmaIcon = _interopRequireDefault(require("../svgIcons/FigmaIcon"));
|
|
15
|
+
var _AdobeXDIcon = _interopRequireDefault(require("../svgIcons/AdobeXDIcon"));
|
|
16
|
+
var _BundleSizeIcon2 = _interopRequireDefault(require("../svgIcons/BundleSizeIcon"));
|
|
17
|
+
var _W3CIcon2 = _interopRequireDefault(require("../svgIcons/W3CIcon"));
|
|
18
|
+
var _MaterialDesignIcon2 = _interopRequireDefault(require("../svgIcons/MaterialDesignIcon"));
|
|
19
|
+
var _i18n = require("../i18n");
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
var _ChatRounded, _BundleSizeIcon, _W3CIcon, _MaterialDesignIcon, _li, _React$Fragment;
|
|
22
|
+
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); }
|
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
+
const Root = (0, _styles.styled)('ul')({
|
|
25
|
+
margin: 0,
|
|
26
|
+
padding: 0,
|
|
27
|
+
listStyle: 'none',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexWrap: 'wrap',
|
|
30
|
+
gap: 8,
|
|
31
|
+
'& .MuiChip-root': {
|
|
32
|
+
height: 26,
|
|
33
|
+
padding: '0 8px',
|
|
34
|
+
gap: 6,
|
|
35
|
+
'& .MuiChip-label': {
|
|
36
|
+
padding: 0
|
|
37
|
+
},
|
|
38
|
+
'& .MuiChip-iconSmall': {
|
|
39
|
+
margin: 0,
|
|
40
|
+
fontSize: 14
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const defaultPackageNames = {
|
|
45
|
+
'material-ui': '@mui/material',
|
|
46
|
+
'joy-ui': '@mui/joy',
|
|
47
|
+
'base-ui': '@mui/base',
|
|
48
|
+
system: '@mui/system'
|
|
49
|
+
};
|
|
50
|
+
function ComponentLinkHeader(props) {
|
|
51
|
+
var _ref, _headers$packageName;
|
|
52
|
+
const {
|
|
53
|
+
markdown: {
|
|
54
|
+
headers
|
|
55
|
+
},
|
|
56
|
+
design
|
|
57
|
+
} = props;
|
|
58
|
+
const t = (0, _i18n.useTranslate)();
|
|
59
|
+
const packageName = (_ref = (_headers$packageName = headers.packageName) != null ? _headers$packageName : defaultPackageNames[headers.productId]) != null ? _ref : '@mui/material';
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, {
|
|
61
|
+
children: [headers.githubLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
62
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
|
|
63
|
+
clickable: true,
|
|
64
|
+
role: undefined,
|
|
65
|
+
component: "a",
|
|
66
|
+
size: "small",
|
|
67
|
+
variant: "outlined",
|
|
68
|
+
rel: "nofollow",
|
|
69
|
+
href: `${process.env.SOURCE_CODE_REPO}/labels/${encodeURIComponent(headers.githubLabel)}`,
|
|
70
|
+
icon: _ChatRounded || (_ChatRounded = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatRounded2.default, {
|
|
71
|
+
color: "primary"
|
|
72
|
+
})),
|
|
73
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
74
|
+
"data-ga-event-action": "click",
|
|
75
|
+
"data-ga-event-label": t('githubLabel'),
|
|
76
|
+
"data-ga-event-split": "0.1",
|
|
77
|
+
label: t('githubLabel')
|
|
78
|
+
})
|
|
79
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
80
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
81
|
+
title: t('bundleSizeTooltip'),
|
|
82
|
+
describeChild: true,
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
|
|
84
|
+
clickable: true,
|
|
85
|
+
role: undefined,
|
|
86
|
+
component: "a",
|
|
87
|
+
size: "small",
|
|
88
|
+
variant: "outlined",
|
|
89
|
+
rel: "nofollow",
|
|
90
|
+
href: `https://bundlephobia.com/package/${packageName}@latest`,
|
|
91
|
+
icon: _BundleSizeIcon || (_BundleSizeIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_BundleSizeIcon2.default, {
|
|
92
|
+
color: "primary"
|
|
93
|
+
})),
|
|
94
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
95
|
+
"data-ga-event-action": "click",
|
|
96
|
+
"data-ga-event-label": t('bundleSize'),
|
|
97
|
+
"data-ga-event-split": "0.1",
|
|
98
|
+
label: t('bundleSize')
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
}), headers.waiAria ? /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
102
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
|
|
103
|
+
clickable: true,
|
|
104
|
+
role: undefined,
|
|
105
|
+
component: "a",
|
|
106
|
+
size: "small",
|
|
107
|
+
variant: "outlined",
|
|
108
|
+
rel: "nofollow",
|
|
109
|
+
href: headers.waiAria,
|
|
110
|
+
icon: _W3CIcon || (_W3CIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_W3CIcon2.default, {
|
|
111
|
+
color: "primary"
|
|
112
|
+
})),
|
|
113
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
114
|
+
"data-ga-event-action": "click",
|
|
115
|
+
"data-ga-event-label": "WAI-ARIA",
|
|
116
|
+
"data-ga-event-split": "0.1",
|
|
117
|
+
label: "WAI-ARIA"
|
|
118
|
+
})
|
|
119
|
+
}) : null, headers.materialDesign ? /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
120
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
|
|
121
|
+
clickable: true,
|
|
122
|
+
role: undefined,
|
|
123
|
+
component: "a",
|
|
124
|
+
size: "small",
|
|
125
|
+
variant: "outlined",
|
|
126
|
+
rel: "nofollow",
|
|
127
|
+
href: headers.materialDesign,
|
|
128
|
+
icon: _MaterialDesignIcon || (_MaterialDesignIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_MaterialDesignIcon2.default, {})),
|
|
129
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
130
|
+
"data-ga-event-action": "click",
|
|
131
|
+
"data-ga-event-label": "Material Design",
|
|
132
|
+
"data-ga-event-split": "0.1",
|
|
133
|
+
label: "Material Design"
|
|
134
|
+
})
|
|
135
|
+
}) : null, design === false ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
136
|
+
children: [_li || (_li = /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
137
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
|
|
138
|
+
clickable: true,
|
|
139
|
+
role: undefined,
|
|
140
|
+
component: "a",
|
|
141
|
+
size: "small",
|
|
142
|
+
variant: "outlined",
|
|
143
|
+
rel: "nofollow",
|
|
144
|
+
href: "https://mui.com/store/items/figma-react/?utm_source=docs&utm_medium=referral&utm_campaign=component-link-header",
|
|
145
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FigmaIcon.default, {}),
|
|
146
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
147
|
+
"data-ga-event-action": "click",
|
|
148
|
+
"data-ga-event-label": "Figma",
|
|
149
|
+
"data-ga-event-split": "0.1",
|
|
150
|
+
label: "Figma"
|
|
151
|
+
})
|
|
152
|
+
})), packageName === '@mui/joy' ? null : _React$Fragment || (_React$Fragment = /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
153
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
154
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
|
|
155
|
+
clickable: true,
|
|
156
|
+
role: undefined,
|
|
157
|
+
component: "a",
|
|
158
|
+
size: "small",
|
|
159
|
+
variant: "outlined",
|
|
160
|
+
rel: "nofollow",
|
|
161
|
+
href: "https://mui.com/store/items/adobe-xd-react/?utm_source=docs&utm_medium=referral&utm_campaign=component-link-header",
|
|
162
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AdobeXDIcon.default, {}),
|
|
163
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
164
|
+
"data-ga-event-action": "click",
|
|
165
|
+
"data-ga-event-label": "Adobe XD",
|
|
166
|
+
"data-ga-event-split": "0.1",
|
|
167
|
+
label: "Adobe"
|
|
168
|
+
})
|
|
169
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
170
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
|
|
171
|
+
clickable: true,
|
|
172
|
+
role: undefined,
|
|
173
|
+
component: "a",
|
|
174
|
+
size: "small",
|
|
175
|
+
variant: "outlined",
|
|
176
|
+
rel: "nofollow",
|
|
177
|
+
href: "https://mui.com/store/items/sketch-react/?utm_source=docs&utm_medium=referral&utm_campaign=component-link-header",
|
|
178
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SketchIcon.default, {}),
|
|
179
|
+
"data-ga-event-category": "ComponentLinkHeader",
|
|
180
|
+
"data-ga-event-action": "click",
|
|
181
|
+
"data-ga-event-label": "Sketch",
|
|
182
|
+
"data-ga-event-split": "0.1",
|
|
183
|
+
label: "Sketch"
|
|
184
|
+
})
|
|
185
|
+
})]
|
|
186
|
+
}))]
|
|
187
|
+
})]
|
|
188
|
+
});
|
|
189
|
+
}
|