From 03817d3c3dd737f4e84a2aae170e760e93e278f5 Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Fri, 10 Jan 2025 14:19:52 +0800 Subject: [PATCH] :bug: fix: fix file type icon (#243) * :bug: fix: fix file type icon * Update index.tsx * Update index.tsx --- .dumirc.ts | 1 - src/{icons => }/FileTypeIcon/demos/Icon.tsx | 5 ++-- src/{icons => }/FileTypeIcon/demos/index.tsx | 3 ++- src/FileTypeIcon/index.md | 16 +++++++++++++ src/{icons => }/FileTypeIcon/index.tsx | 0 .../MaterialFileTypeIcon/demos/index.tsx | 3 ++- .../MaterialFileTypeIcon/icon-map.json | 0 src/MaterialFileTypeIcon/index.md | 12 ++++++++++ .../MaterialFileTypeIcon/index.tsx | 2 +- src/{icons => }/MaterialFileTypeIcon/types.ts | 0 src/{icons => }/MaterialFileTypeIcon/utils.ts | 0 src/components.ts | 5 ++++ src/icons/FileTypeIcon/index.md | 23 ------------------- src/icons/MaterialFileTypeIcon/index.md | 17 -------------- src/icons/components.ts | 5 ---- src/icons/icons.ts | 13 ----------- src/icons/index.ts | 15 ++++++++++-- src/index.ts | 1 - 18 files changed, 53 insertions(+), 68 deletions(-) rename src/{icons => }/FileTypeIcon/demos/Icon.tsx (96%) rename src/{icons => }/FileTypeIcon/demos/index.tsx (89%) create mode 100644 src/FileTypeIcon/index.md rename src/{icons => }/FileTypeIcon/index.tsx (100%) rename src/{icons => }/MaterialFileTypeIcon/demos/index.tsx (97%) rename src/{icons => }/MaterialFileTypeIcon/icon-map.json (100%) create mode 100644 src/MaterialFileTypeIcon/index.md rename src/{icons => }/MaterialFileTypeIcon/index.tsx (97%) rename src/{icons => }/MaterialFileTypeIcon/types.ts (100%) rename src/{icons => }/MaterialFileTypeIcon/utils.ts (100%) delete mode 100644 src/icons/FileTypeIcon/index.md delete mode 100644 src/icons/MaterialFileTypeIcon/index.md delete mode 100644 src/icons/components.ts delete mode 100644 src/icons/icons.ts diff --git a/.dumirc.ts b/.dumirc.ts index fe232799..dc147c4d 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -27,7 +27,6 @@ const nav: INavItem[] = [ { link: '/components/brand/lobe-hub', title: 'Brand' }, { link: '/components/mdx/callout', title: 'Mdx' }, { link: '/components/color/color-scales', title: 'Color' }, - { link: '/components/icons/file-type-icon', mode: 'override', title: 'Icons' }, { link: '/changelog', title: 'Changelog' }, ]; diff --git a/src/icons/FileTypeIcon/demos/Icon.tsx b/src/FileTypeIcon/demos/Icon.tsx similarity index 96% rename from src/icons/FileTypeIcon/demos/Icon.tsx rename to src/FileTypeIcon/demos/Icon.tsx index 3efc20a2..6b7964ea 100644 --- a/src/icons/FileTypeIcon/demos/Icon.tsx +++ b/src/FileTypeIcon/demos/Icon.tsx @@ -1,5 +1,4 @@ -import { Icon } from '@lobehub/ui'; -import { FileTypeIcon } from '@lobehub/ui/icons'; +import { FileTypeIcon, Icon } from '@lobehub/ui'; import { createStyles, useTheme } from 'antd-style'; import { ArrowUpIcon, PlusIcon } from 'lucide-react'; import { Center, Flexbox } from 'react-layout-kit'; @@ -13,12 +12,12 @@ const useStyles = createStyles(({ css, token }) => { width: 150px; height: 100px; + border-radius: ${token.borderRadiusLG}px; font-weight: 500; text-align: center; background: ${token.colorFillTertiary}; - border-radius: ${token.borderRadiusLG}px; box-shadow: 0 0 0 1px ${token.colorFillTertiary} inset; `, glow: css` diff --git a/src/icons/FileTypeIcon/demos/index.tsx b/src/FileTypeIcon/demos/index.tsx similarity index 89% rename from src/icons/FileTypeIcon/demos/index.tsx rename to src/FileTypeIcon/demos/index.tsx index 35ab6468..e6c3771a 100644 --- a/src/icons/FileTypeIcon/demos/index.tsx +++ b/src/FileTypeIcon/demos/index.tsx @@ -1,4 +1,5 @@ -import { FileTypeIcon, FileTypeIconProps } from '@lobehub/ui/icons'; +import { FileTypeIcon, FileTypeIconProps } from '@lobehub/ui'; + import { StoryBook, useControls, useCreateStore } from '@lobehub/ui/storybook'; export default () => { diff --git a/src/FileTypeIcon/index.md b/src/FileTypeIcon/index.md new file mode 100644 index 00000000..95fc27a2 --- /dev/null +++ b/src/FileTypeIcon/index.md @@ -0,0 +1,16 @@ +--- +nav: Components +title: FileTypeIcon +--- + +## Default + + + +## Custom Icon + + + +## APIs + + diff --git a/src/icons/FileTypeIcon/index.tsx b/src/FileTypeIcon/index.tsx similarity index 100% rename from src/icons/FileTypeIcon/index.tsx rename to src/FileTypeIcon/index.tsx diff --git a/src/icons/MaterialFileTypeIcon/demos/index.tsx b/src/MaterialFileTypeIcon/demos/index.tsx similarity index 97% rename from src/icons/MaterialFileTypeIcon/demos/index.tsx rename to src/MaterialFileTypeIcon/demos/index.tsx index 419d85c1..93be36a8 100644 --- a/src/icons/MaterialFileTypeIcon/demos/index.tsx +++ b/src/MaterialFileTypeIcon/demos/index.tsx @@ -1,4 +1,5 @@ -import { MaterialFileTypeIcon, MaterialFileTypeIconProps } from '@lobehub/ui/icons'; +import { MaterialFileTypeIcon, MaterialFileTypeIconProps } from '@lobehub/ui'; + import { StoryBook, useControls, useCreateStore } from '@lobehub/ui/storybook'; export default () => { diff --git a/src/icons/MaterialFileTypeIcon/icon-map.json b/src/MaterialFileTypeIcon/icon-map.json similarity index 100% rename from src/icons/MaterialFileTypeIcon/icon-map.json rename to src/MaterialFileTypeIcon/icon-map.json diff --git a/src/MaterialFileTypeIcon/index.md b/src/MaterialFileTypeIcon/index.md new file mode 100644 index 00000000..6b0108b6 --- /dev/null +++ b/src/MaterialFileTypeIcon/index.md @@ -0,0 +1,12 @@ +--- +nav: Components +title: MaterialFileTypeIcon +--- + +## Default + + + +## APIs + + diff --git a/src/icons/MaterialFileTypeIcon/index.tsx b/src/MaterialFileTypeIcon/index.tsx similarity index 97% rename from src/icons/MaterialFileTypeIcon/index.tsx rename to src/MaterialFileTypeIcon/index.tsx index 70b1ca85..973f948a 100644 --- a/src/icons/MaterialFileTypeIcon/index.tsx +++ b/src/MaterialFileTypeIcon/index.tsx @@ -4,8 +4,8 @@ import { memo, useMemo } from 'react'; import { Center } from 'react-layout-kit'; import { useCdnFn } from '@/ConfigProvider'; +import FileTypeIcon from '@/FileTypeIcon'; import Img from '@/Img'; -import FileTypeIcon from '@/icons/FileTypeIcon'; import { DivProps } from '@/types'; import { getIconUrlForDirectoryPath, getIconUrlForFilePath } from './utils'; diff --git a/src/icons/MaterialFileTypeIcon/types.ts b/src/MaterialFileTypeIcon/types.ts similarity index 100% rename from src/icons/MaterialFileTypeIcon/types.ts rename to src/MaterialFileTypeIcon/types.ts diff --git a/src/icons/MaterialFileTypeIcon/utils.ts b/src/MaterialFileTypeIcon/utils.ts similarity index 100% rename from src/icons/MaterialFileTypeIcon/utils.ts rename to src/MaterialFileTypeIcon/utils.ts diff --git a/src/components.ts b/src/components.ts index 24a27550..94710f00 100644 --- a/src/components.ts +++ b/src/components.ts @@ -33,6 +33,7 @@ export { export { default as EditableText, type EditableTextProps } from './EditableText'; export { default as EmojiPicker, type EmojiPickerProps } from './EmojiPicker'; export { default as EmptyCard, type EmptyCardProps } from './EmptyCard'; +export { default as FileTypeIcon, type FileTypeIconProps } from './FileTypeIcon'; export { default as FluentEmoji, type FluentEmojiProps } from './FluentEmoji'; export { default as FontLoader, type FontLoaderProps } from './FontLoader'; export { default as Footer, type FooterProps } from './Footer'; @@ -80,6 +81,10 @@ export { export { default as List, type ListItemProps } from './List'; export { default as Markdown, type MarkdownProps } from './Markdown'; export { Typography, type TypographyProps } from './Markdown/Typography'; +export { + default as MaterialFileTypeIcon, + type MaterialFileTypeIconProps, +} from './MaterialFileTypeIcon'; export { default as Mermaid, type MermaidProps } from './Mermaid'; export { default as Modal, type ModalProps } from './Modal'; export { default as SearchBar, type SearchBarProps } from './SearchBar'; diff --git a/src/icons/FileTypeIcon/index.md b/src/icons/FileTypeIcon/index.md deleted file mode 100644 index 1ea9cc53..00000000 --- a/src/icons/FileTypeIcon/index.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -nav: Components -group: - title: Components - order: -1 -title: FileTypeIcon -apiHeader: - pkg: '@lobehub/ui/icons' - docUrl: 'https://github.com/lobehub/lobe-ui/tree/master/src/icons/FileTypeIcon/index.md' - sourceUrl: 'https://github.com/lobehub/lobe-ui/tree/master/src/icons/FileTypeIcon/index.ts' ---- - -## Default - - - -## Custom Icon - - - -## APIs - - diff --git a/src/icons/MaterialFileTypeIcon/index.md b/src/icons/MaterialFileTypeIcon/index.md deleted file mode 100644 index 58444fb0..00000000 --- a/src/icons/MaterialFileTypeIcon/index.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -nav: Components -group: Components -title: MaterialFileTypeIcon -apiHeader: - pkg: '@lobehub/ui/icons' - docUrl: 'https://github.com/lobehub/lobe-ui/tree/master/src/icons/MaterialFileTypeIcon/index.md' - sourceUrl: 'https://github.com/lobehub/lobe-ui/tree/master/src/icons/MaterialFileTypeIcon/index.ts' ---- - -## Default - - - -## APIs - - diff --git a/src/icons/components.ts b/src/icons/components.ts deleted file mode 100644 index c5aff5a3..00000000 --- a/src/icons/components.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { default as FileTypeIcon, type FileTypeIconProps } from './FileTypeIcon'; -export { - default as MaterialFileTypeIcon, - type MaterialFileTypeIconProps, -} from './MaterialFileTypeIcon'; diff --git a/src/icons/icons.ts b/src/icons/icons.ts deleted file mode 100644 index 944fe9b6..00000000 --- a/src/icons/icons.ts +++ /dev/null @@ -1,13 +0,0 @@ -export { default as Auth0, type CompoundedIcon as Auth0Props } from './Auth0'; -export { default as Authelia, type CompoundedIcon as AutheliaProps } from './Authelia'; -export { default as Authentik, type CompoundedIcon as AuthentikProps } from './Authentik'; -export { default as Casdoor, type CompoundedIcon as CasdoorProps } from './Casdoor'; -export { default as Clerk, type CompoundedIcon as ClerkProps } from './Clerk'; -export { default as Logto, type CompoundedIcon as LogtoProps } from './Logto'; -export { - default as MicrosoftEntra, - type CompoundedIcon as MicrosoftEntraProps, -} from './MicrosoftEntra'; -export { default as NextAuth, type CompoundedIcon as NextAuthProps } from './NextAuth'; -export { default as Zitadel, type CompoundedIcon as ZitadelProps } from './Zitadel'; -export { Cloudflare, type CloudflareProps, Github, type GithubProps } from '@lobehub/icons'; diff --git a/src/icons/index.ts b/src/icons/index.ts index 95d58a76..944fe9b6 100644 --- a/src/icons/index.ts +++ b/src/icons/index.ts @@ -1,2 +1,13 @@ -export * from './components'; -export * from './icons'; +export { default as Auth0, type CompoundedIcon as Auth0Props } from './Auth0'; +export { default as Authelia, type CompoundedIcon as AutheliaProps } from './Authelia'; +export { default as Authentik, type CompoundedIcon as AuthentikProps } from './Authentik'; +export { default as Casdoor, type CompoundedIcon as CasdoorProps } from './Casdoor'; +export { default as Clerk, type CompoundedIcon as ClerkProps } from './Clerk'; +export { default as Logto, type CompoundedIcon as LogtoProps } from './Logto'; +export { + default as MicrosoftEntra, + type CompoundedIcon as MicrosoftEntraProps, +} from './MicrosoftEntra'; +export { default as NextAuth, type CompoundedIcon as NextAuthProps } from './NextAuth'; +export { default as Zitadel, type CompoundedIcon as ZitadelProps } from './Zitadel'; +export { Cloudflare, type CloudflareProps, Github, type GithubProps } from '@lobehub/icons'; diff --git a/src/index.ts b/src/index.ts index 0411de6c..260d3957 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,5 @@ export { default as Logo, type LobeHubProps as LogoProps } from './brand/LobeHub export * from './chat'; export * from './color'; export * from './components'; -export * from './icons/components'; export * from './mobile'; export * from './storybook';