Skip to content

Commit

Permalink
✨ feat: Add novita.ai 紫东太初 360 智脑
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jul 8, 2024
1 parent e8d7d78 commit 02e6848
Show file tree
Hide file tree
Showing 33 changed files with 856 additions and 29 deletions.
6 changes: 3 additions & 3 deletions README.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@
"devDependencies": {
"@commitlint/cli": "^18.6.1",
"@lobehub/lint": "latest",
"@lobehub/ui": "^1.146.4",
"@lobehub/ui": "^1.146.5",
"@testing-library/react": "^14.3.1",
"@types/lodash-es": "^4.17.12",
"@types/pangu": "^4.0.2",
"@types/query-string": "^6.3.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitest/coverage-v8": "latest",
"antd": "^5.19.0",
"antd": "^5.19.1",
"antd-style": "^3.6.2",
"babel-plugin-antd-style": "latest",
"commitlint": "^18.6.1",
Expand All @@ -91,7 +91,7 @@
"dumi-theme-lobehub": "latest",
"eslint": "^8.57.0",
"father": "^4.4.4",
"glob": "^10.4.2",
"glob": "^10.4.3",
"gray-matter": "^4.0.3",
"husky": "^8.0.3",
"jsdom": "^23.2.0",
Expand All @@ -107,8 +107,8 @@
"semantic-release": "^21.1.2",
"stylelint": "^15.11.0",
"svgo-browser": "^1.3.8",
"tsx": "^4.16.0",
"typescript": "^5.5.2",
"tsx": "^4.16.2",
"typescript": "^5.5.3",
"vitest": "latest"
},
"peerDependencies": {
Expand Down
6 changes: 5 additions & 1 deletion scripts/genMdList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const ROOT_PATH = resolve(__dirname, '..');

const BASE_URL = 'https://icons.lobehub.com/components/';

const fixWindowsPath = (path: string): string => path.replaceAll('\\', '/');

const updateReadme = (split: string, md: string, content: string): string => {
const mds = md.split(split);
mds[1] = [' ', content, ' '].join('\n\n');
Expand All @@ -30,7 +32,9 @@ const genMd = (
.join('<br/>');

const run = () => {
const mds = globSync(resolve(ROOT_PATH, './src/**/index.md').replace('\\', '/'));
const mds = globSync(fixWindowsPath(resolve(ROOT_PATH, './src/**/index.md'))).map((md) =>
fixWindowsPath(md),
);
const metas: any = mds
.map((md) => {
const { data } = matter(readFileSync(md, 'utf8'));
Expand Down
22 changes: 22 additions & 0 deletions src/Ai360/components/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { memo } from 'react';

import IconAvatar, { type IconAvatarProps } from '@/IconAvatar';

import { COLOR_GRADIENT, TITLE } from '../style';
import Mono from './Mono';

export type AvatarProps = Omit<IconAvatarProps, 'Icon'>;

const Avatar = memo<AvatarProps>(({ background, ...rest }) => {
return (
<IconAvatar
Icon={Mono}
aria-label={TITLE}
background={background || COLOR_GRADIENT}
color={'#fff'}
{...rest}
/>
);
});

export default Avatar;
93 changes: 93 additions & 0 deletions src/Ai360/components/Color.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import { forwardRef } from 'react';

import { useFillIds } from '@/hooks/useFillId';
import type { IconType } from '@/types';

import { TITLE } from '../style';

const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
const [a, b, c, d, e] = useFillIds(TITLE, 5);
return (
<svg
height={size}
ref={ref}
style={{ flex: 'none', lineHeight: 1, ...style }}
viewBox="0 0 24 24"
width={size}
xmlns="http://www.w3.org/2000/svg"
{...rest}
>
<title>{TITLE}</title>
<g>
<path
clipRule="evenodd"
d="M12 0h.018c1.473-.002 2.88.261 4.179.754C20.755 2.456 24 6.85 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm8.604 18.967A11.024 11.024 0 0023.07 12c0-1.717-.39-3.344-1.089-4.794a2.59 2.59 0 01-3.214.62 6.278 6.278 0 01-1.333-.992C16.283 5.73 15.109 4.66 13.696 3.9c-3.211-1.729-6.825-1.501-9.695.447A11.033 11.033 0 00.93 12c0 1.663.367 3.241 1.024 4.657.75-.973 2.131-1.346 3.232-.71.667.384 1.257.92 1.837 1.447l.176.16c1.365 1.234 2.794 2.355 4.558 2.965 3.053 1.053 6.356.437 8.847-1.552z"
fill={a.fill}
fillRule="evenodd"
></path>
<path
d="M5.643 10.312c-.83.11-1.401.766-1.408 1.618a1.715 1.715 0 001.45 1.72c.805.128 1.64-.426 1.87-1.26.046-.167.076-.338.106-.51.025-.14.05-.282.084-.42.318-1.317 1.237-1.95 2.788-1.93 1.086.013 1.318.271 1.68 1.855.017.076.043.151.07.226.26.714.976 1.17 1.67 1.065a1.647 1.647 0 001.38-1.438c.083-.729-.348-1.264-1.122-1.575-.34-.136-.664-.158-.995-.141-.726.037-1.121-.36-1.339-.977a3.359 3.359 0 01-.134-.65c-.014-.093-.027-.186-.043-.278-.156-.887-.835-1.51-1.669-1.532-.791-.02-1.464.551-1.665 1.418l-.06.27-.025.117c-.355 1.636-.974 2.205-2.638 2.422z"
fill={b.fill}
></path>
<path
d="M18.059 13.644c.989-.206 1.577-.838 1.592-1.697.015-.83-.624-1.582-1.46-1.724-.77-.13-1.599.383-1.844 1.18-.069.22-.117.448-.165.676-.06.29-.122.58-.225.854-.367.986-1.593 1.546-2.926 1.394-.824-.095-1.106-.446-1.342-1.674-.18-.938-.864-1.535-1.681-1.467-.85.07-1.515.829-1.468 1.673.05.892.678 1.44 1.705 1.489 1.375.064 1.75.396 1.926 1.787.067.531.267.967.685 1.288 1.02.783 2.407.208 2.66-1.108l.022-.114c.152-.796.3-1.577 1.04-2.101.36-.255.761-.326 1.166-.397.105-.019.21-.037.315-.06z"
fill={c.fill}
></path>
<path d="M13.83 7.961a.755.755 0 11-1.51 0 .755.755 0 011.51 0z" fill={d.fill}></path>
<path d="M10.809 16.678a.755.755 0 100-1.511.755.755 0 000 1.51z" fill={e.fill}></path>
</g>
<defs>
<linearGradient gradientUnits="userSpaceOnUse" id={a.id} x1="12" x2="12" y1="0" y2="24">
<stop stopColor="#12B7FA"></stop>
<stop offset="1" stopColor="#006ffb"></stop>
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
id={b.id}
x1="11.943"
x2="11.943"
y1="6.085"
y2="17.778"
>
<stop stopColor="#006ffb"></stop>
<stop offset="1" stopColor="#12B7FA"></stop>
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
id={c.id}
x1="11.943"
x2="11.943"
y1="6.085"
y2="17.778"
>
<stop stopColor="#006ffb"></stop>
<stop offset="1" stopColor="#12B7FA"></stop>
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
id={d.id}
x1="11.943"
x2="11.943"
y1="6.085"
y2="17.778"
>
<stop stopColor="#006ffb"></stop>
<stop offset="1" stopColor="#12B7FA"></stop>
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
id={e.id}
x1="11.943"
x2="11.943"
y1="6.085"
y2="17.778"
>
<stop stopColor="#006ffb"></stop>
<stop offset="1" stopColor="#12B7FA"></stop>
</linearGradient>
</defs>
</svg>
);
});

export default Icon;
28 changes: 28 additions & 0 deletions src/Ai360/components/Combine.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { memo } from 'react';

import IconCombine, { type IconCombineProps } from '@/IconCombine';

import { SPACE_MULTIPLE, TEXT_MULTIPLE, TITLE } from '../style';
import Color from './Color';
import Mono from './Mono';
import Text from './Text';

export interface CombineProps extends Omit<IconCombineProps, 'Icon' | 'Text'> {
type?: 'color' | 'mono';
}
const Combine = memo<CombineProps>(({ type = 'mono', ...rest }) => {
const Icon = type === 'color' ? Color : Mono;

return (
<IconCombine
Icon={Icon}
Text={Text}
aria-label={TITLE}
spaceMultiple={SPACE_MULTIPLE}
textMultiple={TEXT_MULTIPLE}
{...rest}
/>
);
});

export default Combine;
33 changes: 33 additions & 0 deletions src/Ai360/components/Mono.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { forwardRef } from 'react';

import type { IconType } from '@/types';

import { TITLE } from '../style';

const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
return (
<svg
fill="currentColor"
fillRule="evenodd"
height={size}
ref={ref}
style={{ flex: 'none', lineHeight: 1, ...style }}
viewBox="0 0 24 24"
width={size}
xmlns="http://www.w3.org/2000/svg"
{...rest}
>
<title>{TITLE}</title>
<path
clipRule="evenodd"
d="M12 0h.018c1.473-.002 2.88.261 4.179.754C20.755 2.456 24 6.85 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm8.604 18.967A11.024 11.024 0 0023.07 12c0-1.717-.39-3.344-1.089-4.794a2.59 2.59 0 01-3.214.62 6.278 6.278 0 01-1.333-.992C16.283 5.73 15.109 4.66 13.696 3.9c-3.211-1.729-6.825-1.501-9.695.447A11.033 11.033 0 00.93 12c0 1.663.367 3.241 1.024 4.657.75-.973 2.131-1.346 3.232-.71.667.384 1.257.92 1.837 1.447l.176.16c1.365 1.234 2.794 2.355 4.558 2.965 3.053 1.053 6.356.437 8.847-1.552z"
></path>
<path d="M5.643 10.312c-.83.11-1.401.766-1.408 1.618a1.715 1.715 0 001.45 1.72c.805.128 1.64-.426 1.87-1.26.046-.167.076-.338.106-.51.025-.14.05-.282.084-.42.318-1.317 1.237-1.95 2.788-1.93 1.086.013 1.318.271 1.68 1.855.017.076.043.151.07.226.26.714.976 1.17 1.67 1.065a1.647 1.647 0 001.38-1.438c.083-.729-.348-1.264-1.122-1.575-.34-.136-.664-.158-.995-.141-.726.037-1.121-.36-1.339-.977a3.359 3.359 0 01-.134-.65c-.014-.093-.027-.186-.043-.278-.156-.887-.835-1.51-1.669-1.532-.791-.02-1.464.551-1.665 1.418l-.06.27-.025.117c-.355 1.636-.974 2.205-2.638 2.422z"></path>
<path d="M18.059 13.644c.989-.206 1.577-.838 1.592-1.697.015-.83-.624-1.582-1.46-1.724-.77-.13-1.599.383-1.844 1.18-.069.22-.117.448-.165.676-.06.29-.122.58-.225.854-.367.986-1.593 1.546-2.926 1.394-.824-.095-1.106-.446-1.342-1.674-.18-.938-.864-1.535-1.681-1.467-.85.07-1.515.829-1.468 1.673.05.892.678 1.44 1.705 1.489 1.375.064 1.75.396 1.926 1.787.067.531.267.967.685 1.288 1.02.783 2.407.208 2.66-1.108l.022-.114c.152-.796.3-1.577 1.04-2.101.36-.255.761-.326 1.166-.397.105-.019.21-.037.315-.06z"></path>
<path d="M13.83 7.961a.755.755 0 11-1.51 0 .755.755 0 011.51 0z"></path>
<path d="M10.809 16.678a.755.755 0 100-1.511.755.755 0 000 1.51z"></path>
</svg>
);
});

export default Icon;
29 changes: 29 additions & 0 deletions src/Ai360/components/Text.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { forwardRef } from 'react';

import type { IconType } from '@/types';

import { TITLE } from '../style';

const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
return (
<svg
fill="currentColor"
fillRule="evenodd"
height={size}
ref={ref}
style={{ flex: 'none', lineHeight: 1, width: 'fit-content', ...style }}
viewBox="0 0 78 24"
xmlns="http://www.w3.org/2000/svg"
{...rest}
>
<title>{TITLE}</title>
<path d="M17.978 2H2v1.196c0 1.02.827 1.847 1.848 1.847h14.565a3.913 3.913 0 013.913 3.914v1.304H3.956v3.043h18.37v1.848a3.913 3.913 0 01-3.913 3.913H3.848c-1.02 0-1.848.827-1.848 1.848V22h15.978a7.391 7.391 0 007.392-7.391V9.39A7.391 7.391 0 0017.978 2z"></path>
<path
clipRule="evenodd"
d="M27.978 8.957A6.956 6.956 0 0134.935 2h15.87v1.304c0 .96-.78 1.74-1.74 1.74H34.826a3.913 3.913 0 00-3.913 3.913v1.304h15a4.783 4.783 0 014.783 4.783v2.173A4.783 4.783 0 0145.913 22H34.935a6.956 6.956 0 01-6.957-6.957V8.957zm2.935 4.239v1.848c0 2.22 1.8 4.021 4.022 4.021h10.76c1.201 0 2.175-.973 2.175-2.174V15.37c0-1.201-.974-2.174-2.174-2.174H30.913zM60.26 2.109a6.848 6.848 0 00-6.847 6.848v6.195A6.848 6.848 0 0060.261 22h9.13a6.848 6.848 0 006.848-6.848V8.957a6.848 6.848 0 00-6.848-6.848h-9.13zm0 2.934a3.913 3.913 0 00-3.912 3.914v6.195a3.913 3.913 0 003.913 3.913h9.13a3.913 3.913 0 003.913-3.913V8.957a3.913 3.913 0 00-3.913-3.914h-9.13z"
></path>
</svg>
);
});

