create-trellis-docs 1.0.0

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.
Files changed (148) hide show
  1. package/bin/index.js +29 -0
  2. package/lib/index.js +178 -0
  3. package/package.json +23 -0
  4. package/template/_gitignore +6 -0
  5. package/template/blog/2025-01-01-welcome.md +15 -0
  6. package/template/design-tokens.json +218 -0
  7. package/template/docs/faq/general.mdx +16 -0
  8. package/template/docs/faq/index.mdx +13 -0
  9. package/template/docs/getting-started.mdx +54 -0
  10. package/template/docs/guides/writing-docs.mdx +90 -0
  11. package/template/docusaurus.config.js.tpl +200 -0
  12. package/template/package.json.tpl +60 -0
  13. package/template/packages/faq-index-plugin/README.md +104 -0
  14. package/template/packages/faq-index-plugin/index.js +91 -0
  15. package/template/packages/faq-index-plugin/package.json +15 -0
  16. package/template/packages/redirects-plugin/README.md +186 -0
  17. package/template/packages/redirects-plugin/index.js +167 -0
  18. package/template/packages/redirects-plugin/package.json +15 -0
  19. package/template/packages/redirects-plugin/yarn.lock +31 -0
  20. package/template/redirects.json +1 -0
  21. package/template/scripts/build-tokens.js +34 -0
  22. package/template/sidebars.js +17 -0
  23. package/template/src/components/CustomSearch/CustomSearch.js +241 -0
  24. package/template/src/components/CustomSearch/CustomSearchContent.js +171 -0
  25. package/template/src/components/CustomSearch/NavbarSearch.js +211 -0
  26. package/template/src/components/CustomSearch/SearchContext.js +26 -0
  27. package/template/src/components/CustomSearch/styles.module.css +171 -0
  28. package/template/src/components/CustomSearch/wrapperInit.js +11 -0
  29. package/template/src/components/FaqTableOfContents/index.jsx +176 -0
  30. package/template/src/components/FaqTableOfContents/styles.module.css +167 -0
  31. package/template/src/components/Feedback/Feedback.js +310 -0
  32. package/template/src/components/Feedback/api.js +77 -0
  33. package/template/src/components/FlippingCard/FlippingCard.js +197 -0
  34. package/template/src/components/FlippingCard/styles.module.css +248 -0
  35. package/template/src/components/Glossary.js +57 -0
  36. package/template/src/css/custom.css +765 -0
  37. package/template/src/data/glossary.json +1 -0
  38. package/template/src/pages/index.js.tpl +38 -0
  39. package/template/src/theme/Admonition/Icon/Danger.js +11 -0
  40. package/template/src/theme/Admonition/Icon/Info.js +11 -0
  41. package/template/src/theme/Admonition/Icon/Note.js +11 -0
  42. package/template/src/theme/Admonition/Icon/Tip.js +11 -0
  43. package/template/src/theme/Admonition/Icon/Warning.js +11 -0
  44. package/template/src/theme/Admonition/Layout/index.js +39 -0
  45. package/template/src/theme/Admonition/Layout/styles.module.css +36 -0
  46. package/template/src/theme/Admonition/Type/Caution.js +28 -0
  47. package/template/src/theme/Admonition/Type/Danger.js +26 -0
  48. package/template/src/theme/Admonition/Type/Info.js +26 -0
  49. package/template/src/theme/Admonition/Type/Note.js +26 -0
  50. package/template/src/theme/Admonition/Type/Tip.js +26 -0
  51. package/template/src/theme/Admonition/Type/Warning.js +26 -0
  52. package/template/src/theme/Admonition/Types.js +27 -0
  53. package/template/src/theme/Admonition/index.js +18 -0
  54. package/template/src/theme/AnnouncementBar/CloseButton/index.js +20 -0
  55. package/template/src/theme/AnnouncementBar/CloseButton/styles.module.css +4 -0
  56. package/template/src/theme/AnnouncementBar/Content/index.js +17 -0
  57. package/template/src/theme/AnnouncementBar/Content/styles.module.css +10 -0
  58. package/template/src/theme/AnnouncementBar/index.js +33 -0
  59. package/template/src/theme/AnnouncementBar/styles.module.css +55 -0
  60. package/template/src/theme/BlogSidebar/Content/index.js +35 -0
  61. package/template/src/theme/BlogSidebar/Desktop/index.js +44 -0
  62. package/template/src/theme/BlogSidebar/Desktop/styles.module.css +60 -0
  63. package/template/src/theme/BlogSidebar/Mobile/index.js +38 -0
  64. package/template/src/theme/BlogSidebar/Mobile/styles.module.css +3 -0
  65. package/template/src/theme/BlogSidebar/index.js +15 -0
  66. package/template/src/theme/Details/index.js +23 -0
  67. package/template/src/theme/Details/styles.module.css +52 -0
  68. package/template/src/theme/DocBreadcrumbs/Items/Home/index.js +22 -0
  69. package/template/src/theme/DocBreadcrumbs/Items/Home/styles.module.css +7 -0
  70. package/template/src/theme/DocBreadcrumbs/StructuredData/index.js +15 -0
  71. package/template/src/theme/DocBreadcrumbs/index.js +75 -0
  72. package/template/src/theme/DocBreadcrumbs/styles.module.css +5 -0
  73. package/template/src/theme/DocCard/index.js +93 -0
  74. package/template/src/theme/DocCard/styles.module.css +53 -0
  75. package/template/src/theme/DocCardList/index.js +27 -0
  76. package/template/src/theme/DocCardList/styles.module.css +7 -0
  77. package/template/src/theme/DocItem/Content/index.js +121 -0
  78. package/template/src/theme/DocItem/Content/styles.module.css +96 -0
  79. package/template/src/theme/DocItem/Footer/index.js +43 -0
  80. package/template/src/theme/DocItem/Footer/styles.module.css +19 -0
  81. package/template/src/theme/DocItem/Layout/index.js +55 -0
  82. package/template/src/theme/DocItem/Layout/styles.module.css +14 -0
  83. package/template/src/theme/DocItem/Metadata/index.js +17 -0
  84. package/template/src/theme/DocItem/Paginator/index.js +17 -0
  85. package/template/src/theme/DocItem/TOC/Desktop/index.js +15 -0
  86. package/template/src/theme/DocItem/TOC/Mobile/index.js +17 -0
  87. package/template/src/theme/DocItem/TOC/Mobile/styles.module.css +12 -0
  88. package/template/src/theme/DocItem/index.js +19 -0
  89. package/template/src/theme/DocItem/styles.module.css +28 -0
  90. package/template/src/theme/DocRoot/Layout/Main/index.js +23 -0
  91. package/template/src/theme/DocRoot/Layout/Main/styles.module.css +31 -0
  92. package/template/src/theme/DocRoot/Layout/Sidebar/ExpandButton/index.js +28 -0
  93. package/template/src/theme/DocRoot/Layout/Sidebar/ExpandButton/styles.module.css +27 -0
  94. package/template/src/theme/DocRoot/Layout/Sidebar/index.js +70 -0
  95. package/template/src/theme/DocRoot/Layout/Sidebar/styles.module.css +32 -0
  96. package/template/src/theme/DocRoot/Layout/index.js +27 -0
  97. package/template/src/theme/DocRoot/Layout/styles.module.css +9 -0
  98. package/template/src/theme/DocRoot/index.js +25 -0
  99. package/template/src/theme/DocSidebar/Desktop/CollapseButton/index.js +28 -0
  100. package/template/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +40 -0
  101. package/template/src/theme/DocSidebar/Desktop/Content/index.js +44 -0
  102. package/template/src/theme/DocSidebar/Desktop/Content/styles.module.css +16 -0
  103. package/template/src/theme/DocSidebar/Desktop/index.js +28 -0
  104. package/template/src/theme/DocSidebar/Desktop/styles.module.css +37 -0
  105. package/template/src/theme/DocSidebar/Mobile/index.js +39 -0
  106. package/template/src/theme/DocSidebar/index.js +18 -0
  107. package/template/src/theme/DocSidebarItem/Category/index.js +203 -0
  108. package/template/src/theme/DocSidebarItem/Html/index.js +20 -0
  109. package/template/src/theme/DocSidebarItem/Html/styles.module.css +6 -0
  110. package/template/src/theme/DocSidebarItem/Link/index.js +49 -0
  111. package/template/src/theme/DocSidebarItem/Link/styles.module.css +3 -0
  112. package/template/src/theme/DocSidebarItem/index.js +15 -0
  113. package/template/src/theme/EditMetaRow/index.js +25 -0
  114. package/template/src/theme/EditMetaRow/styles.module.css +11 -0
  115. package/template/src/theme/EditThisPage/index.js +29 -0
  116. package/template/src/theme/ErrorPageContent.js +34 -0
  117. package/template/src/theme/Footer/Copyright/index.js +11 -0
  118. package/template/src/theme/Footer/Layout/index.js +21 -0
  119. package/template/src/theme/Footer/LinkItem/index.js +26 -0
  120. package/template/src/theme/Footer/Links/MultiColumn/index.js +44 -0
  121. package/template/src/theme/Footer/Links/Simple/index.js +32 -0
  122. package/template/src/theme/Footer/Links/index.js +11 -0
  123. package/template/src/theme/Footer/Logo/index.js +35 -0
  124. package/template/src/theme/Footer/Logo/styles.module.css +9 -0
  125. package/template/src/theme/Footer/index.js +22 -0
  126. package/template/src/theme/MDXComponents/Heading.js +120 -0
  127. package/template/src/theme/MDXComponents/index.js +17 -0
  128. package/template/src/theme/MDXComponents/styles.module.css +110 -0
  129. package/template/src/theme/MDXContent/index.js +6 -0
  130. package/template/src/theme/NavbarItem/DropdownNavbarItem/Desktop/index.js +110 -0
  131. package/template/src/theme/NavbarItem/DropdownNavbarItem/Mobile/index.js +136 -0
  132. package/template/src/theme/NavbarItem/DropdownNavbarItem/Mobile/styles.module.css +3 -0
  133. package/template/src/theme/NavbarItem/DropdownNavbarItem/index.js +7 -0
  134. package/template/src/theme/NotFound/Content/index.js +46 -0
  135. package/template/src/theme/NotFound/index.js +19 -0
  136. package/template/src/theme/NotFound.js +49 -0
  137. package/template/src/theme/PaginatorNavLink/index.js +17 -0
  138. package/template/src/theme/TOC/index.js +19 -0
  139. package/template/src/theme/TOC/styles.module.css +16 -0
  140. package/template/src/theme/TOCItems/Tree.js +30 -0
  141. package/template/src/theme/TOCItems/index.js +47 -0
  142. package/template/src/theme/TabItem/index.js +15 -0
  143. package/template/src/theme/TabItem/styles.module.css +10 -0
  144. package/template/src/theme/Tabs/index.js +189 -0
  145. package/template/src/theme/Tabs/styles.module.css +74 -0
  146. package/template/static/img/favicon.svg +4 -0
  147. package/template/static/img/oops-404.svg +11 -0
  148. package/template/static/searchIndex.json +1 -0
