Skip to content

Commit a7f4aa7

Browse files
✨ feat: Add StateCloud (lobehub#83)
1 parent dbd8eb0 commit a7f4aa7

File tree

10 files changed

+268
-0
lines changed

10 files changed

+268
-0
lines changed

src/StateCloud/components/Avatar.tsx

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

src/StateCloud/components/Color.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use client';
2+
3+
import { forwardRef } from 'react';
4+
5+
import type { IconType } from '@/types';
6+
7+
import { TITLE } from '../style';
8+
9+
const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
10+
return (
11+
<svg
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
22+
clipRule="evenodd"
23+
d="M15.509 6.023a3.975 3.975 0 014.49 2.442A5.343 5.343 0 0124 13.653C23.999 16.605 21.623 19 18.689 19a5.307 5.307 0 01-4.903-3.303 5.228 5.228 0 01-.399-1.907h-1.343a.105.105 0 01-.074-.18l2.733-2.752a.13.13 0 01.185 0l2.734 2.754c.065.066.019.18-.074.18l-1.42-.001c.047.338.152.673.325.99a2.844 2.844 0 003.954 1.09c1.218-.723 1.732-2.29 1.177-3.6a2.855 2.855 0 00-3.386-1.65 2.03 2.03 0 00-.935-2.366 1.998 1.998 0 00-2.492.431c-.68-1.629-2.363-2.68-4.19-2.463-1.974.234-3.442 1.87-3.553 3.802a3.184 3.184 0 00-3.279.135 3.25 3.25 0 00-1.336 3.588 3.214 3.214 0 003.093 2.356l7.153.003c.055 0 .104.033.125.083a6.495 6.495 0 001.418 2.088c.053.053.018.142-.056.142l-8.637-.003h-.006C2.463 18.416-.001 15.93 0 12.868c.001-3.065 2.468-5.546 5.507-5.544h.008A6.136 6.136 0 0110.964 4c1.801 0 3.421.781 4.545 2.023z"
24+
fill="#DF0428"
25+
fillRule="evenodd"
26+
/>
27+
</svg>
28+
);
29+
});
30+
31+
export default Icon;

src/StateCloud/components/Combine.tsx

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

src/StateCloud/components/Mono.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use client';
2+
3+
import { forwardRef } from 'react';
4+
5+
import type { IconType } from '@/types';
6+
7+
import { TITLE } from '../style';
8+
9+
const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
10+
return (
11+
<svg
12+
fill="currentColor"
13+
fillRule="evenodd"
14+
height={size}
15+
ref={ref}
16+
style={{ flex: 'none', lineHeight: 1, ...style }}
17+
viewBox="0 0 24 24"
18+
width={size}
19+
xmlns="http://www.w3.org/2000/svg"
20+
{...rest}
21+
>
22+
<title>{TITLE}</title>
23+
<path
24+
clipRule="evenodd"
25+
d="M15.509 6.023a3.975 3.975 0 014.49 2.442A5.343 5.343 0 0124 13.653C23.999 16.605 21.623 19 18.689 19a5.307 5.307 0 01-4.903-3.303 5.228 5.228 0 01-.399-1.907h-1.343a.105.105 0 01-.074-.18l2.733-2.752a.13.13 0 01.185 0l2.734 2.754c.065.066.019.18-.074.18l-1.42-.001c.047.338.152.673.325.99a2.844 2.844 0 003.954 1.09c1.218-.723 1.732-2.29 1.177-3.6a2.855 2.855 0 00-3.386-1.65 2.03 2.03 0 00-.935-2.366 1.998 1.998 0 00-2.492.431c-.68-1.629-2.363-2.68-4.19-2.463-1.974.234-3.442 1.87-3.553 3.802a3.184 3.184 0 00-3.279.135 3.25 3.25 0 00-1.336 3.588 3.214 3.214 0 003.093 2.356l7.153.003c.055 0 .104.033.125.083a6.495 6.495 0 001.418 2.088c.053.053.018.142-.056.142l-8.637-.003h-.006C2.463 18.416-.001 15.93 0 12.868c.001-3.065 2.468-5.546 5.507-5.544h.008A6.136 6.136 0 0110.964 4c1.801 0 3.421.781 4.545 2.023z"
26+
/>
27+
</svg>
28+
);
29+
});
30+
31+
export default Icon;

