Visualize Your Ideas With Code
feat(docs): visual changes
aarthificialbe83edf847fb
diff --git a/package-lock.json b/package-lock.jsonindex 3e0412e6..b38fefb4 100644--- a/package-lock.json+++ b/package-lock.json@@ -16208,6 +16208,25 @@"node": ">= 0.8"}},+ "node_modules/raw-loader": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz",+ "integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==",+ "dependencies": {+ "loader-utils": "^2.0.0",+ "schema-utils": "^3.0.0"+ },+ "engines": {+ "node": ">= 10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ },+ "peerDependencies": {+ "webpack": "^4.0.0 || ^5.0.0"+ }+ },"node_modules/rc": {"version": "1.2.8","license": "(BSD-2-Clause OR MIT OR Apache-2.0)",@@ -20220,13 +20239,13 @@},"packages/2d": {"name": "@motion-canvas/2d",- "version": "12.0.0-alpha.2",+ "version": "12.0.0-alpha.4","license": "MIT","dependencies": {"code-fns": "^0.7.0"},"devDependencies": {- "@motion-canvas/core": "^12.0.0-alpha.2",+ "@motion-canvas/core": "^12.0.0-alpha.4","typescript": "^4.7.4"},"peerDependencies": {@@ -20235,7 +20254,7 @@},"packages/core": {"name": "@motion-canvas/core",- "version": "12.0.0-alpha.2",+ "version": "12.0.0-alpha.4","license": "MIT","dependencies": {"@types/chroma-js": "^2.1.4",@@ -20259,7 +20278,7 @@},"packages/create": {"name": "@motion-canvas/create",- "version": "12.0.0-alpha.2",+ "version": "12.0.0-alpha.4","license": "MIT","dependencies": {"prompts": "^2.4.2"@@ -20268,9 +20287,10 @@"create-motion-canvas": "index.js"},"devDependencies": {- "@motion-canvas/core": "^12.0.0-alpha.2",- "@motion-canvas/ui": "^12.0.0-alpha.2",- "@motion-canvas/vite-plugin": "^12.0.0-alpha.0"+ "@motion-canvas/2d": "^12.0.0-alpha.4",+ "@motion-canvas/core": "^12.0.0-alpha.4",+ "@motion-canvas/ui": "^12.0.0-alpha.4",+ "@motion-canvas/vite-plugin": "^12.0.0-alpha.3"}},"packages/docs": {@@ -20284,6 +20304,7 @@"@motion-canvas/player": "*","clsx": "^1.2.0","prism-react-renderer": "^1.3.5",+ "raw-loader": "^4.0.2","react": "^17.0.2","react-dom": "^17.0.2"},@@ -20314,10 +20335,10 @@},"packages/player": {"name": "@motion-canvas/player",- "version": "0.0.0",+ "version": "12.0.0-alpha.4","license": "MIT","devDependencies": {- "@motion-canvas/core": "^12.0.0-alpha.2",+ "@motion-canvas/core": "^12.0.0-alpha.4","terser": "^5.16.1","typescript": "^4.6.4","vite": "^3.0.4"@@ -20342,10 +20363,10 @@},"packages/ui": {"name": "@motion-canvas/ui",- "version": "12.0.0-alpha.2",+ "version": "12.0.0-alpha.4","license": "MIT","devDependencies": {- "@motion-canvas/core": "^12.0.0-alpha.2",+ "@motion-canvas/core": "^12.0.0-alpha.4","@preact/preset-vite": "^2.3.0","preact": "10.7.3","source-map-js": "^1.0.2",@@ -20367,7 +20388,7 @@},"packages/vite-plugin": {"name": "@motion-canvas/vite-plugin",- "version": "12.0.0-alpha.0",+ "version": "12.0.0-alpha.3","license": "MIT","dependencies": {"mime-types": "^2.1.35"@@ -23436,7 +23457,7 @@"@motion-canvas/2d": {"version": "file:packages/2d","requires": {- "@motion-canvas/core": "^12.0.0-alpha.2",+ "@motion-canvas/core": "^12.0.0-alpha.4","code-fns": "^0.7.0","typescript": "^4.7.4"}@@ -23461,9 +23482,10 @@"@motion-canvas/create": {"version": "file:packages/create","requires": {- "@motion-canvas/core": "^12.0.0-alpha.2",- "@motion-canvas/ui": "^12.0.0-alpha.2",- "@motion-canvas/vite-plugin": "^12.0.0-alpha.0",+ "@motion-canvas/2d": "^12.0.0-alpha.4",+ "@motion-canvas/core": "^12.0.0-alpha.4",+ "@motion-canvas/ui": "^12.0.0-alpha.4",+ "@motion-canvas/vite-plugin": "^12.0.0-alpha.3","prompts": "^2.4.2"}},@@ -23480,6 +23502,7 @@"clsx": "^1.2.0","docusaurus-plugin-typedoc": "^0.17.5","prism-react-renderer": "^1.3.5",+ "raw-loader": "*","react": "^17.0.2","react-dom": "^17.0.2","typedoc": "^0.23.7",@@ -23500,8 +23523,8 @@"@motion-canvas/player": {"version": "file:packages/player","requires": {- "@motion-canvas/core": "^12.0.0-alpha.2",- "terser": "*",+ "@motion-canvas/core": "^12.0.0-alpha.4",+ "terser": "^5.16.1","typescript": "^4.6.4","vite": "^3.0.4"}@@ -23519,7 +23542,7 @@"@motion-canvas/ui": {"version": "file:packages/ui","requires": {- "@motion-canvas/core": "^12.0.0-alpha.2",+ "@motion-canvas/core": "^12.0.0-alpha.4","@preact/preset-vite": "^2.3.0","preact": "10.7.3","source-map-js": "^1.0.2",@@ -30763,6 +30786,15 @@}}},+ "raw-loader": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz",+ "integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==",+ "requires": {+ "loader-utils": "^2.0.0",+ "schema-utils": "^3.0.0"+ }+ },"rc": {"version": "1.2.8","requires": {diff --git a/packages/docs/docs/guides/getting-started/_category_.yml b/packages/docs/docs/guides/getting-started/_category_.ymlindex 00cc5db1..d8b9da3d 100644--- a/packages/docs/docs/guides/getting-started/_category_.yml+++ b/packages/docs/docs/guides/getting-started/_category_.yml@@ -1,4 +1,2 @@label: Getting Startedposition: 2-link:- type: generated-indexdiff --git a/packages/docs/docs/guides/getting-started/quickstart.mdx b/packages/docs/docs/guides/getting-started/quickstart.mdxindex 4228ef7a..656a110a 100644--- a/packages/docs/docs/guides/getting-started/quickstart.mdx+++ b/packages/docs/docs/guides/getting-started/quickstart.mdx@@ -2,7 +2,7 @@sidebar_position: 1----import '@motion-canvas/player';+import AnimationPlayer from '@site/src/components/AnimationPlayer';# Quickstart@@ -93,11 +93,7 @@ reflected in the preview. You should see a gray circle in the preview pane atthe top right of the web application. Press the play button to see the circleanimate across the screen.-<motion-canvas-player-style={{maxWidth: 480}}-quality={0.5}-src="/examples/quickstart.js"-/>+<AnimationPlayer small name="quickstart" />Depending on the size of your browser, you may want to zoom the preview out byscrolling down on your mouse wheel while hovering over the preview panel.diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.jsindex 0d68e8a7..6f033955 100644--- a/packages/docs/docusaurus.config.js+++ b/packages/docs/docusaurus.config.js@@ -115,6 +115,7 @@ const config = {routeBasePath: '/',sidebarPath: 'sidebars.js',exclude: ['**/core-api/*.md', '**/2d-api/*.md'],+ showLastUpdateAuthor: true,editUrl: ({versionDocsDirPath, docPath}) =>`https://github.com/motion-canvas/motion-canvas/blob/main/${versionDocsDirPath}/${docPath}`,},diff --git a/packages/docs/package.json b/packages/docs/package.jsonindex 4fa1df9c..d65e046a 100644--- a/packages/docs/package.json+++ b/packages/docs/package.json@@ -4,7 +4,7 @@"private": true,"scripts": {"docusaurus": "docusaurus",- "start": "docusaurus start",+ "start": "docusaurus start --no-open","build": "docusaurus build","swizzle": "docusaurus swizzle","deploy": "docusaurus deploy",@@ -22,6 +22,7 @@"@motion-canvas/player": "*","clsx": "^1.2.0","prism-react-renderer": "^1.3.5",+ "raw-loader": "^4.0.2","react": "^17.0.2","react-dom": "^17.0.2"},diff --git a/packages/docs/src/Icon/Code/index.tsx b/packages/docs/src/Icon/Code/index.tsxnew file mode 100644index 00000000..ff23e8c3--- /dev/null+++ b/packages/docs/src/Icon/Code/index.tsx@@ -0,0 +1,22 @@+import React, {ComponentProps} from 'react';++export default function IconCode({+ width = 24,+ height = 24,+ ...props+}: ComponentProps<'svg'>): JSX.Element {+ return (+ <svg+ viewBox="0 0 24 24"+ width={width}+ height={height}+ aria-hidden+ {...props}+ >+ <path+ d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"+ fill="currentColor"+ />+ </svg>+ );+}diff --git a/packages/docs/src/components/AnimationPlayer/AnimationLink.tsx b/packages/docs/src/components/AnimationPlayer/AnimationLink.tsxnew file mode 100644index 00000000..44e8a5be--- /dev/null+++ b/packages/docs/src/components/AnimationPlayer/AnimationLink.tsx@@ -0,0 +1,19 @@+import React from 'react';+import styles from './styles.module.css';+import IconCode from '@site/src/Icon/Code';+import Link from '@docusaurus/Link';+import clsx from 'clsx';++export interface AnimationLinkProps {+ name: string;+}++export default function AnimationLink({name}: AnimationLinkProps) {+ const url = `https://github.com/motion-canvas/motion-canvas/blob/main/examples/src/scenes/${name}.tsx`;+ return (+ <Link to={url} className={clsx('padding--sm', styles.link)}>+ <span>View source code</span>+ <IconCode className={styles.icon} />+ </Link>+ );+}diff --git a/packages/docs/src/components/AnimationPlayer/index.tsx b/packages/docs/src/components/AnimationPlayer/index.tsxnew file mode 100644index 00000000..10580405--- /dev/null+++ b/packages/docs/src/components/AnimationPlayer/index.tsx@@ -0,0 +1,44 @@+import '@motion-canvas/player';+import type {MotionCanvasPlayerProps} from '@motion-canvas/player';+import React, {ComponentProps} from 'react';+import styles from './styles.module.css';+import AnimationLink from './AnimationLink';+import clsx from 'clsx';++declare global {+ // eslint-disable-next-line @typescript-eslint/no-namespace+ namespace JSX {+ interface IntrinsicElements {+ 'motion-canvas-player': MotionCanvasPlayerProps & ComponentProps<'div'>;+ }+ }+}++export interface AnimationBannerProps {+ banner?: boolean;+ small?: boolean;+ name: string;+}++export default function AnimationPlayer({+ name,+ banner,+ small,+}: AnimationBannerProps) {+ return (+ <div+ className={clsx(+ styles.container,+ banner && styles.banner,+ small && styles.small,+ )}+ >+ <motion-canvas-player+ class={styles.player}+ src={`/examples/${name}.js`}+ auto={banner}+ />+ <AnimationLink name={name} />+ </div>+ );+}diff --git a/packages/docs/src/components/AnimationPlayer/styles.module.css b/packages/docs/src/components/AnimationPlayer/styles.module.cssnew file mode 100644index 00000000..c10b1e0c--- /dev/null+++ b/packages/docs/src/components/AnimationPlayer/styles.module.css@@ -0,0 +1,61 @@+.container {+ width: 100%;+ overflow: hidden;+ border-radius: var(--ifm-global-radius);+ background-color: var(--ifm-background-color);+ position: relative;+ aspect-ratio: 16 / 9;+ border: 1px solid var(--ifm-color-emphasis-300);+}++.container.small {+ max-width: 480px;+ margin: 0 auto var(--ifm-leading);+}++.banner {+ aspect-ratio: 3;+ display: flex;+ align-items: center;+ justify-content: center;+ min-height: min(56vw, 320px);+}++.player {+ aspect-ratio: 16 / 9;+}++.banner .player {+ min-width: min(150vw, 960px);+}++.link {+ position: absolute;+ right: 0;+ bottom: 0;+ display: block;+ opacity: 0.54;+ transition: opacity 0.1s;+}++.link span {+ opacity: 0;+ transition: opacity 0.1s;+}++.link:focus,+.link:hover,+.container:hover .player[data-overlay] + .link {+ opacity: 1;+}++.link:focus span,+.link:hover span,+.container:hover .player[data-overlay] + .link span {+ opacity: 1;+}++.icon {+ margin-bottom: -0.4rem;+ margin-left: 0.3rem;+}diff --git a/packages/docs/src/css/custom.css b/packages/docs/src/css/custom.cssindex a1cbf296..5aa5e269 100644--- a/packages/docs/src/css/custom.css+++ b/packages/docs/src/css/custom.css@@ -13,10 +13,14 @@--ifm-color-primary-light: #33925d;--ifm-color-primary-lighter: #359962;--ifm-color-primary-lightest: #3cad6e;- --ifm-code-font-size: 95%;--ifm-background-color: #eee;--ifm-background-surface-color: #fff;--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);+ --ifm-global-radius: 4px;+ --ifm-font-family-base: Roboto, Noto Sans, system-ui, -apple-system, Segoe UI,+ sans-serif;+ --ifm-font-family-monospace: JetBrains Mono, Consolas, monospace;+ --ifm-pre-line-height: 1.6;}/* For readability concerns, you should choose a lighter palette in dark mode. */@@ -31,6 +35,16 @@ html[data-theme='dark'] {--ifm-background-color: #141414;--ifm-background-surface-color: #242424;--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);++ --ifm-color-secondary-dark: #fff;+ --ifm-color-success-dark: #55c244;+ --ifm-color-info-dark: #4cb3d4;+ --ifm-color-warning-dark: #e6a700;+ --ifm-color-danger-dark: #e13238;+}++.alert {+ background-color: var(--ifm-background-surface-color);}.footer--dark {@@ -45,12 +59,3 @@ a.button:hover {color: var(--ifm-button-color);text-decoration: none;}--motion-canvas-player {- overflow: hidden;- width: 100%;- aspect-ratio: 16 / 9;- margin: 0 auto var(--ifm-leading);- border-radius: var(--ifm-global-radius);- background-color: var(--ifm-background-surface-color);-}diff --git a/packages/docs/src/theme/Admonition/index.tsx b/packages/docs/src/theme/Admonition/index.tsxnew file mode 100644index 00000000..b7257e24--- /dev/null+++ b/packages/docs/src/theme/Admonition/index.tsx@@ -0,0 +1,28 @@+import React, {useMemo} from 'react';+import Admonition from '@theme-original/Admonition';+import styles from './styles.module.css';+import IconInfo from '@site/src/theme/Icon/Info';+import IconWarning from '@site/src/theme/Icon/Warning';+import IconDanger from '@site/src/theme/Icon/Danger';+import IconLightBulb from '@site/src/theme/Icon/LightBulb';++export default function AdmonitionWrapper(props) {+ const Icon = useMemo(() => {+ switch (props.type) {+ case 'tip':+ return IconLightBulb;+ case 'caution':+ return IconWarning;+ case 'danger':+ return IconDanger;+ default:+ return IconInfo;+ }+ }, [props.type]);++ return (+ <>+ <Admonition icon={<Icon className={styles.icon} />} {...props} />+ </>+ );+}diff --git a/packages/docs/src/theme/Admonition/styles.module.css b/packages/docs/src/theme/Admonition/styles.module.cssnew file mode 100644index 00000000..50751bb9--- /dev/null+++ b/packages/docs/src/theme/Admonition/styles.module.css@@ -0,0 +1,4 @@+span .icon {+ width: 24px;+ height: 24px;+}diff --git a/packages/docs/src/theme/Icon/Arrow/index.tsx b/packages/docs/src/theme/Icon/Arrow/index.tsxnew file mode 100644index 00000000..cb36b895--- /dev/null+++ b/packages/docs/src/theme/Icon/Arrow/index.tsx@@ -0,0 +1,11 @@+import React from 'react';+export default function IconArrow(props) {+ return (+ <svg width="20" height="20" aria-hidden="true" {...props}>+ <g fill="#7a7a7a">+ <path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0" />+ <path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0" />+ </g>+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/Close/index.tsx b/packages/docs/src/theme/Icon/Close/index.tsxnew file mode 100644index 00000000..7445fd04--- /dev/null+++ b/packages/docs/src/theme/Icon/Close/index.tsx@@ -0,0 +1,27 @@+/**+ * Copyright (c) Facebook, Inc. and its affiliates.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++import React from 'react';+import type {Props} from '@theme/Icon/Close';++export default function IconClose({+ width = 24,+ height = 24,+ color = 'currentColor',+ strokeWidth = 1.2,+ className,+ ...restProps+}: Props): JSX.Element {+ return (+ <svg viewBox="0 0 24 24" width={width} height={height} {...restProps}>+ <path+ d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"+ fill={color}+ />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/Danger/index.tsx b/packages/docs/src/theme/Icon/Danger/index.tsxnew file mode 100644index 00000000..0f50f51d--- /dev/null+++ b/packages/docs/src/theme/Icon/Danger/index.tsx@@ -0,0 +1,9 @@+import React, {ComponentProps} from 'react';++export default function IconDanger(props: ComponentProps<'svg'>): JSX.Element {+ return (+ <svg viewBox="0 0 24 24" fill="currentColor" {...props}>+ <path d="M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM12 17.3c-.72 0-1.3-.58-1.3-1.3 0-.72.58-1.3 1.3-1.3.72 0 1.3.58 1.3 1.3 0 .72-.58 1.3-1.3 1.3zm1-4.3h-2V7h2v6z" />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/DarkMode/index.tsx b/packages/docs/src/theme/Icon/DarkMode/index.tsxnew file mode 100644index 00000000..3e47e17c--- /dev/null+++ b/packages/docs/src/theme/Icon/DarkMode/index.tsx@@ -0,0 +1,14 @@+import React from 'react';+export default function IconDarkMode(props) {+ return (+ <svg+ height="24px"+ width="24px"+ viewBox="0 0 24 24"+ fill="currentColor"+ {...props}+ >+ <path d="M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36c-0.98,1.37-2.58,2.26-4.4,2.26 c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z" />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/Edit/index.tsx b/packages/docs/src/theme/Icon/Edit/index.tsxnew file mode 100644index 00000000..99e6225c--- /dev/null+++ b/packages/docs/src/theme/Icon/Edit/index.tsx@@ -0,0 +1,31 @@+/**+ * Copyright (c) Facebook, Inc. and its affiliates.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++import React from 'react';+import clsx from 'clsx';+import type {Props} from '@theme/Icon/Edit';++import styles from './styles.module.css';++export default function IconEdit({+ className,+ ...restProps+}: Props): JSX.Element {+ return (+ <svg+ fill="currentColor"+ width="24px"+ height="24px"+ viewBox="0 0 24 24"+ className={clsx(styles.iconEdit, className)}+ aria-hidden="true"+ {...restProps}+ >+ <path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/Edit/styles.module.css b/packages/docs/src/theme/Icon/Edit/styles.module.cssnew file mode 100644index 00000000..31f0e9fd--- /dev/null+++ b/packages/docs/src/theme/Icon/Edit/styles.module.css@@ -0,0 +1,11 @@+/**+ * Copyright (c) Facebook, Inc. and its affiliates.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++.iconEdit {+ margin-right: 0.3em;+ margin-bottom: -0.3em;+}diff --git a/packages/docs/src/theme/Icon/ExternalLink/index.tsx b/packages/docs/src/theme/Icon/ExternalLink/index.tsxnew file mode 100644index 00000000..434a4ae1--- /dev/null+++ b/packages/docs/src/theme/Icon/ExternalLink/index.tsx@@ -0,0 +1,31 @@+/**+ * Copyright (c) Facebook, Inc. and its affiliates.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++import React from 'react';+import type {Props} from '@theme/Icon/ExternalLink';++import styles from './styles.module.css';++export default function IconExternalLink({+ width = 13.5,+ height = 13.5,+}: Props): JSX.Element {+ return (+ <svg+ width={16}+ height={16}+ aria-hidden="true"+ viewBox="0 0 24 24"+ className={styles.iconExternalLink}+ >+ <path+ d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"+ fill="currentColor"+ />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/ExternalLink/styles.module.css b/packages/docs/src/theme/Icon/ExternalLink/styles.module.cssnew file mode 100644index 00000000..2024aa43--- /dev/null+++ b/packages/docs/src/theme/Icon/ExternalLink/styles.module.css@@ -0,0 +1,11 @@+/**+ * Copyright (c) Facebook, Inc. and its affiliates.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++.iconExternalLink {+ margin-left: 0.3rem;+ margin-bottom: -0.2rem;+}diff --git a/packages/docs/src/theme/Icon/Home/index.tsx b/packages/docs/src/theme/Icon/Home/index.tsxnew file mode 100644index 00000000..dd0bbcdc--- /dev/null+++ b/packages/docs/src/theme/Icon/Home/index.tsx@@ -0,0 +1,21 @@+/**+ * Copyright (c) Facebook, Inc. and its affiliates.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++import React from 'react';+import type {Props} from '@theme/Icon/Home';++export default function IconHome(props: Props): JSX.Element {+ return (+ <svg+ viewBox="0 0 24 24"+ style={{width: 16, height: 16, marginTop: '0.1rem'}}+ {...props}+ >+ <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" fill="currentColor" />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/Info/index.tsx b/packages/docs/src/theme/Icon/Info/index.tsxnew file mode 100644index 00000000..9ef10149--- /dev/null+++ b/packages/docs/src/theme/Icon/Info/index.tsx@@ -0,0 +1,9 @@+import React, {ComponentProps} from 'react';++export default function IconInfo(props: ComponentProps<'svg'>): JSX.Element {+ return (+ <svg viewBox="0 0 24 24" fill="currentColor" {...props}>+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/Language/index.tsx b/packages/docs/src/theme/Icon/Language/index.tsxnew file mode 100644index 00000000..e467febe--- /dev/null+++ b/packages/docs/src/theme/Icon/Language/index.tsx@@ -0,0 +1,30 @@+/**+ * Copyright (c) Facebook, Inc. and its affiliates.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++import React from 'react';+import type {Props} from '@theme/Icon/Language';++export default function IconLanguage({+ width = 20,+ height = 20,+ ...props+}: Props): JSX.Element {+ return (+ <svg+ viewBox="0 0 24 24"+ width={width}+ height={height}+ aria-hidden+ {...props}+ >+ <path+ fill="currentColor"+ d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"+ />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/LightBulb/index.tsx b/packages/docs/src/theme/Icon/LightBulb/index.tsxnew file mode 100644index 00000000..09d934ed--- /dev/null+++ b/packages/docs/src/theme/Icon/LightBulb/index.tsx@@ -0,0 +1,11 @@+import React, {ComponentProps} from 'react';++export default function IconLightBulb(+ props: ComponentProps<'svg'>,+): JSX.Element {+ return (+ <svg viewBox="0 0 24 24" fill="currentColor" {...props}>+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z" />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/LightMode/index.tsx b/packages/docs/src/theme/Icon/LightMode/index.tsxnew file mode 100644index 00000000..5dccc3c8--- /dev/null+++ b/packages/docs/src/theme/Icon/LightMode/index.tsx@@ -0,0 +1,23 @@+/**+ * Copyright (c) Facebook, Inc. and its affiliates.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ */++import React from 'react';+import type {Props} from '@theme/Icon/LightMode';++export default function IconLightMode(props: Props): JSX.Element {+ return (+ <svg+ height="24px"+ width="24px"+ viewBox="0 0 24 24"+ fill="currentColor"+ {...props}+ >+ <path d="M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0 c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2 c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1 C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06 c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41 l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41 c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36 c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z" />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/Menu/index.tsx b/packages/docs/src/theme/Icon/Menu/index.tsxnew file mode 100644index 00000000..cccd7c88--- /dev/null+++ b/packages/docs/src/theme/Icon/Menu/index.tsx@@ -0,0 +1,23 @@+import React from 'react';+export default function IconMenu({+ width = 30,+ height = 30,+ className,+ ...restProps+}) {+ return (+ <svg+ className={className}+ width={24}+ height={24}+ viewBox="0 0 24 24"+ {...restProps}+ >+ {/*<path d="M0 0h24v24H0V0z" fill="currentColor" />*/}+ <path+ d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"+ fill="currentColor"+ />+ </svg>+ );+}diff --git a/packages/docs/src/theme/Icon/Warning/index.tsx b/packages/docs/src/theme/Icon/Warning/index.tsxnew file mode 100644index 00000000..9848934f--- /dev/null+++ b/packages/docs/src/theme/Icon/Warning/index.tsx@@ -0,0 +1,9 @@+import React, {ComponentProps} from 'react';++export default function IconWarning(props: ComponentProps<'svg'>): JSX.Element {+ return (+ <svg viewBox="0 0 24 24" fill="currentColor" {...props}>+ <path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" />+ </svg>+ );+}