proicons 4.8.1 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +108 -64
- package/lib/categories.d.ts +1 -0
- package/lib/getIconInfo.d.ts +9 -0
- package/lib/interfaces.d.ts +28 -2
- package/lib/proicons.d.ts +5 -437
- package/lib/replace.d.ts +5 -0
- package/lib/search.d.ts +2 -1
- package/package.json +89 -40
- package/dist/icons.json +0 -430
- package/dist/proicons.js +0 -2
- package/dist/proicons.js.map +0 -1
- package/dist/tags.json +0 -1713
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 ProCode
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 ProCode
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,64 +1,108 @@
|
|
|
1
|
-
# ProIcons
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
# ProIcons
|
|
2
|
+
|
|
3
|
+
<img src="https://raw.githubusercontent.com/ProCode-Software/proicons/main/.github/images/github-cover_light.png#gh-light-mode-only">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/ProCode-Software/proicons/main/.github/images/github-cover_dark.png#gh-dark-mode-only">
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://github.com/ProCode-Software/proicons/releases">
|
|
8
|
+
<img src="https://img.shields.io/github/v/release/ProCode-Software/proicons?style=for-the-badge&color=orange"
|
|
9
|
+
alt="Version">
|
|
10
|
+
</a>
|
|
11
|
+
<a href="">
|
|
12
|
+
<img src="https://img.shields.io/github/stars/ProCode-Software/proicons?style=for-the-badge"
|
|
13
|
+
alt="Stars">
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/proicons">
|
|
16
|
+
<img src="https://img.shields.io/npm/dm/proicons?label=downloads&style=for-the-badge"
|
|
17
|
+
alt="NPM Package">
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/ProCode-Software/proicons/blob/main/LICENSE">
|
|
20
|
+
<img src="https://img.shields.io/github/license/ProCode-Software/proicons?style=for-the-badge"
|
|
21
|
+
alt="License">
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<p align="center">
|
|
26
|
+
<b>A collection of 400+ modern and open-source icons and logos</b>
|
|
27
|
+
<br>
|
|
28
|
+
<a href="https://procode-software.github.io/proicons">Icons</a> |
|
|
29
|
+
<a href="https://procode-software.github.io/proicons/docs/introduction/about">Documentation</a> |
|
|
30
|
+
<a href="https://github.com/ProCode-Software/proicons">GitHub</a> |
|
|
31
|
+
<a href="https://www.npmjs.com/package/proicons">NPM Package</a>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
> **Work in progress**
|
|
35
|
+
>
|
|
36
|
+
> Most of the website and planned packages aren't currently finished, but you can start using the beta package right now on NPM. See [ROADMAP.md](/ROADMAP.md) to learn more.
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Node.js
|
|
41
|
+
|
|
42
|
+
1. Install the ProIcons package via [NPM](https://www.npmjs.com/package/proicons):
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
npm install proicons
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
2. Use ProIcons inside JavaScript
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
import { icons } from 'proicons';
|
|
52
|
+
// or
|
|
53
|
+
const { icons } = require('proicons')
|
|
54
|
+
|
|
55
|
+
// Refer to the icon
|
|
56
|
+
icons.add;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
_or_
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<!-- Insert the icon -->
|
|
63
|
+
<i proicon="add"></i>
|
|
64
|
+
|
|
65
|
+
<script src="path/to/proicons/dist/umd/proicons.cjs"></script>
|
|
66
|
+
|
|
67
|
+
<!-- Replace icons with SVG -->
|
|
68
|
+
<script>
|
|
69
|
+
proicons.replace();
|
|
70
|
+
</script>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### HTML
|
|
74
|
+
You can import the ProIcons package via a CDN provider
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<!-- Insert the icon -->
|
|
78
|
+
<i proicon="add"></i>
|
|
79
|
+
|
|
80
|
+
<script src="https://unpkg.com/proicons"></script>
|
|
81
|
+
|
|
82
|
+
<!-- Replace icons with SVG -->
|
|
83
|
+
<script>
|
|
84
|
+
proicons.replace();
|
|
85
|
+
</script>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Packages
|
|
89
|
+
ProIcons is also available in the following packages:
|
|
90
|
+
|
|
91
|
+
- **[Webfont](https://procode-software.github.io/proicons/docs/packages/webfont):** Use ProIcons on your website as a webfont, similar to Font Awesome, without the need of scripts.
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
ProIcons is MIT-licensed, giving you peace of mind using these icons in your project. Learn more [here](./LICENSE)
|
|
96
|
+
|
|
97
|
+
> [!WARNING]
|
|
98
|
+
> This library contains brand icons that may not be MIT-licensed and may have additional terms and guidelines. Learn more [here](https://procode-software.github.io/proicons/docs/introduction/about#usage-of-brand-icons)
|
|
99
|
+
|
|
100
|
+
## Contributing
|
|
101
|
+
For more info on how to contribute, please see our [contributing guide](https://github.com/ProCode-Software/proicons/blob/main/CONTRIBUTING.md).
|
|
102
|
+
|
|
103
|
+
## Credits
|
|
104
|
+
|
|
105
|
+
- Icon design and guidelines inspired by Microsoft's [Fluent System Icons](https://github.com/microsoft/fluentui-system-icons)
|
|
106
|
+
- Alpha bleeding script from https://github.com/Corecii/Transparent-Pixel-Fix
|
|
107
|
+
- API based on [Feather Icons](https://github.com/feathericons/feather)
|
|
108
|
+
- Website design inspired by [Lucide](https://github.com/lucide-icons/lucide) and built using [VitePress](https://github.com/vuejs/vitepress)
|
package/lib/categories.d.ts
CHANGED
package/lib/getIconInfo.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { ProIconInfo } from './interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Returns information about an icon from the provided key.
|
|
4
|
+
* Throws an error if the provided key does not match an icon name in Friendly Form, camelCase or kebab-case. Use the method `search` instead to return icons that contain a keyword inside its name or tags.
|
|
5
|
+
* @param key The icon name in Friendly Form, camelCase or kebab-case. Throws an error if the provided key is invalid. Case-insensitive
|
|
6
|
+
* @example The following keys are valid:
|
|
7
|
+
* getIconInfo('Add Square')
|
|
8
|
+
* getIconInfo('addSquare')
|
|
9
|
+
* getIconInfo('add-square')
|
|
10
|
+
*/
|
|
2
11
|
declare function getIconInfo(key: string): ProIconInfo;
|
|
3
12
|
export default getIconInfo;
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -1,20 +1,46 @@
|
|
|
1
1
|
export interface ProIconReplaceConfig {
|
|
2
|
+
/** Determines the color of the icons. Defaults to `currentColor`. */
|
|
2
3
|
color: string;
|
|
4
|
+
/** Determines the default stroke width of the icon. Defaults to `1.5`. This only works on SVG elements with existing strokes; add `strokeFilledElements` for this property to affect such elements. */
|
|
3
5
|
strokeWidth: number;
|
|
6
|
+
/** Apply strokes to filled SVG elements, such as circles, by the provided amount with `1.5` (default stroke value) subtracted, if `strokeWidth` is set to a value above `1.5`. Defaults to `false`
|
|
7
|
+
* @example If `strokeWidth` is set to `2`, filled SVG elements will have an additional `0.5`px stroke
|
|
8
|
+
*/
|
|
4
9
|
strokeFilledElements: boolean;
|
|
10
|
+
/** Defaults to `round` */
|
|
5
11
|
strokeCaps: 'round' | 'square' | 'butt';
|
|
12
|
+
/** Defaults to `round` */
|
|
6
13
|
strokeJoin: 'round' | 'miter' | 'bevel';
|
|
14
|
+
/** Determines the corner radius of SVG elements. Does not apply to all rounded elements. */
|
|
7
15
|
cornerRadius: number;
|
|
16
|
+
/** The attribute name that is checked for when converting elements to icons. Defaults to `proicon`. */
|
|
8
17
|
attributeName: string;
|
|
18
|
+
/** Determines whether to overwrite elements when converting to icons. Setting this to `auto` will overwrite only if the element does not have any children. Defaults to `auto`. */
|
|
9
19
|
overwrite: boolean | 'auto';
|
|
20
|
+
/** Determines whether to apply existing HTMl attributes such as styles to the converted SVGs. Defaults to `true` */
|
|
10
21
|
useAttributes: false;
|
|
11
22
|
}
|
|
12
23
|
export declare class ProIconInfo {
|
|
24
|
+
/** The name of the icon in Friendly Form */
|
|
13
25
|
name: string;
|
|
26
|
+
/** The name of the icon in kebab-case */
|
|
14
27
|
kebabCase: string;
|
|
28
|
+
/** The name of the icon in camelCase */
|
|
15
29
|
camelCase: string;
|
|
16
|
-
|
|
30
|
+
/** The icon as an `SVGSVGElement`. Use the `outerHTML` property on this to return the icon as a string. */
|
|
31
|
+
element: SVGSVGElement;
|
|
32
|
+
/** The category of the icon. */
|
|
17
33
|
category: string;
|
|
34
|
+
/** An array of the icon's tags. */
|
|
18
35
|
tags: string[];
|
|
19
|
-
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param name The name of the icon in Friendly Form
|
|
39
|
+
* @param kebabCase The name of the icon in kebab-case
|
|
40
|
+
* @param camelCase The name of the icon in camelCase
|
|
41
|
+
* @param element The icon as an `SVGSVGElement`. Use the `outerHTML` property on this to return the icon as a string.
|
|
42
|
+
* @param category The category of the icon.
|
|
43
|
+
* @param tags An array of the icon's tags.
|
|
44
|
+
*/
|
|
45
|
+
constructor(name: string, kebabCase: string, camelCase: string, element: SVGSVGElement, tags: string[], category: string);
|
|
20
46
|
}
|