Skip to content

Commit

Permalink
✨ feat: Add BAAI (resolve #80)
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Mar 3, 2025
1 parent 7d1ad08 commit 509d749
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/BAAI/components/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'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<IconAvatarProps, 'Icon'>;

const Avatar = memo<AvatarProps>(({ background, ...rest }) => {
return (
<IconAvatar
Icon={Mono}
aria-label={TITLE}
background={background || COLOR_PRIMARY}
color={'#fff'}
iconMultiple={0.6}
{...rest}
/>
);
});

export default Avatar;
27 changes: 27 additions & 0 deletions src/BAAI/components/Combine.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use client';

import { memo } from 'react';

import IconCombine, { type IconCombineProps } from '@/features/IconCombine';

import { SPACE_MULTIPLE, TEXT_MULTIPLE, TITLE } from '../style';
import Mono from './Mono';
import Text from './Text';

export type CombineProps = Omit<IconCombineProps, 'Icon' | 'Text'>;

const Combine = memo<CombineProps>(({ ...rest }) => {
return (
<IconCombine
Icon={Mono}
Text={Text}
aria-label={TITLE}
iconProps={{ shape: 'square' }}
spaceMultiple={SPACE_MULTIPLE}
textMultiple={TEXT_MULTIPLE}
{...rest}
/>
);
});

export default Combine;
31 changes: 31 additions & 0 deletions src/BAAI/components/Mono.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'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 (
<svg
fill="currentColor"
fillRule="evenodd"
height={size}
ref={ref}
style={{ flex: 'none', lineHeight: 1, ...style }}
viewBox="0 0 24 24"
width={size}
xmlns="http://www.w3.org/2000/svg"
{...rest}
>
<title>{TITLE}</title>
<path
clipRule="evenodd"
d="M0 4.68L8.61 0l3.583 2.004 3.1-1.735L24 5.14v8.701l-3.582 2.004v3.469L12.038 24l-8.482-4.52v-3.847L0 13.9V4.68zm1.284 1.472v2.934l7.936 4.098-.032 1.419-7.904-4.08v2.658l10.043 5.303V11.77L1.284 6.152zm10.741 4.532l9.791-5.33-2.63-1.47-7.398 4.137-1.251-.736 7.366-4.12-2.61-1.46-9.806 5.34 6.538 3.64zM4.2 6.328l6.709-3.606L8.61 1.436l-6.714 3.61L4.2 6.327zm11.04 14.444l-2.618 1.465V11.94l6.512-3.642v10.298l-2.61 1.46v-8.241l-1.283.682v8.277zm-10.4-4.42l6.487 3.568v2.23L4.84 18.763v-2.41zm17.876-3.23v-6.83L20.418 7.58v6.829l2.298-1.286z"
/>
</svg>
);
});

export default Icon;
27 changes: 27 additions & 0 deletions src/BAAI/components/Text.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'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 (
<svg
fill="currentColor"
fillRule="evenodd"
height={size}
ref={ref}
style={{ flex: 'none', lineHeight: 1, ...style }}
viewBox="0 0 97 24"
xmlns="http://www.w3.org/2000/svg"
{...rest}
>
<title>{TITLE}</title>
<path d="M15.49 2H2v4.616h11.597a1.539 1.539 0 010 3.076H2v4.616h11.597a1.54 1.54 0 010 3.076H2V22h13.49a6.151 6.151 0 004.802-10A6.154 6.154 0 0015.49 2zM95.362 2h-6.965v20h6.965V2zM73.42 2h-6.966l-8.562 20h6.963l5.086-11.876L75.026 22h6.965L73.427 2h-.008zM43.706 2h-6.965l-8.564 20h6.965l5.085-11.876L45.313 22h6.965L43.713 2h-.007z" />
</svg>
);
});

export default Icon;
66 changes: 66 additions & 0 deletions src/BAAI/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
nav: Components
group: Model
title: BAAI (智源研究院)
atomId: BAAI
description: https://baai.ac.cn
---

## Icons

```tsx
import { BAAI } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

export default () => <BAAI size={64} />;
```

## Text

```tsx
import { BAAI } from '@lobehub/icons';

export default () => <BAAI.Text size={48} />;
```

## Combine

```tsx
import { BAAI } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

export default () => (
<Flexbox gap={16} align={'flex-start'}>
<BAAI.Combine size={64} />
</Flexbox>
);
```

## Avatars

```tsx
import { BAAI } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

export default () => (
<Flexbox gap={16} horizontal>
<BAAI.Avatar size={64} />
<BAAI.Avatar size={64} shape={'square'} />
</Flexbox>
);
```

## Colors

```tsx
import { BAAI } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

import ColorPreview from '../components/ColorPreview';

export default () => (
<Flexbox gap={16} horizontal>
<ColorPreview color={BAAI.colorPrimary} />
</Flexbox>
);
```
23 changes: 23 additions & 0 deletions src/BAAI/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client';

import Avatar from './components/Avatar';
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;
Combine: typeof Combine;
Text: typeof Text;
colorPrimary: string;
title: string;
};

const Icons = Mono as CompoundedIcon;
Icons.Text = Text;
Icons.Combine = Combine;
Icons.Avatar = Avatar;
Icons.colorPrimary = COLOR_PRIMARY;
Icons.title = TITLE;
export default Icons;
4 changes: 4 additions & 0 deletions src/BAAI/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const TITLE = 'BAAI';
export const TEXT_MULTIPLE = 0.7;
export const SPACE_MULTIPLE = 0.3;
export const COLOR_PRIMARY = '#000';
1 change: 1 addition & 0 deletions src/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export { default as Aws, type CompoundedIcon as AwsProps } from './Aws';
export { default as Aya, type CompoundedIcon as AyaProps } from './Aya';
export { default as Azure, type CompoundedIcon as AzureProps } from './Azure';
export { default as AzureAI, type CompoundedIcon as AzureAIProps } from './AzureAI';
export { default as BAAI, type CompoundedIcon as BAAIProps } from './BAAI';
export { default as Baichuan, type CompoundedIcon as BaichuanProps } from './Baichuan';
export { default as Baidu, type CompoundedIcon as BaiduProps } from './Baidu';
export { default as BaiduCloud, type CompoundedIcon as BaiduCloudProps } from './BaiduCloud';
Expand Down
19 changes: 19 additions & 0 deletions src/toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,25 @@ const toc: IconToc[] = [
},
title: 'AzureAI',
},
{
color: '#000',
desc: 'https://baai.ac.cn',
docsUrl: 'baai',
fullTitle: 'BAAI (智源研究院)',
group: 'model',
id: 'BAAI',
param: {
hasAvatar: true,
hasBrand: false,
hasBrandColor: false,
hasColor: false,
hasCombine: true,
hasText: true,
hasTextCn: false,
hasTextColor: false,
},
title: 'BAAI',
},
{
color: '#FF6933',
colorGradient: 'linear-gradient(-45deg, #FF6933, #FEC13E)',
Expand Down

0 comments on commit 509d749

Please sign in to comment.