@dile/iconlib 1.2.0 → 1.2.1

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": "@dile/iconlib",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Icon Component Library based on popular libraries",
5
5
  "keywords": [
6
6
  "UI",
@@ -25,5 +25,5 @@
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },
28
- "gitHead": "56f58ba38c13479d0eb4e2a4e7ae8ad01c2b308c"
28
+ "gitHead": "d1f3c6a38a24314454f4b06376a9279d9affb05a"
29
29
  }
@@ -1,4 +1,5 @@
1
1
  import { badgeStyles } from "./lucideBadgeStyles.js";
2
+ import '../dile-lucide-icon.js';
2
3
 
3
4
  export class DileLucideBadge extends HTMLElement {
4
5
  constructor() {
@@ -6,17 +7,15 @@ export class DileLucideBadge extends HTMLElement {
6
7
  this.attachShadow({ mode: 'open' });
7
8
  this.shadowRoot.adoptedStyleSheets = [badgeStyles];
8
9
  this.icon = "dot";
9
- this.iconLabel = null;
10
10
  this.variant = null;
11
11
  this.rounded = false;
12
12
  this.render();
13
13
  }
14
14
 
15
15
  render() {
16
- const iconAriaLabel = this.iconLabel || this.icon;
17
16
  this.shadowRoot.innerHTML = `
18
17
  <div class="badge-container">
19
- <div class="icon-wrapper" role="img" aria-label="${iconAriaLabel}">
18
+ <div class="icon-wrapper">
20
19
  <dile-lucide-icon icon="${this.icon}"></dile-lucide-icon>
21
20
  </div>
22
21
  <div class="text-wrapper">
@@ -27,7 +26,7 @@ export class DileLucideBadge extends HTMLElement {
27
26
  }
28
27
 
29
28
  static get observedAttributes() {
30
- return ['icon', 'icon-label', 'variant', 'rounded'];
29
+ return ['icon', 'variant', 'rounded'];
31
30
  }
32
31
 
33
32
  attributeChangedCallback(name, oldValue, newValue) {
@@ -35,10 +34,6 @@ export class DileLucideBadge extends HTMLElement {
35
34
  this.icon = newValue;
36
35
  this.render();
37
36
  }
38
- if (name === 'icon-label') {
39
- this.iconLabel = newValue;
40
- this.render();
41
- }
42
37
  if (name === 'variant' && newValue !== null) {
43
38
  this.variant = newValue;
44
39
  }
@@ -2,14 +2,18 @@ export const badgeStyles = new CSSStyleSheet();
2
2
  badgeStyles.replaceSync(`
3
3
  :host {
4
4
  display: inline-flex;
5
+ --dile-icon-color: var(--dile-lucide-badge-on-color, var(--dile-on-primary-color, #303030));
6
+ --dile-icon-size: var(--dile-lucide-badge-icon-size, 18px);
7
+ }
8
+
9
+ .badge-container {
10
+ display: inherit;
5
11
  align-items: center;
6
12
  gap: var(--dile-lucide-badge-gap, 0.5rem);
7
13
  padding: var(--dile-lucide-badge-padding, 0.375rem 0.75rem);
8
14
  border-radius: var(--dile-lucide-badge-border-radius, 9999px);
9
15
  background-color: var(--dile-lucide-badge-color, var(--dile-primary-color, #f3f3ae));
10
16
  color: var(--dile-lucide-badge-on-color, var(--dile-on-primary-color, #303030));
11
- --dile-icon-color: var(--dile-lucide-badge-on-color, var(--dile-on-primary-color, #303030));
12
- --dile-icon-size: var(--dile-lucide-badge-icon-size, 18px);
13
17
  font-size: var(--dile-lucide-badge-font-size, 0.8rem);
14
18
  font-weight: var(--dile-lucide-badge-font-weight, 500);
15
19
  border: var(--dile-lucide-badge-border-width, 0px) solid var(--dile-lucide-badge-border-color, transparent);
@@ -18,54 +22,48 @@ badgeStyles.replaceSync(`
18
22
  transition-property: background-color, color;
19
23
  }
20
24
 
21
- :host([variant="primary"]) {
25
+ :host([variant="primary"]) .badge-container {
22
26
  background-color: var(--dile-lucide-badge-primary, var(--dile-primary-color, #f3f3ae));
23
27
  color: var(--dile-lucide-badge-on-primary, var(--dile-on-primary-color, #303030));
24
28
  --dile-icon-color: var(--dile-lucide-badge-on-primary, var(--dile-on-primary-color, #303030));
25
29
  }
26
30
 
27
- :host([variant="secondary"]) {
31
+ :host([variant="secondary"]) .badge-container {
28
32
  background-color: var(--dile-lucide-badge-secondary, var(--dile-secondary-color, #27a744));
29
33
  color: var(--dile-lucide-badge-on-secondary, var(--dile-on-secondary-color, #ffffff));
30
34
  --dile-icon-color: var(--dile-lucide-badge-on-secondary, var(--dile-on-secondary-color, #ffffff));
31
35
  }
32
36
 
33
- :host([variant="danger"]) {
37
+ :host([variant="danger"]) .badge-container {
34
38
  background-color: var(--dile-lucide-badge-danger, var(--dile-danger-color, #e34a1b));
35
39
  color: var(--dile-lucide-badge-on-danger, var(--dile-on-danger-color, #ffffff));
36
40
  --dile-icon-color: var(--dile-lucide-badge-on-danger, var(--dile-on-danger-color, #ffffff));
37
41
  }
38
42
 
39
- :host([variant="error"]) {
43
+ :host([variant="error"]) .badge-container {
40
44
  background-color: var(--dile-lucide-badge-error, var(--dile-alert-error-color, #cf3535));
41
45
  color: var(--dile-lucide-badge-on-error, var(--dile-on-alert-color, #ffffff));
42
46
  --dile-icon-color: var(--dile-lucide-badge-on-error, var(--dile-on-alert-color, #ffffff));
43
47
  }
44
48
 
45
- :host([variant="success"]) {
49
+ :host([variant="success"]) .badge-container {
46
50
  background-color: var(--dile-lucide-badge-success, var(--dile-alert-success-color, #00900f));
47
51
  color: var(--dile-lucide-badge-on-success, var(--dile-on-alert-color, #ffffff));
48
52
  --dile-icon-color: var(--dile-lucide-badge-on-success, var(--dile-on-alert-color, #ffffff));
49
53
  }
50
54
 
51
- :host([variant="warning"]) {
55
+ :host([variant="warning"]) .badge-container {
52
56
  background-color: var(--dile-lucide-badge-warning, var(--dile-alert-warning-color, #d7b740));
53
57
  color: var(--dile-lucide-badge-on-warning, var(--dile-on-alert-color, #ffffff));
54
58
  --dile-icon-color: var(--dile-lucide-badge-on-warning, var(--dile-on-alert-color, #ffffff));
55
59
  }
56
60
 
57
- :host([variant="soft"]) {
61
+ :host([variant="soft"]) .badge-container {
58
62
  background-color: var(--dile-lucide-badge-soft, #2a7a9f);
59
63
  color: var(--dile-lucide-badge-on-soft, #ffffff);
60
64
  --dile-icon-color: var(--dile-lucide-badge-on-soft, #ffffff);
61
65
  }
62
66
 
63
- .badge-container {
64
- display: inherit;
65
- align-items: inherit;
66
- gap: inherit;
67
- }
68
-
69
67
  .icon-wrapper {
70
68
  display: flex;
71
69
  align-items: center;