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

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 (102) hide show
  1. package/dist/components/accordion/accordion.component.d.ts +9 -5
  2. package/dist/components/accordion/accordion.component.js +22 -19
  3. package/dist/components/accordion/accordion.d.ts +1 -1
  4. package/dist/components/accordion/accordion.styles.js +3 -3
  5. package/dist/components/alert/alert.component.d.ts +7 -4
  6. package/dist/components/alert/alert.component.js +1 -1
  7. package/dist/components/alert/alert.styles.js +1 -1
  8. package/dist/components/button/button.component.js +1 -1
  9. package/dist/components/button/button.styles.js +1 -1
  10. package/dist/components/card/card.component.d.ts +3 -3
  11. package/dist/components/card/card.component.js +16 -19
  12. package/dist/components/card/card.styles.js +11 -3
  13. package/dist/components/checkbox/checkbox.component.d.ts +9 -6
  14. package/dist/components/checkbox/checkbox.component.js +8 -8
  15. package/dist/components/checkbox/checkbox.styles.js +1 -1
  16. package/dist/components/checkbox/checkbox.test.d.ts +1 -0
  17. package/dist/components/collapse/collapse.component.d.ts +9 -6
  18. package/dist/components/collapse/collapse.component.js +39 -36
  19. package/dist/components/collapse/collapse.styles.js +3 -3
  20. package/dist/components/collapse/collapse.test.d.ts +1 -0
  21. package/dist/components/divider/divider.component.d.ts +13 -10
  22. package/dist/components/divider/divider.component.js +34 -29
  23. package/dist/components/divider/divider.styles.js +1 -5
  24. package/dist/components/heading/heading.component.d.ts +12 -2
  25. package/dist/components/heading/heading.component.js +14 -14
  26. package/dist/components/heading/heading.styles.js +1 -1
  27. package/dist/components/icon/icon.component.d.ts +14 -8
  28. package/dist/components/icon/icon.component.js +6 -6
  29. package/dist/components/icon/icon.styles.js +1 -1
  30. package/dist/components/input/input.component.d.ts +34 -29
  31. package/dist/components/input/input.component.js +36 -36
  32. package/dist/components/link/link.component.d.ts +15 -12
  33. package/dist/components/link/link.component.js +7 -7
  34. package/dist/components/link/link.styles.js +1 -1
  35. package/dist/components/loader/loader.component.d.ts +7 -7
  36. package/dist/components/loader/loader.component.js +35 -61
  37. package/dist/components/loader/loader.styles.js +42 -10
  38. package/dist/components/logo/logo.component.d.ts +5 -3
  39. package/dist/components/logo/logo.component.js +8 -8
  40. package/dist/components/logo/logo.styles.js +2 -2
  41. package/dist/components/radio/radio.component.d.ts +15 -13
  42. package/dist/components/radio/radio.component.js +3 -3
  43. package/dist/components/radio/radio.styles.js +3 -3
  44. package/dist/components/select/select.component.d.ts +137 -0
  45. package/dist/components/select/select.component.js +311 -0
  46. package/dist/components/select/select.controllers.d.ts +59 -0
  47. package/dist/components/select/select.controllers.js +169 -0
  48. package/dist/components/select/select.d.ts +8 -0
  49. package/dist/components/select/select.js +6 -0
  50. package/dist/components/select/select.styles.d.ts +1 -0
  51. package/dist/components/select/select.styles.js +116 -0
  52. package/dist/components/select-option/select-option.component.d.ts +77 -0
  53. package/dist/components/select-option/select-option.component.js +117 -0
  54. package/dist/components/select-option/select-option.controllers.d.ts +9 -0
  55. package/dist/components/select-option/select-option.d.ts +8 -0
  56. package/dist/components/select-option/select-option.js +6 -0
  57. package/dist/components/select-option/select-option.styles.d.ts +1 -0
  58. package/dist/components/select-option/select-option.styles.js +53 -0
  59. package/dist/components/select-option-group/select-option-group.component.d.ts +16 -0
  60. package/dist/components/select-option-group/select-option-group.component.js +31 -0
  61. package/dist/components/select-option-group/select-option-group.d.ts +8 -0
  62. package/dist/components/select-option-group/select-option-group.js +6 -0
  63. package/dist/components/select-option-group/select-option-group.style.d.ts +1 -0
  64. package/dist/components/select-option-group/select-option-group.style.js +18 -0
  65. package/dist/components/switch/switch.component.d.ts +2 -3
  66. package/dist/components/switch/switch.component.js +1 -1
  67. package/dist/components/switch/switch.styles.js +1 -1
  68. package/dist/components/switch/switch.test.d.ts +1 -0
  69. package/dist/components/tag/tag.component.d.ts +25 -4
  70. package/dist/components/tag/tag.component.js +66 -29
  71. package/dist/components/tag/tag.styles.js +6 -5
  72. package/dist/components/textarea/textarea.component.d.ts +26 -23
  73. package/dist/components/textarea/textarea.component.js +15 -12
  74. package/dist/custom-elements.json +960 -305
  75. package/dist/index.d.ts +3 -0
  76. package/dist/index.js +39 -30
  77. package/dist/internal/components/formBase.d.ts +18 -1
  78. package/dist/internal/components/formBase.js +25 -13
  79. package/dist/internal/components/skf-element.d.ts +4 -4
  80. package/dist/internal/components/skf-element.js +15 -19
  81. package/dist/internal/helpers/array.d.ts +4 -0
  82. package/dist/internal/helpers/findMatchingTags.d.ts +2 -0
  83. package/dist/internal/helpers/findMatchingTags.js +12 -0
  84. package/dist/internal/helpers/hintSeverity.d.ts +2 -0
  85. package/dist/internal/helpers/hintSeverity.js +6 -0
  86. package/dist/internal/helpers/raiseError.d.ts +28 -0
  87. package/dist/internal/helpers/raiseError.js +29 -0
  88. package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -6
  89. package/dist/react/index.d.ts +3 -0
  90. package/dist/react/index.js +3 -0
  91. package/dist/react/skf-select/index.d.ts +21 -0
  92. package/dist/react/skf-select/index.js +21 -0
  93. package/dist/react/skf-select-option/index.d.ts +9 -0
  94. package/dist/react/skf-select-option/index.js +17 -0
  95. package/dist/react/skf-select-option-group/index.d.ts +3 -0
  96. package/dist/react/skf-select-option-group/index.js +13 -0
  97. package/dist/styles/form-field.styles.js +7 -7
  98. package/dist/types/jsx/custom-element-jsx.d.ts +290 -140
  99. package/dist/types/vue/index.d.ts +223 -90
  100. package/dist/vscode.html-custom-data.json +294 -97
  101. package/dist/web-types.json +614 -242
  102. package/package.json +34 -30
