Skip to content

Commit 0cd6dc1

Browse files
✨ feat: Add GiteeAI (#53)
1 parent 53d99a6 commit 0cd6dc1

File tree

11 files changed

+205
-3
lines changed

11 files changed

+205
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

src/GiteeAI/components/Avatar.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { memo } from 'react';
2+
3+
import IconAvatar, { type IconAvatarProps } from '@/features/IconAvatar';
4+
5+
import { COLOR_PRIMARY, TITLE } from '../style';
6+
import Mono from './Mono';
7+
8+
export type AvatarProps = Omit<IconAvatarProps, 'Icon'>;
9+
10+
const Avatar = memo<AvatarProps>(({ background, ...rest }) => {
11+
return (
12+
<IconAvatar
13+
Icon={Mono}
14+
aria-label={TITLE}
15+
background={background || COLOR_PRIMARY}
16+
color={'#fff'}
17+
{...rest}
18+
/>
19+
);
20+
});
21+
22+
export default Avatar;

src/GiteeAI/components/Combine.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { memo } from 'react';
2+
3+
import IconCombine, { type IconCombineProps } from '@/features/IconCombine';
4+
5+
import { SPACE_MULTIPLE, TEXT_MULTIPLE, TITLE } from '../style';
6+
import Mono from './Mono';
7+
import Text from './Text';
8+
9+
export type CombineProps = Omit<IconCombineProps, 'Icon' | 'Text'>;
10+
11+
const Combine = memo<CombineProps>(({ ...rest }) => {
12+
return (
13+
<IconCombine
14+
Icon={Mono}
15+
Text={Text as any}
16+
aria-label={TITLE}
17+
spaceMultiple={SPACE_MULTIPLE}
18+
textMultiple={TEXT_MULTIPLE}
19+
{...rest}
20+
/>
21+
);
22+
});
23+
24+
export default Combine;

src/GiteeAI/components/Mono.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { forwardRef } from 'react';
2+
3+
import type { IconType } from '@/types';
4+
5+
import { TITLE } from '../style';
6+
7+
const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
8+
return (
9+
<svg
10+
fill="currentColor"
11+
fillRule="evenodd"
12+
height={size}
13+
ref={ref}
14+
style={{ flex: 'none', lineHeight: 1, ...style }}
15+
viewBox="0 0 24 24"
16+
width={size}
17+
xmlns="http://www.w3.org/2000/svg"
18+
{...rest}
19+
>
20+
<title>{TITLE}</title>
21+
<g clipPath="url(#a)">
22+
<path
23+
clipRule="evenodd"
24+
d="M15.08 14.637c.218.815.46 1.648.72 2.513.238.79-.472 1.1-.755.356a66.148 66.148 0 01-.864-2.402c-1.542.775-3.08 1.421-4.823 2.148.697 2.563 1.34 4.707 2.34 6.744.1.003.2.004.302.004 6.628 0 12-5.373 12-12 0-2.38-.693-4.598-1.888-6.464-3.117.281-5.881.738-8.42 1.308a39.775 39.775 0 001.077 6.587 97.459 97.459 0 003.64-1.718c.92-.46 1.808-.49.312.683a37.134 37.134 0 01-3.642 2.24zm6.614-9.712A11.993 11.993 0 0013.557.1c-.101 1.617-.07 3.658.052 5.603 2.44-.37 5.094-.627 8.085-.778zM11.962 0a37.821 37.821 0 00.152 5.948c-1.69.298-3.28.656-4.818 1.074-.067-.767-.1-1.467-.1-2.077a.8.8 0 00-1.6 0c0 .742.061 1.594.172 2.518-.767.234-1.524.484-2.276.75a.8.8 0 00.533 1.508c.65-.23 1.306-.458 1.969-.681.32 1.96.807 4.126 1.368 6.21.098.363.202.726.31 1.086-2.067.712-4.176 1.29-6.105 1.597A11.945 11.945 0 010 12C0 5.385 5.352.02 11.962 0zM2.515 19.352a11.985 11.985 0 008.237 4.584c-.797-1.463-1.792-3.706-2.628-6.182-1.86.712-3.769 1.208-5.61 1.598zm11.27-5.484a39.054 39.054 0 01-1.232-5.302 15.441 15.441 0 01-.277-1.388A74.043 74.043 0 007.46 8.556c.248 1.93.666 4.124 1.246 6.277l.264.983v.002l.013.046a56.801 56.801 0 002.134-.849 174.05 174.05 0 002.666-1.147z"
25+
></path>
26+
</g>
27+
<defs>
28+
<clipPath id="a">
29+
<path d="M0 0h24v24H0z"></path>
30+
</clipPath>
31+
</defs>
32+
</svg>
33+
);
34+
});
35+
36+
export default Icon;

