@skf-design-system/ui-components 1.0.0-beta.7 → 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 (115) hide show
  1. package/dist/components/accordion/accordion.component.js +3 -3
  2. package/dist/components/alert/alert.component.d.ts +2 -2
  3. package/dist/components/alert/alert.component.js +32 -32
  4. package/dist/components/breadcrumb/breadcrumb.component.d.ts +29 -0
  5. package/dist/components/breadcrumb/breadcrumb.d.ts +8 -0
  6. package/dist/components/breadcrumb/breadcrumb.styles.d.ts +1 -0
  7. package/dist/components/breadcrumb-item/breadcrumb-item.component.d.ts +25 -0
  8. package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +8 -0
  9. package/dist/components/breadcrumb-item/breadcrumb-item.styles.d.ts +1 -0
  10. package/dist/components/button/button.component.d.ts +3 -1
  11. package/dist/components/button/button.component.js +60 -47
  12. package/dist/components/button/button.styles.js +64 -45
  13. package/dist/components/card/card.component.js +4 -4
  14. package/dist/components/checkbox/checkbox.component.js +4 -4
  15. package/dist/components/dialog/dialog.component.d.ts +0 -1
  16. package/dist/components/dialog/dialog.component.js +21 -23
  17. package/dist/components/divider/divider.component.js +12 -12
  18. package/dist/components/heading/heading.component.js +13 -13
  19. package/dist/components/icon/icon.component.d.ts +1 -4
  20. package/dist/components/icon/icon.component.js +32 -23
  21. package/dist/components/icon/icon.styles.js +53 -47
  22. package/dist/components/link/link.component.d.ts +1 -0
  23. package/dist/components/link/link.component.js +42 -42
  24. package/dist/components/loader/loader.component.js +19 -19
  25. package/dist/components/logo/logo.component.js +6 -6
  26. package/dist/components/menu/menu.component.d.ts +24 -0
  27. package/dist/components/menu/menu.component.js +18 -0
  28. package/dist/components/menu/menu.d.ts +8 -0
  29. package/dist/components/menu/menu.js +6 -0
  30. package/dist/components/menu/menu.styles.d.ts +1 -0
  31. package/dist/components/menu/menu.styles.js +11 -0
  32. package/dist/components/menu-item/menu-item.component.d.ts +25 -0
  33. package/dist/components/menu-item/menu-item.component.js +13 -0
  34. package/dist/components/menu-item/menu-item.d.ts +8 -0
  35. package/dist/components/menu-item/menu-item.js +6 -0
  36. package/dist/components/menu-item/menu-item.styles.d.ts +1 -0
  37. package/dist/components/menu-item/menu-item.styles.js +19 -0
  38. package/dist/components/popover/popover.component.d.ts +29 -0
  39. package/dist/components/popover/popover.component.js +37 -0
  40. package/dist/components/popover/popover.d.ts +8 -0
  41. package/dist/components/popover/popover.js +6 -0
  42. package/dist/components/popover/popover.styles.d.ts +1 -0
  43. package/dist/components/popover/popover.styles.js +12 -0
  44. package/dist/components/progress/progress.component.js +7 -7
  45. package/dist/components/radio/radio.component.js +4 -4
  46. package/dist/components/select/select.component.d.ts +8 -10
  47. package/dist/components/select/select.component.js +115 -118
  48. package/dist/components/select/select.controllers.d.ts +0 -25
  49. package/dist/components/select/select.controllers.js +35 -95
  50. package/dist/components/select-option-group/select-option-group.component.js +9 -9
  51. package/dist/components/stepper/stepper.component.d.ts +38 -0
  52. package/dist/components/stepper/stepper.component.js +91 -0
  53. package/dist/components/stepper/stepper.d.ts +8 -0
  54. package/dist/components/stepper/stepper.helpers.d.ts +16 -0
  55. package/dist/components/stepper/stepper.helpers.js +18 -0
  56. package/dist/components/stepper/stepper.js +6 -0
  57. package/dist/components/stepper/stepper.styles.d.ts +1 -0
  58. package/dist/components/stepper/stepper.styles.js +15 -0
  59. package/dist/components/stepper-item/stepper-item.component.d.ts +47 -0
  60. package/dist/components/stepper-item/stepper-item.component.js +113 -0
  61. package/dist/components/stepper-item/stepper-item.d.ts +8 -0
  62. package/dist/components/stepper-item/stepper-item.js +6 -0
  63. package/dist/components/stepper-item/stepper-item.styles.d.ts +1 -0
  64. package/dist/components/stepper-item/stepper-item.styles.js +98 -0
  65. package/dist/components/tab/tab.component.js +4 -4
  66. package/dist/components/tab-panel/tab-panel.component.js +12 -12
  67. package/dist/components/tag/tag.component.js +9 -9
  68. package/dist/components/textarea/textarea.component.js +3 -3
  69. package/dist/components/toast/toast.component.d.ts +7 -4
  70. package/dist/components/toast/toast.component.js +30 -26
  71. package/dist/components/toast/toast.singleton.d.ts +2 -7
  72. package/dist/components/toast/toast.singleton.js +25 -25
  73. package/dist/components/toast-item/toast-item.component.js +15 -15
  74. package/dist/components/toast-item/toast-item.styles.js +13 -11
  75. package/dist/components/toast-wrapper/toast-wrapper.component.js +10 -10
  76. package/dist/components/tooltip/tooltip.component.d.ts +24 -0
  77. package/dist/components/tooltip/tooltip.component.js +18 -0
  78. package/dist/components/tooltip/tooltip.d.ts +8 -0
  79. package/dist/components/tooltip/tooltip.js +6 -0
  80. package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
  81. package/dist/components/tooltip/tooltip.styles.js +12 -0
  82. package/dist/custom-elements.json +2179 -1002
  83. package/dist/index.d.ts +6 -0
  84. package/dist/index.js +72 -54
  85. package/dist/internal/base-classes/popover/popover.base.d.ts +29 -0
  86. package/dist/internal/base-classes/popover/popover.base.js +116 -0
  87. package/dist/internal/base-classes/popover/popover.styles.d.ts +1 -0
  88. package/dist/internal/base-classes/popover/popover.styles.js +29 -0
  89. package/dist/internal/components/hint/hint.component.js +13 -13
  90. package/dist/internal/controllers/popover.controller.d.ts +16 -0
  91. package/dist/internal/controllers/popover.controller.js +44 -0
  92. package/dist/internal/helpers/hintSeverity.d.ts +1 -1
  93. package/dist/react/index.d.ts +10 -2
  94. package/dist/react/index.js +10 -2
  95. package/dist/react/skf-breadcrumb/index.d.ts +9 -0
  96. package/dist/react/skf-breadcrumb/index.js +17 -0
  97. package/dist/react/skf-breadcrumb-item/index.d.ts +3 -0
  98. package/dist/react/skf-breadcrumb-item/index.js +13 -0
  99. package/dist/react/skf-menu/index.d.ts +12 -0
  100. package/dist/react/skf-menu/index.js +18 -0
  101. package/dist/react/skf-menu-item/index.d.ts +27 -0
  102. package/dist/react/skf-menu-item/index.js +23 -0
  103. package/dist/react/skf-popover/index.d.ts +12 -0
  104. package/dist/react/skf-popover/index.js +18 -0
  105. package/dist/react/skf-stepper/index.d.ts +9 -0
  106. package/dist/react/skf-stepper/index.js +17 -0
  107. package/dist/react/skf-stepper-item/index.d.ts +9 -0
  108. package/dist/react/skf-stepper-item/index.js +17 -0
  109. package/dist/react/skf-tooltip/index.d.ts +12 -0
  110. package/dist/react/skf-tooltip/index.js +18 -0
  111. package/dist/types/jsx/custom-element-jsx.d.ts +594 -163
  112. package/dist/types/vue/index.d.ts +326 -74
  113. package/dist/vscode.html-custom-data.json +722 -390
  114. package/dist/web-types.json +836 -290
  115. package/package.json +33 -33
