@defra/docusaurus-theme-govuk 0.0.1-alpha
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/LICENSE +21 -0
- package/README.md +163 -0
- package/index.js +215 -0
- package/package.json +44 -0
- package/src/css/components.scss +90 -0
- package/src/css/doc-overrides.css +19 -0
- package/src/css/prose-scope.scss +59 -0
- package/src/css/theme.scss +18 -0
- package/src/lib/empty-module.js +2 -0
- package/src/lib/react-foundry-router-shim.js +68 -0
- package/src/theme/Admonition/index.js +33 -0
- package/src/theme/AnnouncementBar/index.js +5 -0
- package/src/theme/CodeBlock/index.js +55 -0
- package/src/theme/DocItem/Content/index.js +28 -0
- package/src/theme/DocItem/Footer/index.js +5 -0
- package/src/theme/DocItem/Layout/index.js +10 -0
- package/src/theme/DocItem/Metadata/index.js +17 -0
- package/src/theme/DocItem/Paginator/index.js +36 -0
- package/src/theme/DocItem/TOC/Desktop/index.js +5 -0
- package/src/theme/DocItem/TOC/Mobile/index.js +5 -0
- package/src/theme/DocItem/docContext.js +37 -0
- package/src/theme/DocItem/index.js +22 -0
- package/src/theme/DocPage/Layout/index.js +5 -0
- package/src/theme/DocRoot/Layout/index.js +10 -0
- package/src/theme/DocRoot/index.js +18 -0
- package/src/theme/DocVersionRoot/index.js +6 -0
- package/src/theme/DocsRoot/index.js +6 -0
- package/src/theme/Heading/index.js +29 -0
- package/src/theme/Homepage/index.js +47 -0
- package/src/theme/Layout/Provider/index.js +5 -0
- package/src/theme/Layout/index.js +181 -0
- package/src/theme/MDXComponents/index.js +42 -0
- package/src/theme/MDXContent/index.js +7 -0
- package/src/theme/NotFound/Content/index.js +23 -0
- package/src/theme/NotFound/index.js +11 -0
- package/src/theme/Root/index.js +5 -0
- package/src/theme/TOCItems/index.js +5 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import CodeBlock from '@theme/CodeBlock';
|
|
3
|
+
import Heading from '@theme/Heading';
|
|
4
|
+
import Admonition from '@theme/Admonition';
|
|
5
|
+
import {InsetText} from '@not-govuk/simple-components';
|
|
6
|
+
|
|
7
|
+
function GovukLink(props) {
|
|
8
|
+
return <a className="govuk-link" {...props} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const MDXComponents = {
|
|
12
|
+
// Inline code only; block code is handled by the pre handler
|
|
13
|
+
code: (props) => <code {...props} />,
|
|
14
|
+
pre: (props) => {
|
|
15
|
+
// MDX wraps fenced code blocks in <pre><code className="language-x">.
|
|
16
|
+
// Extract the inner code element props and render as CodeBlock.
|
|
17
|
+
const {children} = props;
|
|
18
|
+
if (React.isValidElement(children)) {
|
|
19
|
+
return <CodeBlock {...children.props} />;
|
|
20
|
+
}
|
|
21
|
+
return <pre {...props} />;
|
|
22
|
+
},
|
|
23
|
+
// GOV.UK table styling
|
|
24
|
+
table: (props) => <table className="govuk-table" {...props} />,
|
|
25
|
+
thead: (props) => <thead className="govuk-table__head" {...props} />,
|
|
26
|
+
tbody: (props) => <tbody className="govuk-table__body" {...props} />,
|
|
27
|
+
tr: (props) => <tr className="govuk-table__row" {...props} />,
|
|
28
|
+
th: (props) => <th className="govuk-table__header" {...props} />,
|
|
29
|
+
td: (props) => <td className="govuk-table__cell" {...props} />,
|
|
30
|
+
// Blockquotes rendered as GOV.UK InsetText
|
|
31
|
+
blockquote: ({children, ...rest}) => <InsetText {...rest}>{children}</InsetText>,
|
|
32
|
+
h1: (props) => <Heading as="h1" {...props} />,
|
|
33
|
+
h2: (props) => <Heading as="h2" {...props} />,
|
|
34
|
+
h3: (props) => <Heading as="h3" {...props} />,
|
|
35
|
+
h4: (props) => <Heading as="h4" {...props} />,
|
|
36
|
+
h5: (props) => <Heading as="h5" {...props} />,
|
|
37
|
+
h6: (props) => <Heading as="h6" {...props} />,
|
|
38
|
+
a: GovukLink,
|
|
39
|
+
admonition: Admonition,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default MDXComponents;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
3
|
+
|
|
4
|
+
export default function NotFoundContent() {
|
|
5
|
+
const homeUrl = useBaseUrl('/');
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className="app-prose-scope">
|
|
9
|
+
<h1 className="govuk-heading-xl">Page not found</h1>
|
|
10
|
+
<p className="govuk-body">
|
|
11
|
+
If you typed the web address, check it is correct.
|
|
12
|
+
</p>
|
|
13
|
+
<p className="govuk-body">
|
|
14
|
+
If you pasted the web address, check you copied the entire address.
|
|
15
|
+
</p>
|
|
16
|
+
<p className="govuk-body">
|
|
17
|
+
<a href={homeUrl} className="govuk-link">
|
|
18
|
+
Go to the homepage
|
|
19
|
+
</a>
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}
|