Skip to content

Commit 265887d

Browse files
✨ feat: Add Upsate and Solar
1 parent a09faaa commit 265887d

File tree

14 files changed

+290
-10
lines changed

14 files changed

+290
-10
lines changed

README.md

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

src/IconCombine/index.tsx

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface IconCombineProps extends FlexboxProps {
1212
extraClassName?: string;
1313
extraStyle?: CSSProperties;
1414
iconProps?: Partial<IconAvatarProps>;
15+
inverse?: boolean;
1516
showLogo?: boolean;
1617
showText?: boolean;
1718
size?: number;
@@ -34,10 +35,25 @@ const IconCombine = forwardRef<HTMLDivElement, IconCombineProps>(
3435
showLogo = true,
3536
extraClassName,
3637
iconProps,
38+
inverse,
3739
...rest
3840
},
3941
ref,
4042
) => {
43+
const logo = showLogo && (
44+
<Icon
45+
size={size}
46+
{...(iconProps as any)}
47+
style={
48+
inverse
49+
? { marginLeft: size * spaceMultiple, ...iconProps?.style }
50+
: { marginRight: size * spaceMultiple, ...iconProps?.style }
51+
}
52+
/>
53+
);
54+
55+
const text = showText && Text && <Text size={size * textMultiple} />;
56+
4157
return (
4258
<Flexbox
4359
align={'center'}
@@ -48,14 +64,17 @@ const IconCombine = forwardRef<HTMLDivElement, IconCombineProps>(
4864
style={{ color, ...style }}
4965
{...rest}
5066
>
51-
{showLogo && (
52-
<Icon
53-
size={size}
54-
{...(iconProps as any)}
55-
style={{ marginRight: size * spaceMultiple, ...iconProps?.style }}
56-
/>
67+
{inverse ? (
68+
<>
69+
{text}
70+
{logo}
71+
</>
72+
) : (
73+
<>
74+
{logo}
75+
{text}
76+
</>
5777
)}
58-
{showText && Text && <Text size={size * textMultiple} />}
5978
{extra && (
6079
<span
6180
className={extraClassName}

src/ModelIcon/const.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import Rwkv from '@/Rwkv';
3636
import Spark from '@/Spark';
3737
import Stability from '@/Stability';
3838
import Stepfun from '@/Stepfun';
39+
import Upsate from '@/Upsate';
3940
import Wenxin from '@/Wenxin';
4041
import Yi from '@/Yi';
4142
import type { IconType } from '@/types';
@@ -109,4 +110,5 @@ export const modelMappings: ModelMapping[] = [
109110
{ Icon: Adobe, keywords: ['firefly'] },
110111
{ Icon: Ai21, keywords: ['jamba', '^j2-'] },
111112
{ Icon: InternLM, keywords: ['internlm'] },
113+
{ Icon: Upsate, keywords: ['^solar-'] },
112114
];

src/ProviderCombine/const.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import Qwen from '@/Qwen';
2929
import SiliconCloud from '@/SiliconCloud';
3030
import Stepfun from '@/Stepfun';
3131
import Together from '@/Together';
32+
import Upsate from '@/Upsate';
3233
import ZeroOne from '@/ZeroOne';
3334
import Zhipu from '@/Zhipu';
3435

@@ -133,4 +134,5 @@ export const providerMappings: ProviderMapping[] = [
133134
{ Icon: Ai360.Combine, keywords: [ModelProvider.Ai360], multiple: 0.83 },
134135
{ Icon: Novita.Combine, keywords: [ModelProvider.Novita], multiple: 0.95 },
135136
{ Icon: SiliconCloud.Combine, keywords: [ModelProvider.SiliconCloud], multiple: 0.75 },
137+
{ Icon: Upsate.Combine, keywords: [ModelProvider.Upsate], multiple: 0.9 },
136138
];

src/ProviderIcon/const.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Qwen from '@/Qwen';
2424
import SiliconCloud from '@/SiliconCloud';
2525
import Stepfun from '@/Stepfun';
2626
import Together from '@/Together';
27+
import Upsate from '@/Upsate';
2728
import ZeroOne from '@/ZeroOne';
2829
import Zhipu from '@/Zhipu';
2930
import type { IconType } from '@/types';
@@ -66,6 +67,7 @@ export enum ModelProvider {
6667
Stepfun = 'stepfun',
6768
Taichu = 'taichu',
6869
TogetherAI = 'togetherai',
70+
Upsate = 'upsate',
6971
ZeroOne = 'zeroone',
7072
ZhiPu = 'zhipu',
7173
}
@@ -97,4 +99,5 @@ export const providerMappings: ProviderMapping[] = [
9799
{ Icon: AiMass, keywords: [ModelProvider.Taichu] },
98100
{ Icon: Ai360, keywords: [ModelProvider.Ai360] },
99101
{ Icon: SiliconCloud, keywords: [ModelProvider.SiliconCloud] },
102+
{ Icon: Upsate, keywords: [ModelProvider.Upsate] },
100103
];

src/Upsate/components/Avatar.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { memo } from 'react';
2+
3+
import IconAvatar, { type IconAvatarProps } from '@/IconAvatar';
4+
5+
import { COLOR_GRADIENT, 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_GRADIENT}
16+
color={'#fff'}
17+
iconMultiple={0.6}
18+
{...rest}
19+
/>
20+
);
21+
});
22+
23+
export default Avatar;

src/Upsate/components/Color.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { forwardRef } from 'react';
2+
3+
import { useFillId } from '@/hooks/useFillId';
4+
import type { IconType } from '@/types';
5+
6+
import { TITLE } from '../style';
7+
8+
const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
9+
const { fill, id } = useFillId(TITLE);
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="M19.763 0l-.373 1.297h2.594L22.354 0h-2.591zM16.192 2.27l-.376 1.298h5.52l.37-1.298h-5.514zM12.897 4.54l-.376 1.298h8.166l.37-1.298h-8.16zM2.85 6.81l-.377 1.298h17.565l.37-1.297H2.848zM3.884 9.081l-.376 1.297H19.39l.37-1.297H3.882zM4.088 24l.376-1.297H1.866L1.5 24h2.588zM7.662 21.73l.376-1.297H2.515L2.15 21.73h5.513zM10.957 19.459l.376-1.297h-8.17l-.366 1.297h8.16zM21.005 17.189l.376-1.297H3.812l-.366 1.297h17.559zM19.967 14.919l.376-1.297H4.461l-.366 1.297h15.872zM18.786 12.649l.376-1.297H4.26l-.366 1.297h14.893z"
23+
fill={fill}
24+
></path>
25+
<defs>
26+
<linearGradient gradientUnits="userSpaceOnUse" id={id} x1="11.927" x2="11.927" y2="24">
27+
<stop offset="0" stopColor="#AEBCFE"></stop>
28+
<stop offset="1" stopColor="#805DFA"></stop>
29+
</linearGradient>
30+
</defs>
31+
</svg>
32+
);
33+
});
34+
35+
export default Icon;

src/Upsate/components/Combine.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
inverse
22+
spaceMultiple={SPACE_MULTIPLE}
23+
textMultiple={TEXT_MULTIPLE}
24+
{...rest}
25+
/>
26+
);
27+
});
28+
29+
export default Combine;

