File tree 3 files changed +31
-4
lines changed
3 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @near-pagoda/ui" ,
3
- "version" : " 3.1.10 " ,
3
+ "version" : " 3.1.11 " ,
4
4
"description" : " A React component library that implements the official NEAR design system." ,
5
5
"license" : " MIT" ,
6
6
"repository" : {
Original file line number Diff line number Diff line change 1
1
.imageIcon {
2
- border-radius : 100% ;
3
2
overflow : hidden ;
4
3
flex-shrink : 0 ;
5
4
background : #fff ;
13
12
width : 100% ;
14
13
height : 100% ;
15
14
object-fit : cover ;
16
- fill : #000 !important ;
17
- stroke : #000 !important ;
15
+ }
16
+
17
+ & [data-rounded = ' true' ] {
18
+ border-radius : 100% ;
19
+ }
20
+
21
+ & [data-transparent = ' true' ] {
22
+ background : transparent ;
23
+ }
24
+
25
+ & :not ([data-transparent = ' true' ]) {
26
+ svg {
27
+ fill : #000 !important ;
28
+ stroke : #000 !important ;
29
+ }
18
30
}
19
31
20
32
& [data-size = ' 2xs' ] {
68
80
transform : scale (1.15 , 1.15 );
69
81
}
70
82
}
83
+
84
+ & [data-no-padding = ' true' ] {
85
+ padding : 0 !important ;
86
+ }
71
87
}
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ type Props = {
8
8
className ?: string ;
9
9
fallbackIcon ?: ReactNode ;
10
10
indicateParentClickable ?: boolean ;
11
+ padding ?: boolean ;
12
+ paddingFallbackIcon ?: boolean ;
13
+ rounded ?: boolean ;
14
+ transparent ?: boolean ;
11
15
size ?: ThemeIconSize ;
12
16
src : string | undefined ;
13
17
style ?: CSSProperties ;
@@ -18,6 +22,10 @@ export const ImageIcon = ({
18
22
className = '' ,
19
23
fallbackIcon,
20
24
indicateParentClickable,
25
+ padding = true ,
26
+ paddingFallbackIcon = true ,
27
+ rounded = true ,
28
+ transparent,
21
29
size = 'm' ,
22
30
src,
23
31
...props
@@ -27,6 +35,9 @@ export const ImageIcon = ({
27
35
className = { `${ s . imageIcon } ${ className } image-icon` }
28
36
data-parent-clickable = { indicateParentClickable }
29
37
data-size = { size }
38
+ data-no-padding = { ( ! padding && ! ! src ) || ( ! paddingFallbackIcon && ! src ) }
39
+ data-rounded = { rounded }
40
+ data-transparent = { transparent }
30
41
{ ...props }
31
42
>
32
43
{ src ? < img src = { src } alt = { alt } /> : fallbackIcon }
You can’t perform that action at this time.
0 commit comments