@skf-design-system/ui-components 1.0.2-beta.3 → 1.0.2-beta.4

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.
Files changed (39) hide show
  1. package/dist/components/alert/alert.component.d.ts +5 -1
  2. package/dist/components/alert/alert.component.js +57 -54
  3. package/dist/components/alert/alert.styles.js +51 -47
  4. package/dist/components/breadcrumb/breadcrumb-item.component.js +24 -25
  5. package/dist/components/breadcrumb/breadcrumb-item.styles.js +16 -15
  6. package/dist/components/breadcrumb/breadcrumb.component.d.ts +5 -2
  7. package/dist/components/breadcrumb/breadcrumb.component.js +51 -46
  8. package/dist/components/breadcrumb/breadcrumb.styles.js +13 -10
  9. package/dist/components/button/button.component.js +39 -39
  10. package/dist/components/button/button.styles.js +2 -1
  11. package/dist/components/card/card.component.d.ts +5 -0
  12. package/dist/components/card/card.component.js +46 -24
  13. package/dist/components/card/card.styles.js +5 -4
  14. package/dist/components/heading/heading.component.d.ts +5 -1
  15. package/dist/components/heading/heading.component.js +46 -33
  16. package/dist/components/heading/heading.styles.js +34 -36
  17. package/dist/components/icon/icon.component.d.ts +4 -0
  18. package/dist/components/icon/icon.component.js +52 -43
  19. package/dist/components/icon/icon.styles.js +60 -60
  20. package/dist/components/logo/logo.component.d.ts +4 -1
  21. package/dist/components/logo/logo.component.js +55 -51
  22. package/dist/components/logo/logo.styles.js +26 -16
  23. package/dist/components/select/select-option.component.js +8 -8
  24. package/dist/components/select/select.component.js +1 -2
  25. package/dist/components/tag/tag.component.d.ts +6 -1
  26. package/dist/components/tag/tag.component.js +66 -45
  27. package/dist/components/tag/tag.styles.js +6 -6
  28. package/dist/custom-elements.json +173 -33
  29. package/dist/internal/helpers/stateMap.d.ts +14 -0
  30. package/dist/internal/helpers/stateMap.js +68 -0
  31. package/dist/internal/helpers/watch.d.ts +1 -1
  32. package/dist/internal/helpers/watch.js +12 -12
  33. package/dist/styles/component.styles.js +37 -36
  34. package/dist/styles/global.css +1 -1
  35. package/dist/types/jsx/custom-element-jsx.d.ts +8 -5
  36. package/dist/types/vue/index.d.ts +8 -5
  37. package/dist/vscode.html-custom-data.json +6 -6
  38. package/dist/web-types.json +12 -10
  39. package/package.json +7 -7
@@ -1,8 +1,8 @@
1
1
  var u = (i) => {
2
2
  throw TypeError(i);
3
3
  };
4
- var _ = (i, s, t) => s.has(i) || u("Cannot " + t);
5
- var p = (i, s, t) => (_(i, s, "read from private field"), t ? t.call(i) : s.get(i)), v = (i, s, t) => s.has(i) ? u("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, t), $ = (i, s, t, a) => (_(i, s, "write to private field"), a ? a.call(i, t) : s.set(i, t), t);
4
+ var _ = (i, e, t) => e.has(i) || u("Cannot " + t);
5
+ var p = (i, e, t) => (_(i, e, "read from private field"), t ? t.call(i) : e.get(i)), v = (i, e, t) => e.has(i) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), $ = (i, e, t, a) => (_(i, e, "write to private field"), a ? a.call(i, t) : e.set(i, t), t);
6
6
  import "../icon/icon.js";
7
7
  import "../loader/loader.js";
8
8
  import { SkfElement as O } from "../../internal/components/skf-element.js";
@@ -13,10 +13,10 @@ import { property as r, state as P, query as m } from "lit/decorators.js";
13
13
  import { classMap as L } from "lit/directives/class-map.js";
14
14
  import { ifDefined as g } from "lit/directives/if-defined.js";
15
15
  import { styles as C } from "./button.styles.js";