src/Upsate/components/Mono.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
<path d="M19.763 0l-.373 1.297h2.594L22.354 0h-2.591z"></path>
22+
<path d="M16.192 2.27l-.376 1.298h5.52l.37-1.298h-5.514z"></path>
23+
<path d="M12.897 4.54l-.377 1.298h8.167l.37-1.297h-8.16z"></path>
24+
<path d="M2.85 6.81l-.377 1.298h17.565l.37-1.297H2.85z"></path>
25+
<path d="M3.884 9.081l-.376 1.297H19.39l.37-1.297H3.883z"></path>
26+
<path d="M4.088 24l.376-1.297H1.866L1.5 24h2.588z"></path>
27+
<path d="M7.662 21.73l.376-1.298H2.515L2.15 21.73h5.513z"></path>
28+
<path d="M10.957 19.46l.377-1.298h-8.17l-.367 1.297h8.16z"></path>
29+
<path d="M21.005 17.19l.376-1.298H3.812l-.366 1.297h17.559z"></path>
30+
<path d="M19.967 14.919l.376-1.297H4.461l-.366 1.297h15.872z"></path>
31+
<path d="M18.787 12.649l.376-1.298H4.26l-.366 1.298h14.893z"></path>
32+
</svg>
33+
);
34+
});
35+
36+
export default Icon;

