diff --git a/packages/react-common-docs/brand.tsx b/packages/react-common-docs/brand.tsx
index 527d3d8..b45a0a1 100644
--- a/packages/react-common-docs/brand.tsx
+++ b/packages/react-common-docs/brand.tsx
@@ -6,6 +6,7 @@ const Base = styled('div')({
position: 'relative',
})
+// @ts-ignore
const Title = styled('strong')({
fontSize: '2rem',
fontFamily: 'var(--font-family-headings), sans-serif',
diff --git a/packages/react-common-docs/next.config.js b/packages/react-common-docs/next.config.js
index d24602c..30ab0d3 100644
--- a/packages/react-common-docs/next.config.js
+++ b/packages/react-common-docs/next.config.js
@@ -10,6 +10,9 @@ const e = withMDX({
module.exports = {
...e,
+ typescript: {
+ ignoreBuildErrors: true,
+ },
webpack(...args) {
const oldWebpack = e.webpack(...args)
const [config, { defaultLoaders, }] = args
diff --git a/packages/react-common-docs/src/components/Header/Header.tsx b/packages/react-common-docs/src/components/Header/Header.tsx
index a0672f4..a690f89 100644
--- a/packages/react-common-docs/src/components/Header/Header.tsx
+++ b/packages/react-common-docs/src/components/Header/Header.tsx
@@ -1,11 +1,18 @@
import * as React from 'react'
+import * as PropTypes from 'prop-types'
import Head from 'next/head'
import unified from 'unified'
import parse from 'remark-parse'
import remark2react from 'remark-react'
import docgen from '../../docgen.json'
-const Header = ({ of: ofAttr }) => {
+const propTypes = {
+ of: PropTypes.string,
+}
+
+type Props = PropTypes.InferProps
+
+const Header: React.FC = ({ of: ofAttr }) => {
const docs = docgen.find(d => d.displayName === ofAttr)
if (!docs) {
@@ -25,11 +32,13 @@ const Header = ({ of: ofAttr }) => {
unified()
.use(parse)
.use(remark2react)
- .processSync(docs.description).result
+ .processSync(docs.description).result as any
}
)
}
+Header.propTypes = propTypes
+
export default Header
diff --git a/packages/react-common-docs/src/components/MenuGraphics/MenuGraphics.tsx b/packages/react-common-docs/src/components/MenuGraphics/MenuGraphics.tsx
index c7ea6f7..e6fb8a8 100644
--- a/packages/react-common-docs/src/components/MenuGraphics/MenuGraphics.tsx
+++ b/packages/react-common-docs/src/components/MenuGraphics/MenuGraphics.tsx
@@ -35,7 +35,7 @@ const MenuGraphics: React.FC = ({
return (
)
default:
diff --git a/packages/react-common-docs/src/components/Nav/Nav.tsx b/packages/react-common-docs/src/components/Nav/Nav.tsx
index 1415a35..8fd4ffe 100644
--- a/packages/react-common-docs/src/components/Nav/Nav.tsx
+++ b/packages/react-common-docs/src/components/Nav/Nav.tsx
@@ -1,13 +1,9 @@
import * as React from 'react'
+import * as PropTypes from 'prop-types'
import Link from 'next/link'
import styled from 'styled-components'
import NavLink from '../NavLink/NavLink'
-const StyledLink = styled('a')({
- display: 'block',
- textDecoration: 'none',
-})
-
const Container = styled('span')({
display: 'flex',
alignItems: 'center',
@@ -24,68 +20,82 @@ const HeaderContainer = styled(Container)({
marginTop: '2rem',
})
-const NavContainer = styled('div')({
+const propTypes = {
+ data: PropTypes.oneOfType([
+ PropTypes.array,
+ PropTypes.object,
+ PropTypes.string,
+ ])
+}
-})
+type Props = PropTypes.InferProps
-const Nav = ({
+const Nav: React.FC = ({
data,
}) => {
- if (Array.isArray(data)) {
+ if (Array.isArray(data! as unknown[])) {
return (
-
+
{
- data.map(d => (
+ (data as (string | object | null | undefined)[]).map(d => (
))
}
-
+
)
}
- if (typeof data === 'object') {
- const [entry] = Object.entries(data)
+ if (typeof data as unknown === 'object') {
+ const [entry] = Object.entries(data as Record)
const [key, value] = entry
- if (Array.isArray(value)) {
+ if (Array.isArray(value as unknown[])) {
return (
-
+
{key}
{
- value.map(v => (
+ (value as (string | object | null | undefined)[]).map(v => (
))
}
-
+
)
}
return (
-
+ {
+ // @ts-ignore
+
+ }
)
}
return (
-
+ {
+ // @ts-ignore
+
+ }
)
}
+Nav.propTypes = propTypes
+
export default Nav
diff --git a/packages/react-common-docs/src/components/NavLink/NavLink.tsx b/packages/react-common-docs/src/components/NavLink/NavLink.tsx
index 3c20273..e70bbd5 100644
--- a/packages/react-common-docs/src/components/NavLink/NavLink.tsx
+++ b/packages/react-common-docs/src/components/NavLink/NavLink.tsx
@@ -106,43 +106,49 @@ const NavLink = React.forwardRef((
any}
>
-
- {
- graphics as object
- && (
-
-
-
- )
- }
-
-
- {title}
-
+ {
+ // @ts-ignore
+
{
- subtitle as string
+ graphics as object
&& (
-
- {subtitle}
-
+
+ {
+ // @ts-ignore
+
+ }
+
)
}
-
- {
- indicator as string
- && (
-
-
-
- )
- }
-
+
+
+ {title}
+
+ {
+ subtitle as string
+ && (
+
+ {subtitle}
+
+ )
+ }
+
+ {
+ indicator as string
+ && (
+
+
+
+ )
+ }
+
+ }
))
diff --git a/packages/react-common-docs/src/components/Playground/Playground.tsx b/packages/react-common-docs/src/components/Playground/Playground.tsx
index 29071c6..68ca3a9 100644
--- a/packages/react-common-docs/src/components/Playground/Playground.tsx
+++ b/packages/react-common-docs/src/components/Playground/Playground.tsx
@@ -1,4 +1,5 @@
import * as React from 'react'
+import * as PropTypes from 'prop-types'
import {
LiveProvider,
LiveEditor,
@@ -16,7 +17,15 @@ const StyledLiveEditor = styled(LiveEditor)({
marginTop: '1rem',
})
-const Playground = ({
+const propTypes = {
+ components: PropTypes.object,
+ code: PropTypes.string.isRequired,
+ label: PropTypes.string,
+}
+
+type Props = PropTypes.InferProps
+
+const Playground: React.FC = ({
components,
code,
label,
@@ -31,7 +40,7 @@ const Playground = ({
return (