@@ -0,0 +1 @@
1
+ []
@@ -0,0 +1,38 @@
1
+ import Layout from '@theme/Layout';
2
+ import Link from '@docusaurus/Link';
3
+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
4
+
5
+ export default function Home() {
6
+ const { siteConfig } = useDocusaurusContext();
7
+ return (
8
+ <Layout title={siteConfig.title} description={siteConfig.tagline}>
9
+ <main className="container margin-vert--xl">
10
+ <div className="row">
11
+ <div className="col col--8 col--offset-2" style={{ textAlign: 'center' }}>
12
+ <h1 style={{ fontSize: '3rem', marginBottom: '1rem' }}>
13
+ {siteConfig.title}
14
+ </h1>
15
+ <p style={{ fontSize: '1.25rem', color: 'var(--ifm-color-content-secondary)', marginBottom: '2rem' }}>
16
+ {{tagline}}
17
+ </p>
18
+ <div>
19
+ <Link
20
+ className="button button--primary button--lg"
21
+ to="/getting-started"
22
+ style={{ marginRight: '1rem' }}
23
+ >
24
+ Get Started
25
+ </Link>
26
+ <Link
27
+ className="button button--secondary button--lg"
28
+ to="/guides/writing-docs"
29
+ >
30
+ Read the Guides
31
+ </Link>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </main>
36
+ </Layout>
37
+ );
38
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export default function AdmonitionIconDanger(props) {
3
+ return (
4
+ <svg viewBox="0 0 12 16" {...props}>
5
+ <path
6
+ fillRule="evenodd"
7
+ d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"
8
+ />
9
+ </svg>
10
+ );
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export default function AdmonitionIconInfo(props) {
3
+ return (
4
+ <svg viewBox="0 0 14 16" {...props}>
5
+ <path
6
+ fillRule="evenodd"
7
+ d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"
8
+ />
9
+ </svg>
10
+ );
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export default function AdmonitionIconNote(props) {
3
+ return (
4
+ <svg viewBox="0 0 14 16" {...props}>
5
+ <path
6
+ fillRule="evenodd"
7
+ d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"
8
+ />
9
+ </svg>
10
+ );
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export default function AdmonitionIconTip(props) {
3
+ return (
4
+ <svg viewBox="0 0 12 16" {...props}>
5
+ <path
6
+ fillRule="evenodd"
7
+ d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"
8
+ />
9
+ </svg>
10
+ );
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export default function AdmonitionIconCaution(props) {
3
+ return (
4
+ <svg viewBox="0 0 16 16" {...props}>
5
+ <path
6
+ fillRule="evenodd"
7
+ d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"
8
+ />
9
+ </svg>
10
+ );
11
+ }
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {ThemeClassNames} from '@docusaurus/theme-common';
4
+ import styles from './styles.module.css';
5
+ function AdmonitionContainer({type, className, children}) {
6
+ return (
7
+ <div
8
+ className={clsx(
9
+ ThemeClassNames.common.admonition,
10
+ ThemeClassNames.common.admonitionType(type),
11
+ styles.admonition,
12
+ className,
13
+ )}>
14
+ {children}
15
+ </div>
16
+ );
17
+ }
18
+ function AdmonitionHeading({icon, title}) {
19
+ return (
20
+ <div className={styles.admonitionHeading}>
21
+ <span className={styles.admonitionIcon}>{icon}</span>
22
+ {title}
23
+ </div>
24
+ );
25
+ }
26
+ function AdmonitionContent({children}) {
27
+ return children ? (
28
+ <div className={styles.admonitionContent}>{children}</div>
29
+ ) : null;
30
+ }
31
+ export default function AdmonitionLayout(props) {
32
+ const {type, icon, title, children, className} = props;
33
+ return (
34
+ <AdmonitionContainer type={type} className={className}>
35
+ {title || icon ? <AdmonitionHeading title={title} icon={icon} /> : null}
36
+ <AdmonitionContent>{children}</AdmonitionContent>
37
+ </AdmonitionContainer>
38
+ );
39
+ }
@@ -0,0 +1,36 @@
1
+ .admonition {
2
+ margin-top: 1rem;
3
+ margin-bottom: 1em;
4
+ }
5
+
6
+ .admonitionHeading {
7
+ font: var(--ifm-heading-font-weight) var(--ifm-h5-font-size) /
8
+ var(--ifm-heading-line-height) var(--ifm-heading-font-family);
9
+ text-transform: uppercase;
10
+ }
11
+
12
+ /* Heading alone without content (does not handle fragment content) */
13
+ .admonitionHeading:not(:last-child) {
14
+ margin-bottom: 0.3rem;
15
+ }
16
+
17
+ .admonitionHeading code {
18
+ text-transform: none;
19
+ }
20
+
21
+ .admonitionIcon {
22
+ display: inline-block;
23
+ vertical-align: middle;
24
+ margin-right: 0.4em;
25
+ }
26
+
27
+ .admonitionIcon svg {
28
+ display: inline-block;
29
+ height: 1.6em;
30
+ width: 1.6em;
31
+ fill: var(--ifm-alert-foreground-color);
32
+ }
33
+
34
+ .admonitionContent > :last-child {
35
+ margin-bottom: 0;
36
+ }
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import Translate from '@docusaurus/Translate';
4
+ import AdmonitionLayout from '@theme/Admonition/Layout';
5
+ import IconWarning from '@theme/Admonition/Icon/Warning';
6
+ const infimaClassName = 'alert alert--warning';
7
+ const defaultProps = {
8
+ icon: <IconWarning />,
9
+ title: (
10
+ <Translate
11
+ id="theme.admonition.caution"
12
+ description="The default label used for the Caution admonition (:::caution)">
13
+ caution
14
+ </Translate>
15
+ ),
16
+ };
17
+ // TODO remove before v4: Caution replaced by Warning
18
+ // see https://github.com/facebook/docusaurus/issues/7558
19
+ export default function AdmonitionTypeCaution(props) {
20
+ return (
21
+ <AdmonitionLayout
22
+ {...defaultProps}
23
+ {...props}
24
+ className={clsx(infimaClassName, props.className)}>
25
+ {props.children}
26
+ </AdmonitionLayout>
27
+ );
28
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import Translate from '@docusaurus/Translate';
4
+ import AdmonitionLayout from '@theme/Admonition/Layout';
5
+ import IconDanger from '@theme/Admonition/Icon/Danger';
6
+ const infimaClassName = 'alert alert--danger';
7
+ const defaultProps = {
8
+ icon: <IconDanger />,
9
+ title: (
10
+ <Translate
11
+ id="theme.admonition.danger"
12
+ description="The default label used for the Danger admonition (:::danger)">
13
+ danger
14
+ </Translate>
15
+ ),
16
+ };
17
+ export default function AdmonitionTypeDanger(props) {
18
+ return (
19
+ <AdmonitionLayout
20
+ {...defaultProps}
21
+ {...props}
22
+ className={clsx(infimaClassName, props.className)}>
23
+ {props.children}
24
+ </AdmonitionLayout>
25
+ );
26
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import Translate from '@docusaurus/Translate';
4
+ import AdmonitionLayout from '@theme/Admonition/Layout';
5
+ import IconInfo from '@theme/Admonition/Icon/Info';
6
+ const infimaClassName = 'alert alert--info';
7
+ const defaultProps = {
8
+ icon: <IconInfo />,
9
+ title: (
10
+ <Translate
11
+ id="theme.admonition.info"
12
+ description="The default label used for the Info admonition (:::info)">
13
+ info
14
+ </Translate>
15
+ ),
16
+ };
17
+ export default function AdmonitionTypeInfo(props) {
18
+ return (
19
+ <AdmonitionLayout
20
+ {...defaultProps}
21
+ {...props}
22
+ className={clsx(infimaClassName, props.className)}>
23
+ {props.children}
24
+ </AdmonitionLayout>
25
+ );
26
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import Translate from '@docusaurus/Translate';
4
+ import AdmonitionLayout from '@theme/Admonition/Layout';
5
+ import IconNote from '@theme/Admonition/Icon/Note';
6
+ const infimaClassName = 'alert alert--secondary';
7
+ const defaultProps = {
8
+ icon: <IconNote />,
9
+ title: (
10
+ <Translate
11
+ id="theme.admonition.note"
12
+ description="The default label used for the Note admonition (:::note)">
13
+ note
14
+ </Translate>
15
+ ),
16
+ };
17
+ export default function AdmonitionTypeNote(props) {
18
+ return (
19
+ <AdmonitionLayout
20
+ {...defaultProps}
21
+ {...props}
22
+ className={clsx(infimaClassName, props.className)}>
23
+ {props.children}
24
+ </AdmonitionLayout>
25
+ );
26
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import Translate from '@docusaurus/Translate';
4
+ import AdmonitionLayout from '@theme/Admonition/Layout';
5
+ import IconTip from '@theme/Admonition/Icon/Tip';
6
+ const infimaClassName = 'alert alert--success';
7
+ const defaultProps = {
8
+ icon: <IconTip />,
9
+ title: (
10
+ <Translate
11
+ id="theme.admonition.tip"
12
+ description="The default label used for the Tip admonition (:::tip)">
13
+ tip
14
+ </Translate>
15
+ ),
16
+ };
17
+ export default function AdmonitionTypeTip(props) {
18
+ return (
19
+ <AdmonitionLayout
20
+ {...defaultProps}
21
+ {...props}
22
+ className={clsx(infimaClassName, props.className)}>
23
+ {props.children}
24
+ </AdmonitionLayout>
25
+ );
26
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import Translate from '@docusaurus/Translate';
4
+ import AdmonitionLayout from '@theme/Admonition/Layout';
5
+ import IconWarning from '@theme/Admonition/Icon/Warning';
6
+ const infimaClassName = 'alert alert--warning';
7
+ const defaultProps = {
8
+ icon: <IconWarning />,
9
+ title: (
10
+ <Translate
11
+ id="theme.admonition.warning"
12
+ description="The default label used for the Warning admonition (:::warning)">
13
+ warning
14
+ </Translate>
15
+ ),
16
+ };
17
+ export default function AdmonitionTypeWarning(props) {
18
+ return (
19
+ <AdmonitionLayout
20
+ {...defaultProps}
21
+ {...props}
22
+ className={clsx(infimaClassName, props.className)}>
23
+ {props.children}
24
+ </AdmonitionLayout>
25
+ );
26
+ }
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import AdmonitionTypeNote from '@theme/Admonition/Type/Note';
3
+ import AdmonitionTypeTip from '@theme/Admonition/Type/Tip';
4
+ import AdmonitionTypeInfo from '@theme/Admonition/Type/Info';
5
+ import AdmonitionTypeWarning from '@theme/Admonition/Type/Warning';
6
+ import AdmonitionTypeDanger from '@theme/Admonition/Type/Danger';
7
+ import AdmonitionTypeCaution from '@theme/Admonition/Type/Caution';
8
+ const admonitionTypes = {
9
+ note: AdmonitionTypeNote,
10
+ tip: AdmonitionTypeTip,
11
+ info: AdmonitionTypeInfo,
12
+ warning: AdmonitionTypeWarning,
13
+ danger: AdmonitionTypeDanger,
14
+ };
15
+ // Undocumented legacy admonition type aliases
16
+ // Provide hardcoded/untranslated retrocompatible label
17
+ // See also https://github.com/facebook/docusaurus/issues/7767
18
+ const admonitionAliases = {
19
+ secondary: (props) => <AdmonitionTypeNote title="secondary" {...props} />,
20
+ important: (props) => <AdmonitionTypeInfo title="important" {...props} />,
21
+ success: (props) => <AdmonitionTypeTip title="success" {...props} />,
22
+ caution: AdmonitionTypeCaution,
23
+ };
24
+ export default {
25
+ ...admonitionTypes,
26
+ ...admonitionAliases,
27
+ };
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import {processAdmonitionProps} from '@docusaurus/theme-common';
3
+ import AdmonitionTypes from '@theme/Admonition/Types';
4
+ function getAdmonitionTypeComponent(type) {
5
+ const component = AdmonitionTypes[type];
6
+ if (component) {
7
+ return component;
8
+ }
9
+ console.warn(
10
+ `No admonition component found for admonition type "${type}". Using Info as fallback.`,
11
+ );
12
+ return AdmonitionTypes.info;
13
+ }
14
+ export default function Admonition(unprocessedProps) {
15
+ const props = processAdmonitionProps(unprocessedProps);
16
+ const AdmonitionTypeComponent = getAdmonitionTypeComponent(props.type);
17
+ return <AdmonitionTypeComponent {...props} />;
18
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {translate} from '@docusaurus/Translate';
4
+ import IconClose from '@theme/Icon/Close';
5
+ import styles from './styles.module.css';
6
+ export default function AnnouncementBarCloseButton(props) {
7
+ return (
8
+ <button
9
+ type="button"
10
+ aria-label={translate({
11
+ id: 'theme.AnnouncementBar.closeButtonAriaLabel',
12
+ message: 'Close',
13
+ description: 'The ARIA label for close button of announcement bar',
14
+ })}
15
+ {...props}
16
+ className={clsx('clean-btn close', styles.closeButton, props.className)}>
17
+ <IconClose width={14} height={14} strokeWidth={3.1} />
18
+ </button>
19
+ );
20
+ }
@@ -0,0 +1,4 @@
1
+ .closeButton {
2
+ padding: 0;
3
+ line-height: 0;
4
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {useThemeConfig} from '@docusaurus/theme-common';
4
+ import styles from './styles.module.css';
5
+ export default function AnnouncementBarContent(props) {
6
+ const {announcementBar} = useThemeConfig();
7
+ const {content} = announcementBar;
8
+ return (
9
+ <div
10
+ {...props}
11
+ className={clsx(styles.content, props.className)}
12
+ // Developer provided the HTML, so assume it's safe.
13
+ // eslint-disable-next-line react/no-danger
14
+ dangerouslySetInnerHTML={{__html: content}}
15
+ />
16
+ );
17
+ }
@@ -0,0 +1,10 @@
1
+ .content {
2
+ font-size: 85%;
3
+ text-align: center;
4
+ padding: 12px 0;
5
+ }
6
+
7
+ .content a {
8
+ color: inherit;
9
+ text-decoration: underline;
10
+ }
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import clsx from 'clsx';
3
+ import {ThemeClassNames, useThemeConfig} from '@docusaurus/theme-common';
4
+ import {useAnnouncementBar} from '@docusaurus/theme-common/internal';
5
+ import AnnouncementBarCloseButton from '@theme/AnnouncementBar/CloseButton';
6
+ import AnnouncementBarContent from '@theme/AnnouncementBar/Content';
7
+ import styles from './styles.module.css';
8
+ export default function AnnouncementBar() {
9
+ const {announcementBar} = useThemeConfig();
10
+ const {isActive, close} = useAnnouncementBar();
11
+ if (!isActive) {
12
+ return null;
13
+ }
14
+ const {backgroundColor, textColor, isCloseable} = announcementBar;
15
+ return (
16
+ <div
17
+ className={clsx(
18
+ ThemeClassNames.announcementBar.container,
19
+ styles.announcementBar,
20
+ )}
21
+ style={{backgroundColor, color: textColor}}
22
+ role="banner">
23
+ {isCloseable && <div className={styles.announcementBarPlaceholder} />}
24
+ <AnnouncementBarContent className={styles.announcementBarContent} />
25
+ {isCloseable && (
26
+ <AnnouncementBarCloseButton
27
+ onClick={close}
28
+ className={styles.announcementBarClose}
29
+ />
30
+ )}
31
+ </div>
32
+ );
33
+ }
@@ -0,0 +1,55 @@
1
+ :root {
2
+ --docusaurus-announcement-bar-height: auto;
3
+ }
4
+
5
+ .announcementBar {
6
+ display: flex;
7
+ align-items: center;
8
+ height: var(--docusaurus-announcement-bar-height);
9
+ background-color: var(--ifm-color-white);
10
+ color: var(--ifm-color-black);
11
+
12
+ /*
13
+ Unfortunately we can't make announcement bar render above the navbar
14
+ IE need to use border-bottom instead of shadow
15
+ See https://github.com/facebookincubator/infima/issues/275
16
+
17
+ box-shadow: var(--ifm-global-shadow-lw);
18
+ z-index: calc(var(--ifm-z-index-fixed) + 1);
19
+ */
20
+ border-bottom: 1px solid var(--ifm-color-emphasis-100);
21
+ }
22
+
23
+ html[data-announcement-bar-initially-dismissed='true'] .announcementBar {
24
+ display: none;
25
+ }
26
+
27
+ .announcementBarPlaceholder {
28
+ flex: 0 0 10px;
29
+ }
30
+
31
+ .announcementBarClose {
32
+ flex: 0 0 30px;
33
+ align-self: stretch;
34
+ }
35
+
36
+ .announcementBarContent {
37
+ flex: 1 1 auto;
38
+ }
39
+
40
+ @media print {
41
+ .announcementBar {
42
+ display: none;
43
+ }
44
+ }
45
+
46
+ @media (min-width: 997px) {
47
+ :root {
48
+ --docusaurus-announcement-bar-height: 30px;
49
+ }
50
+
51
+ .announcementBarPlaceholder,
52
+ .announcementBarClose {
53
+ flex-basis: 50px;
54
+ }
55
+ }
@@ -0,0 +1,35 @@
1
+ import React, {memo} from 'react';
2
+ import {useThemeConfig} from '@docusaurus/theme-common';
3
+ import {groupBlogSidebarItemsByYear} from '@docusaurus/plugin-content-blog/client';
4
+ import Heading from '@theme/Heading';
5
+ function BlogSidebarYearGroup({year, yearGroupHeadingClassName, children}) {
6
+ return (
7
+ <div role="group">
8
+ <Heading as="h3" className={yearGroupHeadingClassName}>
9
+ {year}
10
+ </Heading>
11
+ {children}
12
+ </div>
13
+ );
14
+ }
15
+ function BlogSidebarContent({items, yearGroupHeadingClassName, ListComponent}) {
16
+ const themeConfig = useThemeConfig();
17
+ if (themeConfig.blog.sidebar.groupByYear) {
18
+ const itemsByYear = groupBlogSidebarItemsByYear(items);
19
+ return (
20
+ <>
21
+ {itemsByYear.map(([year, yearItems]) => (
22
+ <BlogSidebarYearGroup
23
+ key={year}
24
+ year={year}
25
+ yearGroupHeadingClassName={yearGroupHeadingClassName}>
26
+ <ListComponent items={yearItems} />
27
+ </BlogSidebarYearGroup>
28
+ ))}
29
+ </>
30
+ );
31
+ } else {
32
+ return <ListComponent items={items} />;
33
+ }
34
+ }
35
+ export default memo(BlogSidebarContent);
@@ -0,0 +1,44 @@
1
+ import React, {memo} from 'react';
2
+ import clsx from 'clsx';
3
+ import {translate} from '@docusaurus/Translate';
4
+ import {
5
+ useVisibleBlogSidebarItems,
6
+ BlogSidebarItemList,
7
+ } from '@docusaurus/plugin-content-blog/client';
8
+ import BlogSidebarContent from '@theme/BlogSidebar/Content';
9
+ import styles from './styles.module.css';
10
+ const ListComponent = ({items}) => {
11
+ return (
12
+ <BlogSidebarItemList
13
+ items={items}
14
+ ulClassName={clsx(styles.sidebarItemList, 'clean-list')}
15
+ liClassName={styles.sidebarItem}
16
+ linkClassName={styles.sidebarItemLink}
17
+ linkActiveClassName={styles.sidebarItemLinkActive}
18
+ />
19
+ );
20
+ };
21
+ function BlogSidebarDesktop({sidebar}) {
22
+ const items = useVisibleBlogSidebarItems(sidebar.items);
23
+ return (
24
+ <aside className={clsx("col col--3", styles.sidebarContainer)}>
25
+ <nav
26
+ className={clsx(styles.sidebar, 'thin-scrollbar')}
27
+ aria-label={translate({
28
+ id: 'theme.blog.sidebar.navAriaLabel',
29
+ message: 'Blog recent posts navigation',
30
+ description: 'The ARIA label for recent posts in the blog sidebar',
31
+ })}>
32
+ <div className={clsx(styles.sidebarItemTitle, 'margin-bottom--md')}>
33
+ {sidebar.title}
34
+ </div>
35
+ <BlogSidebarContent
36
+ items={items}
37
+ ListComponent={ListComponent}
38
+ yearGroupHeadingClassName={styles.yearGroupHeading}
39
+ />
40
+ </nav>
41
+ </aside>
42
+ );
43
+ }
44
+ export default memo(BlogSidebarDesktop);