Skip to content

Commit bb94c7a

Browse files
✨ feat: Add Adobe / Firefly / FishAudio / Ai21 (#18)
1 parent 2e715b8 commit bb94c7a

38 files changed

+979
-76
lines changed

README.md

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

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@
7777
"devDependencies": {
7878
"@commitlint/cli": "^18.6.1",
7979
"@lobehub/lint": "latest",
80-
"@lobehub/ui": "^1.138.0",
81-
"@testing-library/react": "^14.3.0",
80+
"@lobehub/ui": "^1.138.5",
81+
"@testing-library/react": "^14.3.1",
8282
"@types/lodash-es": "^4.17.12",
8383
"@types/pangu": "^4.0.2",
8484
"@types/query-string": "^6.3.0",
85-
"@types/react": "^18.2.75",
86-
"@types/react-dom": "^18.2.24",
85+
"@types/react": "^18.2.79",
86+
"@types/react-dom": "^18.2.25",
8787
"@vitest/coverage-v8": "latest",
88-
"antd": "^5.16.1",
88+
"antd": "^5.16.2",
8989
"antd-style": "^3.6.2",
9090
"babel-plugin-antd-style": "latest",
9191
"commitlint": "^18.6.1",
@@ -95,13 +95,14 @@
9595
"dumi-theme-lobehub": "latest",
9696
"eslint": "^8.57.0",
9797
"father": "^4.4.0",
98-
"front-matter": "^4.0.2",
9998
"glob": "^10.3.12",
99+
"gray-matter": "^4.0.3",
100100
"husky": "^8.0.3",
101101
"jsdom": "^23.2.0",
102102
"lint-staged": "^15.2.2",
103103
"lodash-es": "^4.17.21",
104104
"lucide-react": "latest",
105+
"markdown-table": "^3.0.3",
105106
"prettier": "^3.2.5",
106107
"react": "^18.2.0",
107108
"react-dom": "^18.2.0",
@@ -111,7 +112,7 @@
111112
"stylelint": "^15.11.0",
112113
"svgo-browser": "^1.3.8",
113114
"tsx": "^4.7.2",
114-
"typescript": "^5.4.4",
115+
"typescript": "^5.4.5",
115116
"vitest": "latest"
116117
},
117118
"peerDependencies": {

scripts/genMdList.ts

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import fm from 'front-matter';
21
import { globSync } from 'glob';
2+
import matter from 'gray-matter';
33
import { kebabCase } from 'lodash-es';
4+
import { markdownTable } from 'markdown-table';
45
import { readFileSync, writeFileSync } from 'node:fs';
56
import { resolve } from 'node:path';
67

@@ -13,30 +14,47 @@ const updateReadme = (split: string, md: string, content: string): string => {
1314
mds[1] = [' ', content, ' '].join('\n\n');
1415
return mds.join(split);
1516
};
17+
18+
const genMd = (
19+
data: {
20+
group: string;
21+
path: string;
22+
title: string;
23+
}[],
24+
filter: 'model' | 'provider' | 'application',
25+
): string =>
26+
data
27+
.sort((a, b) => a.title.localeCompare(b.title))
28+
.filter((meta) => meta.group === filter)
29+
.map((meta) => `✅ [${meta.title}](${BASE_URL}${kebabCase(meta.path)})`)
30+
.join('<br/>');
31+
1632
const run = () => {
1733
const mds = globSync(resolve(ROOT_PATH, './src/**/index.md').replace('\\', '/'));
18-
const metas = mds
34+
const metas: any = mds
1935
.map((md) => {
20-
const meta: any = fm(readFileSync(md, 'utf8')).attributes;
36+
const { data } = matter(readFileSync(md, 'utf8'));
2137
const paths = md.split('/');
22-
if (!['model', 'provider', 'application'].includes(String(meta.group).toLowerCase()))
23-
return false;
38+
const group = String(data.group).toLowerCase();
39+
if (!['model', 'provider', 'application'].includes(group)) return false;
2440
return {
25-
...meta,
41+
...data,
42+
group,
2643
path: paths.at(-2),
2744
};
2845
})
2946
.filter(Boolean);
3047

31-
const contents = metas
32-
.sort((a, b) => a.title.localeCompare(b.title))
33-
.map((meta) => `- [x] [${meta.title}](${BASE_URL}${kebabCase(meta.path)})`);
48+
const contents = markdownTable([
49+
['Model', 'Provider', 'Application'],
50+
[genMd(metas, 'model'), genMd(metas, 'provider'), genMd(metas, 'application')],
51+
]);
3452

3553
const readmePath = resolve(ROOT_PATH, 'README.md');
3654

3755
const readme = readFileSync(readmePath, 'utf8');
3856

39-
const newReadme = updateReadme('<!-- ICON LIST -->', readme, contents.join('\n'));
57+
const newReadme = updateReadme('<!-- ICON LIST -->', readme, contents);
4058

4159
writeFileSync(readmePath, newReadme, 'utf8');
4260

src/Adobe/components/Avatar.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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
13+
Icon={Mono}
14+
aria-label={TITLE}
15+
background={background || COLOR_PRIMARY}
16+
color={'#fff'}
17+
{...rest}
18+
/>
19+
);
20+
});
21+
22+
export default Avatar;

