Compare commits
114 Commits
Author | SHA1 | Date | |
---|---|---|---|
e5d9dffac4 | |||
eced6f7414 | |||
f949102033 | |||
61803f2129 | |||
8aec53b331 | |||
156c0919c9 | |||
179b482c03 | |||
a23698d5be | |||
fb057f1f94 | |||
21bb9fe6d6 | |||
c63f478ff5 | |||
b424fa779d | |||
01698dea84 | |||
ae8e149850 | |||
9f49fd9560 | |||
742f452232 | |||
962870d51c | |||
ba1b12a712 | |||
5045ec3b78 | |||
0d65b5761b | |||
fcf9aec131 | |||
2ee03d261c | |||
dc3c0cc47e | |||
d5ba74d93b | |||
9b157b399d | |||
c978b1cb4e | |||
bd129d9dcf | |||
90133ea33e | |||
1a210808c5 | |||
400f34afc2 | |||
1da9dd43b2 | |||
6e7693e6da | |||
32810336ec | |||
e374f72cb6 | |||
28e74c6e2b | |||
3183ae1ef6 | |||
703b1a7882 | |||
9dffc53b3a | |||
741ac5632c | |||
ad3c8a94d0 | |||
76f29d8565 | |||
23b17b9c55 | |||
1d3283d81d | |||
5031cacbdd | |||
894dcfd6a6 | |||
765985a5e3 | |||
87f272275a | |||
17fb9c99a9 | |||
9167bfc36d | |||
fb0ae8054e | |||
d2369242f1 | |||
d33cb6ecf9 | |||
b22f3b4515 | |||
94531bbe7c | |||
a3527829b8 | |||
e697b3a927 | |||
920bd45776 | |||
cbd3c6184b | |||
93dd65f8c5 | |||
031f305c83 | |||
1180d2d8b4 | |||
3422f0aaf7 | |||
b3655c438f | |||
5a8a8b7d93 | |||
ba33c8312e | |||
b157434645 | |||
6adadf4319 | |||
7ea765f04f | |||
2dbe78fc02 | |||
0dce8a8fb9 | |||
ed0e08a451 | |||
b5331a253d | |||
ada2681ad4 | |||
c7d417e19b | |||
6999eeba10 | |||
9e681f8f89 | |||
1f5bb6e1dc | |||
fbdff6452c | |||
1f87e256b6 | |||
5596f66525 | |||
1d3807c005 | |||
a7fe66e4b4 | |||
c85cb6556b | |||
3ad661ecae | |||
4ae3fa8093 | |||
e3a3cd6727 | |||
73111225b0 | |||
d5e7e14e5b | |||
a29480d769 | |||
84b8428ee9 | |||
f6984951a9 | |||
e70ae51980 | |||
dd9a0b0fe1 | |||
44d6501a8a | |||
483a3f1738 | |||
827d2be993 | |||
58c2ec781f | |||
4ba17e488b | |||
d79db8d1e8 | |||
c908b6ab31 | |||
1014f53d2a | |||
1f7216a6c7 | |||
5df24f02b7 | |||
f527932e2b | |||
8161cd71b5 | |||
1af2cf5a73 | |||
eb8e3d6e30 | |||
c847a2b195 | |||
9d3a802eb2 | |||
10a1b217ef | |||
080d5b4187 | |||
f329a1ef64 | |||
b817fe2605 | |||
ef4f52918b |
13
.babelrc
@ -1,4 +1,13 @@
|
||||
{
|
||||
"presets": ["es2015"],
|
||||
"plugins": ["transform-object-rest-spread"]
|
||||
"presets": [
|
||||
[
|
||||
"env",
|
||||
{
|
||||
"targets": {
|
||||
"browsers": ["last 2 versions"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"stage-2"
|
||||
]
|
||||
}
|
||||
|
@ -1 +1,2 @@
|
||||
dist
|
||||
coverage
|
10
.github/ISSUE_TEMPLATE.md
vendored
@ -1,10 +0,0 @@
|
||||
<!--
|
||||
If you'd like to request an icon, please provide the following information:
|
||||
- icon name
|
||||
- at least one use case
|
||||
- screenshots of similar icons
|
||||
|
||||
Please create one issue for each icon request.
|
||||
-->
|
||||
|
||||
|
67
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
---
|
||||
|
||||
<!--
|
||||
Before reporting an issue, please search to see if someone has filed a similar issue before. If there is already an open issue, please add a 👍 and/or leave a comment with additional information.
|
||||
-->
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* Version:
|
||||
* Are you running from source/master:
|
||||
* Are you using a released build:
|
||||
* Operating system:
|
||||
* Bits:
|
||||
|
||||
## Step to reproduce
|
||||
|
||||
*(Type here)*
|
||||
|
||||
### Actual behavior
|
||||
|
||||
## Any message or error
|
||||
|
||||
*(Type here)*
|
||||
|
||||
## Resources
|
||||
|
||||
* Links
|
||||
* Screenshots
|
||||
|
||||
|
||||
Here is what a great bug report would look like:
|
||||
|
||||
```
|
||||
## Prerequisites
|
||||
|
||||
Version: Release v3.1.0
|
||||
Running from: Import using webpack
|
||||
Operating system: Mac OSX
|
||||
Bits: 64 bits
|
||||
|
||||
## Step to reproduce
|
||||
|
||||
- Import `check` icon
|
||||
- Add to a React component/view
|
||||
- Run the react app
|
||||
- Notice that the `check` isn't rendering correctly which seems a encoding problem
|
||||
|
||||
### Actual behavior:
|
||||
|
||||
- Import `check` icon
|
||||
- Add to a React component/view
|
||||
- Run the react app
|
||||
- Check is displayed with correct encoding (e.g UTF-8)
|
||||
|
||||
## Any message or error
|
||||
|
||||
No console output
|
||||
...
|
||||
|
||||
## Resources
|
||||
|
||||
No resources
|
||||
...
|
||||
```
|
14
.github/ISSUE_TEMPLATE/icon_request.md
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
name: Icon request
|
||||
about: Suggest an new icon for this project
|
||||
---
|
||||
|
||||
<!--
|
||||
Before creating an icon request, please search to see if someone has requested the icon already. If there is an open request, please add a 👍.
|
||||
-->
|
||||
|
||||
## Icon Request
|
||||
|
||||
* Icon name:
|
||||
* Use case:
|
||||
* Screenshots of similar icons:
|
1
.gitignore
vendored
@ -3,3 +3,4 @@ node_modules
|
||||
dist
|
||||
sandbox
|
||||
stash
|
||||
coverage
|
10
.travis.yml
@ -8,6 +8,12 @@ node_js: 8
|
||||
before_script:
|
||||
- npm prune
|
||||
script:
|
||||
- npm start
|
||||
- npm run all
|
||||
after_success:
|
||||
- npm run semantic-release
|
||||
- npx codecov
|
||||
- npx babel-node ./bin/sync-algolia.js
|
||||
deploy:
|
||||
provider: script
|
||||
skip_cleanup: true
|
||||
script:
|
||||
- npx semantic-release
|
||||
|
@ -37,24 +37,36 @@ When creating a new issue make sure to include the following:
|
||||
- A screenshot of any visual bug.
|
||||
|
||||
Here is what a great bug report would look like:
|
||||
|
||||
```
|
||||
Check not rendering properly
|
||||
## Prerequisites
|
||||
|
||||
Version: Release v3.1.0
|
||||
Downloaded from: Import using webpack
|
||||
OS: Mac OSX
|
||||
Running from: Import using webpack
|
||||
Operating system: Mac OSX
|
||||
Bits: 64 bits
|
||||
|
||||
## Step to reproduce
|
||||
|
||||
How to reproduce:
|
||||
- Import `check` icon
|
||||
- Add to a React component/view
|
||||
- Run the react app
|
||||
- Notice that the `check` isn't rendering correctly which seems a encoding problem
|
||||
Actual result:
|
||||
|
||||
### Actual behavior:
|
||||
|
||||
- Import `check` icon
|
||||
- Add to a React component/view
|
||||
- Run the react app
|
||||
- Check is displayed with correct encoding (e.g UTF-8)
|
||||
|
||||
## Any message or error
|
||||
|
||||
No console output
|
||||
...
|
||||
|
||||
## Resources
|
||||
|
||||
No resources
|
||||
...
|
||||
```
|
||||
|
114
README.md
@ -1,9 +1,11 @@
|
||||
# Feather
|
||||
|
||||
[](https://travis-ci.org/feathericons/feather)
|
||||
[](https://npm-stat.com/charts.html?package=feather-icons&from=2017-06-01)
|
||||
[](https://travis-ci.org/feathericons/feather)
|
||||
[](https://codecov.io/gh/feathericons/feather)
|
||||
[](https://www.npmjs.com/package/feather-icons)
|
||||
[](https://www.npmjs.com/package/feather-icons)
|
||||
[](https://cdnjs.com/libraries/feather-icons)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=G6CPFZ6PQRZW8&lc=US&item_name=Feather&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
|
||||
|
||||
## What is Feather?
|
||||
|
||||
@ -11,7 +13,7 @@ Feather is a collection of simply beautiful open source icons. Each icon is desi
|
||||
|
||||
https://feathericons.com
|
||||
|
||||
```sh
|
||||
```shell
|
||||
npm install feather-icons
|
||||
```
|
||||
|
||||
@ -25,13 +27,14 @@ npm install feather-icons
|
||||
|
||||
* [Quick Start](#quick-start)
|
||||
* [Usage](#usage)
|
||||
* [Client-side](#client-side)
|
||||
* [Client-side JavaScript](#client-side-javascript)
|
||||
* [Node](#node)
|
||||
* [SVG Sprite](#svg-sprite)
|
||||
* [API Reference](#api-reference)
|
||||
* [`feather.icons`](#feathericons)
|
||||
* [`feather.icons[name].toSvg()`](#feathericonsnametosvgattrs)
|
||||
* [`feather.replace()`](#featherreplaceattrs)
|
||||
* [[Deprecated] `feather.toSvg()`](#deprecated-feathertosvgname-attrs)
|
||||
* [(DEPRECATED) `feather.toSvg()`](#deprecated-feathertosvgname-attrs)
|
||||
* [Roadmap](#roadmap)
|
||||
* [Contributing](#contributing)
|
||||
* [Related Projects](#related-projects)
|
||||
@ -47,7 +50,7 @@ Or copy and paste the following code snippet into a blank `html` file.
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<title></title>
|
||||
<script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script>
|
||||
<script src="https://unpkg.com/feather-icons"></script>
|
||||
<body>
|
||||
|
||||
<!-- example icon -->
|
||||
@ -66,7 +69,7 @@ At its core, Feather is a collection of [SVG](https://svgontheweb.com/#svg) file
|
||||
|
||||
The following are additional ways you can use Feather.
|
||||
|
||||
### Client-side
|
||||
### Client-side JavaScript
|
||||
|
||||
#### 1. Install
|
||||
|
||||
@ -74,7 +77,7 @@ The following are additional ways you can use Feather.
|
||||
|
||||
Install with [npm](https://docs.npmjs.com/getting-started/what-is-npm).
|
||||
|
||||
```
|
||||
```shell
|
||||
npm install feather-icons --save
|
||||
```
|
||||
|
||||
@ -82,25 +85,27 @@ Or just copy [`feather.js`](https://unpkg.com/feather-icons/dist/feather.js) or
|
||||
|
||||
#### 2. Include
|
||||
|
||||
Include `feather.js` or `feather.min.js` with a `<script>` tag. These files are located in the `dist` directory of the npm package.
|
||||
Include `feather.js` or `feather.min.js` with a `<script>` tag:
|
||||
|
||||
```html
|
||||
<script src="path/to/dist/feather.js"></script>
|
||||
```
|
||||
|
||||
Or load the script from a CDN provider.
|
||||
> **Note:** `feather.js` and `feather.min.js` are located in the `dist` directory of the npm package.
|
||||
|
||||
Or load the script from a CDN provider:
|
||||
|
||||
```html
|
||||
<!-- choose one -->
|
||||
<script src="https://unpkg.com/feather-icons"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
||||
<script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script>
|
||||
```
|
||||
|
||||
After including the script, `feather` will be available as a global variable.
|
||||
|
||||
#### 3. Use
|
||||
|
||||
To use an icon on your page, add a `data-feather` attribute with the icon name to an element.
|
||||
To use an icon on your page, add a `data-feather` attribute with the icon name to an element:
|
||||
|
||||
```html
|
||||
<i data-feather="circle"></i>
|
||||
@ -110,7 +115,7 @@ See the complete list of icons at [feathericons.com](https://feathericons.com).
|
||||
|
||||
#### 4. Replace
|
||||
|
||||
Call the `feather.replace()` method.
|
||||
Call the `feather.replace()` method:
|
||||
|
||||
```html
|
||||
<script>
|
||||
@ -123,15 +128,15 @@ All elements that have a `data-feather` attribute will be replaced with SVG mark
|
||||
### Node
|
||||
#### 1. Install
|
||||
|
||||
Install with [npm](https://docs.npmjs.com/getting-started/what-is-npm).
|
||||
Install with [npm](https://docs.npmjs.com/getting-started/what-is-npm):
|
||||
|
||||
```
|
||||
```shell
|
||||
npm install feather-icons --save
|
||||
```
|
||||
|
||||
#### 2. Require
|
||||
|
||||
```javascript
|
||||
```js
|
||||
const feather = require('feather-icons')
|
||||
```
|
||||
|
||||
@ -154,7 +159,8 @@ feather.icons.x
|
||||
// 'stroke-width': 2,
|
||||
// 'stroke-linecap': 'round',
|
||||
// 'stroke-linejoin': 'round',
|
||||
// }
|
||||
// },
|
||||
// toSvg: [Function],
|
||||
// }
|
||||
|
||||
feather.icons.x.toSvg()
|
||||
@ -166,6 +172,60 @@ feather.icons.x.toSvg({ class: 'foo bar', 'stroke-width': 1, color: 'red' })
|
||||
|
||||
See the [API Reference](#api-reference) for more information about the available properties and methods of the `feather` object.
|
||||
|
||||
### SVG Sprite
|
||||
|
||||
#### 1. Install
|
||||
|
||||
> **Note:** If you intend to use Feather with a CDN, you can skip this installation step.
|
||||
|
||||
Install with [npm](https://docs.npmjs.com/getting-started/what-is-npm).
|
||||
|
||||
```shell
|
||||
npm install feather-icons --save
|
||||
```
|
||||
|
||||
Or just copy [`feather-sprite.svg`](https://unpkg.com/feather-icons/dist/feather-sprite.svg) into your project directory.
|
||||
|
||||
#### 2. Use
|
||||
|
||||
Include an icon on your page with the following markup:
|
||||
|
||||
```html
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<use xlink:href="path/to/feather-sprite.svg#circle"/>
|
||||
</svg>
|
||||
```
|
||||
|
||||
> **Note:** `circle` in the above example can be replaced with any valid icon name. See the complete list of icon names at [feathericons.com](https://feathericons.com).
|
||||
|
||||
However, this markup can be simplified using a simple CSS class to avoid repetition of SVG attributes between icons:
|
||||
|
||||
```css
|
||||
.feather {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
stroke: currentColor;
|
||||
stroke-width: 2;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
fill: none;
|
||||
}
|
||||
```
|
||||
|
||||
```html
|
||||
<svg class="feather">
|
||||
<use xlink:href="path/to/dist/feather-sprite.svg#circle"/>
|
||||
</svg>
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
### `feather.icons`
|
||||
@ -191,13 +251,16 @@ feather.icons.x
|
||||
// 'stroke-width': 2,
|
||||
// 'stroke-linecap': 'round',
|
||||
// 'stroke-linejoin': 'round',
|
||||
// }
|
||||
// },
|
||||
// toSvg: [Function],
|
||||
// }
|
||||
|
||||
feather.icons.x.toString()
|
||||
// '<line ... /><line ... />'
|
||||
```
|
||||
|
||||
> **Note:** `x` in the above example can be replaced with any valid icon name. See the complete list of icon names at [feathericons.com](https://feathericons.com). Icons with multi-word names (e.g. `arrow-right`) **cannot** be accessed using dot notation (e.g. `feather.icons.x`). Instead, use bracket notation (e.g. `feather.icons['arrow-right']`).
|
||||
|
||||
[View Source](https://github.com/colebemis/feather/blob/master/src/icons.js)
|
||||
|
||||
---
|
||||
@ -212,9 +275,17 @@ Returns an SVG string.
|
||||
| --------- | ------ | ----------- |
|
||||
| `attrs` (optional) | Object | Key-value pairs in the `attrs` object will be mapped to HTML attributes on the `<svg>` tag (e.g. `{ foo: 'bar' }` maps to `foo="bar"`). All default attributes on the `<svg>` tag can be overridden with the `attrs` object. |
|
||||
|
||||
> **Hint:** You might find these SVG attributes helpful for manipulating icons:
|
||||
> * [`color`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/color)
|
||||
> * [`width`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/width)
|
||||
> * [`height`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/height)
|
||||
> * [`stroke-width`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width)
|
||||
> * [`stroke-linecap`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap)
|
||||
> * [`stroke-linejoin`](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linejoin)
|
||||
|
||||
#### Usage
|
||||
|
||||
```javascript
|
||||
```js
|
||||
feather.icons.circle.toSvg()
|
||||
// '<svg class="feather feather-circle" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle></svg>'
|
||||
|
||||
@ -287,7 +358,7 @@ All attributes on the placeholder element (i.e. `<i>`) will be copied to the `<s
|
||||
|
||||
---
|
||||
|
||||
### [Deprecated] `feather.toSvg(name, [attrs])`
|
||||
### (DEPRECATED) `feather.toSvg(name, [attrs])`
|
||||
|
||||
> **Note:** `feather.toSvg()` is deprecated. Please use `feather.icons[name].toSvg()` instead.
|
||||
|
||||
@ -302,7 +373,7 @@ Returns an SVG string.
|
||||
|
||||
#### Usage
|
||||
|
||||
```javascript
|
||||
```js
|
||||
feather.toSvg('circle')
|
||||
// '<svg class="feather feather-circle" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle></svg>'
|
||||
|
||||
@ -318,7 +389,6 @@ feather.toSvg('circle', { class: 'foo bar' })
|
||||
## Roadmap
|
||||
|
||||
- [ ] Write icon design guidelines
|
||||
- [ ] Track code coverage
|
||||
- [ ] Improve SVG accessibility
|
||||
- [ ] Handle usage of custom icons
|
||||
- [ ] Add usage examples
|
||||
|
6
bin/.eslintrc.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"rules": {
|
||||
"import/no-extraneous-dependencies": "off",
|
||||
"no-console": "off"
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`builds sprite correctly 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\"><defs><symbol id=\\"icon1\\" viewBox=\\"0 0 24 24\\"><line x1=\\"23\\" y1=\\"1\\" x2=\\"1\\" y2=\\"23\\"></line><line x1=\\"1\\" y1=\\"1\\" x2=\\"23\\" y2=\\"23\\"></line></symbol><symbol id=\\"icon2\\" viewBox=\\"0 0 24 24\\"><circle cx=\\"12\\" cy=\\"12\\" r=\\"11\\"></circle></symbol></defs></svg>"`;
|
12
bin/__tests__/build-sprite-string.test.js
Normal file
@ -0,0 +1,12 @@
|
||||
/* eslint-env jest */
|
||||
import buildSpriteString from '../build-sprite-string';
|
||||
|
||||
const icons = {
|
||||
icon1:
|
||||
'<line x1="23" y1="1" x2="1" y2="23"></line><line x1="1" y1="1" x2="23" y2="23"></line>',
|
||||
icon2: '<circle cx="12" cy="12" r="11"></circle>',
|
||||
};
|
||||
|
||||
test('builds sprite correctly', () => {
|
||||
expect(buildSpriteString(icons)).toMatchSnapshot();
|
||||
});
|
@ -6,7 +6,7 @@ import buildIconsObject from './build-icons-object';
|
||||
const IN_DIR = path.resolve(__dirname, '../icons');
|
||||
const OUT_FILE = path.resolve(__dirname, '../dist/icons.json');
|
||||
|
||||
console.log(`Building ${OUT_FILE}`); // eslint-disable-line no-console
|
||||
console.log(`Building ${OUT_FILE}...`);
|
||||
|
||||
const svgFiles = fs
|
||||
.readdirSync(IN_DIR)
|
||||
|
@ -1,12 +1,11 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import path from 'path';
|
||||
import cheerio from 'cheerio';
|
||||
import { minify } from 'html-minifier';
|
||||
|
||||
/**
|
||||
* Build an object in the format: `{ <name>: <contents> }`.
|
||||
* @param {string[]} svgFiles - A list of file names.
|
||||
* @param {Function} getSvg - A function that returns the contents of an SVG file.
|
||||
* @param {string[]} svgFiles - A list of filenames.
|
||||
* @param {Function} getSvg - A function that returns the contents of an SVG file given a filename.
|
||||
* @returns {Object}
|
||||
*/
|
||||
function buildIconsObject(svgFiles, getSvg) {
|
||||
@ -26,6 +25,7 @@ function buildIconsObject(svgFiles, getSvg) {
|
||||
/**
|
||||
* Get contents between opening and closing `<svg>` tags.
|
||||
* @param {string} svg
|
||||
* @returns {string}
|
||||
*/
|
||||
function getSvgContents(svg) {
|
||||
const $ = cheerio.load(svg);
|
||||
|
28
bin/build-sprite-string.js
Normal file
@ -0,0 +1,28 @@
|
||||
import DEFAULT_ATTRS from '../src/default-attrs.json';
|
||||
|
||||
/**
|
||||
* Build an SVG sprite string containing SVG symbols.
|
||||
* @param {Object} icons
|
||||
* @returns {string}
|
||||
*/
|
||||
function buildSpriteString(icons) {
|
||||
const symbols = Object.keys(icons)
|
||||
.map(icon => toSvgSymbol(icon, icons[icon]))
|
||||
.join('');
|
||||
|
||||
return `<svg xmlns="${DEFAULT_ATTRS.xmlns}"><defs>${symbols}</defs></svg>`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an SVG symbol string.
|
||||
* @param {string} name - Icon name
|
||||
* @param {string} contents - SVG contents
|
||||
* @returns {string}
|
||||
*/
|
||||
function toSvgSymbol(name, contents) {
|
||||
return `<symbol id="${name}" viewBox="${DEFAULT_ATTRS.viewBox}">${
|
||||
contents
|
||||
}</symbol>`;
|
||||
}
|
||||
|
||||
export default buildSpriteString;
|
10
bin/build-sprite.js
Normal file
@ -0,0 +1,10 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import icons from '../dist/icons.json';
|
||||
import buildSpriteString from './build-sprite-string';
|
||||
|
||||
const OUT_FILE = path.resolve(__dirname, '../dist/feather-sprite.svg');
|
||||
|
||||
console.log(`Building ${OUT_FILE}...`);
|
||||
|
||||
fs.writeFileSync(OUT_FILE, buildSpriteString(icons));
|
@ -4,7 +4,7 @@ import icons from '../src/icons';
|
||||
|
||||
const OUT_DIR = path.resolve(__dirname, '../dist/icons');
|
||||
|
||||
console.log(`Building SVGs in ${OUT_DIR}`); // eslint-disable-line no-console
|
||||
console.log(`Building SVGs in ${OUT_DIR}...`);
|
||||
|
||||
Object.keys(icons).forEach(name => {
|
||||
const svg = icons[name].toSvg();
|
||||
|
25
bin/build.sh
@ -1,14 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
./node_modules/.bin/babel-node bin/process-svgs.js
|
||||
# Process SVG files
|
||||
npx babel-node bin/process-svgs.js
|
||||
|
||||
./node_modules/.bin/rimraf dist
|
||||
# Create dist directory
|
||||
npx rimraf dist
|
||||
mkdir dist
|
||||
./node_modules/.bin/babel-node bin/build-icons-json.js
|
||||
|
||||
./node_modules/.bin/rimraf dist/icons
|
||||
# Build icons.json
|
||||
npx babel-node bin/build-icons-json.js
|
||||
|
||||
# Build SVG sprite
|
||||
npx babel-node bin/build-sprite.js
|
||||
|
||||
# Create dist/icons directory
|
||||
npx rimraf dist/icons
|
||||
mkdir dist/icons
|
||||
./node_modules/.bin/babel-node bin/build-svgs.js
|
||||
|
||||
./node_modules/.bin/webpack --output-filename feather.js
|
||||
./node_modules/.bin/webpack --output-filename feather.min.js -p
|
||||
# Build SVG icons
|
||||
npx babel-node bin/build-svgs.js
|
||||
|
||||
# Build JavaScript library
|
||||
npx webpack --output-filename feather.js --mode development
|
||||
npx webpack --output-filename feather.min.js --mode production
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import Svgo from 'svgo';
|
||||
import cheerio from 'cheerio';
|
||||
import { format } from 'prettier';
|
||||
|
@ -5,7 +5,7 @@ import processSvg from './process-svg';
|
||||
|
||||
const IN_DIR = path.resolve(__dirname, '../icons');
|
||||
|
||||
console.log(`Processing SVGs in ${IN_DIR}`); // eslint-disable-line no-console
|
||||
console.log(`Processing SVGs in ${IN_DIR}...`);
|
||||
|
||||
fs
|
||||
.readdirSync(IN_DIR)
|
||||
|
73
bin/sync-algolia.js
Normal file
@ -0,0 +1,73 @@
|
||||
import algolia from 'algoliasearch';
|
||||
import icons from '../dist/icons.json';
|
||||
import tags from '../src/tags.json';
|
||||
|
||||
const ALGOLIA_APP_ID = '5EEOG744D0';
|
||||
|
||||
if (
|
||||
process.env.TRAVIS_PULL_REQUEST === 'false' &&
|
||||
process.env.TRAVIS_BRANCH === 'master'
|
||||
) {
|
||||
syncAlgolia();
|
||||
} else {
|
||||
console.log('Skipped Algolia sync.');
|
||||
}
|
||||
|
||||
function syncAlgolia() {
|
||||
// ALGOLIA_ADMIN_KEY must be added as an environment variable in Travis CI
|
||||
const client = algolia(ALGOLIA_APP_ID, process.env.ALGOLIA_ADMIN_KEY);
|
||||
|
||||
console.log('Initializing target and temporary indexes...');
|
||||
const index = client.initIndex('icons');
|
||||
const indexTmp = client.initIndex('icons_tmp');
|
||||
|
||||
console.log(
|
||||
"Copying target index's settings, synonyms and rules into temporary index...",
|
||||
);
|
||||
scopedCopyIndex(client, index.indexName, indexTmp.indexName)
|
||||
.then(() => {
|
||||
const objects = Object.keys(icons).map(name => ({
|
||||
name,
|
||||
tags: tags[name] || [],
|
||||
}));
|
||||
|
||||
console.log('Adding objects to the temporary index...');
|
||||
return addObjects(indexTmp, objects);
|
||||
})
|
||||
.then(() => {
|
||||
console.log('Moving temporary index to target index...');
|
||||
return moveIndex(client, indexTmp.indexName, index.indexName);
|
||||
});
|
||||
}
|
||||
|
||||
function scopedCopyIndex(
|
||||
client,
|
||||
indexNameSrc,
|
||||
indexNameDest,
|
||||
scope = ['settings', 'synonyms', 'rules'],
|
||||
) {
|
||||
return new Promise((resolve, reject) => {
|
||||
client.copyIndex(indexNameSrc, indexNameDest, scope, (error, contents) => {
|
||||
if (error) reject(error);
|
||||
resolve(contents);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addObjects(index, objects) {
|
||||
return new Promise((resolve, reject) => {
|
||||
index.addObjects(objects, (error, contents) => {
|
||||
if (error) reject(error);
|
||||
resolve(contents);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function moveIndex(client, indexNameSrc, indexNameDest) {
|
||||
return new Promise((resolve, reject) => {
|
||||
client.moveIndex(indexNameSrc, indexNameDest, (error, contents) => {
|
||||
if (error) reject(error);
|
||||
resolve(contents);
|
||||
});
|
||||
});
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
module.exports = {
|
||||
extends: ['@commitlint/config-angular'],
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
rules: {
|
||||
'subject-case': 'sentence-case',
|
||||
'scope-case': [0],
|
||||
'subject-case': [2, 'always', 'sentence-case'],
|
||||
'header-max-length': [0],
|
||||
},
|
||||
};
|
||||
|
@ -3,20 +3,13 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Feather</title>
|
||||
<!--
|
||||
To build feather.min.js run
|
||||
$ npm run build
|
||||
in the root directory, or use the already built package available on unpkg.com.
|
||||
-->
|
||||
<script src="../dist/feather.min.js"></script>
|
||||
<!-- <script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script> -->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<i data-feather="eye"></i>
|
||||
<i data-feather="heart"></i>
|
||||
<i data-feather="feather"></i>
|
||||
|
||||
<script src="https://unpkg.com/feather-icons"></script>
|
||||
<script>
|
||||
feather.replace()
|
||||
</script>
|
||||
|
15
icons/archive.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<polyline points="21 8 21 21 3 21 3 8" />
|
||||
<rect x="1" y="3" width="22" height="5" />
|
||||
<line x1="10" y1="12" x2="14" y2="12" />
|
||||
</svg>
|
After Width: | Height: | Size: 340 B |
@ -9,6 +9,6 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M22 11.07V12a10 10 0 1 1-5.93-9.14" />
|
||||
<polyline points="23 3 12 14 9 11" />
|
||||
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14" />
|
||||
<polyline points="22 4 12 14.01 9 11.01" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 304 B |
@ -9,6 +9,6 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<polyline points="9 11 12 14 23 3" />
|
||||
<polyline points="9 11 12 14 22 4" />
|
||||
<path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 321 B After Width: | Height: | Size: 321 B |
17
icons/coffee.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M18 8h1a4 4 0 0 1 0 8h-1" />
|
||||
<path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z" />
|
||||
<line x1="6" y1="1" x2="6" y2="4" />
|
||||
<line x1="10" y1="1" x2="10" y2="4" />
|
||||
<line x1="14" y1="1" x2="14" y2="4" />
|
||||
</svg>
|
After Width: | Height: | Size: 427 B |
15
icons/database.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<ellipse cx="12" cy="5" rx="9" ry="3" />
|
||||
<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3" />
|
||||
<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5" />
|
||||
</svg>
|
After Width: | Height: | Size: 351 B |
14
icons/dollar-sign.svg
Normal file
@ -0,0 +1,14 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<line x1="12" y1="1" x2="12" y2="23" />
|
||||
<path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
|
||||
</svg>
|
After Width: | Height: | Size: 315 B |
@ -11,5 +11,5 @@
|
||||
>
|
||||
<path d="M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z" />
|
||||
<line x1="16" y1="8" x2="2" y2="22" />
|
||||
<line x1="17" y1="15" x2="9" y2="15" />
|
||||
<line x1="17.5" y1="15" x2="9" y2="15" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 356 B |
17
icons/gift.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<polyline points="20 12 20 22 4 22 4 12" />
|
||||
<rect x="2" y="7" width="20" height="5" />
|
||||
<line x1="12" y1="22" x2="12" y2="7" />
|
||||
<path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z" />
|
||||
<path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z" />
|
||||
</svg>
|
After Width: | Height: | Size: 459 B |
16
icons/git-branch.svg
Normal file
@ -0,0 +1,16 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<line x1="6" y1="3" x2="6" y2="15" />
|
||||
<circle cx="18" cy="6" r="3" />
|
||||
<circle cx="6" cy="18" r="3" />
|
||||
<path d="M18 9a9 9 0 0 1-9 9" />
|
||||
</svg>
|
After Width: | Height: | Size: 351 B |
15
icons/git-commit.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="12" cy="12" r="4" />
|
||||
<line x1="1.05" y1="12" x2="7" y2="12" />
|
||||
<line x1="17.01" y1="12" x2="22.96" y2="12" />
|
||||
</svg>
|
After Width: | Height: | Size: 336 B |
15
icons/git-merge.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="18" cy="18" r="3" />
|
||||
<circle cx="6" cy="6" r="3" />
|
||||
<path d="M6 21V9a9 9 0 0 0 9 9" />
|
||||
</svg>
|
After Width: | Height: | Size: 313 B |
16
icons/git-pull-request.svg
Normal file
@ -0,0 +1,16 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="18" cy="18" r="3" />
|
||||
<circle cx="6" cy="6" r="3" />
|
||||
<path d="M13 6h3a2 2 0 0 1 2 2v7" />
|
||||
<line x1="6" y1="9" x2="6" y2="21" />
|
||||
</svg>
|
After Width: | Height: | Size: 355 B |
@ -9,7 +9,7 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />
|
||||
<line x1="12" y1="17" x2="12" y2="17" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 339 B After Width: | Height: | Size: 339 B |
15
icons/linkedin.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z" />
|
||||
<rect x="2" y="9" width="4" height="12" />
|
||||
<circle cx="4" cy="4" r="2" />
|
||||
</svg>
|
After Width: | Height: | Size: 380 B |
14
icons/send.svg
Normal file
@ -0,0 +1,14 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<line x1="22" y1="2" x2="11" y2="13" />
|
||||
<polygon points="22 2 15 22 11 13 2 9 22 2" />
|
||||
</svg>
|
After Width: | Height: | Size: 299 B |
15
icons/shopping-bag.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z" />
|
||||
<line x1="3" y1="6" x2="21" y2="6" />
|
||||
<path d="M16 10a4 4 0 0 1-8 0" />
|
||||
</svg>
|
After Width: | Height: | Size: 350 B |
15
icons/trello.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
|
||||
<rect x="7" y="7" width="3" height="9" />
|
||||
<rect x="14" y="7" width="3" height="5" />
|
||||
</svg>
|
After Width: | Height: | Size: 357 B |
16
icons/truck.svg
Normal file
@ -0,0 +1,16 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect x="1" y="3" width="15" height="13" />
|
||||
<polygon points="16 8 20 8 23 11 23 16 16 16 16 8" />
|
||||
<circle cx="5.5" cy="18.5" r="2.5" />
|
||||
<circle cx="18.5" cy="18.5" r="2.5" />
|
||||
</svg>
|
After Width: | Height: | Size: 391 B |
14
icons/youtube.svg
Normal file
@ -0,0 +1,14 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z" />
|
||||
<polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02" />
|
||||
</svg>
|
After Width: | Height: | Size: 547 B |
16
icons/zap-off.svg
Normal file
@ -0,0 +1,16 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<polyline points="12.41 6.75 13 2 10.57 4.92" />
|
||||
<polyline points="18.57 12.91 21 10 15.66 10" />
|
||||
<polyline points="8 8 3 14 12 14 11 22 16 16" />
|
||||
<line x1="1" y1="1" x2="23" y2="23" />
|
||||
</svg>
|
After Width: | Height: | Size: 402 B |
13734
package-lock.json
generated
52
package.json
@ -3,58 +3,64 @@
|
||||
"version": "0.0.0-development",
|
||||
"description": "Simply beautiful open source icons",
|
||||
"main": "dist/feather.js",
|
||||
"unpkg": "dist/feather.min.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"start": "npm-run-all --sequential build lint test",
|
||||
"all": "npm-run-all --sequential build lint test:coverage",
|
||||
"build": "./bin/build.sh",
|
||||
"lint": "eslint .",
|
||||
"test": "jest",
|
||||
"test": "jest --watch",
|
||||
"test:coverage": "jest --coverage",
|
||||
"cm": "git-cz",
|
||||
"precommit": "lint-staged",
|
||||
"commitmsg": "commitlint --edit",
|
||||
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
|
||||
"commitmsg": "commitlint --edit"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "cz-conventional-changelog"
|
||||
}
|
||||
},
|
||||
"jest": {
|
||||
"collectCoverageFrom": [
|
||||
"src/**/*.js"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.5"
|
||||
"classnames": "^2.2.5",
|
||||
"core-js": "^2.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^5.0.0",
|
||||
"@commitlint/config-angular": "^5.0.0",
|
||||
"@commitlint/cli": "^5.2.5",
|
||||
"@commitlint/config-conventional": "^6.1.3",
|
||||
"algoliasearch": "^3.27.1",
|
||||
"babel-cli": "^6.24.1",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"babel-register": "^6.24.1",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"babel-preset-stage-2": "^6.24.1",
|
||||
"cheerio": "^1.0.0-rc.2",
|
||||
"commitizen": "^2.9.6",
|
||||
"core-js": "^2.4.1",
|
||||
"cz-conventional-changelog": "^2.1.0",
|
||||
"eslint": "^4.0.0",
|
||||
"eslint-config-airbnb-base": "^11.2.0",
|
||||
"eslint-config-prettier": "^2.7.0",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-airbnb-base": "^12.1.0",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-import": "^2.5.0",
|
||||
"eslint-plugin-prettier": "^2.3.1",
|
||||
"html-minifier": "^3.5.6",
|
||||
"husky": "^0.13.4",
|
||||
"jest": "^21.2.1",
|
||||
"lint-staged": "^5.0.0",
|
||||
"eslint-plugin-prettier": "^2.5.0",
|
||||
"html-minifier": "^3.5.8",
|
||||
"husky": "^0.14.3",
|
||||
"jest": "^22.4.4",
|
||||
"lint-staged": "^6.0.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"prettier": "^1.8.2",
|
||||
"rimraf": "^2.6.2",
|
||||
"semantic-release": "^6.3.6",
|
||||
"semantic-release": "^12.2.2",
|
||||
"svgo": "^0.7.2",
|
||||
"webpack": "^3.0.0"
|
||||
"webpack": "^4.8.3",
|
||||
"webpack-cli": "^2.1.3"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/colebemis/feather.git"
|
||||
"url": "https://github.com/feathericons/feather.git"
|
||||
},
|
||||
"author": "Cole Bemis <cole@colebemis.com> (http://colebemis.com)",
|
||||
"license": "MIT"
|
||||
|
3
src/__tests__/__snapshots__/replace.node.test.js.snap
Normal file
@ -0,0 +1,3 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`throws an error when run in node environment 1`] = `"\`feather.replace()\` only works in a browser environment."`;
|
@ -1,5 +1,5 @@
|
||||
/* eslint-env jest */
|
||||
import feather from '../..';
|
||||
import feather from '../index';
|
||||
|
||||
test('has correct properties', () => {
|
||||
expect(feather).toHaveProperty('icons');
|
||||
|
10
src/__tests__/replace.node.test.js
Normal file
@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @jest-environment node
|
||||
*/
|
||||
|
||||
/* eslint-env jest */
|
||||
import replace from '../replace';
|
||||
|
||||
test('throws an error when run in node environment', () => {
|
||||
expect(replace).toThrowErrorMatchingSnapshot();
|
||||
});
|
103
src/tags.json
@ -1,45 +1,91 @@
|
||||
{
|
||||
"activity": ["pulse", "health"],
|
||||
"airplay": ["stream", "cast"],
|
||||
"activity": ["pulse", "health", "action", "motion"],
|
||||
"airplay": ["stream", "cast", "mirroring"],
|
||||
"alert-circle": ["warning"],
|
||||
"alert-octagon": ["warning"],
|
||||
"alert-triangle": ["warning"],
|
||||
"at-sign": ["mention"],
|
||||
"award": ["achievement", "badge"],
|
||||
"aperture": ["camera", "photo"],
|
||||
"bell": ["alarm", "notification"],
|
||||
"bell-off": ["alarm", "notification"],
|
||||
"compass": ["navigation", "safari"],
|
||||
"disc": ["album"],
|
||||
"edit": ["pencil"],
|
||||
"edit-2": ["pencil"],
|
||||
"edit-3": ["pencil"],
|
||||
"bell-off": ["alarm", "notification", "silent"],
|
||||
"bluetooth": ["wireless"],
|
||||
"book-open": ["read"],
|
||||
"book": ["read", "dictionary", "booklet", "magazine"],
|
||||
"bookmark": ["read", "clip", "marker", "tag"],
|
||||
"briefcase": ["work", "bag", "baggage", "folder"],
|
||||
"clipboard": ["copy"],
|
||||
"clock": ["time", "watch", "alarm"],
|
||||
"cloud-drizzle": ["weather", "shower"],
|
||||
"cloud-lightning": ["weather", "bolt"],
|
||||
"cloud-rain": ["weather"],
|
||||
"cloud-snow": ["weather", "blizzard"],
|
||||
"cloud": ["weather"],
|
||||
"codepen": ["logo"],
|
||||
"coffee": ["drink", "cup", "mug", "tea", "cafe", "hot", "beverage"],
|
||||
"command": ["keyboard", "cmd"],
|
||||
"compass": ["navigation", "safari", "travel"],
|
||||
"copy": ["clone", "duplicate"],
|
||||
"corner-down-left": ["arrow"],
|
||||
"corner-down-right": ["arrow"],
|
||||
"corner-left-down": ["arrow"],
|
||||
"corner-left-up": ["arrow"],
|
||||
"corner-right-down": ["arrow"],
|
||||
"corner-right-up": ["arrow"],
|
||||
"corner-up-left": ["arrow"],
|
||||
"corner-up-right": ["arrow"],
|
||||
"credit-card": ["purchase", "payment", "cc"],
|
||||
"crop": ["photo", "image"],
|
||||
"crosshair": ["aim", "target"],
|
||||
"database": ["storage"],
|
||||
"delete": ["remove"],
|
||||
"disc": ["album", "cd", "dvd", "music"],
|
||||
"dollar-sign": ["currency", "money", "payment"],
|
||||
"droplet": ["water"],
|
||||
"edit": ["pencil", "change"],
|
||||
"edit-2": ["pencil", "change"],
|
||||
"edit-3": ["pencil", "change"],
|
||||
"eye": ["view", "watch"],
|
||||
"eye-off": ["view", "watch"],
|
||||
"external-link": ["outbound"],
|
||||
"facebook": ["logo"],
|
||||
"fast-forward": ["music"],
|
||||
"film": ["movie", "video"],
|
||||
"folder": ["directory"],
|
||||
"folder-minus": ["directory"],
|
||||
"folder-plus": ["directory"],
|
||||
"folder": ["directory"],
|
||||
"gift": ["present", "box", "birthday", "party"],
|
||||
"git-branch": ["code", "version control"],
|
||||
"git-commit": ["code", "version control"],
|
||||
"git-merge": ["code", "version control"],
|
||||
"git-pull-request": ["code", "version control"],
|
||||
"github": ["logo", "version control"],
|
||||
"gitlab": ["logo", "version control"],
|
||||
"global": ["world", "browser", "language", "translate"],
|
||||
"hard-drive": ["computer", "server"],
|
||||
"hash": ["hashtag", "number", "pound"],
|
||||
"headphones": ["music"],
|
||||
"headphones": ["music", "audio"],
|
||||
"heart": ["like", "love"],
|
||||
"help-circle": ["question mark"],
|
||||
"home": ["house"],
|
||||
"image": ["picture"],
|
||||
"life-bouy": ["help", "life ring"],
|
||||
"inbox": ["email"],
|
||||
"instagram": ["logo", "camera"],
|
||||
"life-bouy": ["help", "life ring", "support"],
|
||||
"linkedin": ["logo"],
|
||||
"lock": ["security", "password"],
|
||||
"log-in": ["sign in", "arrow"],
|
||||
"log-out": ["sign out", "arrow"],
|
||||
"mail": ["email"],
|
||||
"map-pin": ["location", "navigation", "travel"],
|
||||
"map-pin": ["location", "navigation", "travel", "marker"],
|
||||
"map": ["location", "navigation", "travel"],
|
||||
"maximize": ["fullscreen"],
|
||||
"maximize-2": ["fullscreen", "arrows"],
|
||||
"menu": ["bars", "navigation", "hamburger"],
|
||||
"message-circle": ["comment"],
|
||||
"message-square": ["comment"],
|
||||
"message-circle": ["comment", "chat"],
|
||||
"message-square": ["comment", "chat"],
|
||||
"mic-off": ["record"],
|
||||
"mic": ["record"],
|
||||
"minimize": ["exit fullscreen"],
|
||||
"minimize-2": ["exit fullscreen", "arrows"],
|
||||
"monitor": ["tv"],
|
||||
@ -59,18 +105,24 @@
|
||||
"plus": ["add", "new"],
|
||||
"plus-circle": ["add", "new"],
|
||||
"plus-square": ["add", "new"],
|
||||
"pocket": ["logo", "save"],
|
||||
"power": ["on", "off"],
|
||||
"radio": ["signal"],
|
||||
"rewind": ["music"],
|
||||
"rss": ["feed"],
|
||||
"rss": ["feed", "subscribe"],
|
||||
"save": ["floppy disk"],
|
||||
"send": ["message", "mail", "paper airplane"],
|
||||
"settings": ["cog", "edit", "gear", "preferences"],
|
||||
"shield": ["security"],
|
||||
"shield-off": ["security"],
|
||||
"shopping-bag": ["ecommerce", "cart", "purchase", "store"],
|
||||
"shopping-cart": ["ecommerce", "cart", "purchase", "store"],
|
||||
"shuffle": ["music"],
|
||||
"skip-back": ["music"],
|
||||
"skip-forward": ["music"],
|
||||
"slash": ["ban", "no"],
|
||||
"sliders": ["settings", "controls"],
|
||||
"speaker": ["music"],
|
||||
"star": ["bookmark", "favorite", "like"],
|
||||
"sun": ["brightness", "weather", "light"],
|
||||
"sunrise": ["weather"],
|
||||
@ -78,16 +130,29 @@
|
||||
"tag": ["label"],
|
||||
"target": ["bullseye"],
|
||||
"terminal": ["code", "command line"],
|
||||
"thumbs-down": ["dislike"],
|
||||
"thumbs-up": ["like"],
|
||||
"thumbs-down": ["dislike", "bad"],
|
||||
"thumbs-up": ["like", "good"],
|
||||
"toggle-left": ["on", "off", "switch"],
|
||||
"toggle-right": ["on", "off", "switch"],
|
||||
"trash": ["garbage", "delete", "remove"],
|
||||
"trash-2": ["garbage", "delete", "remove"],
|
||||
"triangle": ["delta"],
|
||||
"truck": ["delivery", "van", "shipping"],
|
||||
"twitter": ["logo"],
|
||||
"umbrella": ["rain", "weather"],
|
||||
"video-off": ["camera", "movie", "film"],
|
||||
"video": ["camera", "movie", "film"],
|
||||
"voicemail": ["phone"],
|
||||
"volume": ["music", "sound", "mute"],
|
||||
"volume-1": ["music", "sound"],
|
||||
"volume-2": ["music", "sound"],
|
||||
"volume-x": ["music", "sound", "mute"],
|
||||
"watch": ["clock", "time"],
|
||||
"wind": ["weather"],
|
||||
"x": ["cancel", "close", "delete", "remove"]
|
||||
"wind": ["weather", "air"],
|
||||
"x-circle": ["cancel", "close", "delete", "remove", "times"],
|
||||
"x-square": ["cancel", "close", "delete", "remove", "times"],
|
||||
"x": ["cancel", "close", "delete", "remove", "times"],
|
||||
"youtube": ["logo", "video", "play"],
|
||||
"zap-off": ["flash", "camera", "lightning"],
|
||||
"zap": ["flash", "camera", "lightning"]
|
||||
}
|
||||
|
@ -1,25 +0,0 @@
|
||||
import path from 'path';
|
||||
|
||||
export default {
|
||||
entry: [
|
||||
'core-js/fn/array/from',
|
||||
'core-js/fn/object/assign',
|
||||
'core-js/fn/set',
|
||||
path.resolve(__dirname, 'src/index.js'),
|
||||
],
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
libraryTarget: 'umd',
|
||||
library: 'feather',
|
||||
},
|
||||
devtool: 'source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
23
webpack.config.js
Normal file
@ -0,0 +1,23 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: ['core-js/fn/array/from', path.resolve(__dirname, 'src/index.js')],
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
libraryTarget: 'umd',
|
||||
library: 'feather',
|
||||
// Prevents webpack from referencing `window` in the UMD build
|
||||
// Source: https://git.io/vppgU
|
||||
globalObject: "typeof self !== 'undefined' ? self : this",
|
||||
},
|
||||
devtool: 'source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|