export default Icon;
73 changes: 73 additions & 0 deletions src/Ai360/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
nav: Components
group: Provider
title: Ai360 (360智脑)
atomId: Ai360
description: https://ai.360.com/
---

## Icons

```tsx
import { Ai360 } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

export default () => (
<Flexbox gap={16} horizontal>
<Ai360 size={64} />
<Ai360.Color size={64} />
</Flexbox>
);
```

## Text

```tsx
import { Ai360 } from '@lobehub/icons';

export default () => <Ai360.Text size={48} />;
```

## Combine

```tsx
import { Ai360 } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

export default () => (
<Flexbox gap={16}>
<Ai360.Combine size={64} />
<Ai360.Combine size={64} type={'color'} />
</Flexbox>
);
```

## Avatars

```tsx
import { Ai360 } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

export default () => (
<Flexbox gap={16} horizontal>
<Ai360.Avatar size={64} background={Ai360.colorPrimary} />
<Ai360.Avatar size={64} />
<Ai360.Avatar size={64} shape={'square'} />
</Flexbox>
);
```

## Colors

```tsx
import { Ai360 } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

import ColorPreview from '../components/ColorPreview';

export default () => (
<Flexbox gap={16} horizontal>
<ColorPreview color={Ai360.colorPrimary} />
</Flexbox>
);
```
27 changes: 27 additions & 0 deletions src/Ai360/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Avatar from './components/Avatar';
import Color from './components/Color';
import Combine from './components/Combine';
import Mono from './components/Mono';
import Text from './components/Text';
import { COLOR_GRADIENT, COLOR_PRIMARY, TITLE } from './style';

