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

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 (167) hide show
  1. package/README.md +26 -6
  2. package/custom-elements.json +18265 -0
  3. package/dist/components/accordion/accordion.component.d.ts +9 -5
  4. package/dist/components/accordion/accordion.component.js +22 -19
  5. package/dist/components/accordion/accordion.d.ts +1 -1
  6. package/dist/components/accordion/accordion.styles.js +3 -3
  7. package/dist/components/alert/alert.component.d.ts +7 -4
  8. package/dist/components/alert/alert.component.js +21 -19
  9. package/dist/components/alert/alert.styles.js +50 -47
  10. package/dist/components/button/button.component.d.ts +24 -0
  11. package/dist/components/button/button.component.js +80 -56
  12. package/dist/components/button/button.styles.js +2 -1
  13. package/dist/components/card/card.component.d.ts +3 -3
  14. package/dist/components/card/card.component.js +16 -19
  15. package/dist/components/card/card.styles.js +11 -3
  16. package/dist/components/checkbox/checkbox.component.d.ts +17 -15
  17. package/dist/components/checkbox/checkbox.component.js +95 -89
  18. package/dist/components/checkbox/checkbox.styles.js +7 -2
  19. package/dist/components/checkbox/checkbox.test.d.ts +1 -0
  20. package/dist/components/collapse/collapse.component.d.ts +9 -6
  21. package/dist/components/collapse/collapse.component.js +39 -36
  22. package/dist/components/collapse/collapse.styles.js +3 -3
  23. package/dist/components/collapse/collapse.test.d.ts +1 -0
  24. package/dist/components/divider/divider.component.d.ts +13 -10
  25. package/dist/components/divider/divider.component.js +34 -29
  26. package/dist/components/divider/divider.styles.js +1 -5
  27. package/dist/components/heading/heading.component.d.ts +12 -2
  28. package/dist/components/heading/heading.component.js +14 -14
  29. package/dist/components/heading/heading.styles.js +1 -1
  30. package/dist/components/icon/icon.component.d.ts +14 -8
  31. package/dist/components/icon/icon.component.js +6 -6
  32. package/dist/components/icon/icon.styles.js +56 -54
  33. package/dist/components/input/input.component.d.ts +44 -29
  34. package/dist/components/input/input.component.js +118 -111
  35. package/dist/components/link/link.component.d.ts +15 -12
  36. package/dist/components/link/link.component.js +7 -7
  37. package/dist/components/link/link.styles.js +1 -1
  38. package/dist/components/loader/loader.component.d.ts +7 -7
  39. package/dist/components/loader/loader.component.js +35 -61
  40. package/dist/components/loader/loader.styles.js +42 -10
  41. package/dist/components/logo/logo.component.d.ts +5 -3
  42. package/dist/components/logo/logo.component.js +8 -8
  43. package/dist/components/logo/logo.styles.js +2 -2
  44. package/dist/components/progress/progress.component.d.ts +22 -0
  45. package/dist/components/progress/progress.component.js +40 -0
  46. package/dist/components/progress/progress.d.ts +8 -0
  47. package/dist/components/progress/progress.js +6 -0
  48. package/dist/components/progress/progress.styles.d.ts +1 -0
  49. package/dist/components/progress/progress.styles.js +47 -0
  50. package/dist/components/radio/radio.component.d.ts +18 -18
  51. package/dist/components/radio/radio.component.js +94 -78
  52. package/dist/components/radio/radio.styles.js +6 -1
  53. package/dist/components/select/select.component.d.ts +140 -0
  54. package/dist/components/select/select.component.js +327 -0
  55. package/dist/components/select/select.controllers.d.ts +59 -0
  56. package/dist/components/select/select.controllers.js +172 -0
  57. package/dist/components/select/select.d.ts +8 -0
  58. package/dist/components/select/select.js +6 -0
  59. package/dist/components/select/select.styles.d.ts +1 -0
  60. package/dist/components/select/select.styles.js +131 -0
  61. package/dist/components/select-option/select-option.component.d.ts +77 -0
  62. package/dist/components/select-option/select-option.component.js +123 -0
  63. package/dist/components/select-option/select-option.controllers.d.ts +9 -0
  64. package/dist/components/select-option/select-option.d.ts +8 -0
  65. package/dist/components/select-option/select-option.js +6 -0
  66. package/dist/components/select-option/select-option.styles.d.ts +1 -0
  67. package/dist/components/select-option/select-option.styles.js +53 -0
  68. package/dist/components/select-option-group/select-option-group.component.d.ts +16 -0
  69. package/dist/components/select-option-group/select-option-group.component.js +31 -0
  70. package/dist/components/select-option-group/select-option-group.d.ts +8 -0
  71. package/dist/components/select-option-group/select-option-group.js +6 -0
  72. package/dist/components/select-option-group/select-option-group.style.d.ts +1 -0
  73. package/dist/components/select-option-group/select-option-group.style.js +18 -0
  74. package/dist/components/switch/switch.component.d.ts +2 -3
  75. package/dist/components/switch/switch.component.js +5 -2
  76. package/dist/components/switch/switch.styles.js +6 -1
  77. package/dist/components/switch/switch.test.d.ts +1 -0
  78. package/dist/components/tab/tab.component.d.ts +29 -0
  79. package/dist/components/tab/tab.component.js +57 -0
  80. package/dist/components/tab/tab.d.ts +8 -0
  81. package/dist/components/tab/tab.js +6 -0
  82. package/dist/components/tab/tab.styles.d.ts +1 -0
  83. package/dist/components/tab/tab.styles.js +123 -0
  84. package/dist/components/tab-group/tab-group.component.d.ts +43 -0
  85. package/dist/components/tab-group/tab-group.component.js +98 -0
  86. package/dist/components/tab-group/tab-group.d.ts +8 -0
  87. package/dist/components/tab-group/tab-group.js +6 -0
  88. package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
  89. package/dist/components/tab-group/tab-group.styles.js +75 -0
  90. package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
  91. package/dist/components/tab-panel/tab-panel.component.js +36 -0
  92. package/dist/components/tab-panel/tab-panel.d.ts +8 -0
  93. package/dist/components/tab-panel/tab-panel.js +6 -0
  94. package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
  95. package/dist/components/tab-panel/tab-panel.styles.js +13 -0
  96. package/dist/components/tag/tag.component.d.ts +25 -4
  97. package/dist/components/tag/tag.component.js +66 -29
  98. package/dist/components/tag/tag.styles.js +6 -5
  99. package/dist/components/textarea/textarea.component.d.ts +26 -23
  100. package/dist/components/textarea/textarea.component.js +20 -17
  101. package/dist/components/toast/toast.component.d.ts +35 -0
  102. package/dist/components/toast/toast.component.js +52 -0
  103. package/dist/components/toast/toast.d.ts +8 -0
  104. package/dist/components/toast/toast.js +6 -0
  105. package/dist/components/toast/toast.singleton.d.ts +26 -0
  106. package/dist/components/toast/toast.singleton.js +53 -0
  107. package/dist/components/toast/toast.styles.d.ts +1 -0
  108. package/dist/components/toast/toast.styles.js +9 -0
  109. package/dist/components/toast-item/toast-item.component.d.ts +21 -0
  110. package/dist/components/toast-item/toast-item.component.js +65 -0
  111. package/dist/components/toast-item/toast-item.d.ts +6 -0
  112. package/dist/components/toast-item/toast-item.js +2 -0
  113. package/dist/components/toast-item/toast-item.styles.d.ts +2 -0
  114. package/dist/components/toast-item/toast-item.styles.js +16 -0
  115. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
  116. package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
  117. package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
  118. package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
  119. package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
  120. package/dist/components/toast-wrapper/toast-wrapper.styles.js +20 -0
  121. package/dist/custom-elements.json +2146 -616
  122. package/dist/index.d.ts +8 -0
  123. package/dist/index.js +60 -36
  124. package/dist/internal/components/formBase.d.ts +19 -1
  125. package/dist/internal/components/formBase.js +29 -17
  126. package/dist/internal/components/hint/hint.component.js +12 -10
  127. package/dist/internal/components/hint/hint.styles.js +26 -10
  128. package/dist/internal/components/skf-element.d.ts +4 -4
  129. package/dist/internal/components/skf-element.js +15 -19
  130. package/dist/internal/helpers/array.d.ts +4 -0
  131. package/dist/internal/helpers/findMatchingTags.d.ts +2 -0
  132. package/dist/internal/helpers/findMatchingTags.js +12 -0
  133. package/dist/internal/helpers/hintSeverity.d.ts +2 -0
  134. package/dist/internal/helpers/hintSeverity.js +6 -0
  135. package/dist/internal/helpers/raiseError.d.ts +28 -0
  136. package/dist/internal/helpers/raiseError.js +29 -0
  137. package/dist/internal/helpers/watch.d.ts +27 -0
  138. package/dist/internal/helpers/watch.js +28 -0
  139. package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -6
  140. package/dist/react/index.d.ts +9 -0
  141. package/dist/react/index.js +9 -0
  142. package/dist/react/skf-button/index.d.ts +7 -1
  143. package/dist/react/skf-button/index.js +5 -1
  144. package/dist/react/skf-progress/index.d.ts +3 -0
  145. package/dist/react/skf-progress/index.js +13 -0
  146. package/dist/react/skf-select/index.d.ts +21 -0
  147. package/dist/react/skf-select/index.js +21 -0
  148. package/dist/react/skf-select-option/index.d.ts +9 -0
  149. package/dist/react/skf-select-option/index.js +17 -0
  150. package/dist/react/skf-select-option-group/index.d.ts +3 -0
  151. package/dist/react/skf-select-option-group/index.js +13 -0
  152. package/dist/react/skf-tab/index.d.ts +12 -0
  153. package/dist/react/skf-tab/index.js +18 -0
  154. package/dist/react/skf-tab-group/index.d.ts +3 -0
  155. package/dist/react/skf-tab-group/index.js +13 -0
  156. package/dist/react/skf-tab-panel/index.d.ts +3 -0
  157. package/dist/react/skf-tab-panel/index.js +13 -0
  158. package/dist/react/skf-toast/index.d.ts +3 -0
  159. package/dist/react/skf-toast/index.js +13 -0
  160. package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
  161. package/dist/react/skf-toast-wrapper/index.js +13 -0
  162. package/dist/styles/form-field.styles.js +11 -7
  163. package/dist/types/jsx/custom-element-jsx.d.ts +166 -995
  164. package/dist/types/vue/index.d.ts +368 -94
  165. package/dist/vscode.html-custom-data.json +408 -106
  166. package/dist/web-types.json +932 -281
  167. package/package.json +39 -35
