diff --git a/src/theme/AnnouncementBar/CloseButton/index.tsx b/src/theme/AnnouncementBar/CloseButton/index.tsx deleted file mode 100644 index 96a29812b23..00000000000 --- a/src/theme/AnnouncementBar/CloseButton/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { translate } from '@docusaurus/Translate'; -import type { Props } from '@theme/AnnouncementBar/CloseButton'; -import IconClose from '@theme/Icon/Close'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './styles.module.css'; - -export default function AnnouncementBarCloseButton(props: Props): React.Element | null { - return ( - - ); -} diff --git a/src/theme/AnnouncementBar/CloseButton/styles.module.css b/src/theme/AnnouncementBar/CloseButton/styles.module.css deleted file mode 100644 index 3ae5f4a1dfc..00000000000 --- a/src/theme/AnnouncementBar/CloseButton/styles.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.closeButton { - line-height: 0; - padding: 0; -} diff --git a/src/theme/AnnouncementBar/Content/index.tsx b/src/theme/AnnouncementBar/Content/index.tsx deleted file mode 100644 index 5a9e133da8c..00000000000 --- a/src/theme/AnnouncementBar/Content/index.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { useThemeConfig } from '@docusaurus/theme-common'; -import type { Props } from '@theme/AnnouncementBar/Content'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './styles.module.css'; - -export default function AnnouncementBarContent(props: Props): React.Element | null { - const { announcementBar } = useThemeConfig(); - const { content } = announcementBar!; - return ( -
- ); -} diff --git a/src/theme/AnnouncementBar/Content/styles.module.css b/src/theme/AnnouncementBar/Content/styles.module.css deleted file mode 100644 index 19cf9b3907b..00000000000 --- a/src/theme/AnnouncementBar/Content/styles.module.css +++ /dev/null @@ -1,14 +0,0 @@ -.content { - --utrecht-link-color: auto; - - font-size: 16px; - padding: 8px 10px; - text-align: center; -} - -.content a { - --utrecht-link-color: currentColor; - --utrecht-link-hover-color: currentColor; - --utrecht-link-text-decoration-color: currentColor; - --ifm-link-hover-color: currentColor; -} diff --git a/src/theme/AnnouncementBar/index.tsx b/src/theme/AnnouncementBar/index.tsx deleted file mode 100644 index 582948fe77c..00000000000 --- a/src/theme/AnnouncementBar/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useThemeConfig } from '@docusaurus/theme-common'; -import { useAnnouncementBar } from '@docusaurus/theme-common/internal'; -import AnnouncementBarCloseButton from '@theme/AnnouncementBar/CloseButton'; -import AnnouncementBarContent from '@theme/AnnouncementBar/Content'; -import React from 'react'; -import styles from './styles.module.css'; - -export default function AnnouncementBar(): React.Element | null { - const { announcementBar } = useThemeConfig(); - const { isActive, close } = useAnnouncementBar(); - if (!isActive) { - return null; - } - const { backgroundColor, textColor, isCloseable } = announcementBar!; - return ( -
- {isCloseable &&
} - - {isCloseable && } -
- ); -} diff --git a/src/theme/AnnouncementBar/styles.module.css b/src/theme/AnnouncementBar/styles.module.css deleted file mode 100644 index f0d2b170abd..00000000000 --- a/src/theme/AnnouncementBar/styles.module.css +++ /dev/null @@ -1,55 +0,0 @@ -:root { - --docusaurus-announcement-bar-height: auto; -} - -.announcementBar { - align-items: center; - background-color: var(--ifm-color-white); - - /* - Unfortunately we can't make announcement bar render above the navbar - IE need to use border-bottom instead of shadow - See https://github.com/facebookincubator/infima/issues/275 - - box-shadow: var(--ifm-global-shadow-lw); - z-index: calc(var(--ifm-z-index-fixed) + 1); - */ - border-bottom: 1px solid var(--ifm-color-emphasis-100); - color: var(--ifm-color-black); - display: flex; - height: var(--docusaurus-announcement-bar-height); -} - -html[data-announcement-bar-initially-dismissed="true"] .announcementBar { - display: none; -} - -.announcementBarPlaceholder { - flex: 0 0 10px; -} - -.announcementBarClose { - align-self: stretch; - flex: 0 0 30px; -} - -.announcementBarContent { - flex: 1 1 auto; -} - -@media print { - .announcementBar { - display: none; - } -} - -@media (width >= 997px) { - :root { - --docusaurus-announcement-bar-height: 30px; - } - - .announcementBarPlaceholder, - .announcementBarClose { - flex-basis: 50px; - } -} diff --git a/src/theme/BlogLayout/index.tsx b/src/theme/BlogLayout/index.tsx deleted file mode 100644 index e24ad82472d..00000000000 --- a/src/theme/BlogLayout/index.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { BreadcrumbNav } from '@site/src/components/BreadcrumbNav'; -import type { Props } from '@theme/BlogLayout'; -import Layout from '@theme/Layout'; -import clsx from 'clsx'; -import React, { PropsWithChildren } from 'react'; - -interface BlogLayoutProps extends Props { - breadcrumbs: { label: string; href?: string; rel?: string }[]; -} - -export default function BlogLayout(props: PropsWithChildren): React.Element { - const { sidebar, toc, breadcrumbs = [], children, ...layoutProps } = props; - const hasSidebar = sidebar && sidebar.items.length > 0; - - return ( - -
-
-
- -
-
- {children} -
- {toc &&
{toc}
} -
-
-
- ); -} diff --git a/src/theme/BlogListPage/index.tsx b/src/theme/BlogListPage/index.tsx deleted file mode 100644 index 976871aa482..00000000000 --- a/src/theme/BlogListPage/index.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { HtmlClassNameProvider, PageMetadata, ThemeClassNames } from '@docusaurus/theme-common'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import type { Props } from '@theme/BlogListPage'; -import BlogListPaginator from '@theme/BlogListPaginator'; -import BlogPostItems from '@theme/BlogPostItems'; -import SearchMetadata from '@theme/SearchMetadata'; -import { Heading1 } from '@utrecht/component-library-react'; -import clsx from 'clsx'; -import React from 'react'; -import BlogLayout from '../BlogLayout'; - -function BlogListPageMetadata(props: Props): React.Element { - const { metadata } = props; - const { - siteConfig: { title: siteTitle }, - } = useDocusaurusContext(); - const { blogDescription, blogTitle, permalink } = metadata; - const isBlogOnlyMode = permalink === '/'; - const title = isBlogOnlyMode ? siteTitle : blogTitle; - return ( - <> - - - - ); -} - -function BlogListPageContent(props: Props): React.Element { - const { metadata, items, sidebar } = props; - return ( - - {metadata.blogTitle} - - - - ); -} - -export default function BlogListPage(props: Props): React.Element { - return ( - - - - - ); -} diff --git a/src/theme/BlogPostItems/index.tsx b/src/theme/BlogPostItems/index.tsx deleted file mode 100644 index 76434d3f44a..00000000000 --- a/src/theme/BlogPostItems/index.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import Link from '@docusaurus/Link'; -import { BlogPostProvider } from '@docusaurus/theme-common/internal'; -import { Card, CardContent, CardGroup } from '@site/src/components/CardGroup'; -import { IconCalendar, IconUser } from '@tabler/icons-react'; -import type { Props } from '@theme/BlogPostItems'; -import { BadgeList, DataBadge, Heading2, Icon } from '@utrecht/component-library-react'; -import clsx from 'clsx'; -import React from 'react'; -import style from './styles.module.css'; - -export default function BlogPostItems({ items }: Props): React.Element { - return ( - - {items.map(({ content }) => { - return ( - - - - - - {content.metadata.title} - - -
{content.metadata.description}
- - {content.metadata.authors.map((author) => ( - - - - - auteur: {author.name} - - ))} - - - - - publicatie datum:{' '} - - - -
-
-
- ); - })} -
- ); -} diff --git a/src/theme/BlogPostItems/styles.module.css b/src/theme/BlogPostItems/styles.module.css deleted file mode 100644 index 4d2bd7f7685..00000000000 --- a/src/theme/BlogPostItems/styles.module.css +++ /dev/null @@ -1,24 +0,0 @@ -.blog-card { - --utrecht-badge-list-item-margin-block: 8px; - --utrecht-badge-list-item-margin-inline: 16px; - --utrecht-badge-font-weight: 400; - --utrecht-badge-background-color: transparent; - --utrecht-badge-color: rgb(74 111 120); - --cardgroup-card-justify-content: start; - --utrecht-icon-size: 1em; - --utrecht-icon-inset-block-start: 0.12em; -} - -.blog-card__header-link { - --utrecht-link-text-decoration: none; -} - -.blog-card__header-link:hover { - --utrecht-link-text-decoration: underline; -} - -.blog-card__badge { - display: flex; - gap: 4px; - margin-block-start: 24px; -} diff --git a/src/theme/BlogPostPage/Metadata/index.tsx b/src/theme/BlogPostPage/Metadata/index.tsx deleted file mode 100644 index 10316df7bfb..00000000000 --- a/src/theme/BlogPostPage/Metadata/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { PageMetadata } from '@docusaurus/theme-common'; -import { useBlogPost } from '@docusaurus/theme-common/internal'; -import React from 'react'; - -export default function BlogPostPageMetadata(): React.Element { - const { assets, metadata } = useBlogPost(); - const { title, description, date, tags, authors, frontMatter } = metadata; - - const { keywords } = frontMatter; - const image = assets.image ?? frontMatter.image; - return ( - - - - {/* TODO double check those article meta array syntaxes, see https://ogp.me/#array */} - {authors.some((author) => author.url) && ( - author.url) - .filter(Boolean) - .join(',')} - /> - )} - {tags.length > 0 && tag.label).join(',')} />} - - ); -} diff --git a/src/theme/BlogPostPage/index.tsx b/src/theme/BlogPostPage/index.tsx deleted file mode 100644 index 38a7541a31b..00000000000 --- a/src/theme/BlogPostPage/index.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import type { BlogSidebar } from '@docusaurus/plugin-content-blog'; -import { HtmlClassNameProvider, ThemeClassNames } from '@docusaurus/theme-common'; -import { BlogPostProvider, useBlogPost } from '@docusaurus/theme-common/internal'; -import BlogPostItem from '@theme/BlogPostItem'; -import type { Props } from '@theme/BlogPostPage'; -import BlogPostPageMetadata from '@theme/BlogPostPage/Metadata'; -import BlogPostPaginator from '@theme/BlogPostPaginator'; -import TOC from '@theme/TOC'; -import clsx from 'clsx'; -import React, { type ReactNode } from 'react'; -import BlogLayout from '../BlogLayout'; - -function BlogPostPageContent({ sidebar, children }: { sidebar: BlogSidebar; children: ReactNode }): React.Element { - const { metadata, toc } = useBlogPost(); - const { nextItem, prevItem, frontMatter } = metadata; - const { - hide_table_of_contents: hideTableOfContents, - toc_min_heading_level: tocMinHeadingLevel, - toc_max_heading_level: tocMaxHeadingLevel, - } = frontMatter; - return ( - 0 ? ( - - ) : undefined - } - > - {children} - - {(nextItem || prevItem) && } - - ); -} - -export default function BlogPostPage(props: Props): React.Element { - const BlogPostContent = props.content; - return ( - - - - - - - - - ); -} diff --git a/src/theme/DocBreadcrumbs/index.tsx b/src/theme/DocBreadcrumbs/index.tsx deleted file mode 100644 index 69096b16e81..00000000000 --- a/src/theme/DocBreadcrumbs/index.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { ThemeClassNames } from '@docusaurus/theme-common'; -import { useSidebarBreadcrumbs } from '@docusaurus/theme-common/internal'; -import { BreadcrumbNav } from '@site/src/components/BreadcrumbNav'; -import React from 'react'; - -export default function DocBreadcrumbs(): React.Element | null { - const sidebarBreadcrumbs = - useSidebarBreadcrumbs()?.map((item) => { - if (item.type === 'category') { - return { ...item, ...item.items.find((i) => i.type === 'link'), label: item.label }; - } - return { href: item.href, label: item.label }; - }) || []; - - return ; -} diff --git a/src/theme/DocCard/index.tsx b/src/theme/DocCard/index.tsx deleted file mode 100644 index 38b7281696c..00000000000 --- a/src/theme/DocCard/index.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import Link from '@docusaurus/Link'; -import { translate } from '@docusaurus/Translate'; -import type { PropSidebarItemCategory, PropSidebarItemLink } from '@docusaurus/plugin-content-docs'; -import { findFirstSidebarItemLink, useDocById } from '@docusaurus/theme-common/internal'; -import type { Props } from '@theme/DocCard'; -import { Icon } from '@utrecht/component-library-react/dist/css-module'; -import clsx from 'clsx'; -import React, { type ReactNode } from 'react'; -import { ArrowNarrowRight } from 'tabler-icons-react'; -import styles from './styles.module.css'; - -function CardLayout({ - href, - icon = '', - title, - description, - linkDescription, -}: { - href: string; - linkDescription: string; - icon?: ReactNode; - title: string; - description?: string; -}): React.Element { - return ( -
-

- {icon} {title} -

- {description && ( -

- {description} -

- )} - - {linkDescription}{' '} - - - - -
- ); -} - -function CardCategory({ item }: { item: PropSidebarItemCategory }): React.Element | null { - const href = findFirstSidebarItemLink(item); - - // Unexpected: categories that don't have a link have been filtered upfront - if (!href) { - return null; - } - - return ( - - ); -} - -function CardLink({ item }: { item: PropSidebarItemLink }): React.Element { - const doc = useDocById(item.docId); - return ( - - ); -} - -export default function DocCard({ item }: Props): React.Element { - switch (item.type) { - case 'link': - return ; - case 'category': - return ; - default: - throw new Error(`unknown item type ${JSON.stringify(item)}`); - } -} diff --git a/src/theme/DocCard/styles.module.css b/src/theme/DocCard/styles.module.css deleted file mode 100644 index f28a6f065e8..00000000000 --- a/src/theme/DocCard/styles.module.css +++ /dev/null @@ -1,23 +0,0 @@ -.card { - --ifm-link-color: var(--nlds-interaction-color); - --ifm-link-hover-color: var(--ifm-color-emphasis-700); - --utrecht-icon-size: 20px; - --utrecht-icon-inset-block-start: 0.25em; - - background-color: white; - border: 2px solid #f5f5f5; - border-radius: 0; - box-shadow: 4px 4px #d1d1d1; - box-sizing: border-box; - color: #00303d; - padding-block: 24px; - padding-inline: 16px; -} - -.cardTitle { - font-size: 28px; -} - -.cardDescription { - font-size: 20px; -} diff --git a/src/theme/DocCardList/index.tsx b/src/theme/DocCardList/index.tsx deleted file mode 100644 index 51202854a93..00000000000 --- a/src/theme/DocCardList/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { filterDocCardListItems, useCurrentSidebarCategory } from '@docusaurus/theme-common'; -import DocCard from '@theme/DocCard'; -import type { Props } from '@theme/DocCardList'; -import clsx from 'clsx'; -import React from 'react'; - -function DocCardListForCurrentSidebarCategory({ className }: Props) { - const category = useCurrentSidebarCategory(); - return ; -} - -export default function DocCardList(props: Props): React.Element { - const { items, className } = props; - - if (!items) { - return ; - } - const filteredItems = filterDocCardListItems(items); - return ( -
- {filteredItems.map((item, index) => ( -
- -
- ))} -
- ); -} diff --git a/src/theme/DocCategoryGeneratedIndexPage/index.tsx b/src/theme/DocCategoryGeneratedIndexPage/index.tsx deleted file mode 100644 index af200af2768..00000000000 --- a/src/theme/DocCategoryGeneratedIndexPage/index.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { PageMetadata, useCurrentSidebarCategory } from '@docusaurus/theme-common'; -import useBaseUrl from '@docusaurus/useBaseUrl'; -import DocBreadcrumbs from '@theme/DocBreadcrumbs'; -import DocCardList from '@theme/DocCardList'; -import type { Props } from '@theme/DocCategoryGeneratedIndexPage'; -import DocPaginator from '@theme/DocPaginator'; -import DocVersionBadge from '@theme/DocVersionBadge'; -import DocVersionBanner from '@theme/DocVersionBanner'; -import Heading from '@theme/Heading'; -import React from 'react'; -import styles from './styles.module.css'; - -function DocCategoryGeneratedIndexPageMetadata({ categoryGeneratedIndex }: Props): React.Element { - return ( - - ); -} - -function DocCategoryGeneratedIndexPageContent({ categoryGeneratedIndex }: Props): React.Element { - const category = useCurrentSidebarCategory(); - return ( -
- - - -
- - {categoryGeneratedIndex.title} - - {categoryGeneratedIndex.description &&

{categoryGeneratedIndex.description}

} -
-
- -
-
- -
-
- ); -} - -export default function DocCategoryGeneratedIndexPage(props: Props): React.Element { - return ( - <> - - - - ); -} diff --git a/src/theme/DocCategoryGeneratedIndexPage/styles.module.css b/src/theme/DocCategoryGeneratedIndexPage/styles.module.css deleted file mode 100644 index 5aea19a0b0e..00000000000 --- a/src/theme/DocCategoryGeneratedIndexPage/styles.module.css +++ /dev/null @@ -1,24 +0,0 @@ -@media (width >= 997px) { - .generatedIndexPage { - max-width: 75%; - } - - .list article:nth-last-child(-n + 2) { - margin-bottom: 0; - } -} - -/* Duplicated from .markdown h1 */ -.title { - --ifm-h1-font-size: 3rem; - - margin-bottom: calc(1.25 * var(--ifm-leading)); -} - -.list article:last-child { - margin-bottom: 0; -} - -.navbar__items--right > :last-child { - padding: auto; -} diff --git a/src/theme/DocItem/Content/index.tsx b/src/theme/DocItem/Content/index.tsx deleted file mode 100644 index f03b17ddce2..00000000000 --- a/src/theme/DocItem/Content/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { ThemeClassNames } from '@docusaurus/theme-common'; -import { useDoc } from '@docusaurus/theme-common/internal'; -import type { Props } from '@theme/DocItem/Content'; -import Heading from '@theme/Heading'; -import MDXContent from '@theme/MDXContent'; -import clsx from 'clsx'; -import React from 'react'; - -/** - Title can be declared inside md content or declared through - front matter and added manually. To make both cases consistent, - the added title is added under the same div.markdown block - See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120 - - We render a "synthetic title" if: - - user doesn't ask to hide it with front matter - - the markdown content does not already contain a top-level h1 heading -*/ -function useSyntheticTitle(): string | null { - const { metadata, frontMatter, contentTitle } = useDoc(); - const shouldRender = !frontMatter.hide_title && typeof contentTitle === 'undefined'; - if (!shouldRender) { - return null; - } - return metadata.title; -} - -export default function DocItemContent({ children }: Props): React.Element { - const syntheticTitle = useSyntheticTitle(); - return ( -
- {syntheticTitle && ( -
- {syntheticTitle} -
- )} - {children} -
- ); -} diff --git a/src/theme/DocPage/Layout/Sidebar/ExpandButton/index.tsx b/src/theme/DocPage/Layout/Sidebar/ExpandButton/index.tsx deleted file mode 100644 index a0f5dc239ba..00000000000 --- a/src/theme/DocPage/Layout/Sidebar/ExpandButton/index.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { translate } from '@docusaurus/Translate'; -import { IconArrowBarToRight } from '@tabler/icons-react'; -import type { Props } from '@theme/DocPage/Layout/Sidebar/ExpandButton'; -import { LinkButton } from '@utrecht/component-library-react/dist/css-module'; -import React from 'react'; -import styles from './styles.module.css'; - -export default function DocPageLayoutSidebarExpandButton({ toggleSidebar }: Props): React.Element { - return ( - - - - ); -} diff --git a/src/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css b/src/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css deleted file mode 100644 index 4597ab9f1f1..00000000000 --- a/src/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css +++ /dev/null @@ -1,24 +0,0 @@ -@media (width >= 997px) { - .expandButton { - background-color: var(--docusaurus-collapse-button-bg); - height: 100%; - position: absolute; - right: 0; - top: 0; - transition: background-color var(--ifm-transition-fast) ease; - width: 100%; - } - - .expandButton:hover, - .expandButton:focus { - background-color: var(--docusaurus-collapse-button-bg-hover); - } - - .expandButtonIcon { - transform: rotate(0); - } - - [dir="rtl"] .expandButtonIcon { - transform: rotate(180deg); - } -} diff --git a/src/theme/DocPage/Layout/Sidebar/index.tsx b/src/theme/DocPage/Layout/Sidebar/index.tsx deleted file mode 100644 index df657be506e..00000000000 --- a/src/theme/DocPage/Layout/Sidebar/index.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { useLocation } from '@docusaurus/router'; -import { ThemeClassNames } from '@docusaurus/theme-common'; -import { useDocsSidebar } from '@docusaurus/theme-common/internal'; -import type { Props } from '@theme/DocPage/Layout/Sidebar'; -import DocSidebar from '@theme/DocSidebar'; -import clsx from 'clsx'; -import React, { type ReactNode, useCallback, useState } from 'react'; -import styles from './styles.module.css'; - -// Reset sidebar state when sidebar changes -// Use React key to unmount/remount the children -// See https://github.com/facebook/docusaurus/issues/3414 -function ResetOnSidebarChange({ children }: { children: ReactNode }) { - const sidebar = useDocsSidebar(); - return {children}; -} - -export default function DocPageLayoutSidebar({ - sidebar, - hiddenSidebarContainer, - setHiddenSidebarContainer, -}: Props): React.Element { - const { pathname } = useLocation(); - - const [hiddenSidebar, setHiddenSidebar] = useState(false); - const toggleSidebar = useCallback(() => { - setHiddenSidebar((t) => !t); - }, [setHiddenSidebarContainer, hiddenSidebar]); - - return ( - - ); -} diff --git a/src/theme/DocPage/Layout/Sidebar/styles.module.css b/src/theme/DocPage/Layout/Sidebar/styles.module.css deleted file mode 100644 index 139af38e33f..00000000000 --- a/src/theme/DocPage/Layout/Sidebar/styles.module.css +++ /dev/null @@ -1,22 +0,0 @@ -:root { - --doc-sidebar-width: 320px; - --doc-sidebar-hidden-width: 48px; -} - -.docSidebarContainer { - display: none; -} - -@media (width >= 997px) { - .docSidebarContainer { - bottom: 40px; - display: block; - height: calc(100vh - 80px); - position: sticky; - top: 80px; - } - - .sidebarViewport { - height: 100%; - } -} diff --git a/src/theme/DocSidebar/Desktop/Content/index.tsx b/src/theme/DocSidebar/Desktop/Content/index.tsx deleted file mode 100644 index faa43681bf4..00000000000 --- a/src/theme/DocSidebar/Desktop/Content/index.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { translate } from '@docusaurus/Translate'; -import { ThemeClassNames } from '@docusaurus/theme-common'; -import { useAnnouncementBar, useScrollPosition } from '@docusaurus/theme-common/internal'; -import type { Props } from '@theme/DocSidebar/Desktop/Content'; -import DocSidebarItems from '@theme/DocSidebarItems'; -import clsx from 'clsx'; -import React, { useState } from 'react'; -import styles from './styles.module.css'; - -function useShowAnnouncementBar() { - const { isActive } = useAnnouncementBar(); - const [showAnnouncementBar, setShowAnnouncementBar] = useState(isActive); - - useScrollPosition( - ({ scrollY }) => { - if (isActive) { - setShowAnnouncementBar(scrollY === 0); - } - }, - [isActive], - ); - return isActive && showAnnouncementBar; -} - -export default function DocSidebarDesktopContent({ path, sidebar, className }: Props): React.Element { - const showAnnouncementBar = useShowAnnouncementBar(); - - return ( - - ); -} diff --git a/src/theme/DocSidebar/Desktop/Content/styles.module.css b/src/theme/DocSidebar/Desktop/Content/styles.module.css deleted file mode 100644 index 47236a58eb1..00000000000 --- a/src/theme/DocSidebar/Desktop/Content/styles.module.css +++ /dev/null @@ -1,12 +0,0 @@ -@media (width >= 997px) { - .menu { - flex-grow: 1; - padding-block: 0.5rem; - padding-inline-end: 0; - padding-inline-start: 0.5rem; - } - - .menuWithAnnouncementBar { - margin-bottom: var(--docusaurus-announcement-bar-height); - } -} diff --git a/src/theme/DocSidebar/Desktop/index.tsx b/src/theme/DocSidebar/Desktop/index.tsx deleted file mode 100644 index f2b40d8d3fe..00000000000 --- a/src/theme/DocSidebar/Desktop/index.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { useThemeConfig } from '@docusaurus/theme-common'; -import { useHideableNavbar } from '@docusaurus/theme-common/internal'; -import { IconArrowBarToLeft, IconArrowBarToRight } from '@tabler/icons-react'; -import type { Props } from '@theme/DocSidebar/Desktop'; -import Content from '@theme/DocSidebar/Desktop/Content'; -import { Button } from '@utrecht/component-library-react/dist/css-module'; -import clsx from 'clsx'; -import React, { useId } from 'react'; -import styles from './styles.module.css'; - -function DocSidebarDesktop({ path, sidebar, onCollapse: toggleSidebar, isHidden }: Props) { - const { - navbar: { hideOnScroll }, - } = useThemeConfig(); - const { isNavbarVisible } = useHideableNavbar(hideOnScroll); - const sidebarId = useId(); - - return ( -
- - -
- -
-
- ); -} - -export default React.memo(DocSidebarDesktop); diff --git a/src/theme/DocSidebar/Desktop/styles.module.css b/src/theme/DocSidebar/Desktop/styles.module.css deleted file mode 100644 index 3ea699800c8..00000000000 --- a/src/theme/DocSidebar/Desktop/styles.module.css +++ /dev/null @@ -1,52 +0,0 @@ -@media (width >= 997px) { - .sidebar { - border-right: 1px solid var(--ifm-toc-border-color); - display: flex; - flex-direction: column; - height: 100%; - transition: width var(--ifm-transition-fast) ease; - width: var(--doc-sidebar-width); - will-change: width; - } - - .sidebarWithHideableNavbar { - padding-top: 0; - } - - .sidebarHidden { - width: 48px; - } - - .sidebar__content { - display: flex; - overflow-x: scroll; - scroll-behavior: smooth; - } - - .sidebar__content--hidden { - opacity: 0%; - visibility: hidden; - } - - .sidebar__toggle-button { - --utrecht-button-icon-gap: 8px; - --utrecht-button-font-size: 18px; - --utrecht-button-subtle-color: currentColor; - - align-items: center; - display: flex; - justify-content: flex-start !important; - margin: 0; - max-height: var(--ifm-navbar-height); - min-height: var(--ifm-navbar-height); - padding-inline-start: 24px; - text-decoration: none; - } - - .sidebar__toggle-button--icon-only { - align-items: center; - justify-content: center; - margin: 0; - padding: 0; - } -} diff --git a/src/theme/DocSidebar/Mobile/index.js b/src/theme/DocSidebar/Mobile/index.js deleted file mode 100644 index 6ba48c3616e..00000000000 --- a/src/theme/DocSidebar/Mobile/index.js +++ /dev/null @@ -1,31 +0,0 @@ -import { NavbarSecondaryMenuFiller, ThemeClassNames } from '@docusaurus/theme-common'; -import { useNavbarMobileSidebar } from '@docusaurus/theme-common/internal'; -import DocSidebarItems from '@theme/DocSidebarItems'; -import clsx from 'clsx'; -import React from 'react'; - -const DocSidebarMobileSecondaryMenu = ({ sidebar, path }) => { - const mobileSidebar = useNavbarMobileSidebar(); - return ( -
    - { - // Mobile sidebar should only be closed if the category has a link - if (item.type === 'category' && item.href) { - mobileSidebar.toggle(); - } - if (item.type === 'link') { - mobileSidebar.toggle(); - } - }} - level={1} - /> -
- ); -}; -function DocSidebarMobile(props) { - return ; -} -export default React.memo(DocSidebarMobile); diff --git a/src/theme/DocSidebar/index.js b/src/theme/DocSidebar/index.js deleted file mode 100644 index d992c39ab88..00000000000 --- a/src/theme/DocSidebar/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import { useWindowSize } from '@docusaurus/theme-common'; -import DocSidebarDesktop from '@theme/DocSidebar/Desktop'; -import DocSidebarMobile from '@theme/DocSidebar/Mobile'; -import React from 'react'; -export default function DocSidebar(props) { - const windowSize = useWindowSize(); - // Desktop sidebar visible on hydration: need SSR rendering - const shouldRenderSidebarDesktop = windowSize === 'desktop' || windowSize === 'ssr'; - // Mobile sidebar not visible on hydration: can avoid SSR rendering - const shouldRenderSidebarMobile = windowSize === 'mobile'; - return ( - <> - {shouldRenderSidebarDesktop && } - {shouldRenderSidebarMobile && } - - ); -} diff --git a/src/theme/DocSidebarItem/Category/index.tsx b/src/theme/DocSidebarItem/Category/index.tsx deleted file mode 100644 index c615da76b9a..00000000000 --- a/src/theme/DocSidebarItem/Category/index.tsx +++ /dev/null @@ -1,187 +0,0 @@ -import Link from '@docusaurus/Link'; -import { translate } from '@docusaurus/Translate'; -import { Collapsible, ThemeClassNames, useCollapsible, usePrevious, useThemeConfig } from '@docusaurus/theme-common'; -import { - findFirstSidebarItemLink, - isActiveSidebarItem, - useDocSidebarItemsExpandedState, -} from '@docusaurus/theme-common/internal'; -import useIsBrowser from '@docusaurus/useIsBrowser'; -import { IconChevronDown, IconChevronUp } from '@tabler/icons-react'; -import type { Props } from '@theme/DocSidebarItem/Category'; -import DocSidebarItems from '@theme/DocSidebarItems'; -import { Button, Icon } from '@utrecht/component-library-react/dist/css-module'; -import clsx from 'clsx'; -import React, { type ComponentProps, useEffect, useMemo } from 'react'; - -// If we navigate to a category and it becomes active, it should automatically -// expand itself -function useAutoExpandActiveCategory({ - isActive, - collapsed, - updateCollapsed, -}: { - isActive: boolean; - collapsed: boolean; - updateCollapsed: (_: boolean) => void; -}) { - const wasActive = usePrevious(isActive); - useEffect(() => { - const justBecameActive = isActive && !wasActive; - if (justBecameActive && collapsed) { - updateCollapsed(false); - } - }, [isActive, wasActive, collapsed, updateCollapsed]); -} - -/** - * When a collapsible category has no link, we still link it to its first child - * during SSR as a temporary fallback. This allows to be able to navigate inside - * the category even when JS fails to load, is delayed or simply disabled - * React hydration becomes an optional progressive enhancement - * see https://github.com/facebookincubator/infima/issues/36#issuecomment-772543188 - * see https://github.com/facebook/docusaurus/issues/3030 - */ -function useCategoryHrefWithSSRFallback(item: Props['item']): string | undefined { - const isBrowser = useIsBrowser(); - return useMemo(() => { - if (item.href) { - return item.href; - } - // In these cases, it's not necessary to render a fallback - // We skip the "findFirstSidebarItemLink" computation - if (isBrowser || !item.collapsible) { - return undefined; - } - return findFirstSidebarItemLink(item); - }, [item, isBrowser]); -} - -function CollapseButton({ - categoryLabel, - collapsed, - onClick, -}: { - categoryLabel: string; - collapsed: boolean; - onClick: ComponentProps<'button'>['onClick']; -}) { - return ( - - ); -} - -export default function DocSidebarItemCategory({ - item, - onItemClick, - activePath, - level, - index, - ...props -}: Props): React.Element { - const { items, label, collapsible, className, href } = item; - const isMainCategory = className === 'sidebar__main-category'; - const { - docs: { - sidebar: { autoCollapseCategories }, - }, - } = useThemeConfig(); - const hrefWithSSRFallback = useCategoryHrefWithSSRFallback(item); - - const isActive = isActiveSidebarItem(item, activePath); - - const { collapsed, setCollapsed } = useCollapsible({ - // Active categories are always initialized as expanded. The default - // (`item.collapsed`) is only used for non-active categories. - initialState: () => { - if (!collapsible) { - return false; - } - return isActive ? false : item.collapsed; - }, - }); - - const { expandedItem, setExpandedItem } = useDocSidebarItemsExpandedState(); - // Use this instead of `setCollapsed`, because it is also reactive - const updateCollapsed = (toCollapsed: boolean = !collapsed) => { - setExpandedItem(toCollapsed ? null : index); - setCollapsed(toCollapsed); - }; - useAutoExpandActiveCategory({ isActive, collapsed, updateCollapsed }); - useEffect(() => { - if ( - collapsible && - expandedItem !== null && - typeof expandedItem !== 'undefined' && - expandedItem !== index && - autoCollapseCategories - ) { - setCollapsed(true); - } - }, [collapsible, expandedItem, index, setCollapsed, autoCollapseCategories]); - - return ( -
  • -
    - {isMainCategory ? ( - label - ) : ( - - {label} - - )} - {href && collapsible && ( - { - e.preventDefault(); - updateCollapsed(); - }} - collapsed={collapsed} - /> - )} -
    - - - - -
  • - ); -} diff --git a/src/theme/DocSidebarItem/Html/index.tsx b/src/theme/DocSidebarItem/Html/index.tsx deleted file mode 100644 index 2583681acf7..00000000000 --- a/src/theme/DocSidebarItem/Html/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { ThemeClassNames } from '@docusaurus/theme-common'; -import type { Props } from '@theme/DocSidebarItem/Html'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './styles.module.css'; - -export default function DocSidebarItemHtml({ item, level, index }: Props): React.Element { - const { value, defaultStyle, className } = item; - return ( -
  • - ); -} diff --git a/src/theme/DocSidebarItem/Html/styles.module.css b/src/theme/DocSidebarItem/Html/styles.module.css deleted file mode 100644 index 426fc90bf65..00000000000 --- a/src/theme/DocSidebarItem/Html/styles.module.css +++ /dev/null @@ -1,5 +0,0 @@ -@media (width >= 997px) { - .menuHtmlItem { - padding: var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal); - } -} diff --git a/src/theme/DocSidebarItem/Link/index.tsx b/src/theme/DocSidebarItem/Link/index.tsx deleted file mode 100644 index b361799b420..00000000000 --- a/src/theme/DocSidebarItem/Link/index.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import Link from '@docusaurus/Link'; -import isInternalUrl from '@docusaurus/isInternalUrl'; -import { ThemeClassNames } from '@docusaurus/theme-common'; -import { isActiveSidebarItem } from '@docusaurus/theme-common/internal'; -import type { Props } from '@theme/DocSidebarItem/Link'; -import IconExternalLink from '@theme/Icon/ExternalLink'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './styles.module.css'; - -export default function DocSidebarItemLink({ - item, - onItemClick, - activePath, - level, - index: _, - ...props -}: Props): React.Element { - const { href, label, className, autoAddBaseUrl } = item; - const isActive = isActiveSidebarItem(item, activePath); - const isInternalLink = isInternalUrl(href); - return ( -
  • - onItemClick(item) : undefined, - })} - {...props} - > - {label} - {!isInternalLink && } - -
  • - ); -} diff --git a/src/theme/DocSidebarItem/Link/styles.module.css b/src/theme/DocSidebarItem/Link/styles.module.css deleted file mode 100644 index acba7f3f2ff..00000000000 --- a/src/theme/DocSidebarItem/Link/styles.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.menuExternalLink { - align-items: center; -} diff --git a/src/theme/DocSidebarItem/index.tsx b/src/theme/DocSidebarItem/index.tsx deleted file mode 100644 index cdf11b70e68..00000000000 --- a/src/theme/DocSidebarItem/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import type { Props } from '@theme/DocSidebarItem'; -import DocSidebarItemCategory from '@theme/DocSidebarItem/Category'; -import DocSidebarItemHtml from '@theme/DocSidebarItem/Html'; -import DocSidebarItemLink from '@theme/DocSidebarItem/Link'; -import React from 'react'; - -export default function DocSidebarItem({ item, ...props }: Props): React.Element | null { - switch (item.type) { - case 'category': - return ; - case 'html': - return ; - case 'link': - default: - return ; - } -} diff --git a/src/theme/DocSidebarItems/index.tsx b/src/theme/DocSidebarItems/index.tsx deleted file mode 100644 index 9c5020a7fea..00000000000 --- a/src/theme/DocSidebarItems/index.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { DocSidebarItemsExpandedStateProvider } from '@docusaurus/theme-common/internal'; -import DocSidebarItem from '@theme/DocSidebarItem'; -import type { Props } from '@theme/DocSidebarItems'; -import React, { memo } from 'react'; - -// TODO this item should probably not receive the "activePath" props -// TODO this triggers whole sidebar re-renders on navigation -function DocSidebarItems({ items, ...props }: Props): React.Element { - return ( - - {items.map((item, index) => ( - - ))} - - ); -} - -// Optimize sidebar at each "level" -export default memo(DocSidebarItems); diff --git a/src/theme/Footer/Copyright/index.tsx b/src/theme/Footer/Copyright/index.tsx deleted file mode 100644 index d31c6aff924..00000000000 --- a/src/theme/Footer/Copyright/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import type { Props } from '@theme/Footer/Copyright'; -import React from 'react'; - -export default function FooterCopyright({ copyright }: Props): React.Element { - return ( -
    - ); -} diff --git a/src/theme/Footer/Layout/Layout.module.css b/src/theme/Footer/Layout/Layout.module.css deleted file mode 100644 index 74409721909..00000000000 --- a/src/theme/Footer/Layout/Layout.module.css +++ /dev/null @@ -1,5 +0,0 @@ -.footer { - --utrecht-link-color: white; - --utrecht-link-text-decoration: none; - --utrecht-link-hover-text-decoration: underline; -} diff --git a/src/theme/Footer/Layout/index.tsx b/src/theme/Footer/Layout/index.tsx deleted file mode 100644 index 95350123895..00000000000 --- a/src/theme/Footer/Layout/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import type { Props } from '@theme/Footer/Layout'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './Layout.module.css'; - -export default function FooterLayout({ style, links, logo, copyright }: Props): React.Element { - return ( -
    -
    - {links} - {(logo || copyright) && ( -
    - {logo &&
    {logo}
    } - {copyright} -
    - )} -
    -
    - ); -} diff --git a/src/theme/Footer/LinkItem/index.tsx b/src/theme/Footer/LinkItem/index.tsx deleted file mode 100644 index 8acecb6bac7..00000000000 --- a/src/theme/Footer/LinkItem/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import Link from '@docusaurus/Link'; -import useBaseUrl from '@docusaurus/useBaseUrl'; -import type { Props } from '@theme/Footer/LinkItem'; -import clsx from 'clsx'; -import React from 'react'; - -export default function FooterLinkItem({ item }: Props): React.Element { - const { to, href, label, prependBaseUrlToHref, ...props } = item; - const toUrl = useBaseUrl(to); - const normalizedHref = useBaseUrl(href, { forcePrependBaseUrl: true }); - - return ( - - {label} - - ); -} diff --git a/src/theme/Footer/Links/MultiColumn/index.tsx b/src/theme/Footer/Links/MultiColumn/index.tsx deleted file mode 100644 index a1cf7dcc545..00000000000 --- a/src/theme/Footer/Links/MultiColumn/index.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import LinkItem from '@theme/Footer/LinkItem'; -import type { Props } from '@theme/Footer/Links/MultiColumn'; -import React from 'react'; - -type ColumnType = Props['columns'][number]; -type ColumnItemType = ColumnType['items'][number]; - -function ColumnLinkItem({ item }: { item: ColumnItemType }) { - return item.html ? ( -
  • - ) : ( -
  • - -
  • - ); -} - -function Column({ column }: { column: ColumnType }) { - return ( -
    -
    {column.title}
    -
      - {column.items.map((item, i) => ( - - ))} -
    -
    - ); -} - -export default function FooterLinksMultiColumn({ columns }: Props): React.Element { - return ( -
    - {columns.map((column, i) => ( - - ))} -
    - ); -} diff --git a/src/theme/Footer/Links/Simple/index.tsx b/src/theme/Footer/Links/Simple/index.tsx deleted file mode 100644 index 31373df1fce..00000000000 --- a/src/theme/Footer/Links/Simple/index.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import LinkItem from '@theme/Footer/LinkItem'; -import type { Props } from '@theme/Footer/Links/Simple'; -import React from 'react'; - -function Separator() { - return ยท; -} - -function SimpleLinkItem({ item }: { item: Props['links'][number] }) { - return item.html ? ( - - ) : ( - - ); -} - -export default function FooterLinksSimple({ links }: Props): React.Element { - return ( -
    -
    - {links.map((item, i) => ( - - - {links.length !== i + 1 && } - - ))} -
    -
    - ); -} diff --git a/src/theme/Footer/Links/index.tsx b/src/theme/Footer/Links/index.tsx deleted file mode 100644 index 5d92f93a65b..00000000000 --- a/src/theme/Footer/Links/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { isMultiColumnFooterLinks } from '@docusaurus/theme-common'; -import type { Props } from '@theme/Footer/Links'; -import FooterLinksMultiColumn from '@theme/Footer/Links/MultiColumn'; -import FooterLinksSimple from '@theme/Footer/Links/Simple'; -import React from 'react'; - -export default function FooterLinks({ links }: Props): React.Element { - return isMultiColumnFooterLinks(links) ? ( - - ) : ( - - ); -} diff --git a/src/theme/Footer/Logo/index.tsx b/src/theme/Footer/Logo/index.tsx deleted file mode 100644 index 9e62d084362..00000000000 --- a/src/theme/Footer/Logo/index.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import Link from '@docusaurus/Link'; -import { useBaseUrlUtils } from '@docusaurus/useBaseUrl'; -import type { Props } from '@theme/Footer/Logo'; -import ThemedImage from '@theme/ThemedImage'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './styles.module.css'; - -function LogoImage({ logo }: Props) { - const { withBaseUrl } = useBaseUrlUtils(); - const sources = { - light: withBaseUrl(logo.src), - dark: withBaseUrl(logo.srcDark ?? logo.src), - }; - return ( - - ); -} - -export default function FooterLogo({ logo }: Props): React.Element { - return logo.href ? ( - - - - ) : ( - - ); -} diff --git a/src/theme/Footer/Logo/styles.module.css b/src/theme/Footer/Logo/styles.module.css deleted file mode 100644 index ae513b2169b..00000000000 --- a/src/theme/Footer/Logo/styles.module.css +++ /dev/null @@ -1,8 +0,0 @@ -.footerLogoLink { - opacity: 50%; - transition: opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default); -} - -.footerLogoLink:hover { - opacity: 100%; -} diff --git a/src/theme/Footer/index.tsx b/src/theme/Footer/index.tsx deleted file mode 100644 index e0fb0990f9e..00000000000 --- a/src/theme/Footer/index.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { useThemeConfig } from '@docusaurus/theme-common'; -import FooterCopyright from '@theme/Footer/Copyright'; -import FooterLayout from '@theme/Footer/Layout'; -import FooterLinks from '@theme/Footer/Links'; -import FooterLogo from '@theme/Footer/Logo'; -import React from 'react'; - -function Footer(): React.Element | null { - const { footer } = useThemeConfig(); - if (!footer) { - return null; - } - const { copyright, links, logo, style } = footer; - - return ( - 0 && } - logo={logo && } - copyright={copyright && } - /> - ); -} - -export default React.memo(Footer); diff --git a/src/theme/Logo/index.tsx b/src/theme/Logo/index.tsx deleted file mode 100644 index 27444d200b9..00000000000 --- a/src/theme/Logo/index.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import Link from '@docusaurus/Link'; -import { type NavbarLogo, useThemeConfig } from '@docusaurus/theme-common'; -import { useNavbarMobileSidebar } from '@docusaurus/theme-common/internal'; -import useBaseUrl from '@docusaurus/useBaseUrl'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import type { Props } from '@theme/Logo'; -import ThemedImage from '@theme/ThemedImage'; -import React from 'react'; - -function LogoThemedImage({ logo, alt, imageClassName }: { logo: NavbarLogo; alt: string; imageClassName?: string }) { - const sources = { - light: useBaseUrl(logo.src), - dark: useBaseUrl(logo.srcDark || logo.src), - }; - const themedImage = ( - - ); - - // Is this extra div really necessary? - // introduced in https://github.com/facebook/docusaurus/pull/5666 - return imageClassName ?
    {themedImage}
    : themedImage; -} - -export default function Logo(props: Props): React.Element { - const { - siteConfig: { title }, - } = useDocusaurusContext(); - const { - navbar: { title: navbarTitle, logo }, - } = useThemeConfig(); - - const { shouldRender: isMobile } = useNavbarMobileSidebar(); - - const { imageClassName, titleClassName, ...propsRest } = props; - const logoLink = useBaseUrl(logo?.href || '/'); - - // If visible title is shown, fallback alt text should be - // an empty string to mark the logo as decorative. - const fallbackAlt = navbarTitle ? '' : title; - - // Use logo alt text if provided (including empty string), - // and provide a sensible fallback otherwise. - const alt = logo?.alt ?? fallbackAlt; - - return ( - - {logo && !isMobile && } - {navbarTitle && {navbarTitle}} - - ); -} diff --git a/src/theme/MDXComponents/A.tsx b/src/theme/MDXComponents/A.tsx deleted file mode 100644 index 2dd298e68b5..00000000000 --- a/src/theme/MDXComponents/A.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import type { Props } from '@theme/MDXComponents/A'; -import { Link } from '@utrecht/component-library-react/dist/css-module'; -import React from 'react'; - -export default function MDXA({ href, hrefLang, className, children }: Props): React.Element { - return ( - - {children} - - ); -} diff --git a/src/theme/MDXComponents/Code.tsx b/src/theme/MDXComponents/Code.tsx deleted file mode 100644 index ec277d0746c..00000000000 --- a/src/theme/MDXComponents/Code.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import CodeBlock from '@theme/CodeBlock'; -import type { Props } from '@theme/MDXComponents/Code'; -import type { ComponentProps } from 'react'; -import React, { isValidElement } from 'react'; - -export default function MDXCode(props: Props): React.Element { - const inlineElements: (string | undefined)[] = [ - 'a', - 'abbr', - 'b', - 'br', - 'button', - 'cite', - 'code', - 'del', - 'dfn', - 'em', - 'i', - 'img', - 'input', - 'ins', - 'kbd', - 'label', - 'object', - 'output', - 'q', - 'ruby', - 's', - 'small', - 'span', - 'strong', - 'sub', - 'sup', - 'time', - 'u', - 'var', - 'wbr', - ]; - const shouldBeInline = React.Children.toArray(props.children).every( - (el) => - (typeof el === 'string' && !el.includes('\n')) || - (isValidElement(el) && inlineElements.includes((el.props as { mdxType: string } | null)?.mdxType)), - ); - - return shouldBeInline ? : )} />; -} diff --git a/src/theme/MDXComponents/Details.tsx b/src/theme/MDXComponents/Details.tsx deleted file mode 100644 index 3e5d5b30ddf..00000000000 --- a/src/theme/MDXComponents/Details.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import Details from '@theme/Details'; -import type { Props } from '@theme/MDXComponents/Details'; -import React, { type ComponentProps, type ReactElement } from 'react'; - -export default function MDXDetails(props: Props): React.Element { - const items = React.Children.toArray(props.children); - // Split summary item from the rest to pass it as a separate prop to the - // Details theme component - const summary = items.find( - (item): item is ReactElement> => - React.isValidElement(item) && (item.props as { mdxType: string } | null)?.mdxType === 'summary', - ); - const children = <>{items.filter((item) => item !== summary)}; - - return ( -
    - {children} -
    - ); -} diff --git a/src/theme/MDXComponents/Head.tsx b/src/theme/MDXComponents/Head.tsx deleted file mode 100644 index 632d33498b6..00000000000 --- a/src/theme/MDXComponents/Head.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import Head, { type Props as HeadProps } from '@docusaurus/Head'; -import type { Props } from '@theme/MDXComponents/Head'; -import React, { type ReactElement } from 'react'; - -// MDX elements are wrapped through the MDX pragma. In some cases (notably usage -// with Head/Helmet) we need to unwrap those elements. -function unwrapMDXElement(element: ReactElement<{ mdxType?: string; originalType?: string } | undefined>) { - if (element.props?.mdxType && element.props.originalType) { - const { ...newProps } = element.props; - return React.createElement(element.props.originalType, newProps); - } - return element; -} - -export default function MDXHead(props: Props): React.Element { - const unwrappedChildren = React.Children.map(props.children, (child) => - React.isValidElement(child) ? unwrapMDXElement(child) : child, - ); - return {unwrappedChildren}; -} diff --git a/src/theme/MDXComponents/Heading.tsx b/src/theme/MDXComponents/Heading.tsx deleted file mode 100644 index bb16137194e..00000000000 --- a/src/theme/MDXComponents/Heading.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import Heading from '@theme/Heading'; -import type { Props } from '@theme/MDXComponents/Heading'; -import React from 'react'; - -export default function MDXHeading(props: Props): React.Element { - return ; -} diff --git a/src/theme/MDXComponents/Img/index.tsx b/src/theme/MDXComponents/Img/index.tsx deleted file mode 100644 index 00dbe5a3fb3..00000000000 --- a/src/theme/MDXComponents/Img/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import type { Props } from '@theme/MDXComponents/Img'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './styles.module.css'; - -function transformImgClassName(className?: string): string { - return clsx(className, styles.img); -} - -export default function MDXImg(props: Props): React.Element { - return ; -} diff --git a/src/theme/MDXComponents/Img/styles.module.css b/src/theme/MDXComponents/Img/styles.module.css deleted file mode 100644 index 2e4c258fe41..00000000000 --- a/src/theme/MDXComponents/Img/styles.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.img { - height: auto; -} diff --git a/src/theme/MDXComponents/Pre.tsx b/src/theme/MDXComponents/Pre.tsx deleted file mode 100644 index 1fc31a5e60b..00000000000 --- a/src/theme/MDXComponents/Pre.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import CodeBlock from '@theme/CodeBlock'; -import type { Props } from '@theme/MDXComponents/Pre'; -import React, { isValidElement } from 'react'; - -export default function MDXPre(props: Props): React.Element { - return ( - - ); -} diff --git a/src/theme/MDXComponents/Ul/index.tsx b/src/theme/MDXComponents/Ul/index.tsx deleted file mode 100644 index 213f5c132e9..00000000000 --- a/src/theme/MDXComponents/Ul/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import type { Props } from '@theme/MDXComponents/Ul'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './styles.module.css'; - -function transformUlClassName(className?: string): string { - return clsx( - className, - // This class is set globally by GitHub/MDX. We keep the global class, and - // add another class to get a task list without the default ul styling - // See https://github.com/syntax-tree/mdast-util-to-hast/issues/28 - className?.includes('contains-task-list') && styles.containsTaskList, - ); -} - -export default function MDXUl(props: Props): React.Element { - return
      ; -} diff --git a/src/theme/MDXComponents/Ul/styles.module.css b/src/theme/MDXComponents/Ul/styles.module.css deleted file mode 100644 index 0e0eec9d2b3..00000000000 --- a/src/theme/MDXComponents/Ul/styles.module.css +++ /dev/null @@ -1,7 +0,0 @@ -.containsTaskList { - list-style: none; -} - -:not(.containsTaskList > li) > .containsTaskList { - padding-left: 0; -} diff --git a/src/theme/MDXComponents/index.tsx b/src/theme/MDXComponents/index.tsx deleted file mode 100644 index 0439e749c3f..00000000000 --- a/src/theme/MDXComponents/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import Admonition from '@theme/Admonition'; -import MDXA from '@theme/MDXComponents/A'; -import MDXCode from '@theme/MDXComponents/Code'; -import MDXDetails from '@theme/MDXComponents/Details'; -import MDXHead from '@theme/MDXComponents/Head'; -import MDXHeading from '@theme/MDXComponents/Heading'; -import MDXImg from '@theme/MDXComponents/Img'; -import MDXPre from '@theme/MDXComponents/Pre'; -import MDXUl from '@theme/MDXComponents/Ul'; -import Mermaid from '@theme/Mermaid'; - -export { MDXHead, MDXCode, MDXA, MDXPre, MDXDetails, MDXHeading, MDXUl, MDXImg, Admonition, Mermaid }; diff --git a/src/theme/MDXContent/index.tsx b/src/theme/MDXContent/index.tsx deleted file mode 100644 index eb41987f648..00000000000 --- a/src/theme/MDXContent/index.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { MDXProvider } from '@mdx-js/react'; -import Admonition from '@theme/Admonition'; -import MDXDetails from '@theme/MDXComponents/Details'; -import MDXHead from '@theme/MDXComponents/Head'; -import MDXPre from '@theme/MDXComponents/Pre'; -import type { Props } from '@theme/MDXContent'; -import Mermaid from '@theme/Mermaid'; -import { - Code, - Emphasis, - Heading1, - Heading2, - Heading3, - Heading4, - Heading5, - Heading6, - Image, - Link, - UnorderedList, - UnorderedListItem, -} from '@utrecht/component-library-react/dist/css-module'; -import React from 'react'; - -export default function MDXContent({ children }: Props): React.Element { - return ( - - {children} - - ); -} diff --git a/src/theme/Navbar/ColorModeToggle/index.tsx b/src/theme/Navbar/ColorModeToggle/index.tsx deleted file mode 100644 index b08d5458821..00000000000 --- a/src/theme/Navbar/ColorModeToggle/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { useColorMode, useThemeConfig } from '@docusaurus/theme-common'; -import ColorModeToggle from '@theme/ColorModeToggle'; -import type { Props } from '@theme/Navbar/ColorModeToggle'; -import React from 'react'; -import styles from './styles.module.css'; - -export default function NavbarColorModeToggle({ className }: Props): React.Element | null { - const navbarStyle = useThemeConfig().navbar.style; - const disabled = useThemeConfig().colorMode.disableSwitch; - const { colorMode, setColorMode } = useColorMode(); - - if (disabled) { - return null; - } - - return ( - - ); -} diff --git a/src/theme/Navbar/ColorModeToggle/styles.module.css b/src/theme/Navbar/ColorModeToggle/styles.module.css deleted file mode 100644 index 7bd077a6bfd..00000000000 --- a/src/theme/Navbar/ColorModeToggle/styles.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.darkNavbarColorModeToggle:hover { - background: var(--ifm-color-gray-800); -} diff --git a/src/theme/Navbar/Content/index.tsx b/src/theme/Navbar/Content/index.tsx deleted file mode 100644 index 21d44b6ea50..00000000000 --- a/src/theme/Navbar/Content/index.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import { ErrorCauseBoundary, useThemeConfig } from '@docusaurus/theme-common'; -import { splitNavbarItems, useNavbarMobileSidebar } from '@docusaurus/theme-common/internal'; -import NavbarLogo from '@theme/Navbar/Logo'; -import NavbarMobileSidebarToggle from '@theme/Navbar/MobileSidebar/Toggle'; -import NavbarSearch from '@theme/Navbar/Search'; -import NavbarItem, { type Props as NavbarItemConfig } from '@theme/NavbarItem'; -import SearchBar from '@theme/SearchBar'; -import clsx from 'clsx'; -import React, { PropsWithChildren } from 'react'; - -function useNavbarItems() { - // TODO temporary casting until ThemeConfig type is improved - return useThemeConfig().navbar.items as NavbarItemConfig[]; -} - -interface NavbarItemsProps { - items: NavbarItemConfig[]; - position?: 'block-start' | 'block-end'; - positionChildren?: 'block-start' | 'block-end'; - showOnMobile?: boolean; -} - -function NavbarItems({ - items, - position = 'block-start', - positionChildren = 'block-end', - showOnMobile, - children, -}: PropsWithChildren): React.Element { - return ( -
      - {positionChildren === 'block-start' && children} - {items.map((item, i) => ( - - new Error( - `A theme navbar item failed to render. -Please double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config: -${JSON.stringify(item, null, 2)}`, - ) - } - > - - - ))}{' '} - {positionChildren === 'block-end' && children} -
      - ); -} - -export default function NavbarContent(): React.Element { - const items = useNavbarItems(); - const [leftItems, rightItems] = splitNavbarItems(items); - const mobileSidebar = useNavbarMobileSidebar(); - const searchBarItem = items.find((item) => item.type === 'search'); - - return ( -
      - {!mobileSidebar.disabled && } - - - - - {!searchBarItem && ( - - - - )} - -
      - ); -} diff --git a/src/theme/Navbar/Layout/index.tsx b/src/theme/Navbar/Layout/index.tsx deleted file mode 100644 index 24d0b100afc..00000000000 --- a/src/theme/Navbar/Layout/index.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { translate } from '@docusaurus/Translate'; -import { useThemeConfig } from '@docusaurus/theme-common'; -import { useHideableNavbar, useNavbarMobileSidebar } from '@docusaurus/theme-common/internal'; -import type { Props } from '@theme/Navbar/Layout'; -import NavbarMobileSidebar from '@theme/Navbar/MobileSidebar'; -import clsx from 'clsx'; -import React, { type ComponentProps } from 'react'; - -function NavbarBackdrop(props: ComponentProps<'div'>) { - return
      ; -} - -export default function NavbarLayout({ children }: Props): React.Element { - const { - navbar: { hideOnScroll, style }, - } = useThemeConfig(); - const mobileSidebar = useNavbarMobileSidebar(); - - const { navbarRef } = useHideableNavbar(hideOnScroll); - return ( - - ); -} diff --git a/src/theme/Navbar/Logo/Logo.module.css b/src/theme/Navbar/Logo/Logo.module.css deleted file mode 100644 index 83f33ffabb2..00000000000 --- a/src/theme/Navbar/Logo/Logo.module.css +++ /dev/null @@ -1,51 +0,0 @@ -.navbar-logo { - --utrecht-link-text-decoration: none; - --ifm-link-hover-decoration: none; - --utrecht-link-color: currentColor; - --utrecht-link-focus-color: #00303d; - - display: flex; - gap: 0.5rem; -} - -.navbar-logo__icon { - display: none; - height: 40px; - margin-right: 0; - width: 40px; -} - -.navbar-logo__title { - font-family: var(--nlds-typography-alternative-font-family); - font-size: 20px; - font-weight: 600; -} - -@media screen and (width <= 350px) { - .navbar-logo { - flex-grow: 1; - padding-inline-start: 12px; - } - - .navbar-logo__title { - font-size: 18px; - } -} - -@media screen and (width >= 350px) and (width <= 400px) { - .navbar-logo { - min-width: 13.875rem; - } -} - -@media (width >= 1150px) { - .navbar-logo__icon { - display: block; - } -} - -@media (width >= 1100px) { - .navbar-logo__title { - font-size: 28px; - } -} diff --git a/src/theme/Navbar/Logo/index.tsx b/src/theme/Navbar/Logo/index.tsx deleted file mode 100644 index 5275b6c1a01..00000000000 --- a/src/theme/Navbar/Logo/index.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import Logo from '@theme/Logo'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './Logo.module.css'; - -export default function NavbarLogo(): React.Element { - return ( - - ); -} diff --git a/src/theme/Navbar/MobileSidebar/Header/Header.module.css b/src/theme/Navbar/MobileSidebar/Header/Header.module.css deleted file mode 100644 index ca99c871d95..00000000000 --- a/src/theme/Navbar/MobileSidebar/Header/Header.module.css +++ /dev/null @@ -1,31 +0,0 @@ -.mobile-sidebar__header { - align-items: center; - background-color: var(--nlds-page-header-background-color); - color: white; - display: flex; - justify-content: space-between; - min-height: 64px; - text-align: right; -} - -.navbar-sidebar__header-button { - --utrecht-button-color: white; - --utrecht-button-hover-color: white; - --utrecht-button-font-size: 18px; - --utrecht-button-min-block-size: 100%; -} - -.navbar-sidebar__header-button:hover { - --utrecht-button-hover-color: white; - - text-decoration: underline; - text-underline-offset: 2px; -} - -.navbar-sidebar__header-button:active { - color: lightgrey; -} - -.navbar-sidebar__header-button--close:hover { - --utrecht-button-hover-background-color: var(--nlds-mobile-sidebar-background-color); -} diff --git a/src/theme/Navbar/MobileSidebar/Header/index.tsx b/src/theme/Navbar/MobileSidebar/Header/index.tsx deleted file mode 100644 index ec674fc9032..00000000000 --- a/src/theme/Navbar/MobileSidebar/Header/index.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { translate } from '@docusaurus/Translate'; -import { useThemeConfig } from '@docusaurus/theme-common'; -import { useNavbarMobileSidebar } from '@docusaurus/theme-common/internal'; -import { useNavbarSecondaryMenu } from '@docusaurus/theme-common/internal'; -import { IconChevronLeft, IconX } from '@tabler/icons-react'; -import { ButtonProps } from '@utrecht/component-library-react/dist/Button'; -import { Button } from '@utrecht/component-library-react/dist/css-module'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './Header.module.css'; - -function CloseButton() { - const mobileSidebar = useNavbarMobileSidebar(); - return ( - - ); -} - -function SecondaryMenuBackButton(props: ButtonProps) { - return ( - - ); -} - -export default function NavbarMobileSidebarHeader(): React.Element { - const isPrimaryMenuEmpty = useThemeConfig().navbar.items.length === 0; - const { hide, shown } = useNavbarSecondaryMenu(); - - return ( -
      - {/* edge-case: prevent returning to the primaryMenu when it's empty */} - {!isPrimaryMenuEmpty && shown ? hide()} /> :
      } - -
      - ); -} diff --git a/src/theme/Navbar/MobileSidebar/Layout/Layout.module.css b/src/theme/Navbar/MobileSidebar/Layout/Layout.module.css deleted file mode 100644 index 166c395683c..00000000000 --- a/src/theme/Navbar/MobileSidebar/Layout/Layout.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.navbar-sidebar { - background-color: var(--nlds-mobile-sidebar-background-color); -} diff --git a/src/theme/Navbar/MobileSidebar/Layout/index.tsx b/src/theme/Navbar/MobileSidebar/Layout/index.tsx deleted file mode 100644 index ed841e93f41..00000000000 --- a/src/theme/Navbar/MobileSidebar/Layout/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useNavbarSecondaryMenu } from '@docusaurus/theme-common/internal'; -import type { Props } from '@theme/Navbar/MobileSidebar/Layout'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './Layout.module.css'; - -export default function NavbarMobileSidebarLayout({ header, primaryMenu, secondaryMenu }: Props): React.Element { - const { shown: secondaryMenuShown } = useNavbarSecondaryMenu(); - return ( -
      - {header} -
      -
      {primaryMenu}
      -
      {secondaryMenu}
      -
      -
      - ); -} diff --git a/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx b/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx deleted file mode 100644 index c975b3ff303..00000000000 --- a/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { useThemeConfig } from '@docusaurus/theme-common'; -import { useNavbarMobileSidebar } from '@docusaurus/theme-common/internal'; -import NavbarItem, { type Props as NavbarItemConfig } from '@theme/NavbarItem'; -import React from 'react'; - -function useNavbarItems() { - // TODO temporary casting until ThemeConfig type is improved - return useThemeConfig().navbar.items as NavbarItemConfig[]; -} - -// The primary menu displays the navbar items -export default function NavbarMobilePrimaryMenu(): React.Element { - const mobileSidebar = useNavbarMobileSidebar(); - - // TODO how can the order be defined for mobile? - // Should we allow providing a different list of items? - const items = useNavbarItems(); - - return ( -
        - {items.map((item, i) => ( - mobileSidebar.toggle()} key={i} /> - ))} -
      - ); -} diff --git a/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx b/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx deleted file mode 100644 index d70efc4d9ca..00000000000 --- a/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { useNavbarSecondaryMenu } from '@docusaurus/theme-common/internal'; -import React from 'react'; - -// The secondary menu slides from the right and shows contextual information -// such as the docs sidebar -export default function NavbarMobileSidebarSecondaryMenu(): React.Element | null { - const secondaryMenu = useNavbarSecondaryMenu(); - return <>{secondaryMenu.content}; -} diff --git a/src/theme/Navbar/MobileSidebar/Toggle/index.tsx b/src/theme/Navbar/MobileSidebar/Toggle/index.tsx deleted file mode 100644 index f6606874929..00000000000 --- a/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { translate } from '@docusaurus/Translate'; -import { useNavbarMobileSidebar } from '@docusaurus/theme-common/internal'; -import { Button } from '@utrecht/component-library-react/dist/css-module'; -import React from 'react'; - -export default function MobileSidebarToggle(): React.Element { - const { toggle, shown } = useNavbarMobileSidebar(); - return ( - - ); -} diff --git a/src/theme/Navbar/MobileSidebar/index.tsx b/src/theme/Navbar/MobileSidebar/index.tsx deleted file mode 100644 index 1866af63930..00000000000 --- a/src/theme/Navbar/MobileSidebar/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { useLockBodyScroll, useNavbarMobileSidebar } from '@docusaurus/theme-common/internal'; -import NavbarMobileSidebarHeader from '@theme/Navbar/MobileSidebar/Header'; -import NavbarMobileSidebarLayout from '@theme/Navbar/MobileSidebar/Layout'; -import NavbarMobileSidebarPrimaryMenu from '@theme/Navbar/MobileSidebar/PrimaryMenu'; -import NavbarMobileSidebarSecondaryMenu from '@theme/Navbar/MobileSidebar/SecondaryMenu'; -import React from 'react'; - -export default function NavbarMobileSidebar(): React.Element | null { - const mobileSidebar = useNavbarMobileSidebar(); - useLockBodyScroll(mobileSidebar.shown); - - if (!mobileSidebar.shouldRender) { - return null; - } - - return ( - } - primaryMenu={} - secondaryMenu={} - /> - ); -} diff --git a/src/theme/Navbar/Search/Search.module.css b/src/theme/Navbar/Search/Search.module.css deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/theme/Navbar/Search/index.tsx b/src/theme/Navbar/Search/index.tsx deleted file mode 100644 index b598dc8b5a7..00000000000 --- a/src/theme/Navbar/Search/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import type { Props } from '@theme/Navbar/Search'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './Search.module.css'; - -export default function NavbarSearch({ children, className, ...props }: Props): React.Element { - return ( -
      - {children} -
      - ); -} diff --git a/src/theme/Navbar/index.tsx b/src/theme/Navbar/index.tsx deleted file mode 100644 index 8d7155a90a3..00000000000 --- a/src/theme/Navbar/index.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import NavbarContent from '@theme/Navbar/Content'; -import NavbarLayout from '@theme/Navbar/Layout'; -import React from 'react'; - -export default function Navbar(): React.Element { - return ( - - - - ); -} diff --git a/src/theme/NavbarItem/ComponentTypes.tsx b/src/theme/NavbarItem/ComponentTypes.tsx deleted file mode 100644 index 22a18414012..00000000000 --- a/src/theme/NavbarItem/ComponentTypes.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { ComponentTypesObject } from '@theme/NavbarItem/ComponentTypes'; -import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem'; -import DocNavbarItem from '@theme/NavbarItem/DocNavbarItem'; -import DocSidebarNavbarItem from '@theme/NavbarItem/DocSidebarNavbarItem'; -import DocsVersionDropdownNavbarItem from '@theme/NavbarItem/DocsVersionDropdownNavbarItem'; -import DocsVersionNavbarItem from '@theme/NavbarItem/DocsVersionNavbarItem'; -import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem'; -import HtmlNavbarItem from '@theme/NavbarItem/HtmlNavbarItem'; -import LocaleDropdownNavbarItem from '@theme/NavbarItem/LocaleDropdownNavbarItem'; -import SearchNavbarItem from '@theme/NavbarItem/SearchNavbarItem'; - -const ComponentTypes: ComponentTypesObject = { - default: DefaultNavbarItem, - localeDropdown: LocaleDropdownNavbarItem, - search: SearchNavbarItem, - dropdown: DropdownNavbarItem, - html: HtmlNavbarItem, - doc: DocNavbarItem, - docSidebar: DocSidebarNavbarItem, - docsVersion: DocsVersionNavbarItem, - docsVersionDropdown: DocsVersionDropdownNavbarItem, -}; - -export default ComponentTypes; diff --git a/src/theme/NavbarItem/DefaultNavbarItem.tsx b/src/theme/NavbarItem/DefaultNavbarItem.tsx deleted file mode 100644 index ef8017eacb3..00000000000 --- a/src/theme/NavbarItem/DefaultNavbarItem.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import type { DesktopOrMobileNavBarItemProps, Props } from '@theme/NavbarItem/DefaultNavbarItem'; -import NavbarNavLink from '@theme/NavbarItem/NavbarNavLink'; -import clsx from 'clsx'; -import React from 'react'; - -function DefaultNavbarItemDesktop({ className, isDropdownItem = false, ...props }: DesktopOrMobileNavBarItemProps) { - const element = ( - - ); - - if (isDropdownItem) { - return
    • {element}
    • ; - } - - return element; -} - -function DefaultNavbarItemMobile({ className, isDropdownItem: _, ...props }: DesktopOrMobileNavBarItemProps) { - return ( -
    • - -
    • - ); -} - -export default function DefaultNavbarItem({ - mobile = false, - position: _, // Need to destructure position from props so that it doesn't get passed on. - ...props -}: Props): React.Element { - const Comp = mobile ? DefaultNavbarItemMobile : DefaultNavbarItemDesktop; - return ( - - ); -} diff --git a/src/theme/NavbarItem/DocNavbarItem.tsx b/src/theme/NavbarItem/DocNavbarItem.tsx deleted file mode 100644 index c745905d307..00000000000 --- a/src/theme/NavbarItem/DocNavbarItem.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { useActiveDocContext } from '@docusaurus/plugin-content-docs/client'; -import { useLayoutDoc } from '@docusaurus/theme-common/internal'; -import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem'; -import type { Props } from '@theme/NavbarItem/DocNavbarItem'; -import React from 'react'; - -export default function DocNavbarItem({ - docId, - label: staticLabel, - docsPluginId, - ...props -}: Props): React.Element | null { - const { activeDoc } = useActiveDocContext(docsPluginId); - const doc = useLayoutDoc(docId, docsPluginId); - - // Draft items are not displayed in the navbar. - if (doc === null) { - return null; - } - - return ( - activeDoc?.path === doc.path || (!!activeDoc?.sidebar && activeDoc.sidebar === doc.sidebar)} - label={staticLabel ?? doc.id} - to={doc.path} - /> - ); -} diff --git a/src/theme/NavbarItem/DocSidebarNavbarItem.tsx b/src/theme/NavbarItem/DocSidebarNavbarItem.tsx deleted file mode 100644 index 6da0830989f..00000000000 --- a/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useActiveDocContext } from '@docusaurus/plugin-content-docs/client'; -import { useLayoutDocsSidebar } from '@docusaurus/theme-common/internal'; -import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem'; -import type { Props } from '@theme/NavbarItem/DocSidebarNavbarItem'; -import React from 'react'; - -export default function DocSidebarNavbarItem({ sidebarId, label, docsPluginId, ...props }: Props): React.Element { - const { activeDoc } = useActiveDocContext(docsPluginId); - const sidebarLink = useLayoutDocsSidebar(sidebarId, docsPluginId).link; - if (!sidebarLink) { - throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${sidebarId}" doesn't have anything to be linked to.`); - } - return ( - activeDoc?.sidebar === sidebarId} - label={label ?? sidebarLink.label} - to={sidebarLink.path} - /> - ); -} diff --git a/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx b/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx deleted file mode 100644 index 01c0eada1ab..00000000000 --- a/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import { translate } from '@docusaurus/Translate'; -import { useActiveDocContext, useVersions } from '@docusaurus/plugin-content-docs/client'; -import type { GlobalVersion } from '@docusaurus/plugin-content-docs/client'; -import { useLocation } from '@docusaurus/router'; -import { useDocsPreferredVersion } from '@docusaurus/theme-common'; -import { useDocsVersionCandidates } from '@docusaurus/theme-common/internal'; -import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem'; -import type { Props } from '@theme/NavbarItem/DocsVersionDropdownNavbarItem'; -import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem'; -import React from 'react'; - -const getVersionMainDoc = (version: GlobalVersion) => version.docs.find((doc) => doc.id === version.mainDocId)!; - -export default function DocsVersionDropdownNavbarItem({ - mobile, - docsPluginId, - dropdownActiveClassDisabled, - dropdownItemsBefore, - dropdownItemsAfter, - ...props -}: Props): React.Element { - const { search, hash } = useLocation(); - const activeDocContext = useActiveDocContext(docsPluginId); - const versions = useVersions(docsPluginId); - const { savePreferredVersionName } = useDocsPreferredVersion(docsPluginId); - const versionLinks = versions.map((version) => { - // We try to link to the same doc, in another version - // When not possible, fallback to the "main doc" of the version - const versionDoc = activeDocContext.alternateDocVersions[version.name] ?? getVersionMainDoc(version); - return { - label: version.label, - // preserve ?search#hash suffix on version switches - to: `${versionDoc.path}${search}${hash}`, - isActive: () => version === activeDocContext.activeVersion, - onClick: () => savePreferredVersionName(version.name), - }; - }); - const items = [...dropdownItemsBefore, ...versionLinks, ...dropdownItemsAfter]; - - const dropdownVersion = useDocsVersionCandidates(docsPluginId)[0]; - - // Mobile dropdown is handled a bit differently - const dropdownLabel = - mobile && items.length > 1 - ? translate({ - id: 'theme.navbar.mobileVersionsDropdown.label', - message: 'Versions', - description: 'The label for the navbar versions dropdown on mobile view', - }) - : dropdownVersion.label; - const dropdownTo = mobile && items.length > 1 ? undefined : getVersionMainDoc(dropdownVersion).path; - - // We don't want to render a version dropdown with 0 or 1 item. If we build - // the site with a single docs version (onlyIncludeVersions: ['1.0.0']), - // We'd rather render a button instead of a dropdown - if (items.length <= 1) { - return ( - false : undefined} - /> - ); - } - - return ( - false : undefined} - /> - ); -} diff --git a/src/theme/NavbarItem/DocsVersionNavbarItem.tsx b/src/theme/NavbarItem/DocsVersionNavbarItem.tsx deleted file mode 100644 index 8698499389b..00000000000 --- a/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import type { GlobalVersion } from '@docusaurus/plugin-content-docs/client'; -import { useDocsVersionCandidates } from '@docusaurus/theme-common/internal'; -import DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem'; -import type { Props } from '@theme/NavbarItem/DocsVersionNavbarItem'; -import React from 'react'; - -const getVersionMainDoc = (version: GlobalVersion) => version.docs.find((doc) => doc.id === version.mainDocId)!; - -export default function DocsVersionNavbarItem({ - label: staticLabel, - to: staticTo, - docsPluginId, - ...props -}: Props): React.Element { - const version = useDocsVersionCandidates(docsPluginId)[0]; - const label = staticLabel ?? version.label; - const path = staticTo ?? getVersionMainDoc(version).path; - return ; -} diff --git a/src/theme/NavbarItem/DropdownNavbarItem.tsx b/src/theme/NavbarItem/DropdownNavbarItem.tsx deleted file mode 100644 index 57826a3d07b..00000000000 --- a/src/theme/NavbarItem/DropdownNavbarItem.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import { Collapsible, isRegexpStringMatch, useCollapsible } from '@docusaurus/theme-common'; -import { isSamePath, useLocalPathname } from '@docusaurus/theme-common/internal'; -import NavbarItem, { type LinkLikeNavbarItemProps } from '@theme/NavbarItem'; -import type { DesktopOrMobileNavBarItemProps, Props } from '@theme/NavbarItem/DropdownNavbarItem'; -import NavbarNavLink from '@theme/NavbarItem/NavbarNavLink'; -import clsx from 'clsx'; -import React, { useEffect, useRef, useState } from 'react'; - -function isItemActive(item: LinkLikeNavbarItemProps, localPathname: string): boolean { - if (isSamePath(item.to, localPathname)) { - return true; - } - if (isRegexpStringMatch(item.activeBaseRegex, localPathname)) { - return true; - } - if (item.activeBasePath && localPathname.startsWith(item.activeBasePath)) { - return true; - } - return false; -} - -function containsActiveItems(items: readonly LinkLikeNavbarItemProps[], localPathname: string): boolean { - return items.some((item) => isItemActive(item, localPathname)); -} - -function DropdownNavbarItemDesktop({ - items, - position, - className, - onClick: _onClick, - ...props -}: DesktopOrMobileNavBarItemProps) { - const dropdownRef = useRef(null); - const [showDropdown, setShowDropdown] = useState(false); - - useEffect(() => { - const handleClickOutside = (event: MouseEvent | TouchEvent | FocusEvent) => { - if (!dropdownRef.current || dropdownRef.current.contains(event.target as Node)) { - return; - } - setShowDropdown(false); - }; - - document.addEventListener('mousedown', handleClickOutside); - document.addEventListener('touchstart', handleClickOutside); - document.addEventListener('focusin', handleClickOutside); - - return () => { - document.removeEventListener('mousedown', handleClickOutside); - document.removeEventListener('touchstart', handleClickOutside); - document.removeEventListener('focusin', handleClickOutside); - }; - }, [dropdownRef]); - - return ( -
      - e.preventDefault()} - onKeyDown={(e) => { - if (e.key === 'Enter') { - e.preventDefault(); - setShowDropdown(!showDropdown); - } - }} - > - {props.children ?? props.label} - -
        - {items.map((childItemProps, i) => ( - - ))} -
      -
      - ); -} - -function DropdownNavbarItemMobile({ - items, - className, - position: _, // Need to destructure position from props so that it doesn't get passed on. - onClick, - ...props -}: DesktopOrMobileNavBarItemProps) { - const localPathname = useLocalPathname(); - const containsActive = containsActiveItems(items, localPathname); - - const { collapsed, toggleCollapsed, setCollapsed } = useCollapsible({ - initialState: () => !containsActive, - }); - - // Expand/collapse if any item active after a navigation - useEffect(() => { - if (containsActive) { - setCollapsed(!containsActive); - } - }, [localPathname, containsActive, setCollapsed]); - - return ( -
    • - { - e.preventDefault(); - toggleCollapsed(); - }} - > - {props.children ?? props.label} - - - {items.map((childItemProps, i) => ( - - ))} - -
    • - ); -} - -export default function DropdownNavbarItem({ mobile = false, ...props }: Props): React.Element { - const Comp = mobile ? DropdownNavbarItemMobile : DropdownNavbarItemDesktop; - return ; -} diff --git a/src/theme/NavbarItem/HtmlNavbarItem.tsx b/src/theme/NavbarItem/HtmlNavbarItem.tsx deleted file mode 100644 index 383b735f4f9..00000000000 --- a/src/theme/NavbarItem/HtmlNavbarItem.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { Props } from '@theme/NavbarItem/HtmlNavbarItem'; -import clsx from 'clsx'; -import React from 'react'; - -export default function HtmlNavbarItem({ - value, - className, - mobile = false, - isDropdownItem = false, -}: Props): React.Element { - const Comp = isDropdownItem ? 'li' : 'div'; - return ( - - ); -} diff --git a/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx b/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx deleted file mode 100644 index 3be5601060a..00000000000 --- a/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { translate } from '@docusaurus/Translate'; -import { useLocation } from '@docusaurus/router'; -import { useAlternatePageUtils } from '@docusaurus/theme-common/internal'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import IconLanguage from '@theme/Icon/Language'; -import type { LinkLikeNavbarItemProps } from '@theme/NavbarItem'; -import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem'; -import type { Props } from '@theme/NavbarItem/LocaleDropdownNavbarItem'; -import React from 'react'; -import styles from './styles.module.css'; - -export default function LocaleDropdownNavbarItem({ - mobile, - dropdownItemsBefore, - dropdownItemsAfter, - ...props -}: Props): React.Element { - const { - i18n: { currentLocale, locales, localeConfigs }, - } = useDocusaurusContext(); - const alternatePageUtils = useAlternatePageUtils(); - const { search, hash } = useLocation(); - - const localeItems = locales.map((locale): LinkLikeNavbarItemProps => { - const baseTo = `pathname://${alternatePageUtils.createUrl({ - locale, - fullyQualified: false, - })}`; - // preserve ?search#hash suffix on locale switches - const to = `${baseTo}${search}${hash}`; - return { - label: localeConfigs[locale]!.label, - lang: localeConfigs[locale]!.htmlLang, - to, - target: '_self', - autoAddBaseUrl: false, - className: - locale === currentLocale - ? // Similar idea as DefaultNavbarItem: select the right Infima active - // class name. This cannot be substituted with isActive, because the - // target URLs contain `pathname://` and therefore are not NavLinks! - mobile - ? 'menu__link--active' - : 'dropdown__link--active' - : '', - }; - }); - - const items = [...dropdownItemsBefore, ...localeItems, ...dropdownItemsAfter]; - - // Mobile is handled a bit differently - const dropdownLabel = mobile - ? translate({ - message: 'Languages', - id: 'theme.navbar.mobileLanguageDropdown.label', - description: 'The label for the mobile language switcher dropdown', - }) - : localeConfigs[currentLocale]!.label; - - return ( - - - {dropdownLabel} - - } - items={items} - /> - ); -} diff --git a/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css b/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css deleted file mode 100644 index 68a2cdcb40d..00000000000 --- a/src/theme/NavbarItem/LocaleDropdownNavbarItem/styles.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.iconLanguage { - margin-right: 5px; - vertical-align: text-bottom; -} diff --git a/src/theme/NavbarItem/NavbarNavLink.tsx b/src/theme/NavbarItem/NavbarNavLink.tsx deleted file mode 100644 index 379787441d7..00000000000 --- a/src/theme/NavbarItem/NavbarNavLink.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import Link from '@docusaurus/Link'; -import isInternalUrl from '@docusaurus/isInternalUrl'; -import { isRegexpStringMatch } from '@docusaurus/theme-common'; -import useBaseUrl from '@docusaurus/useBaseUrl'; -import IconExternalLink from '@theme/Icon/ExternalLink'; -import type { Props } from '@theme/NavbarItem/NavbarNavLink'; -import React from 'react'; - -export default function NavbarNavLink({ - activeBasePath, - activeBaseRegex, - to, - href, - label, - html, - isDropdownLink, - prependBaseUrlToHref, - ...props -}: Props): React.Element { - // TODO all this seems hacky - // {to: 'version'} should probably be forbidden, in favor of {to: '/version'} - const toUrl = useBaseUrl(to); - const activeBaseUrl = useBaseUrl(activeBasePath); - const normalizedHref = useBaseUrl(href, { forcePrependBaseUrl: true }); - const isExternalLink = label && href && !isInternalUrl(href); - - // Link content is set through html XOR label - const linkContentProps = html - ? { dangerouslySetInnerHTML: { __html: html } } - : { - children: ( - <> - {label} - {isExternalLink && } - - ), - }; - - if (href) { - return ; - } - - return ( - - activeBaseRegex - ? isRegexpStringMatch(activeBaseRegex, location.pathname) - : location.pathname.startsWith(activeBaseUrl), - })} - {...props} - {...linkContentProps} - /> - ); -} diff --git a/src/theme/NavbarItem/SearchNavbarItem.tsx b/src/theme/NavbarItem/SearchNavbarItem.tsx deleted file mode 100644 index 064913f9bf9..00000000000 --- a/src/theme/NavbarItem/SearchNavbarItem.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import NavbarSearch from '@theme/Navbar/Search'; -import type { Props } from '@theme/NavbarItem/SearchNavbarItem'; -import SearchBar from '@theme/SearchBar'; -import React from 'react'; - -export default function SearchNavbarItem({ mobile, className }: Props): React.Element | null { - if (mobile) { - return null; - } - - return ( - - - - ); -} diff --git a/src/theme/NavbarItem/index.tsx b/src/theme/NavbarItem/index.tsx deleted file mode 100644 index 36a1fa35713..00000000000 --- a/src/theme/NavbarItem/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { NavbarItemType, Props } from '@theme/NavbarItem'; -import ComponentTypes from '@theme/NavbarItem/ComponentTypes'; -import React from 'react'; - -function normalizeComponentType(type: NavbarItemType, props: object) { - // Backward compatibility: navbar item with no type set - // but containing dropdown items should use the type "dropdown" - if (!type || type === 'default') { - return 'items' in props ? 'dropdown' : 'default'; - } - return type; -} - -export default function NavbarItem({ type, ...props }: Props): React.Element { - const componentType = normalizeComponentType(type, props); - const NavbarItemComponent = ComponentTypes[componentType]; - if (!NavbarItemComponent) { - throw new Error(`No NavbarItem component found for type "${type}".`); - } - return ; -} diff --git a/src/theme/Root.js b/src/theme/Root.js deleted file mode 100644 index c19eb48637c..00000000000 --- a/src/theme/Root.js +++ /dev/null @@ -1,18 +0,0 @@ -import { Document } from '@utrecht/component-library-react/dist/css-module'; -import React from 'react'; -import '@nl-design-system-unstable/nlds-design-tokens/src/font'; -import '@nl-design-system-unstable/voorbeeld-design-tokens/dist/design-tokens.css'; -import '@nl-design-system-unstable/voorbeeld-design-tokens/dist/custom.css'; -import '@fontsource/open-sans/300.css'; -import '@fontsource/open-sans/400.css'; -import '@fontsource/open-sans/500.css'; -import '@fontsource/open-sans/600.css'; -import '@fontsource/open-sans/700.css'; -import '@fontsource/open-sans/800.css'; - -// Default implementation, that you can customize -function Root({ children }) { - return {children}; -} - -export default Root; diff --git a/src/theme/SearchBar/index.js b/src/theme/SearchBar/index.js deleted file mode 100644 index 191a51e9a8c..00000000000 --- a/src/theme/SearchBar/index.js +++ /dev/null @@ -1,182 +0,0 @@ -import React, { useCallback, useMemo, useRef, useState } from 'react'; -import { useDocSearchKeyboardEvents } from '@docsearch/react'; -import Head from '@docusaurus/Head'; -import Link from '@docusaurus/Link'; -import { useHistory } from '@docusaurus/router'; -import { isRegexpStringMatch, useSearchLinkCreator } from '@docusaurus/theme-common'; -import { useAlgoliaContextualFacetFilters, useSearchResultUrlProcessor } from '@docusaurus/theme-search-algolia/client'; -import Translate from '@docusaurus/Translate'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import { createPortal } from 'react-dom'; -import translations from '@theme/SearchTranslations'; -import { Button } from '@utrecht/component-library-react/dist/css-module'; -let DocSearchModal = null; -function Hit({ hit, children }) { - return ( - - {children} - - ); -} -function ResultsFooter({ state, onClose }) { - const createSearchLink = useSearchLinkCreator(); - return ( - - - {'See all {count} results'} - - - ); -} -function mergeFacetFilters(f1, f2) { - const normalize = (f) => (typeof f === 'string' ? [f] : f); - return [...normalize(f1), ...normalize(f2)]; -} -function DocSearch({ contextualSearch, externalUrlRegex, ...props }) { - const { siteMetadata } = useDocusaurusContext(); - const processSearchResultUrl = useSearchResultUrlProcessor(); - const contextualSearchFacetFilters = useAlgoliaContextualFacetFilters(); - const configFacetFilters = props.searchParameters?.facetFilters ?? []; - const facetFilters = contextualSearch - ? // Merge contextual search filters with config filters - mergeFacetFilters(contextualSearchFacetFilters, configFacetFilters) - : // ... or use config facetFilters - configFacetFilters; - // We let user override default searchParameters if she wants to - const searchParameters = { - ...props.searchParameters, - facetFilters, - }; - const history = useHistory(); - const searchContainer = useRef(null); - const searchButtonRef = useRef(null); - const [isOpen, setIsOpen] = useState(false); - const [initialQuery, setInitialQuery] = useState(undefined); - const importDocSearchModalIfNeeded = useCallback(() => { - if (DocSearchModal) { - return Promise.resolve(); - } - return Promise.all([ - import('@docsearch/react/modal'), - import('@docsearch/react/style'), - import('./styles.css'), - ]).then(([{ DocSearchModal: Modal }]) => { - DocSearchModal = Modal; - }); - }, []); - const onOpen = useCallback(() => { - importDocSearchModalIfNeeded().then(() => { - searchContainer.current = document.createElement('div'); - document.body.insertBefore(searchContainer.current, document.body.firstChild); - setIsOpen(true); - }); - }, [importDocSearchModalIfNeeded, setIsOpen]); - const onClose = useCallback(() => { - setIsOpen(false); - searchContainer.current?.remove(); - }, [setIsOpen]); - const onInput = useCallback( - (event) => { - importDocSearchModalIfNeeded().then(() => { - setIsOpen(true); - setInitialQuery(event.key); - }); - }, - [importDocSearchModalIfNeeded, setIsOpen, setInitialQuery], - ); - const navigator = useRef({ - navigate({ itemUrl }) { - // Algolia results could contain URL's from other domains which cannot - // be served through history and should navigate with window.location - if (isRegexpStringMatch(externalUrlRegex, itemUrl)) { - window.location.href = itemUrl; - } else { - history.push(itemUrl); - } - }, - }).current; - const transformItems = useRef((items) => - props.transformItems - ? // Custom transformItems - props.transformItems(items) - : // Default transformItems - items.map((item) => ({ - ...item, - url: processSearchResultUrl(item.url), - })), - ).current; - const resultsFooterComponent = useMemo( - () => - // eslint-disable-next-line react/no-unstable-nested-components - (footerProps) => - , - [onClose], - ); - const transformSearchClient = useCallback( - (searchClient) => { - searchClient.addAlgoliaAgent('docusaurus', siteMetadata.docusaurusVersion); - return searchClient; - }, - [siteMetadata.docusaurusVersion], - ); - useDocSearchKeyboardEvents({ - isOpen, - onOpen, - onClose, - onInput, - searchButtonRef, - }); - return ( - <> - - {/* This hints the browser that the website will load data from Algolia, - and allows it to preconnect to the DocSearch cluster. It makes the first - query faster, especially on mobile. */} - - - - - - {isOpen && - DocSearchModal && - searchContainer.current && - createPortal( - , - searchContainer.current, - )} - - ); -} -export default function SearchBar() { - const { siteConfig } = useDocusaurusContext(); - return ; -} diff --git a/src/theme/SearchBar/styles.css b/src/theme/SearchBar/styles.css deleted file mode 100644 index fc2c2b73a3a..00000000000 --- a/src/theme/SearchBar/styles.css +++ /dev/null @@ -1,8 +0,0 @@ -:root { - --docsearch-primary-color: var(--ifm-color-primary); - --docsearch-text-color: var(--ifm-font-color-base); -} - -.DocSearch-Container { - z-index: calc(var(--ifm-z-index-fixed) + 1); -} diff --git a/src/theme/ThemedImage/index.tsx b/src/theme/ThemedImage/index.tsx deleted file mode 100644 index e0d7585e216..00000000000 --- a/src/theme/ThemedImage/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { useColorMode } from '@docusaurus/theme-common'; -import useIsBrowser from '@docusaurus/useIsBrowser'; -import type { Props } from '@theme/ThemedImage'; -import clsx from 'clsx'; -import React from 'react'; -import styles from './styles.module.css'; - -export default function ThemedImage(props: Props): React.Element { - const isBrowser = useIsBrowser(); - const { colorMode } = useColorMode(); - const { sources, className, alt, ...propsRest } = props; - - type SourceName = keyof Props['sources']; - - const clientThemes: SourceName[] = colorMode === 'dark' ? ['dark'] : ['light']; - - const renderedSourceNames: SourceName[] = isBrowser - ? clientThemes - : // We need to render both images on the server to avoid flash - // See https://github.com/facebook/docusaurus/pull/3730 - ['light', 'dark']; - - return ( - <> - {renderedSourceNames.map((sourceName) => ( - {alt} - ))} - - ); -} diff --git a/src/theme/ThemedImage/styles.module.css b/src/theme/ThemedImage/styles.module.css deleted file mode 100644 index 37499db0b47..00000000000 --- a/src/theme/ThemedImage/styles.module.css +++ /dev/null @@ -1,11 +0,0 @@ -.themedImage { - display: none; -} - -[data-theme="light"] .themedImage--light { - display: initial; -} - -[data-theme="dark"] .themedImage--dark { - display: initial; -}