@kubex/zinc 1.1.20 → 1.1.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubex/zinc",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
5
5
  "keywords": [
6
6
  "web components",
@@ -55,7 +55,3 @@ table:not(.remarkd-table) {
55
55
  .zn-table-fixed {
56
56
  table-layout: fixed;
57
57
  }
58
-
59
- thead tr:last-of-type th {
60
- border-bottom: 0;
61
- }
@@ -1,6 +1,6 @@
1
1
  import {choose} from 'lit/directives/choose.js';
2
2
  import {classMap} from "lit/directives/class-map.js";
3
- import {type CSSResultGroup, html, render, unsafeCSS} from 'lit';
3
+ import {type CSSResultGroup, html, type PropertyValues, render, unsafeCSS} from 'lit';
4
4
  import {icons} from 'lucide';
5
5
  import {property} from 'lit/decorators.js';
6
6
  import {sha256} from '../../utilities/sha256';
@@ -90,6 +90,8 @@ export default class ZnIcon extends ZincElement {
90
90
  gravatarOptions = "";
91
91
  defaultLibrary: IconLibrary = "material-symbols-outlined";
92
92
 
93
+ private libraryAutoSet = false;
94
+
93
95
  convertToLibrary(input: string): IconLibrary {
94
96
  return this.convertIndicatorToLibrary(input) ?? this.defaultLibrary
95
97
  }
@@ -140,6 +142,33 @@ export default class ZnIcon extends ZincElement {
140
142
  connectedCallback() {
141
143
  super.connectedCallback();
142
144
 
145
+ // load the material icons font if the library is set to material
146
+ render(html`
147
+ <link
148
+ href="https://cdn.jsdelivr.net/gh/kubex/icons@0.0.8/dist/kubex-icons.css"
149
+ rel="stylesheet">
150
+ <link
151
+ href="https://cdn.lineicons.com/5.0/lineicons.css"
152
+ rel="stylesheet">
153
+ <link
154
+ href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined|Material+Icons|Material+Icons+Round|Material+Icons+Sharp|Material+Icons+Two+Tone|Material+Icons+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
155
+ rel="stylesheet">`, document.head);
156
+ }
157
+
158
+ protected override willUpdate(changedProperties: PropertyValues<this>) {
159
+ super.willUpdate(changedProperties);
160
+
161
+ if (changedProperties.has('src')) {
162
+ this.parseSrc();
163
+ }
164
+ }
165
+
166
+ private parseSrc() {
167
+ if (this.libraryAutoSet) {
168
+ this.library = undefined as unknown as IconLibrary;
169
+ this.libraryAutoSet = false;
170
+ }
171
+
143
172
  let hashFragment = '';
144
173
 
145
174
  if (this.src && this.src.includes('#')) {
@@ -157,8 +186,8 @@ export default class ZnIcon extends ZincElement {
157
186
  if (libraryOrDomain.includes('.')) {
158
187
  this.library = this.library ?? "gravatar";
159
188
  } else if ((this.library === undefined) && indicatedLibrary !== undefined) {
160
- // if split[1] is a valid library name, set it
161
189
  this.library = indicatedLibrary;
190
+ this.libraryAutoSet = true;
162
191
  this.src = this.src.slice(0, atIndex);
163
192
  } else if (this.library !== undefined && indicatedLibrary === this.library) {
164
193
  this.src = this.src.slice(0, atIndex);
@@ -173,21 +202,10 @@ export default class ZnIcon extends ZincElement {
173
202
  } else if (!this.library && this.src && !this.src.includes('/')) {
174
203
  this.applyHashFragment(hashFragment);
175
204
  this.library = this.defaultLibrary;
205
+ this.libraryAutoSet = true;
176
206
  } else {
177
207
  this.applyHashFragment(hashFragment);
178
208
  }
179
-
180
- // load the material icons font if the library is set to material
181
- render(html`
182
- <link
183
- href="https://cdn.jsdelivr.net/gh/kubex/icons@0.0.8/dist/kubex-icons.css"
184
- rel="stylesheet">
185
- <link
186
- href="https://cdn.lineicons.com/5.0/lineicons.css"
187
- rel="stylesheet">
188
- <link
189
- href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined|Material+Icons|Material+Icons+Round|Material+Icons+Sharp|Material+Icons+Two+Tone|Material+Icons+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
190
- rel="stylesheet">`, document.head);
191
209
  }
192
210
 
193
211
  private applyHashFragment(hashFragment: string) {
@@ -116,7 +116,7 @@
116
116
  50% {
117
117
  background-color: rgba(var(--indicator-alt-color), 0.8);
118
118
  border-color: rgb(var(--indicator-alt-color));
119
- box-shadow: 0 0 3px 1px rgba(var(--indicator-alt-color), 0.5);
119
+ box-shadow: 0 0 4px 2px rgba(var(--indicator-alt-color), 0.5);
120
120
  }
121
121
  }
122
122