Skip to content

Commit 796efd0

Browse files
committed
chore(docs): Enable rust compiler by removing custom babelrc
1 parent 3157a7b commit 796efd0

45 files changed

Lines changed: 274 additions & 302 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/documentation/.babelrc

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/documentation/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
"@types/prismjs": "^1.16.6",
5353
"@types/qs": "^6.9.7",
5454
"@types/react-virtualized": "^9.21.13",
55-
"babel-plugin-inline-react-svg": "^2.0.1",
56-
"babel-plugin-prismjs": "^2.1.0",
5755
"cross-env": "^7.0.3",
5856
"eslint-config-next": "^11.1.2",
5957
"npm-run-all": "^4.1.5",

packages/documentation/src/components/CodeBlock/utils.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
import { highlight, languages } from "prismjs";
2+
import "prismjs/components/prism-javascript";
3+
import "prismjs/components/prism-jsx";
4+
import "prismjs/components/prism-typescript";
5+
import "prismjs/components/prism-tsx";
6+
import "prismjs/components/prism-css";
7+
import "prismjs/components/prism-scss";
8+
import "prismjs/components/prism-css-extras";
9+
import "prismjs/components/prism-markup";
10+
import "prismjs/components/prism-markdown";
11+
import "prismjs/components/prism-bash";
12+
import "prismjs/components/prism-git";
13+
import "prismjs/components/prism-diff";
14+
import "prismjs/components/prism-json";
15+
import "prismjs/components/prism-properties";
216
import {
317
DangerouslyHighlightCode,
418
GetCodeLanguage,

packages/documentation/src/components/Demos/Tree/CustomizingTreeItems.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "@react-md/tree";
1616

1717
import FileSVGIcon from "icons/FileSVGIcon";
18-
import HTML5SVGIcon from "icons/HTML5SVGIcon";
18+
import Html5SVGIcon from "icons/Html5SVGIcon";
1919
import SassSVGIcon from "icons/SassSVGIcon";
2020
import TypescriptSVGIcon from "icons/TypescriptSVGIcon";
2121
import createIdGenerator from "utils/createIdGenerator";
@@ -72,7 +72,7 @@ const getItemProps: GetItemProps<Item> = (item) => {
7272
leftAddon = expanded ? <FolderOpenSVGIcon /> : <FolderSVGIcon />;
7373
break;
7474
case "html":
75-
leftAddon = <HTML5SVGIcon />;
75+
leftAddon = <Html5SVGIcon />;
7676
break;
7777
case "text":
7878
leftAddon = <FileSVGIcon />;

packages/documentation/src/components/Home/Components.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { ReactElement } from "react";
2+
import Image from "next/image";
23
import {
34
CardHeader,
45
CardTitle,
@@ -13,7 +14,7 @@ import Code from "components/Code";
1314
import CodeBlock from "components/CodeBlock";
1415
import LinkButton from "components/LinkButton";
1516

16-
import { Component as SVG } from "./components.svg";
17+
import components from "./components.svg";
1718
import JumpStartCard from "./JumpStartCard";
1819

1920
export default function Components(): ReactElement {
@@ -23,7 +24,7 @@ export default function Components(): ReactElement {
2324
<CardTitle>Components and Styles</CardTitle>
2425
</CardHeader>
2526
<MediaContainer fullWidth>
26-
<SVG role="presentation" />
27+
<Image src={components} />
2728
</MediaContainer>
2829
<CardContent disableSecondaryColor>
2930
<Text>

packages/documentation/src/components/Home/Customization.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { ReactElement } from "react";
2+
import Image from "next/image";
23
import {
34
CardHeader,
45
CardTitle,
@@ -12,7 +13,7 @@ import { Text } from "@react-md/typography";
1213
import Code from "components/Code";
1314
import LinkButton from "components/LinkButton";
1415

15-
import { Component as SVG } from "./customization.svg";
16+
import customization from "./customization.svg";
1617
import JumpStartCard from "./JumpStartCard";
1718

1819
export default function GettingStarted(): ReactElement {
@@ -22,7 +23,7 @@ export default function GettingStarted(): ReactElement {
2223
<CardTitle>Customization and Themes</CardTitle>
2324
</CardHeader>
2425
<MediaContainer fullWidth>
25-
<SVG role="presentation" />
26+
<Image src={customization} />
2627
</MediaContainer>
2728
<CardContent disableSecondaryColor>
2829
<Text>

packages/documentation/src/components/Home/GettingStarted.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { ReactElement } from "react";
2+
import Image from "next/image";
23
import {
34
CardHeader,
45
CardTitle,
@@ -13,7 +14,7 @@ import Code from "components/Code";
1314
import LinkButton from "components/LinkButton";
1415

1516
import JumpStartCard from "./JumpStartCard";
16-
import { Component as SVG } from "./getting-started.svg";
17+
import gettingStarted from "./getting-started.svg";
1718

1819
export default function GettingStarted(): ReactElement {
1920
return (
@@ -22,7 +23,7 @@ export default function GettingStarted(): ReactElement {
2223
<CardTitle>Getting Started</CardTitle>
2324
</CardHeader>
2425
<MediaContainer fullWidth>
25-
<SVG role="presentation" />
26+
<Image src={gettingStarted} />
2627
</MediaContainer>
2728
<CardContent disableSecondaryColor>
2829
<Text>
Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
import React, { ReactElement } from "react";
2-
import cn from "classnames";
3-
import { SVGIconProps } from "@react-md/icon";
4-
import { Component as CodeSandboxIcon } from "./codesandbox.svg";
2+
import { SVGIcon, SVGIconProps } from "@react-md/icon";
53

6-
export default function CodeSandboxSVGIcon({
7-
className,
8-
...props
9-
}: SVGIconProps): ReactElement {
4+
export default function CodeSandboxSVGIcon(props: SVGIconProps): ReactElement {
105
return (
11-
<CodeSandboxIcon
12-
{...props}
13-
className={cn("rmd-icon rmd-icon--svg", className)}
14-
/>
6+
<SVGIcon {...props} viewBox="0 0 512 512">
7+
<path d="M69.2898098,165.083974 L69.2898098,276.649443 L152.161311,324.692718 L152.161311,412.603224 L241.327633,463.829131 L241.327633,264.06328 L69.2898098,165.083974 Z M89.0172642,137.098529 L260.121958,235.540974 L427.640018,138.456525 L339.210941,87.2017661 L262.258901,131.853758 L179.736828,84.2839889 L89.0172642,137.098529 Z M272.206216,463.739666 L370.845646,406.905256 L370.845646,322.809124 L444.244039,280.276172 L444.244039,167.397587 L272.206216,266.116045 L272.206216,463.739666 Z M255.633239,512 L34,384.729507 L34,128.977638 L255.644267,0 L477.328236,128.432852 L477.328236,384.321468 L255.633239,512 Z"></path>
8+
</SVGIcon>
159
);
1610
}
17-
18-
CodeSandboxSVGIcon.defaultProps = {
19-
role: "img",
20-
focusable: "false",
21-
};
Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
import React, { ReactElement } from "react";
2-
import cn from "classnames";
3-
import { SVGIconProps } from "@react-md/icon";
2+
import { SVGIcon, SVGIconProps } from "@react-md/icon";
43

5-
import { Component as HtmlSVG } from "./html.svg";
6-
7-
export default function HtmlIcon({
8-
className,
9-
...props
10-
}: SVGIconProps): ReactElement | null {
4+
export default function HtmlIcon(props: SVGIconProps): ReactElement {
115
return (
12-
<HtmlSVG {...props} className={cn("rmd-icon rmd-icon--svg", className)} />
6+
<SVGIcon {...props} viewBox="0 0 72 96">
7+
<path
8+
fill="#72a536"
9+
d="M0 2v92c0 1.1.9 2 2 2h68c1.1 0 2-.9 2-2V28H50c-1.1 0-2-.9-2-2V0H2C.9 0 0 .9 0 2z"
10+
/>
11+
<path fill="#72a536" d="M71.9 24c-.1-.4-.2-.7-.4-1L52 1.2V24h19.9z" />
12+
<path
13+
d="M6 41h60v49H6V41zm6.5-34.9c1.3 0 2.6.4 3.6 1.2l-1.4 2.8c-.4-.5-1.3-.9-2.1-.9-2.1 0-3.2 1.9-3.2 4.2s1.2 4.4 3.2 4.4c1 0 1.7-.5 2.3-1l1.4 2.8c-.9.7-2 1.3-3.9 1.3-4 0-6.3-3.1-6.3-7.4-.1-4.2 2.3-7.4 6.4-7.4zm7.2 10.6c.6.6 1.4 1.2 2.3 1.2s1.3-.6 1.3-1.2c0-2-4.8-2.1-4.8-6.2 0-2.4 1.7-4.3 4.5-4.3 1.2 0 2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.9-2.5 1.2-.7.2-1.9.4-3.5.4h-1v-4.1c1.3 0 2.1-.1 2.6-.3s.7-.4.9-.6c.2-.3.3-.7.3-1.5 0-.6.1-2 .2-4 .1-1.2.3-2.1.5-2.8.3-.7.6-1.3 1.1-1.9.4-.5 1-.9 1.7-1.3-.9-.6-1.6-1.1-2-1.6-.5-.7-1-1.8-1.2-2.8-.2-.8-.3-2.6-.3-5.2 0-.8-.1-1.4-.3-1.8-.2-.3-.4-.5-.8-.6-.2-.3-1-.3-2.5-.3v-4h1c1.6 0 2.9.1 3.7.4.9.3 1.6.6 2.2 1.2s1 1.2 1.2 2 .4 2.1.4 4c0 2 .1 3.4.3 4.1.3.9.7 1.6 1.2 1.9.5.4 1.4.6 2.5.6.1.1 0 4.3 0 4.3z"
18+
fill="#72a536"
19+
stroke="#72a536"
20+
strokeMiterlimit="10"
21+
/>
22+
</SVGIcon>
1323
);
1424
}
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// source: https://ionicons.com/
22
import React, { ReactElement } from "react";
3-
import cn from "classnames";
4-
import { SVGIconProps } from "@react-md/icon";
3+
import { SVGIcon, SVGIconProps } from "@react-md/icon";
54

6-
import { Component as FileSVG } from "./file.svg";
7-
8-
export default function FileSVGIcon({
9-
className,
10-
...props
11-
}: SVGIconProps): ReactElement {
5+
export default function FileSVGIcon(props: SVGIconProps): ReactElement {
126
return (
13-
<FileSVG {...props} className={cn("rmd-icon rmd-icon--svg", className)} />
7+
<SVGIcon {...props} viewBox="0 0 512 512">
8+
<path d="M288 48H136c-22.092 0-40 17.908-40 40v336c0 22.092 17.908 40 40 40h240c22.092 0 40-17.908 40-40V176L288 48zm-16 144V80l112 112H272z" />
9+
</SVGIcon>
1410
);
1511
}

0 commit comments

Comments
 (0)