Skip to content

Commit f194d23

Browse files
✨ feat: Add BaiduCloud and SenseNova (resolve #43)
1 parent c887e34 commit f194d23

File tree

24 files changed

+689
-6
lines changed

24 files changed

+689
-6
lines changed

README.md

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

src/BaiduCloud/components/Avatar.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { memo } from 'react';
2+
3+
import IconAvatar, { type IconAvatarProps } from '@/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 Icon={Mono} aria-label={TITLE} background={background || COLOR_PRIMARY} {...rest} />
13+
);
14+
});
15+
16+
export default Avatar;

src/BaiduCloud/components/Color.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
height={size}
11+
ref={ref}
12+
style={{ flex: 'none', lineHeight: 1, ...style }}
13+
viewBox="0 0 24 24"
14+
width={size}
15+
xmlns="http://www.w3.org/2000/svg"
16+
{...rest}
17+
>
18+
<title>{TITLE}</title>
19+
<path
20+
d="M21.715 5.61l-3.983 2.31a.903.903 0 01-.896 0L12.44 5.384a.903.903 0 00-.897 0L7.156 7.92a.903.903 0 01-.896 0L2.276 5.617 12.002 0l9.713 5.61z"
21+
fill="#5BCA87"
22+
></path>
23+
<path
24+
d="M18.641 9.467a.89.89 0 00-.438.77v5.072a.896.896 0 01-.445.77l-4.428 2.51a.884.884 0 00-.445.777v4.607l4.429-2.536 5.31-3.047V7.157l-3.983 2.31z"
25+
fill="#EC5D3E"
26+
></path>
27+
<path
28+
d="M10.98 18.941a.936.936 0 00-.305-.352l-4.429-2.516a.903.903 0 01-.431-.764v-5.078a.89.89 0 00-.452-.757l-.451-.26L1.38 7.158V18.39l5.311 3.047L11.126 24v-4.608a.881.881 0 00-.146-.45z"
29+
fill="#2464F5"
30+
></path>
31+
</svg>
32+
);
33+
});
34+
35+
export default Icon;

src/BaiduCloud/components/Combine.tsx

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

src/BaiduCloud/components/Mono.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
<path d="M21.715 5.61l-3.983 2.31a.903.903 0 01-.896 0L12.44 5.384a.903.903 0 00-.897 0L7.156 7.92a.903.903 0 01-.896 0L2.276 5.617 12.002 0l9.713 5.61z"></path>
22+
<path d="M18.641 9.467a.89.89 0 00-.438.77v5.072a.896.896 0 01-.445.77l-4.428 2.51a.884.884 0 00-.445.777v4.607l4.429-2.536 5.31-3.047V7.157l-3.983 2.31z"></path>
23+
<path d="M10.98 18.941a.936.936 0 00-.305-.352l-4.429-2.516a.903.903 0 01-.431-.764v-5.078a.89.89 0 00-.452-.757l-.451-.26L1.38 7.158V18.39l5.311 3.047L11.126 24v-4.608a.881.881 0 00-.146-.45z"></path>
24+
</svg>
25+
);
26+
});
27+
28+
export default Icon;

