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

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 (204) hide show
  1. package/dist/components/accordion/accordion-item.d.ts +1 -1
  2. package/dist/components/accordion/accordion.component.d.ts +4 -4
  3. package/dist/components/accordion/accordion.component.js +18 -17
  4. package/dist/components/accordion/accordion.styles.d.ts +1 -2
  5. package/dist/components/accordion/accordion.styles.js +5 -4
  6. package/dist/components/alert/alert.component.d.ts +5 -5
  7. package/dist/components/alert/alert.component.js +46 -35
  8. package/dist/components/alert/alert.styles.d.ts +1 -2
  9. package/dist/components/alert/alert.styles.js +29 -24
  10. package/dist/components/breadcrumb/breadcrumb.component.d.ts +29 -0
  11. package/dist/components/breadcrumb/breadcrumb.d.ts +8 -0
  12. package/dist/components/breadcrumb-item/breadcrumb-item.component.d.ts +25 -0
  13. package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +8 -0
  14. package/dist/components/button/button.component.d.ts +29 -5
  15. package/dist/components/button/button.component.js +89 -52
  16. package/dist/components/button/button.styles.js +65 -45
  17. package/dist/components/card/card.component.d.ts +4 -4
  18. package/dist/components/card/card.component.js +35 -24
  19. package/dist/components/card/card.styles.d.ts +1 -2
  20. package/dist/components/card/card.styles.js +14 -12
  21. package/dist/components/checkbox/checkbox.component.d.ts +11 -12
  22. package/dist/components/checkbox/checkbox.component.js +96 -90
  23. package/dist/components/collapse/collapse.component.d.ts +8 -8
  24. package/dist/components/collapse/collapse.component.js +42 -34
  25. package/dist/components/collapse/collapse.styles.js +15 -14
  26. package/dist/components/dialog/dialog.component.d.ts +74 -0
  27. package/dist/components/dialog/dialog.component.js +187 -0
  28. package/dist/components/dialog/dialog.d.ts +8 -0
  29. package/dist/components/dialog/dialog.js +6 -0
  30. package/dist/components/dialog/dialog.styles.d.ts +1 -0
  31. package/dist/components/dialog/dialog.styles.js +91 -0
  32. package/dist/components/divider/divider.component.d.ts +3 -3
  33. package/dist/components/divider/divider.component.js +39 -27
  34. package/dist/components/divider/divider.styles.d.ts +1 -2
  35. package/dist/components/divider/divider.styles.js +26 -26
  36. package/dist/components/heading/heading.component.d.ts +2 -2
  37. package/dist/components/heading/heading.component.js +13 -13
  38. package/dist/components/icon/icon.component.d.ts +2 -5
  39. package/dist/components/icon/icon.component.js +32 -23
  40. package/dist/components/icon/icon.styles.js +53 -47
  41. package/dist/components/input/input.component.d.ts +12 -11
  42. package/dist/components/input/input.component.js +88 -89
  43. package/dist/components/link/link.component.d.ts +7 -6
  44. package/dist/components/link/link.component.js +49 -43
  45. package/dist/components/link/link.styles.js +36 -40
  46. package/dist/components/loader/loader.component.d.ts +2 -2
  47. package/dist/components/loader/loader.component.js +39 -32
  48. package/dist/components/loader/loader.styles.js +11 -10
  49. package/dist/components/logo/logo.component.d.ts +3 -3
  50. package/dist/components/logo/logo.component.js +28 -17
  51. package/dist/components/logo/logo.styles.d.ts +1 -2
  52. package/dist/components/logo/logo.styles.js +11 -9
  53. package/dist/components/menu/menu.component.d.ts +24 -0
  54. package/dist/components/menu/menu.component.js +18 -0
  55. package/dist/components/menu/menu.d.ts +8 -0
  56. package/dist/components/menu/menu.js +6 -0
  57. package/dist/components/menu/menu.styles.d.ts +1 -0
  58. package/dist/components/menu/menu.styles.js +11 -0
  59. package/dist/components/menu-item/menu-item.component.d.ts +25 -0
  60. package/dist/components/menu-item/menu-item.component.js +13 -0
  61. package/dist/components/menu-item/menu-item.d.ts +8 -0
  62. package/dist/components/menu-item/menu-item.js +6 -0
  63. package/dist/components/menu-item/menu-item.styles.d.ts +1 -0
  64. package/dist/components/menu-item/menu-item.styles.js +19 -0
  65. package/dist/components/popover/popover.component.d.ts +29 -0
  66. package/dist/components/popover/popover.component.js +37 -0
  67. package/dist/components/popover/popover.d.ts +8 -0
  68. package/dist/components/popover/popover.js +6 -0
  69. package/dist/components/popover/popover.styles.d.ts +1 -0
  70. package/dist/components/popover/popover.styles.js +12 -0
  71. package/dist/components/progress/progress.component.d.ts +22 -0
  72. package/dist/components/progress/progress.component.js +49 -0
  73. package/dist/components/progress/progress.d.ts +8 -0
  74. package/dist/components/progress/progress.js +6 -0
  75. package/dist/components/progress/progress.styles.d.ts +1 -0
  76. package/dist/components/progress/progress.styles.js +48 -0
  77. package/dist/components/radio/radio.component.d.ts +7 -9
  78. package/dist/components/radio/radio.component.js +95 -79
  79. package/dist/components/select/select.component.d.ts +10 -12
  80. package/dist/components/select/select.component.js +120 -120
  81. package/dist/components/select/select.controllers.d.ts +1 -26
  82. package/dist/components/select/select.controllers.js +35 -95
  83. package/dist/components/select-option/select-option.component.d.ts +1 -1
  84. package/dist/components/select-option/select-option.controllers.d.ts +1 -1
  85. package/dist/components/select-option-group/select-option-group.component.d.ts +1 -1
  86. package/dist/components/select-option-group/select-option-group.component.js +9 -9
  87. package/dist/components/stepper/stepper.component.d.ts +38 -0
  88. package/dist/components/stepper/stepper.component.js +91 -0
  89. package/dist/components/stepper/stepper.d.ts +8 -0
  90. package/dist/components/stepper/stepper.helpers.d.ts +16 -0
  91. package/dist/components/stepper/stepper.helpers.js +18 -0
  92. package/dist/components/stepper/stepper.js +6 -0
  93. package/dist/components/stepper/stepper.styles.d.ts +1 -0
  94. package/dist/components/stepper/stepper.styles.js +15 -0
  95. package/dist/components/stepper-item/stepper-item.component.d.ts +47 -0
  96. package/dist/components/stepper-item/stepper-item.component.js +113 -0
  97. package/dist/components/stepper-item/stepper-item.d.ts +8 -0
  98. package/dist/components/stepper-item/stepper-item.js +6 -0
  99. package/dist/components/stepper-item/stepper-item.styles.d.ts +1 -0
  100. package/dist/components/stepper-item/stepper-item.styles.js +98 -0
  101. package/dist/components/switch/switch.component.d.ts +2 -2
  102. package/dist/components/switch/switch.component.js +17 -7
  103. package/dist/components/switch/switch.styles.js +16 -13
  104. package/dist/components/tab/tab.component.d.ts +29 -0
  105. package/dist/components/tab/tab.component.js +57 -0
  106. package/dist/components/tab/tab.d.ts +8 -0
  107. package/dist/components/tab/tab.js +6 -0
  108. package/dist/components/tab/tab.styles.d.ts +1 -0
  109. package/dist/components/tab/tab.styles.js +123 -0
  110. package/dist/components/tab-group/tab-group.component.d.ts +43 -0
  111. package/dist/components/tab-group/tab-group.component.js +98 -0
  112. package/dist/components/tab-group/tab-group.d.ts +8 -0
  113. package/dist/components/tab-group/tab-group.js +6 -0
  114. package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
  115. package/dist/components/tab-group/tab-group.styles.js +75 -0
  116. package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
  117. package/dist/components/tab-panel/tab-panel.component.js +36 -0
  118. package/dist/components/tab-panel/tab-panel.d.ts +8 -0
  119. package/dist/components/tab-panel/tab-panel.js +6 -0
  120. package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
  121. package/dist/components/tab-panel/tab-panel.styles.js +13 -0
  122. package/dist/components/tag/tag.component.d.ts +2 -2
  123. package/dist/components/tag/tag.component.js +61 -45
  124. package/dist/components/tag/tag.styles.js +30 -28
  125. package/dist/components/textarea/textarea.component.d.ts +4 -4
  126. package/dist/components/textarea/textarea.component.js +2 -2
  127. package/dist/components/toast/toast.component.d.ts +8 -5
  128. package/dist/components/toast/toast.component.js +30 -26
  129. package/dist/components/toast/toast.singleton.d.ts +5 -10
  130. package/dist/components/toast/toast.singleton.js +25 -25
  131. package/dist/components/toast/toast.styles.d.ts +1 -0
  132. package/dist/components/toast-item/toast-item.component.d.ts +1 -1
  133. package/dist/components/toast-item/toast-item.component.js +15 -15
  134. package/dist/components/toast-item/toast-item.styles.js +18 -0
  135. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +2 -2
  136. package/dist/components/toast-wrapper/toast-wrapper.component.js +11 -11
  137. package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
  138. package/dist/components/tooltip/tooltip.component.d.ts +24 -0
  139. package/dist/components/tooltip/tooltip.component.js +18 -0
  140. package/dist/components/tooltip/tooltip.d.ts +8 -0
  141. package/dist/components/tooltip/tooltip.js +6 -0
  142. package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
  143. package/dist/components/tooltip/tooltip.styles.js +12 -0
  144. package/dist/custom-elements.json +2465 -629
  145. package/dist/index.d.ts +11 -0
  146. package/dist/index.js +77 -44
  147. package/dist/internal/base-classes/popover/popover.base.d.ts +29 -0
  148. package/dist/internal/base-classes/popover/popover.base.js +116 -0
  149. package/dist/internal/base-classes/popover/popover.styles.d.ts +1 -0
  150. package/dist/internal/base-classes/popover/popover.styles.js +29 -0
  151. package/dist/internal/components/formBase.d.ts +1 -0
  152. package/dist/internal/components/formBase.js +11 -11
  153. package/dist/internal/components/hint/hint.component.d.ts +2 -2
  154. package/dist/internal/components/hint/hint.component.js +13 -13
  155. package/dist/internal/components/skf-element.js +26 -25
  156. package/dist/internal/controllers/popover.controller.d.ts +16 -0
  157. package/dist/internal/controllers/popover.controller.js +44 -0
  158. package/dist/internal/helpers/hintSeverity.d.ts +2 -2
  159. package/dist/internal/helpers/watch.d.ts +27 -0
  160. package/dist/internal/helpers/watch.js +28 -0
  161. package/dist/internal/templates/asterisk.d.ts +1 -1
  162. package/dist/internal/templates/asterisk.js +7 -6
  163. package/dist/react/index.d.ts +13 -0
  164. package/dist/react/index.js +13 -0
  165. package/dist/react/skf-breadcrumb/index.d.ts +9 -0
  166. package/dist/react/skf-breadcrumb/index.js +17 -0
  167. package/dist/react/skf-breadcrumb-item/index.d.ts +3 -0
  168. package/dist/react/skf-breadcrumb-item/index.js +13 -0
  169. package/dist/react/skf-button/index.d.ts +7 -1
  170. package/dist/react/skf-button/index.js +5 -1
  171. package/dist/react/skf-dialog/index.d.ts +15 -0
  172. package/dist/react/skf-dialog/index.js +19 -0
  173. package/dist/react/skf-menu/index.d.ts +12 -0
  174. package/dist/react/skf-menu/index.js +18 -0
  175. package/dist/react/skf-menu-item/index.d.ts +27 -0
  176. package/dist/react/skf-menu-item/index.js +23 -0
  177. package/dist/react/skf-popover/index.d.ts +12 -0
  178. package/dist/react/skf-popover/index.js +18 -0
  179. package/dist/react/skf-progress/index.d.ts +3 -0
  180. package/dist/react/skf-progress/index.js +13 -0
  181. package/dist/react/skf-stepper/index.d.ts +9 -0
  182. package/dist/react/skf-stepper/index.js +17 -0
  183. package/dist/react/skf-stepper-item/index.d.ts +9 -0
  184. package/dist/react/skf-stepper-item/index.js +17 -0
  185. package/dist/react/skf-tab/index.d.ts +12 -0
  186. package/dist/react/skf-tab/index.js +18 -0
  187. package/dist/react/skf-tab-group/index.d.ts +3 -0
  188. package/dist/react/skf-tab-group/index.js +13 -0
  189. package/dist/react/skf-tab-panel/index.d.ts +3 -0
  190. package/dist/react/skf-tab-panel/index.js +13 -0
  191. package/dist/react/skf-tooltip/index.d.ts +12 -0
  192. package/dist/react/skf-tooltip/index.js +18 -0
  193. package/dist/styles/component.styles.js +15 -2
  194. package/dist/types/jsx/custom-element-jsx.d.ts +603 -27
  195. package/dist/types/vue/index.d.ts +413 -11
  196. package/dist/vscode.html-custom-data.json +462 -36
  197. package/dist/web-types.json +944 -90
  198. package/package.json +43 -42
  199. package/dist/components/toast-item/toast-item.style.js +0 -16
  200. /package/dist/components/{toast/toast.style.d.ts → breadcrumb/breadcrumb.styles.d.ts} +0 -0
  201. /package/dist/components/{toast-wrapper/toast-wrapper.style.d.ts → breadcrumb-item/breadcrumb-item.styles.d.ts} +0 -0
  202. /package/dist/components/toast/{toast.style.js → toast.styles.js} +0 -0
  203. /package/dist/components/toast-item/{toast-item.style.d.ts → toast-item.styles.d.ts} +0 -0
  204. /package/dist/components/toast-wrapper/{toast-wrapper.style.js → toast-wrapper.styles.js} +0 -0