src/GiteeAI/components/Text.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { forwardRef } from 'react';
2+
3+
import type { IconType } from '@/types';
4+
5+
import { TITLE } from '../style';
6+
7+
const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
8+
return (
9+
<svg
10+
fill="currentColor"
11+
fillRule="evenodd"
12+
height={size}
13+
ref={ref}
14+
style={{ flex: 'none', lineHeight: 1, ...style }}
15+
viewBox="0 0 80 24"
16+
xmlns="http://www.w3.org/2000/svg"
17+
{...rest}
18+
>
19+
<title>{TITLE}</title>
20+
<path d="M7.349 24c2.183 0 3.926-.426 5.228-1.278 1.303-.851 1.954-1.954 1.954-3.308 0-2.184-1.63-3.276-4.89-3.276H7.633c-.67 0-1.15-.065-1.441-.196-.291-.131-.437-.35-.437-.655s.095-.56.284-.765c.073-.087.167-.116.284-.087.465.13.91.196 1.331.196 1.5 0 2.718-.36 3.657-1.08.939-.721 1.408-1.788 1.408-3.2 0-.524-.094-.99-.284-1.397-.014-.03-.01-.062.011-.099a.107.107 0 01.099-.054h.502c.364 0 .67-.124.917-.372.247-.247.37-.553.37-.917v-.305c0-.35-.123-.652-.37-.907a1.228 1.228 0 00-.917-.382h-3.21c-.101 0-.21-.014-.327-.044a6.282 6.282 0 00-1.856-.262c-.946 0-1.812.164-2.598.492a4.502 4.502 0 00-1.954 1.572c-.516.72-.775 1.576-.775 2.566 0 .684.16 1.31.48 1.878.321.568.721 1.026 1.202 1.376.029.014.043.036.043.065 0 .03-.014.059-.043.088a3.49 3.49 0 00-.983 1.059c-.247.415-.371.84-.371 1.277 0 .932.371 1.653 1.113 2.162.03.015.044.04.044.077s-.015.069-.044.098c-.582.291-1.022.648-1.32 1.07A2.368 2.368 0 002 20.79c0 .728.247 1.34.742 1.834.495.495 1.132.848 1.91 1.06.78.21 1.678.316 2.697.316zm.305-11.771c-.48 0-.87-.171-1.168-.513-.298-.342-.447-.834-.447-1.474 0-.626.15-1.11.447-1.453.299-.342.688-.513 1.168-.513s.87.168 1.168.503.448.822.448 1.463c0 .64-.15 1.132-.448 1.474s-.687.513-1.168.513zm.306 9.281c-.83 0-1.488-.113-1.976-.338-.487-.226-.731-.565-.731-1.016 0-.364.167-.706.502-1.026.044-.044.11-.066.196-.066h.066c.364.073.917.11 1.66.11h1.2c.64 0 1.11.065 1.408.196.299.131.448.371.448.72 0 .408-.259.747-.775 1.016-.517.27-1.183.404-1.998.404zM18.526 4.083c.655 0 1.194-.19 1.616-.568.422-.378.633-.866.633-1.463 0-.597-.211-1.088-.633-1.474C19.72.192 19.182 0 18.526 0c-.67 0-1.219.193-1.648.58-.43.385-.644.876-.644 1.473 0 .597.214 1.085.644 1.463.43.379.979.568 1.648.568zm.677 14.501c.35 0 .651-.127.906-.382s.382-.557.382-.906V7.14c0-.35-.127-.652-.382-.907a1.238 1.238 0 00-.906-.382h-1.376c-.363 0-.669.128-.916.382a1.257 1.257 0 00-.372.907v10.155c0 .35.124.651.372.906s.553.382.916.382h1.376zm9.497.306c.553 0 1.098-.051 1.637-.153.35-.058.619-.247.808-.568.13-.218.196-.444.196-.677a2.64 2.64 0 00-.022-.327l-.087-.35a1.162 1.162 0 00-.546-.731 1.968 1.968 0 00-.982-.295c-1.004-.044-1.507-.699-1.507-1.966V9.128c0-.102.051-.153.153-.153h1.55c.35 0 .652-.127.906-.382.255-.255.382-.557.382-.906V7.14c0-.35-.127-.652-.382-.906a1.238 1.238 0 00-.906-.382h-1.55c-.102 0-.153-.051-.153-.153V3.8c0-.364-.127-.67-.382-.917a1.256 1.256 0 00-.906-.372h-.742c-.364 0-.684.12-.96.36-.277.24-.444.543-.503.907l-.24 1.922c-.014.102-.08.16-.196.174l-.502.044a1.35 1.35 0 00-.917.448c-.248.27-.371.586-.371.95v.37c0 .35.127.652.382.907.254.255.556.382.906.382h.283c.102 0 .153.051.153.153v4.74c0 1.586.364 2.82 1.092 3.7.728.881 1.863 1.322 3.406 1.322zm10.676 0c1.164 0 2.314-.27 3.449-.808.32-.146.524-.4.611-.765a.982.982 0 00.066-.349 1.27 1.27 0 00-.196-.655l-.066-.131a1.283 1.283 0 00-.764-.612 1.825 1.825 0 00-.48-.065c-.19 0-.372.03-.546.087a4.558 4.558 0 01-1.529.262c-1.717 0-2.758-.764-3.121-2.293-.015-.043-.008-.083.021-.12s.066-.054.11-.054h6.003c.379 0 .713-.12 1.004-.36s.444-.543.459-.907v-.415c0-1.834-.466-3.32-1.397-4.455-.932-1.135-2.285-1.703-4.06-1.703a5.56 5.56 0 00-2.239.47c-.72.312-1.36.75-1.92 1.31-.561.56-1.012 1.266-1.354 2.118-.343.851-.513 1.78-.513 2.784 0 2.053.607 3.676 1.822 4.87s2.762 1.79 4.64 1.79zm1.484-8.08h-3.995c-.102 0-.153-.037-.153-.11 0-.596.284-1.128.852-1.594.407-.349.895-.524 1.462-.524.655 0 1.146.186 1.474.557.327.371.506.87.535 1.496v.022c0 .102-.058.153-.175.153zm11.833 8.08c1.165 0 2.315-.27 3.45-.808.32-.146.524-.4.611-.765a.982.982 0 00.066-.349c0-.218-.066-.437-.197-.655l-.066-.131a1.278 1.278 0 00-.764-.612 1.815 1.815 0 00-.48-.065c-.19 0-.37.03-.545.087a4.563 4.563 0 01-1.53.262c-1.716 0-2.757-.764-3.12-2.293a.122.122 0 01.02-.12.135.135 0 01.11-.054h6.004c.378 0 .713-.12 1.004-.36.29-.24.444-.543.459-.907v-.415c0-1.834-.467-3.32-1.398-4.455-.93-1.135-2.285-1.703-4.06-1.703a5.56 5.56 0 00-2.238.47c-.72.312-1.36.75-1.92 1.31-.562.56-1.013 1.266-1.355 2.118-.342.851-.513 1.78-.513 2.784 0 2.053.608 3.676 1.823 4.87s2.762 1.79 4.64 1.79zm1.485-8.08h-3.995c-.103 0-.153-.037-.153-.11 0-.596.284-1.128.851-1.594.407-.349.895-.524 1.463-.524.655 0 1.146.186 1.473.557.328.371.507.87.535 1.496v.022c0 .102-.058.153-.174.153zM63.198 18.708h-2.286l6.096-13.333 6.238 13.333h-2.238l-4-8.428-3.81 8.428zM75.457 5.641h2.286v13.067h-2.286V5.641z"></path>
21+
</svg>
22+
);
23+
});
24+
25+
export default Icon;

