Skip to content

Commit 2d0349a

Browse files
committed
update to 0.1.6v
1 parent b460c88 commit 2d0349a

File tree

8 files changed

+24
-14
lines changed

8 files changed

+24
-14
lines changed

.gitmodules

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "src/icons/bx-icons"]
22
path = src/icons/bx-icons
33
url = https://github.com/bx-design/bx-icons.git
4+
branch = main

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bx-design/react-icons",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"repository": "[email protected]:bx-design/react-icons.git",
55
"author": "BX Creative Studio",
66
"license": "MIT",
@@ -76,5 +76,9 @@
7676
"react-dom": {
7777
"optional": true
7878
}
79+
},
80+
"dependencies": {
81+
"@types/classnames": "^2.2.11",
82+
"classnames": "^2.2.6"
7983
}
8084
}

src/__tests__/__snapshots__/index.spec.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports[`BxIcons render BxIcons component 1`] = `
1111
>
1212
<path
1313
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"
1515
fill="currentColor"
1616
fill-rule="inherit"
1717
/>
@@ -30,7 +30,7 @@ exports[`BxIcons render BxIcons with more props 1`] = `
3030
>
3131
<path
3232
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"
3434
fill="currentColor"
3535
fill-rule="inherit"
3636
/>

src/__tests__/index.spec.tsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
import { render, screen } from '@testing-library/react'
22
import BxIcons from '../'
3-
import type { BxIconsProps } from '../types'
4-
5-
const customRender = (props: BxIconsProps) => {
6-
return render(<BxIcons {...props} />)
7-
}
83

94
describe('BxIcons', () => {
105
test('render BxIcons component', () => {
11-
customRender({ icon: 'back' })
6+
render(<BxIcons icon='back' />)
127
const component = screen.getByTestId('iconBase')
138
expect(component).toBeInTheDocument()
149
expect(component).toMatchSnapshot()
1510
})
1611

1712
test('render BxIcons with more props', () => {
18-
customRender({ icon: 'back', color: 'red', size: '30' })
13+
render(<BxIcons icon='back' color='red' size='30' />)
1914
const component = screen.getByTestId('iconBase')
2015
expect(component).toBeInTheDocument()
2116
expect(component.getAttribute('width')).toBe('30')

src/icons/bx-icons

Submodule bx-icons updated 130 files

src/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import IconBase from './icon-base'
44
import type { BxIconsProps } from './types'
55

66
const BxIcons: FC<BxIconsProps> = ({ icon, size, color }) => {
7-
const filteredIcon = iconList.find((ico) => ico.name === icon)
7+
const filteredIcon = iconList[icon]
88

99
return (
1010
<IconBase size={size} color={color}>

src/types.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { IconList } from './icons/bx-icons/src/types'
1+
import type { IconsNamesListType } from './icons/bx-icons/src/types'
22

33
export type BxIconsProps = {
4-
icon: IconList
4+
icon: IconsNamesListType
55
size?: string
66
color?: string
77
}

yarn.lock

+10
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,11 @@
632632
dependencies:
633633
"@babel/types" "^7.3.0"
634634

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+
635640
"@types/graceful-fs@^4.1.2":
636641
version "4.1.5"
637642
resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15"
@@ -1314,6 +1319,11 @@ class-utils@^0.3.5:
13141319
isobject "^3.0.0"
13151320
static-extend "^0.1.1"
13161321

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+
13171327
clean-stack@^2.0.0:
13181328
version "2.2.0"
13191329
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"

0 commit comments

Comments
 (0)