πŸ› fix: Fix zero-one

This commit is contained in:
canisminor1990
2026-05-07 10:43:36 +08:00
parent 0f2696b4b0
commit e94963c172
9 changed files with 26 additions and 10 deletions
@@ -3,14 +3,14 @@ import React, { memo } from 'react';
import { RNIconAvatar, type RNIconAvatarProps } from '@/features';
import { AVATAR_BACKGROUND, AVATAR_COLOR, AVATAR_ICON_MULTIPLE, TITLE } from '../style';
import Mono from './Mono';
import Color from './Color';
export type AvatarProps = Omit<RNIconAvatarProps, 'Icon'>;
const Avatar = memo<AvatarProps>(({ background, ...rest }) => {
return (
<RNIconAvatar
Icon={Mono}
Icon={Color}
aria-label={TITLE}
background={background || AVATAR_BACKGROUND}
color={AVATAR_COLOR}
@@ -2,7 +2,7 @@ import React, { memo } from 'react';
import { RNIconCombine, type RNIconCombineProps } from '@/features';
import { COMBINE_SPACE_MULTIPLE, COMBINE_TEXT_MULTIPLE, TITLE } from '../style';
import { COLOR_PRIMARY, COMBINE_SPACE_MULTIPLE, COMBINE_TEXT_MULTIPLE, TITLE } from '../style';
import Text from './Text';
export interface CombineProps extends Omit<RNIconCombineProps, 'Icon' | 'Text'> {
@@ -14,7 +14,7 @@ const Combine = memo<CombineProps>(({ type = 'mono', ...rest }) => {
<RNIconCombine
Text={Text}
aria-label={TITLE}
color={type === 'color' ? '#00ffb3' : undefined}
color={type === 'color' ? COLOR_PRIMARY : undefined}
spaceMultiple={COMBINE_SPACE_MULTIPLE}
textMultiple={COMBINE_TEXT_MULTIPLE}
{...rest}
@@ -15,7 +15,12 @@ const Icon = memo<RNIconProps>(({ size = 24, style, color = '#000000', ...rest }
{...rest}
>
<Path
d="M5.246 12c0 .837-.086 1.554-.257 2.151-.172.598-.45 1.055-.837 1.373-.386.317-.898.476-1.534.476-.901 0-1.563-.353-1.985-1.059C.211 14.235 0 13.255 0 12c0-.837.086-1.554.257-2.151.172-.598.45-1.055.832-1.373C1.472 8.16 1.981 8 2.618 8c.894 0 1.555.351 1.985 1.053.429.702.643 1.685.643 2.947zm-3.883 0c0 .956.09 1.668.273 2.134.183.467.51.7.982.7.465 0 .792-.23.981-.694.19-.463.285-1.176.285-2.14 0-.956-.095-1.668-.285-2.134-.19-.467-.516-.7-.981-.7-.472 0-.8.233-.982.7-.182.466-.273 1.178-.273 2.134zm8.52 3.771H8.517l.011-6.295-1.823.324V8.571l2.04-.457h1.136v7.657zm2.497-1.6h.543c.3 0 .543.256.543.572v.571a.558.558 0 01-.543.572h-.543a.558.558 0 01-.543-.572v-.571c0-.316.243-.572.543-.572zm10.317-6.057H24v7.772h-1.303V8.114zm-3.692 0l2.606 7.772h-1.303l-.69-2.058h-3.073l-.69 2.058h-1.303l2.606-7.772h1.847zm.191 4.457l-1.115-3.323-1.114 3.323h2.23z"
clipRule="evenodd"
d="M18.62 13.927c.611 0 1.107.505 1.107 1.128v5.817c0 .623-.496 1.128-1.108 1.128a1.118 1.118 0 01-1.108-1.128v-5.817c0-.623.496-1.128 1.108-1.128h.001zM16.59 3.052a1.095 1.095 0 011.562-.13c.466.405.522 1.117.126 1.59l-5.938 7.112v9.147c0 .624-.496 1.129-1.108 1.129a1.119 1.119 0 01-1.108-1.13v-9.476l.003-.088.01-.087a1.14 1.14 0 01.261-.654l6.192-7.413zM2.906 2.256a1.094 1.094 0 011.559.157l4.387 5.45a1.142 1.142 0 01-.155 1.587 1.094 1.094 0 01-1.559-.157l-4.387-5.45a1.144 1.144 0 01.06-1.498l.095-.09z"
fill={color}
/>
<Path
d="M20.146 12.071c.748 0 1.354-.617 1.354-1.379s-.606-1.379-1.354-1.379c-.748 0-1.354.617-1.354 1.379s.606 1.379 1.354 1.379z"
fill={color}
/>
</Svg>
@@ -1,4 +1,5 @@
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';
@@ -6,6 +7,7 @@ import { COLOR_PRIMARY, TITLE } from './style';
export type CompoundedIcon = typeof Mono & {
Avatar: typeof Avatar;
Color: typeof Color;
Combine: typeof Combine;
Text: typeof Text;
colorPrimary: string;
@@ -15,6 +17,7 @@ export type CompoundedIcon = typeof Mono & {
const Icons = Mono as CompoundedIcon;
Icons.Text = Text;
Icons.Color = Color;
Icons.Combine = Combine;
Icons.Avatar = Avatar;
Icons.colorPrimary = COLOR_PRIMARY;
+2 -2
View File
@@ -5,14 +5,14 @@ import { memo } from 'react';
import IconAvatar, { type IconAvatarProps } from '@/features/IconAvatar';
import { AVATAR_BACKGROUND, AVATAR_COLOR, AVATAR_ICON_MULTIPLE, TITLE } from '../style';
import Mono from './Mono';
import Color from './Color';
export type AvatarProps = Omit<IconAvatarProps, 'Icon'>;
const Avatar = memo<AvatarProps>(({ ...rest }) => {
return (
<IconAvatar
Icon={Mono}
Icon={Color}
aria-label={TITLE}
background={AVATAR_BACKGROUND}
color={AVATAR_COLOR}
+2 -2
View File
@@ -4,7 +4,7 @@ import { memo } from 'react';
import IconCombine, { type IconCombineProps } from '@/features/IconCombine';
import { COMBINE_SPACE_MULTIPLE, COMBINE_TEXT_MULTIPLE, TITLE } from '../style';
import { COLOR_PRIMARY, COMBINE_SPACE_MULTIPLE, COMBINE_TEXT_MULTIPLE, TITLE } from '../style';
import Text from './Text';
export interface CombineProps extends Omit<IconCombineProps, 'Icon' | 'Text'> {
@@ -16,7 +16,7 @@ const Combine = memo<CombineProps>(({ type = 'mono', ...rest }) => {
<IconCombine
Text={Text}
aria-label={TITLE}
color={type === 'color' ? '#00ffb3' : undefined}
color={type === 'color' ? COLOR_PRIMARY : undefined}
spaceMultiple={COMBINE_SPACE_MULTIPLE}
textMultiple={COMBINE_TEXT_MULTIPLE}
{...rest}
+5 -1
View File
@@ -19,7 +19,11 @@ const Icon: IconType = memo(({ size = '1em', style, ...rest }) => {
{...rest}
>
<title>{TITLE}</title>
<path d="M5.246 12c0 .837-.086 1.554-.257 2.151-.172.598-.45 1.055-.837 1.373-.386.317-.898.476-1.534.476-.901 0-1.563-.353-1.985-1.059C.211 14.235 0 13.255 0 12c0-.837.086-1.554.257-2.151.172-.598.45-1.055.832-1.373C1.472 8.16 1.981 8 2.618 8c.894 0 1.555.351 1.985 1.053.429.702.643 1.685.643 2.947zm-3.883 0c0 .956.09 1.668.273 2.134.183.467.51.7.982.7.465 0 .792-.23.981-.694.19-.463.285-1.176.285-2.14 0-.956-.095-1.668-.285-2.134-.19-.467-.516-.7-.981-.7-.472 0-.8.233-.982.7-.182.466-.273 1.178-.273 2.134zm8.52 3.771H8.517l.011-6.295-1.823.324V8.571l2.04-.457h1.136v7.657zm2.497-1.6h.543c.3 0 .543.256.543.572v.571a.558.558 0 01-.543.572h-.543a.558.558 0 01-.543-.572v-.571c0-.316.243-.572.543-.572zm10.317-6.057H24v7.772h-1.303V8.114zm-3.692 0l2.606 7.772h-1.303l-.69-2.058h-3.073l-.69 2.058h-1.303l2.606-7.772h1.847zm.191 4.457l-1.115-3.323-1.114 3.323h2.23z" />
<path
clipRule="evenodd"
d="M18.62 13.927c.611 0 1.107.505 1.107 1.128v5.817c0 .623-.496 1.128-1.108 1.128a1.118 1.118 0 01-1.108-1.128v-5.817c0-.623.496-1.128 1.108-1.128h.001zM16.59 3.052a1.095 1.095 0 011.562-.13c.466.405.522 1.117.126 1.59l-5.938 7.112v9.147c0 .624-.496 1.129-1.108 1.129a1.119 1.119 0 01-1.108-1.13v-9.476l.003-.088.01-.087a1.14 1.14 0 01.261-.654l6.192-7.413zM2.906 2.256a1.094 1.094 0 011.559.157l4.387 5.45a1.142 1.142 0 01-.155 1.587 1.094 1.094 0 01-1.559-.157l-4.387-5.45a1.144 1.144 0 01.06-1.498l.095-.09z"
/>
<path d="M20.146 12.071c.748 0 1.354-.617 1.354-1.379s-.606-1.379-1.354-1.379c-.748 0-1.354.617-1.354 1.379s.606 1.379 1.354 1.379z" />
</svg>
);
});
+1
View File
@@ -15,6 +15,7 @@ import { Flexbox } from '@lobehub/ui';
export default () => (
<Flexbox gap={16} horizontal>
<ZeroOne size={64} />
<ZeroOne.Color size={64} />
</Flexbox>
);
```
+3
View File
@@ -1,4 +1,5 @@
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';
@@ -6,6 +7,7 @@ import { COLOR_PRIMARY, TITLE } from './style';
export type CompoundedIcon = typeof Mono & {
Avatar: typeof Avatar;
Color: typeof Color;
Combine: typeof Combine;
Text: typeof Text;
colorPrimary: string;
@@ -15,6 +17,7 @@ export type CompoundedIcon = typeof Mono & {
const Icons = Mono as CompoundedIcon;
Icons.Text = Text;
Icons.Color = Color;
Icons.Combine = Combine;
Icons.Avatar = Avatar;
Icons.colorPrimary = COLOR_PRIMARY;