Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spectrum-web-components/iconset

Package Overview
Dependencies
Maintainers
13
Versions
290
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/iconset - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1-color-testing

6

package.json
{
"name": "@spectrum-web-components/iconset",
"version": "1.0.0",
"version": "1.0.1-color-testing",
"publishConfig": {

@@ -63,3 +63,3 @@ "access": "public"

"dependencies": {
"@spectrum-web-components/base": "^1.0.0"
"@spectrum-web-components/base": "^1.0.1-color-testing"
},

@@ -75,3 +75,3 @@ "types": "./src/index.d.ts",

],
"gitHead": "5cf5d34645bf9494ebd20f64c42d1619523d2d84"
"gitHead": "17e14b4a9fa2c8b15df158ea7d77ce09bf50de82"
}

@@ -70,2 +70,3 @@ "use strict";

this.icons = [];
this.filteredIcons = [];
this.unsubscribeSystemContext = null;

@@ -80,3 +81,2 @@ this.spectrumVersion = 1;

super.connectedCallback();
this.requestSystemContext();
window.addEventListener("sp-iconset-added", this.handleIconSetAdded);

@@ -92,15 +92,20 @@ }

}
requestSystemContext() {
this.dispatchEvent(
new CustomEvent("sp-system-context", {
detail: {
callback: (system, unsubscribe) => {
this.spectrumVersion = system === "spectrum-two" ? 2 : 1;
this.unsubscribeSystemContext = unsubscribe;
}
},
bubbles: true,
composed: true
})
);
filterIconsBySpectrumVersion() {
const iconVersion = this.spectrumVersion === 2 ? "s2" : "s1";
let filteredIcons = this.icons;
if (this.name === "workflow") {
filteredIcons = filteredIcons.filter((icon) => {
const iconName = icon.name.replace(/\s/g, "").toLowerCase();
return iconsList[iconVersion].includes(iconName);
});
}
const iconSet = /* @__PURE__ */ new Set();
filteredIcons = filteredIcons.filter((icon) => {
if (iconSet.has(icon.name)) {
return false;
}
iconSet.add(icon.name);
return true;
});
this.filteredIcons = filteredIcons;
}

@@ -110,3 +115,7 @@ update(changes) {

this.spectrumVersion = this.systemResolver.system === "spectrum-two" ? 2 : 1;
this.filterIconsBySpectrumVersion();
}
if (changes.has("icons")) {
this.filterIconsBySpectrumVersion();
}
super.update(changes);

@@ -197,10 +206,5 @@ }

renderSearch() {
let matchingIcons = this.search ? this.icons.filter(
const matchingIcons = this.search ? this.filteredIcons.filter(
(icon) => icon.name.toLowerCase().includes(this.search.toLowerCase())
) : this.icons;
const iconVersion = this.spectrumVersion === 2 ? "s2" : "s1";
matchingIcons = matchingIcons.filter((icon) => {
const iconName = icon.name.replace(/\s/g, "").toLowerCase();
return iconsList[iconVersion].includes(iconName);
});
) : this.filteredIcons;
return html`

@@ -219,4 +223,4 @@ <div class="search" part="search">

<sp-help-text slot="help-text">
Showing ${matchingIcons.length} of ${this.icons.length}
available icons.
Showing ${matchingIcons.length} of
${this.filteredIcons.length} available icons.
</sp-help-text>

@@ -244,3 +248,3 @@ </sp-search>

return html`
${this.icons.length ? this.renderSearch() : html`
${this.filteredIcons.length ? this.renderSearch() : html`
<slot></slot>

@@ -247,0 +251,0 @@ `}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc