@skf-design-system/ui-components 1.0.0-beta.4 → 1.0.0-beta.5

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 (98) hide show
  1. package/README.md +26 -6
  2. package/dist/components/accordion/accordion.component.d.ts +9 -5
  3. package/dist/components/accordion/accordion.component.js +22 -19
  4. package/dist/components/accordion/accordion.d.ts +1 -1
  5. package/dist/components/accordion/accordion.styles.js +3 -3
  6. package/dist/components/alert/alert.component.d.ts +7 -4
  7. package/dist/components/alert/alert.component.js +21 -19
  8. package/dist/components/alert/alert.styles.js +50 -47
  9. package/dist/components/button/button.component.d.ts +2 -0
  10. package/dist/components/button/button.component.js +6 -6
  11. package/dist/components/button/button.styles.js +1 -1
  12. package/dist/components/card/card.component.d.ts +3 -3
  13. package/dist/components/card/card.component.js +16 -19
  14. package/dist/components/card/card.styles.js +11 -3
  15. package/dist/components/checkbox/checkbox.component.d.ts +9 -6
  16. package/dist/components/checkbox/checkbox.component.js +7 -7
  17. package/dist/components/checkbox/checkbox.styles.js +7 -2
  18. package/dist/components/checkbox/checkbox.test.d.ts +1 -0
  19. package/dist/components/collapse/collapse.component.d.ts +9 -6
  20. package/dist/components/collapse/collapse.component.js +39 -36
  21. package/dist/components/collapse/collapse.styles.js +3 -3
  22. package/dist/components/collapse/collapse.test.d.ts +1 -0
  23. package/dist/components/divider/divider.component.d.ts +13 -10
  24. package/dist/components/divider/divider.component.js +34 -29
  25. package/dist/components/divider/divider.styles.js +1 -5
  26. package/dist/components/heading/heading.component.d.ts +12 -2
  27. package/dist/components/heading/heading.component.js +14 -14
  28. package/dist/components/heading/heading.styles.js +1 -1
  29. package/dist/components/icon/icon.component.d.ts +14 -8
  30. package/dist/components/icon/icon.component.js +6 -6
  31. package/dist/components/icon/icon.styles.js +56 -54
  32. package/dist/components/input/input.component.d.ts +43 -29
  33. package/dist/components/input/input.component.js +46 -36
  34. package/dist/components/link/link.component.d.ts +15 -12
  35. package/dist/components/link/link.component.js +7 -7
  36. package/dist/components/link/link.styles.js +1 -1
  37. package/dist/components/loader/loader.component.d.ts +7 -7
  38. package/dist/components/loader/loader.component.js +35 -61
  39. package/dist/components/loader/loader.styles.js +42 -10
  40. package/dist/components/logo/logo.component.d.ts +5 -3
  41. package/dist/components/logo/logo.component.js +8 -8
  42. package/dist/components/logo/logo.styles.js +2 -2
  43. package/dist/components/radio/radio.component.d.ts +15 -13
  44. package/dist/components/radio/radio.component.js +3 -3
  45. package/dist/components/radio/radio.styles.js +6 -1
  46. package/dist/components/select/select.component.d.ts +12 -10
  47. package/dist/components/select/select.component.js +113 -100
  48. package/dist/components/select/select.controllers.js +5 -2
  49. package/dist/components/select/select.styles.js +18 -3
  50. package/dist/components/select-option/select-option.component.d.ts +2 -2
  51. package/dist/components/select-option/select-option.component.js +16 -10
  52. package/dist/components/switch/switch.component.d.ts +2 -3
  53. package/dist/components/switch/switch.component.js +1 -1
  54. package/dist/components/switch/switch.styles.js +6 -1
  55. package/dist/components/switch/switch.test.d.ts +1 -0
  56. package/dist/components/tag/tag.component.d.ts +12 -7
  57. package/dist/components/tag/tag.component.js +24 -24
  58. package/dist/components/tag/tag.styles.js +6 -1
  59. package/dist/components/textarea/textarea.component.d.ts +26 -23
  60. package/dist/components/textarea/textarea.component.js +15 -12
  61. package/dist/components/toast/toast.component.d.ts +35 -0
  62. package/dist/components/toast/toast.component.js +52 -0
  63. package/dist/components/toast/toast.d.ts +8 -0
  64. package/dist/components/toast/toast.js +6 -0
  65. package/dist/components/toast/toast.singleton.d.ts +26 -0
  66. package/dist/components/toast/toast.singleton.js +53 -0
  67. package/dist/components/toast/toast.style.d.ts +1 -0
  68. package/dist/components/toast/toast.style.js +9 -0
  69. package/dist/components/toast-item/toast-item.component.d.ts +21 -0
  70. package/dist/components/toast-item/toast-item.component.js +65 -0
  71. package/dist/components/toast-item/toast-item.d.ts +6 -0
  72. package/dist/components/toast-item/toast-item.js +2 -0
  73. package/dist/components/toast-item/toast-item.style.d.ts +2 -0
  74. package/dist/components/toast-item/toast-item.style.js +16 -0
  75. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
  76. package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
  77. package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
  78. package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
  79. package/dist/components/toast-wrapper/toast-wrapper.style.d.ts +1 -0
  80. package/dist/components/toast-wrapper/toast-wrapper.style.js +20 -0
  81. package/dist/custom-elements.json +676 -238
  82. package/dist/index.d.ts +1 -0
  83. package/dist/index.js +43 -40
  84. package/dist/internal/components/hint/hint.component.js +12 -10
  85. package/dist/internal/components/hint/hint.styles.js +26 -10
  86. package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -8
  87. package/dist/react/index.d.ts +5 -3
  88. package/dist/react/index.js +5 -3
  89. package/dist/react/skf-toast/index.d.ts +3 -0
  90. package/dist/react/skf-toast/index.js +13 -0
  91. package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
  92. package/dist/react/skf-toast-wrapper/index.js +13 -0
  93. package/dist/styles/form-field.styles.js +5 -1
  94. package/dist/types/jsx/custom-element-jsx.d.ts +88 -50
  95. package/dist/types/vue/index.d.ts +91 -51
  96. package/dist/vscode.html-custom-data.json +101 -62
  97. package/dist/web-types.json +208 -122
  98. package/package.json +3 -3