@@ -1,26 +1,28 @@
1
- import { computePosition as v, flip as _, shift as f, 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
- import { findMatchingTags as y } from "../../internal/helpers/findMatchingTags.js";
4
- import { hintSeverity as O } from "../../internal/helpers/hintSeverity.js";
3
+ import { PopoverController as y } from "../../internal/controllers/popover.controller.js";
4
+ import { findMatchingTags as O } from "../../internal/helpers/findMatchingTags.js";
5
+ import { hintSeverity as x } from "../../internal/helpers/hintSeverity.js";
5
6
  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 S } from "lit";
9
- import { property as o, state as d, query as p } from "lit/decorators.js";
10
- import { classMap as V } from "lit/directives/class-map.js";
7
+ import { watch as $ } from "../../internal/helpers/watch.js";
8
+ import { Asterisk as V } from "../../internal/templates/asterisk.js";
9
+ import S from "../../styles/component.styles.js";
10
+ import { html as n, nothing as C } from "lit";
11
+ import { property as o, state as h, query as p } from "lit/decorators.js";
12
+ import { classMap as E } from "lit/directives/class-map.js";
11
13
  import { ifDefined as m } from "lit/directives/if-defined.js";
12
14
  import "../../internal/components/hint/hint.js";
13
15
  import "../tag/tag.js";