src/GiteeAI/index.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
nav: Components
3+
group: Provider
4+
title: GiteeAI
5+
atomId: GiteeAI
6+
description: https://ai-assets.gitee.com/
7+
---
8+
9+
## Icons
10+
11+
```tsx
12+
import { GiteeAI } from '@lobehub/icons';
13+
import { Flexbox } from 'react-layout-kit';
14+
15+
export default () => <GiteeAI size={64} />;
16+
```
17+
18+
## Text
19+
20+
```tsx
21+
import { GiteeAI } from '@lobehub/icons';
22+
23+
export default () => <GiteeAI.Text size={48} />;
24+
```
25+
26+
## Combine
27+
28+
```tsx
29+
import { GiteeAI } from '@lobehub/icons';
30+
import { Flexbox } from 'react-layout-kit';
31+
32+
export default () => (
33+
<Flexbox gap={16}>
34+
<GiteeAI.Combine size={64} />
35+
</Flexbox>
36+
);
37+
```
38+
39+
## Avatars
40+
41+
```tsx
42+
import { GiteeAI } from '@lobehub/icons';
43+
import { Flexbox } from 'react-layout-kit';
44+
45+
export default () => (
46+
<Flexbox gap={16} horizontal>
47+
<GiteeAI.Avatar size={64} />
48+
<GiteeAI.Avatar size={64} shape={'square'} />
49+
</Flexbox>
50+
);
51+
```
52+
53+
## Colors
54+
55+
```tsx
56+
import { GiteeAI } from '@lobehub/icons';
57+
import { Flexbox } from 'react-layout-kit';
58+
59+
import ColorPreview from '../components/ColorPreview';
60+
61+
export default () => (
62+
<Flexbox gap={16} horizontal>
63+
<ColorPreview color={GiteeAI.colorPrimary} />
64+
</Flexbox>
65+
);
66+
```