@@ -1,50 +1,51 @@
1
1
  import "../icon/icon.js";
2
- import { FormBase as c } from "../../internal/components/formBase.js";
2
+ import { FormBase as b } 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 { ifDefined as a } from "lit/directives/if-defined.js";
9
- 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;
8
+ import { property as e, state as c, query as _, queryAssignedNodes as $ } from "lit/decorators.js";
9
+ import { ifDefined as n } from "lit/directives/if-defined.js";
10
+ import { live as g } from "lit/directives/live.js";
11
+ import { InputNumberController as w, InputPasswordController as E } from "./input.controllers.js";
12
+ import A from "./input.styles.js";
13
+ var C = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (m, s, r, a) => {
14
+ for (var o = a > 1 ? void 0 : a ? S(s, r) : s, l = m.length - 1, u; l >= 0; l--)
15
+ (u = m[l]) && (o = (a ? u(s, r, o) : u(o)) || o);
16
+ return a && o && C(s, r, o), o;
16
17
  };
17
- const m = class m extends c {
18
+ const p = class p extends b {
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());
21
- }, this._resetValue = (e) => {
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 w(this), this._passwordController = new E(this), this._handleInput = () => {
21
+ this.value = this.$input.value || "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
22
+ }, this._resetValue = (s) => {
22
23
  var r;
23
- e.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._internals.setFormValue(this.value), this.$input.focus();
24
- }, this._handlePressStart = (e) => {
25
- this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(e);
24
+ s.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._internals.setFormValue(this.value), this.$input.focus();
25
+ }, this._handlePressStart = (s) => {
26
+ this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(s);
26
27
  }, this._handlePressEnd = () => {
27
28
  this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
28
- }, this._renderNumberButton = (e) => h`
29
+ }, this._renderNumberButton = (s) => h`
29
30
  <button
30
31
  ?disabled=${this.disabled}
31
32
  @click=${(r) => {
32
- this._numberController.handleActionBtnClick(r, e);
33
+ this._numberController.handleActionBtnClick(r, s);
33
34
  }}
34
35
  @mousedown=${this._handlePressStart}
35
36
  @mouseup=${this._handlePressEnd}
36
37
  @mouseleave=${this._handlePressEnd}
37
- aria-label="${e === "inc" ? "Increment" : "Decrement"}"
38
- class="number"
38
+ aria-label="${s === "inc" ? "Increment" : "Decrement"}"
39
+ class="number skf-icon-host"
39
40
  type="button"
40
41
  >
41
- <skf-icon name="${e === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
42
+ <skf-icon name="${s === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
42
43
  </button>
43
44
  `, this._renderPasswordButton = () => h`
44
45
  <button
45
46
  @click=${this._passwordController.toggleVisibility}
46
- aria-label=${a(this._passwordController._buttonAriaLabel)}
47
- class="password"
47
+ aria-label=${n(this._passwordController._buttonAriaLabel)}
48
+ class="password skf-icon-host"
48
49
  type="button"
49
50
  @mousedown="${this._handlePressStart}"
50
51
  @mouseup="${this._handlePressEnd}"
@@ -58,43 +59,43 @@ const m = class m extends c {
58
59
  @mousedown=${this._handlePressStart}
59
60
  @mouseup=${this._handlePressEnd}
60
61
  @mouseleave=${this._handlePressEnd}
61
- aria-label=${a(this.buttonAriaLabelClear)}
62
- class="search"
62
+ aria-label=${n(this.buttonAriaLabelClear)}
63
+ class="search skf-icon-host"
63
64
  type="button"
64
65
  >
65
66
  <skf-icon name="close" size="sm"></skf-icon>
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
- set customInvalid(e) {
72
- this.customError = String(e);
72
+ set customInvalid(s) {
73
+ this.customError = s || "";
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.addEventListener("invalid", (e) => {
81
- this.pristine = !1, this.invalid = !0, this.customErrorDisplay && e.preventDefault();
80
+ this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
81
+ }), this.addEventListener("invalid", (s) => {
82
+ this._pristine = !1, this.invalid = !0, this.customErrorDisplay && s.preventDefault();
82
83
  }), this.addEventListener("reset", this._resetValue), this.validateInput();
83
84
  }
84
- willUpdate(e) {
85
- if (e.has("invalid"))
85
+ willUpdate(s) {
86
+ if (s.has("invalid"))
86
87
  if (this.invalid) {
87
88
  this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
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
- attributeChangedCallback(e, r, n) {
94
- if (super.attributeChangedCallback(e, r, n), e === "value" && this._internals.setFormValue(n), e === "custom-invalid")
95
- if (typeof n == "string") {
96
- const l = String(n).trim();
97
- this.pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
94
+ attributeChangedCallback(s, r, a) {
95
+ if (super.attributeChangedCallback(s, r, a), s === "value" && this._internals.setFormValue(a), s === "custom-invalid")
96
+ if (typeof a == "string") {
97
+ const l = this.withFallback(a);
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,68 +106,71 @@ 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
- let n;
110
- for (n in r) {
111
- const o = `data-${n.toString()}`;
112
- if (r[n] && !this.hasAttribute(o) && this.debug && console.log(
109
+ this.invalid = !this._pristine && !r.valid;
110
+ let a;
111
+ for (a in r) {
112
+ const o = `data-${a.toString()}`;
113
+ if (r[a] && !this.hasAttribute(o) && this.debug && console.log(
113
114
  `Add custom message on ${this.localName} using attribute: ${o.toUpperCase()}="Your custom message"`
114
- ), r[n]) {
115
- this.validationError = n.toString();
115
+ ), r[a]) {
116
+ this.validationError = a.toString();
116
117
  const l = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
117
118
  this._internals.setValidity(
118
119
  { [this.validationError]: !0, customError: this._internals.validity.customError },
119
- l ?? ""
120
+ this.withFallback(l)
120
121
  ), this.invalid && this.customErrorDisplay && this.checkValidity();
121
122
  }
122
123
  }
123
124
  }
124
125
  }
125
126
  render() {
126
- var e, r;
127
+ var r, a, o, l;
128
+ const s = (this._defaultSlot.length === 0 || !((a = (r = this._defaultSlot[0]) == null ? void 0 : r.textContent) != null && a.trim())) && !this.label;
127
129
  return h`
128
- <div id="field">
130
+ <div id="root">
129
131
  <label>
130
- <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
132
+ <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${s} id="label">
131
133
  <slot>${this.label}</slot>
132
- ${this.required ? v(this.requiredLabel) : null}
134
+ ${this.required ? y(this.requiredLabel) : null}
133
135
  </div>
134
136
  <div id="input">
135
- ${this.type === "search" ? h`<skf-icon name="search" size="sm"></skf-icon>` : d}
137
+ ${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : d}
136
138
  <div
137
- data-leading=${a(this.leading)}
138
- data-trailing=${a(this.trailing)}
139
+ data-leading=${n(this.leading)}
140
+ data-trailing=${n(this.trailing)}
139
141
  id="affix"
140
142
  >
141
143
  <input
142
- autocomplete="off"
143
- title=""
144
144
  ?disabled=${this.disabled}
145
145
  ?readonly=${this.readonly}
146
146
  ?required=${this.required}
147
- .value=${$(this.value)}
148
- @input=${this._handleInput}
147
+ .value=${g(this.value)}
149
148
  @blur=${this._onBlur}
150
- aria-describedby=${a((e = this.hint) != null && e.trim() ? "hint" : d)}
151
- aria-errormessage=${a((r = this.hint) != null && r.trim() ? "hint" : d)}
149
+ @input=${this._handleInput}
150
+ autocomplete=${this.autocomplete}
151
+ aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" : d)}
152
+ aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" : d)}
152
153
  aria-invalid=${!!this.invalid}
154
+ autocomplete="off"
153
155
  data-testid="field-input"
154
- inputmode=${a(this.inputMode)}
155
- max=${a(this.max)}
156
- maxlength=${a(this.maxLength)}
157
- min=${a(this.min)}
158
- minlength=${a(this.minLength)}
159
- name=${a(this.name)}
160
- pattern=${a(this.pattern)}
161
- placeholder=${a(this.placeholder)}
162
- type=${a(
156
+ inputmode=${n(this.inputMode)}
157
+ max=${n(this.max)}
158
+ maxlength=${n(this.maxLength)}
159
+ min=${n(this.min)}
160
+ minlength=${n(this.minLength)}
161
+ name=${n(this.name)}
162
+ pattern=${n(this.pattern)}
163
+ placeholder=${n(this.placeholder)}
164
+ type=${n(
163
165
  this.type === "password" ? this._passwordController._type : this.type
164
166
  )}
165
167
  />
166
168
  </div>
167
- ${this.type === "number" ? h`<div id="action">
168
- ${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
169
- </div>` : d}
169
+ ${this.type === "number" ? h`
170
+ <div id="action">
171
+ ${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
172
+ </div>
173
+ ` : d}
170
174
  ${this.type === "password" ? this._renderPasswordButton() : d}
171
175
  ${this.type === "search" && this.value.length > 0 ? this._renderSearchButton() : d}
172
176
  </div>
@@ -175,106 +179,109 @@ const m = class m extends c {
175
179
  <skf-hint
176
180
  aria-live=${this.invalid ? "assertive" : "polite"}
177
181
  id="hint"
178
- severity=${a(C(this.severity, this.invalid))}
179
- >${this.hint}
182
+ severity=${n(v(this.severity, this.invalid))}
183
+ >${this.customInvalid ? this.customInvalid : this.hint}
180
184
  </skf-hint>
181
185
  `}
182
186
  </div>
183
187
  `;
184
188
  }
185
189
  };
186
- m.styles = [y, w];
187
- let t = m;
190
+ p.styles = [f, A];
191
+ let t = p;
192
+ i([
193
+ e({ type: String })
194
+ ], t.prototype, "autocomplete", 2);
188
195
  i([
189
- s({ attribute: "button-aria-label-clear" })
196
+ e({ attribute: "button-aria-label-clear" })
190
197
  ], t.prototype, "buttonAriaLabelClear", 2);
191
198
  i([
192
- s({ attribute: "button-aria-label-hide" })
199
+ e({ attribute: "button-aria-label-hide" })
193
200
  ], t.prototype, "buttonAriaLabelHide", 2);
194
201
  i([
195
- s({ attribute: "button-aria-label-show" })
202
+ e({ attribute: "button-aria-label-show" })
196
203
  ], t.prototype, "buttonAriaLabelShow", 2);
197
204
  i([
198
- s({ attribute: "custom-invalid", reflect: !0 })
205
+ e({ attribute: "custom-invalid", reflect: !0 })
199
206
  ], t.prototype, "customInvalid", 1);
200
207
  i([
201
- s({ type: Boolean })
208
+ e({ type: Boolean })
202
209
  ], t.prototype, "debug", 2);
203
210
  i([
204
- s({ type: Boolean, attribute: "hide-label" })
211
+ e({ type: Boolean, attribute: "hide-label" })
205
212
  ], t.prototype, "hideLabel", 2);
206
213
  i([
207
- s()
214
+ e()
208
215
  ], t.prototype, "hint", 2);
209
216
  i([
210
- s({ type: String })
217
+ e({ type: String })
211
218
  ], t.prototype, "inputmode", 2);
212
219
  i([
213
- s()
220
+ e()
214
221
  ], t.prototype, "label", 2);
215
222
  i([
216
- s()
223
+ e()
217
224
  ], t.prototype, "leading", 2);
218
225
  i([
219
- s()
226
+ e()
220
227
  ], t.prototype, "max", 2);
221
228
  i([
222
- s({ type: Number, attribute: "maxlength" })
229
+ e({ type: Number, attribute: "maxlength" })
223
230
  ], t.prototype, "maxLength", 2);
224
231
  i([
225
- s()
232
+ e()
226
233
  ], t.prototype, "min", 2);
227
234
  i([
228
- s({ type: Number, attribute: "minlength" })
235
+ e({ type: Number, attribute: "minlength" })
229
236
  ], t.prototype, "minLength", 2);
230
237
  i([
231
- s()
238
+ e()
232
239
  ], t.prototype, "name", 2);
233
240
  i([
234
- s()
241
+ e()
235
242
  ], t.prototype, "pattern", 2);
236
243
  i([
237
- s()
244
+ e()
238
245
  ], t.prototype, "placeholder", 2);
239
246
  i([
240
- s({ type: Boolean })
247
+ e({ type: Boolean })
241
248
  ], t.prototype, "readonly", 2);
242
249
  i([
243
- s({ attribute: "required-label" })
250
+ e({ attribute: "required-label" })
244
251
  ], t.prototype, "requiredLabel", 2);
245
252
  i([
246
- s()
253
+ e({ reflect: !0 })
247
254
  ], t.prototype, "severity", 2);
248
255
  i([
249
- s({ type: Boolean, attribute: "show-valid" })
256
+ e({ type: Boolean, attribute: "show-valid" })
250
257
  ], t.prototype, "showValid", 2);
251
258
  i([
252
- s({ reflect: !0 })
259
+ e({ reflect: !0 })
253
260
  ], t.prototype, "size", 2);
254
261
  i([
255
- s()
262
+ e()
256
263
  ], t.prototype, "trailing", 2);
257
264
  i([
258
- s()
265
+ e()
259
266
  ], t.prototype, "type", 2);
260
267
  i([
261
- s({ type: String, attribute: "validate-on" })
268
+ e({ type: String, attribute: "validate-on" })
262
269
  ], t.prototype, "validateOn", 2);
263
270
  i([
264
- s()
271
+ e()
265
272
  ], t.prototype, "value", 2);
266
273
  i([
267
- b()
274
+ c()
268
275
  ], t.prototype, "invalid", 2);
269
276
  i([
270
- b()
277
+ c()
271
278
  ], t.prototype, "_buttonDown", 2);
272
279
  i([
273
- f("input")
280
+ _("input")
274
281
  ], t.prototype, "$input", 2);
275
- function C(u, e) {
276
- return e ? "error" : u;
277
- }
282
+ i([
283
+ $({ flatten: !0 })
284
+ ], t.prototype, "_defaultSlot", 2);
278
285
  export {
279
286
  t as SkfInput
280
287
  };
@@ -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;
@@ -6,10 +6,10 @@ import "lit";
6
6
  import { property as r } from "lit/decorators.js";
7
7
  import { ifDefined as n } from "lit/directives/if-defined.js";
8
8
  import { html as f, literal as d } from "lit/static-html.js";
9
- var k = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (h, t, i, l) => {
10
- for (var s = l > 1 ? void 0 : l ? v(t, i) : t, p = h.length - 1, c; p >= 0; p--)
11
- (c = h[p]) && (s = (l ? c(t, i, s) : c(s)) || s);
12
- return l && s && k(t, i, s), s;
9
+ var k = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (h, t, i, p) => {
10
+ for (var s = p > 1 ? void 0 : p ? v(t, i) : t, l = h.length - 1, c; l >= 0; l--)
11
+ (c = h[l]) && (s = (p ? c(t, i, s) : c(s)) || s);
12
+ return p && s && k(t, i, s), s;
13
13
  };
14
14
  const a = class a extends m {
15
15
  constructor() {
@@ -20,8 +20,8 @@ const a = class a extends m {
20
20
  set onClick(t) {
21
21
  if (!t) return;
22
22
  this._onClick = t;
23
- const i = (l) => {
24
- t(l, this.href ?? this.route);
23
+ const i = (p) => {
24
+ t(p, this.href ?? this.route);
25
25
  };
26
26
  this._assertValidOnClick(t), this.removeEventListener("click", i), this.addEventListener("click", i);
27
27
  }
@@ -58,7 +58,7 @@ const a = class a extends m {
58
58
  @click=${this._preprocessOnClick}
59
59
  download=${n(t ? this.download : void 0)}
60
60
  href=${n(t ? this.href : void 0)}
61
- id="link"
61
+ id="root"
62
62
  rel=${n(t ? this.rel : void 0)}
63
63
  target=${n(t ? this.target : void 0)}
64
64
  title=${this.title}
@@ -4,7 +4,7 @@ const e = r`
4
4
  display: contents;
5
5
  }
6
6
 
7
- #link {
7
+ #root {
8
8
  align-items: center;
9
9
  color: var(--state-color, var(--color));
10
10
  display: inline-flex;
@@ -1,21 +1,21 @@
1
1
  import { SkfElement } from '@internal/components/skf-element.js';
2
2
  import { type CSSResultGroup } from 'lit';
3
3
  /**
4
- * The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities.
4
+ * The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities
5
5
  *
6
- * @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/619e4125b3d2147c0c584b11) for design principles.
6
+ * @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/8188a9-loader) for design principles
7
7
  *
8
8
  * @tagname skf-loader
9
9
  */
10
10
  export declare class SkfLoader extends SkfElement {
11
+ #private;
11
12
  static styles: CSSResultGroup;
13
+ /** Defines the aria-label */
12
14
  ariaLabel: string;
13
15
  /** If true, inverts the color (to be used on colored backgrounds) */
14
- invert: boolean;
15
- /** If provided, displays an alternative size */
16
+ invert?: boolean;
17
+ /** Defines the size of the loader */
16
18
  size?: 'md' | 'sm';
17
- connectedCallback(): void;
18
- /** @internal */
19
- private getCircle;
19
+ constructor();
20
20
  render(): import("lit").TemplateResult<1>;
21
21
  }
@@ -1,71 +1,45 @@
1
- import { SkfElement as u } from "../../internal/components/skf-element.js";
2
- import { COLORS as c } from "@skf-design-system/ui-assets";
3
- import m from "../../styles/component.styles.js";
4
- import { svg as d, html as h } from "lit";
5
- import { property as a } from "lit/decorators.js";
6
- import v from "./loader.styles.js";
7
- var f = Object.defineProperty, o = (l, t, i, g) => {
8
- for (var e = void 0, s = l.length - 1, p; s >= 0; s--)
9
- (p = l[s]) && (e = p(t, i, e) || e);
10
- return e && f(t, i, e), e;
1
+ var m = (t) => {
2
+ throw TypeError(t);
11
3
  };
12
- const n = class n extends u {
4
+ var f = (t, r, e) => r.has(t) || m("Cannot " + e);
5
+ var p = (t, r, e) => (f(t, r, "read from private field"), e ? e.call(t) : r.get(t)), h = (t, r, e) => r.has(t) ? m("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), y = (t, r, e, l) => (f(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 g } from "lit";
9
+ import { property as n } from "lit/decorators.js";
10
+ import _ from "./loader.styles.js";
11
+ var x = Object.defineProperty, c = (t, r, e, l) => {
12
+ for (var i = void 0, a = t.length - 1, d; a >= 0; a--)
13
+ (d = t[a]) && (i = d(r, e, i) || i);
14
+ return i && x(r, e, i), i;
15
+ }, s;
16
+ const v = class v extends u {
13
17
  constructor() {
14
- super(...arguments), this.ariaLabel = "Loading...", this.invert = !1, this.size = "md";
15
- }
16
- connectedCallback() {
17
- super.connectedCallback(), this.setAttribute("role", "progressbar"), this.setAttribute("aria-live", "polite");
18
- }
19
- /** @internal */
20
- getCircle(t, i) {
21
- return d`
22
- <circle
23
- cx=${t}
24
- cy="26"
25
- fill=${this.invert ? c.neutralWhite : c.brandBase}
26
- key=${t}
27
- r="6"
28
- stroke="none"
29
- >
30
- <animate
31
- attributeName="opacity"
32
- begin=${i}
33
- dur="1s"
34
- repeatCount="indefinite"
35
- values="0;1;0"
36
- />
37
- </circle>
38
- `;
18
+ super();
19
+ h(this, s);
20
+ this.ariaLabel = "Loading...", this.size = "md", y(this, s, this.attachInternals()), p(this, s).role = "progressbar", p(this, s).ariaLive = "polite";
39
21
  }
40
22
  render() {
41
- return h`
42
- <div aria-hidden="true" id="loader">
43
- <svg
44
- enableBackground="new 0 0 0 0"
45
- height="100%"
46
- version="1.1"
47
- viewBox="0 0 52 52"
48
- width="100%"
49
- x="0px"
50
- y="0px"
51
- >
52
- ${[this.getCircle(6, 0.1), this.getCircle(26, 0.2), this.getCircle(46, 0.3)]}
53
- </svg>
23
+ return g`
24
+ <div id="root">
25
+ <div class="circle"></div>
26
+ <div class="circle"></div>
27
+ <div class="circle"></div>
54
28
  </div>
55
29
  `;
56
30
  }
57
31
  };
58
- n.styles = [m, v];
59
- let r = n;
60
- o([
61
- a({ type: String, reflect: !0, attribute: "aria-label" })
62
- ], r.prototype, "ariaLabel");
63
- o([
64
- a({ type: Boolean })
65
- ], r.prototype, "invert");
66
- o([
67
- a({ type: String, reflect: !0 })
68
- ], r.prototype, "size");
32
+ s = new WeakMap(), v.styles = [b, _];
33
+ let o = v;
34
+ c([
35
+ n({ reflect: !0, attribute: "aria-label" })
36
+ ], o.prototype, "ariaLabel");
37
+ c([
38
+ n({ type: Boolean })
39
+ ], o.prototype, "invert");
40
+ c([
41
+ n({ type: String, reflect: !0 })
42
+ ], o.prototype, "size");
69
43
  export {
70
- r as SkfLoader
44
+ o as SkfLoader
71
45
  };