mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-12 15:52:39 +02:00
refactor(theme): nest theme icons under subfolder @theme/Icon/* (#7740)
This commit is contained in:
parent
c3ff131110
commit
d3d22d3a72
28 changed files with 39 additions and 39 deletions
|
@ -93,35 +93,35 @@ export default function getSwizzleConfig(): SwizzleConfig {
|
|||
},
|
||||
description: 'The footer logo',
|
||||
},
|
||||
IconArrow: {
|
||||
'Icon/Arrow': {
|
||||
actions: {
|
||||
eject: 'safe',
|
||||
wrap: 'safe',
|
||||
},
|
||||
description: 'The arrow icon component',
|
||||
},
|
||||
IconDarkMode: {
|
||||
'Icon/DarkMode': {
|
||||
actions: {
|
||||
eject: 'safe',
|
||||
wrap: 'safe',
|
||||
},
|
||||
description: 'The dark mode icon component.',
|
||||
},
|
||||
IconEdit: {
|
||||
'Icon/Edit': {
|
||||
actions: {
|
||||
eject: 'safe',
|
||||
wrap: 'safe',
|
||||
},
|
||||
description: 'The edit icon component',
|
||||
},
|
||||
IconLightMode: {
|
||||
'Icon/LightMode': {
|
||||
actions: {
|
||||
eject: 'safe',
|
||||
wrap: 'safe',
|
||||
},
|
||||
description: 'The light mode icon component.',
|
||||
},
|
||||
IconMenu: {
|
||||
'Icon/Menu': {
|
||||
actions: {
|
||||
eject: 'safe',
|
||||
wrap: 'safe',
|
||||
|
|
|
@ -1256,7 +1256,7 @@ declare module '@theme/Logo' {
|
|||
export default function Logo(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/IconArrow' {
|
||||
declare module '@theme/Icon/Arrow' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {}
|
||||
|
@ -1264,7 +1264,7 @@ declare module '@theme/IconArrow' {
|
|||
export default function IconArrow(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/IconDarkMode' {
|
||||
declare module '@theme/Icon/DarkMode' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {}
|
||||
|
@ -1272,7 +1272,7 @@ declare module '@theme/IconDarkMode' {
|
|||
export default function IconDarkMode(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/IconEdit' {
|
||||
declare module '@theme/Icon/Edit' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {}
|
||||
|
@ -1280,7 +1280,7 @@ declare module '@theme/IconEdit' {
|
|||
export default function IconEdit(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/IconHome' {
|
||||
declare module '@theme/Icon/Home' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {}
|
||||
|
@ -1288,7 +1288,7 @@ declare module '@theme/IconHome' {
|
|||
export default function IconHome(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/IconLightMode' {
|
||||
declare module '@theme/Icon/LightMode' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {}
|
||||
|
@ -1296,7 +1296,7 @@ declare module '@theme/IconLightMode' {
|
|||
export default function IconLightMode(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/IconMenu' {
|
||||
declare module '@theme/Icon/Menu' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {}
|
||||
|
@ -1304,7 +1304,7 @@ declare module '@theme/IconMenu' {
|
|||
export default function IconMenu(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/IconClose' {
|
||||
declare module '@theme/Icon/Close' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {}
|
||||
|
@ -1312,7 +1312,7 @@ declare module '@theme/IconClose' {
|
|||
export default function IconClose(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/IconLanguage' {
|
||||
declare module '@theme/Icon/Language' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {}
|
||||
|
@ -1320,7 +1320,7 @@ declare module '@theme/IconLanguage' {
|
|||
export default function IconLanguage(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/IconExternalLink' {
|
||||
declare module '@theme/Icon/ExternalLink' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {}
|
||||
|
|
|
@ -10,7 +10,7 @@ import clsx from 'clsx';
|
|||
import {useThemeConfig} from '@docusaurus/theme-common';
|
||||
import {useAnnouncementBar} from '@docusaurus/theme-common/internal';
|
||||
import {translate} from '@docusaurus/Translate';
|
||||
import IconClose from '@theme/IconClose';
|
||||
import IconClose from '@theme/Icon/Close';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ import React from 'react';
|
|||
import clsx from 'clsx';
|
||||
import useIsBrowser from '@docusaurus/useIsBrowser';
|
||||
import {translate} from '@docusaurus/Translate';
|
||||
import IconLightMode from '@theme/IconLightMode';
|
||||
import IconDarkMode from '@theme/IconDarkMode';
|
||||
import IconLightMode from '@theme/Icon/LightMode';
|
||||
import IconDarkMode from '@theme/Icon/DarkMode';
|
||||
import type {Props} from '@theme/ColorModeToggle';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
import Link from '@docusaurus/Link';
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import {translate} from '@docusaurus/Translate';
|
||||
import IconHome from '@theme/IconHome';
|
||||
import IconHome from '@theme/Icon/Home';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
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 styles from './styles.module.css';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
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 styles from './styles.module.css';
|
||||
|
|
|
@ -11,7 +11,7 @@ import {ThemeClassNames} from '@docusaurus/theme-common';
|
|||
import {isActiveSidebarItem} from '@docusaurus/theme-common/internal';
|
||||
import Link from '@docusaurus/Link';
|
||||
import isInternalUrl from '@docusaurus/isInternalUrl';
|
||||
import IconExternalLink from '@theme/IconExternalLink';
|
||||
import IconExternalLink from '@theme/Icon/ExternalLink';
|
||||
import type {Props} from '@theme/DocSidebarItem/Link';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React from 'react';
|
||||
import Translate from '@docusaurus/Translate';
|
||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||
import IconEdit from '@theme/IconEdit';
|
||||
import IconEdit from '@theme/Icon/Edit';
|
||||
import type {Props} from '@theme/EditThisPage';
|
||||
|
||||
export default function EditThisPage({editUrl}: Props): JSX.Element {
|
||||
|
|
|
@ -10,7 +10,7 @@ import React from 'react';
|
|||
import Link from '@docusaurus/Link';
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import isInternalUrl from '@docusaurus/isInternalUrl';
|
||||
import IconExternalLink from '@theme/IconExternalLink';
|
||||
import IconExternalLink from '@theme/Icon/ExternalLink';
|
||||
import type {Props} from '@theme/Footer/LinkItem';
|
||||
|
||||
export default function FooterLinkItem({item}: Props): JSX.Element {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
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 {
|
||||
return (
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import type {Props} from '@theme/IconClose';
|
||||
import type {Props} from '@theme/Icon/Close';
|
||||
|
||||
export default function IconClose({
|
||||
width = 21,
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
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 {
|
||||
return (
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import type {Props} from '@theme/IconEdit';
|
||||
import type {Props} from '@theme/Icon/Edit';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import type {Props} from '@theme/IconExternalLink';
|
||||
import type {Props} from '@theme/Icon/ExternalLink';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
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 {
|
||||
return (
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import type {Props} from '@theme/IconLanguage';
|
||||
import type {Props} from '@theme/Icon/Language';
|
||||
|
||||
export default function IconLanguage({
|
||||
width = 20,
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
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 {
|
||||
return (
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import type {Props} from '@theme/IconMenu';
|
||||
import type {Props} from '@theme/Icon/Menu';
|
||||
|
||||
export default function IconMenu({
|
||||
width = 30,
|
|
@ -8,7 +8,7 @@
|
|||
import React from 'react';
|
||||
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
|
||||
import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
|
||||
import IconClose from '@theme/IconClose';
|
||||
import IconClose from '@theme/Icon/Close';
|
||||
import NavbarLogo from '@theme/Navbar/Logo';
|
||||
|
||||
function CloseButton() {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
|
||||
import IconMenu from '@theme/IconMenu';
|
||||
import IconMenu from '@theme/Icon/Menu';
|
||||
|
||||
export default function MobileSidebarToggle(): JSX.Element {
|
||||
const mobileSidebar = useNavbarMobileSidebar();
|
||||
|
|
|
@ -10,7 +10,7 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|||
import {useAlternatePageUtils} from '@docusaurus/theme-common/internal';
|
||||
import {translate} from '@docusaurus/Translate';
|
||||
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 {Props} from '@theme/NavbarItem/LocaleDropdownNavbarItem';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import Link from '@docusaurus/Link';
|
|||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import isInternalUrl from '@docusaurus/isInternalUrl';
|
||||
import {isRegexpStringMatch} from '@docusaurus/theme-common';
|
||||
import IconExternalLink from '@theme/IconExternalLink';
|
||||
import IconExternalLink from '@theme/Icon/ExternalLink';
|
||||
import type {Props} from '@theme/NavbarItem/NavbarNavLink';
|
||||
|
||||
export default function NavbarNavLink({
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, {useState} from 'react';
|
|||
import clsx from 'clsx';
|
||||
import {useBlogPost} from '@docusaurus/theme-common/internal';
|
||||
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 styles from './styles.module.css';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
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 {
|
||||
if (expanded) {
|
|
@ -15,7 +15,7 @@ declare module '@theme/ChangelogItem/Header/Authors';
|
|||
declare module '@theme/ChangelogList';
|
||||
declare module '@theme/ChangelogList/Header';
|
||||
|
||||
declare module '@theme/IconExpand' {
|
||||
declare module '@theme/Icon/Expand' {
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
export interface Props extends ComponentProps<'svg'> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue