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

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 (159) hide show
  1. package/README.md +26 -6
  2. package/dist/components/accordion/accordion-item.d.ts +1 -1
  3. package/dist/components/accordion/accordion.component.d.ts +13 -9
  4. package/dist/components/accordion/accordion.component.js +34 -30
  5. package/dist/components/accordion/accordion.d.ts +1 -1
  6. package/dist/components/accordion/accordion.styles.d.ts +1 -2
  7. package/dist/components/accordion/accordion.styles.js +5 -4
  8. package/dist/components/alert/alert.component.d.ts +10 -7
  9. package/dist/components/alert/alert.component.js +50 -37
  10. package/dist/components/alert/alert.styles.d.ts +1 -2
  11. package/dist/components/alert/alert.styles.js +42 -34
  12. package/dist/components/button/button.component.d.ts +28 -4
  13. package/dist/components/button/button.component.js +80 -56
  14. package/dist/components/button/button.styles.js +2 -1
  15. package/dist/components/card/card.component.d.ts +1 -1
  16. package/dist/components/card/card.component.js +29 -21
  17. package/dist/components/card/card.styles.d.ts +1 -2
  18. package/dist/components/card/card.styles.js +22 -12
  19. package/dist/components/checkbox/checkbox.component.d.ts +20 -18
  20. package/dist/components/checkbox/checkbox.component.js +95 -89
  21. package/dist/components/checkbox/checkbox.styles.js +7 -2
  22. package/dist/components/checkbox/checkbox.test.d.ts +1 -0
  23. package/dist/components/collapse/collapse.component.d.ts +8 -5
  24. package/dist/components/collapse/collapse.component.js +50 -39
  25. package/dist/components/collapse/collapse.styles.js +13 -12
  26. package/dist/components/collapse/collapse.test.d.ts +1 -0
  27. package/dist/components/dialog/dialog.component.d.ts +75 -0
  28. package/dist/components/dialog/dialog.component.js +189 -0
  29. package/dist/components/dialog/dialog.d.ts +8 -0
  30. package/dist/components/dialog/dialog.js +6 -0
  31. package/dist/components/dialog/dialog.styles.d.ts +1 -0
  32. package/dist/components/dialog/dialog.styles.js +91 -0
  33. package/dist/components/divider/divider.component.d.ts +14 -11
  34. package/dist/components/divider/divider.component.js +46 -29
  35. package/dist/components/divider/divider.styles.d.ts +1 -2
  36. package/dist/components/divider/divider.styles.js +26 -30
  37. package/dist/components/heading/heading.component.d.ts +14 -4
  38. package/dist/components/heading/heading.component.js +14 -14
  39. package/dist/components/heading/heading.styles.js +1 -1
  40. package/dist/components/icon/icon.component.d.ts +15 -9
  41. package/dist/components/icon/icon.component.js +6 -6
  42. package/dist/components/icon/icon.styles.js +56 -54
  43. package/dist/components/input/input.component.d.ts +48 -33
  44. package/dist/components/input/input.component.js +108 -99
  45. package/dist/components/link/link.component.d.ts +20 -17
  46. package/dist/components/link/link.component.js +20 -14
  47. package/dist/components/link/link.styles.js +36 -40
  48. package/dist/components/loader/loader.component.d.ts +7 -7
  49. package/dist/components/loader/loader.component.js +42 -61
  50. package/dist/components/loader/loader.styles.js +44 -11
  51. package/dist/components/logo/logo.component.d.ts +7 -5
  52. package/dist/components/logo/logo.component.js +25 -14
  53. package/dist/components/logo/logo.styles.d.ts +1 -2
  54. package/dist/components/logo/logo.styles.js +12 -10
  55. package/dist/components/progress/progress.component.d.ts +22 -0
  56. package/dist/components/progress/progress.component.js +49 -0
  57. package/dist/components/progress/progress.d.ts +8 -0
  58. package/dist/components/progress/progress.js +6 -0
  59. package/dist/components/progress/progress.styles.d.ts +1 -0
  60. package/dist/components/progress/progress.styles.js +48 -0
  61. package/dist/components/radio/radio.component.d.ts +21 -21
  62. package/dist/components/radio/radio.component.js +94 -78
  63. package/dist/components/radio/radio.styles.js +6 -1
  64. package/dist/components/select/select.component.d.ts +14 -12
  65. package/dist/components/select/select.component.js +119 -103
  66. package/dist/components/select/select.controllers.d.ts +1 -1
  67. package/dist/components/select/select.controllers.js +5 -2
  68. package/dist/components/select/select.styles.js +18 -3
  69. package/dist/components/select-option/select-option.component.d.ts +3 -3
  70. package/dist/components/select-option/select-option.component.js +16 -10
  71. package/dist/components/select-option/select-option.controllers.d.ts +1 -1
  72. package/dist/components/select-option-group/select-option-group.component.d.ts +1 -1
  73. package/dist/components/switch/switch.component.d.ts +4 -5
  74. package/dist/components/switch/switch.component.js +17 -7
  75. package/dist/components/switch/switch.styles.js +19 -11
  76. package/dist/components/switch/switch.test.d.ts +1 -0
  77. package/dist/components/tab/tab.component.d.ts +29 -0
  78. package/dist/components/tab/tab.component.js +57 -0
  79. package/dist/components/tab/tab.d.ts +8 -0
  80. package/dist/components/tab/tab.js +6 -0
  81. package/dist/components/tab/tab.styles.d.ts +1 -0
  82. package/dist/components/tab/tab.styles.js +123 -0
  83. package/dist/components/tab-group/tab-group.component.d.ts +43 -0
  84. package/dist/components/tab-group/tab-group.component.js +98 -0
  85. package/dist/components/tab-group/tab-group.d.ts +8 -0
  86. package/dist/components/tab-group/tab-group.js +6 -0
  87. package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
  88. package/dist/components/tab-group/tab-group.styles.js +75 -0
  89. package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
  90. package/dist/components/tab-panel/tab-panel.component.js +36 -0
  91. package/dist/components/tab-panel/tab-panel.d.ts +8 -0
  92. package/dist/components/tab-panel/tab-panel.js +6 -0
  93. package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
  94. package/dist/components/tab-panel/tab-panel.styles.js +13 -0
  95. package/dist/components/tag/tag.component.d.ts +14 -9
  96. package/dist/components/tag/tag.component.js +63 -47
  97. package/dist/components/tag/tag.styles.js +35 -28
  98. package/dist/components/textarea/textarea.component.d.ts +30 -27
  99. package/dist/components/textarea/textarea.component.js +20 -17
  100. package/dist/components/toast/toast.component.d.ts +35 -0
  101. package/dist/components/toast/toast.component.js +52 -0
  102. package/dist/components/toast/toast.d.ts +8 -0
  103. package/dist/components/toast/toast.js +6 -0
  104. package/dist/components/toast/toast.singleton.d.ts +26 -0
  105. package/dist/components/toast/toast.singleton.js +53 -0
  106. package/dist/components/toast/toast.styles.d.ts +1 -0
  107. package/dist/components/toast/toast.styles.js +9 -0
  108. package/dist/components/toast-item/toast-item.component.d.ts +21 -0
  109. package/dist/components/toast-item/toast-item.component.js +65 -0
  110. package/dist/components/toast-item/toast-item.d.ts +6 -0
  111. package/dist/components/toast-item/toast-item.js +2 -0
  112. package/dist/components/toast-item/toast-item.styles.d.ts +2 -0
  113. package/dist/components/toast-item/toast-item.styles.js +16 -0
  114. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
  115. package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
  116. package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
  117. package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
  118. package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
  119. package/dist/components/toast-wrapper/toast-wrapper.styles.js +20 -0
  120. package/dist/custom-elements.json +3090 -1993
  121. package/dist/index.d.ts +6 -0
  122. package/dist/index.js +60 -42
  123. package/dist/internal/components/formBase.d.ts +1 -0
  124. package/dist/internal/components/formBase.js +11 -11
  125. package/dist/internal/components/hint/hint.component.d.ts +2 -2
  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.js +26 -25
  129. package/dist/internal/helpers/hintSeverity.d.ts +1 -1
  130. package/dist/internal/helpers/watch.d.ts +27 -0
  131. package/dist/internal/helpers/watch.js +28 -0
  132. package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -8
  133. package/dist/internal/templates/asterisk.d.ts +1 -1
  134. package/dist/internal/templates/asterisk.js +7 -6
  135. package/dist/react/index.d.ts +10 -3
  136. package/dist/react/index.js +10 -3
  137. package/dist/react/skf-button/index.d.ts +7 -1
  138. package/dist/react/skf-button/index.js +5 -1
  139. package/dist/react/skf-dialog/index.d.ts +15 -0
  140. package/dist/react/skf-dialog/index.js +19 -0
  141. package/dist/react/skf-progress/index.d.ts +3 -0
  142. package/dist/react/skf-progress/index.js +13 -0
  143. package/dist/react/skf-tab/index.d.ts +12 -0
  144. package/dist/react/skf-tab/index.js +18 -0
  145. package/dist/react/skf-tab-group/index.d.ts +3 -0
  146. package/dist/react/skf-tab-group/index.js +13 -0
  147. package/dist/react/skf-tab-panel/index.d.ts +3 -0
  148. package/dist/react/skf-tab-panel/index.js +13 -0
  149. package/dist/react/skf-toast/index.d.ts +3 -0
  150. package/dist/react/skf-toast/index.js +13 -0
  151. package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
  152. package/dist/react/skf-toast-wrapper/index.js +13 -0
  153. package/dist/styles/component.styles.js +15 -2
  154. package/dist/styles/form-field.styles.js +5 -1
  155. package/dist/types/jsx/custom-element-jsx.d.ts +300 -117
  156. package/dist/types/vue/index.d.ts +266 -76
  157. package/dist/vscode.html-custom-data.json +349 -216
  158. package/dist/web-types.json +686 -292
  159. package/package.json +33 -32