@@ -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 })
@@ -4,7 +4,7 @@ const r = o`
4
4
  display: inline-flex;
5
5
  }
6
6
 
7
- #icon {
7
+ #root {
8
8
  --_skf-icon-size: var(--skf-icon-size-md);
9
9
 
10
10
  block-size: var(--_skf-icon-size);
@@ -14,7 +14,7 @@ import { type CSSResultGroup } from 'lit';
14
14
  * @event change - Fires when the value of the input changes
15
15
  * @event invalid - Fires when the input is invalid
16
16
  *
17
- * @slot Default - Alternatively, you can use the `label` attribute
17
+ * @slot - The Inputs label. Alternatively, you can use the `label` attribute.
18
18
  *
19
19
  * @tagname skf-input
20
20
  *
@@ -24,57 +24,63 @@ import { type CSSResultGroup } from 'lit';
24
24
  export declare class SkfInput extends FormBase implements FormFieldBaseProps {
25
25
  static styles: CSSResultGroup;
26
26
  private customError;
27
- /** If provided, renders a custom aria-label for the clear button **Notice!** Only applicable to type=search. */
27
+ /** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
28
28
  buttonAriaLabelClear: string;
29
- /** If provided, renders a custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
29
+ /** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
30
30
  buttonAriaLabelHide: string;
31
- /** If provided, renders a custom aria-label for the visibility button **Notice!** Only applicable to type=password. */
31
+ /** Custom aria-label for the visibility button **Notice!** Only applicable to type=password. */
32
32
  buttonAriaLabelShow: string;
33
- /** If provided, forces component to invalid state until removed. Its value is used as hint text. */
33
+ /** If defined, forces component to invalid state until removed. Its value is used as hint text. */
34
34
  set customInvalid(value: string | undefined);
35
35
  get customInvalid(): string | undefined;
36
- /** If provided, outputs helping hints in console */
37
- debug: boolean;
36
+ /** If true, outputs helping hints in console */
37
+ debug?: boolean;
38
38
  /** If true, hides the label visually */
39
- hideLabel: boolean;
40
- /** If provided, displays informational text below the field */
39
+ hideLabel?: boolean;
40
+ /** If defined, displays informational text below the field */
41
41
  hint?: string;
42
- /** If provided, tells what keyboard to use if applicable */
42
+ /** Tells what keyboard to use if applicable */
43
43
  inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
44
- /** The input's label. Alternatively, you can use the `label` attribute. */
44
+ /** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
45
45
  label?: string;
46
- /** If provided, displays a prefix/adornment before the input-element */
46
+ /** If defined, displays a prefix/adornment before the input-element */
47
47
  leading?: string;
48
- /** If provided, sets the maximum value to accept for this input */
48
+ /** If defined, sets the maximum value to accept for this input */
49
49
  max?: number | string;
50
- /** If provided, sets the maximum character length to accept for this input */
50
+ /** If defined, sets the maximum character length to accept for this input */
51
51
  maxLength?: number;
52
- /** If provided, sets the minimum value to accept for this input */
52
+ /** If defined, sets the minimum value to accept for this input */
53
53
  min?: number | string;
54
- /** If provided, sets the minimum character length to accept for this input */
54
+ /** If defined, sets the minimum character length to accept for this input */
55
55
  minLength?: number;
56
- /** If provided, adds name to the input-element */
56
+ /** If defined, adds name to the input-element */
57
57
  name?: string;
58
- /** If provided, adds name to the input-element */
58
+ /** If defined, adds name to the input-element */
59
59
  pattern?: string;
60
- /** If provided, displays placeholder text */
60
+ /** If defined, displays placeholder text */
61
61
  placeholder?: string;
62
62
  /** If true, makes the element not mutable, meaning the user can not edit the control */
63
63
  readonly?: boolean;
64
- /** If provided, renders an alternative A11y text for the asterisk */
64
+ /** If defined, renders an alternative A11y text for the asterisk */
65
65
  requiredLabel?: string;
66
- /** If provided, displays provided severity state */
66
+ /**
67
+ * If defined, displays provided severity state
68
+ * @type { "alert" | "success" | "info" | "warning" }
69
+ */
67
70
  severity?: FormFieldBaseProps['severity'];
68
- /** If provided, displays provided severity state */
71
+ /** If true, displays valid state after interaction */
69
72
  showValid?: boolean;
70
- /** If provided, displays an alternative size */
71
- size?: 'sm' | 'md';
72
- /** If provided, displays a suffix/adornment after the input-element */
73
+ /** Size of the input */
74
+ size: 'sm' | 'md';
75
+ /** If defined, displays a suffix/adornment after the input-element */
73
76
  trailing?: string;
74
- /** If provided, changes the type of form control */
77
+ /**
78
+ * Type of input control
79
+ * @type { 'button' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' }
80
+ */
75
81
  type?: Exclude<FormFieldBaseProps['type'], 'checkbox' | 'radio'>;
76
- /** If provided, sets validation start, "input", "change" or "submit" */
77
- validateOn?: 'input' | 'change' | 'submit';
82
+ /** Sets validation start */
83
+ validateOn: 'input' | 'change' | 'submit';
78
84
  /** The current value of the input field */
79
85
  value: string;
80
86
  /** @internal */
@@ -88,7 +94,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
88
94
  private _numberController;
89
95
  /** @internal */
90
96
  private _passwordController;
91
- constructor();
92
97
  protected firstUpdated(): void;
93
98
  willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
94
99
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
@@ -1,23 +1,24 @@
1
1
  import "../icon/icon.js";
2
2
  import { FormBase as c } from "../../internal/components/formBase.js";
3
3
  import "../../internal/components/hint/hint.js";
4
- import { Asterisk as v } from "../../internal/templates/asterisk.js";
5
- import y from "../../styles/component.styles.js";
4
+ import { hintSeverity as v } from "../../internal/helpers/hintSeverity.js";
5
+ import { Asterisk as y } from "../../internal/templates/asterisk.js";
6
+ import f from "../../styles/component.styles.js";
6
7
  import { html as h, nothing as d } from "lit";
7
- import { property as s, state as b, query as f } from "lit/decorators.js";
8
+ import { property as s, state as b, query as _ } from "lit/decorators.js";
8
9
  import { ifDefined as a } from "lit/directives/if-defined.js";
9
10
  import { live as $ } from "lit/directives/live.js";
10
- import { InputNumberController as _, InputPasswordController as g } from "./input.controllers.js";
11
- import w from "./input.styles.js";
12
- var E = Object.defineProperty, A = Object.getOwnPropertyDescriptor, i = (u, e, r, n) => {
13
- for (var o = n > 1 ? void 0 : n ? A(e, r) : e, l = u.length - 1, p; l >= 0; l--)
14
- (p = u[l]) && (o = (n ? p(e, r, o) : p(o)) || o);
15
- return n && o && E(e, r, o), o;
11
+ import { InputNumberController as g, InputPasswordController as w } from "./input.controllers.js";
12
+ import E from "./input.styles.js";
13
+ var A = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (m, e, r, n) => {
14
+ for (var o = n > 1 ? void 0 : n ? C(e, r) : e, l = m.length - 1, u; l >= 0; l--)
15
+ (u = m[l]) && (o = (n ? u(e, r, o) : u(o)) || o);
16
+ return n && o && A(e, r, o), o;
16
17
  };
17
- const m = class m extends c {
18
+ const p = class p extends c {
18
19
  constructor() {
19
- super(), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this.invalid = !1, this._buttonDown = !1, this._handleInput = () => {
20
- this.value = this.$input.value || "", this.validateOn === "input" && (this.pristine = !1, this.validateInput());
20
+ super(...arguments), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.inputmode = "text", this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this.invalid = !1, this._buttonDown = !1, this._numberController = new g(this), this._passwordController = new w(this), this._handleInput = () => {
21
+ this.value = this.$input.value || "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
21
22
  }, this._resetValue = (e) => {
22
23
  var r;
23
24
  e.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._internals.setFormValue(this.value), this.$input.focus();
@@ -66,19 +67,19 @@ const m = class m extends c {
66
67
  </button>
67
68
  `, this._onBlur = () => {
68
69
  this._buttonDown && this.$input.focus();
69
- }, this._numberController = new _(this), this._passwordController = new g(this);
70
+ };
70
71
  }