src/StateCloud/components/Text.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use client';
2+
3+
import { forwardRef } from 'react';
4+
5+
import type { IconType } from '@/types';
6+
7+
import { TITLE } from '../style';
8+
9+
const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
10+
return (
11+
<svg
12+
fill="currentColor"
13+
fillRule="evenodd"
14+
height={size}
15+
ref={ref}
16+
style={{ flex: 'none', lineHeight: 1, ...style }}
17+
viewBox="0 0 72 24"
18+
xmlns="http://www.w3.org/2000/svg"
19+
{...rest}
20+
>
21+
<title>{TITLE}</title>
22+
<path
23+
clipRule="evenodd"
24+
d="M14.376 9.522V3.936h8.38V2H2.663v1.936h8.38V9.538H2v1.936h8.805c-.583 2.799-2.517 6.72-8.805 8.434v2.002c6.15-.927 9.197-4.19 10.709-7.226 1.513 3.035 4.559 6.299 10.709 7.226v-2.002c-6.287-1.714-8.221-5.636-8.805-8.434h8.805V9.538h-9.042v-.016zM69.335 2H49.245v1.936h20.093V2zM70 9.324v1.936H55.432l-2.881 8.496h13.974l-2.19-5.7h2.922l2.008 5.228a1.993 1.993 0 01-1.863 2.705H51.687a1.994 1.994 0 01-1.89-2.63l2.747-8.099h-3.962V9.324H70zm-27.84 9.517h4.338v-1.303h-4.463v-1.092h4.463v-1.303h-4.463v-1.092h3.441c.44 0 .798-.357.798-.797v-3.89a.798.798 0 00-.798-.797H26.674a.798.798 0 00-.799.797v3.89c0 .44.358.797.799.797h3.44v1.092h-4.463v1.303h4.464v1.092h-4.463v1.303h4.337c-.256.682-1.122 1.388-2.345 1.587-.63.102-1.152.155-2.014.175V22c1.373 0 2.512-.096 3.583-.302 1.782-.343 3.091-1.437 3.533-2.857h6.657c.442 1.42 1.751 2.514 3.533 2.857 1.072.206 2.21.302 3.584.302v-1.397a13.201 13.201 0 01-2.015-.175c-1.223-.199-2.088-.905-2.345-1.587zm-4.853-6.022v-1.017h6.504v1.017h-6.504zm6.504-2.003h-6.504V9.8h6.504v1.017zM34.843 9.8v1.017H28.34V9.8h6.504zm-6.504 2.003h6.504v1.017H28.34v-1.017zm4.57 2.249h6.331v1.092h-6.33v-1.092zm0 2.395h6.331v1.092h-6.33v-1.092zm.963-8.846h-8.173V6.352h6.91a.48.48 0 00.48-.48v-.58h-6.945v-.985h6.946v-.58a.48.48 0 00-.48-.479H25.7V2h8.172a1.68 1.68 0 011.681 1.68v2.24a1.68 1.68 0 01-1.681 1.68zm10.653 0h.244a1.68 1.68 0 001.681-1.68V3.68A1.68 1.68 0 0044.77 2h-8.173v1.248h6.91a.48.48 0 01.48.48v.58h-6.945v.985h6.946v.58a.48.48 0 01-.48.479h-6.91V7.6h7.928z"
25+
/>
26+
</svg>
27+
);
28+
});
29+
30+
export default Icon;

src/StateCloud/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: StateCloud (天翼云)
5+
atomId: StateCloud
6+
description: https://www.ctyun.cn/act/xirang/deepseek
7+
---
8+
9+
## Icons
10+
11+
```tsx
12+
import { StateCloud } from '@lobehub/icons';
13+
import { Flexbox } from 'react-layout-kit';
14+
15+
export default () => (
16+
<Flexbox gap={16} horizontal>
17+
<StateCloud size={64} />
18+
<StateCloud.Color size={64} />
19+
</Flexbox>
20+
);
21+
```
22+
23+
## Text
24+
25+
```tsx
26+
import { StateCloud } from '@lobehub/icons';
27+
28+
export default () => <StateCloud.Text size={48} />;
29+
```
30+
31+
## Combine
32+
33+
```tsx
34+
import { StateCloud } from '@lobehub/icons';
35+
import { Flexbox } from 'react-layout-kit';
36+
37+
export default () => (
38+
<Flexbox gap={16} align={'flex-start'}>
39+
<StateCloud.Combine size={64} />
40+
<StateCloud.Combine size={64} type={'color'} />
41+
</Flexbox>
42+
);
43+
```
44+
45+
## Avatars
46+
47+
```tsx
48+
import { StateCloud } from '@lobehub/icons';
49+
import { Flexbox } from 'react-layout-kit';
50+
51+
export default () => (
52+
<Flexbox gap={16} horizontal>
53+
<StateCloud.Avatar size={64} />
54+
<StateCloud.Avatar size={64} shape={'square'} />
55+
</Flexbox>
56+
);
57+
```
58+
59+
## Colors
60+
61+
```tsx
62+
import { StateCloud } 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={StateCloud.colorPrimary} />
70+
</Flexbox>
71+
);
72+
```

src/StateCloud/index.ts

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

src/StateCloud/style.ts

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

src/icons.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export { default as SenseNova, type CompoundedIcon as SenseNovaProps } from './S
111111
export { default as SiliconCloud, type CompoundedIcon as SiliconCloudProps } from './SiliconCloud';
112112
export { default as Spark, type CompoundedIcon as SparkProps } from './Spark';
113113
export { default as Stability, type CompoundedIcon as StabilityProps } from './Stability';
114+
export { default as StateCloud, type CompoundedIcon as StateCloudProps } from './StateCloud';
114115
export { default as Stepfun, type CompoundedIcon as StepfunProps } from './Stepfun';
115116
export { default as Suno, type CompoundedIcon as SunoProps } from './Suno';
116117
export { default as Sync, type CompoundedIcon as SyncProps } from './Sync';

src/toc.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,6 +2133,25 @@ const toc: IconToc[] = [
21332133
},
21342134
title: 'Stability',
21352135
},
2136+
{
2137+
color: '#DF0428',
2138+
desc: 'https://www.ctyun.cn/act/xirang/deepseek',
2139+
docsUrl: 'state-cloud',
2140+
fullTitle: 'StateCloud (天翼云)',
2141+
group: 'provider',
2142+
id: 'StateCloud',
2143+
param: {
2144+
hasAvatar: true,
2145+
hasBrand: false,
2146+
hasBrandColor: false,
2147+
hasColor: true,
2148+
hasCombine: true,
2149+
hasText: true,
2150+
hasTextCn: false,
2151+
hasTextColor: false,
2152+
},
2153+
title: 'StateCloud',
2154+
},
21362155
{
21372156
color: '#005AFF',
21382157
desc: 'https://www.stepfun.com',

0 commit comments

Comments
 (0)