16
- var F = Object.defineProperty, k = Object.getOwnPropertyDescriptor, o = (i, s, t, a) => {
17
- for (var n = a > 1 ? void 0 : a ? k(s, t) : s, h = i.length - 1, d; h >= 0; h--)
18
- (d = i[h]) && (n = (a ? d(s, t, n) : d(n)) || n);
19
- return a && n && F(s, t, n), n;
16
+ var F = Object.defineProperty, q = Object.getOwnPropertyDescriptor, s = (i, e, t, a) => {
17
+ for (var n = a > 1 ? void 0 : a ? q(e, t) : e, h = i.length - 1, d; h >= 0; h--)
18
+ (d = i[h]) && (n = (a ? d(e, t, n) : d(n)) || n);
19
+ return a && n && F(e, t, n), n;
20
20
  }, l;
21
21
  const c = class c extends O {
22
22
  constructor() {
@@ -34,7 +34,7 @@ const c = class c extends O {
34
34
  }, this._resetForm = () => {
35
35
  var t;
36
36
  (t = p(this, l).form) == null || t.reset();
37
- }, this._renderIcon = () => y`<skf-icon class="skf-icon-host" name=${g(this.icon)}></skf-icon>`, $(this, l, this.attachInternals());
37
+ }, this._renderIcon = () => y`<skf-icon data-color="custom" name=${g(this.icon)}></skf-icon>`, $(this, l, this.attachInternals());
38
38
  }
39
39
  firstUpdated(t) {
40
40
  if (t.has("loading") && this.loading) {
@@ -91,52 +91,52 @@ const c = class c extends O {
91
91
  }
92
92
  };
93
93
  l = new WeakMap(), c.styles = [w, C], c.formAssociated = !0, c.shadowRootOptions = { ...z.shadowRootOptions, delegatesFocus: !0 };
94
- let e = c;
95
- o([
94
+ let o = c;
95
+ s([
96
96
  r({ type: Boolean })
97
- ], e.prototype, "destructive", 2);
98
- o([
97
+ ], o.prototype, "destructive", 2);
98
+ s([
99
99
  r({ type: Boolean })
100
- ], e.prototype, "disabled", 2);
101
- o([
100
+ ], o.prototype, "disabled", 2);
101
+ s([
102
102
  r()
103
- ], e.prototype, "icon", 2);
104
- o([
103
+ ], o.prototype, "icon", 2);
104
+ s([
105
105
  r({ type: Boolean, attribute: "icon-only" })
106
- ], e.prototype, "iconOnly", 2);
107
- o([
106
+ ], o.prototype, "iconOnly", 2);
107
+ s([
108
108
  r({ attribute: "icon-position" })
109
- ], e.prototype, "iconPosition", 2);
110
- o([
109
+ ], o.prototype, "iconPosition", 2);
110
+ s([
111
111
  r({ type: Boolean, reflect: !0 })
112
- ], e.prototype, "loading", 2);
113
- o([
112
+ ], o.prototype, "loading", 2);
113
+ s([
114
114
  r({ type: Boolean, attribute: "no-validate" })
115
- ], e.prototype, "noValidate", 2);
116
- o([
115
+ ], o.prototype, "noValidate", 2);
116
+ s([
117
117
  r({ reflect: !0 })
118
- ], e.prototype, "size", 2);
119
- o([
118
+ ], o.prototype, "size", 2);
119
+ s([
120
120
  r()
121
- ], e.prototype, "type", 2);
122
- o([
121
+ ], o.prototype, "type", 2);
122
+ s([
123
123
  r({ reflect: !0 })
124
- ], e.prototype, "variant", 2);
125
- o([
124
+ ], o.prototype, "variant", 2);
125
+ s([
126
126
  P()
127
- ], e.prototype, "_loaderVisible", 2);
128
- o([
127
+ ], o.prototype, "_loaderVisible", 2);
128
+ s([
129
129
  m("skf-loader")
130
- ], e.prototype, "$loader", 2);
131
- o([
130
+ ], o.prototype, "$loader", 2);
131
+ s([
132
132
  m("#body")
133
- ], e.prototype, "$body", 2);
134
- o([
133
+ ], o.prototype, "$body", 2);
134
+ s([
135
135
  m("button")
136
- ], e.prototype, "$button", 2);
137
- o([
136
+ ], o.prototype, "$button", 2);
137
+ s([
138
138
  V("loading", { afterUpdate: !0 })
139
- ], e.prototype, "_handleLoadingChange", 1);
139
+ ], o.prototype, "_handleLoadingChange", 1);
140
140
  export {
141
- e as SkfButton
141
+ o as SkfButton
142
142
  };
@@ -49,7 +49,8 @@ const r = o`
49
49
 
50
50
  .btn--icon-only {
51
51
  aspect-ratio: 1;
52
- place-items: center;
52
+ display: inherit;
53
+ place-content: center;
53
54
  }
54
55
 
55
56
  /**
@@ -7,9 +7,12 @@ import { type CSSResultGroup } from 'lit';
7
7
  *
8
8
  * @slot - The card's main content
9
9
  *
10
+ * @cssproperty --mod-card-bg-color - Ability to set a custom background color
11
+ *
10
12
  * @tagname skf-card
11
13
  */
12
14
  export declare class SkfCard extends SkfElement {
15
+ #private;
13
16
  static styles: CSSResultGroup;
14
17
  /** If true, removes border */
15
18
  noBorder: boolean;
@@ -17,5 +20,7 @@ export declare class SkfCard extends SkfElement {
17
20
  noPadding: boolean;
18
21
  /** If true, the Card fills the parent element height */
19
22
  stretch: boolean;
23
+ /** @internal */
24
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
20
25
  render(): import("lit").TemplateResult<1>;
21
26
  }
@@ -1,32 +1,54 @@
1
- import { SkfElement as f } from "../../internal/components/skf-element.js";
2
- import { componentStyles as m } from "../../styles/component.styles.js";
3
- import { html as d } from "lit";
4
- import { property as o } from "lit/decorators.js";
5
- import { styles as u } from "./card.styles.js";
6
- var c = Object.defineProperty, s = (p, l, i, y) => {
7
- for (var t = void 0, r = p.length - 1, a; r >= 0; r--)
8
- (a = p[r]) && (t = a(l, i, t) || t);
9
- return t && c(l, i, t), t;
1
+ var g = (t) => {
2
+ throw TypeError(t);
10
3
  };
11
- const n = class n extends f {
4
+ var u = (t, e, o) => e.has(t) || g("Cannot " + o);
5
+ var m = (t, e, o) => (u(t, e, "read from private field"), o ? o.call(t) : e.get(t)), d = (t, e, o) => e.has(t) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, o), c = (t, e, o, s) => (u(t, e, "write to private field"), s ? s.call(t, o) : e.set(t, o), o);
6
+ import { SkfElement as b } from "../../internal/components/skf-element.js";
7
+ import { stateMap as v } from "../../internal/helpers/stateMap.js";
8
+ import { watch as P } from "../../internal/helpers/watch.js";
9
+ import { componentStyles as B } from "../../styles/component.styles.js";
10
+ import { html as O } from "lit";
11
+ import { property as f } from "lit/decorators.js";
12
+ import { styles as j } from "./card.styles.js";
13
+ var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, i = (t, e, o, s) => {
14
+ for (var r = s > 1 ? void 0 : s ? x(e, o) : e, h = t.length - 1, l; h >= 0; h--)
15
+ (l = t[h]) && (r = (s ? l(e, o, r) : l(r)) || r);
16
+ return s && r && w(e, o, r), r;
17
+ };
18
+ const _ = {
19
+ noBorder: "no-border",
20
+ noPadding: "no-padding",
21
+ stretch: "stretch"
22
+ };
23
+ var p, a;
24
+ const y = class y extends b {
12
25
  constructor() {
13
- super(...arguments), this.noBorder = !1, this.noPadding = !1, this.stretch = !1;
26
+ super(...arguments);
27
+ d(this, p);
28
+ d(this, a);
29
+ c(this, p, this.attachInternals()), c(this, a, m(this, p).states), this.noBorder = !1, this.noPadding = !1, this.stretch = !1;
30
+ }
31
+ _handleStateChange(o, s, r) {
32
+ v(m(this, a), _[o]).set(r);
14
33
  }
15
34
  render() {
16
- return d`<slot id="root"></slot>`;
35
+ return O`<slot id="root"></slot>`;
17
36
  }
18
37
  };
19
- n.styles = [m, u];
20
- let e = n;
21
- s([
22
- o({ type: Boolean, reflect: !0, attribute: "no-border" })
23
- ], e.prototype, "noBorder");
24
- s([
25
- o({ type: Boolean, reflect: !0, attribute: "no-padding" })
26
- ], e.prototype, "noPadding");
27
- s([
28
- o({ type: Boolean, reflect: !0 })
29
- ], e.prototype, "stretch");
38
+ p = new WeakMap(), a = new WeakMap(), y.styles = [B, j];
39
+ let n = y;
40
+ i([
41
+ f({ type: Boolean, attribute: "no-border" })
42
+ ], n.prototype, "noBorder", 2);
43
+ i([
44
+ f({ type: Boolean, attribute: "no-padding" })
45
+ ], n.prototype, "noPadding", 2);
46
+ i([
47
+ f({ type: Boolean })
48
+ ], n.prototype, "stretch", 2);
49
+ i([
50
+ P(Object.keys(_))
51
+ ], n.prototype, "_handleStateChange", 1);
30
52
  export {
31
- e as SkfCard
53
+ n as SkfCard
32
54
  };
@@ -7,11 +7,12 @@ const a = r`
7
7
  }
8
8
 
9
9
  #root {
10
+ --_skf-card-bg-color: var(--mod-card-bg-color, var(--skf-bg-color-neutral-1));
10
11
  --_skf-card-border-color: var(--skf-border-color-tertiary);
11
12
  --_skf-card-padding: var(--skf-spacing-100);
12
13
  --_skf-card-shadow: var(--skf-shadow-md);
13
14
 
14
- background-color: var(--skf-bg-color-neutral-1);
15
+ background-color: var(--_skf-card-bg-color);
15
16
  border: var(--skf-border-width-sm) solid var(--_skf-card-border-color);
16
17
  border-radius: var(--skf-border-radius-sm);
17
18
  box-shadow: var(--_skf-card-shadow);
@@ -21,20 +22,20 @@ const a = r`
21
22
  }
22
23
 
23
24
  @layer mods {
24
- :host([no-border]) {
25
+ :host(:state(no-border)) {
25
26
  #root {
26
27
  --_skf-card-border-color: transparent;
27
28
  --_skf-card-shadow: none;
28
29
  }
29
30
  }
30
31
 
31
- :host([no-padding]) {
32
+ :host(:state(no-padding)) {
32
33
  #root {
33
34
  --_skf-card-padding: 0;
34
35
  }
35
36
  }
36
37
 
37
- :host([stretch]) {
38
+ :host(:state(stretch)) {
38
39
  block-size: 100%;
39
40
 
40
41
  #root {
@@ -10,10 +10,14 @@ import { type CSSResultGroup } from 'lit';
10
10
  * @tagname skf-heading
11
11
  */
12
12
  export declare class SkfHeading extends SkfElement {
13
+ #private;
13
14
  static styles: CSSResultGroup;
14
15
  /** Controls which heading element will be rendered. Should not be used to affect appearance */
15
16
  as: HeadingType;
16
17
  /** If defined, changes the appearance of the heading */
17
18
  styledAs?: HeadingType;
18
- render(): import("lit").TemplateResult;
19
+ connectedCallback(): void;
20
+ /** @internal */
21
+ _handleStateChange(): void;
22
+ render(): import("lit").TemplateResult<1>;
19
23
  }
@@ -1,49 +1,62 @@
1
- import { SkfElement as f } from "../../internal/components/skf-element.js";
2
- import { componentStyles as c } from "../../styles/component.styles.js";
3
- import "lit";
4
- import { property as h } from "lit/decorators.js";
5
- import { literal as e, html as u } from "lit/static-html.js";
6
- import { styles as n } from "./heading.styles.js";
7
- var y = Object.defineProperty, m = (l, t, i, d) => {
8
- for (var r = void 0, o = l.length - 1, p; o >= 0; o--)
9
- (p = l[o]) && (r = p(t, i, r) || r);
10
- return r && y(t, i, r), r;
1
+ var y = (t) => {
2
+ throw TypeError(t);
11
3
  };
12
- const a = class a extends f {
4
+ var d = (t, e, s) => e.has(t) || y("Cannot " + s);
5
+ var n = (t, e, s) => (d(t, e, "read from private field"), s ? s.call(t) : e.get(t)), c = (t, e, s) => e.has(t) ? y("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), m = (t, e, s, r) => (d(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
6
+ import { SkfElement as b } from "../../internal/components/skf-element.js";
7
+ import { stateMap as _ } from "../../internal/helpers/stateMap.js";
8
+ import { watch as C } from "../../internal/helpers/watch.js";
9
+ import { componentStyles as g } from "../../styles/component.styles.js";
10
+ import { html as w } from "lit";
11
+ import { property as v } from "lit/decorators.js";
12
+ import { styles as L } from "./heading.styles.js";
13
+ var O = Object.defineProperty, P = Object.getOwnPropertyDescriptor, f = (t, e, s, r) => {
14
+ for (var a = r > 1 ? void 0 : r ? P(e, s) : e, l = t.length - 1, p; l >= 0; l--)
15
+ (p = t[l]) && (a = (r ? p(e, s, a) : p(a)) || a);
16
+ return r && a && O(e, s, a), a;
17
+ }, h, i;
18
+ const u = class u extends b {
13
19
  constructor() {
14
- super(...arguments), this.as = "h2";
20
+ super(...arguments);
21
+ c(this, h);
22
+ c(this, i);
23
+ m(this, h, this.attachInternals()), m(this, i, n(this, h).states), this.as = "h2";
15
24
  }
16
- render() {
17
- let t;
18
- switch (!0) {
25
+ connectedCallback() {
26
+ switch (super.connectedCallback(), this.role = "heading", !0) {
19
27
  case this.as === "h1":
20
- t = e`h1`;
28
+ this.ariaLevel = "1";
21
29
  break;
22
30
  case this.as === "h3":
23
- t = e`h3`;
31
+ this.ariaLevel = "3";
24
32
  break;
25
33
  case this.as === "h4":
26
- t = e`h4`;
34
+ this.ariaLevel = "4";
27
35
  break;
28
36
  default:
29
- t = e`h2`;
37
+ this.ariaLevel = "2";
30
38
  break;
31
39
  }
32
- return u`
33
- <${t} id="root">
34
- <slot></slot>
35
- </${t}>
36
- `;
40
+ }
41
+ _handleStateChange() {
42
+ const s = ["h1", "h2", "h3", "h4"];
43
+ _(n(this, i), s).set(this.styledAs);
44
+ }
45
+ render() {
46
+ return w`<slot data-as=${this.as} id="root"></slot>`;
37
47
  }
38
48
  };
39
- a.styles = [c, n];
40
- let s = a;
41
- m([
42
- h({ reflect: !0 })
43
- ], s.prototype, "as");
44
- m([
45
- h({ attribute: "styled-as", reflect: !0 })
46
- ], s.prototype, "styledAs");
49
+ h = new WeakMap(), i = new WeakMap(), u.styles = [g, L];
50
+ let o = u;
51
+ f([
52
+ v({ type: String, reflect: !0, useDefault: !0 })
53
+ ], o.prototype, "as", 2);
54
+ f([
55
+ v({ type: String, attribute: "styled-as" })
56
+ ], o.prototype, "styledAs", 2);
57
+ f([
58
+ C("styledAs")
59
+ ], o.prototype, "_handleStateChange", 1);
47
60
  export {
48
- s as SkfHeading
61
+ o as SkfHeading
49
62
  };
@@ -1,57 +1,55 @@
1
1
  import { css as s } from "lit";
2
2
  const t = s`
3
3
  @layer components {
4
- :host {
5
- display: contents;
6
- }
7
-
8
- #root {
9
- color: var(--skf-text-color-primary);
10
- font-size: var(--_skf-heading-size);
11
- font-weight: var(--_skf-heading-weight);
12
- line-height: 1.2;
13
-
14
- /* Defaults */
15
- :host([as='h1']) & {
16
- --_skf-heading-size: var(--skf-font-size-700);
17
- --_skf-heading-weight: var(--skf-font-weight-regular);
18
- }
19
-
20
- :host(:is([as='h2'], [as='h3'], [as='h4'])) & {
21
- --_skf-heading-weight: var(--skf-font-weight-bold);
22
- }
23
-
24
- :host([as='h2']) & {
25
- --_skf-heading-size: var(--skf-font-size-300);
26
- }
27
-
28
- :host([as='h3']) & {
29
- --_skf-heading-size: var(--skf-font-size-200);
30
- }
31
-
32
- :host([as='h4']) & {
33
- --_skf-heading-size: var(--skf-font-size-200);
4
+ @layer base {
5
+ #root {
6
+ color: var(--skf-text-color-primary);
7
+ font-size: var(--_skf-heading-size);
8
+ font-weight: var(--_skf-heading-weight);
9
+ line-height: 1.2;
10
+
11
+ &[data-as='h1'] {
12
+ --_skf-heading-size: var(--skf-font-size-700);
13
+ --_skf-heading-weight: var(--skf-font-weight-regular);
14
+ }
15
+
16
+ &:is([data-as='h2'], [data-as='h3'], [data-as='h4']) {
17
+ --_skf-heading-weight: var(--skf-font-weight-bold);
18
+ }
19
+
20
+ &[data-as='h2'] {
21
+ --_skf-heading-size: var(--skf-font-size-300);
22
+ }
23
+
24
+ &[data-as='h3'] {
25
+ --_skf-heading-size: var(--skf-font-size-200);
26
+ }
27
+
28
+ &[data-as='h4'] {
29
+ --_skf-heading-size: var(--skf-font-size-200);
30
+ }
34
31
  }
32
+ }
35
33
 
36
- /** Styled As */
37
- :host([styled-as='h1']) & {
34
+ @layer mods {
35
+ :host(:state(h1)) #root {
38
36
  --_skf-heading-size: var(--skf-font-size-700);
39
37
  --_skf-heading-weight: var(--skf-font-weight-regular);
40
38
  }
41
39
 
42
- :host(:is([styled-as='h2'], [styled-as='h3'], [styled-as='h4'])) & {
40
+ :host(:is(:state(h2), :state(h3), :state(h4))) #root {
43
41
  --_skf-heading-weight: var(--skf-font-weight-bold);
44
42
  }
45
43
 
46
- :host([styled-as='h2']) & {
44
+ :host(:state(h2)) #root {
47
45
  --_skf-heading-size: var(--skf-font-size-300);
48
46
  }
49
47
 
50
- :host([styled-as='h3']) & {
48
+ :host(:state(h3)) #root {
51
49
  --_skf-heading-size: var(--skf-font-size-200);
52
50
  }
53
51
 
54
- :host([styled-as='h4']) & {
52
+ :host(:state(h4)) #root {
55
53
  --_skf-heading-size: var(--skf-font-size-200);
56
54
  }
57
55
  }
@@ -11,6 +11,7 @@ type SkfIconSize = IconSize;
11
11
  * @tagname skf-icon
12
12
  */
13
13
  export declare class SkfIcon extends SkfElement {
14
+ #private;
14
15
  static styles: CSSResultGroup;
15
16
  /** Sets the color of the icon */
16
17
  color: IconColor;
@@ -20,6 +21,9 @@ export declare class SkfIcon extends SkfElement {
20
21
  name: Icon;
21
22
  /** Size of the icon */
22
23
  size: SkfIconSize;
24
+ connectedCallback(): void;
25
+ /** @internal */
26
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
23
27
  render(): import("lit").TemplateResult<1>;
24
28
  }
25
29
  export {};
@@ -1,51 +1,60 @@
1
- import { SkfElement as f } from "../../internal/components/skf-element.js";
2
- import { ICONS as c } from "@skf-design-system/ui-assets";
3
- import { componentStyles as d } from "../../styles/component.styles.js";
4
- import { html as h } from "lit";
5
- import { property as t } from "lit/decorators.js";
6
- import { classMap as u } from "lit/directives/class-map.js";
7
- import { ifDefined as s } from "lit/directives/if-defined.js";
8
- import { styles as v } from "./icon.styles.js";
9
- var y = Object.defineProperty, o = (m, p, a, $) => {
10
- for (var r = void 0, i = m.length - 1, n; i >= 0; i--)
11
- (n = m[i]) && (r = n(p, a, r) || r);
12
- return r && y(p, a, r), r;
1
+ var u = (t) => {
2
+ throw TypeError(t);
13
3
  };
14
- const l = class l extends f {
4
+ var g = (t, e, r) => e.has(t) || u("Cannot " + r);
5
+ var c = (t, e, r) => (g(t, e, "read from private field"), r ? r.call(t) : e.get(t)), y = (t, e, r) => e.has(t) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), d = (t, e, r, o) => (g(t, e, "write to private field"), o ? o.call(t, r) : e.set(t, r), r);
6
+ import { SkfElement as v } from "../../internal/components/skf-element.js";
7
+ import { stateMap as b } from "../../internal/helpers/stateMap.js";
8
+ import { watch as _ } from "../../internal/helpers/watch.js";
9
+ import { ICONS as S } from "@skf-design-system/ui-assets";
10
+ import { componentStyles as C } from "../../styles/component.styles.js";
11
+ import { html as O } from "lit";
12
+ import { property as n } from "lit/decorators.js";
13
+ import { styles as w } from "./icon.styles.js";
14
+ var z = Object.defineProperty, P = Object.getOwnPropertyDescriptor, p = (t, e, r, o) => {
15
+ for (var s = o > 1 ? void 0 : o ? P(e, r) : e, m = t.length - 1, h; m >= 0; m--)
16
+ (h = t[m]) && (s = (o ? h(e, r, s) : h(s)) || s);
17
+ return o && s && z(e, r, s), s;
18
+ };
19
+ const x = {
20
+ color: ["emphasised", "error", "info", "inverse", "primary", "secondary", "success", "warning"],
21
+ size: ["lg", "md", "sm", "xs"]
22
+ };
23
+ var a, l;
24
+ const f = class f extends v {
15
25
  constructor() {
16
- super(...arguments), this.color = "primary", this.size = "md";
26
+ super(...arguments);
27
+ y(this, a);
28
+ y(this, l);
29
+ d(this, a, this.attachInternals()), d(this, l, c(this, a).states), this.color = "primary", this.size = "md";
30
+ }
31
+ connectedCallback() {
32
+ super.connectedCallback(), this.ariaHidden = this.label ? null : "true", this.ariaLabel = this.label ?? null, this.role = this.label ? "img" : null;
33
+ }
34
+ _handleStateChange(r, o, s) {
35
+ b(c(this, l), x[r]).set(s);
17
36
  }
18
37
  render() {
19
- return h`
20
- <div
21
- aria-hidden=${s(this.label ? void 0 : "true")}
22
- aria-label=${s(this.label)}
23
- class=${u({
24
- icon: !0,
25
- [`icon--color-${this.color}`]: !0,
26
- [`icon--size-${this.size}`]: !0
27
- })}
28
- role=${s(this.label ? "img" : void 0)}
29
- >
30
- ${c[this.name]}
31
- </div>
32
- `;
38
+ return O`<div id="root">${S[this.name]}</div>`;
33
39
  }
34
40
  };
35
- l.styles = [d, v];
36
- let e = l;
37
- o([
38
- t({ reflect: !0 })
39
- ], e.prototype, "color");
40
- o([
41
- t()
42
- ], e.prototype, "label");
43
- o([
44
- t()
45
- ], e.prototype, "name");
46
- o([
47
- t({ reflect: !0 })
48
- ], e.prototype, "size");
41
+ a = new WeakMap(), l = new WeakMap(), f.styles = [C, w];
42
+ let i = f;
43
+ p([
44
+ n({ type: String })
45
+ ], i.prototype, "color", 2);
46
+ p([
47
+ n({ type: String })
48
+ ], i.prototype, "label", 2);
49
+ p([
50
+ n({ type: String })
51
+ ], i.prototype, "name", 2);
52
+ p([
53
+ n({ type: String })
54
+ ], i.prototype, "size", 2);
55
+ p([
56
+ _(["color", "size"])
57
+ ], i.prototype, "_handleStateChange", 1);
49
58
  export {
50
- e as SkfIcon
59
+ i as SkfIcon
51
60
  };