src/BaiduCloud/components/Text.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 108 24"
16+
xmlns="http://www.w3.org/2000/svg"
17+
{...rest}
18+
>
19+
<title>{TITLE}</title>
20+
<path d="M32.273 3.064V2h3.25v1.064h7.162v2.178H26.46v12.137a18.54 18.54 0 01-.503 4.608h-2.89c.53-1.476.766-3.041.695-4.608V3.064h8.511z"></path>
21+
<path
22+
clipRule="evenodd"
23+
d="M12.379 8.065l.837-2.513h8.251V3.039H2v2.513h7.698l-.796 2.513H2.913v13.93h15.204a2.311 2.311 0 001.742-.628c.448-.44.69-1.048.67-1.676V8.065h-8.15zm-6.367 5.662v-3.283h11.476v3.283H6.012zm0 2.337H17.53v2.337c.007.306-.097.603-.293.838a1.055 1.055 0 01-.77.285H6.011v-3.46zM29.132 6.222v.695h-1.676v2.178h1.676v3.828h10.52c.34 0 .666-.129.914-.36.235-.249.364-.58.36-.921V9.129h1.76V6.917h-1.76v-.695h-2.73v.695h-6.333v-.695h-2.731zm2.73 4.523V9.07h6.333v.98c0 .436-.21.653-.628.653l-5.704.042zM27.917 16.71l4.247 2.345.218.142-.26.076c-.634.286-1.31.47-2.002.544h-2.898v2.178h3.183c.866 0 2.365-.5 4.498-1.5v-.041h.076v.042c2.16 1 3.657 1.499 4.49 1.499h3.216v-2.203h-2.89a7.299 7.299 0 01-2.035-.545l-.26-.075 4.448-2.513v-2.513h-14.03v2.563zm3.552-.37l.067-.259h6.835l.042.26-.028.014a43.95 43.95 0 01-1.84.899c-1.03.477-1.44.662-1.566.695a13.681 13.681 0 01-1.726-.729 74.354 74.354 0 00-1.784-.829v-.05z"
24+
></path>
25+
<path d="M102.745 16.173h2.597v3.485a2.212 2.212 0 01-.695 1.675 2.161 2.161 0 01-1.608.662H87.483v-2.186l3.066-7.54h-3.217V9.708h18.362v2.554H93.431l-2.99 7.196h11.542c.204.005.4-.074.545-.218a.837.837 0 00.217-.553v-2.513zM105.627 5.367V2.804H87.835v2.563h17.792zM49.479 2.41l-.553.763h5.897v2.261h-3.577v1.022h3.61v2.262h-3.099l.653.838c.142.13.32.211.511.234h1.7v2.329h-2.194a2.052 2.052 0 01-1.49-.653l-1.065-1.282-.695 1.022c-.37.566-1 .908-1.675.913h-2.404V9.79h2.035a.746.746 0 00.62-.368l.402-.737h-3.1V6.423h3.502v-.989h-1.39c-.279.257-.643.4-1.022.402h-1.156v-2.27h.502c.174.011.34-.072.436-.217l.695-.939h2.857z"></path>
26+
<path
27+
clipRule="evenodd"
28+
d="M63.46 11.466a2.228 2.228 0 00.694-1.676V2.73h-8.72v9.432h6.4a2.237 2.237 0 001.675-.695h-.05zM61.456 9.43a.838.838 0 01-.586.218h-2.924V5.242h3.77v3.644a.837.837 0 01-.26.544zM45.45 12.672h18.244v6.977a2.379 2.379 0 01-2.329 2.346H45.449v-9.323zm2.52 2.412v.98h13.227v-.98H47.971zm12.683 4.549a.595.595 0 00.394-.151.62.62 0 00.15-.427v-.545H47.971v1.123h12.682z"
29+
></path>
30+
<path d="M74.047 8.316a1.885 1.885 0 001.382-.578c.381-.344.595-.835.587-1.349V4.85h-2.33v.627c0 .335-.183.503-.552.503h-3.258l2.705-3.543h-3.1L66.45 6.314v2.002h7.597zM84.057 5.912a2.094 2.094 0 01-1.575.653h-3.45v2.086a.595.595 0 00.217.47c.12.137.294.216.478.217h5.302V11.8h-6.056a2.228 2.228 0 01-1.676-.696 2.203 2.203 0 01-.687-1.675V2.52h2.404v1.566h2.698c.301 0 .452-.143.452-.436V2.628h2.513v1.676a2.262 2.262 0 01-.62 1.608zM82.24 14.062c0 .26-.135.394-.411.394h-2.74v-1.86h-2.403v7.02c-.013.63.236 1.236.687 1.675.45.431 1.052.666 1.675.654h6.056v-2.413h-5.377a.704.704 0 01-.478-.176.771.771 0 01-.218-.519v-1.868h3.694a1.776 1.776 0 001.349-.586c.38-.362.593-.866.586-1.39v-1.96h-2.513l.092 1.03z"></path>
31+
<path
32+
clipRule="evenodd"
33+
d="M73.276 18.988v-.151h-3.878v3.158h-2.513V9.053h8.762v10.53a2.379 2.379 0 01-.695 1.717 2.437 2.437 0 01-1.675.695h-.838v-2.17a.754.754 0 00.838-.837zm-3.878-3.795v1.165h3.904v-1.165h-3.904zm0-2.488h3.904v-1.172h-3.904v1.172z"
34+
></path>
35+
</svg>
36+
);
37+
});
38+
39+
export default Icon;

src/BaiduCloud/index.md

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

src/BaiduCloud/index.ts

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

src/BaiduCloud/style.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const TITLE = 'BaiduCloud';
2+
export const TEXT_MULTIPLE = 0.8;
3+
export const SPACE_MULTIPLE = 0.15;
4+
export const COLOR_PRIMARY = '#2468f2';

src/Doubao/style.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const TITLE = 'Doubao';
22
export const TEXT_MULTIPLE = 0.8;
3-
export const SPACE_MULTIPLE = 0.1;
3+
export const SPACE_MULTIPLE = 0.15;
44
export const COLOR_PRIMARY = '#FFF';

0 commit comments

Comments
 (0)