Update iconoir-react to v2.0.0

- Add CHANGELOG for better visibility of changes
- Update README to reflect changes made in update
- Update version in package.json and package-lock.json
This commit is contained in:
Daniel Martin 2021-06-01 22:46:34 +01:00
parent a1b3f9a23c
commit 9565207e23
4 changed files with 56 additions and 29 deletions

View file

@ -0,0 +1,38 @@
# Changelog
All notable changes to the [iconoir-react](https://www.npmjs.com/package/iconoir-react)
npm package will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.0.0] - 2021-06-01
A massive thank you to [@paescuj](https://github.com/paescuj) for making all of the changes
for this update.
### Added
- All default SVG properties are now valid component props.
### Changed
- Updated `iconoir-react` to use iconoir `v4.3.1`.
- `Cell4x4` component changed to `Cell4X4`.
- `Display4k` component changed to `Display4K`.
- `Medal1st` component changed to `Medal1St`.
### Removed
- `size` prop has been removed. Instead, the `height` and `width` props should be used
to fit in line with native SVG properties.
- `Icon` type has been removed due to type autogeneration from using `tsup`.
- `IconProps` type has been removed due to type autogeneration from using `tsup`.
## [1.1.0] - 2021-05-22
### Changed
- Updated `iconoir-react` to use iconoir `v4.3.0`.
## [1.0.0] - 2021-05-19
### Added
- Initial release of `iconoir-react` to npm. Based on iconoir `v4.2.2`.

View file

@ -7,7 +7,7 @@ Iconoir is an open source library with 900+ SVG Icons. No premium icons, no emai
`iconoir-react` is an open source package that exports these icons as React.js components that can be used in all of your React projects.
**Based on Iconoir Icons ```v4.3.0```.**
**Based on Iconoir Icons ```v4.3.1```.**
### Installation
@ -32,11 +32,20 @@ const App = () => {
export default App;
```
Icons can take the optional props `color: string` and `size: string | number`, e.g.
Icons can take any standard SVG properties as optional props, e.g.
```javascript
<Iconoir color="red" size={36} />
<Iconoir color="red" height={36} width={36} />
```
The default color is `"currentColor"` and the default size is `24`.
Default values for the most common props are given below:
| Prop name | Default value |
|-------------|----------------|
| color | "currentColor" |
| width | "1.5em" |
| height | "1.5em" |
| strokeWidth | 1.5 |
| fill | "none" |
### Icon names
@ -44,32 +53,12 @@ For the most part, the React components are named as PascalCase variations of th
| Iconoir Name | React Component |
|------------------|-----------------|
| `1st-medal` | `Medal1st` |
| `4k-display` | `Display4k` |
| `4x4-cell` | `Cell4x4` |
| `1st-medal` | `Medal1St` |
| `4k-display` | `Display4K` |
| `4x4-cell` | `Cell4X4` |
| `github` | `GitHub` |
| `github-outline` | `GitHubOutline` |
| `gitlab-full` | `GitLabFull` |
| `linkedin` | `LinkedIn` |
| `tiktok` | `TikTok` |
| `youtube` | `YouTube` |
### TypeScript
The types `Icon` and `IconProps` are provided by default within the package. If you are using TypeScript, you can just import them from the `iconoir-react` package.
```typescript
import React from 'react';
import { Iconoir, IconProps } from 'iconoir-react';
const App: React.FC<{}> = () => {
const props: IconProps = {
color: 'green',
size: 12,
};
return <Iconoir {...props} />
};
export default App;
```

View file

@ -1,6 +1,6 @@
{
"name": "iconoir-react",
"version": "1.1.0",
"version": "2.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "iconoir-react",
"version": "1.1.0",
"version": "2.0.0",
"description": "React library for Iconoir icon set",
"main": "dist/index.js",
"module": "dist/esm/index.js",