Skip to content

Commit b560c78

Browse files
committed
hugeicons update: direct import icon instead of svg
1 parent cad592d commit b560c78

19 files changed

+1182
-32
lines changed

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = {
66
{
77
alias: {
88
'@components': './src/components',
9+
'@hugeicons': './src/assets/icons/hugeicons',
910
'@icons': './src/assets/icons/src',
1011
'@images': './src/assets/images/src',
1112
'@assets': './src/assets',
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
import React from 'react'
3+
import Svg, { Circle, ClipPath, Defs, Ellipse, G, Line, LinearGradient, Mask, Path, Polygon, Polyline, RadialGradient, Rect, Stop } from 'react-native-svg'
4+
import { Variant, IconProps, defaultStrokeWidth, defaultVariant, defaultColor, defaultSize } from './constants'
5+
6+
const iconMap: Record<Variant, React.FC<IconProps>> = {
7+
'stroke-rounded': StrokeRounded,
8+
'stroke-standard': StrokeStandard,
9+
'solid-standard': SolidStandard,
10+
'duotone-rounded': DuotoneRounded,
11+
'twotone-rounded': TwotoneRounded,
12+
'solid-rounded': SolidRounded,
13+
'bulk-rounded': BulkRounded,
14+
'stroke-sharp': StrokeSharp,
15+
'solid-sharp': SolidSharp,
16+
}
17+
18+
export default function Add01Icon({ variant, ...rest }: IconProps) {
19+
const Component = iconMap[variant || defaultVariant]
20+
return <Component {...rest} />
21+
}
22+
23+
function StrokeRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
24+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
25+
<Path d="M12 4V20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
26+
<Path d="M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
27+
</Svg>
28+
)
29+
}
30+
31+
function StrokeStandard({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
32+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
33+
<Path d="M12 4V20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
34+
<Path d="M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
35+
</Svg>
36+
)
37+
}
38+
39+
function SolidStandard({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
40+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
41+
<Path fillRule="evenodd" clipRule="evenodd" d="M12 2.75C12.6904 2.75 13.25 3.30964 13.25 4V20C13.25 20.6904 12.6904 21.25 12 21.25C11.3096 21.25 10.75 20.6904 10.75 20V4C10.75 3.30964 11.3096 2.75 12 2.75Z" fill={color}/>
42+
<Path fillRule="evenodd" clipRule="evenodd" d="M2.75 12C2.75 11.3096 3.30964 10.75 4 10.75H20C20.6904 10.75 21.25 11.3096 21.25 12C21.25 12.6904 20.6904 13.25 20 13.25H4C3.30964 13.25 2.75 12.6904 2.75 12Z" fill={color}/>
43+
</Svg>
44+
)
45+
}
46+
47+
function DuotoneRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
48+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
49+
<Path opacity="0.4" d="M12 4V20M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
50+
</Svg>
51+
)
52+
}
53+
54+
function TwotoneRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
55+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
56+
<Path d="M12 4V20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
57+
<Path opacity="0.4" d="M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
58+
</Svg>
59+
)
60+
}
61+
62+
function SolidRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
63+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
64+
<Path fillRule="evenodd" clipRule="evenodd" d="M12 2.75C12.6904 2.75 13.25 3.30964 13.25 4V20C13.25 20.6904 12.6904 21.25 12 21.25C11.3096 21.25 10.75 20.6904 10.75 20V4C10.75 3.30964 11.3096 2.75 12 2.75Z" fill={color}/>
65+
<Path fillRule="evenodd" clipRule="evenodd" d="M2.75 12C2.75 11.3096 3.30964 10.75 4 10.75H20C20.6904 10.75 21.25 11.3096 21.25 12C21.25 12.6904 20.6904 13.25 20 13.25H4C3.30964 13.25 2.75 12.6904 2.75 12Z" fill={color}/>
66+
</Svg>
67+
)
68+
}
69+
70+
function BulkRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
71+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
72+
<Path fillRule="evenodd" clipRule="evenodd" d="M12 2.75C12.6904 2.75 13.25 3.30964 13.25 4V20C13.25 20.6904 12.6904 21.25 12 21.25C11.3096 21.25 10.75 20.6904 10.75 20V4C10.75 3.30964 11.3096 2.75 12 2.75Z" fill={color}/>
73+
<Path opacity="0.4" fillRule="evenodd" clipRule="evenodd" d="M2.75 12C2.75 11.3096 3.30964 10.75 4 10.75H20C20.6904 10.75 21.25 11.3096 21.25 12C21.25 12.6904 20.6904 13.25 20 13.25H4C3.30964 13.25 2.75 12.6904 2.75 12Z" fill={color}/>
74+
</Svg>
75+
)
76+
}
77+
78+
function StrokeSharp({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
79+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
80+
<Path d="M12 4V20" stroke={color} strokeWidth={strokeWidth} strokeLinejoin="round"/>
81+
<Path d="M4 12H20" stroke={color} strokeWidth={strokeWidth} strokeLinejoin="round"/>
82+
</Svg>
83+
)
84+
}
85+
86+
function SolidSharp({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
87+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
88+
<Path d="M10.75 13.25V20H13.25V13.25H20V10.75H13.25V4H10.75V10.75H4V13.25H10.75Z" fill={color}/>
89+
</Svg>
90+
)
91+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
2+
import React from 'react'
3+
import Svg, { Circle, ClipPath, Defs, Ellipse, G, Line, LinearGradient, Mask, Path, Polygon, Polyline, RadialGradient, Rect, Stop } from 'react-native-svg'
4+
import { Variant, IconProps, defaultStrokeWidth, defaultVariant, defaultColor, defaultSize } from './constants'
5+
6+
const iconMap: Record<Variant, React.FC<IconProps>> = {
7+
'stroke-rounded': StrokeRounded,
8+
'stroke-standard': StrokeStandard,
9+
'solid-standard': SolidStandard,
10+
'duotone-rounded': DuotoneRounded,
11+
'twotone-rounded': TwotoneRounded,
12+
'solid-rounded': SolidRounded,
13+
'bulk-rounded': BulkRounded,
14+
'stroke-sharp': StrokeSharp,
15+
'solid-sharp': SolidSharp,
16+
}
17+
18+
export default function DashboardSpeed02Icon({ variant, ...rest }: IconProps) {
19+
const Component = iconMap[variant || defaultVariant]
20+
return <Component {...rest} />
21+
}
22+
23+
function StrokeRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
24+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
25+
<Circle cx="12" cy="18" r="3" stroke={color} strokeWidth={strokeWidth}/>
26+
<Path d="M12 15V10" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round"/>
27+
<Path d="M22 13C22 7.47715 17.5228 3 12 3C6.47715 3 2 7.47715 2 13" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round"/>
28+
</Svg>
29+
)
30+
}
31+
32+
function StrokeStandard({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
33+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
34+
<Circle cx="12" cy="18" r="3" stroke={color} strokeWidth={strokeWidth}/>
35+
<Path d="M12 15V10" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
36+
<Path d="M22 13C22 7.47715 17.5228 3 12 3C6.47715 3 2 7.47715 2 13" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"/>
37+
</Svg>
38+
)
39+
}
40+
41+
function SolidStandard({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
42+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
43+
<Path d="M13 10.5C13 9.94772 12.5523 9.5 12 9.5C11.4477 9.5 11 9.94772 11 10.5V15.6707C9.83481 16.0825 9 17.1938 9 18.5C9 20.1569 10.3431 21.5 12 21.5C13.6569 21.5 15 20.1569 15 18.5C15 17.1938 14.1652 16.0825 13 15.6707V10.5Z" fill={color}/>
44+
<Path fillRule="evenodd" clipRule="evenodd" d="M12 4.5C7.02944 4.5 3 8.52944 3 13.5C3 14.0523 2.55228 14.5 2 14.5C1.44772 14.5 1 14.0523 1 13.5C1 7.42487 5.92487 2.5 12 2.5C18.0751 2.5 23 7.42487 23 13.5C23 14.0523 22.5523 14.5 22 14.5C21.4477 14.5 21 14.0523 21 13.5C21 8.52944 16.9706 4.5 12 4.5Z" fill={color}/>
45+
</Svg>
46+
)
47+
}
48+
49+
function DuotoneRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
50+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
51+
<Circle opacity="0.4" cx="12" cy="18" r="3" fill={color}/>
52+
<Circle cx="12" cy="18" r="3" stroke={color} strokeWidth={strokeWidth}/>
53+
<Path d="M12 15V10" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round"/>
54+
<Path d="M22 13C22 7.47715 17.5228 3 12 3C6.47715 3 2 7.47715 2 13" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round"/>
55+
</Svg>
56+
)
57+
}
58+
59+
function TwotoneRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
60+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
61+
<Path opacity="0.4" d="M12 15C10.3431 15 9 16.3431 9 18C9 19.6569 10.3431 21 12 21C13.6569 21 15 19.6569 15 18C15 16.3431 13.6569 15 12 15ZM12 15V10" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round"/>
62+
<Path d="M22 13C22 7.47715 17.5228 3 12 3C6.47715 3 2 7.47715 2 13" stroke={color} strokeWidth={strokeWidth} strokeLinecap="round"/>
63+
</Svg>
64+
)
65+
}
66+
67+
function SolidRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
68+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
69+
<Path d="M13 10C13 9.44772 12.5523 9 12 9C11.4477 9 11 9.44772 11 10V15.1707C9.83481 15.5825 9 16.6938 9 18C9 19.6569 10.3431 21 12 21C13.6569 21 15 19.6569 15 18C15 16.6938 14.1652 15.5825 13 15.1707V10Z" fill={color}/>
70+
<Path fillRule="evenodd" clipRule="evenodd" d="M12 5C7.58172 5 4 8.58172 4 13C4 13.5523 3.55228 14 3 14C2.44772 14 2 13.5523 2 13C2 7.47715 6.47715 3 12 3C17.5228 3 22 7.47715 22 13C22 13.5523 21.5523 14 21 14C20.4477 14 20 13.5523 20 13C20 8.58172 16.4183 5 12 5Z" fill={color}/>
71+
</Svg>
72+
)
73+
}
74+
75+
function BulkRounded({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
76+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
77+
<Path opacity="0.4" d="M13 10C13 9.44772 12.5523 9 12 9C11.4477 9 11 9.44772 11 10V15.1707C9.83481 15.5825 9 16.6938 9 18C9 19.6569 10.3431 21 12 21C13.6569 21 15 19.6569 15 18C15 16.6938 14.1652 15.5825 13 15.1707V10Z" fill={color}/>
78+
<Path fillRule="evenodd" clipRule="evenodd" d="M12 5C7.58172 5 4 8.58172 4 13C4 13.5523 3.55228 14 3 14C2.44772 14 2 13.5523 2 13C2 7.47715 6.47715 3 12 3C17.5228 3 22 7.47715 22 13C22 13.5523 21.5523 14 21 14C20.4477 14 20 13.5523 20 13C20 8.58172 16.4183 5 12 5Z" fill={color}/>
79+
</Svg>
80+
)
81+
}
82+
83+
function StrokeSharp({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
84+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
85+
<Circle cx="12" cy="17" r="3" stroke={color} strokeWidth={strokeWidth}/>
86+
<Path d="M12 14V8" stroke={color} strokeWidth={strokeWidth}/>
87+
<Path d="M22 14C22 8.47715 17.5228 4 12 4C6.47715 4 2 8.47715 2 14" stroke={color} strokeWidth={strokeWidth}/>
88+
</Svg>
89+
)
90+
}
91+
92+
function SolidSharp({ size = defaultSize, color = defaultColor, strokeWidth = defaultStrokeWidth, className, style }: IconProps) {
93+
return (<Svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24" fill="none">
94+
<Path d="M8.25 17C8.25 14.9289 9.92893 13.25 12 13.25C14.0711 13.25 15.75 14.9289 15.75 17C15.75 19.0711 14.0711 20.75 12 20.75C9.92893 20.75 8.25 19.0711 8.25 17Z" fill={color}/>
95+
<Path fillRule="evenodd" clipRule="evenodd" d="M13 8V14H11V8H13Z" fill={color}/>
96+
<Path fillRule="evenodd" clipRule="evenodd" d="M12 5.20455C7.1424 5.20455 3.20455 9.1424 3.20455 14H1.25C1.25 8.06294 6.06294 3.25 12 3.25C17.9371 3.25 22.75 8.06294 22.75 14H20.7955C20.7955 9.1424 16.8576 5.20455 12 5.20455Z" fill={color}/>
97+
</Svg>
98+
)
99+
}

0 commit comments

Comments
 (0)