Skip to content

Commit 25155c9

Browse files
✨ feat: Add FalAI (resolve lobehub#58)
1 parent 135e258 commit 25155c9

File tree

10 files changed

+226
-0
lines changed

10 files changed

+226
-0
lines changed

.dumirc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default defineConfig({
7979
favicons: ['https://lobehub.com/favicon.ico'],
8080
jsMinifier: 'swc',
8181
locales: [{ id: 'en-US', name: 'English' }],
82+
mako: isWin ? false : {},
8283
mfsu: isWin ? undefined : {},
8384
npmClient: 'pnpm',
8485
publicPath: '/',

src/Fal/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 || '#FFC4D8'}
18+
color={COLOR_PRIMARY}
19+
{...rest}
20+
/>
21+
);
22+
});
23+
24+
export default Avatar;

src/Fal/components/Combine.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 Mono from './Mono';
9+
import Text from './Text';
10+
11+
export type CombineProps = Omit<IconCombineProps, 'Icon' | 'Text'>;
12+
13+
const Combine = memo<CombineProps>(({ ...rest }) => {
14+
return (
15+
<IconCombine
16+
Icon={Mono}
17+
Text={Text as any}
18+
aria-label={TITLE}
19+
spaceMultiple={SPACE_MULTIPLE}
20+
textMultiple={TEXT_MULTIPLE}
21+
{...rest}
22+
/>
23+
);
24+
});
25+
26+
export default Combine;

src/Fal/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.477 0c.415 0 .749.338.788.752a7.775 7.775 0 006.985 6.984c.413.04.752.373.752.788v6.952c0 .415-.338.748-.752.788a7.775 7.775 0 00-6.985 6.984c-.04.414-.373.752-.788.752H8.525c-.416 0-.749-.338-.789-.752a7.775 7.775 0 00-6.984-6.984c-.414-.04-.752-.373-.752-.788V8.524c0-.415.338-.748.752-.788A7.775 7.775 0 007.736.752C7.776.338 8.11 0 8.526 0h6.95zM4.819 11.98a7.226 7.226 0 007.223 7.23 7.226 7.226 0 007.223-7.23c0-3.994-3.234-7.23-7.223-7.23a7.227 7.227 0 00-7.223 7.23z"
26+
/>
27+
</svg>
28+
);
29+
});
30+
31+
export default Icon;

src/Fal/components/Text.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 31 24"
18+
xmlns="http://www.w3.org/2000/svg"
19+
{...rest}
20+
>
21+
<title>{TITLE}</title>
22+
<path d="M2.679 11.307c.966 0 1.175.053 1.175.55v7.503c0 2.326.052 2.43.261 2.43h3.63c.21 0 .288-.104.288-2.43v-7.504c0-.496.183-.549 1.358-.549h1.201c.183 0 .21-.13.21-1.202v-.183c0-1.072 0-1.177-.236-1.177H9.391c-1.175 0-1.358-.078-1.358-.549v-1.62c0-1.465.522-1.883 1.358-1.883.463 0 .784.128.95.195.06.024.1.04.12.04.079 0 .079-.235.079-1.229v-.34c0-.967 0-1.045-.052-1.098-.13-.078-.94-.261-2.116-.261-2.977 0-4.518 1.516-4.518 4.575v1.621c0 .47-.13.55-1.097.55H2.21C2.026 8.745 2 8.85 2 9.921v.183c0 1.071.026 1.202.209 1.202h.47zM28.625 4.693V19.36c0 2.326-.026 2.431-.314 2.431H24.76c-.288 0-.34-.105-.34-2.431V4.693c0-2.327.052-2.431.34-2.431h3.551c.288 0 .314.104.314 2.431z" />
23+
<path
24+
clipRule="evenodd"
25+
d="M18.666 13.268v-.549c0-1.307-.6-1.83-1.645-1.83-1.019 0-1.567.549-1.724 1.516a3.26 3.26 0 00-.029.207c-.022.186-.037.316-.154.316H11.59c-.21 0-.21-.052-.21-.235 0-1.386 1.307-4.262 5.85-4.262 3.213 0 5.512 1.281 5.512 4.837v5.229c0 .834.313 1.906.506 2.564.085.29.146.5.146.573 0 .104-.078.157-.157.157H19.32c-.183 0-.209-.105-.34-.758l-.104-.497c-.078-.392-.13-.523-.287-.523-.107 0-.194.123-.33.317-.13.186-.304.435-.584.703-.627.575-1.384.967-2.69.967-2.116 0-4.022-1.203-4.022-3.817 0-2.928 2.272-4.183 5.641-4.314.368-.016.673-.021.924-.025.944-.015 1.14-.019 1.14-.576zm0 3.79v-.522c0-.523-.13-.68-.574-.654l-.967.053c-1.227.078-1.958.705-1.958 1.882 0 1.15.627 1.726 1.54 1.726 1.02 0 1.96-.942 1.96-2.484z"
26+
/>
27+
</svg>
28+
);
29+
});
30+
31+
export default Icon;

src/Fal/index.md

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

src/Fal/index.ts

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

src/Fal/style.ts

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

src/icons.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export { default as DeepMind, type CompoundedIcon as DeepMindProps } from './Dee
3737
export { default as DeepSeek, type CompoundedIcon as DeepSeekProps } from './DeepSeek';
3838
export { default as Dify, type CompoundedIcon as DifyProps } from './Dify';
3939
export { default as Doubao, type CompoundedIcon as DoubaoProps } from './Doubao';
40+
export { default as Fal, type CompoundedIcon as FalProps } from './Fal';
4041
export { default as Fireworks, type CompoundedIcon as FireworksProps } from './Fireworks';
4142
export { default as FishAudio, type CompoundedIcon as FishAudioProps } from './FishAudio';
4243
export { default as Flux, type CompoundedIcon as FluxProps } from './Flux';

src/toc.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,25 @@ const toc: IconToc[] = [
771771
},
772772
title: 'Doubao',
773773
},
774+
{
775+
color: '#EC0648',
776+
desc: 'https://fal.ai',
777+
docsUrl: 'fal',
778+
fullTitle: 'Fal',
779+
group: 'provider',
780+
id: 'Fal',
781+
param: {
782+
hasAvatar: true,
783+
hasBrand: false,
784+
hasBrandColor: false,
785+
hasColor: false,
786+
hasCombine: true,
787+
hasText: true,
788+
hasTextCn: false,
789+
hasTextColor: false,
790+
},
791+
title: 'Fal',
792+
},
774793
{
775794
color: '#000',
776795
colorGradient: 'linear-gradient(to bottom, #952C78, #050003)',

0 commit comments

Comments
 (0)