src/Upsate/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 87 24"
16+
xmlns="http://www.w3.org/2000/svg"
17+
{...rest}
18+
>
19+
<title>{TITLE}</title>
20+
<path d="M43.583 14.44c0 .731 0 3.44 2.975 3.44a4.13 4.13 0 002.382-.654v-1.72h-.046a3.586 3.586 0 01-1.598.457c-1.141 0-1.415-.822-1.415-2.412V8.612h3.226V6.725h-3.226V2.944h-.046L43.59 4.686v2.04h-1.856v1.886h1.856v5.829h-.007zM66.486 17.454a4.339 4.339 0 002.093-.457 4.42 4.42 0 001.636-1.384v.875c0 2.275-1.378 3.515-3.387 3.515a7.316 7.316 0 01-4.58-1.606h-.046v2.085a7.636 7.636 0 004.802 1.514c3.249 0 5.493-1.97 5.493-5.942V6.725H70.74l-.252 1.864a4.305 4.305 0 00-1.613-1.628 4.196 4.196 0 00-2.222-.533c-2.792 0-5.15 2.177-5.15 5.51 0 3.332 2.29 5.508 4.983 5.508v.008zm.64-9.047c2.061 0 3.21 1.72 3.21 3.508s-1.148 3.56-3.21 3.56c-2.215 0-3.273-1.727-3.273-3.56 0-1.834.982-3.508 3.273-3.508zM11.245 2H6.078l-.525 1.857h5.152L11.245 2zM59.897 10.173c0-2.823-2.313-3.767-4.58-3.736a7.354 7.354 0 00-4.277 1.56l-.068 2.07h.045a6.07 6.07 0 014.147-1.606c1.53 0 2.496.479 2.496 1.552s-.944 1.172-2.61 1.172c-2.519 0-4.801.798-4.801 3.355 0 2.2 1.917 3.401 3.98 3.401a4.203 4.203 0 002.122-.479 4.195 4.195 0 001.59-1.484l.206 1.674h1.765v-7.48h-.015zm-2.123 3.081c0 .396-.091.784-.243 1.15-.16.357-.389.684-.678.95-.289.267-.624.48-.996.609a2.85 2.85 0 01-1.157.167c-1.103 0-2.214-.502-2.214-1.605s1.042-1.606 2.397-1.606c1.354 0 2.381-.144 2.891-.799v1.15-.016zM79.764 6.375c-.761 0-1.515.145-2.214.442a5.582 5.582 0 00-3.074 3.142 5.436 5.436 0 00-.366 2.199c0 3.455 2.39 5.768 5.821 5.768a6.563 6.563 0 004.375-1.583v-1.956h-.046a5.781 5.781 0 01-1.948 1.195 5.864 5.864 0 01-2.266.335c-2.116 0-3.478-1.164-3.478-2.283 0-.662.517-.753 1.18-.753h6.992v-2.268a4.735 4.735 0 00-1.651-3.081 4.88 4.88 0 00-3.333-1.15l.008-.007zm-1.69 4.824a2.621 2.621 0 00-1.689.502c.137-1.947 1.187-3.317 3.173-3.317a2.82 2.82 0 012.085.776c.274.259.487.578.624.936.145.35.213.73.198 1.103h-4.39zM27.323 6.352a4.746 4.746 0 00-1.933.464 4.642 4.642 0 00-1.567 1.225l.616-2.138h-4.954l-.54 1.872h2.572l-1.567 5.463c-2.511 1.43-3.592 1.903-4.132 1.903-.54 0-.723-.305-.54-.921l2.35-8.317h-2.35l-1.796 6.247c-2.016 2.169-3.036 2.99-4.109 2.99S7.92 14.297 8.3 12.943l1.963-7.039H2.525L2 7.768h5.478-.076l-1.529 5.394c-.662 2.306.365 4.018 2.32 4.018 1.477 0 2.8-.944 4.84-3.424l-.053.205c-.563 2.047.205 3.219 2.092 3.219.92 0 2.017-.365 4.193-1.545l-1.819 6.354h2.374l2.146-7.488c.198.86.64 1.636 1.27 2.253l.214.19.053.046.122.09c.73.518 1.605.785 2.495.77 3.204 0 5.631-2.71 5.631-6.293 0-3.059-1.758-5.212-4.436-5.212l.008.007zm-1.4 9.527c-1.644 0-2.839-1.172-2.839-3.173 0-2.313 1.576-4.383 3.66-4.383 1.667 0 2.77 1.255 2.77 3.211 0 2.45-1.53 4.337-3.584 4.337l-.007.008zM40.958 14.555c0-2.184-1.986-2.846-3.63-3.371-1.179-.373-2.183-.7-2.183-1.499 0-.799.76-1.309 2.008-1.309 1.142 0 2.245.365 3.166 1.035h.045V7.448a6.256 6.256 0 00-3.317-.959c-2.42 0-4.018 1.309-4.018 3.356 0 2.047 1.85 2.693 3.455 3.21 1.232.404 2.328.754 2.328 1.705 0 .83-.844 1.355-2.153 1.355a6.508 6.508 0 01-3.729-1.355h-.076v1.963a7.615 7.615 0 004.048 1.187c2.268 0 4.056-1.172 4.056-3.355z"></path>
21+
</svg>
22+
);
23+
});
24+
25+
export default Icon;

0 commit comments

Comments
 (0)