@@ -1,29 +1,29 @@
1
- import { computePosition as f, flip as _, shift as v, offset as g } from "@floating-ui/dom";
1
+ import { computePosition as v, flip as f, shift as _, offset as g } from "@floating-ui/dom";
2
2
  import { FormBase as b } from "../../internal/components/formBase.js";
3
3
  import { findMatchingTags as y } from "../../internal/helpers/findMatchingTags.js";
4
4
  import { hintSeverity as O } from "../../internal/helpers/hintSeverity.js";
5
- import { raiseError as S } from "../../internal/helpers/raiseError.js";
6
- import { Asterisk as w } from "../../internal/templates/asterisk.js";
7
- import x from "../../styles/component.styles.js";
8
- import { html as h, nothing as $ } from "lit";
9
- import { property as r, state as d, query as p } from "lit/decorators.js";
10
- import { classMap as V } from "lit/directives/class-map.js";
5
+ import { raiseError as w } from "../../internal/helpers/raiseError.js";
6
+ import { Asterisk as x } from "../../internal/templates/asterisk.js";
7
+ import $ from "../../styles/component.styles.js";
8
+ import { html as h, nothing as V } from "lit";
9
+ import { property as o, state as d, query as p } from "lit/decorators.js";
10
+ import { classMap as S } from "lit/directives/class-map.js";
11
11
  import { ifDefined as m } from "lit/directives/if-defined.js";