export type CompoundedIcon = typeof Mono & {
Avatar: typeof Avatar;
Color: typeof Color;
Combine: typeof Combine;
Text: typeof Text;
colorGradient: string;
colorPrimary: string;
title: string;
};

const Icons = Mono as CompoundedIcon;
Icons.Color = Color;
Icons.Text = Text;
Icons.Combine = Combine;
Icons.Avatar = Avatar;
Icons.colorPrimary = COLOR_PRIMARY;
Icons.colorGradient = COLOR_GRADIENT;
Icons.title = TITLE;

export default Icons;
5 changes: 5 additions & 0 deletions src/Ai360/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const TITLE = '360智脑';
export const TEXT_MULTIPLE = 0.7;
export const SPACE_MULTIPLE = 0.2;
export const COLOR_PRIMARY = '#006ffb';
export const COLOR_GRADIENT = 'linear-gradient(to bottom, #12B7FA, #006ffb)';
21 changes: 21 additions & 0 deletions src/AiMass/components/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { memo } from 'react';

import IconAvatar, { type IconAvatarProps } from '@/IconAvatar';

import { COLOR_PRIMARY, TITLE } from '../style';
import Color from './Color';

export type AvatarProps = Omit<IconAvatarProps, 'Icon'>;

const Avatar = memo<AvatarProps>(({ background, ...rest }) => {
return (
<IconAvatar
Icon={Color}
aria-label={TITLE}
background={background || COLOR_PRIMARY}
{...rest}
/>
);
});

export default Avatar;
Loading

0 comments on commit 02e6848

Please sign in to comment.