Skip to content

Commit e39bdc2

Browse files
committed
✨ feat: Add SiliconCloud icon
1 parent 54ffca0 commit e39bdc2

File tree

10 files changed

+244
-3
lines changed

10 files changed

+244
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { memo } from 'react';
2+
3+
import IconAvatar, { type IconAvatarProps } from '@/IconAvatar';
4+
5+
import { TITLE } from '../style';
6+
import Color from './Color';
7+
8+
export type AvatarProps = Omit<IconAvatarProps, 'Icon'>;
9+
10+
const Avatar = memo<AvatarProps>(({ background, ...rest }) => {
11+
return (
12+
<IconAvatar
13+
Icon={Color}
14+
aria-label={TITLE}
15+
background={background}
16+
iconMultiple={1.12}
17+
shape={'square'}
18+
{...rest}
19+
/>
20+
);
21+
});
22+
23+
export default Avatar;

src/SiliconCloud/components/Color.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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.5 0 28 28"
14+
width={size}
15+
xmlns="http://www.w3.org/2000/svg"
16+
{...rest}
17+
>
18+
<title>{TITLE}</title>
19+
<path
20+
clipRule="evenodd"
21+
d="M0 5.887v16.226a5.408 5.408 0 005.408 5.408h16.226a5.408 5.408 0 005.408-5.408V5.887A5.408 5.408 0 0021.634.48H5.408A5.408 5.408 0 000 5.887zm21.709-3.53h-1.69c-5.409 0-8.526 3.455-8.526 8.75v.909a6.948 6.948 0 104.893 5.289h5.323a2.545 2.545 0 000-5.09h-5.296v-1.332c0-2.029 1.465-3.493 3.606-3.493h1.69a2.517 2.517 0 000-5.033zM11.643 18.695a2.066 2.066 0 10-4.131 0 2.066 2.066 0 004.131 0z"
22+
fill="#7C3AED"
23+
fillRule="evenodd"
24+
></path>
25+
</svg>
26+
);
27+
});
28+
29+
export default Icon;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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', extraStyle, ...rest }) => {
14+
const Icon = type === 'color' ? Color : Mono;
15+
16+
return (
17+
<IconCombine
18+
Icon={Icon}
19+
Text={Text}
20+
aria-label={TITLE}
21+
extraStyle={{ fontWeight: 500, ...extraStyle }}
22+
spaceMultiple={SPACE_MULTIPLE}
23+
textMultiple={TEXT_MULTIPLE}
24+
{...rest}
25+
/>
26+
);
27+
});
28+
29+
export default Combine;

src/SiliconCloud/components/Mono.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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.5 0 28 28"
16+
width={size}
17+
xmlns="http://www.w3.org/2000/svg"
18+
{...rest}
19+
>
20+
<title>{TITLE}</title>
21+
<path
22+
clipRule="evenodd"
23+
d="M0 5.887v16.226a5.408 5.408 0 005.408 5.408h16.226a5.408 5.408 0 005.408-5.408V5.887A5.408 5.408 0 0021.634.48H5.408A5.408 5.408 0 000 5.887zm21.709-3.53h-1.69c-5.409 0-8.526 3.455-8.526 8.75v.909a6.948 6.948 0 104.893 5.289h5.323a2.545 2.545 0 000-5.09h-5.296v-1.332c0-2.029 1.465-3.493 3.606-3.493h1.69a2.517 2.517 0 000-5.033zM11.643 18.695a2.066 2.066 0 10-4.131 0 2.066 2.066 0 004.131 0z"
24+
></path>
25+
</svg>
26+
);
27+
});
28+
29+
export default Icon;