14
- import { ScrollController as C, ResizeController as k, GlobalClickController as E, KeyboardNavigationController as L, DeveloperFeedbackController as A } from "./select.controllers.js";
16
+ import { GlobalClickController as k, KeyboardNavigationController as L, DeveloperFeedbackController as A } from "./select.controllers.js";
15
17
  import { styles as P } from "./select.styles.js";
16
- var D = Object.defineProperty, M = Object.getOwnPropertyDescriptor, l = (u, t, e, i) => {
17
- for (var r = i > 1 ? void 0 : i ? M(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 && D(t, e, r), r;
18
+ var T = Object.defineProperty, D = Object.getOwnPropertyDescriptor, s = (u, t, e, l) => {
19
+ for (var a = l > 1 ? void 0 : l ? D(t, e) : t, r = u.length - 1, d; r >= 0; r--)
20
+ (d = u[r]) && (a = (l ? d(t, e, a) : d(a)) || a);
21
+ return l && a && T(t, e, a), a;
20
22
  };
21
23
  const c = class c extends b {
22
24
  constructor() {
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 E(this), this.keyboardNavController = new L(this), this.developerFeedbackController = new A(this), this._handleOptionSelected = (t) => {
25
+ super(), this.selectDelay = 200, this._optionsList = [], this.buttonLabel = "Select an option", this.size = "md", this._expanded = !1, this._invalid = !1, this.globalClickController = new k(this), this.keyboardNavController = new L(this), this.developerFeedbackController = new A(this), this.popoverController = new y(this), this._handleOptionSelected = (t) => {
24
26
  this._pristine = !1;
25
27
  const e = this._selectedOptions.length > 0;
26
28
  this.setFormValue(e ? this.selectedValues.join(",") : null), this._updateState(t);
@@ -28,26 +30,20 @@ const c = class c extends b {
28
30
  this.emitEvent("reset"), this._resetSelectedOptions();
29
31
  }, this._updateWidth = () => {
30
32
  setTimeout(() => {
31
- var t;
32
- (t = this.$dropdown) == null || t.style.setProperty("--select-width", `${String(this.offsetWidth)}px`);
33
+ this.$popover.style.setProperty("--select-width", `${String(this.offsetWidth)}px`);
33
34
  }, 50);
34
- }, this._managePopover = () => ({ close: () => {
35
- var i;
36
- (i = this.$dropdown) == null || i.hidePopover();
37
- }, open: () => {
38
- const i = this.$selectBtn, r = this.$dropdown;
39
- !i || !r || (r.showPopover(), v(i, r, {
35
+ }, this.reposition = async () => {
36
+ const { x: t, y: e } = await v(this.$anchor, this.$popover, {
40
37
  placement: "bottom",
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
- });
47
- }).catch((n) => {
48
- console.error(n);
49
- }));
50
- } }), this._handleDropdownToggle = (t) => {
38
+ middleware: [f(), _({ padding: 5 }), g(2)],
39
+ strategy: "fixed"
40
+ });
41
+ Object.assign(this.$popover.style, {
42
+ left: `${String(t)}px`,
43
+ top: `${String(e)}px`,
44
+ width: `${String(this.$anchor.offsetWidth)}px`
45
+ });
46
+ }, this._handleDropdownToggle = (t) => {
51
47
  t.stopPropagation(), this._expanded = !this._expanded;
52
48
  }, this._setValue = async () => new Promise((t) => {
53
49
  switch (!0) {
@@ -68,8 +64,8 @@ const c = class c extends b {
68
64
  });
69
65
  }), this._resetSelectedOptions = (t) => {
70
66
  const e = !t;
71
- this._optionsList.forEach((i) => {
72
- (e || i !== t) && i.removeAttribute("selected");
67
+ this._optionsList.forEach((l) => {
68
+ (e || l !== t) && l.removeAttribute("selected");
73
69
  });
74
70
  }, this._handleSlotChange = () => {
75
71
  this._collectSlotOptionTags(), this._validateInput();
@@ -93,8 +89,8 @@ const c = class c extends b {
93
89
  return this._selectedOptions.map((t) => t.textContent ?? "");
94
90
  }
95
91
  set value(t) {
96
- const e = t.split(",").map((i) => i.trim());
97
- this._selectedOptions = this._optionsList.filter((i) => e.includes(i.value.trim()));
92
+ const e = t.split(",").map((l) => l.trim());
93
+ this._selectedOptions = this._optionsList.filter((l) => e.includes(l.value.trim()));
98
94
  }
99
95
  get value() {
100
96
  return this._selectedOptions.length ? this._selectedOptions.length === 1 ? this._selectedOptions[0].value.trim() : this._selectedOptions.map((t) => t.value.trim()).join(",") : "";
@@ -127,18 +123,16 @@ const c = class c extends b {
127
123
  var t;
128
124
  this.addEventListener("skf-select-option:select", this._handleOptionSelected), (t = this._internals.form) == null || t.addEventListener("reset", this._handleReset), this.onUpdateComplete(), this._validateInput();
129
125
  }
130
- updated(t) {
131
- if (t.has("_expanded")) {
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();
135
- }
126
+ handleExpandedChange() {
127
+ this._expanded ? (this.$popover.togglePopover(this._expanded), this.popoverController.start()) : (this.$popover.togglePopover(this._expanded), this.popoverController.stop().catch((t) => {
128
+ console.error(t);
129
+ })), this.emit("skf-select:dropdown", { detail: { expanded: this._expanded } });
136
130
  }
137
- attributeChangedCallback(t, e, i) {
138
- if (super.attributeChangedCallback(t, e, i), t === "custom-invalid")
139
- if (typeof i == "string") {
140
- const n = String(i).trim() || "Custom error";
141
- this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, n), this.checkValidity();
131
+ attributeChangedCallback(t, e, l) {
132
+ if (super.attributeChangedCallback(t, e, l), t === "custom-invalid")
133
+ if (typeof l == "string") {
134
+ const r = this.withFallback(l);
135
+ this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, r), this.checkValidity();
142
136
  } else
143
137
  this.setValidity({}), this._validateInput();
144
138
  }
@@ -153,8 +147,8 @@ const c = class c extends b {
153
147
  e.selected && (this.selectedOptions = [...this.selectedOptions, e]);
154
148
  });
155
149
  else {
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]);
150
+ const e = this._selectedOptions.length > 0, l = t.detail.value !== null;
151
+ e && (this._selectedOptions[0].setSelectedDiscrete = !1, this._selectedOptions = []), l && (this.selectedOptions = [t.target]);
158
152
  }
159
153
  this._setValue();
160
154
  }
@@ -165,7 +159,7 @@ const c = class c extends b {
165
159
  /** @internal */
166
160
  /** Filter out elements other than skf-select-option and store in this._optionsList */
167
161
  _collectSlotOptionTags() {
168
- this._optionsList = y(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), w({
162
+ this._optionsList = O(this, "skf-select-option"), this._selectedOptions = this._optionsList.filter((t) => t.selected), w({
169
163
  assert: this._optionsList.length > 0,
170
164
  reason: "no-children",
171
165
  replaceStrings: [this.localName, "skf-select-option"]
@@ -174,29 +168,29 @@ const c = class c extends b {
174
168
  /** @internal */
175
169
  _validateInput() {
176
170
  this._invalid = !1;
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);
171
+ const t = this.required && !this.selectedValues.length || this.min === 1, e = !!(this.min && this.selectedValues.length < this.min), l = !!(this.max && this.selectedValues.length > this.max);
178
172
  if (this._internals.validity.customError) {
179
173
  this._invalid = !0;
180
174
  return;
181
175
  } else if (t) {
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);
176
+ const r = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
177
+ this.setValidity({ valueMissing: !0 }, String(r)), this._pristine || (this._invalid = !0);
184
178
  } else if (e) {
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
+ const r = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
180
+ this.setValidity({ rangeUnderflow: !0 }, String(r)), this._pristine || (this._invalid = !0);
181
+ } else if (l) {
182
+ const r = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
183
+ this.setValidity({ rangeOverflow: !0 }, String(r)), this._pristine || (this._invalid = !0);
190
184
  } else
191
185
  this.setValidity({}), !this._pristine && this.showValid && this.setAttribute("valid", "true");
192
186
  }
193
187
  render() {
194
- return h`
188
+ return n`
195
189
  <div id="root">
196
190
  <label>
197
191
  <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
198
192
  ${this.label}
199
- ${this.required ? x(this.requiredLabel) : null}
193
+ ${this.required ? V(this.requiredLabel) : null}
200
194
  </div>
201
195
  <button
202
196
  ?disabled=${this.disabled}
@@ -211,7 +205,7 @@ const c = class c extends b {
211
205
  >
212
206
  <span
213
207
  id="selected-value"
214
- class=${V({ "selected-value": !0, "contains-meta-info": !this.value })}>
208
+ class=${E({ "selected-value": !0, "contains-meta-info": !this.value })}>
215
209
  ${this._computeVisibleValue()}
216
210
  </span>
217
211
  <skf-icon class="arrow" name="chevronDown"></skf-icon>
@@ -220,25 +214,28 @@ const c = class c extends b {
220
214
  <div aria-multiselectable=${m(this.multiple && !0)} id="select-dropdown" popover role="listbox">
221
215
  <slot @slotchange=${this._handleSlotChange}></slot>
222
216
  </div>
223
- ${!this.hideTags && this.multiple && this.selectedOptions.length > 0 ? h`
217
+ ${!this.hideTags && this.multiple && this.selectedOptions.length > 0 ? n`
224
218
  <div id="tags">
225
219
  ${this.selectedOptions.map(
226
- (t) => h`
220
+ (t) => n`
227
221
  <skf-tag
222
+ style="${`view-transition-name: tag-${String(t.textContent).replace(/[^a-zA-Z]/g, "").toLowerCase()}`}"
228
223
  removable
229
- .onRemove=${(e) => (e.stopPropagation(), e.preventDefault(), t.removeAttribute("selected"), !1)}
224
+ .onRemove=${(e) => (e.stopPropagation(), e.preventDefault(), document.startViewTransition || t.removeAttribute("selected"), document.startViewTransition(() => {
225
+ t.removeAttribute("selected");
226
+ }), !1)}
230
227
  >
231
228
  ${t.textContent}
232
229
  </skf-tag>
233
230
  `
234
231
  )}
235
232
  </div>
236
- ` : S}
237
- ${this.hint && h`
233
+ ` : C}
234
+ ${this.hint && n`
238
235
  <skf-hint
239
236
  aria-live=${this._invalid ? "assertive" : "polite"}
240
237
  id="hint"
241
- severity=${m(O(this.severity, this._invalid))}
238
+ severity=${m(x(this.severity, this._invalid))}
242
239
  >
243
240
  ${this.customInvalid ? this.customInvalid : this.hint}
244
241
  </skf-hint>
@@ -248,77 +245,80 @@ const c = class c extends b {
248
245
  `;
249
246
  }
250
247
  };
251
- c.styles = [$, P];
252
- let s = c;
253
- l([
248
+ c.styles = [S, P];
249
+ let i = c;
250
+ s([
254
251
  o({ type: String, reflect: !0, attribute: "button-label" })
255
- ], s.prototype, "buttonLabel", 2);
256
- l([
252
+ ], i.prototype, "buttonLabel", 2);
253
+ s([
257
254
  o({ attribute: "custom-invalid" })
258
- ], s.prototype, "customInvalid", 2);
259
- l([
255
+ ], i.prototype, "customInvalid", 2);
256
+ s([
260
257
  o({ type: Boolean, attribute: "hide-label" })
261
- ], s.prototype, "hideLabel", 2);
262
- l([
258
+ ], i.prototype, "hideLabel", 2);
259
+ s([
263
260
  o({ type: Boolean, reflect: !0, attribute: "hide-tags" })
264
- ], s.prototype, "hideTags", 2);
265
- l([
261
+ ], i.prototype, "hideTags", 2);
262
+ s([
266
263
  o()
267
- ], s.prototype, "hint", 2);
268
- l([
264
+ ], i.prototype, "hint", 2);
265
+ s([
269
266
  o({ type: Array, attribute: !1 })
270
- ], s.prototype, "selectedValues", 1);
271
- l([
267
+ ], i.prototype, "selectedValues", 1);
268
+ s([
272
269
  o({ type: Array, attribute: !1 })
273
- ], s.prototype, "selectedOptionsText", 1);
274
- l([
270
+ ], i.prototype, "selectedOptionsText", 1);
271
+ s([
275
272
  o({ reflect: !0 })
276
- ], s.prototype, "label", 2);
277
- l([
273
+ ], i.prototype, "label", 2);
274
+ s([
278
275
  o({ type: Number })
279
- ], s.prototype, "max", 2);
280
- l([
276
+ ], i.prototype, "max", 2);
277
+ s([
281
278
  o({ type: Number })
282
- ], s.prototype, "min", 2);
283
- l([
279
+ ], i.prototype, "min", 2);
280
+ s([
284
281
  o({ type: Boolean, reflect: !0 })
285
- ], s.prototype, "multiple", 2);
286
- l([
282
+ ], i.prototype, "multiple", 2);
283
+ s([
287
284
  o()
288
- ], s.prototype, "name", 2);
289
- l([
285
+ ], i.prototype, "name", 2);
286
+ s([
290
287
  o({ attribute: "required-label" })
291
- ], s.prototype, "requiredLabel", 2);
292
- l([
288
+ ], i.prototype, "requiredLabel", 2);
289
+ s([
293
290
  o()
294
- ], s.prototype, "severity", 2);
295
- l([
291
+ ], i.prototype, "severity", 2);
292
+ s([
296
293
  o({ type: Boolean, attribute: "show-valid" })
297
- ], s.prototype, "showValid", 2);
298
- l([
294
+ ], i.prototype, "showValid", 2);
295
+ s([
299
296
  o({ reflect: !0 })
300
- ], s.prototype, "size", 2);
301
- l([
302
- d()
303
- ], s.prototype, "value", 1);
304
- l([
305
- d()
306
- ], s.prototype, "selectedOptions", 1);
307
- l([
308
- d()
309
- ], s.prototype, "_expanded", 2);
310
- l([
311
- d()
312
- ], s.prototype, "_invalid", 2);
313
- l([
297
+ ], i.prototype, "size", 2);
298
+ s([
299
+ h()
300
+ ], i.prototype, "value", 1);
301
+ s([
302
+ h()
303
+ ], i.prototype, "selectedOptions", 1);
304
+ s([
305
+ h()
306
+ ], i.prototype, "_expanded", 2);
307
+ s([
308
+ h()
309
+ ], i.prototype, "_invalid", 2);
310
+ s([
314
311
  p("#select-button")
315
- ], s.prototype, "$selectBtn", 2);
316
- l([
312
+ ], i.prototype, "$anchor", 2);
313
+ s([
317
314
  p("#selected-value")
318
- ], s.prototype, "$selectedValue", 2);
319
- l([
315
+ ], i.prototype, "$selectedValue", 2);
316
+ s([
320
317
  p("#select-dropdown")
321
- ], s.prototype, "$dropdown", 2);
318
+ ], i.prototype, "$popover", 2);
319
+ s([
320
+ $("_expanded", { afterUpdate: !0 })
321
+ ], i.prototype, "handleExpandedChange", 1);
322
322
  export {
323
- s as SkfSelect
323
+ i as SkfSelect
324
324
  };
@@ -1,32 +1,7 @@
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;
5
- export declare class ScrollController implements ReactiveController {
6
- _scrollHandler?: () => void;
7
- host?: ControllerHost;
8
- localExpanded: boolean;
9
- constructor(host: ControllerHost);
10
- hostDisconnected(): void;
11
- hostUpdated(): void;
12
- enableScrollDetection(): void;
13
- disableScrollDetection(): void;
14
- /** @internal */
15
- _onScrollOutOfView(): void;
16
- /** @internal */
17
- _onScrollIntoView(): void;
18
- }
19
- export declare class ResizeController implements ReactiveController {
20
- host: ControllerHost;
21
- _resizeObserver?: ResizeObserver;
22
- constructor(host: ControllerHost);
23
- hostConnected(): void;
24
- hostDisconnected(): void;
25
- enableResizeObserver(): void;
26
- disableResizeObserver(): void;
27
- /** @internal */
28
- _onResize: () => void;
29
- }
30
5
  export declare class GlobalClickController implements ReactiveController {
31
6
  host: ControllerHost;
32
7
  constructor(host: ControllerHost);
@@ -1,67 +1,9 @@
1
- import { raiseError as r } from "../../internal/helpers/raiseError.js";
1
+ import { raiseError as l } from "../../internal/helpers/raiseError.js";
2
2
  class d {
3
- constructor(e) {
4
- this.localExpanded = !1, this.host = e, e.addController(this);
5
- }
6
- hostDisconnected() {
7
- this.disableScrollDetection();
8
- }
9
- hostUpdated() {
10
- var e, t, s;
11
- ((e = this.host) == null ? void 0 : e._expanded) !== this.localExpanded && (this.localExpanded = !!((t = this.host) != null && t._expanded), (s = this.host) != null && s._expanded ? this.enableScrollDetection() : this.disableScrollDetection());
12
- }
13
- enableScrollDetection() {
14
- if (this._scrollHandler = () => {
15
- if (!this.host) return;
16
- this.host._expanded = !1;
17
- const t = this.host.getBoundingClientRect();
18
- t.top < 0 || t.bottom > window.innerHeight || t.left < 0 || t.right > window.innerWidth ? this._onScrollOutOfView() : this._onScrollIntoView();
19
- }, window.addEventListener("scroll", this._scrollHandler, !0), !this.host) return;
20
- let e = this.host.parentElement;
21
- for (; e; )
22
- (e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth) && e.addEventListener("scroll", this._scrollHandler, !0), e = e.parentElement;
23
- }
24
- disableScrollDetection() {
25
- if (!this._scrollHandler || (window.removeEventListener("scroll", this._scrollHandler, !0), !this.host)) return;
26
- let e = this.host.parentElement;
27
- for (; e; )
28
- (e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth) && e.removeEventListener("scroll", this._scrollHandler, !0), e = e.parentElement;
29
- }
30
- /** @internal */
31
- _onScrollOutOfView() {
32
- this.host && (this.host._expanded = !1);
33
- }
34
- /** @internal */
35
- _onScrollIntoView() {
36
- }
37
- }
38
- class b {
39
- constructor(e) {
40
- this._onResize = () => {
41
- this.host._expanded = !1;
42
- }, this.host = e, e.addController(this);
43
- }
44
- hostConnected() {
45
- this.enableResizeObserver();
46
- }
47
- hostDisconnected() {
48
- this.disableResizeObserver();
49
- }
50
- enableResizeObserver() {
51
- this._resizeObserver = new ResizeObserver(() => {
52
- this.host._expanded = !1, this.host._updateWidth();
53
- }), this._resizeObserver.observe(document.body), this._resizeObserver.observe(this.host);
54
- }
55
- disableResizeObserver() {
56
- var e;
57
- (e = this._resizeObserver) == null || e.disconnect();
58
- }
59
- }
60
- class p {
61
- constructor(e) {
62
- this._globalClickHandler = (t) => {
63
- t.target.closest(this.host.localName) || (this.host._expanded = !1);
64
- }, this.host = e, e.addController(this);
3
+ constructor(t) {
4
+ this._globalClickHandler = (e) => {
5
+ e.target.closest(this.host.localName) || (this.host._expanded = !1);
6
+ }, this.host = t, t.addController(this);
65
7
  }
66
8
  // hostConnected() {
67
9
  // this.enableGlobalClickDetection();
@@ -79,26 +21,26 @@ class p {
79
21
  document.removeEventListener("click", this._globalClickHandler);
80
22
  }
81
23
  }
82
- class u {
83
- constructor(e) {
84
- this._handleKeyDown = (t) => {
85
- switch (t.key) {
24
+ class p {
25
+ constructor(t) {
26
+ this._handleKeyDown = (e) => {
27
+ switch (e.key) {
86
28
  case "ArrowDown":
87
- t.preventDefault(), this._focusSiblingOption("next");
29
+ e.preventDefault(), this._focusSiblingOption("next");
88
30
  break;
89
31
  case "ArrowUp":
90
- t.preventDefault(), this._focusSiblingOption("prev");
32
+ e.preventDefault(), this._focusSiblingOption("prev");
91
33
  break;
92
34
  case "Enter":
93
- t.preventDefault(), this._selectFocusedOption(t.target);
35
+ e.preventDefault(), this._selectFocusedOption(e.target);
94
36
  break;
95
37
  case "Escape":
96
- t.preventDefault(), this.host._expanded = !1, setTimeout(() => {
38
+ e.preventDefault(), this.host._expanded = !1, setTimeout(() => {
97
39
  this.host.focus();
98
40
  });
99
41
  break;
100
42
  }
101
- }, this.host = e, e.addController(this), this._listenerActivated = !1;
43
+ }, this.host = t, t.addController(this), this._listenerActivated = !1;
102
44
  }
103
45
  hostDisconnected() {
104
46
  this.removeKeyboardListener();
@@ -113,50 +55,50 @@ class u {
113
55
  this.host.removeEventListener("keydown", this._handleKeyDown), this._listenerActivated = !1;
114
56
  }
115
57
  _focusFirstOption() {
116
- const e = this._selectableOptions[0];
58
+ const t = this._selectableOptions[0];
117
59
  setTimeout(() => {
118
- e.focus();
60
+ t.focus();
119
61
  });
120
62
  }
121
- _focusSiblingOption(e) {
122
- const t = (n) => n === document.activeElement, s = this._selectableOptions.find((n) => t(n));
63
+ _focusSiblingOption(t) {
64
+ const e = (n) => n === document.activeElement, s = this._selectableOptions.find((n) => e(n));
123
65
  if (!s) {
124
66
  this._focusFirstOption();
125
67
  return;
126
68
  }
127
- const h = this._selectableOptions.indexOf(s);
128
- let o = h - 1, l = h + 1;
129
- o < 0 && (o = this._selectableOptions.length - 1), l >= this._selectableOptions.length && (l = 0);
130
- const a = this._selectableOptions[e === "next" ? l : o];
131
- s.blur(), a.focus();
69
+ const r = this._selectableOptions.indexOf(s);
70
+ let i = r - 1, o = r + 1;
71
+ i < 0 && (i = this._selectableOptions.length - 1), o >= this._selectableOptions.length && (o = 0);
72
+ const h = this._selectableOptions[t === "next" ? o : i];
73
+ s.blur(), h.focus();
132
74
  }
133
- _selectFocusedOption(e) {
134
- e.selected = !0;
75
+ _selectFocusedOption(t) {
76
+ t.selected = !0;
135
77
  }
136
78
  get _selectableOptions() {
137
- return this.host._optionsList.filter((e) => !e.disabled);
79
+ return this.host._optionsList.filter((t) => !t.disabled);
138
80
  }
139
81
  }
140
- class _ {
141
- constructor(e) {
142
- this.host = e, e.addController(this);
82
+ class b {
83
+ constructor(t) {
84
+ this.host = t, t.addController(this);
143
85
  }
144
86
  hostConnected() {
145
87
  this._badAttributeCombinationWarning();
146
88
  }
147
89
  _badAttributeCombinationWarning() {
148
- r({
90
+ l({
149
91
  assert: (this.host.min ?? 0) <= (this.host.max ?? 1 / 0),
150
92
  reason: "attribute-mismatch",
151
93
  replaceStrings: [this.host.localName, "min", "smaller than max"]
152
- }), r({
94
+ }), l({
153
95
  assert: (
154
96
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
155
97
  (this.host.min || this.host.max) && this.host.multiple || !(this.host.min && this.host.max)
156
98
  ),
157
99
  reason: "attribute-mismatch",
158
100
  replaceStrings: [this.host.localName, "min or max", "together with multiple"]
159
- }), r({
101
+ }), l({
160
102
  assert: (this.host.hideTags && this.host.multiple) ?? !this.host.hideTags,
161
103
  reason: "attribute-mismatch",
162
104
  replaceStrings: [this.host.localName, "hide-tags", "together with multiple"]
@@ -164,9 +106,7 @@ class _ {
164
106
  }
165
107
  }
166
108
  export {
167
- _ as DeveloperFeedbackController,
168
- p as GlobalClickController,
169
- u as KeyboardNavigationController,
170
- b as ResizeController,
171
- d as ScrollController
109
+ b as DeveloperFeedbackController,
110
+ d as GlobalClickController,
111
+ p as KeyboardNavigationController
172
112
  };
@@ -1,4 +1,4 @@
1
- import { SkfElement } from '@internal/components/skf-element.js';
1
+ import { SkfElement } from '../../internal/components/skf-element.js';
2
2
  import type { SeverityFgColor } from '@skf-design-system/ui-assets';
3
3
  import { type CSSResultGroup } from 'lit';
4
4
  import '../icon/icon';
@@ -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,19 +1,19 @@
1
1
  import { SkfElement as a } from "../../internal/components/skf-element.js";
2
2
  import f from "../../styles/component.styles.js";
3
- import { html as p } from "lit";
3
+ import { html as n } from "lit";
4
4
  import { property as d } from "lit/decorators.js";
5
- import { styles as n } from "./select-option-group.style.js";
6
- var v = Object.defineProperty, u = (o, s, i, b) => {
7
- for (var r = void 0, e = o.length - 1, m; e >= 0; e--)
8
- (m = o[e]) && (r = m(s, i, r) || r);
9
- return r && v(s, i, r), r;
5
+ import { styles as p } from "./select-option-group.style.js";
6
+ var u = Object.defineProperty, v = (s, o, i, b) => {
7
+ for (var r = void 0, e = s.length - 1, m; e >= 0; e--)
8
+ (m = s[e]) && (r = m(o, i, r) || r);
9
+ return r && u(o, i, r), r;
10
10
  };
11
11
  const l = class l extends a {
12
12
  constructor() {
13
13
  super(...arguments), this.label = "Default label";
14
14
  }
15
15
  render() {
16
- return p`
16
+ return n`
17
17
  <div role="group">
18
18
  <div id="label">${this.label}</div>
19
19
  <slot></slot>
@@ -21,9 +21,9 @@ const l = class l extends a {
21
21
  `;
22
22
  }
23
23
  };
24
- l.styles = [f, n];
24
+ l.styles = [f, p];
25
25
  let t = l;
26
- u([
26
+ v([
27
27
  d({ reflect: !0 })
28
28
  ], t.prototype, "label");
29
29
  export {