@@ -1,26 +1,28 @@
1
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 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";
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 L, KeyboardNavigationController as A, DeveloperFeedbackController as E } 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 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;
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 L(this), this.keyboardNavController = new A(this), this.developerFeedbackController = new E(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 = this.withFallback(i);
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=${S({ "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,10 +214,10 @@ 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
228
222
  style="${`view-transition-name: tag-${String(t.textContent).replace(/[^a-zA-Z]/g, "").toLowerCase()}`}"
229
223
  removable
@@ -236,12 +230,12 @@ const c = class c extends b {
236
230
  `
237
231
  )}
238
232
  </div>
239
- ` : V}
240
- ${this.hint && h`
233
+ ` : C}
234
+ ${this.hint && n`
241
235
  <skf-hint
242
236
  aria-live=${this._invalid ? "assertive" : "polite"}
243
237
  id="hint"
244
- severity=${m(O(this.severity, this._invalid))}
238
+ severity=${m(x(this.severity, this._invalid))}
245
239
  >
246
240
  ${this.customInvalid ? this.customInvalid : this.hint}
247
241
  </skf-hint>
@@ -251,77 +245,80 @@ const c = class c extends b {
251
245
  `;
252
246
  }
253
247
  };
254
- c.styles = [$, P];
255
- let s = c;
256
- l([
248
+ c.styles = [S, P];
249
+ let i = c;
250
+ s([
257
251
  o({ type: String, reflect: !0, attribute: "button-label" })
258
- ], s.prototype, "buttonLabel", 2);
259
- l([
252
+ ], i.prototype, "buttonLabel", 2);
253
+ s([
260
254
  o({ attribute: "custom-invalid" })
261
- ], s.prototype, "customInvalid", 2);
262
- l([
255
+ ], i.prototype, "customInvalid", 2);
256
+ s([
263
257
  o({ type: Boolean, attribute: "hide-label" })
264
- ], s.prototype, "hideLabel", 2);
265
- l([
258
+ ], i.prototype, "hideLabel", 2);
259
+ s([
266
260
  o({ type: Boolean, reflect: !0, attribute: "hide-tags" })
267
- ], s.prototype, "hideTags", 2);
268
- l([
261
+ ], i.prototype, "hideTags", 2);
262
+ s([
269
263
  o()
270
- ], s.prototype, "hint", 2);
271
- l([
264
+ ], i.prototype, "hint", 2);
265
+ s([
272
266
  o({ type: Array, attribute: !1 })
273
- ], s.prototype, "selectedValues", 1);
274
- l([
267
+ ], i.prototype, "selectedValues", 1);
268
+ s([
275
269
  o({ type: Array, attribute: !1 })
276
- ], s.prototype, "selectedOptionsText", 1);
277
- l([
270
+ ], i.prototype, "selectedOptionsText", 1);
271
+ s([
278
272
  o({ reflect: !0 })
279
- ], s.prototype, "label", 2);
280
- l([
273
+ ], i.prototype, "label", 2);
274
+ s([
281
275
  o({ type: Number })
282
- ], s.prototype, "max", 2);
283
- l([
276
+ ], i.prototype, "max", 2);
277
+ s([
284
278
  o({ type: Number })
285
- ], s.prototype, "min", 2);
286
- l([
279
+ ], i.prototype, "min", 2);
280
+ s([
287
281
  o({ type: Boolean, reflect: !0 })
288
- ], s.prototype, "multiple", 2);
289
- l([
282
+ ], i.prototype, "multiple", 2);
283
+ s([
290
284
  o()
291
- ], s.prototype, "name", 2);
292
- l([
285
+ ], i.prototype, "name", 2);
286
+ s([
293
287
  o({ attribute: "required-label" })
294
- ], s.prototype, "requiredLabel", 2);
295
- l([
288
+ ], i.prototype, "requiredLabel", 2);
289
+ s([
296
290
  o()
297
- ], s.prototype, "severity", 2);
298
- l([
291
+ ], i.prototype, "severity", 2);
292
+ s([
299
293
  o({ type: Boolean, attribute: "show-valid" })
300
- ], s.prototype, "showValid", 2);
301
- l([
294
+ ], i.prototype, "showValid", 2);
295
+ s([
302
296
  o({ reflect: !0 })
303
- ], s.prototype, "size", 2);
304
- l([
305
- d()
306
- ], s.prototype, "value", 1);
307
- l([
308
- d()
309
- ], s.prototype, "selectedOptions", 1);
310
- l([
311
- d()
312
- ], s.prototype, "_expanded", 2);
313
- l([
314
- d()
315
- ], s.prototype, "_invalid", 2);
316
- 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([
317
311
  p("#select-button")
318
- ], s.prototype, "$selectBtn", 2);
319
- l([
312
+ ], i.prototype, "$anchor", 2);
313
+ s([
320
314
  p("#selected-value")
321
- ], s.prototype, "$selectedValue", 2);
322
- l([
315
+ ], i.prototype, "$selectedValue", 2);
316
+ s([
323
317
  p("#select-dropdown")
324
- ], s.prototype, "$dropdown", 2);
318
+ ], i.prototype, "$popover", 2);
319
+ s([
320
+ $("_expanded", { afterUpdate: !0 })
321
+ ], i.prototype, "handleExpandedChange", 1);
325
322
  export {
326
- s as SkfSelect
323
+ i as SkfSelect
327
324
  };
@@ -2,31 +2,6 @@ import type { SkfSelectOption } from '../select-option/select-option.component.j
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,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 {
@@ -0,0 +1,38 @@
1
+ import type { SkfStepperItem } from '../stepper-item/stepper-item.component.js';
2
+ import { SkfElement } from '../../internal/components/skf-element';
3
+ import { type CSSResultGroup } from 'lit';
4
+ /**
5
+ * The `<skf-stepper>` is a component that displays a list of actions or options.
6
+ *
7
+ * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
8
+ *
9
+ * @slot - One or more `<skf-stepper-item>`
10
+ *
11
+ * @event skf-stepper-item-select - Dispatched when the stepper item is selected
12
+ *
13
+ * @tagname skf-stepper
14
+ */
15
+ export declare class SkfStepper extends SkfElement {
16
+ #private;
17
+ static styles: CSSResultGroup;
18
+ /** Sets the active item */
19
+ activeIndex: number;
20
+ /** If true, sets linear mode (user can't go back to completed steps due to dependencies) */
21
+ linear: boolean;
22
+ /** @internal */
23
+ _items?: NodeListOf<SkfStepperItem>;
24
+ constructor();
25
+ firstUpdated(): void;
26
+ /** @internal activeIndex is the source of truth. Once updated all stepper states are recalculated. */
27
+ _handleActiveIndexChanged(): void;
28
+ /** @internal */
29
+ _handleLinearMode(): void;
30
+ private _handleSelected;
31
+ /** @internal */
32
+ private _resetActive;
33
+ /** @internal */
34
+ private _getCurrentActiveIndex;
35
+ /** @internal Not much can be handled before this kick off */
36
+ private _handleSlotChanged;
37
+ render(): import("lit").TemplateResult<1>;
38
+ }