├── .circleci └── config.yml ├── .eslintrc.json ├── .gitignore ├── .huskyrc ├── .lintstagedrc ├── .npmignore ├── .nvmrc ├── .travis.yml ├── LICENSE ├── README.md ├── demo ├── App │ ├── App.test.tsx │ ├── App.tsx │ └── index.ts ├── Icon │ ├── Icon.test.tsx │ ├── Icon.tsx │ └── index.ts └── assets │ └── icons │ └── selection.json ├── images └── hero.png ├── jest.config.ts ├── package.json ├── public ├── index.html └── index.tsx ├── src ├── IcomoonReact │ ├── IcomoonReact.test.tsx │ ├── IcomoonReact.tsx │ └── index.ts └── index.ts └── tsconfig.json /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | test_and_build: 4 | docker: 5 | - image: circleci/node:12.13.1 6 | working_directory: ~/repo 7 | steps: 8 | - checkout 9 | # Download and cache dependencies 10 | - restore_cache: 11 | keys: 12 | - v1-dependencies-{{ checksum "package.json" }} 13 | # fallback to using the latest cache if no exact match is found 14 | - v1-dependencies- 15 | - run: yarn install 16 | - save_cache: 17 | paths: 18 | - node_modules 19 | key: v1-dependencies-{{ checksum "package.json" }} 20 | # run tests! 21 | - run: yarn test 22 | - run: yarn tsc 23 | - persist_to_workspace: 24 | root: ~/repo 25 | paths: . 26 | coveralls_publish: 27 | docker: 28 | - image: circleci/node:12.13.1 29 | working_directory: ~/repo 30 | steps: 31 | - attach_workspace: 32 | at: ~/repo 33 | - run: npm run coveralls 34 | npm_publish: 35 | docker: 36 | - image: circleci/node:12.13.1 37 | working_directory: ~/repo 38 | steps: 39 | - attach_workspace: 40 | at: ~/repo 41 | - run: 42 | name: Authenticate with registry 43 | command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc 44 | - run: 45 | name: Publish package 46 | command: npm publish 47 | workflows: 48 | version: 2 49 | icomoon_flow: 50 | jobs: 51 | - test_and_build: 52 | filters: 53 | tags: 54 | only: /^v.*/ 55 | branches: 56 | ignore: /.*/ 57 | - coveralls_publish: 58 | requires: 59 | - test_and_build 60 | filters: 61 | tags: 62 | only: /^v.*/ 63 | branches: 64 | ignore: /.*/ 65 | - npm_publish: 66 | requires: 67 | - test_and_build 68 | filters: 69 | tags: 70 | only: /^v.*/ 71 | branches: 72 | ignore: /.*/ 73 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": "airbnb", 4 | "env": { 5 | "es6": true, 6 | "node": true, 7 | "browser": true, 8 | "jest": true 9 | }, 10 | "rules": { 11 | "no-unused-vars": "error", 12 | "prefer-const": "error", 13 | "no-undef": "error", 14 | "no-var": "error", 15 | "object-shorthand": "error", 16 | "quote-props": ["error", "as-needed"], 17 | "prefer-arrow-callback": ["error", { "allowNamedFunctions": true }], 18 | "prefer-destructuring": [ 19 | "error", 20 | { 21 | "array": true, 22 | "object": true 23 | }, 24 | { 25 | "enforceForRenamedProperties": false 26 | } 27 | ], 28 | "quotes": ["error", "single"], 29 | "arrow-spacing": ["error", { "before": true, "after": true }], 30 | "arrow-parens": ["error", "as-needed"], 31 | "no-dupe-class-members": "error", 32 | "no-duplicate-imports": "error", 33 | "no-nested-ternary": "error", 34 | "no-unneeded-ternary": "error", 35 | "no-mixed-operators": "error", 36 | "nonblock-statement-body-position": ["error", "below"], 37 | "brace-style": "error", 38 | "no-else-return": "error", 39 | "indent": ["error", 2], 40 | "space-before-blocks": "error", 41 | "keyword-spacing": ["error", { "before": true }], 42 | "space-infix-ops": "error", 43 | "eol-last": ["error", "always"], 44 | "no-whitespace-before-property": "error", 45 | "newline-per-chained-call": ["error", { "ignoreChainWithDepth": 2 }], 46 | "padded-blocks": ["error", "never"], 47 | "space-in-parens": ["error", "never"], 48 | "array-bracket-spacing": ["error", "never"], 49 | "object-curly-spacing": ["error", "always"], 50 | "block-spacing": "error", 51 | "comma-spacing": ["error"], 52 | "computed-property-spacing": ["error", "never"], 53 | "func-call-spacing": ["error"], 54 | "key-spacing": ["error"], 55 | "no-trailing-spaces": "error", 56 | "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1 }], 57 | "comma-style": ["error", "last"], 58 | "comma-dangle": [ 59 | "error", 60 | { 61 | "arrays": "always-multiline", 62 | "objects": "always-multiline", 63 | "imports": "always-multiline", 64 | "exports": "always-multiline", 65 | "functions": "ignore" 66 | } 67 | ], 68 | "semi": ["error", "always"], 69 | "radix": "error", 70 | "no-new-wrappers": "error", 71 | "camelcase": "error" 72 | }, 73 | "plugins": ["babel", "react"], 74 | "parserOptions": { 75 | "sourceType": "module" 76 | }, 77 | "settings": { 78 | "react": { 79 | "version": "detect" 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .parcel-cache 2 | .vscode 3 | .idea 4 | .DS_Store 5 | yarn-error.log 6 | yarn.lock 7 | /node_modules 8 | /dist 9 | /build 10 | /coverage -------------------------------------------------------------------------------- /.huskyrc: -------------------------------------------------------------------------------- 1 | { 2 | "hooks": { 3 | "pre-commit": "lint-staged" 4 | } 5 | } -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{js,jsx,ts,tsx}": ["prettier-eslint --write", "git add"] 3 | } -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | public 2 | images 3 | .babelrc 4 | .gitignore 5 | .nvmrc 6 | .eslintrc 7 | .idea 8 | .eslintrc.json 9 | coverage 10 | .vscode 11 | .huskyrc 12 | .lintstagedrc 13 | .travis.yml 14 | .travis.yml 15 | tsconfig.json 16 | demo 17 | jest.config.js 18 | webpack.config.js 19 | index.tsx 20 | yarn.lock 21 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v12.13.1 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - 12.13.1 5 | 6 | cache: yarn 7 | 8 | install: 9 | - yarn install 10 | - yarn tsc 11 | 12 | script: 13 | - COVERALLS_REPO_TOKEN=$coveralls_repo_token npm run coveralls 14 | 15 | deploy: 16 | provider: npm 17 | email: ponciusz@gmail.com 18 | api_key: $NPM_TOKEN 19 | on: 20 | tags: true 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Kamil Albrycht 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/ponciusz/icomoon-react.svg?branch=master)](https://travis-ci.org/ponciusz/icomoon-react) [![Coverage Status](https://coveralls.io/repos/github/ponciusz/icomoon-react/badge.svg?branch=master)](https://coveralls.io/github/ponciusz/icomoon-react?branch=master) 2 | 3 | # icomoon-react 4 | 5 | ![Hero Image](/images/hero.png) 6 | 7 | React Component which let you use icomoon `selection.json` file to render SVG instead font 8 | 9 | Short example can be found [here](https://codesandbox.io/s/q89onw1kqq) 10 | 11 | installation with YARN: 12 | 13 | ``` 14 | yarn add icomoon-react 15 | ``` 16 | 17 | installation with NPM: 18 | 19 | ``` 20 | npm install icomoon-react 21 | ``` 22 | 23 | ## Quick usage: 24 | 25 | use `selection.json` generated from http://icomoon.io/app 26 | 27 | - add your desired icons, select from ready library or add custom svg's 28 | - once done click Generate Font 29 | - click Download 30 | - unzip package and grab your `selection.json` 31 | 32 | ```js 33 | import iconSet from "somewhere/selection.json"; 34 | import IcomoonReact, { iconList } from "icomoon-react"; 35 | ``` 36 | 37 | than just use component in code: 38 | 39 | ```js 40 | 41 | ``` 42 | 43 | To console.log all icons use: `iconList(iconSet)` function 44 | 45 | ## Advanced usage: 46 | 47 | To not include set all over again just create your wraper component: 48 | 49 | #### Icon.tsx 50 | 51 | ```js 52 | import React from "react"; 53 | 54 | import IcomoonReact from "../IcomoonReact"; 55 | import iconSet from "./pathToSelection/selection.json"; 56 | 57 | const Icon: React.FC<{ 58 | color?: string, 59 | size: string | number, 60 | icon: string, 61 | className?: string 62 | }> = props => { 63 | const { color, size = "100%", icon, className = "" } = props; 64 | return ( 65 | 72 | ); 73 | }; 74 | 75 | export default Icon; 76 | ``` 77 | 78 | ### App.tsx 79 | 80 | ```js 81 | import React from "react"; 82 | import Icon from "./Icon"; 83 | 84 | const App = () => ( 85 |
86 | 87 |
88 | ); 89 | 90 | export default App; 91 | ``` 92 | 93 | # Develop 94 | 95 | clone repo `git clone git@github.com:ponciusz/icomoon-react.git` 96 | 97 | `yarn install` 98 | 99 | `yarn start` 100 | -------------------------------------------------------------------------------- /demo/App/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import App from "./index"; 4 | 5 | it("renders without crashing", () => { 6 | const div = document.createElement("div"); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /demo/App/App.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { iconList } from "../../src/IcomoonReact"; 3 | import Icon from "../Icon"; 4 | import iconSet from "../assets/icons/selection.json"; 5 | 6 | const styles: React.CSSProperties = { 7 | borderCollapse: "collapse", 8 | border: "1px solid black", 9 | padding: "10px" 10 | }; 11 | 12 | const App = () => ( 13 |
14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | {iconList(iconSet).map(icon => ( 24 | 25 | 28 | 29 | 30 | ))} 31 | 32 |
18 | Icon List 19 |
26 | 27 | {icon}
33 |
34 | ); 35 | 36 | export default App; 37 | -------------------------------------------------------------------------------- /demo/App/index.ts: -------------------------------------------------------------------------------- 1 | import App from "./App"; 2 | 3 | export default App; 4 | -------------------------------------------------------------------------------- /demo/Icon/Icon.test.tsx: -------------------------------------------------------------------------------- 1 | import Enzyme from "enzyme"; 2 | import Adapter from "enzyme-adapter-react-16"; 3 | import React from "react"; 4 | import ReactDOM from "react-dom"; 5 | import Icon from "./index"; 6 | 7 | Enzyme.configure({ adapter: new Adapter() }); 8 | 9 | describe("IcomoonReact component", () => { 10 | it("should be defined", () => { 11 | expect(Icon).toBeDefined(); 12 | }); 13 | }); 14 | 15 | it("rendering star icon", () => { 16 | const div = document.createElement("div"); 17 | ReactDOM.render(, div); 18 | ReactDOM.unmountComponentAtNode(div); 19 | }); 20 | 21 | it("not existion icon not crashing ", () => { 22 | const div = document.createElement("div"); 23 | ReactDOM.render( 24 | , 25 | div 26 | ); 27 | ReactDOM.unmountComponentAtNode(div); 28 | }); 29 | -------------------------------------------------------------------------------- /demo/Icon/Icon.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import IcomoonReact from "../../src/IcomoonReact"; 3 | import iconSet from "../assets/icons/selection.json"; 4 | 5 | const Icon: React.FC<{ 6 | color?: string; 7 | size?: string | number; 8 | icon: string; 9 | className?: string; 10 | }> = props => { 11 | const { color, size = "100%", icon, className = "" } = props; 12 | return ( 13 | 20 | ); 21 | }; 22 | 23 | export default Icon; 24 | -------------------------------------------------------------------------------- /demo/Icon/index.ts: -------------------------------------------------------------------------------- 1 | import Icon from "./Icon"; 2 | 3 | export default Icon; 4 | -------------------------------------------------------------------------------- /demo/assets/icons/selection.json: -------------------------------------------------------------------------------- 1 | { 2 | "IcoMoonType": "selection", 3 | "icons": [ 4 | { 5 | "icon": { 6 | "paths": [ 7 | "M950.857 859.429v-438.857c-12 13.714-25.143 26.286-39.429 37.714-81.714 62.857-164 126.857-243.429 193.143-42.857 36-96 80-155.429 80h-1.143c-59.429 0-112.571-44-155.429-80-79.429-66.286-161.714-130.286-243.429-193.143-14.286-11.429-27.429-24-39.429-37.714v438.857c0 9.714 8.571 18.286 18.286 18.286h841.143c9.714 0 18.286-8.571 18.286-18.286zM950.857 258.857c0-14.286 3.429-39.429-18.286-39.429h-841.143c-9.714 0-18.286 8.571-18.286 18.286 0 65.143 32.571 121.714 84 162.286 76.571 60 153.143 120.571 229.143 181.143 30.286 24.571 85.143 77.143 125.143 77.143h1.143c40 0 94.857-52.571 125.143-77.143 76-60.571 152.571-121.143 229.143-181.143 37.143-29.143 84-92.571 84-141.143zM1024 237.714v621.714c0 50.286-41.143 91.429-91.429 91.429h-841.143c-50.286 0-91.429-41.143-91.429-91.429v-621.714c0-50.286 41.143-91.429 91.429-91.429h841.143c50.286 0 91.429 41.143 91.429 91.429z" 8 | ], 9 | "width": 1024, 10 | "attrs": [], 11 | "isMulticolor": false, 12 | "isMulticolor2": false, 13 | "tags": [ 14 | "envelope-o" 15 | ], 16 | "defaultCode": 61443, 17 | "grid": 14 18 | }, 19 | "attrs": [], 20 | "properties": { 21 | "name": "envelope-o", 22 | "id": 7, 23 | "order": 16, 24 | "prevSize": 28, 25 | "code": 61443 26 | }, 27 | "setIdx": 0, 28 | "setId": 0, 29 | "iconIdx": 7 30 | }, 31 | { 32 | "icon": { 33 | "paths": [ 34 | "M950.857 369.714c0 10.286-7.429 20-14.857 27.429l-207.429 202.286 49.143 285.714c0.571 4 0.571 7.429 0.571 11.429 0 14.857-6.857 28.571-23.429 28.571-8 0-16-2.857-22.857-6.857l-256.571-134.857-256.571 134.857c-7.429 4-14.857 6.857-22.857 6.857-16.571 0-24-13.714-24-28.571 0-4 0.571-7.429 1.143-11.429l49.143-285.714-208-202.286c-6.857-7.429-14.286-17.143-14.286-27.429 0-17.143 17.714-24 32-26.286l286.857-41.714 128.571-260c5.143-10.857 14.857-23.429 28-23.429s22.857 12.571 28 23.429l128.571 260 286.857 41.714c13.714 2.286 32 9.143 32 26.286z" 35 | ], 36 | "width": 950.8571428571428, 37 | "attrs": [], 38 | "isMulticolor": false, 39 | "isMulticolor2": false, 40 | "tags": [ 41 | "star" 42 | ], 43 | "defaultCode": 61445, 44 | "grid": 14 45 | }, 46 | "attrs": [], 47 | "properties": { 48 | "name": "star", 49 | "id": 9, 50 | "order": 21, 51 | "prevSize": 28, 52 | "code": 61445 53 | }, 54 | "setIdx": 0, 55 | "setId": 0, 56 | "iconIdx": 9 57 | }, 58 | { 59 | "icon": { 60 | "paths": [ 61 | "M804.571 566.857v274.286c0 20-16.571 36.571-36.571 36.571h-219.429v-219.429h-146.286v219.429h-219.429c-20 0-36.571-16.571-36.571-36.571v-274.286c0-1.143 0.571-2.286 0.571-3.429l328.571-270.857 328.571 270.857c0.571 1.143 0.571 2.286 0.571 3.429zM932 527.429l-35.429 42.286c-2.857 3.429-7.429 5.714-12 6.286h-1.714c-4.571 0-8.571-1.143-12-4l-395.429-329.714-395.429 329.714c-4 2.857-8.571 4.571-13.714 4-4.571-0.571-9.143-2.857-12-6.286l-35.429-42.286c-6.286-7.429-5.143-19.429 2.286-25.714l410.857-342.286c24-20 62.857-20 86.857 0l139.429 116.571v-111.429c0-10.286 8-18.286 18.286-18.286h109.714c10.286 0 18.286 8 18.286 18.286v233.143l125.143 104c7.429 6.286 8.571 18.286 2.286 25.714z" 62 | ], 63 | "width": 950.8571428571428, 64 | "attrs": [], 65 | "isMulticolor": false, 66 | "isMulticolor2": false, 67 | "tags": [ 68 | "home" 69 | ], 70 | "defaultCode": 61461, 71 | "grid": 14 72 | }, 73 | "attrs": [], 74 | "properties": { 75 | "name": "home", 76 | "id": 24, 77 | "order": 7, 78 | "prevSize": 28, 79 | "code": 61461 80 | }, 81 | "setIdx": 0, 82 | "setId": 0, 83 | "iconIdx": 24 84 | }, 85 | { 86 | "icon": { 87 | "paths": [ 88 | "M512 310.857v256c0 10.286-8 18.286-18.286 18.286h-182.857c-10.286 0-18.286-8-18.286-18.286v-36.571c0-10.286 8-18.286 18.286-18.286h128v-201.143c0-10.286 8-18.286 18.286-18.286h36.571c10.286 0 18.286 8 18.286 18.286zM749.714 512c0-171.429-139.429-310.857-310.857-310.857s-310.857 139.429-310.857 310.857 139.429 310.857 310.857 310.857 310.857-139.429 310.857-310.857zM877.714 512c0 242.286-196.571 438.857-438.857 438.857s-438.857-196.571-438.857-438.857 196.571-438.857 438.857-438.857 438.857 196.571 438.857 438.857z" 89 | ], 90 | "width": 877.7142857142857, 91 | "attrs": [], 92 | "isMulticolor": false, 93 | "isMulticolor2": false, 94 | "tags": [ 95 | "clock-o" 96 | ], 97 | "defaultCode": 61463, 98 | "grid": 14 99 | }, 100 | "attrs": [], 101 | "properties": { 102 | "name": "clock-o", 103 | "id": 26, 104 | "order": 20, 105 | "prevSize": 28, 106 | "code": 61463 107 | }, 108 | "setIdx": 0, 109 | "setId": 0, 110 | "iconIdx": 26 111 | }, 112 | { 113 | "icon": { 114 | "paths": [ 115 | "M877.714 146.286v256c0 20-16.571 36.571-36.571 36.571h-256c-14.857 0-28-9.143-33.714-22.857-5.714-13.143-2.857-29.143 8-39.429l78.857-78.857c-53.714-49.714-124.571-78.286-199.429-78.286-161.143 0-292.571 131.429-292.571 292.571s131.429 292.571 292.571 292.571c90.857 0 174.857-41.143 230.857-113.714 2.857-4 8-6.286 13.143-6.857 5.143 0 10.286 1.714 14.286 5.143l78.286 78.857c6.857 6.286 6.857 17.143 1.143 24.571-83.429 100.571-206.857 158.286-337.714 158.286-241.714 0-438.857-197.143-438.857-438.857s197.143-438.857 438.857-438.857c112.571 0 221.714 45.143 302.286 121.143l74.286-73.714c10.286-10.857 26.286-13.714 40-8 13.143 5.714 22.286 18.857 22.286 33.714z" 116 | ], 117 | "width": 877.7142857142857, 118 | "attrs": [], 119 | "isMulticolor": false, 120 | "isMulticolor2": false, 121 | "tags": [ 122 | "repeat", 123 | "rotate-right" 124 | ], 125 | "defaultCode": 61470, 126 | "grid": 14 127 | }, 128 | "attrs": [], 129 | "properties": { 130 | "name": "repeat, rotate-right", 131 | "id": 33, 132 | "order": 18, 133 | "prevSize": 28, 134 | "code": 61470 135 | }, 136 | "setIdx": 0, 137 | "setId": 0, 138 | "iconIdx": 33 139 | }, 140 | { 141 | "icon": { 142 | "paths": [ 143 | "M507.429 676.571l66.286-66.286-86.857-86.857-66.286 66.286v32h54.857v54.857h32zM758.857 265.143c-5.143-5.143-13.714-4.571-18.857 0.571l-200 200c-5.143 5.143-5.714 13.714-0.571 18.857s13.714 4.571 18.857-0.571l200-200c5.143-5.143 5.714-13.714 0.571-18.857zM804.571 604.571v108.571c0 90.857-73.714 164.571-164.571 164.571h-475.429c-90.857 0-164.571-73.714-164.571-164.571v-475.429c0-90.857 73.714-164.571 164.571-164.571h475.429c22.857 0 45.714 4.571 66.857 14.286 5.143 2.286 9.143 7.429 10.286 13.143 1.143 6.286-0.571 12-5.143 16.571l-28 28c-5.143 5.143-12 6.857-18.286 4.571-8.571-2.286-17.143-3.429-25.714-3.429h-475.429c-50.286 0-91.429 41.143-91.429 91.429v475.429c0 50.286 41.143 91.429 91.429 91.429h475.429c50.286 0 91.429-41.143 91.429-91.429v-72c0-4.571 1.714-9.143 5.143-12.571l36.571-36.571c5.714-5.714 13.143-6.857 20-4s11.429 9.143 11.429 16.571zM749.714 182.857l164.571 164.571-384 384h-164.571v-164.571zM1003.429 258.286l-52.571 52.571-164.571-164.571 52.571-52.571c21.143-21.143 56.571-21.143 77.714 0l86.857 86.857c21.143 21.143 21.143 56.571 0 77.714z" 144 | ], 145 | "width": 1024.5851428571427, 146 | "attrs": [], 147 | "isMulticolor": false, 148 | "isMulticolor2": false, 149 | "tags": [ 150 | "edit", 151 | "pencil-square-o" 152 | ], 153 | "defaultCode": 61508, 154 | "grid": 14 155 | }, 156 | "attrs": [], 157 | "properties": { 158 | "name": "edit, pencil-square-o", 159 | "id": 68, 160 | "order": 15, 161 | "prevSize": 28, 162 | "code": 61508 163 | }, 164 | "setIdx": 0, 165 | "setId": 0, 166 | "iconIdx": 68 167 | }, 168 | { 169 | "icon": { 170 | "paths": [ 171 | "M585.143 786.286v-91.429c0-10.286-8-18.286-18.286-18.286h-54.857v-292.571c0-10.286-8-18.286-18.286-18.286h-182.857c-10.286 0-18.286 8-18.286 18.286v91.429c0 10.286 8 18.286 18.286 18.286h54.857v182.857h-54.857c-10.286 0-18.286 8-18.286 18.286v91.429c0 10.286 8 18.286 18.286 18.286h256c10.286 0 18.286-8 18.286-18.286zM512 274.286v-91.429c0-10.286-8-18.286-18.286-18.286h-109.714c-10.286 0-18.286 8-18.286 18.286v91.429c0 10.286 8 18.286 18.286 18.286h109.714c10.286 0 18.286-8 18.286-18.286zM877.714 512c0 242.286-196.571 438.857-438.857 438.857s-438.857-196.571-438.857-438.857 196.571-438.857 438.857-438.857 438.857 196.571 438.857 438.857z" 172 | ], 173 | "width": 877.7142857142857, 174 | "attrs": [], 175 | "isMulticolor": false, 176 | "isMulticolor2": false, 177 | "tags": [ 178 | "info-circle" 179 | ], 180 | "defaultCode": 61530, 181 | "grid": 14 182 | }, 183 | "attrs": [], 184 | "properties": { 185 | "name": "info-circle", 186 | "id": 89, 187 | "order": 19, 188 | "prevSize": 28, 189 | "code": 61530 190 | }, 191 | "setIdx": 0, 192 | "setId": 0, 193 | "iconIdx": 89 194 | }, 195 | { 196 | "icon": { 197 | "paths": [ 198 | "M438.857 73.143c242.286 0 438.857 196.571 438.857 438.857s-196.571 438.857-438.857 438.857-438.857-196.571-438.857-438.857 196.571-438.857 438.857-438.857zM595.429 370.857c-4.571 3.429-7.429 9.714-13.143 10.857 2.857-0.571 5.714-10.857 7.429-13.143 3.429-4 8-6.286 12.571-8.571 9.714-4 19.429-5.143 29.714-6.857 9.714-2.286 21.714-2.286 29.143 6.286-1.714-1.714 12-13.714 13.714-14.286 5.143-2.857 13.714-1.714 17.143-6.857 1.143-1.714 1.143-12.571 1.143-12.571-9.714 1.143-13.143-8-13.714-16 0 0.571-1.143 2.286-3.429 4.571 0.571-8.571-10.286-2.286-14.286-3.429-13.143-3.429-11.429-12.571-15.429-22.286-2.286-5.143-8.571-6.857-10.857-12-2.286-3.429-3.429-10.857-8.571-11.429-3.429-0.571-9.714 12-10.857 11.429-5.143-2.857-7.429 1.143-11.429 3.429-3.429 2.286-6.286 1.143-9.714 2.857 10.286-3.429-4.571-9.143-9.714-8 8-2.286 4-10.857-0.571-14.857h2.857c-1.143-5.143-17.143-9.714-22.286-13.143s-32.571-9.143-38.286-5.714c-6.857 4 1.714 15.429 1.714 21.143 0.571 6.857-6.857 8.571-6.857 14.286 0 9.714 18.286 8 13.714 21.143-2.857 8-13.714 9.714-18.286 16-4.571 5.714 0.571 16 5.143 20 4.571 3.429-8 9.143-9.714 10.286-9.714 4.571-17.143-9.714-19.429-18.286-1.714-6.286-2.286-13.714-9.143-17.143-3.429-1.143-14.286-2.857-16.571 0.571-3.429-8.571-15.429-12-23.429-14.857-11.429-4-21.143-4-33.143-2.286 4-0.571-1.143-18.286-10.857-15.429 2.857-5.714 1.714-12 2.857-17.714 1.143-4.571 3.429-9.143 6.857-13.143 1.143-2.286 13.714-15.429 9.714-16 9.714 1.143 20.571 1.714 28.571-6.286 5.143-5.143 7.429-13.714 12.571-19.429 7.429-8.571 16.571 2.286 24.571 2.857 11.429 0.571 10.857-12 4.571-17.714 7.429 0.571 1.143-13.143-2.857-14.857-5.143-1.714-24.571 3.429-14.286 7.429-2.286-1.143-16 27.429-24 13.143-2.286-2.857-3.429-14.857-8.571-15.429-4.571 0-7.429 5.143-9.143 8.571 2.857-7.429-16-12.571-20-13.143 8.571-5.714 1.714-12-4.571-15.429-4.571-2.857-18.857-5.143-22.857-0.571-10.857 13.143 11.429 14.857 17.143 18.286 1.714 1.143 8.571 5.143 4.571 8-3.429 1.714-13.714 4.571-14.857 6.857-3.429 5.143 4 10.857-1.143 16-5.143-5.143-5.143-13.714-9.143-19.429 5.143 6.286-20.571 2.857-20 2.857-8.571 0-22.286 5.714-28.571-2.857-1.143-2.286-1.143-15.429 2.286-12.571-5.143-4-8.571-8-12-10.286-18.857 6.286-36.571 14.286-53.714 23.429 2.286 0.571 4 0.571 6.857-0.571 4.571-1.714 8.571-4.571 13.143-6.857 5.714-2.286 17.714-9.143 24-4 0.571-1.143 2.286-2.286 2.857-2.857 4 4.571 8 9.143 11.429 14.286-4.571-2.286-12-1.143-17.143-0.571-4 1.143-10.857 2.286-12.571 6.857 1.714 2.857 4 7.429 2.857 10.286-7.429-5.143-13.143-13.714-23.429-14.857-4.571 0-9.143 0-12.571 0.571-54.857 30.286-101.143 74.286-134.286 126.857 2.286 2.286 4.571 4 6.857 4.571 5.714 1.714 0 18.286 10.857 9.714 3.429 2.857 4 6.857 1.714 10.857 0.571-0.571 23.429 14.286 25.143 15.429 4 3.429 10.286 7.429 12 12 1.143 4-2.286 8.571-5.714 10.286-0.571-1.143-9.143-9.714-10.286-7.429-1.714 2.857 0 18.286 6.286 17.714-9.143 0.571-5.143 36-7.429 42.857 0 0.571 1.143 0.571 1.143 0.571-1.714 6.857 4 33.714 15.429 30.857-7.429 1.714 13.143 28 16 29.714 7.429 5.143 16 8.571 21.143 16 5.714 8 5.714 20 13.714 26.286-2.286 6.857 12 14.857 11.429 24.571-1.143 0.571-1.714 0.571-2.857 1.143 2.857 8 13.714 8 17.714 15.429 2.286 4.571 0 15.429 7.429 13.143 1.143-12.571-7.429-25.143-13.714-35.429-3.429-5.714-6.857-10.857-9.714-16.571-2.857-5.143-3.429-11.429-5.714-17.143 2.286 0.571 14.857 5.143 13.714 6.857-4.571 11.429 18.286 31.429 24.571 38.857 1.714 1.714 14.857 18.857 8 18.857 7.429 0 17.714 11.429 21.143 17.143 5.143 8.571 4 19.429 7.429 28.571 3.429 11.429 19.429 16.571 28.571 21.714 8 4 14.857 9.714 22.857 12.571 12 4.571 14.857 0.571 25.143-1.143 14.857-2.286 16.571 14.286 28.571 20.571 7.429 4 23.429 9.714 31.429 6.286-3.429 1.143 12 24.571 13.143 26.286 5.143 6.857 14.857 10.286 20.571 17.143 1.714-1.143 3.429-2.857 4-5.143-2.286 6.286 8.571 18.286 14.286 17.143 6.286-1.143 8-13.714 8-18.286-11.429 5.714-21.714 1.143-28-10.286-1.143-2.857-10.286-18.857-2.286-18.857 10.857 0 3.429-8.571 2.286-16.571s-9.143-13.143-13.143-20c-3.429 6.857-14.857 5.143-18.286-0.571 0 1.714-1.714 4.571-1.714 6.857-2.857 0-5.714 0.571-8.571-0.571 1.143-6.857 1.714-15.429 3.429-22.857 2.857-10.286 21.714-30.286-2.857-29.143-8.571 0.571-12 4-14.857 11.429-2.857 6.857-1.714 13.143-9.714 16.571-5.143 2.286-22.286 1.143-27.429-1.714-10.857-6.286-18.286-26.286-18.286-37.714-0.571-15.429 7.429-29.143 0-43.429 3.429-2.857 6.857-8.571 10.857-11.429 3.429-2.286 7.429 1.714 9.143-5.143-1.714-1.143-4-3.429-4.571-3.429 8.571 4 24.571-5.714 32 0 4.571 3.429 9.714 4.571 12.571-1.143 0.571-1.714-4-8.571-1.714-13.143 1.714 9.714 8 11.429 16.571 5.143 3.429 3.429 12.571 2.286 18.857 5.714 6.286 4 7.429 10.286 14.857 1.714 4.571 6.857 5.143 6.857 6.857 13.714 1.714 6.286 5.143 22.286 10.857 25.143 12 7.429 9.143-12.571 8-19.429-0.571-0.571-0.571-19.429-1.143-19.429-18.286-4-11.429-18.286-1.143-28 1.714-1.143 14.857-5.714 20.571-10.286 5.143-4.571 11.429-12.571 8.571-20 2.857 0 5.143-2.286 6.286-5.143-1.714-0.571-8.571-6.286-9.714-5.714 4-2.286 3.429-5.714 1.143-9.143 5.714-3.429 2.857-9.714 8.571-12 6.286 8.571 18.857-1.143 12.571-8 5.714-8 18.857-4 22.286-11.429 8.571 2.286 2.286-8.571 6.857-14.857 4-5.143 10.857-5.143 16-8 0 0.571 14.286-8 9.714-8.571 9.714 1.143 29.143-9.143 14.286-17.714 2.286-5.143-5.143-7.429-10.286-8.571 4-1.143 9.143 1.143 12.571-1.143 7.429-5.143 2.286-7.429-4-9.143-8-2.286-18.286 2.857-24.571 6.857zM502.286 872c78.286-13.714 148-52.571 200.571-108-3.429-3.429-9.714-2.286-14.286-4.571-4.571-1.714-8-3.429-13.714-4.571 1.143-11.429-11.429-15.429-19.429-21.143-7.429-5.714-12-12-22.857-9.714-1.143 0.571-12.571 4.571-10.286 6.857-7.429-6.286-10.857-9.714-20.571-12.571-9.143-2.857-15.429-14.286-24.571-4-4.571 4.571-2.286 11.429-4.571 16-7.429-6.286 6.857-13.714 1.143-20.571-6.857-8-18.857 5.143-24.571 8.571-3.429 2.857-7.429 4-9.714 7.429-2.857 4-4 9.143-6.286 13.143-1.714-4.571-11.429-3.429-12-6.857 2.286 13.714 2.286 28 5.143 41.714 1.714 8 0 21.143-6.857 27.429s-15.429 13.143-16.571 22.857c-1.143 6.857 0.571 13.143 6.857 14.857 0.571 8.571-9.143 14.857-8.571 24 0 0.571 0.571 6.286 1.143 9.143z" 199 | ], 200 | "width": 877.7142857142857, 201 | "attrs": [], 202 | "isMulticolor": false, 203 | "isMulticolor2": false, 204 | "tags": [ 205 | "globe" 206 | ], 207 | "defaultCode": 61612, 208 | "grid": 14 209 | }, 210 | "attrs": [], 211 | "properties": { 212 | "name": "globe", 213 | "id": 163, 214 | "order": 13, 215 | "prevSize": 28, 216 | "code": 61612 217 | }, 218 | "setIdx": 0, 219 | "setId": 0, 220 | "iconIdx": 163 221 | }, 222 | { 223 | "icon": { 224 | "paths": [ 225 | "M338.857 512c-59.429 1.714-113.143 27.429-151.429 73.143h-76.571c-57.143 0-110.857-27.429-110.857-90.857 0-46.286-1.714-201.714 70.857-201.714 12 0 71.429 48.571 148.571 48.571 26.286 0 51.429-4.571 76-13.143-1.714 12.571-2.857 25.143-2.857 37.714 0 52 16.571 103.429 46.286 146.286zM950.857 876c0 92.571-61.143 148-152.571 148h-499.429c-91.429 0-152.571-55.429-152.571-148 0-129.143 30.286-327.429 197.714-327.429 19.429 0 90.286 79.429 204.571 79.429s185.143-79.429 204.571-79.429c167.429 0 197.714 198.286 197.714 327.429zM365.714 146.286c0 80.571-65.714 146.286-146.286 146.286s-146.286-65.714-146.286-146.286 65.714-146.286 146.286-146.286 146.286 65.714 146.286 146.286zM768 365.714c0 121.143-98.286 219.429-219.429 219.429s-219.429-98.286-219.429-219.429 98.286-219.429 219.429-219.429 219.429 98.286 219.429 219.429zM1097.143 494.286c0 63.429-53.714 90.857-110.857 90.857h-76.571c-38.286-45.714-92-71.429-151.429-73.143 29.714-42.857 46.286-94.286 46.286-146.286 0-12.571-1.143-25.143-2.857-37.714 24.571 8.571 49.714 13.143 76 13.143 77.143 0 136.571-48.571 148.571-48.571 72.571 0 70.857 155.429 70.857 201.714zM1024 146.286c0 80.571-65.714 146.286-146.286 146.286s-146.286-65.714-146.286-146.286 65.714-146.286 146.286-146.286 146.286 65.714 146.286 146.286z" 226 | ], 227 | "width": 1097.142857142857, 228 | "attrs": [], 229 | "isMulticolor": false, 230 | "isMulticolor2": false, 231 | "tags": [ 232 | "group", 233 | "users" 234 | ], 235 | "defaultCode": 61632, 236 | "grid": 14 237 | }, 238 | "attrs": [], 239 | "properties": { 240 | "name": "group, users", 241 | "id": 169, 242 | "order": 14, 243 | "prevSize": 28, 244 | "code": 61632 245 | }, 246 | "setIdx": 0, 247 | "setId": 0, 248 | "iconIdx": 169 249 | }, 250 | { 251 | "icon": { 252 | "paths": [ 253 | "M1024 676.571v109.714c0 9.714-8.571 18.286-18.286 18.286h-786.286v109.714c0 9.714-8 18.286-18.286 18.286-5.143 0-9.714-2.286-13.714-5.714l-182.286-182.857c-3.429-3.429-5.143-8-5.143-12.571 0-5.143 1.714-9.714 5.143-13.143l182.857-182.857c3.429-3.429 8.571-5.143 13.143-5.143 9.714 0 18.286 8 18.286 18.286v109.714h786.286c9.714 0 18.286 8 18.286 18.286zM1024 365.714c0 4.571-1.714 9.714-5.143 13.143l-182.857 182.857c-3.429 3.429-8.571 5.143-13.143 5.143-9.714 0-18.286-8.571-18.286-18.286v-109.714h-786.286c-9.714 0-18.286-8.571-18.286-18.286v-109.714c0-9.714 8.571-18.286 18.286-18.286h786.286v-109.714c0-10.286 8-18.286 18.286-18.286 5.143 0 9.714 2.286 13.714 5.714l182.286 182.286c3.429 3.429 5.143 8.571 5.143 13.143z" 254 | ], 255 | "width": 1024, 256 | "attrs": [], 257 | "isMulticolor": false, 258 | "isMulticolor2": false, 259 | "tags": [ 260 | "exchange" 261 | ], 262 | "defaultCode": 61676, 263 | "grid": 14 264 | }, 265 | "attrs": [], 266 | "properties": { 267 | "name": "exchange", 268 | "id": 211, 269 | "order": 10, 270 | "prevSize": 28, 271 | "code": 61676 272 | }, 273 | "setIdx": 0, 274 | "setId": 0, 275 | "iconIdx": 211 276 | }, 277 | { 278 | "icon": { 279 | "paths": [ 280 | "M265.143 804.571c0-25.143-20.571-45.714-45.714-45.714s-45.714 20.571-45.714 45.714 20.571 45.714 45.714 45.714 45.714-20.571 45.714-45.714zM384 713.143v-402.286c0-9.714-8.571-18.286-18.286-18.286h-292.571c-9.714 0-18.286 8.571-18.286 18.286v402.286c0 9.714 8.571 18.286 18.286 18.286h292.571c9.714 0 18.286-8.571 18.286-18.286zM274.286 228.571c0-5.143-4-9.143-9.143-9.143h-91.429c-5.143 0-9.143 4-9.143 9.143s4 9.143 9.143 9.143h91.429c5.143 0 9.143-4 9.143-9.143zM438.857 219.429v585.143c0 40-33.143 73.143-73.143 73.143h-292.571c-40 0-73.143-33.143-73.143-73.143v-585.143c0-40 33.143-73.143 73.143-73.143h292.571c40 0 73.143 33.143 73.143 73.143z" 281 | ], 282 | "width": 438.85714285714283, 283 | "attrs": [], 284 | "isMulticolor": false, 285 | "isMulticolor2": false, 286 | "tags": [ 287 | "mobile", 288 | "mobile-phone" 289 | ], 290 | "defaultCode": 61707, 291 | "grid": 14 292 | }, 293 | "attrs": [], 294 | "properties": { 295 | "name": "mobile, mobile-phone", 296 | "id": 240, 297 | "order": 12, 298 | "prevSize": 28, 299 | "code": 61707 300 | }, 301 | "setIdx": 0, 302 | "setId": 0, 303 | "iconIdx": 240 304 | }, 305 | { 306 | "icon": { 307 | "paths": [ 308 | "M648 614.286c-28.571 92-112.571 153.714-209.143 153.714s-180.571-61.714-209.143-153.714c-6.286-19.429 4.571-39.429 24-45.714 18.857-6.286 39.429 4.571 45.714 24 18.857 61.143 75.429 102.286 139.429 102.286s120.571-41.143 139.429-102.286c6.286-19.429 26.857-30.286 46.286-24 18.857 6.286 29.714 26.286 23.429 45.714zM365.714 365.714c0 40.571-32.571 73.143-73.143 73.143s-73.143-32.571-73.143-73.143 32.571-73.143 73.143-73.143 73.143 32.571 73.143 73.143zM658.286 365.714c0 40.571-32.571 73.143-73.143 73.143s-73.143-32.571-73.143-73.143 32.571-73.143 73.143-73.143 73.143 32.571 73.143 73.143zM804.571 512c0-201.714-164-365.714-365.714-365.714s-365.714 164-365.714 365.714 164 365.714 365.714 365.714 365.714-164 365.714-365.714zM877.714 512c0 242.286-196.571 438.857-438.857 438.857s-438.857-196.571-438.857-438.857 196.571-438.857 438.857-438.857 438.857 196.571 438.857 438.857z" 309 | ], 310 | "width": 877.7142857142857, 311 | "attrs": [], 312 | "isMulticolor": false, 313 | "isMulticolor2": false, 314 | "tags": [ 315 | "smile-o" 316 | ], 317 | "defaultCode": 61720, 318 | "grid": 14 319 | }, 320 | "attrs": [], 321 | "properties": { 322 | "name": "smile-o", 323 | "id": 250, 324 | "order": 3, 325 | "prevSize": 28, 326 | "code": 61720 327 | }, 328 | "setIdx": 0, 329 | "setId": 0, 330 | "iconIdx": 250 331 | }, 332 | { 333 | "icon": { 334 | "paths": [ 335 | "M648 702.286c6.286 19.429-4.571 39.429-23.429 45.714-19.429 6.286-40-4.571-46.286-24-18.857-61.143-75.429-102.286-139.429-102.286s-120.571 41.143-139.429 102.286c-6.286 19.429-26.857 30.286-45.714 24-19.429-6.286-30.286-26.286-24-45.714 28.571-92 112.571-153.714 209.143-153.714s180.571 61.714 209.143 153.714zM365.714 365.714c0 40.571-32.571 73.143-73.143 73.143s-73.143-32.571-73.143-73.143 32.571-73.143 73.143-73.143 73.143 32.571 73.143 73.143zM658.286 365.714c0 40.571-32.571 73.143-73.143 73.143s-73.143-32.571-73.143-73.143 32.571-73.143 73.143-73.143 73.143 32.571 73.143 73.143zM804.571 512c0-201.714-164-365.714-365.714-365.714s-365.714 164-365.714 365.714 164 365.714 365.714 365.714 365.714-164 365.714-365.714zM877.714 512c0 242.286-196.571 438.857-438.857 438.857s-438.857-196.571-438.857-438.857 196.571-438.857 438.857-438.857 438.857 196.571 438.857 438.857z" 336 | ], 337 | "width": 877.7142857142857, 338 | "attrs": [], 339 | "isMulticolor": false, 340 | "isMulticolor2": false, 341 | "tags": [ 342 | "frown-o" 343 | ], 344 | "defaultCode": 61721, 345 | "grid": 14 346 | }, 347 | "attrs": [], 348 | "properties": { 349 | "name": "frown-o", 350 | "id": 251, 351 | "order": 4, 352 | "prevSize": 28, 353 | "code": 61721 354 | }, 355 | "setIdx": 0, 356 | "setId": 0, 357 | "iconIdx": 251 358 | }, 359 | { 360 | "icon": { 361 | "paths": [ 362 | "M0.103 610.921c9.037 61.993 29.337 121.090 60.439 175.952 31.623 55.337 71.511 102.102 118.592 140.356l0.91 0.716c27.407-33.857 43.998-77.449 43.998-124.915 0-35.762-9.418-69.323-25.909-98.34l0.516 0.986c-33.401-58.455-95.229-97.299-166.158-97.649h-0.050c-10.697 0-21.535 0.953-32.338 2.894z", 363 | "M465.223 558.883c-61.085-104.904-172.894-174.367-300.951-174.68h-0.045c-55.909 0.166-108.647 13.581-155.288 37.269l1.968-0.907c-5.755 27.078-9.355 54.332-10.803 81.268 13.062-1.73 26.125-2.612 39.010-2.612 112.57 0.297 210.808 61.363 263.672 152.113l0.784 1.457c25.806 43.955 41.049 96.81 41.049 153.223 0 28.35-3.849 55.803-11.054 81.861l0.508-2.154c-11.030 40.869-29.040 76.53-52.88 107.468l0.526-0.71c24.5 12.603 49.778 23.194 75.479 31.597 152.369-101.992 199.992-304.95 108.028-465.191z", 364 | "M593.727 1017.013c180.682-150.675 226.895-408.776 109.652-615.124-84.729-149.192-242.781-241.863-412.484-241.863-59.583 0.050-116.52 11.317-168.833 31.802l3.155-1.088c-22.669 27.75-43.034 59.004-59.87 92.345l-1.346 2.939c31.85-8.592 68.421-13.536 106.145-13.556h0.012c155.123 0 299.654 84.729 377.144 221.175 36.809 63.424 58.533 139.559 58.533 220.768 0 40.82-5.489 80.358-15.769 117.917l0.73-3.126c-20.172 75.82-57.728 141.155-108.254 193.979l0.156-0.164c37.069 2.189 74.243 0.177 111.029-6.002z", 365 | "M955.375 251.391c-66.855-114.314-174.655-198.529-302.821-233.149l-3.506-0.807c-39.284-11.025-84.396-17.363-130.989-17.363-82.413 0-160.194 19.828-228.834 54.973l2.836-1.319h3.989c206.348 0 398.575 110.392 501.66 288.075 48.636 82.537 77.369 181.839 77.369 287.852 0 108.123-29.886 209.266-81.849 295.619l1.446-2.589c222.305-144.602 295.030-439.632 160.701-671.292z" 366 | ], 367 | "attrs": [ 368 | { "fill": "rgb(82, 184, 91)" }, 369 | { "fill": "rgb(225, 131, 39)" }, 370 | { "fill": "rgb(213, 33, 39)" }, 371 | { "fill": "rgb(29, 84, 112)" } 372 | ], 373 | "isMulticolor": true, 374 | "isMulticolor2": false, 375 | "grid": 16, 376 | "tags": ["logo"], 377 | "colorPermutations": { 378 | "21333391225131391288511412984112182184911": [ 379 | { "f": 3 }, 380 | { "f": 4 }, 381 | { "f": 2 }, 382 | { "f": 1 } 383 | ] 384 | }, 385 | "defaultCode": 59653 386 | }, 387 | "attrs": [ 388 | { "fill": "rgb(82, 184, 91)" }, 389 | { "fill": "rgb(225, 131, 39)" }, 390 | { "fill": "rgb(213, 33, 39)" }, 391 | { "fill": "rgb(29, 84, 112)" } 392 | ], 393 | "properties": { 394 | "order": 5, 395 | "id": 3, 396 | "name": "logo-colored", 397 | "prevSize": 20, 398 | "codes": [59653, 59654, 59655, 59656], 399 | "code": 59653 400 | }, 401 | "setIdx": 0, 402 | "setId": 2, 403 | "iconIdx": 3 404 | } 405 | ], 406 | "height": 1024, 407 | "metadata": { 408 | "name": "icomoon" 409 | }, 410 | "preferences": { 411 | "showGlyphs": true, 412 | "showCodes": true, 413 | "showQuickUse": true, 414 | "showQuickUse2": true, 415 | "showSVGs": true, 416 | "fontPref": { 417 | "prefix": "icon-", 418 | "metadata": { 419 | "fontFamily": "icomoon" 420 | }, 421 | "metrics": { 422 | "emSize": 1024, 423 | "baseline": 6.25, 424 | "whitespace": 50 425 | }, 426 | "embed": false 427 | }, 428 | "imagePref": { 429 | "prefix": "icon-", 430 | "png": true, 431 | "useClassSelector": true, 432 | "color": 0, 433 | "bgColor": 16777215 434 | }, 435 | "historySize": 50 436 | } 437 | } 438 | -------------------------------------------------------------------------------- /images/hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ponciusz/icomoon-react/f3949f31d0818d0921cd0821bcdc4e5fe0c2df4e/images/hero.png -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | // Sync object 4 | const config: Config.InitialOptions = { 5 | roots: ["/src"], 6 | transform: { 7 | "^.+\\.tsx?$": "ts-jest" 8 | }, 9 | collectCoverage: true, 10 | coverageReporters: ["json", "html"], 11 | collectCoverageFrom: ["**/*.{js,jsx,ts,tsx}", "!src/index.ts"], 12 | verbose: true, 13 | setupFilesAfterEnv: ["@testing-library/jest-dom/extend-expect"] 14 | }; 15 | export default config; 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "icomoon-react", 3 | "version": "3.0.0", 4 | "description": "Component let which let you use icomoon selection.json file to display svg's", 5 | "main": "build/src/index.js", 6 | "scripts": { 7 | "start": "yarn parcel public/index.html", 8 | "fix": "prettier-eslint --write $PWD/'src/**/*.{js,jsx,ts,tsx}'", 9 | "test": "jest --env=jsdom --coverage", 10 | "coveralls": "jest --env=jsdom --coverage --coverageReporters=text-lcov | coveralls", 11 | "tsc": "tsc" 12 | }, 13 | "author": { 14 | "name": "Kamil Albrycht", 15 | "email": "ponciusz@gmail.com" 16 | }, 17 | "license": "ISC", 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/ponciusz/icomoon-react.git" 21 | }, 22 | "devDependencies": { 23 | "@testing-library/jest-dom": "^5.16.4", 24 | "@testing-library/react": "^13.1.1", 25 | "@types/node": "^17.0.29", 26 | "@types/react": "^18.0.8", 27 | "@types/react-dom": "^18.0.0", 28 | "jest": "^27.5.1", 29 | "parcel": "^2.5.0", 30 | "prettier-eslint-cli": "^5.0.1", 31 | "ts-jest": "^27.1.4", 32 | "ts-node": "^10.7.0", 33 | "typescript": "^3.6.2" 34 | }, 35 | "dependencies": { 36 | "react": ">=16.9.0", 37 | "react-dom": ">=16.9.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Icomoon react example 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { createRoot } from 'react-dom/client'; 3 | import App from "../demo/App"; 4 | 5 | if (process.env.NODE_ENV !== "production") { 6 | console.log("Looks like we are in development mode!"); 7 | } 8 | 9 | const container = document.getElementById('root'); 10 | const root = createRoot(container!); 11 | root.render(); 12 | 13 | -------------------------------------------------------------------------------- /src/IcomoonReact/IcomoonReact.test.tsx: -------------------------------------------------------------------------------- 1 | import IcomoonReact, { iconList } from "./index"; 2 | import { render, screen } from '@testing-library/react' 3 | import * as React from "react"; 4 | 5 | 6 | const iconSet = { 7 | IcoMoonType: "selection", 8 | icons: [ 9 | { 10 | icon: { 11 | paths: [ 12 | "M950.857 859.429v-438.857c-12 13.714-25.143 26.286-39.429 37.714-81.714 62.857-164 126.857-243.429 193.143-42.857 36-96 80-155.429 80h-1.143c-59.429 0-112.571-44-155.429-80-79.429-66.286-161.714-130.286-243.429-193.143-14.286-11.429-27.429-24-39.429-37.714v438.857c0 9.714 8.571 18.286 18.286 18.286h841.143c9.714 0 18.286-8.571 18.286-18.286zM950.857 258.857c0-14.286 3.429-39.429-18.286-39.429h-841.143c-9.714 0-18.286 8.571-18.286 18.286 0 65.143 32.571 121.714 84 162.286 76.571 60 153.143 120.571 229.143 181.143 30.286 24.571 85.143 77.143 125.143 77.143h1.143c40 0 94.857-52.571 125.143-77.143 76-60.571 152.571-121.143 229.143-181.143 37.143-29.143 84-92.571 84-141.143zM1024 237.714v621.714c0 50.286-41.143 91.429-91.429 91.429h-841.143c-50.286 0-91.429-41.143-91.429-91.429v-621.714c0-50.286 41.143-91.429 91.429-91.429h841.143c50.286 0 91.429 41.143 91.429 91.429z" 13 | ], 14 | width: 1024, 15 | attrs: [], 16 | isMulticolor: false, 17 | isMulticolor2: false, 18 | tags: ["envelope-o"], 19 | defaultCode: 61443, 20 | grid: 14 21 | }, 22 | attrs: [], 23 | properties: { 24 | name: "envelope-o", 25 | id: 7, 26 | order: 16, 27 | prevSize: 28, 28 | code: 61443 29 | }, 30 | setIdx: 0, 31 | setId: 0, 32 | iconIdx: 7 33 | }, 34 | { 35 | icon: { 36 | paths: [ 37 | "M338.857 512c-59.429 1.714-113.143 27.429-151.429 73.143h-76.571c-57.143 0-110.857-27.429-110.857-90.857 0-46.286-1.714-201.714 70.857-201.714 12 0 71.429 48.571 148.571 48.571 26.286 0 51.429-4.571 76-13.143-1.714 12.571-2.857 25.143-2.857 37.714 0 52 16.571 103.429 46.286 146.286zM950.857 876c0 92.571-61.143 148-152.571 148h-499.429c-91.429 0-152.571-55.429-152.571-148 0-129.143 30.286-327.429 197.714-327.429 19.429 0 90.286 79.429 204.571 79.429s185.143-79.429 204.571-79.429c167.429 0 197.714 198.286 197.714 327.429zM365.714 146.286c0 80.571-65.714 146.286-146.286 146.286s-146.286-65.714-146.286-146.286 65.714-146.286 146.286-146.286 146.286 65.714 146.286 146.286zM768 365.714c0 121.143-98.286 219.429-219.429 219.429s-219.429-98.286-219.429-219.429 98.286-219.429 219.429-219.429 219.429 98.286 219.429 219.429zM1097.143 494.286c0 63.429-53.714 90.857-110.857 90.857h-76.571c-38.286-45.714-92-71.429-151.429-73.143 29.714-42.857 46.286-94.286 46.286-146.286 0-12.571-1.143-25.143-2.857-37.714 24.571 8.571 49.714 13.143 76 13.143 77.143 0 136.571-48.571 148.571-48.571 72.571 0 70.857 155.429 70.857 201.714zM1024 146.286c0 80.571-65.714 146.286-146.286 146.286s-146.286-65.714-146.286-146.286 65.714-146.286 146.286-146.286 146.286 65.714 146.286 146.286z" 38 | ], 39 | width: 1097.142857142857, 40 | attrs: [], 41 | isMulticolor: false, 42 | isMulticolor2: false, 43 | tags: ["group", "users"], 44 | defaultCode: 61632, 45 | grid: 14 46 | }, 47 | attrs: [], 48 | properties: { 49 | name: "group, users", 50 | id: 169, 51 | order: 14, 52 | prevSize: 28, 53 | code: 61632 54 | }, 55 | setIdx: 0, 56 | setId: 0, 57 | iconIdx: 169 58 | }, 59 | { 60 | icon: { 61 | paths: [ 62 | "M1024 676.571v109.714c0 9.714-8.571 18.286-18.286 18.286h-786.286v109.714c0 9.714-8 18.286-18.286 18.286-5.143 0-9.714-2.286-13.714-5.714l-182.286-182.857c-3.429-3.429-5.143-8-5.143-12.571 0-5.143 1.714-9.714 5.143-13.143l182.857-182.857c3.429-3.429 8.571-5.143 13.143-5.143 9.714 0 18.286 8 18.286 18.286v109.714h786.286c9.714 0 18.286 8 18.286 18.286zM1024 365.714c0 4.571-1.714 9.714-5.143 13.143l-182.857 182.857c-3.429 3.429-8.571 5.143-13.143 5.143-9.714 0-18.286-8.571-18.286-18.286v-109.714h-786.286c-9.714 0-18.286-8.571-18.286-18.286v-109.714c0-9.714 8.571-18.286 18.286-18.286h786.286v-109.714c0-10.286 8-18.286 18.286-18.286 5.143 0 9.714 2.286 13.714 5.714l182.286 182.286c3.429 3.429 5.143 8.571 5.143 13.143z" 63 | ], 64 | width: 1024, 65 | attrs: [], 66 | isMulticolor: false, 67 | isMulticolor2: false, 68 | tags: ["exchange"], 69 | defaultCode: 61676, 70 | grid: 14 71 | }, 72 | attrs: [], 73 | properties: { 74 | name: "exchange", 75 | id: 211, 76 | order: 10, 77 | prevSize: 28, 78 | code: 61676 79 | }, 80 | setIdx: 0, 81 | setId: 0, 82 | iconIdx: 211 83 | }, 84 | { 85 | icon: { 86 | paths: [ 87 | "M265.143 804.571c0-25.143-20.571-45.714-45.714-45.714s-45.714 20.571-45.714 45.714 20.571 45.714 45.714 45.714 45.714-20.571 45.714-45.714zM384 713.143v-402.286c0-9.714-8.571-18.286-18.286-18.286h-292.571c-9.714 0-18.286 8.571-18.286 18.286v402.286c0 9.714 8.571 18.286 18.286 18.286h292.571c9.714 0 18.286-8.571 18.286-18.286zM274.286 228.571c0-5.143-4-9.143-9.143-9.143h-91.429c-5.143 0-9.143 4-9.143 9.143s4 9.143 9.143 9.143h91.429c5.143 0 9.143-4 9.143-9.143zM438.857 219.429v585.143c0 40-33.143 73.143-73.143 73.143h-292.571c-40 0-73.143-33.143-73.143-73.143v-585.143c0-40 33.143-73.143 73.143-73.143h292.571c40 0 73.143 33.143 73.143 73.143z" 88 | ], 89 | width: 438.85714285714283, 90 | attrs: [], 91 | isMulticolor: false, 92 | isMulticolor2: false, 93 | tags: ["mobile", "mobile-phone"], 94 | defaultCode: 61707, 95 | grid: 14 96 | }, 97 | attrs: [], 98 | properties: { 99 | name: "mobile, mobile-phone", 100 | id: 240, 101 | order: 12, 102 | prevSize: 28, 103 | code: 61707 104 | }, 105 | setIdx: 0, 106 | setId: 0, 107 | iconIdx: 240 108 | }, 109 | { 110 | icon: { 111 | paths: [ 112 | "M648 614.286c-28.571 92-112.571 153.714-209.143 153.714s-180.571-61.714-209.143-153.714c-6.286-19.429 4.571-39.429 24-45.714 18.857-6.286 39.429 4.571 45.714 24 18.857 61.143 75.429 102.286 139.429 102.286s120.571-41.143 139.429-102.286c6.286-19.429 26.857-30.286 46.286-24 18.857 6.286 29.714 26.286 23.429 45.714zM365.714 365.714c0 40.571-32.571 73.143-73.143 73.143s-73.143-32.571-73.143-73.143 32.571-73.143 73.143-73.143 73.143 32.571 73.143 73.143zM658.286 365.714c0 40.571-32.571 73.143-73.143 73.143s-73.143-32.571-73.143-73.143 32.571-73.143 73.143-73.143 73.143 32.571 73.143 73.143zM804.571 512c0-201.714-164-365.714-365.714-365.714s-365.714 164-365.714 365.714 164 365.714 365.714 365.714 365.714-164 365.714-365.714zM877.714 512c0 242.286-196.571 438.857-438.857 438.857s-438.857-196.571-438.857-438.857 196.571-438.857 438.857-438.857 438.857 196.571 438.857 438.857z" 113 | ], 114 | width: 877.7142857142857, 115 | attrs: [], 116 | isMulticolor: false, 117 | isMulticolor2: false, 118 | tags: ["smile-o"], 119 | defaultCode: 61720, 120 | grid: 14 121 | }, 122 | attrs: [], 123 | properties: { 124 | name: "smile-o", 125 | id: 250, 126 | order: 3, 127 | prevSize: 28, 128 | code: 61720 129 | }, 130 | setIdx: 0, 131 | setId: 0, 132 | iconIdx: 250 133 | } 134 | ], 135 | height: 1024 136 | }; 137 | 138 | describe("IcomoonReact component", () => { 139 | render( 140 | 147 | ); 148 | const icon = screen.getByTestId('svgIcon') 149 | 150 | it("should be defined", () => { 151 | expect(icon).toBeVisible(); 152 | expect(icon).toHaveClass('testClass') 153 | }); 154 | 155 | it("should have custom CSSProps", () => { 156 | expect(icon).toHaveStyle({ 157 | display: 'inline-block', 158 | verticalAlign: 'middle', 159 | marginTop: '20px' 160 | }) 161 | }); 162 | }); 163 | 164 | 165 | describe("IcomoonReact component with unknown icon", () => { 166 | const { container } = render( 167 | 172 | ); 173 | 174 | it("should be defined", () => { 175 | expect(container.firstChild).toBe(null); 176 | }); 177 | 178 | }); 179 | 180 | describe("iconList function", () => { 181 | it("should be defined", () => { 182 | expect(iconList(iconSet)).toBeDefined(); 183 | }); 184 | 185 | const expected = ["envelope-o", "group", "exchange", "mobile", "smile-o"]; 186 | it("should return array of icons", () => { 187 | expect(iconList(iconSet)).toEqual(expect.arrayContaining(expected)); 188 | }); 189 | }); -------------------------------------------------------------------------------- /src/IcomoonReact/IcomoonReact.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const iconList = iconSet => { 4 | const list: Array = []; 5 | iconSet.icons.forEach(icon => { 6 | list.push(icon.properties.name.split(", ")[0]); 7 | }); 8 | return list; 9 | }; 10 | 11 | function getSvg(icon, iconSet, styles, size, className, rest) { 12 | const find = iconEl => iconEl.properties.name.split(", ").includes(icon); 13 | const currentIcon = iconSet.icons.find(find); 14 | const renderPath = iconObj => (path, index) => { 15 | const attrs = (iconObj.attrs && iconObj.attrs[index]) || {}; 16 | return ; 17 | }; 18 | 19 | if (currentIcon) { 20 | return ( 21 | 30 | {currentIcon.icon.paths.map(renderPath(currentIcon.icon))} 31 | 32 | ); 33 | } 34 | console.warn(`icon ${icon} does not exist.`); 35 | return null; 36 | } 37 | 38 | export const IcomoonReact: React.FC<{ 39 | color?: string; 40 | size?: string | number; 41 | icon: string; 42 | iconSet: Object; 43 | className?: string; 44 | style?: React.CSSProperties; 45 | [x: string]: any; 46 | }> = props => { 47 | const { 48 | color, 49 | size = "100%", 50 | icon, 51 | iconSet, 52 | className = "", 53 | style = {}, 54 | ...rest 55 | } = props; 56 | 57 | const styles = { 58 | svg: { 59 | display: "inline-block", 60 | verticalAlign: "middle", 61 | ...style 62 | }, 63 | path: { 64 | fill: color 65 | } 66 | }; 67 | 68 | return getSvg(icon, iconSet, styles, size, className, rest); 69 | }; 70 | 71 | IcomoonReact.displayName = `IcomoonReact`; 72 | 73 | export default IcomoonReact; 74 | -------------------------------------------------------------------------------- /src/IcomoonReact/index.ts: -------------------------------------------------------------------------------- 1 | import IcomoonReact, { iconList } from "./IcomoonReact"; 2 | 3 | export { iconList, IcomoonReact }; 4 | export default IcomoonReact; 5 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { IcomoonReact } from "./IcomoonReact/IcomoonReact"; 2 | 3 | export { iconList } from "./IcomoonReact/IcomoonReact"; 4 | export default IcomoonReact; 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./build/", 4 | "sourceMap": true, 5 | "rootDirs": [ 6 | "src" 7 | ], 8 | "baseUrl": "src", 9 | "noImplicitAny": false, 10 | "module": "commonjs", 11 | "esModuleInterop": true, 12 | "target": "es5", 13 | "jsx": "react", 14 | "declaration": true, 15 | "declarationDir": "./build", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "forceConsistentCasingInFileNames": true, 19 | "noImplicitReturns": true, 20 | "noImplicitThis": true, 21 | "strictNullChecks": true, 22 | "suppressImplicitAnyIndexErrors": true, 23 | "noUnusedLocals": true, 24 | "allowSyntheticDefaultImports": true, 25 | "experimentalDecorators": true, 26 | "emitDecoratorMetadata": true 27 | }, 28 | "include": [ 29 | "./src/**/*.*", 30 | "./demo/**/*.*", 31 | "public/index.tsx" 32 | ], 33 | "exclude": [ 34 | "node_modules", 35 | "build", 36 | "scripts", 37 | "**/*.test.tsx" 38 | ] 39 | } --------------------------------------------------------------------------------