src/GiteeAI/index.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Avatar from './components/Avatar';
2+
import Combine from './components/Combine';
3+
import Mono from './components/Mono';
4+
import Text from './components/Text';
5+
import { COLOR_PRIMARY, TITLE } from './style';
6+
7+
export type CompoundedIcon = typeof Mono & {
8+
Avatar: typeof Avatar;
9+
Combine: typeof Combine;
10+
Text: typeof Text;
11+
colorPrimary: string;
12+
title: string;
13+
};
14+
15+
const Icons = Mono as CompoundedIcon;
16+
Icons.Text = Text;
17+
Icons.Combine = Combine;
18+
Icons.Avatar = Avatar;
19+
Icons.colorPrimary = COLOR_PRIMARY;
20+
Icons.title = TITLE;
21+
export default Icons;

src/GiteeAI/style.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const TITLE = 'GiteeAI';
2+
export const TEXT_MULTIPLE = 0.85;
3+
export const SPACE_MULTIPLE = 0.2;
4+
export const COLOR_PRIMARY = '#000';

src/features/providerConfig.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import DeepSeek from '@/DeepSeek';
1616
import Doubao from '@/Doubao';
1717
import Fireworks from '@/Fireworks';
1818
import Gemini from '@/Gemini';
19+
import GiteeAI from '@/GiteeAI';
1920
import Github from '@/Github';
2021
import Google from '@/Google';
2122
import Groq from '@/Groq';
@@ -185,4 +186,5 @@ export const providerMappings: ProviderMapping[] = [
185186
},
186187
{ Icon: InternLM, combineMultiple: 0.95, keywords: [ModelProvider.InternLM] },
187188
{ Icon: Higress, keywords: [ModelProvider.Higress] },
189+
{ Icon: GiteeAI, combineMultiple: 0.95, keywords: [ModelProvider.GiteeAI] },
188190
];

src/features/providerEnum.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export enum ModelProvider {
99
DeepSeek = 'deepseek',
1010
Doubao = 'Doubao',
1111
FireworksAI = 'fireworksai',
12+
GiteeAI = 'giteeai',
1213
Github = 'github',
1314
Google = 'google',
1415
Groq = 'groq',

0 commit comments

Comments
 (0)