src/Adobe/components/Color.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<g fill="#EB1000" fillRule="nonzero">
20+
<path d="M14.86 3H23v19zM9.14 3H1v19zM11.992 9.998L17.182 22h-3.394l-1.549-3.813h-3.79z"></path>
21+
</g>
22+
</svg>
23+
);
24+
});
25+
26+
export default Icon;

src/Adobe/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/Adobe/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+
<g>
22+
<path d="M14.86 3H23v19zM9.14 3H1v19zM11.992 9.998L17.182 22h-3.394l-1.549-3.813h-3.79z"></path>
23+
</g>
24+
</svg>
25+
);
26+
});
27+
28+
export default Icon;

src/Adobe/components/Text.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="0 0 78 24"
16+
xmlns="http://www.w3.org/2000/svg"
17+
{...rest}
18+
>
19+
<title>{TITLE}</title>
20+
<path d="M13.541 17.383H7.113l-1.336 4.116c-.055.166-.166.222-.333.222H2.216c-.196 0-.251-.083-.196-.278l5.568-16.05c.11-.278.222-.612.25-1.67 0-.138.083-.194.194-.194h4.425c.139 0 .194.028.222.14l6.345 17.802c.057.167.029.25-.167.25H15.24c-.139 0-.222-.056-.305-.167l-1.392-4.173v.002zm-1.057-3.45c-.528-1.836-1.64-5.203-2.197-7.205h-.03c-.444 1.893-1.418 4.951-2.142 7.205h4.37zm6.687 1.028c0-4.005 2.978-7.314 8.071-7.314.222 0 .473 0 .89.027v-5.48c0-.138.083-.194.194-.194h3.535c.111 0 .139.056.139.167v16.438c0 .67.056 1.502.112 2.032 0 .166-.027.222-.167.278A14.056 14.056 0 0126.435 22c-4.119-.002-7.264-2.31-7.264-7.039zm8.961-3.977c-.278-.083-.64-.111-1.029-.111-2.116 0-3.951 1.28-3.951 3.894 0 2.753 1.585 3.95 3.673 3.95.473 0 .918-.056 1.307-.167v-7.566zm19.39 3.754c0 4.368-2.81 7.262-6.845 7.262-4.732 0-6.846-3.561-6.846-7.15 0-3.95 2.615-7.205 6.93-7.205 4.451.002 6.762 3.367 6.762 7.093zm-6.929-3.865c-1.64 0-2.865 1.418-2.865 3.922 0 2.42 1.14 3.977 3.032 3.977 1.615 0 2.839-1.363 2.839-3.922 0-2.197-.919-3.977-3.006-3.977zM52.914 2c.223 0 .278.056.278.25l.028 5.703c.695-.223 1.502-.306 2.338-.306 4.09 0 6.678 2.892 6.678 6.62 0 5.172-4.118 7.731-8.376 7.731-1.447 0-2.95-.166-4.342-.64a.268.268 0 01-.194-.25V2.223c0-.166.083-.222.222-.222h3.368zm5.37 12.628c0-2.531-1.474-3.727-3.45-3.727-.863 0-1.252.139-1.614.25v7.538c.334.055.669.083 1.03.083 2.087 0 4.035-1.28 4.035-4.144zm9.034 1.224c.14 1.585 1.28 2.892 3.978 2.892a9.04 9.04 0 003.424-.64c.111-.055.194-.027.194.112v2.643c0 .222-.055.278-.194.36-1.114.502-2.338.78-4.286.78-5.204 0-7.04-3.588-7.04-7.01 0-3.866 2.338-7.344 6.707-7.344 4.229 0 5.899 3.228 5.899 6.01 0 .834-.056 1.557-.139 1.835-.028.139-.083.194-.223.223-.39.084-1.447.14-2.866.14h-5.454zm3.617-2.725c.89 0 1.308-.03 1.391-.057.028-.028.028-.139.028-.167 0-.695-.555-2.226-2.393-2.226-1.753 0-2.477 1.309-2.644 2.448l3.618.002z"></path>
21+
</svg>
22+
);
23+
});
24+
25+
export default Icon;

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

src/Adobe/index.ts

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

0 commit comments

Comments
 (0)