12
12
  import "../../internal/components/hint/hint.js";
13
13
  import "../tag/tag.js";
14
- import { ScrollController as C, ResizeController as A, GlobalClickController as E, KeyboardNavigationController as k, DeveloperFeedbackController as L } from "./select.controllers.js";
14
+ import { ScrollController as C, ResizeController as k, GlobalClickController as L, KeyboardNavigationController as A, DeveloperFeedbackController as E } from "./select.controllers.js";
15
15
  import { styles as P } from "./select.styles.js";
16
- var D = Object.defineProperty, M = Object.getOwnPropertyDescriptor, l = (u, t, e, s) => {
17
- for (var o = s > 1 ? void 0 : s ? M(t, e) : t, a = u.length - 1, n; a >= 0; a--)
18
- (n = u[a]) && (o = (s ? n(t, e, o) : n(o)) || o);
19
- return s && o && D(t, e, o), o;
16
+ var T = Object.defineProperty, D = Object.getOwnPropertyDescriptor, l = (u, t, e, i) => {
17
+ for (var r = i > 1 ? void 0 : i ? D(t, e) : t, n = u.length - 1, a; n >= 0; n--)
18
+ (a = u[n]) && (r = (i ? a(t, e, r) : a(r)) || r);
19
+ return i && r && T(t, e, r), r;
20
20
  };
21
21
  const c = class c extends b {
22
22
  constructor() {
23
- super(), this.selectDelay = 50, this._optionsList = [], this.buttonLabel = "Select an option", this.label = "Default label", this.size = "md", this._expanded = !1, this._invalid = !1, this.scrollController = new C(this), this.resizeController = new A(this), this.globalClickController = new E(this), this.keyboardNavController = new k(this), this.developerFeedbackController = new L(this), this._handleOptionSelected = (t) => {
23
+ super(), this.selectDelay = 200, this._optionsList = [], this.buttonLabel = "Select an option", this.size = "md", this._expanded = !1, this._invalid = !1, this.scrollController = new C(this), this.resizeController = new k(this), this.globalClickController = new L(this), this.keyboardNavController = new A(this), this.developerFeedbackController = new E(this), this._handleOptionSelected = (t) => {
24
24
  this._pristine = !1;
25
25
  const e = this._selectedOptions.length > 0;
26
- this.setFormValue(e ? this.getSelectedValues.join(",") : null), this._updateState(t);
26
+ this.setFormValue(e ? this.selectedValues.join(",") : null), this._updateState(t);
27
27
  }, this._handleReset = () => {
28
28
  this.emitEvent("reset"), this._resetSelectedOptions();
29
29
  }, this._updateWidth = () => {
@@ -32,20 +32,20 @@ const c = class c extends b {
32
32
  (t = this.$dropdown) == null || t.style.setProperty("--select-width", `${String(this.offsetWidth)}px`);
33
33
  }, 50);
34
34
  }, this._managePopover = () => ({ close: () => {
35
- var s;
36
- (s = this.$dropdown) == null || s.hidePopover();
35
+ var i;
36
+ (i = this.$dropdown) == null || i.hidePopover();
37
37
  }, open: () => {
38
- const s = this.$selectBtn, o = this.$dropdown;
39
- !s || !o || (o.showPopover(), f(s, o, {
38
+ const i = this.$selectBtn, r = this.$dropdown;
39
+ !i || !r || (r.showPopover(), v(i, r, {
40
40
  placement: "bottom",
41
- middleware: [_(), v({ padding: 5 }), g(2)]
42
- }).then(({ x: a, y: n }) => {
43
- Object.assign(o.style, {
44
- left: `${String(a)}px`,
45
- top: `${String(Math.round(n - window.scrollY))}px`
41
+ middleware: [f(), _({ padding: 5 }), g(2)]
42
+ }).then(({ x: n, y: a }) => {
43
+ Object.assign(r.style, {
44
+ left: `${String(n)}px`,
45
+ top: `${String(Math.round(a - window.scrollY))}px`
46
46
  });
47
- }).catch((a) => {
48
- console.error(a);
47
+ }).catch((n) => {
48
+ console.error(n);
49
49
  }));
50
50
  } }), this._handleDropdownToggle = (t) => {
51
51
  t.stopPropagation(), this._expanded = !this._expanded;
@@ -55,10 +55,10 @@ const c = class c extends b {
55
55
  this.setFormValue(null), this.requestUpdate();
56
56
  break;
57
57
  case this._selectedOptions.length === 1:
58
- this.setFormValue(this.getSelectedValues[0]);
58
+ this.setFormValue(this.selectedValues[0]);
59
59
  break;
60
60
  case this._selectedOptions.length > 1:
61
- this.setFormValue(this.getSelectedValues.join(","));
61
+ this.setFormValue(this.selectedValues.join(","));
62
62
  break;
63
63
  default:
64
64
  throw new Error("Something went wrong");
@@ -68,8 +68,8 @@ const c = class c extends b {
68
68
  });
69
69
  }), this._resetSelectedOptions = (t) => {
70
70
  const e = !t;
71
- this._optionsList.forEach((s) => {
72
- (e || s !== t) && s.removeAttribute("selected");
71
+ this._optionsList.forEach((i) => {
72
+ (e || i !== t) && i.removeAttribute("selected");
73
73
  });
74
74
  }, this._handleSlotChange = () => {
75
75
  this._collectSlotOptionTags(), this._validateInput();
@@ -78,11 +78,23 @@ const c = class c extends b {
78
78
  return (t = this.$selectedValue) == null || t.classList.add("contains-meta-info"), this._selectedOptions.length > 1 ? `(${String(this._selectedOptions.length)} items selected)` : this.value ? ((e = this.$selectedValue) == null || e.classList.remove("contains-meta-info"), this.value) : this.buttonLabel;
79
79
  }, this._selectedOptions = [];
80
80
  }
81
- get getSelectedValues() {
81
+ set selectedValues(t) {
82
+ this._selectedOptions = this._optionsList.filter((e) => t.includes(e.value.trim()));
83
+ }
84
+ get selectedValues() {
82
85
  return this._selectedOptions.map((t) => t.value.trim());
83
86
  }
84
- get getSelectedOptionsText() {
85
- return this._selectedOptions.map((t) => t.textContent);
87
+ set selectedOptionsText(t) {
88
+ this._selectedOptions = this._selectedOptions.filter(
89
+ (e) => e.textContent && t.includes(e.textContent)
90
+ );
91
+ }
92
+ get selectedOptionsText() {
93
+ return this._selectedOptions.map((t) => t.textContent ?? "");
94
+ }
95
+ set value(t) {
96
+ const e = t.split(",").map((i) => i.trim());
97
+ this._selectedOptions = this._optionsList.filter((i) => e.includes(i.value.trim()));
86
98
  }
87
99
  get value() {
88
100
  return this._selectedOptions.length ? this._selectedOptions.length === 1 ? this._selectedOptions[0].value.trim() : this._selectedOptions.map((t) => t.value.trim()).join(",") : "";
@@ -113,21 +125,20 @@ const c = class c extends b {
113
125
  }
114
126
  firstUpdated() {
115
127
  var t;
116
- this.addEventListener("skf-select-option:select", this._handleOptionSelected), (t = this._internals.form) == null || t.addEventListener("reset", this._handleReset), this.onUpdateComplete(), this._collectSlotOptionTags(), this._validateInput();
128
+ this.addEventListener("skf-select-option:select", this._handleOptionSelected), (t = this._internals.form) == null || t.addEventListener("reset", this._handleReset), this.onUpdateComplete(), this._validateInput();
117
129
  }
118
130
  updated(t) {
119
- var e, s;
120
131
  if (t.has("_expanded")) {
121
- const o = !!t.get("_expanded") === this._expanded;
122
- if (this.emit("skf-select:dropdown", { detail: { expanded: this._expanded } }), o) return;
123
- this._expanded ? ((e = this.$selectBtn) == null || e.setAttribute("aria-expanded", "true"), this._managePopover().open()) : ((s = this.$selectBtn) == null || s.setAttribute("aria-expanded", "false"), this._managePopover().close());
132
+ const e = !!t.get("_expanded") === this._expanded;
133
+ if (this.emit("skf-select:dropdown", { detail: { expanded: this._expanded } }), e) return;
134
+ this._expanded ? this._managePopover().open() : this._managePopover().close();
124
135
  }
125
136
  }
126
- attributeChangedCallback(t, e, s) {
127
- if (super.attributeChangedCallback(t, e, s), t === "custom-invalid")
128
- if (typeof s == "string") {
129
- const a = String(s).trim() || "Custom error";
130
- this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, a), this.checkValidity();
137
+ attributeChangedCallback(t, e, i) {
138
+ if (super.attributeChangedCallback(t, e, i), t === "custom-invalid")
139
+ if (typeof i == "string") {
140
+ const n = this.withFallback(i);
141
+ this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, n), this.checkValidity();
131
142
  } else
132
143
  this.setValidity({}), this._validateInput();
133
144
  }
@@ -142,8 +153,8 @@ const c = class c extends b {
142
153
  e.selected && (this.selectedOptions = [...this.selectedOptions, e]);
143
154
  });
144
155
  else {
145
- const e = this._selectedOptions.length > 0, s = t.detail.value !== null;
146
- e && (this._selectedOptions[0].setSelectedDiscrete = !1, this._selectedOptions = []), s && (this.selectedOptions = [t.target]);
156
+ const e = this._selectedOptions.length > 0, i = t.detail.value !== null;
157
+ e && (this._selectedOptions[0].setSelectedDiscrete = !1, this._selectedOptions = []), i && (this.selectedOptions = [t.target]);
147
158
  }
148
159
  this._setValue();
149
160
  }
@@ -154,7 +165,7 @@ const c = class c extends b {
154
165
  /** @internal */
155
166
  /** Filter out elements other than skf-select-option and store in this._optionsList */
156
167
  _collectSlotOptionTags() {
157
- this._optionsList = y(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), S({
168
+ this._optionsList = y(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), w({
158
169
  assert: this._optionsList.length > 0,
159
170
  reason: "no-children",
160
171
  replaceStrings: [this.localName, "skf-select-option"]
@@ -163,42 +174,44 @@ const c = class c extends b {
163
174
  /** @internal */
164
175
  _validateInput() {
165
176
  this._invalid = !1;
166
- const t = this.required && !this.getSelectedValues.length || this.min === 1, e = !!(this.min && this.getSelectedValues.length < this.min), s = !!(this.max && this.getSelectedValues.length > this.max);
177
+ const t = this.required && !this.selectedValues.length || this.min === 1, e = !!(this.min && this.selectedValues.length < this.min), i = !!(this.max && this.selectedValues.length > this.max);
167
178
  if (this._internals.validity.customError) {
168
179
  this._invalid = !0;
169
180
  return;
170
181
  } else if (t) {
171
- const a = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
172
- this.setValidity({ valueMissing: !0 }, String(a)), this._pristine || (this._invalid = !0);
182
+ const n = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
183
+ this.setValidity({ valueMissing: !0 }, String(n)), this._pristine || (this._invalid = !0);
173
184
  } else if (e) {
174
- const a = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
175
- this.setValidity({ rangeUnderflow: !0 }, String(a)), this._pristine || (this._invalid = !0);
176
- } else if (s) {
177
- const a = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
178
- this.setValidity({ rangeOverflow: !0 }, String(a)), this._pristine || (this._invalid = !0);
185
+ const n = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
186
+ this.setValidity({ rangeUnderflow: !0 }, String(n)), this._pristine || (this._invalid = !0);
187
+ } else if (i) {
188
+ const n = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
189
+ this.setValidity({ rangeOverflow: !0 }, String(n)), this._pristine || (this._invalid = !0);
179
190
  } else
180
191
  this.setValidity({}), !this._pristine && this.showValid && this.setAttribute("valid", "true");
181
192
  }
182
193
  render() {
183
194
  return h`
184
- <div id="select">
195
+ <div id="root">
185
196
  <label>
186
197
  <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
187
198
  ${this.label}
188
- ${this.required ? w(this.requiredLabel) : null}
199
+ ${this.required ? x(this.requiredLabel) : null}
189
200
  </div>
190
201
  <button
191
202
  ?disabled=${this.disabled}
192
203
  @click=${this._handleDropdownToggle}
193
204
  aria-controls="select-dropdown"
194
- aria-expanded="false"
205
+ aria-expanded=${this._expanded}
206
+ aria-invalid=${this._invalid}
195
207
  aria-haspopup="listbox"
208
+ class="skf-icon-host"
196
209
  id="select-button"
197
210
  role="combobox"
198
211
  >
199
212
  <span
200
213
  id="selected-value"
201
- class=${V({ "selected-value": !0, "contains-meta-info": !this.value })}>
214
+ class=${S({ "selected-value": !0, "contains-meta-info": !this.value })}>
202
215
  ${this._computeVisibleValue()}
203
216
  </span>
204
217
  <skf-icon class="arrow" name="chevronDown"></skf-icon>
@@ -207,27 +220,30 @@ const c = class c extends b {
207
220
  <div aria-multiselectable=${m(this.multiple && !0)} id="select-dropdown" popover role="listbox">
208
221
  <slot @slotchange=${this._handleSlotChange}></slot>
209
222
  </div>
210
- ${!this.hideTags && this.multiple ? h`
223
+ ${!this.hideTags && this.multiple && this.selectedOptions.length > 0 ? h`
211
224
  <div id="tags">
212
225
  ${this.selectedOptions.map(
213
226
  (t) => h`
214
227
  <skf-tag
228
+ style="${`view-transition-name: tag-${String(t.textContent).replace(/[^a-zA-Z]/g, "").toLowerCase()}`}"
215
229
  removable
216
- .onRemove=${(e) => (e.stopPropagation(), e.preventDefault(), t.removeAttribute("selected"), !1)}
230
+ .onRemove=${(e) => (e.stopPropagation(), e.preventDefault(), document.startViewTransition || t.removeAttribute("selected"), document.startViewTransition(() => {
231
+ t.removeAttribute("selected");
232
+ }), !1)}
217
233
  >
218
234
  ${t.textContent}
219
235
  </skf-tag>
220
236
  `
221
237
  )}
222
238
  </div>
223
- ` : $}
239
+ ` : V}
224
240
  ${this.hint && h`
225
241
  <skf-hint
226
242
  aria-live=${this._invalid ? "assertive" : "polite"}
227
243
  id="hint"
228
244
  severity=${m(O(this.severity, this._invalid))}
229
245
  >
230
- ${this.hint}
246
+ ${this.customInvalid ? this.customInvalid : this.hint}
231
247
  </skf-hint>
232
248
  `}
233
249
  </div>
@@ -235,77 +251,77 @@ const c = class c extends b {
235
251
  `;
236
252
  }
237
253
  };
238
- c.styles = [x, P];
239
- let i = c;
254
+ c.styles = [$, P];
255
+ let s = c;
240
256
  l([
241
- r({ type: String, reflect: !0, attribute: "button-label" })
242
- ], i.prototype, "buttonLabel", 2);
257
+ o({ type: String, reflect: !0, attribute: "button-label" })
258
+ ], s.prototype, "buttonLabel", 2);
243
259
  l([
244
- r({ attribute: "custom-invalid" })
245
- ], i.prototype, "customInvalid", 2);
260
+ o({ attribute: "custom-invalid" })
261
+ ], s.prototype, "customInvalid", 2);
246
262
  l([
247
- r({ type: Boolean, attribute: "hide-label" })
248
- ], i.prototype, "hideLabel", 2);
263
+ o({ type: Boolean, attribute: "hide-label" })
264
+ ], s.prototype, "hideLabel", 2);
249
265
  l([
250
- r({ type: Boolean, reflect: !0, attribute: "hide-tags" })
251
- ], i.prototype, "hideTags", 2);
266
+ o({ type: Boolean, reflect: !0, attribute: "hide-tags" })
267
+ ], s.prototype, "hideTags", 2);
252
268
  l([
253
- r()
254
- ], i.prototype, "hint", 2);
269
+ o()
270
+ ], s.prototype, "hint", 2);
255
271
  l([
256
- r({ type: Array, attribute: !1 })
257
- ], i.prototype, "getSelectedValues", 1);
272
+ o({ type: Array, attribute: !1 })
273
+ ], s.prototype, "selectedValues", 1);
258
274
  l([
259
- r({ type: Array, attribute: !1 })
260
- ], i.prototype, "getSelectedOptionsText", 1);
275
+ o({ type: Array, attribute: !1 })
276
+ ], s.prototype, "selectedOptionsText", 1);
261
277
  l([
262
- r({ reflect: !0 })
263
- ], i.prototype, "label", 2);
278
+ o({ reflect: !0 })
279
+ ], s.prototype, "label", 2);
264
280
  l([
265
- r({ type: Number })
266
- ], i.prototype, "max", 2);
281
+ o({ type: Number })
282
+ ], s.prototype, "max", 2);
267
283
  l([
268
- r({ type: Number })
269
- ], i.prototype, "min", 2);
284
+ o({ type: Number })
285
+ ], s.prototype, "min", 2);
270
286
  l([
271
- r({ type: Boolean, reflect: !0 })
272
- ], i.prototype, "multiple", 2);
287
+ o({ type: Boolean, reflect: !0 })
288
+ ], s.prototype, "multiple", 2);
273
289
  l([
274
- r()
275
- ], i.prototype, "name", 2);
290
+ o()
291
+ ], s.prototype, "name", 2);
276
292
  l([
277
- r({ attribute: "required-label" })
278
- ], i.prototype, "requiredLabel", 2);
293
+ o({ attribute: "required-label" })
294
+ ], s.prototype, "requiredLabel", 2);
279
295
  l([
280
- r()
281
- ], i.prototype, "severity", 2);
296
+ o()
297
+ ], s.prototype, "severity", 2);
282
298
  l([
283
- r({ type: Boolean, attribute: "show-valid" })
284
- ], i.prototype, "showValid", 2);
299
+ o({ type: Boolean, attribute: "show-valid" })
300
+ ], s.prototype, "showValid", 2);
285
301
  l([
286
- r({ reflect: !0 })
287
- ], i.prototype, "size", 2);
302
+ o({ reflect: !0 })
303
+ ], s.prototype, "size", 2);
288
304
  l([
289
305
  d()
290
- ], i.prototype, "value", 1);
306
+ ], s.prototype, "value", 1);
291
307
  l([
292
308
  d()
293
- ], i.prototype, "selectedOptions", 1);
309
+ ], s.prototype, "selectedOptions", 1);
294
310
  l([
295
311
  d()
296
- ], i.prototype, "_expanded", 2);
312
+ ], s.prototype, "_expanded", 2);
297
313
  l([
298
314
  d()
299
- ], i.prototype, "_invalid", 2);
315
+ ], s.prototype, "_invalid", 2);
300
316
  l([
301
317
  p("#select-button")
302
- ], i.prototype, "$selectBtn", 2);
318
+ ], s.prototype, "$selectBtn", 2);
303
319
  l([
304
320
  p("#selected-value")
305
- ], i.prototype, "$selectedValue", 2);
321
+ ], s.prototype, "$selectedValue", 2);
306
322
  l([
307
323
  p("#select-dropdown")
308
- ], i.prototype, "$dropdown", 2);
324
+ ], s.prototype, "$dropdown", 2);
309
325
  export {
310
- i as SkfSelect
326
+ s as SkfSelect
311
327
  };