src/SiliconCloud/components/Text.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, width: 'fit-content', ...style }}
15+
viewBox="30 0 189 28"
16+
xmlns="http://www.w3.org/2000/svg"
17+
{...rest}
18+
>
19+
<title>{TITLE}</title>
20+
<path
21+
clipRule="evenodd"
22+
d="M53.845 22V6h2.785v16h-2.785zm7.598-16v12.534h13.99V22H60.487c-.499 0-.928-.219-1.289-.656-.36-.438-.54-.972-.54-1.602V6h2.785zM78.17 22V6h2.784v16H78.17zm55.782-3.466V6h2.66v16h-2.66L122.54 9.555V22h-2.66V7.245c0-.315.083-.586.249-.814.166-.228.374-.341.624-.341h1.787l11.413 12.444zM160.897 6v12.534h13.99V22h-14.946c-.499 0-.928-.219-1.288-.656-.36-.438-.54-.972-.54-1.602V6h2.784zm53.649 14.11c.998-1.26 1.496-2.766 1.496-4.516V6h-2.743v9.594c0 .805-.229 1.488-.686 2.048-.457.56-1.004.84-1.641.84h-3.782V6h-2.66v12.482h-3.824c-.637 0-1.178-.28-1.621-.84-.443-.56-.665-1.243-.665-2.048V6h-2.743v9.594c0 1.75.492 3.255 1.475 4.516.984 1.26 2.169 1.89 3.554 1.89h10.266c1.385 0 2.577-.63 3.574-1.89zM89.301 18.534H99.8V22H89.301c-1.136 0-2.189-.359-3.159-1.076-.97-.718-1.738-1.68-2.306-2.889-.568-1.207-.852-2.529-.852-3.964 0-1.47.284-2.81.852-4.017.568-1.208 1.337-2.17 2.306-2.888.97-.717 2.023-1.076 3.16-1.076H99.8v3.465H89.301c-.97 0-1.8.438-2.493 1.313-.693.875-1.04 1.943-1.04 3.203 0 1.225.347 2.275 1.04 3.15.692.876 1.523 1.313 2.493 1.313zm27.075 1.602c-.984 1.243-2.182 1.864-3.595 1.864h-6.634c-1.385 0-2.569-.621-3.553-1.864s-1.476-2.74-1.476-4.49v-3.15c0-1.75.492-3.256 1.476-4.516.984-1.26 2.168-1.89 3.553-1.89h6.634c1.413 0 2.611.63 3.595 1.89.984 1.26 1.476 2.765 1.476 4.516v3.15c0 1.75-.492 3.247-1.476 4.49zM155.374 6.09v3.465h-14.053v2.73h14.053v3.466h-13.989V22h-2.744v-8.267h-.007V6.5h.007v-.41h16.733zm36.799 14.046c-.983 1.243-2.182 1.864-3.595 1.864h-6.634c-1.385 0-2.569-.621-3.553-1.864s-1.475-2.74-1.475-4.49v-3.15c0-1.75.491-3.256 1.475-4.516.984-1.26 2.168-1.89 3.553-1.89h6.634c1.413 0 2.612.63 3.595 1.89.984 1.26 1.476 2.765 1.476 4.516v3.15c0 1.75-.492 3.247-1.476 4.49zm-141.478.446c-.748.945-1.649 1.418-2.702 1.418h-12.95v-3.466h12.95c.305 0 .561-.13.77-.393.207-.263.31-.587.31-.972s-.103-.709-.31-.971c-.209-.263-.465-.394-.77-.394h-9.127c-1.053 0-1.953-.473-2.702-1.418-.748-.945-1.122-2.083-1.122-3.413 0-1.33.374-2.468 1.122-3.413.748-.945 1.649-1.418 2.702-1.418H51.11v3.466H38.866c-.305 0-.561.131-.769.394-.208.262-.312.586-.312.971s.104.709.312.971c.208.263.464.394.769.394h9.127c1.053 0 1.954.473 2.702 1.418s1.122 2.083 1.122 3.413c0 1.33-.374 2.468-1.122 3.413zm63.728-10.134c-.458-.56-1.005-.84-1.642-.84h-6.634c-.637 0-1.177.28-1.62.84-.444.56-.666 1.243-.666 2.048v3.15c.001.805.222 1.488.666 2.048.443.56.983.84 1.62.84h6.634c.637 0 1.185-.28 1.642-.84.457-.56.686-1.242.686-2.048v-3.15c0-.805-.229-1.488-.686-2.048zm75.797 0c-.457-.56-1.005-.84-1.642-.84h-6.634c-.637 0-1.177.28-1.62.84-.444.56-.665 1.243-.665 2.048v3.15c0 .805.221 1.488.665 2.048.443.56.983.84 1.62.84h6.634c.637 0 1.185-.28 1.642-.84.457-.56.686-1.242.686-2.048v-3.15c0-.805-.229-1.488-.686-2.048z"
23+
></path>
24+
</svg>
25+
);
26+
});
27+
28+
export default Icon;

src/SiliconCloud/index.md

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

src/SiliconCloud/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/SiliconCloud/style.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const TITLE = 'SiliconCloud';
2+
export const TEXT_MULTIPLE = 0.75;
3+
export const SPACE_MULTIPLE = 0.3;
4+
export const COLOR_PRIMARY = '#EEEEEE';

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export { default as Pollinations, type CompoundedIcon as PollinationsProps } fro
5858
export { default as Qingyan, type CompoundedIcon as QingyanProps } from './Qingyan';
5959
export { default as Replicate, type CompoundedIcon as ReplicateProps } from './Replicate';
6060
export { default as Rwkv, type CompoundedIcon as RwkvProps } from './Rwkv';
61+
export { default as SiliconCloud, type CompoundedIcon as SiliconCloudProps } from './SiliconCloud';
6162
export { default as Spark, type CompoundedIcon as SparkProps } from './Spark';
6263
export { default as Stability, type CompoundedIcon as StabilityProps } from './Stability';
6364
export { default as Stepfun, type CompoundedIcon as StepfunProps } from './Stepfun';

0 commit comments

Comments
 (0)