proicons 4.13.1 → 4.13.2

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/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # ProIcons for HTML/Vanilla JavaScript
2
+
3
+ <p>
4
+ <a href="https://github.com/ProCode-Software/proicons/releases">
5
+ <img src="https://img.shields.io/github/v/release/ProCode-Software/proicons?style=for-the-badge"
6
+ alt="Version">
7
+ </a>
8
+ <a href="https://github.com/ProCode-Software/proicons">
9
+ <img src="https://img.shields.io/github/stars/ProCode-Software/proicons?style=for-the-badge"
10
+ alt="Stars">
11
+ </a>
12
+ <a href="https://www.npmjs.com/package/proicons">
13
+ <img src="https://img.shields.io/npm/dm/proicons?label=downloads&style=for-the-badge" alt="NPM Package">
14
+ </a>
15
+ <a href="https://github.com/ProCode-Software/proicons/blob/main/LICENSE">
16
+ <img src="https://img.shields.io/github/license/ProCode-Software/proicons?style=for-the-badge" alt="License">
17
+ </a>
18
+ </p>
19
+
20
+ <img src="https://raw.githubusercontent.com/ProCode-Software/proicons/main/.github/images/github-cover_light.png#gh-light-mode-only">
21
+ <img src="https://raw.githubusercontent.com/ProCode-Software/proicons/main/.github/images/github-cover_dark.png#gh-dark-mode-only">
22
+
23
+ <p align="center">
24
+ <br>
25
+ 👑 A collection of 500+ modern and open-source icons and logos
26
+ <br>
27
+ <a href="https://procode-software.github.io/proicons/icons">Browse icons</a> |
28
+ <a href="https://procode-software.github.io/proicons/docs/html-api">HTML Docs</a> |
29
+ <a href="https://procode-software.github.io/proicons/docs/javascript-api">JavaScript Docs</a> |
30
+ <a href="https://github.com/ProCode-Software/proicons/tree/main/packages/proicons">GitHub</a> |
31
+ <a href="https://www.npmjs.com/package/proicons">NPM</a>
32
+ </p>
33
+
34
+ ## Features
35
+
36
+ - Use ProIcons as HTML attributes
37
+ - Use ProIcons as JavaScript objects
38
+ - Supports ESM tree-shaking
39
+
40
+ **Read the full documentation for [HTML](https://procode-software.github.io/proicons/docs/html-api) and [JavaScript](https://procode-software.github.io/proicons/docs/javascript-api)**
41
+
42
+ ## Installation & Usage
43
+ For installation steps, see the [documentation](https://procode-software.github.io/proicons/docs/html-api#installation).
44
+
45
+ ## Usage
46
+ For usage instructions, see the documentation ([HTML](https://procode-software.github.io/proicons/docs/html-api) or [JavaScript](https://procode-software.github.io/proicons/docs/javascript-api)).
47
+
48
+ ## Request an icon
49
+
50
+ If an icon you want isn't in the set, you can request an icon in [discussions](https://github.com/ProCode-Software/proicons/discussions/categories/icon-requests).
51
+
52
+ ## Contributing
53
+
54
+ For more info on how to contribute, please see our [contributing guide](https://github.com/ProCode-Software/proicons/blob/main/CONTRIBUTING.md).
@@ -21084,7 +21084,8 @@ function replace(rootElm, config) {
21084
21084
  };
21085
21085
  const elementConfig = {};
21086
21086
  if (useAttrs) {
21087
- for (const [htmlAttr, optionKey] of Object.entries(propMap)) if (element.hasAttribute(htmlAttr)) {
21087
+ for (const [htmlAttr, optionKey] of Object.entries(propMap)) {
21088
+ if (!element.hasAttribute(htmlAttr)) continue;
21088
21089
  let typed = element.getAttribute(htmlAttr);
21089
21090
  if (propTypes[optionKey] == "number") typed = isNaN(+typed) ? void 0 : +typed;
21090
21091
  else if (propTypes[optionKey] == "bool") typed = typed === "true";
@@ -21102,7 +21103,8 @@ function replace(rootElm, config) {
21102
21103
  iconElement = iconElement.children[0];
21103
21104
  iconElement.classList.add("proicon");
21104
21105
  iconElement.setAttribute("data-proicon-id", getIconInfo_default(iconName).kebabCase);
21105
- toReplace == true ? element.replaceWith(iconElement) : element.insertBefore(iconElement, element.childNodes[0]);
21106
+ if (toReplace) element.replaceWith(iconElement);
21107
+ else element.insertBefore(iconElement, element.childNodes[0]);
21106
21108
  }
21107
21109
  }
21108
21110
  var replace_default = replace;
@@ -45,7 +45,8 @@ function replace(rootElm, config) {
45
45
  };
46
46
  const elementConfig = {};
47
47
  if (useAttrs) {
48
- for (const [htmlAttr, optionKey] of Object.entries(propMap)) if (element.hasAttribute(htmlAttr)) {
48
+ for (const [htmlAttr, optionKey] of Object.entries(propMap)) {
49
+ if (!element.hasAttribute(htmlAttr)) continue;
49
50
  let typed = element.getAttribute(htmlAttr);
50
51
  if (propTypes[optionKey] == "number") typed = isNaN(+typed) ? void 0 : +typed;
51
52
  else if (propTypes[optionKey] == "bool") typed = typed === "true";
@@ -63,7 +64,8 @@ function replace(rootElm, config) {
63
64
  iconElement = iconElement.children[0];
64
65
  iconElement.classList.add("proicon");
65
66
  iconElement.setAttribute("data-proicon-id", getIconInfo_default(iconName).kebabCase);
66
- toReplace == true ? element.replaceWith(iconElement) : element.insertBefore(iconElement, element.childNodes[0]);
67
+ if (toReplace) element.replaceWith(iconElement);
68
+ else element.insertBefore(iconElement, element.childNodes[0]);
67
69
  }
68
70
  }
69
71
  var replace_default = replace;