refactor(theme): nest theme icons under subfolder @theme/Icon/* (#7740)

This commit is contained in:
Sébastien Lorber 2022-07-08 16:56:53 +02:00 committed by GitHub
parent c3ff131110
commit d3d22d3a72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 39 additions and 39 deletions

View file

@ -93,35 +93,35 @@ export default function getSwizzleConfig(): SwizzleConfig {
}, },
description: 'The footer logo', description: 'The footer logo',
}, },
IconArrow: { 'Icon/Arrow': {
actions: { actions: {
eject: 'safe', eject: 'safe',
wrap: 'safe', wrap: 'safe',
}, },
description: 'The arrow icon component', description: 'The arrow icon component',
}, },
IconDarkMode: { 'Icon/DarkMode': {
actions: { actions: {
eject: 'safe', eject: 'safe',
wrap: 'safe', wrap: 'safe',
}, },
description: 'The dark mode icon component.', description: 'The dark mode icon component.',
}, },
IconEdit: { 'Icon/Edit': {
actions: { actions: {
eject: 'safe', eject: 'safe',
wrap: 'safe', wrap: 'safe',
}, },
description: 'The edit icon component', description: 'The edit icon component',
}, },
IconLightMode: { 'Icon/LightMode': {
actions: { actions: {
eject: 'safe', eject: 'safe',
wrap: 'safe', wrap: 'safe',
}, },
description: 'The light mode icon component.', description: 'The light mode icon component.',
}, },
IconMenu: { 'Icon/Menu': {
actions: { actions: {
eject: 'safe', eject: 'safe',
wrap: 'safe', wrap: 'safe',

View file

@ -1256,7 +1256,7 @@ declare module '@theme/Logo' {
export default function Logo(props: Props): JSX.Element; export default function Logo(props: Props): JSX.Element;
} }
declare module '@theme/IconArrow' { declare module '@theme/Icon/Arrow' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> {} export interface Props extends ComponentProps<'svg'> {}
@ -1264,7 +1264,7 @@ declare module '@theme/IconArrow' {
export default function IconArrow(props: Props): JSX.Element; export default function IconArrow(props: Props): JSX.Element;
} }
declare module '@theme/IconDarkMode' { declare module '@theme/Icon/DarkMode' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> {} export interface Props extends ComponentProps<'svg'> {}
@ -1272,7 +1272,7 @@ declare module '@theme/IconDarkMode' {
export default function IconDarkMode(props: Props): JSX.Element; export default function IconDarkMode(props: Props): JSX.Element;
} }
declare module '@theme/IconEdit' { declare module '@theme/Icon/Edit' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> {} export interface Props extends ComponentProps<'svg'> {}
@ -1280,7 +1280,7 @@ declare module '@theme/IconEdit' {
export default function IconEdit(props: Props): JSX.Element; export default function IconEdit(props: Props): JSX.Element;
} }
declare module '@theme/IconHome' { declare module '@theme/Icon/Home' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> {} export interface Props extends ComponentProps<'svg'> {}
@ -1288,7 +1288,7 @@ declare module '@theme/IconHome' {
export default function IconHome(props: Props): JSX.Element; export default function IconHome(props: Props): JSX.Element;
} }
declare module '@theme/IconLightMode' { declare module '@theme/Icon/LightMode' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> {} export interface Props extends ComponentProps<'svg'> {}
@ -1296,7 +1296,7 @@ declare module '@theme/IconLightMode' {
export default function IconLightMode(props: Props): JSX.Element; export default function IconLightMode(props: Props): JSX.Element;
} }
declare module '@theme/IconMenu' { declare module '@theme/Icon/Menu' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> {} export interface Props extends ComponentProps<'svg'> {}
@ -1304,7 +1304,7 @@ declare module '@theme/IconMenu' {
export default function IconMenu(props: Props): JSX.Element; export default function IconMenu(props: Props): JSX.Element;
} }
declare module '@theme/IconClose' { declare module '@theme/Icon/Close' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> {} export interface Props extends ComponentProps<'svg'> {}
@ -1312,7 +1312,7 @@ declare module '@theme/IconClose' {
export default function IconClose(props: Props): JSX.Element; export default function IconClose(props: Props): JSX.Element;
} }
declare module '@theme/IconLanguage' { declare module '@theme/Icon/Language' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> {} export interface Props extends ComponentProps<'svg'> {}
@ -1320,7 +1320,7 @@ declare module '@theme/IconLanguage' {
export default function IconLanguage(props: Props): JSX.Element; export default function IconLanguage(props: Props): JSX.Element;
} }
declare module '@theme/IconExternalLink' { declare module '@theme/Icon/ExternalLink' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> {} export interface Props extends ComponentProps<'svg'> {}

View file

@ -10,7 +10,7 @@ import clsx from 'clsx';
import {useThemeConfig} from '@docusaurus/theme-common'; import {useThemeConfig} from '@docusaurus/theme-common';
import {useAnnouncementBar} from '@docusaurus/theme-common/internal'; import {useAnnouncementBar} from '@docusaurus/theme-common/internal';
import {translate} from '@docusaurus/Translate'; import {translate} from '@docusaurus/Translate';
import IconClose from '@theme/IconClose'; import IconClose from '@theme/Icon/Close';
import styles from './styles.module.css'; import styles from './styles.module.css';

View file

@ -9,8 +9,8 @@ import React from 'react';
import clsx from 'clsx'; import clsx from 'clsx';
import useIsBrowser from '@docusaurus/useIsBrowser'; import useIsBrowser from '@docusaurus/useIsBrowser';
import {translate} from '@docusaurus/Translate'; import {translate} from '@docusaurus/Translate';
import IconLightMode from '@theme/IconLightMode'; import IconLightMode from '@theme/Icon/LightMode';
import IconDarkMode from '@theme/IconDarkMode'; import IconDarkMode from '@theme/Icon/DarkMode';
import type {Props} from '@theme/ColorModeToggle'; import type {Props} from '@theme/ColorModeToggle';
import styles from './styles.module.css'; import styles from './styles.module.css';

View file

@ -15,7 +15,7 @@ import {
import Link from '@docusaurus/Link'; import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl'; import useBaseUrl from '@docusaurus/useBaseUrl';
import {translate} from '@docusaurus/Translate'; import {translate} from '@docusaurus/Translate';
import IconHome from '@theme/IconHome'; import IconHome from '@theme/Icon/Home';
import styles from './styles.module.css'; import styles from './styles.module.css';

View file

@ -7,7 +7,7 @@
import React from 'react'; import React from 'react';
import {translate} from '@docusaurus/Translate'; import {translate} from '@docusaurus/Translate';
import IconArrow from '@theme/IconArrow'; import IconArrow from '@theme/Icon/Arrow';
import type {Props} from '@theme/DocPage/Layout/Sidebar/ExpandButton'; import type {Props} from '@theme/DocPage/Layout/Sidebar/ExpandButton';
import styles from './styles.module.css'; import styles from './styles.module.css';

View file

@ -8,7 +8,7 @@
import React from 'react'; import React from 'react';
import clsx from 'clsx'; import clsx from 'clsx';
import {translate} from '@docusaurus/Translate'; import {translate} from '@docusaurus/Translate';
import IconArrow from '@theme/IconArrow'; import IconArrow from '@theme/Icon/Arrow';
import type {Props} from '@theme/DocSidebar/Desktop/CollapseButton'; import type {Props} from '@theme/DocSidebar/Desktop/CollapseButton';
import styles from './styles.module.css'; import styles from './styles.module.css';

View file

@ -11,7 +11,7 @@ import {ThemeClassNames} from '@docusaurus/theme-common';
import {isActiveSidebarItem} from '@docusaurus/theme-common/internal'; import {isActiveSidebarItem} from '@docusaurus/theme-common/internal';
import Link from '@docusaurus/Link'; import Link from '@docusaurus/Link';
import isInternalUrl from '@docusaurus/isInternalUrl'; import isInternalUrl from '@docusaurus/isInternalUrl';
import IconExternalLink from '@theme/IconExternalLink'; import IconExternalLink from '@theme/Icon/ExternalLink';
import type {Props} from '@theme/DocSidebarItem/Link'; import type {Props} from '@theme/DocSidebarItem/Link';
import styles from './styles.module.css'; import styles from './styles.module.css';

View file

@ -8,7 +8,7 @@
import React from 'react'; import React from 'react';
import Translate from '@docusaurus/Translate'; import Translate from '@docusaurus/Translate';
import {ThemeClassNames} from '@docusaurus/theme-common'; import {ThemeClassNames} from '@docusaurus/theme-common';
import IconEdit from '@theme/IconEdit'; import IconEdit from '@theme/Icon/Edit';
import type {Props} from '@theme/EditThisPage'; import type {Props} from '@theme/EditThisPage';
export default function EditThisPage({editUrl}: Props): JSX.Element { export default function EditThisPage({editUrl}: Props): JSX.Element {

View file

@ -10,7 +10,7 @@ import React from 'react';
import Link from '@docusaurus/Link'; import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl'; import useBaseUrl from '@docusaurus/useBaseUrl';
import isInternalUrl from '@docusaurus/isInternalUrl'; import isInternalUrl from '@docusaurus/isInternalUrl';
import IconExternalLink from '@theme/IconExternalLink'; import IconExternalLink from '@theme/Icon/ExternalLink';
import type {Props} from '@theme/Footer/LinkItem'; import type {Props} from '@theme/Footer/LinkItem';
export default function FooterLinkItem({item}: Props): JSX.Element { export default function FooterLinkItem({item}: Props): JSX.Element {

View file

@ -6,7 +6,7 @@
*/ */
import React from 'react'; import React from 'react';
import type {Props} from '@theme/IconArrow'; import type {Props} from '@theme/Icon/Arrow';
export default function IconArrow(props: Props): JSX.Element { export default function IconArrow(props: Props): JSX.Element {
return ( return (

View file

@ -6,7 +6,7 @@
*/ */
import React from 'react'; import React from 'react';
import type {Props} from '@theme/IconClose'; import type {Props} from '@theme/Icon/Close';
export default function IconClose({ export default function IconClose({
width = 21, width = 21,

View file

@ -6,7 +6,7 @@
*/ */
import React from 'react'; import React from 'react';
import type {Props} from '@theme/IconDarkMode'; import type {Props} from '@theme/Icon/DarkMode';
export default function IconDarkMode(props: Props): JSX.Element { export default function IconDarkMode(props: Props): JSX.Element {
return ( return (

View file

@ -7,7 +7,7 @@
import React from 'react'; import React from 'react';
import clsx from 'clsx'; import clsx from 'clsx';
import type {Props} from '@theme/IconEdit'; import type {Props} from '@theme/Icon/Edit';
import styles from './styles.module.css'; import styles from './styles.module.css';

View file

@ -6,7 +6,7 @@
*/ */
import React from 'react'; import React from 'react';
import type {Props} from '@theme/IconExternalLink'; import type {Props} from '@theme/Icon/ExternalLink';
import styles from './styles.module.css'; import styles from './styles.module.css';

View file

@ -6,7 +6,7 @@
*/ */
import React from 'react'; import React from 'react';
import type {Props} from '@theme/IconHome'; import type {Props} from '@theme/Icon/Home';
export default function IconHome(props: Props): JSX.Element { export default function IconHome(props: Props): JSX.Element {
return ( return (

View file

@ -6,7 +6,7 @@
*/ */
import React from 'react'; import React from 'react';
import type {Props} from '@theme/IconLanguage'; import type {Props} from '@theme/Icon/Language';
export default function IconLanguage({ export default function IconLanguage({
width = 20, width = 20,

View file

@ -6,7 +6,7 @@
*/ */
import React from 'react'; import React from 'react';
import type {Props} from '@theme/IconLightMode'; import type {Props} from '@theme/Icon/LightMode';
export default function IconLightMode(props: Props): JSX.Element { export default function IconLightMode(props: Props): JSX.Element {
return ( return (

View file

@ -6,7 +6,7 @@
*/ */
import React from 'react'; import React from 'react';
import type {Props} from '@theme/IconMenu'; import type {Props} from '@theme/Icon/Menu';
export default function IconMenu({ export default function IconMenu({
width = 30, width = 30,

View file

@ -8,7 +8,7 @@
import React from 'react'; import React from 'react';
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal'; import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle'; import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
import IconClose from '@theme/IconClose'; import IconClose from '@theme/Icon/Close';
import NavbarLogo from '@theme/Navbar/Logo'; import NavbarLogo from '@theme/Navbar/Logo';
function CloseButton() { function CloseButton() {

View file

@ -7,7 +7,7 @@
import React from 'react'; import React from 'react';
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal'; import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
import IconMenu from '@theme/IconMenu'; import IconMenu from '@theme/Icon/Menu';
export default function MobileSidebarToggle(): JSX.Element { export default function MobileSidebarToggle(): JSX.Element {
const mobileSidebar = useNavbarMobileSidebar(); const mobileSidebar = useNavbarMobileSidebar();

View file

@ -10,7 +10,7 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import {useAlternatePageUtils} from '@docusaurus/theme-common/internal'; import {useAlternatePageUtils} from '@docusaurus/theme-common/internal';
import {translate} from '@docusaurus/Translate'; import {translate} from '@docusaurus/Translate';
import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem'; import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem';
import IconLanguage from '@theme/IconLanguage'; import IconLanguage from '@theme/Icon/Language';
import type {LinkLikeNavbarItemProps} from '@theme/NavbarItem'; import type {LinkLikeNavbarItemProps} from '@theme/NavbarItem';
import type {Props} from '@theme/NavbarItem/LocaleDropdownNavbarItem'; import type {Props} from '@theme/NavbarItem/LocaleDropdownNavbarItem';

View file

@ -10,7 +10,7 @@ import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl'; import useBaseUrl from '@docusaurus/useBaseUrl';
import isInternalUrl from '@docusaurus/isInternalUrl'; import isInternalUrl from '@docusaurus/isInternalUrl';
import {isRegexpStringMatch} from '@docusaurus/theme-common'; import {isRegexpStringMatch} from '@docusaurus/theme-common';
import IconExternalLink from '@theme/IconExternalLink'; import IconExternalLink from '@theme/Icon/ExternalLink';
import type {Props} from '@theme/NavbarItem/NavbarNavLink'; import type {Props} from '@theme/NavbarItem/NavbarNavLink';
export default function NavbarNavLink({ export default function NavbarNavLink({

View file

@ -9,7 +9,7 @@ import React, {useState} from 'react';
import clsx from 'clsx'; import clsx from 'clsx';
import {useBlogPost} from '@docusaurus/theme-common/internal'; import {useBlogPost} from '@docusaurus/theme-common/internal';
import BlogPostItemHeaderAuthor from '@theme/BlogPostItem/Header/Author'; import BlogPostItemHeaderAuthor from '@theme/BlogPostItem/Header/Author';
import IconExpand from '@theme/IconExpand'; import IconExpand from '@theme/Icon/Expand';
import type {Props} from '@theme/BlogPostItem/Header/Authors'; import type {Props} from '@theme/BlogPostItem/Header/Authors';
import styles from './styles.module.css'; import styles from './styles.module.css';

View file

@ -7,7 +7,7 @@
import React from 'react'; import React from 'react';
import type {Props} from '@theme/IconExpand'; import type {Props} from '@theme/Icon/Expand';
export default function IconExpand({expanded, ...props}: Props): JSX.Element { export default function IconExpand({expanded, ...props}: Props): JSX.Element {
if (expanded) { if (expanded) {

View file

@ -15,7 +15,7 @@ declare module '@theme/ChangelogItem/Header/Authors';
declare module '@theme/ChangelogList'; declare module '@theme/ChangelogList';
declare module '@theme/ChangelogList/Header'; declare module '@theme/ChangelogList/Header';
declare module '@theme/IconExpand' { declare module '@theme/Icon/Expand' {
import type {ComponentProps} from 'react'; import type {ComponentProps} from 'react';
export interface Props extends ComponentProps<'svg'> { export interface Props extends ComponentProps<'svg'> {