71
72
  set customInvalid(e) {
72
- this.customError = String(e);
73
+ this.customError = e || "";
73
74
  }
74
75
  get customInvalid() {
75
76
  return this.customError;
76
77
  }
77
78
  firstUpdated() {
78
79
  this.$input.addEventListener("change", () => {
79
- this.validateOn === "change" && (this.validateOn = "input", this.pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
80
+ this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
80
81
  }), this.addEventListener("invalid", (e) => {
81
- this.pristine = !1, this.invalid = !0, this.customErrorDisplay && e.preventDefault();
82
+ this._pristine = !1, this.invalid = !0, this.customErrorDisplay && e.preventDefault();
82
83
  }), this.addEventListener("reset", this._resetValue), this.validateInput();
83
84
  }
84
85
  willUpdate(e) {
@@ -88,13 +89,13 @@ const m = class m extends c {
88
89
  const r = this._internals.validationMessage;
89
90
  this.hint = r !== "" ? this._internals.validationMessage : "", this.checkValidity();
90
91
  } else
91
- this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
92
+ this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
92
93
  }
93
94
  attributeChangedCallback(e, r, n) {
94
95
  if (super.attributeChangedCallback(e, r, n), e === "value" && this._internals.setFormValue(n), e === "custom-invalid")
95
96
  if (typeof n == "string") {
96
97
  const l = String(n).trim();
97
- this.pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
98
+ this._pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
98
99
  } else
99
100
  this._internals.setValidity({}), this.validateInput();
100
101
  }
@@ -105,7 +106,7 @@ const m = class m extends c {
105
106
  if (this.invalid = !1, r.valid)
106
107
  this._internals.setValidity({ customError: this._internals.validity.customError });
107
108
  else {
108
- this.invalid = !this.pristine && !r.valid;
109
+ this.invalid = !this._pristine && !r.valid;
109
110
  let n;
110
111
  for (n in r) {
111
112
  const o = `data-${n.toString()}`;
@@ -125,11 +126,11 @@ const m = class m extends c {
125
126
  render() {
126
127
  var e, r;
127
128
  return h`
128
- <div id="field">
129
+ <div id="root">
129
130
  <label>
130
131
  <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
131
132
  <slot>${this.label}</slot>
132
- ${this.required ? v(this.requiredLabel) : null}
133
+ ${this.required ? y(this.requiredLabel) : null}
133
134
  </div>
134
135
  <div id="input">
135
136
  ${this.type === "search" ? h`<skf-icon name="search" size="sm"></skf-icon>` : d}
@@ -139,17 +140,16 @@ const m = class m extends c {
139
140
  id="affix"
140
141
  >
141
142
  <input
142
- autocomplete="off"
143
- title=""
144
143
  ?disabled=${this.disabled}
145
144
  ?readonly=${this.readonly}
146
145
  ?required=${this.required}
147
146
  .value=${$(this.value)}
148
- @input=${this._handleInput}
149
147
  @blur=${this._onBlur}
148
+ @input=${this._handleInput}
150
149
  aria-describedby=${a((e = this.hint) != null && e.trim() ? "hint" : d)}
151
150
  aria-errormessage=${a((r = this.hint) != null && r.trim() ? "hint" : d)}
152
151
  aria-invalid=${!!this.invalid}
152
+ autocomplete="off"
153
153
  data-testid="field-input"
154
154
  inputmode=${a(this.inputMode)}
155
155
  max=${a(this.max)}
@@ -159,14 +159,17 @@ const m = class m extends c {
159
159
  name=${a(this.name)}
160
160
  pattern=${a(this.pattern)}
161
161
  placeholder=${a(this.placeholder)}
162
+ title=""
162
163
  type=${a(
163
164
  this.type === "password" ? this._passwordController._type : this.type
164
165
  )}
165
166
  />
166
167
  </div>
167
- ${this.type === "number" ? h`<div id="action">
168
- ${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
169
- </div>` : d}
168
+ ${this.type === "number" ? h`
169
+ <div id="action">
170
+ ${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
171
+ </div>
172
+ ` : d}
170
173
  ${this.type === "password" ? this._renderPasswordButton() : d}
171
174
  ${this.type === "search" && this.value.length > 0 ? this._renderSearchButton() : d}
172
175
  </div>
@@ -175,16 +178,16 @@ const m = class m extends c {
175
178
  <skf-hint
176
179
  aria-live=${this.invalid ? "assertive" : "polite"}
177
180
  id="hint"
178
- severity=${a(C(this.severity, this.invalid))}
179
- >${this.hint}
181
+ severity=${a(v(this.severity, this.invalid))}
182
+ >${this.customInvalid ? this.customInvalid : this.hint}
180
183
  </skf-hint>
181
184
  `}
182
185
  </div>
183
186
  `;
184
187
  }
185
188
  };
186
- m.styles = [y, w];
187
- let t = m;
189
+ p.styles = [f, E];
190
+ let t = p;
188
191
  i([
189
192
  s({ attribute: "button-aria-label-clear" })
190
193
  ], t.prototype, "buttonAriaLabelClear", 2);
@@ -243,7 +246,7 @@ i([
243
246
  s({ attribute: "required-label" })
244
247
  ], t.prototype, "requiredLabel", 2);
245
248
  i([
246
- s()
249
+ s({ reflect: !0 })
247
250
  ], t.prototype, "severity", 2);
248
251
  i([
249
252
  s({ type: Boolean, attribute: "show-valid" })
@@ -270,11 +273,8 @@ i([
270
273
  b()
271
274
  ], t.prototype, "_buttonDown", 2);
272
275
  i([
273
- f("input")
276
+ _("input")
274
277
  ], t.prototype, "$input", 2);
275
- function C(u, e) {
276
- return e ? "error" : u;
277
- }
278
278
  export {
279
279
  t as SkfInput
280
280
  };
@@ -9,38 +9,41 @@ import { type CSSResultGroup } from 'lit';
9
9
  *
10
10
  * @property {function} onClick - If provided, custom function triggered by click where the second return parameter enables custom routing.
11
11
  *
12
- * @slot {string} - The links' main content
12
+ * @slot - The links' main content
13
13
  *
14
14
  * @tagname skf-link
15
15
  */
16
16
  export declare class SkfLink extends SkfElement {
17
17
  static styles: CSSResultGroup;
18
18
  private _onClick?;
19
- /** Specifies semantic element to render - @default "a" */
19
+ /** Defines the semantic element to render */
20
20
  as: 'button' | 'a';
21
- /** @default "primary" */
21
+ /** Defines the text-color */
22
22
  color: 'primary' | 'inverse';
23
23
  /** If true, disables the link */
24
24
  disabled?: boolean;
25
- /** If provided, downloads the url */
25
+ /** If defined, downloads the url */
26
26
  download?: string;
27
- /** If provided, loads url on click */
27
+ /** If defined, loads url on click */
28
28
  href?: string;
29
- /** If provided, renders an icon before or after the text @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" } */
29
+ /**
30
+ * If defined, renders an icon before or after the text
31
+ * @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" }
32
+ */
30
33
  icon?: SkfIcon['name'];
31
- /** Position of the icon in relation to the text - @default "left" */
34
+ /** Defines the position of the icon in relation to the text */
32
35
  iconPlacement: 'left' | 'right';
33
- /** Specifies the relationship of the target object to the link object - @default "noreferrer noopener" */
36
+ /** Defines the relationship of the target object to the link object */
34
37
  rel: string;
35
- /** If provided, used on conjunction with onClick property, second argument */
38
+ /** If defined, used on conjunction with onClick property, second argument */
36
39
  route?: string;
37
40
  /** If true, fills the parents horizontal axis */
38
41
  stretch?: boolean;
39
- /** If provided, specifies where to open the linked document */
42
+ /** If defined, specifies where to open the linked document */
40
43
  target?: '_blank' | '_parent' | '_self' | '_top';
41
- /** Type of button - @default "button" */
44
+ /** Defines the type of button */
42
45
  type: 'button' | 'submit' | 'reset';
43
- /** If provided, accepts a function that runs on click. Forwards optional route as second argument. */
46
+ /** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
44
47
  set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
45
48
  get onClick(): ((event: Event, route?: string) => void) | undefined;
46
49
  connectedCallback(): void;