Skip to content

Commit 9201a68

Browse files
✨ feat: Add LiveKit (resolve lobehub#61)
1 parent 57198cb commit 9201a68

File tree

10 files changed

+266
-0
lines changed

10 files changed

+266
-0
lines changed

src/LiveKit/components/Avatar.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 Color from './Color';
9+
10+
export type AvatarProps = Omit<IconAvatarProps, 'Icon'>;
11+
12+
const Avatar = memo<AvatarProps>(({ background, size, ...rest }) => {
13+
return (
14+
<IconAvatar
15+
Icon={Color}
16+
aria-label={TITLE}
17+
background={background || COLOR_PRIMARY}
18+
iconMultiple={0.65}
19+
size={size}
20+
{...rest}
21+
/>
22+
);
23+
});
24+
25+
export default Avatar;

src/LiveKit/components/Color.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+
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+
d="M14 10h-4v4h4v-4zM18 6h-4v4.001h4v-4zM18 14h-4v4h4v-4zM22 2h-4v4h4V2zM22 18h-4v4h4v-4z"
23+
fill="#1FD5F9"
24+
/>
25+
<path d="M6 18V2H2v20h12v-4H6z" fill="#fff" />
26+
</svg>
27+
);
28+
});
29+
30+
export default Icon;

src/LiveKit/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/LiveKit/components/Mono.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 d="M14 10h-4v4h4v-4zM18 6h-4v4.001h4v-4zM18 14h-4v4h4v-4zM22 2h-4v4h4V2zM22 18h-4v4h4v-4z" />
24+
<path d="M6 18V2H2v20h12v-4H6z" />
25+
</svg>
26+
);
27+
});
28+
29+
export default Icon;

src/LiveKit/components/Text.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 100 24"
18+
xmlns="http://www.w3.org/2000/svg"
19+
{...rest}
20+
>
21+
<title>{TITLE}</title>
22+
<path d="M5.693 0H2v21.686h13.357v-3.143H5.693V0zm15.793 9.821H17.95v11.786h3.536V9.821zm10.528 11.393L27.457 6.286H24l4.714 15.4h6.757l4.715-15.4H36.57l-4.557 14.928zM48.986 5.971c-4.636 0-7.543 3.3-7.543 8.015C41.443 18.7 44.27 22 48.986 22c3.614 0 6.285-1.571 7.228-4.871H52.6c-.55 1.492-1.571 2.357-3.536 2.357-2.2 0-3.693-1.572-3.928-4.479H56.45l.079-1.1c0-4.793-2.986-7.936-7.543-7.936zm-3.929 6.6c.393-2.828 1.886-4.085 3.929-4.085 2.278 0 3.693 1.571 3.928 4.085h-7.857zM77.43 0h-4.636l-8.957 9.9V0h-3.693v21.686h3.693v-11l9.9 11h4.714L68.079 10.214 77.507 0h-.078zm6.285 6.286H80.1V18.07h3.536V6.286h.078zm-65.764 0h-3.614V9.82h3.614V6.286zm69.3 11.785h-3.614v3.615h3.614V18.07zm10.607 0h-3.536v3.615h3.615V18.07h-.079zm0-8.25V6.286h-3.536V0h-3.535v6.286H87.17V9.82h3.615v8.25h3.535v-8.25h3.615-.079z" />
23+
</svg>
24+
);
25+
});
26+
27+
export default Icon;

src/LiveKit/index.md

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

src/LiveKit/index.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
27+
export default Icons;

src/LiveKit/style.ts

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

src/icons.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export { default as Kimi, type CompoundedIcon as KimiProps } from './Kimi';
6262
export { default as Kling, type CompoundedIcon as KlingProps } from './Kling';
6363
export { default as LangChain, type CompoundedIcon as LangChainProps } from './LangChain';
6464
export { default as Langfuse, type CompoundedIcon as LangfuseProps } from './Langfuse';
65+
export { default as LiveKit, type CompoundedIcon as LiveKitProps } from './LiveKit';
6566
export { default as LLaVA, type CompoundedIcon as LLaVAProps } from './LLaVA';
6667
export { default as LmStudio, type CompoundedIcon as LmStudioProps } from './LmStudio';
6768
export { default as LobeHub, type CompoundedIcon as LobeHubProps } from './LobeHub';

src/toc.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,25 @@ const toc: IconToc[] = [
12151215
},
12161216
title: 'Langfuse',
12171217
},
1218+
{
1219+
color: '#000',
1220+
desc: 'https://livekit.io',
1221+
docsUrl: 'live-kit',
1222+
fullTitle: 'LiveKit',
1223+
group: 'application',
1224+
id: 'LiveKit',
1225+
param: {
1226+
hasAvatar: true,
1227+
hasBrand: false,
1228+
hasBrandColor: false,
1229+
hasColor: true,
1230+
hasCombine: true,
1231+
hasText: true,
1232+
hasTextCn: false,
1233+
hasTextColor: false,
1234+
},
1235+
title: 'LiveKit',
1236+
},
12181237
{
12191238
color: '#4338CA',
12201239
colorGradient: 'linear-gradient(135deg, #6C78EF, #4F14BE)',

0 commit comments

Comments
 (0)