diff --git a/docs/src/components/Color.js b/docs/src/components/Color.js
deleted file mode 100644
index bda3420..0000000
--- a/docs/src/components/Color.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import React from "react";
-import styles from "./styles.module.css";
-
-export default ({ hex }) => (
-
-
- {hex}
-
-);
diff --git a/docs/src/components/Color.tsx b/docs/src/components/Color.tsx
new file mode 100644
index 0000000..7c2864e
--- /dev/null
+++ b/docs/src/components/Color.tsx
@@ -0,0 +1,18 @@
+import * as React from "react";
+import styles from "./styles.module.css";
+
+type ColorProps = {
+ hex: string;
+};
+
+const Color = (props: React.PropsWithChildren): JSX.Element => {
+ const { hex } = props;
+ return (
+
+
+ {hex}
+
+ );
+};
+
+export default Color;
diff --git a/docs/src/components/Datetime.js b/docs/src/components/Datetime.js
deleted file mode 100644
index 9830cae..0000000
--- a/docs/src/components/Datetime.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from "react";
-
-export default ({ year = false, ...props }) => {
- const date = new Date();
- const granularity = year ? date.getFullYear() : date.toString();
- return {granularity};
-};
diff --git a/docs/src/components/Datetime.tsx b/docs/src/components/Datetime.tsx
new file mode 100644
index 0000000..4c811d8
--- /dev/null
+++ b/docs/src/components/Datetime.tsx
@@ -0,0 +1,16 @@
+import * as React from "react";
+
+type DatetimeProps = {
+ year?: boolean;
+};
+
+const Datetime = (
+ props: React.PropsWithChildren
+): JSX.Element => {
+ const { year } = props;
+ const date = new Date();
+ const granularity = year ? date.getFullYear() : date.toString();
+ return {granularity};
+};
+
+export default Datetime;
diff --git a/docs/src/components/Font.js b/docs/src/components/Font.tsx
similarity index 62%
rename from docs/src/components/Font.js
rename to docs/src/components/Font.tsx
index 510c0bd..e6bb20a 100644
--- a/docs/src/components/Font.js
+++ b/docs/src/components/Font.tsx
@@ -1,8 +1,13 @@
-import React from "react";
+import * as React from "react";
import clsx from "clsx";
import styles from "./fonts.module.css";
-export default ({ name }) => {
+type FontProps = {
+ name: string;
+};
+
+const Font = (props: React.PropsWithChildren): JSX.Element => {
+ const { name } = props;
const fontClass = { Nunito: "fontBody", "Fira Code": "fontMono" };
return (
@@ -10,3 +15,5 @@ export default ({ name }) => {
);
};
+
+export default Font;
diff --git a/docs/src/components/JSXCode.js b/docs/src/components/JSXCode.js
deleted file mode 100644
index 6712289..0000000
--- a/docs/src/components/JSXCode.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import React from "react";
-import styles from "./styles.module.css";
-
-export default ({ children }) => {children};
diff --git a/docs/src/components/JSXCode.tsx b/docs/src/components/JSXCode.tsx
new file mode 100644
index 0000000..48de6ed
--- /dev/null
+++ b/docs/src/components/JSXCode.tsx
@@ -0,0 +1,8 @@
+import * as React from "react";
+import styles from "./styles.module.css";
+
+const JSXCode = (props: React.ComponentProps<"span">): JSX.Element => {
+ return ;
+};
+
+export default JSXCode;
diff --git a/docs/src/components/MiniNote.js b/docs/src/components/MiniNote.js
deleted file mode 100644
index c59d885..0000000
--- a/docs/src/components/MiniNote.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import React from "react";
-
-export default ({ children, newLine = true }) => (
- <>
- {newLine &&
}
-
- {children}
-
- >
-);
diff --git a/docs/src/components/MiniNote.tsx b/docs/src/components/MiniNote.tsx
new file mode 100644
index 0000000..4086adc
--- /dev/null
+++ b/docs/src/components/MiniNote.tsx
@@ -0,0 +1,28 @@
+import * as React from "react";
+
+type MiniNodeProps = {
+ newLine: boolean;
+};
+
+const MiniNote = (
+ props: React.PropsWithChildren
+): JSX.Element => {
+ const { newLine, children } = props;
+ return (
+ <>
+ {newLine &&
}
+
+ {children}
+
+ >
+ );
+};
+
+export default MiniNote;
diff --git a/docs/src/components/Native.tsx b/docs/src/components/Native.tsx
new file mode 100644
index 0000000..28e3ad2
--- /dev/null
+++ b/docs/src/components/Native.tsx
@@ -0,0 +1,9 @@
+import * as React from "react";
+import styles from "./styles.module.css";
+
+const Native = (props: React.ComponentProps<"span">): JSX.Element => {
+ const { children } = props;
+ return {children};
+};
+
+export default Native;
diff --git a/docs/src/components/PageLink.js b/docs/src/components/PageLink.js
deleted file mode 100644
index 5ac54cb..0000000
--- a/docs/src/components/PageLink.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import React from "react";
-import Link from "@docusaurus/Link";
-
-export default ({ children, to }) => (
-
- {children}
-
-);
diff --git a/docs/src/components/PageLink.tsx b/docs/src/components/PageLink.tsx
new file mode 100644
index 0000000..81f5091
--- /dev/null
+++ b/docs/src/components/PageLink.tsx
@@ -0,0 +1,10 @@
+import * as React from "react";
+import Link from "@docusaurus/Link";
+
+import type { LinkProps } from "@docusaurus/Link";
+
+const PageLink = (props: React.PropsWithChildren): JSX.Element => {
+ return ;
+};
+
+export default PageLink;
diff --git a/docs/src/components/RegexPattern.js b/docs/src/components/RegexPattern.js
deleted file mode 100644
index e0c7b1b..0000000
--- a/docs/src/components/RegexPattern.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from "react";
-import Code from "./JSXCode";
-
-const patternMap = {
- aspath_asdot: String.raw`^(\^|^\_)((\d+\.\d+)\_|(\d+\.\d+)\$|(\d+\.\d+)\(\_\.\+\_\))+$`,
- aspath_asplain: String.raw`^(\^|^\_)(\d+\_|\d+\$|\d+\(\_\.\+\_\))+$`,
- community_decimal: String.raw`^[0-9]{1,10}$`,
- community_extended: String.raw`^([0-9]{0,5})\:([0-9]{1,5})$`,
- community_large: String.raw`^([0-9]{1,10})\:([0-9]{1,10})\:[0-9]{1,10}$`
-};
-
-export default ({ pattern }) => {
- const thisPattern = patternMap[pattern];
- return '{thisPattern}';
-};
diff --git a/docs/src/components/RegexPattern.tsx b/docs/src/components/RegexPattern.tsx
new file mode 100644
index 0000000..c2b4ba3
--- /dev/null
+++ b/docs/src/components/RegexPattern.tsx
@@ -0,0 +1,25 @@
+import * as React from "react";
+import { useMemo } from "react";
+import Code from "./JSXCode";
+
+const PATTERN_MAP = {
+ aspath_asdot: String.raw`^(\^|^\_)((\d+\.\d+)\_|(\d+\.\d+)\$|(\d+\.\d+)\(\_\.\+\_\))+$`,
+ aspath_asplain: String.raw`^(\^|^\_)(\d+\_|\d+\$|\d+\(\_\.\+\_\))+$`,
+ community_decimal: String.raw`^[0-9]{1,10}$`,
+ community_extended: String.raw`^([0-9]{0,5})\:([0-9]{1,5})$`,
+ community_large: String.raw`^([0-9]{1,10})\:([0-9]{1,10})\:[0-9]{1,10}$`,
+};
+
+type RegexPatternProps = {
+ pattern: keyof typeof PATTERN_MAP;
+};
+
+const RegexPattern = (
+ props: React.PropsWithChildren
+): JSX.Element => {
+ const { pattern } = props;
+ const thisPattern = useMemo(() => PATTERN_MAP[pattern], [pattern]);
+ return '{thisPattern}';
+};
+
+export default RegexPattern;
diff --git a/docs/src/components/Required.js b/docs/src/components/Required.js
deleted file mode 100644
index f615549..0000000
--- a/docs/src/components/Required.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import React from "react";
-
-export default () => (
- *
-);
diff --git a/docs/src/components/Required.tsx b/docs/src/components/Required.tsx
new file mode 100644
index 0000000..14a36b5
--- /dev/null
+++ b/docs/src/components/Required.tsx
@@ -0,0 +1,11 @@
+import * as React from "react";
+
+const Required = (): JSX.Element => {
+ return (
+
+ *
+
+ );
+};
+
+export default Required;
diff --git a/docs/src/components/styles.module.css b/docs/src/components/styles.module.css
index 95e46f2..1ad1ee4 100644
--- a/docs/src/components/styles.module.css
+++ b/docs/src/components/styles.module.css
@@ -1,25 +1,31 @@
.code {
- background-color: var(--ifm-code-background);
- color: var(--ifm-code-color);
- font-family: var(--ifm-font-family-monospace);
- font-size: var(--ifm-code-font-size);
- border-radius: var(--ifm-code-border-radius);
- margin: 0;
- padding: var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal);
- font-style: normal;
+ background-color: var(--ifm-code-background);
+ color: var(--ifm-code-color);
+ font-family: var(--ifm-font-family-monospace);
+ font-size: var(--ifm-code-font-size);
+ border-radius: var(--ifm-code-border-radius);
+ margin: 0;
+ padding: var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal);
+ font-style: normal;
}
.color {
- border-radius: var(--ifm-global-radius);
- display: inline-flex;
- height: 1.5rem;
- width: 1.5rem;
- margin-right: 0.5rem;
- padding: var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal);
+ border-radius: var(--ifm-global-radius);
+ display: inline-flex;
+ height: 1.5rem;
+ width: 1.5rem;
+ margin-right: 0.5rem;
+ padding: var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal);
}
.colorCode {
- display: flex;
- align-items: center;
- justify-content: space-between;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.Native {
+ /* color: var(--ifm-link-color); */
+ color: var(--ifm-color-success);
+ font-weight: bold;
}