@@ -1,4 +1,4 @@
1
- import type { SkfSelectOption } from '@components/select-option/select-option.component.js';
1
+ import type { SkfSelectOption } from '../select-option/select-option.component.js';
2
2
  import type { ReactiveController } from 'lit';
3
3
  import type { SkfSelect } from './select.component.js';
4
4
  type ControllerHost = SkfSelect;
@@ -146,11 +146,14 @@ class _ {
146
146
  }
147
147
  _badAttributeCombinationWarning() {
148
148
  r({
149
- assert: (this.host.min ?? 0) < (this.host.max ?? 1 / 0),
149
+ assert: (this.host.min ?? 0) <= (this.host.max ?? 1 / 0),
150
150
  reason: "attribute-mismatch",
151
151
  replaceStrings: [this.host.localName, "min", "smaller than max"]
152
152
  }), r({
153
- assert: ((this.host.min ?? this.host.max) && this.host.multiple) ?? !(this.host.min && this.host.max),
153
+ assert: (
154
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
155
+ (this.host.min || this.host.max) && this.host.multiple || !(this.host.min && this.host.max)
156
+ ),
154
157
  reason: "attribute-mismatch",
155
158
  replaceStrings: [this.host.localName, "min or max", "together with multiple"]
156
159
  }), r({
@@ -1,19 +1,23 @@
1
1
  import { visuallyHidden as r } from "../../styles/util.styles.js";
2
- import { css as e } from "lit";
2
+ import { css as o } from "lit";
3
3
  const t = [
4
4
  r,
5
- e`
5
+ o`
6
6
  @layer components {
7
7
  :host {
8
8
  contain: initial;
9
9
  }
10
10
 
11
- #select {
11
+ #root {
12
12
  color: var(--_skf-select-color, var(--skf-text-color-primary));
13
13
  display: flex;
14
14
  flex-direction: column;
15
15
  gap: var(--skf-spacing-25);
16
16
 
17
+ :host([disabled]) & {
18
+ --_skf-select-color: var(--skf-interactive-text-color-disabled);
19
+ }
20
+
17
21
  :host([size='sm']) & {
18
22
  font-size: var(--skf-font-size-75);
19
23
  font-weight: var(--skf-font-weight-medium);
@@ -96,6 +100,16 @@ const t = [
96
100
  }
97
101
  }
98
102
 
103
+ skf-icon {
104
+ transform: var(--_skf-select-icon-transform, rotateX(0deg));
105
+ transform-origin: center;
106
+ transition: transform calc(var(--skf-motion-duration-normal) * 1ms) ease-out;
107
+
108
+ [aria-expanded='true'] & {
109
+ --_skf-select-icon-transform: rotateX(180deg);
110
+ }
111
+ }
112
+
99
113
  #select-dropdown {
100
114
  background-color: var(--skf-bg-color-neutral-1);
101
115
  border: var(--skf-border-width-sm) solid var(--skf-border-color-tertiary);
@@ -106,6 +120,7 @@ const t = [
106
120
 
107
121
  #tags {
108
122
  display: flex;
123
+ flex-wrap: wrap;
109
124
  gap: 0.5rem;
110
125
  }
111
126
  }
@@ -1,5 +1,5 @@
1
- import { SkfElement } from '@internal/components/skf-element.js';
2
- import type { IconColor } from '@skf-design-system/ui-assets';
1
+ import { SkfElement } from '../../internal/components/skf-element.js';
2
+ import type { SeverityFgColor } from '@skf-design-system/ui-assets';
3
3
  import { type CSSResultGroup } from 'lit';
4
4
  import '../icon/icon';
5
5
  import { SkfIcon } from '../icon/icon';
@@ -43,7 +43,7 @@ export declare class SkfSelectOption extends SkfElement {
43
43
  /** If defined, set an icon */
44
44
  icon?: SkfIcon['name'];
45
45
  /** If defined, sets provided color on the icon */
46
- iconColor?: IconColor;
46
+ iconColor?: SeverityFgColor;
47
47
  /** If true, sets the option as selected */
48
48
  selected?: boolean;
49
49
  /** If defined, sets a short label */
@@ -1,8 +1,8 @@
1
- import { SkfElement as p } from "../../internal/components/skf-element.js";
2
- import u from "../../styles/component.styles.js";
3
- import { LitElement as f, html as h } from "lit";
4
- import { property as n, queryAssignedNodes as m } from "lit/decorators.js";
5
- import { ifDefined as _ } from "lit/directives/if-defined.js";
1
+ import { SkfElement as u } from "../../internal/components/skf-element.js";
2
+ import f from "../../styles/component.styles.js";
3
+ import { LitElement as m, html as h } from "lit";
4
+ import { property as n, queryAssignedNodes as _ } from "lit/decorators.js";
5
+ import { ifDefined as p } from "lit/directives/if-defined.js";
6
6
  import "../icon/icon.js";
7
7
  import { styles as y } from "./select-option.styles.js";
8
8
  var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (d, t, s, i) => {
@@ -10,7 +10,7 @@ var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (d, t, s
10
10
  (c = d[a]) && (r = (i ? c(t, s, r) : c(r)) || r);
11
11
  return i && r && v(t, s, r), r;
12
12
  };
13
- const l = class l extends p {
13
+ const l = class l extends u {
14
14
  constructor() {
15
15
  super(), this._handleClick = (s) => {
16
16
  s.stopPropagation(), this.selected = !this.selected;
@@ -69,16 +69,22 @@ const l = class l extends p {
69
69
  render() {
70
70
  return h`
71
71
  <button
72
+ ?disabled=${this.disabled}
72
73
  @click=${this._handleClick}
73
74
  aria-selected=${this.selected ? "true" : "false"}
74
- ?disabled=${this.disabled}
75
75
  role="option"
76
76
  >
77
77
  <skf-icon id="icon-check" name="check" size="sm"></skf-icon>
78
78
  <slot>${this.text}</slot>
79
79
  <div id="adornments">
80
80
  <slot name="icon">
81
- ${this.icon && h`<skf-icon name=${this.icon} color=${_(this.iconColor)}></skf-icon>`}
81
+ ${this.icon && h`
82
+ <skf-icon
83
+ class=${p((this.disabled ?? !this.iconColor) && "skf-icon-host")}
84
+ color=${p(this.iconColor)}
85
+ name=${this.icon}
86
+ ></skf-icon>
87
+ `}
82
88
  </slot>
83
89
  ${this.shortLabel && h`<div id="short-label">${this.shortLabel}</div>`}
84
90
  </div>
@@ -86,7 +92,7 @@ const l = class l extends p {
86
92
  `;
87
93
  }
88
94
  };
89
- l.styles = [u, y], l.shadowRootOptions = { ...f.shadowRootOptions, delegatesFocus: !0 };
95
+ l.styles = [f, y], l.shadowRootOptions = { ...m.shadowRootOptions, delegatesFocus: !0 };
90
96
  let e = l;
91
97
  o([
92
98
  n({ type: Boolean, reflect: !0 })
@@ -110,7 +116,7 @@ o([
110
116
  n({ reflect: !0 })
111
117
  ], e.prototype, "value", 1);
112
118
  o([
113
- m({ flatten: !0 })
119
+ _({ flatten: !0 })
114
120
  ], e.prototype, "_assignedNodes", 2);
115
121
  export {
116
122
  e as SkfSelectOption
@@ -1,4 +1,4 @@
1
- import type { SkfSelectOption } from '@components/select-option/select-option.component.js';
1
+ import type { SkfSelectOption } from '../select-option/select-option.component.js';
2
2
  import type { ReactiveController } from 'lit';
3
3
  type ControllerHost = SkfSelectOption;
4
4
  export declare class DeveloperFeedbackController implements ReactiveController {
@@ -1,4 +1,4 @@
1
- import { SkfElement } from '@internal/components/skf-element';
1
+ import { SkfElement } from '../../internal/components/skf-element';
2
2
  import { type CSSResultGroup } from 'lit';
3
3
  /**
4
4
  * The `<skf-select-option-group>` is a component that groups select-options
@@ -1,5 +1,5 @@
1
- import { FormBase } from '@internal/components/formBase.js';
2
- import type { FormFieldBaseProps } from '@internal/types/formField.js';
1
+ import { FormBase } from '../../internal/components/formBase.js';
2
+ import type { FormFieldBaseProps } from '../../internal/types/formField.js';
3
3
  import { type CSSResultGroup } from 'lit';
4
4
  /**
5
5
  * The `<skf-switch>` is a component that displays a list of actions or options
@@ -9,13 +9,12 @@ import { type CSSResultGroup } from 'lit';
9
9
  * @attribute {boolean} disabled - If true, sets disabled state
10
10
  * @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
11
11
  *
12
- * @slot - The component's placeholder content
12
+ * @slot - The Switchs label. Alternatively, you can use the `label` attribute.
13
13
  *
14
14
  * @tagname skf-switch
15
15
  */
16
16
  export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
17
17
  static styles: CSSResultGroup;
18
- /** @internal */
19
18
  private _initialChecked;
20
19
  /** If true, outputs helping hints in console */
21
20
  debug?: boolean;
@@ -23,7 +22,7 @@ export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
23
22
  checked?: boolean;
24
23
  /** If true, hides the label visually */
25
24
  hideLabel?: boolean;
26
- /** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
25
+ /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
27
26
  label?: string;
28
27
  /** If defined, adds name to the input-element */
29
28
  name?: string;
@@ -3,9 +3,10 @@ import { Asterisk as u } from "../../internal/templates/asterisk.js";
3
3
  import p from "../../styles/component.styles.js";
4
4
  import { html as c } from "lit";
5
5
  import { property as s, state as v, query as f } from "lit/decorators.js";
6
- import { ifDefined as m } from "lit/directives/if-defined.js";
6
+ import { classMap as m } from "lit/directives/class-map.js";
7
+ import { ifDefined as _ } from "lit/directives/if-defined.js";
7
8
  import { styles as b } from "./switch.styles.js";
8
- var y = Object.defineProperty, i = (d, e, a, _) => {
9
+ var y = Object.defineProperty, i = (d, e, a, g) => {
9
10
  for (var l = void 0, r = d.length - 1, n; r >= 0; r--)
10
11
  (n = d[r]) && (l = n(e, a, l) || l);
11
12
  return l && y(e, a, l), l;
@@ -41,14 +42,22 @@ const h = class h extends o {
41
42
  var e;
42
43
  if (this._invalid = !1, this.required && !this.checked) {
43
44
  this.pristine || (this._invalid = !0);
44
- const a = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : ((e = this.$input) == null ? void 0 : e.validationMessage) ?? "Please check this box if you want to proceed";
45
+ const a = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : (
46
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
47
+ ((e = this.$input) == null ? void 0 : e.validationMessage) || "Please check this box if you want to proceed"
48
+ );
45
49
  this.setValidity({ valueMissing: !0 }, String(a));
46
50
  } else
47
51
  this.setValidity({});
48
52
  }
49
53
  render() {
50
54
  return c`
51
- <label id="switch">
55
+ <label
56
+ class=${m({
57
+ switch: !0,
58
+ "switch--small": this.size === "sm"
59
+ })}
60
+ >
52
61
  <input
53
62
  ?checked=${this.checked}
54
63
  ?disabled=${this.disabled}
@@ -57,13 +66,14 @@ const h = class h extends o {
57
66
  @invalid=${this._handleInvalid}
58
67
  @reset=${this._resetValue}
59
68
  aria-invalid=${!!this._invalid}
60
- name=${m(this.name)}
69
+ class="switch__input"
70
+ name=${_(this.name)}
61
71
  type="checkbox"
62
72
  value=${this.value}
63
73
  />
64
- <div id="label">
74
+ <div class="switch__label">
65
75
  <slot>${this.label}</slot>
66
- ${this.required ? u(this.requiredLabel) : null}
76
+ ${this.required ? u(this.requiredLabel, "switch__asterisk") : null}
67
77
  </div>
68
78
  </label>
69
79
  `;