@@ -8,12 +8,17 @@ const i = [
8
8
  contain: initial;
9
9
  }
10
10
 
11
- #checkbox {
11
+ #root {
12
12
  align-items: center;
13
+ color: var(--_skf-checkbox-color, var(--skf-text-color-primary));
13
14
  display: grid;
14
15
  grid-gap: var(--skf-spacing-50);
15
16
  grid-template: 'input label' / auto minmax(0, 1fr);
16
17
 
18
+ :host([disabled]) & {
19
+ --_skf-checkbox-color: var(--skf-interactive-text-color-disabled);
20
+ }
21
+
17
22
  :host([size='sm']) & {
18
23
  --_skf-checkbox-size: var(--skf-size-20);
19
24
 
@@ -57,7 +62,7 @@ const i = [
57
62
  }
58
63
 
59
64
  :host([valid]) & {
60
- --_skf-checkbox-border-color: var(--skf-severity-fg-color-error);
65
+ --_skf-checkbox-border-color: var(--skf-severity-fg-color-success);
61
66
  }
62
67
 
63
68
  :host([severity='alert']:not([invalid], [valid])) & {
@@ -0,0 +1 @@
1
+ export {};
@@ -5,7 +5,7 @@ import type { CSSResultGroup } from 'lit';
5
5
  /**
6
6
  * The `<skf-collapse>` component is a general purpose container for content that can be collapsed / expanded.
7
7
  *
8
- * See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229e2eb8a8dacf366dc3243) for design principles.
8
+ * See [zeroheight](https://zeroheight.com/853e936c9/p/6590bf-accordion) for design principles.
9
9
  *
10
10
  * @event {CustomEvent} skf-collapse-toggle - Event emitted when toggled
11
11
  *
@@ -16,17 +16,20 @@ import type { CSSResultGroup } from 'lit';
16
16
  export declare class SkfCollapse extends SkfElement {
17
17
  static styles: CSSResultGroup;
18
18
  /** If true, will animate the expand/collapse state */
19
- animated: boolean;
19
+ animated?: boolean;
20
20
  /** If true, will set the collapse to be expanded by default */
21
- expanded: boolean;
21
+ expanded?: boolean;
22
22
  /** Heading for the collapse */
23
23
  heading?: string;
24
- /** Controls which heading element will be rendered */
24
+ /**
25
+ * Defines which heading element will be rendered
26
+ * @type { "h1" | "h2" | "h3" | "h4" }
27
+ */
25
28
  headingAs: Exclude<HeadingType, 'h1'>;
26
29
  /** If true, renders the small version */
27
- small: boolean;
30
+ small?: boolean;
28
31
  /** If true, will truncate the heading in collapsed state */
29
- truncate: boolean;
32
+ truncate?: boolean;
30
33
  /** Class method as alternative to manipulate attribute */
31
34
  setClose(): void;
32
35
  /** Class method as alternative to manipulate attribute */
@@ -1,17 +1,18 @@
1
1
  import "../icon/icon.js";
2
2
  import { SkfElement as h } from "../../internal/components/skf-element.js";
3
3
  import m from "../../styles/component.styles.js";
4
- import { property as a } from "lit/decorators.js";
5
- import { html as c, unsafeStatic as l } from "lit/static-html.js";
6
- import u from "./collapse.styles.js";
7
- var f = Object.defineProperty, s = (o, r, d, y) => {
8
- for (var t = void 0, i = o.length - 1, p; i >= 0; i--)
9
- (p = o[i]) && (t = p(r, d, t) || t);
10
- return t && f(r, d, t), t;
4
+ import { property as i } from "lit/decorators.js";
5
+ import { ifDefined as c } from "lit/directives/if-defined.js";
6
+ import { html as u, unsafeStatic as l } from "lit/static-html.js";
7
+ import f from "./collapse.styles.js";
8
+ var y = Object.defineProperty, o = (a, s, d, g) => {
9
+ for (var t = void 0, r = a.length - 1, p; r >= 0; r--)
10
+ (p = a[r]) && (t = p(s, d, t) || t);
11
+ return t && y(s, d, t), t;
11
12
  };
12
13
  const n = class n extends h {
13
14
  constructor() {
14
- super(...arguments), this.animated = !1, this.expanded = !1, this.headingAs = "h2", this.small = !1, this.truncate = !1, this._toggle = () => {
15
+ super(...arguments), this.headingAs = "h2", this._toggle = () => {
15
16
  this.dispatchEvent(
16
17
  new CustomEvent("skf-collapse-toggle", {
17
18
  bubbles: !0,
@@ -30,45 +31,47 @@ const n = class n extends h {
30
31
  this.expanded = !0;
31
32
  }
32
33
  render() {
33
- return c`
34
- <${l(this.headingAs)} id="heading">
35
- <button
36
- @click=${this._toggle}
37
- aria-controls="main"
38
- aria-expanded=${this.expanded}
39
- type="button"
40
- >
41
- <span id="label">${this.heading}</span>
42
- <skf-icon name=${this.expanded ? "caretUp" : "caretDown"}></skf-icon>
43
- </button>
44
- </${l(this.headingAs)}>
45
- <div id="body">
46
- <div id="main" data-testid="main">
47
- <slot></slot>
34
+ return u`
35
+ <div id="root">
36
+ <${l(this.headingAs)} id="heading">
37
+ <button
38
+ @click=${this._toggle}
39
+ aria-controls="main"
40
+ aria-expanded=${c(this.expanded ? "true" : "false")}
41
+ type="button"
42
+ >
43
+ <span id="label">${this.heading}</span>
44
+ <skf-icon name=${this.expanded ? "caretUp" : "caretDown"}></skf-icon>
45
+ </button>
46
+ </${l(this.headingAs)}>
47
+ <div id="body">
48
+ <div id="main" data-testid="main">
49
+ <slot></slot>
50
+ </div>
48
51
  </div>
49
52
  </div>
50
53
  `;
51
54
  }
52
55
  };
53
- n.styles = [m, u];
56
+ n.styles = [m, f];
54
57
  let e = n;
55
- s([
56
- a({ type: Boolean, reflect: !0 })
58
+ o([
59
+ i({ type: Boolean, reflect: !0 })
57
60
  ], e.prototype, "animated");
58
- s([
59
- a({ type: Boolean, reflect: !0 })
61
+ o([
62
+ i({ type: Boolean, reflect: !0 })
60
63
  ], e.prototype, "expanded");
61
- s([
62
- a()
64
+ o([
65
+ i()
63
66
  ], e.prototype, "heading");
64
- s([
65
- a({ attribute: "heading-as" })
67
+ o([
68
+ i({ attribute: "heading-as" })
66
69
  ], e.prototype, "headingAs");
67
- s([
68
- a({ type: Boolean, reflect: !0 })
70
+ o([
71
+ i({ type: Boolean, reflect: !0 })
69
72
  ], e.prototype, "small");
70
- s([
71
- a({ type: Boolean, reflect: !0 })
73
+ o([
74
+ i({ type: Boolean, reflect: !0 })
72
75
  ], e.prototype, "truncate");
73
76
  export {
74
77
  e as SkfCollapse
@@ -1,7 +1,7 @@
1
- import { css as a } from "lit";
2
- const s = a`
1
+ import { css as o } from "lit";
2
+ const s = o`
3
3
  @layer components {
4
- :host {
4
+ #root {
5
5
  background: var(--skf-bg-color-neutral-1);
6
6
  border-bottom: var(--skf-border-width-sm) solid var(--skf-border-color-tertiary);
7
7
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -2,7 +2,9 @@ import { SkfElement } from '@internal/components/skf-element.js';
2
2
  import type { BorderColor } from '@skf-design-system/ui-assets';
3
3
  import { type CSSResultGroup } from 'lit';
4
4
  /**
5
- * The `<Divider>` component can separate items from each other, to visually emphasize their lack of a relationship between groups of information.
5
+ * The `<Divider>` component can separate items from each other, to visually emphasize their lack of a relationship between groups of information
6
+ *
7
+ * @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/3831f1-divider) for design principles
6
8
  *
7
9
  * @cssproperty --skf-divider-spacing - The amount of space the divider occupies. Pass valid CSS **margin-block** values when horizontal and **margin-inline** when vertical
8
10
  * @cssproperty --skf-divider-inset - The amount of space the divider should be indented. Pass valid CSS **margin-inline** values when horizontal and **margin-block** when vertical
@@ -10,17 +12,18 @@ import { type CSSResultGroup } from 'lit';
10
12
  * @tagname skf-divider
11
13
  */
12
14
  export declare class SkfDivider extends SkfElement {
15
+ #private;
13
16
  static styles: CSSResultGroup;
14
- /** If provided, alters the Divider color */
15
- /** @type { "emphasised" | "primary" | "secondary" | "tertiary" | "inverse" } */
16
- color?: BorderColor;
17
+ /**
18
+ * Defines the Divider color
19
+ * @type { "emphasised" | "primary" | "secondary" | "tertiary" | "inverse" }
20
+ */
21
+ color: BorderColor;
17
22
  /** If true, renders a div for presentational purpose instead of the semantic hr-element */
18
- decorative?: boolean | undefined;
23
+ decorative?: boolean;
19
24
  /** If true, renders the divider vertically */
20
- vertical?: boolean | undefined;
21
- /** @internal */
22
- private renderDecorative;
23
- /** @internal */
24
- private renderDefault;
25
+ vertical?: boolean;
26
+ constructor();
27
+ connectedCallback(): void;
25
28
  render(): import("lit").TemplateResult<1>;
26
29
  }
@@ -1,37 +1,42 @@
1
- import { SkfElement as h } from "../../internal/components/skf-element.js";
2
- import m from "../../styles/component.styles.js";
3
- import { html as c } from "lit";
4
- import { property as o } from "lit/decorators.js";
5
- import { when as d } from "lit/directives/when.js";
6
- import f from "./divider.styles.js";
7
- var v = Object.defineProperty, i = (s, l, n, u) => {
8
- for (var r = void 0, t = s.length - 1, p; t >= 0; t--)
9
- (p = s[t]) && (r = p(l, n, r) || r);
10
- return r && v(l, n, r), r;
1
+ var f = (t) => {
2
+ throw TypeError(t);
11
3
  };
12
- const a = class a extends h {
4
+ var d = (t, r, e) => r.has(t) || f("Cannot " + e);
5
+ var s = (t, r, e) => (d(t, r, "read from private field"), e ? e.call(t) : r.get(t)), v = (t, r, e) => r.has(t) ? f("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), y = (t, r, e, l) => (d(t, r, "write to private field"), l ? l.call(t, e) : r.set(t, e), e);
6
+ import { SkfElement as u } from "../../internal/components/skf-element.js";
7
+ import b from "../../styles/component.styles.js";
8
+ import { html as C } from "lit";
9
+ import { property as p } from "lit/decorators.js";
10
+ import _ from "./divider.styles.js";
11
+ var x = Object.defineProperty, c = (t, r, e, l) => {
12
+ for (var o = void 0, n = t.length - 1, h; n >= 0; n--)
13
+ (h = t[n]) && (o = h(r, e, o) || o);
14
+ return o && x(r, e, o), o;
15
+ }, i;
16
+ const m = class m extends u {
13
17
  constructor() {
14
- super(...arguments), this.color = "primary", this.decorative = !1, this.vertical = !1, this.renderDecorative = () => c`
15
- <span aria-orientation=${this.vertical ? "vertical" : "horizontal"} id="divider"></span>
16
- `, this.renderDefault = () => c`
17
- <hr aria-orientation=${this.vertical ? "vertical" : "horizontal"} id="divider" />
18
- `;
18
+ super();
19
+ v(this, i);
20
+ this.color = "primary", y(this, i, this.attachInternals());
21
+ }
22
+ connectedCallback() {
23
+ super.connectedCallback(), s(this, i).role = this.decorative ? "generic" : "separator", s(this, i).ariaOrientation = this.vertical ? "vertical" : "horizontal";
19
24
  }
20
25
  render() {
21
- return d(this.decorative, this.renderDecorative, this.renderDefault);
26
+ return C`<div id="root"></div>`;
22
27
  }
23
28
  };
24
- a.styles = [m, f];
25
- let e = a;
26
- i([
27
- o({ reflect: !0 })
28
- ], e.prototype, "color");
29
- i([
30
- o({ type: Boolean })
31
- ], e.prototype, "decorative");
32
- i([
33
- o({ type: Boolean, reflect: !0 })
34
- ], e.prototype, "vertical");
29
+ i = new WeakMap(), m.styles = [b, _];
30
+ let a = m;
31
+ c([
32
+ p({ reflect: !0 })
33
+ ], a.prototype, "color");
34
+ c([
35
+ p({ type: Boolean })
36
+ ], a.prototype, "decorative");
37
+ c([
38
+ p({ type: Boolean, reflect: !0 })
39
+ ], a.prototype, "vertical");
35
40
  export {
36
- e as SkfDivider
41
+ a as SkfDivider
37
42
  };
@@ -1,10 +1,6 @@
1
1
  import { css as r } from "lit";
2
2
  const i = r`
3
- :host {
4
- display: contents;
5
- }
6
-
7
- #divider {
3
+ #root {
8
4
  --_skf-divider-border-color: var(--skf-border-color-primary);
9
5
  --_skf-divider-border: var(--skf-border-width-sm) solid var(--_skf-divider-border-color);
10
6
 
@@ -5,13 +5,23 @@ import { type CSSResultGroup } from 'lit';
5
5
  * The `<Heading>` component is to deliniate content on a page. When using, take note not to skip heading levels.<br>
6
6
  * It extends the interface of native html `<h1>` to `<h4>` elements.
7
7
  *
8
+ * @slot - The headings content
9
+ *
8
10
  * @tagname skf-heading
9
11
  */
10
12
  export declare class SkfHeading extends SkfElement {
11
13
  static styles: CSSResultGroup;
12
- /** Controls which heading element will be rendered. Should not be used to affect appearance. */
14
+ /**
15
+ * Controls which heading element will be rendered. Should not be used to affect appearance
16
+ *
17
+ * @type { "h1" | "h2" | "h3" | "h4" }
18
+ */
13
19
  as: HeadingType;
14
- /** If provided, changes the appearance of the heading */
20
+ /**
21
+ * If provided, changes the appearance of the heading
22
+ *
23
+ * @type { "h1" | "h2" | "h3" | "h4" }
24
+ */
15
25
  styledAs?: HeadingType;
16
26
  render(): import("lit").TemplateResult;
17
27
  }
@@ -1,32 +1,32 @@
1
- import { SkfElement as f } from "../../internal/components/skf-element.js";
1
+ import { SkfElement as n } from "../../internal/components/skf-element.js";
2
2
  import u from "../../styles/component.styles.js";
3
3
  import "lit";
4
4
  import { property as a } from "lit/decorators.js";
5
- import { html as h, unsafeStatic as l } from "lit/static-html.js";
6
- import y from "./heading.styles.js";
7
- var c = Object.defineProperty, n = (o, p, i, d) => {
8
- for (var t = void 0, e = o.length - 1, m; e >= 0; e--)
9
- (m = o[e]) && (t = m(p, i, t) || t);
10
- return t && c(p, i, t), t;
5
+ import { html as y, unsafeStatic as l } from "lit/static-html.js";
6
+ import c from "./heading.styles.js";
7
+ var h = Object.defineProperty, f = (o, p, i, d) => {
8
+ for (var t = void 0, s = o.length - 1, m; s >= 0; s--)
9
+ (m = o[s]) && (t = m(p, i, t) || t);
10
+ return t && h(p, i, t), t;
11
11
  };
12
- const s = class s extends f {
12
+ const e = class e extends n {
13
13
  constructor() {
14
14
  super(...arguments), this.as = "h1";
15
15
  }
16
16
  render() {
17
- return h`
18
- <${l(this.as)} id="heading">
17
+ return y`
18
+ <${l(this.as)} id="root">
19
19
  <slot></slot>
20
20
  </${l(this.as)}>
21
21
  `;
22
22
  }
23
23
  };
24
- s.styles = [u, y];
25
- let r = s;
26
- n([
24
+ e.styles = [u, c];
25
+ let r = e;
26
+ f([
27
27
  a({ reflect: !0 })
28
28
  ], r.prototype, "as");
29
- n([
29
+ f([
30
30
  a({ attribute: "styled-as" })
31
31
  ], r.prototype, "styledAs");
32
32
  export {
@@ -5,7 +5,7 @@ const t = s`
5
5
  display: contents;
6
6
  }
7
7
 
8
- #heading {
8
+ #root {
9
9
  color: var(--skf-text-color-primary);
10
10
  font-size: var(--_skf-heading-size);
11
11
  font-weight: var(--_skf-heading-weight);
@@ -10,19 +10,25 @@ import { type CSSResultGroup } from 'lit';
10
10
  */
11
11
  export declare class SkfIcon extends SkfElement {
12
12
  static styles: CSSResultGroup;
13
- /** @internal */
14
13
  private _rootId;
15
- /** @type { "primary" | "inverse" | "emphasised" | "secondary" | "success" | "info" | "warning" | "error" | "alert" } */
16
- color?: IconColor | SeverityFgColor;
17
- /** If provided, adds an alternate description to use for assistive devices */
14
+ /**
15
+ * Sets the color of the icon
16
+ * @type { "primary" | "inverse" | "emphasised" | "secondary" | "success" | "info" | "warning" | "error" | "alert" }
17
+ */
18
+ color: IconColor | SeverityFgColor;
19
+ /** If defined, adds an alternate description to use for assistive devices */
18
20
  label?: string;
19
- /** @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" } */
21
+ /**
22
+ * Name of the icon to display
23
+ * @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" }
24
+ */
20
25
  name: Icon;
21
- /** @type { "xs" | "sm" | "md" | "lg" } */
26
+ /**
27
+ * Size of the icon
28
+ * @type { "xs" | "sm" | "md" | "lg" }
29
+ */
22
30
  size?: IconSize;
23
- /** @internal */
24
31
  private renderDecorativeIcon;
25
- /** @internal */
26
32
  private renderInformativeIcon;
27
33
  render(): import("lit").TemplateResult<1>;
28
34
  }
@@ -5,15 +5,15 @@ import { html as l } from "lit";
5
5
  import { property as t } from "lit/decorators.js";
6
6
  import { ifDefined as c } from "lit/directives/if-defined.js";
7
7
  import { when as v } from "lit/directives/when.js";
8
- import y from "./icon.styles.js";
9
- var u = Object.defineProperty, o = (m, n, p, I) => {
8
+ import u from "./icon.styles.js";
9
+ var y = Object.defineProperty, o = (m, n, p, I) => {
10
10
  for (var r = void 0, i = m.length - 1, a; i >= 0; i--)
11
11
  (a = m[i]) && (r = a(n, p, r) || r);
12
- return r && u(n, p, r), r;
12
+ return r && y(n, p, r), r;
13
13
  };
14
14
  const s = class s extends f {
15
15
  constructor() {
16
- super(...arguments), this._rootId = "icon", this.color = "primary", this.size = "md", this.renderDecorativeIcon = () => l`
16
+ super(...arguments), this._rootId = "root", this.color = "primary", this.size = "md", this.renderDecorativeIcon = () => l`
17
17
  <div aria-hidden="true" id=${this._rootId}>${d[this.name]}</div>
18
18
  `, this.renderInformativeIcon = () => l`
19
19
  <div aria-label=${c(this.label)} id=${this._rootId} role="img">${d[this.name]}</div>
@@ -23,7 +23,7 @@ const s = class s extends f {
23
23
  return v(!!this.label, this.renderInformativeIcon, this.renderDecorativeIcon);
24
24
  }
25
25
  };
26
- s.styles = [h, y];
26
+ s.styles = [h, u];
27
27
  let e = s;
28
28
  o([
29
29
  t({ reflect: !0 })
@@ -32,7 +32,7 @@ o([
32
32
  t()
33
33
  ], e.prototype, "label");
34
34
  o([
35
- t({ type: String })
35
+ t()
36
36
  ], e.prototype, "name");
37
37
  o([
38
38
  t({ reflect: !0 })
@@ -1,73 +1,75 @@
1
1
  import { css as o } from "lit";
2
2
  const r = o`
3
- :host {
4
- display: inline-flex;
5
- }
3
+ @layer components {
4
+ :host {
5
+ display: inline-flex;
6
+ }
6
7
 
7
- #icon {
8
- --_skf-icon-size: var(--skf-icon-size-md);
8
+ #root {
9
+ --_skf-icon-size: var(--skf-icon-size-md);
9
10
 
10
- block-size: var(--_skf-icon-size);
11
- color: var(--_skf-icon-color, var(--skf-icon-color-primary));
12
- display: inline-flex;
13
- flex-shrink: 0; /* Prevents shrink when flex-child */
14
- inline-size: var(--_skf-icon-size);
15
- pointer-events: none;
16
- user-select: none;
11
+ block-size: var(--_skf-icon-size);
12
+ color: var(--_skf-icon-color, var(--skf-icon-color-primary));
13
+ display: inline-flex;
14
+ flex-shrink: 0; /* Prevents shrink when flex-child */
15
+ inline-size: var(--_skf-icon-size);
16
+ pointer-events: none;
17
+ user-select: none;
17
18
 
18
- :host-context(.skf-icon-host) & {
19
- color: inherit;
20
- }
19
+ :host-context(.skf-icon-host) & {
20
+ color: inherit;
21
+ }
21
22
 
22
- /**
23
- * Colors
24
- */
25
- :host([color='secondary']) & {
26
- --_skf-icon-color: var(--skf-icon-color-secondary);
27
- }
23
+ /**
24
+ * Colors
25
+ */
26
+ :host([color='secondary']) & {
27
+ --_skf-icon-color: var(--skf-icon-color-secondary);
28
+ }
28
29
 
29
- :host([color='inverse']) & {
30
- --_skf-icon-color: var(--skf-icon-color-inverse);
31
- }
30
+ :host([color='inverse']) & {
31
+ --_skf-icon-color: var(--skf-icon-color-inverse);
32
+ }
32
33
 
33
- :host([color='emphasised']) & {
34
- --_skf-icon-color: var(--skf-icon-color-emphasised);
35
- }
34
+ :host([color='emphasised']) & {
35
+ --_skf-icon-color: var(--skf-icon-color-emphasised);
36
+ }
36
37
 
37
- /* Severity */
38
- :host([color='alert']) & {
39
- --_skf-icon-color: var(--skf-severity-fg-color-alert);
40
- }
38
+ /* Severity */
39
+ :host([color='alert']) & {
40
+ --_skf-icon-color: var(--skf-severity-fg-color-alert);
41
+ }
41
42
 
42
- :host([color='error']) & {
43
- --_skf-icon-color: var(--skf-severity-fg-color-error);
44
- }
43
+ :host([color='error']) & {
44
+ --_skf-icon-color: var(--skf-severity-fg-color-error);
45
+ }
45
46
 
46
- :host([color='info']) & {
47
- --_skf-icon-color: var(--skf-severity-fg-color-info);
48
- }
47
+ :host([color='info']) & {
48
+ --_skf-icon-color: var(--skf-severity-fg-color-info);
49
+ }
49
50
 
50
- :host([color='success']) & {
51
- --_skf-icon-color: var(--skf-severity-fg-color-success);
52
- }
51
+ :host([color='success']) & {
52
+ --_skf-icon-color: var(--skf-severity-fg-color-success);
53
+ }
53
54
 
54
- :host([color='warning']) & {
55
- --_skf-icon-color: var(--skf-severity-fg-color-warning);
56
- }
55
+ :host([color='warning']) & {
56
+ --_skf-icon-color: var(--skf-severity-fg-color-warning);
57
+ }
57
58
 
58
- /**
59
- * Sizes
60
- */
61
- :host([size='xs']) & {
62
- --_skf-icon-size: var(--skf-icon-size-xs);
63
- }
59
+ /**
60
+ * Sizes
61
+ */
62
+ :host([size='xs']) & {
63
+ --_skf-icon-size: var(--skf-icon-size-xs);
64
+ }
64
65
 
65
- :host([size='sm']) & {
66
- --_skf-icon-size: var(--skf-icon-size-sm);
67
- }
66
+ :host([size='sm']) & {
67
+ --_skf-icon-size: var(--skf-icon-size-sm);
68
+ }
68
69
 
69
- :host([size='lg']) & {
70
- --_skf-icon-size: var(--skf-icon-size-lg);
70
+ :host([size='lg']) & {
71
+ --_skf-icon-size: var(--skf-icon-size-lg);
72
+ }
71
73
  }
72
74
  }
73
75
  `;