File tree 8 files changed +24
-14
lines changed
8 files changed +24
-14
lines changed Original file line number Diff line number Diff line change 1
1
[submodule "src/icons/bx-icons "]
2
2
path = src/icons/bx-icons
3
3
url = https://github.com/bx-design/bx-icons.git
4
+ branch = main
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @bx-design/react-icons" ,
3
- "version" : " 0.1.5 " ,
3
+ "version" : " 0.1.6 " ,
4
4
"repository" :
" [email protected] :bx-design/react-icons.git" ,
5
5
"author" : " BX Creative Studio" ,
6
6
"license" : " MIT" ,
76
76
"react-dom" : {
77
77
"optional" : true
78
78
}
79
+ },
80
+ "dependencies" : {
81
+ "@types/classnames" : " ^2.2.11" ,
82
+ "classnames" : " ^2.2.6"
79
83
}
80
84
}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ exports[`BxIcons render BxIcons component 1`] = `
11
11
>
12
12
<path
13
13
clip-rule = " inherit"
14
- d = " M13.524 4.949H4.301l2.42 -2.404a.887.887 0 00-.03 -1.295.998.998 0 00-1.35.028L1.269 5.31a.88.88 0 00.01 1.276L5.34 10.45a.999.999 0 001.36 0 .88.88 0 000-1.295L4.204 6.78h9.33c4.17 0 7.561 3.227 7.561 7.194 0 3.968 -3.392 7.195-7.561 7.195h -3.402c-.534 0-.962.407-.962.915 0 .51.428.916.962.916h3.392C18.753 23 23 18.95 23 13.984c.01 -4.985-4.247-9.035-9.476-9.035z "
14
+ d = " M13.386 5.59H5l2.2 -2.186a.807.807 0 00-.027 -1.177.907.907 0 00-1.228.025L2.244 5.918a.801.801 0 00.009 1.16l3.693 3.514a.908.908 0 001.237 0 .8.8 0 000-1.177l-2.27-2.16h8.481c3.79 0 6.874 2.933 6.874 6.54 0 3.606 -3.083 6.54-6.874 6.54h -3.092c-.486 0-.875.37-.875.833 0 .462.389.832.875.832h3.084C18.139 22 22 18.318 22 13.803c.009 -4.53-3.861-8.213-8.614-8.213z "
15
15
fill = " currentColor"
16
16
fill-rule = " inherit"
17
17
/>
@@ -30,7 +30,7 @@ exports[`BxIcons render BxIcons with more props 1`] = `
30
30
>
31
31
<path
32
32
clip-rule = " inherit"
33
- d = " M13.524 4.949H4.301l2.42 -2.404a.887.887 0 00-.03 -1.295.998.998 0 00-1.35.028L1.269 5.31a.88.88 0 00.01 1.276L5.34 10.45a.999.999 0 001.36 0 .88.88 0 000-1.295L4.204 6.78h9.33c4.17 0 7.561 3.227 7.561 7.194 0 3.968 -3.392 7.195-7.561 7.195h -3.402c-.534 0-.962.407-.962.915 0 .51.428.916.962.916h3.392C18.753 23 23 18.95 23 13.984c.01 -4.985-4.247-9.035-9.476-9.035z "
33
+ d = " M13.386 5.59H5l2.2 -2.186a.807.807 0 00-.027 -1.177.907.907 0 00-1.228.025L2.244 5.918a.801.801 0 00.009 1.16l3.693 3.514a.908.908 0 001.237 0 .8.8 0 000-1.177l-2.27-2.16h8.481c3.79 0 6.874 2.933 6.874 6.54 0 3.606 -3.083 6.54-6.874 6.54h -3.092c-.486 0-.875.37-.875.833 0 .462.389.832.875.832h3.084C18.139 22 22 18.318 22 13.803c.009 -4.53-3.861-8.213-8.614-8.213z "
34
34
fill = " currentColor"
35
35
fill-rule = " inherit"
36
36
/>
Original file line number Diff line number Diff line change 1
1
import { render , screen } from '@testing-library/react'
2
2
import BxIcons from '../'
3
- import type { BxIconsProps } from '../types'
4
-
5
- const customRender = ( props : BxIconsProps ) => {
6
- return render ( < BxIcons { ...props } /> )
7
- }
8
3
9
4
describe ( 'BxIcons' , ( ) => {
10
5
test ( 'render BxIcons component' , ( ) => {
11
- customRender ( { icon : 'back' } )
6
+ render ( < BxIcons icon = 'back' /> )
12
7
const component = screen . getByTestId ( 'iconBase' )
13
8
expect ( component ) . toBeInTheDocument ( )
14
9
expect ( component ) . toMatchSnapshot ( )
15
10
} )
16
11
17
12
test ( 'render BxIcons with more props' , ( ) => {
18
- customRender ( { icon : 'back' , color : 'red' , size : '30' } )
13
+ render ( < BxIcons icon = 'back' color = 'red' size = '30' /> )
19
14
const component = screen . getByTestId ( 'iconBase' )
20
15
expect ( component ) . toBeInTheDocument ( )
21
16
expect ( component . getAttribute ( 'width' ) ) . toBe ( '30' )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import IconBase from './icon-base'
4
4
import type { BxIconsProps } from './types'
5
5
6
6
const BxIcons : FC < BxIconsProps > = ( { icon, size, color } ) => {
7
- const filteredIcon = iconList . find ( ( ico ) => ico . name === icon )
7
+ const filteredIcon = iconList [ icon ]
8
8
9
9
return (
10
10
< IconBase size = { size } color = { color } >
Original file line number Diff line number Diff line change 1
- import type { IconList } from './icons/bx-icons/src/types'
1
+ import type { IconsNamesListType } from './icons/bx-icons/src/types'
2
2
3
3
export type BxIconsProps = {
4
- icon : IconList
4
+ icon : IconsNamesListType
5
5
size ?: string
6
6
color ?: string
7
7
}
Original file line number Diff line number Diff line change 632
632
dependencies :
633
633
" @babel/types" " ^7.3.0"
634
634
635
+ " @types/classnames@^2.2.11 " :
636
+ version "2.2.11"
637
+ resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.11.tgz#2521cc86f69d15c5b90664e4829d84566052c1cf"
638
+ integrity sha512-2koNhpWm3DgWRp5tpkiJ8JGc1xTn2q0l+jUNUE7oMKXUf5NpI9AIdC4kbjGNFBdHtcxBD18LAksoudAVhFKCjw==
639
+
635
640
" @types/graceful-fs@^4.1.2 " :
636
641
version "4.1.5"
637
642
resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15"
@@ -1314,6 +1319,11 @@ class-utils@^0.3.5:
1314
1319
isobject "^3.0.0"
1315
1320
static-extend "^0.1.1"
1316
1321
1322
+ classnames@^2.2.6 :
1323
+ version "2.2.6"
1324
+ resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
1325
+ integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
1326
+
1317
1327
clean-stack@^2.0.0 :
1318
1328
version "2.2.0"
1319
1329
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
You can’t perform that action at this time.
0 commit comments