diff --git a/src/ModelScope/components/Avatar.tsx b/src/ModelScope/components/Avatar.tsx new file mode 100644 index 0000000..50e3f40 --- /dev/null +++ b/src/ModelScope/components/Avatar.tsx @@ -0,0 +1,18 @@ +'use client'; + +import { memo } from 'react'; + +import IconAvatar, { type IconAvatarProps } from '@/features/IconAvatar'; + +import { COLOR_PRIMARY, TITLE } from '../style'; +import Mono from './Mono'; + +export type AvatarProps = Omit; + +const Avatar = memo(({ background, ...rest }) => { + return ( + + ); +}); + +export default Avatar; diff --git a/src/ModelScope/components/Color.tsx b/src/ModelScope/components/Color.tsx new file mode 100644 index 0000000..bc92695 --- /dev/null +++ b/src/ModelScope/components/Color.tsx @@ -0,0 +1,35 @@ +'use client'; + +import { forwardRef } from 'react'; + +import type { IconType } from '@/types'; + +import { TITLE } from '../style'; + +const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => { + return ( + + {TITLE} + + + + + + ); +}); + +export default Icon; diff --git a/src/ModelScope/components/Combine.tsx b/src/ModelScope/components/Combine.tsx new file mode 100644 index 0000000..2bf349a --- /dev/null +++ b/src/ModelScope/components/Combine.tsx @@ -0,0 +1,30 @@ +'use client'; + +import { memo } from 'react'; + +import IconCombine, { type IconCombineProps } from '@/features/IconCombine'; + +import { SPACE_MULTIPLE, TEXT_MULTIPLE, TITLE } from '../style'; +import Color from './Color'; +import Mono from './Mono'; +import Text from './Text'; + +export interface CombineProps extends Omit { + type?: 'color' | 'mono'; +} +const Combine = memo(({ type = 'mono', ...rest }) => { + const Icon = type === 'color' ? Color : Mono; + + return ( + + ); +}); + +export default Combine; diff --git a/src/ModelScope/components/Mono.tsx b/src/ModelScope/components/Mono.tsx new file mode 100644 index 0000000..0cbf8a0 --- /dev/null +++ b/src/ModelScope/components/Mono.tsx @@ -0,0 +1,28 @@ +'use client'; + +import { forwardRef } from 'react'; + +import type { IconType } from '@/types'; + +import { TITLE } from '../style'; + +const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => { + return ( + + {TITLE} + + + ); +}); + +export default Icon; diff --git a/src/ModelScope/components/Text.tsx b/src/ModelScope/components/Text.tsx new file mode 100644 index 0000000..da4ad5c --- /dev/null +++ b/src/ModelScope/components/Text.tsx @@ -0,0 +1,30 @@ +'use client'; + +import { forwardRef } from 'react'; + +import type { IconType } from '@/types'; + +import { TITLE } from '../style'; + +const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => { + return ( + + {TITLE} + + + ); +}); + +export default Icon; diff --git a/src/ModelScope/index.md b/src/ModelScope/index.md new file mode 100644 index 0000000..1bd752a --- /dev/null +++ b/src/ModelScope/index.md @@ -0,0 +1,73 @@ +--- +nav: Components +group: Provider +title: ModelScope (魔搭) +atomId: ModelScope +description: https://modelscope.cn +--- + +## Icons + +```tsx +import { ModelScope } from '@lobehub/icons'; +import { Flexbox } from 'react-layout-kit'; + +export default () => ( + + + + +); +``` + +## Text + +```tsx +import { ModelScope } from '@lobehub/icons'; + +export default () => ; +``` + +## Combine + +```tsx +import { ModelScope } from '@lobehub/icons'; +import { Flexbox } from 'react-layout-kit'; + +export default () => ( + + + + +); +``` + +## Avatars + +```tsx +import { ModelScope } from '@lobehub/icons'; +import { Flexbox } from 'react-layout-kit'; + +export default () => ( + + + + + +); +``` + +## Colors + +```tsx +import { ModelScope } from '@lobehub/icons'; +import { Flexbox } from 'react-layout-kit'; + +import ColorPreview from '../components/ColorPreview'; + +export default () => ( + + + +); +``` diff --git a/src/ModelScope/index.ts b/src/ModelScope/index.ts new file mode 100644 index 0000000..765ff80 --- /dev/null +++ b/src/ModelScope/index.ts @@ -0,0 +1,28 @@ +'use client'; + +import Avatar from './components/Avatar'; +import Color from './components/Color'; +import Combine from './components/Combine'; +import Mono from './components/Mono'; +import Text from './components/Text'; +import { COLOR_PRIMARY, TITLE } from './style'; + +export type CompoundedIcon = typeof Mono & { + Avatar: typeof Avatar; + Color: typeof Color; + Combine: typeof Combine; + Text: typeof Text; + colorGradient: string; + colorPrimary: string; + title: string; +}; + +const Icons = Mono as CompoundedIcon; +Icons.Color = Color; +Icons.Text = Text; +Icons.Combine = Combine; +Icons.Avatar = Avatar; +Icons.colorPrimary = COLOR_PRIMARY; +Icons.title = TITLE; + +export default Icons; diff --git a/src/ModelScope/style.ts b/src/ModelScope/style.ts new file mode 100644 index 0000000..afb0795 --- /dev/null +++ b/src/ModelScope/style.ts @@ -0,0 +1,4 @@ +export const TITLE = 'ModelScope'; +export const TEXT_MULTIPLE = 0.6; +export const SPACE_MULTIPLE = 0.2; +export const COLOR_PRIMARY = '#624AFF'; diff --git a/src/features/providerConfig.tsx b/src/features/providerConfig.tsx index 6eef6e2..ee96a87 100644 --- a/src/features/providerConfig.tsx +++ b/src/features/providerConfig.tsx @@ -28,6 +28,7 @@ import LmStudio from '@/LmStudio'; import LobeHub from '@/LobeHub'; import Minimax from '@/Minimax'; import Mistral from '@/Mistral'; +import ModelScope from '@/ModelScope'; import Moonshot from '@/Moonshot'; import Novita from '@/Novita'; import Ollama from '@/Ollama'; @@ -187,4 +188,5 @@ export const providerMappings: ProviderMapping[] = [ { Icon: InternLM, combineMultiple: 0.95, keywords: [ModelProvider.InternLM] }, { Icon: Higress, keywords: [ModelProvider.Higress] }, { Icon: GiteeAI, combineMultiple: 0.95, keywords: [ModelProvider.GiteeAI] }, + { Icon: ModelScope, combineMultiple: 0.95, keywords: [ModelProvider.ModelScope] }, ]; diff --git a/src/features/providerEnum.ts b/src/features/providerEnum.ts index 3f9e8d2..11fd454 100644 --- a/src/features/providerEnum.ts +++ b/src/features/providerEnum.ts @@ -21,6 +21,7 @@ export enum ModelProvider { LobeHub = 'lobehub', Minimax = 'minimax', Mistral = 'mistral', + ModelScope = 'modelscope', Moonshot = 'moonshot', Novita = 'novita', Ollama = 'ollama', diff --git a/src/icons.ts b/src/icons.ts index 4fb4a06..15161a3 100644 --- a/src/icons.ts +++ b/src/icons.ts @@ -71,6 +71,7 @@ export { default as Meta, type CompoundedIcon as MetaProps } from './Meta'; export { default as Midjourney, type CompoundedIcon as MidjourneyProps } from './Midjourney'; export { default as Minimax, type CompoundedIcon as MinimaxProps } from './Minimax'; export { default as Mistral, type CompoundedIcon as MistralProps } from './Mistral'; +export { default as ModelScope, type CompoundedIcon as ModelScopeProps } from './ModelScope'; export { default as Moonshot, type CompoundedIcon as MoonshotProps } from './Moonshot'; export { default as MyShell, type CompoundedIcon as MyShellProps } from './MyShell'; export { default as Notion, type CompoundedIcon as NotionProps } from './Notion'; diff --git a/src/toc.ts b/src/toc.ts index b867ee3..2a4add3 100644 --- a/src/toc.ts +++ b/src/toc.ts @@ -1371,6 +1371,25 @@ const toc: IconToc[] = [ }, title: 'Mistral', }, + { + color: '#624AFF', + desc: 'https://modelscope.cn', + docsUrl: 'model-scope', + fullTitle: 'ModelScope (魔搭)', + group: 'provider', + id: 'ModelScope', + param: { + hasAvatar: true, + hasBrand: false, + hasBrandColor: false, + hasColor: true, + hasCombine: true, + hasText: true, + hasTextCn: false, + hasTextColor: false, + }, + title: 'ModelScope', + }, { color: '#16191E', desc: 'https://moonshot.cn',