@skf-design-system/ui-components 1.0.1-beta.1 → 1.0.2-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 (186) hide show
  1. package/README.md +1 -18
  2. package/dist/components/accordion/accordion.component.d.ts +4 -4
  3. package/dist/components/accordion/accordion.component.js +8 -8
  4. package/dist/components/alert/alert.component.d.ts +8 -9
  5. package/dist/components/alert/alert.component.js +7 -7
  6. package/dist/components/breadcrumb/breadcrumb.component.d.ts +1 -1
  7. package/dist/components/card/card.component.js +18 -30
  8. package/dist/components/card/card.styles.js +25 -28
  9. package/dist/components/checkbox/checkbox.component.d.ts +8 -8
  10. package/dist/components/checkbox/checkbox.component.js +3 -3
  11. package/dist/components/collapse/collapse.component.js +1 -1
  12. package/dist/components/date-picker/datepicker.calendar.component.d.ts +5 -0
  13. package/dist/components/date-picker/datepicker.calendar.component.js +128 -95
  14. package/dist/components/date-picker/datepicker.calendar.styles.js +35 -25
  15. package/dist/components/date-picker/datepicker.component.d.ts +5 -0
  16. package/dist/components/date-picker/datepicker.component.js +117 -97
  17. package/dist/components/date-picker/datepicker.helpers.d.ts +3 -2
  18. package/dist/components/date-picker/datepicker.helpers.js +46 -39
  19. package/dist/components/date-picker/datepicker.styles.js +14 -26
  20. package/dist/components/date-picker-input/datepicker-input.component.d.ts +13 -5
  21. package/dist/components/date-picker-input/datepicker-input.component.js +263 -219
  22. package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +36 -2
  23. package/dist/components/date-picker-input/datepicker-input.helpers.js +25 -23
  24. package/dist/components/date-picker-input/datepicker-input.styles.js +6 -10
  25. package/dist/components/dialog/dialog.component.d.ts +18 -28
  26. package/dist/components/dialog/dialog.component.js +89 -79
  27. package/dist/components/divider/divider.component.d.ts +4 -8
  28. package/dist/components/divider/divider.component.js +24 -46
  29. package/dist/components/divider/divider.styles.js +34 -30
  30. package/dist/components/drawer/drawer.component.d.ts +57 -0
  31. package/dist/components/drawer/drawer.component.js +124 -0
  32. package/dist/components/drawer/drawer.d.ts +8 -0
  33. package/dist/components/drawer/drawer.js +6 -0
  34. package/dist/components/drawer/drawer.styles.d.ts +1 -0
  35. package/dist/components/drawer/drawer.styles.js +71 -0
  36. package/dist/components/header/header.component.d.ts +45 -0
  37. package/dist/components/header/header.component.js +110 -0
  38. package/dist/components/header/header.d.ts +8 -0
  39. package/dist/components/header/header.js +6 -0
  40. package/dist/components/header/header.styles.d.ts +1 -0
  41. package/dist/components/header/header.styles.js +68 -0
  42. package/dist/components/heading/heading.component.d.ts +6 -12
  43. package/dist/components/heading/heading.component.js +11 -11
  44. package/dist/components/heading/heading.styles.d.ts +1 -2
  45. package/dist/components/heading/heading.styles.js +1 -1
  46. package/dist/components/icon/icon.component.d.ts +1 -1
  47. package/dist/components/input/input.component.d.ts +2 -2
  48. package/dist/components/input/input.component.js +3 -3
  49. package/dist/components/input/input.controllers.d.ts +20 -6
  50. package/dist/components/input/input.controllers.js +14 -10
  51. package/dist/components/link/link.component.js +1 -0
  52. package/dist/components/link/link.styles.js +24 -20
  53. package/dist/components/menu/menu.component.d.ts +4 -5
  54. package/dist/components/menu/menu.component.js +1 -1
  55. package/dist/components/nav/nav.component.d.ts +17 -0
  56. package/dist/components/nav/nav.component.js +34 -0
  57. package/dist/components/nav/nav.d.ts +8 -0
  58. package/dist/components/nav/nav.js +6 -0
  59. package/dist/components/nav/nav.styles.d.ts +1 -0
  60. package/dist/components/nav/nav.styles.js +17 -0
  61. package/dist/components/nav-item/nav-item.component.d.ts +20 -0
  62. package/dist/components/nav-item/nav-item.component.js +38 -0
  63. package/dist/components/nav-item/nav-item.d.ts +8 -0
  64. package/dist/components/nav-item/nav-item.js +6 -0
  65. package/dist/components/nav-item/nav-item.styles.d.ts +1 -0
  66. package/dist/components/nav-item/nav-item.styles.js +39 -0
  67. package/dist/components/popover/popover.component.d.ts +5 -6
  68. package/dist/components/popover/popover.component.js +19 -19
  69. package/dist/components/radio/radio.component.d.ts +10 -6
  70. package/dist/components/radio/radio.component.js +10 -10
  71. package/dist/components/radio/radio.styles.d.ts +1 -2
  72. package/dist/components/radio/radio.styles.js +1 -1
  73. package/dist/components/segmented-button/segmented-button.component.d.ts +32 -0
  74. package/dist/components/segmented-button/segmented-button.d.ts +8 -0
  75. package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
  76. package/dist/components/segmented-button-item/segmented-button-item.component.d.ts +36 -0
  77. package/dist/components/segmented-button-item/segmented-button-item.d.ts +8 -0
  78. package/dist/components/segmented-button-item/segmented-button-item.styles.d.ts +1 -0
  79. package/dist/components/select/select.component.js +2 -2
  80. package/dist/components/select/select.controllers.d.ts +20 -9
  81. package/dist/components/select/select.controllers.js +27 -22
  82. package/dist/components/select-option/select-option.controllers.d.ts +11 -5
  83. package/dist/components/stepper/stepper.component.d.ts +2 -1
  84. package/dist/components/stepper-item/stepper-item.component.js +2 -2
  85. package/dist/components/switch/switch.component.d.ts +7 -6
  86. package/dist/components/switch/switch.component.js +7 -7
  87. package/dist/components/tag/tag.component.d.ts +4 -2
  88. package/dist/components/tag/tag.component.js +6 -6
  89. package/dist/components/textarea/textarea.component.js +7 -7
  90. package/dist/components/toast/toast.component.d.ts +1 -1
  91. package/dist/components/tooltip/tooltip.component.d.ts +5 -6
  92. package/dist/components/tooltip/tooltip.component.js +11 -11
  93. package/dist/custom-elements.json +2477 -1745
  94. package/dist/index.d.ts +4 -0
  95. package/dist/index.js +82 -70
  96. package/dist/internal/base-classes/popover/popover.base.d.ts +17 -7
  97. package/dist/internal/base-classes/popover/popover.base.js +119 -75
  98. package/dist/internal/base-classes/popover/popover.styles.js +14 -1
  99. package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
  100. package/dist/internal/controllers/popover.controller.d.ts +12 -7
  101. package/dist/internal/controllers/popover.controller.js +9 -14
  102. package/dist/internal/helpers/utilityTypes.d.ts +1 -1
  103. package/dist/internal/helpers/uuid.d.ts +15 -0
  104. package/dist/internal/helpers/uuid.js +14 -0
  105. package/dist/internal/storybook/styles.d.ts +1 -0
  106. package/dist/styles/form-field.styles.js +11 -6
  107. package/dist/styles/global.css +1 -1
  108. package/dist/types/jsx/custom-element-jsx.d.ts +642 -1261
  109. package/dist/types/vue/index.d.ts +422 -267
  110. package/dist/vscode.html-custom-data.json +805 -525
  111. package/dist/web-types.json +928 -653
  112. package/package.json +41 -51
  113. package/dist/react/index.d.ts +0 -36
  114. package/dist/react/index.js +0 -36
  115. package/dist/react/skf-accordion/index.d.ts +0 -3
  116. package/dist/react/skf-accordion/index.js +0 -13
  117. package/dist/react/skf-alert/index.d.ts +0 -9
  118. package/dist/react/skf-alert/index.js +0 -17
  119. package/dist/react/skf-breadcrumb/index.d.ts +0 -9
  120. package/dist/react/skf-breadcrumb/index.js +0 -17
  121. package/dist/react/skf-breadcrumb-item/index.d.ts +0 -3
  122. package/dist/react/skf-breadcrumb-item/index.js +0 -13
  123. package/dist/react/skf-button/index.d.ts +0 -9
  124. package/dist/react/skf-button/index.js +0 -17
  125. package/dist/react/skf-card/index.d.ts +0 -3
  126. package/dist/react/skf-card/index.js +0 -13
  127. package/dist/react/skf-checkbox/index.d.ts +0 -9
  128. package/dist/react/skf-checkbox/index.js +0 -17
  129. package/dist/react/skf-collapse/index.d.ts +0 -9
  130. package/dist/react/skf-collapse/index.js +0 -17
  131. package/dist/react/skf-datepicker/index.d.ts +0 -12
  132. package/dist/react/skf-datepicker/index.js +0 -18
  133. package/dist/react/skf-dialog/index.d.ts +0 -15
  134. package/dist/react/skf-dialog/index.js +0 -19
  135. package/dist/react/skf-divider/index.d.ts +0 -3
  136. package/dist/react/skf-divider/index.js +0 -13
  137. package/dist/react/skf-heading/index.d.ts +0 -3
  138. package/dist/react/skf-heading/index.js +0 -13
  139. package/dist/react/skf-icon/index.d.ts +0 -3
  140. package/dist/react/skf-icon/index.js +0 -13
  141. package/dist/react/skf-input/index.d.ts +0 -12
  142. package/dist/react/skf-input/index.js +0 -18
  143. package/dist/react/skf-link/index.d.ts +0 -3
  144. package/dist/react/skf-link/index.js +0 -13
  145. package/dist/react/skf-loader/index.d.ts +0 -3
  146. package/dist/react/skf-loader/index.js +0 -13
  147. package/dist/react/skf-logo/index.d.ts +0 -3
  148. package/dist/react/skf-logo/index.js +0 -13
  149. package/dist/react/skf-menu/index.d.ts +0 -12
  150. package/dist/react/skf-menu/index.js +0 -18
  151. package/dist/react/skf-menu-item/index.d.ts +0 -27
  152. package/dist/react/skf-menu-item/index.js +0 -23
  153. package/dist/react/skf-popover/index.d.ts +0 -12
  154. package/dist/react/skf-popover/index.js +0 -18
  155. package/dist/react/skf-progress/index.d.ts +0 -3
  156. package/dist/react/skf-progress/index.js +0 -13
  157. package/dist/react/skf-radio/index.d.ts +0 -9
  158. package/dist/react/skf-radio/index.js +0 -17
  159. package/dist/react/skf-select/index.d.ts +0 -21
  160. package/dist/react/skf-select/index.js +0 -21
  161. package/dist/react/skf-select-option/index.d.ts +0 -9
  162. package/dist/react/skf-select-option/index.js +0 -17
  163. package/dist/react/skf-select-option-group/index.d.ts +0 -3
  164. package/dist/react/skf-select-option-group/index.js +0 -13
  165. package/dist/react/skf-stepper/index.d.ts +0 -9
  166. package/dist/react/skf-stepper/index.js +0 -17
  167. package/dist/react/skf-stepper-item/index.d.ts +0 -9
  168. package/dist/react/skf-stepper-item/index.js +0 -17
  169. package/dist/react/skf-switch/index.d.ts +0 -3
  170. package/dist/react/skf-switch/index.js +0 -13
  171. package/dist/react/skf-tab/index.d.ts +0 -12
  172. package/dist/react/skf-tab/index.js +0 -18
  173. package/dist/react/skf-tab-group/index.d.ts +0 -3
  174. package/dist/react/skf-tab-group/index.js +0 -13
  175. package/dist/react/skf-tab-panel/index.d.ts +0 -3
  176. package/dist/react/skf-tab-panel/index.js +0 -13
  177. package/dist/react/skf-tag/index.d.ts +0 -3
  178. package/dist/react/skf-tag/index.js +0 -13
  179. package/dist/react/skf-textarea/index.d.ts +0 -12
  180. package/dist/react/skf-textarea/index.js +0 -18
  181. package/dist/react/skf-toast/index.d.ts +0 -3
  182. package/dist/react/skf-toast/index.js +0 -13
  183. package/dist/react/skf-toast-wrapper/index.d.ts +0 -3
  184. package/dist/react/skf-toast-wrapper/index.js +0 -13
  185. package/dist/react/skf-tooltip/index.d.ts +0 -12
  186. package/dist/react/skf-tooltip/index.js +0 -18
@@ -0,0 +1,32 @@
1
+ import { SkfElement } from '../../internal/components/skf-element';
2
+ import { type CSSResultGroup } from 'lit';
3
+ /**
4
+ * The `<skf-segmented-button>` component consists of multiple `<skf-segmented-button-item>`, working together.
5
+ *
6
+ * See [zeroheight](https://zeroheight.com/853e936c9/p/68ff54-segmented-buttons) for design principles
7
+ *
8
+ * @slot - One or more `<skf-segmented-button-item>`
9
+ *
10
+ * @tagname skf-segmented-button
11
+ */
12
+ export declare class SkfSegmentedButton extends SkfElement {
13
+ static styles: CSSResultGroup;
14
+ /** Sets the default selected control */
15
+ defaultSelected: number;
16
+ /** If true, allowes multiple items to be selected */
17
+ multiple: boolean;
18
+ /** @internal */
19
+ value: string;
20
+ /** @internal */
21
+ private items;
22
+ firstUpdated(): void;
23
+ /** @internal */
24
+ private _handleSegmentedButtonItemSelected;
25
+ /** @internal */
26
+ private _handleSlotChange;
27
+ /** @internal */
28
+ private _handleKeyDown;
29
+ /** @internal */
30
+ private _getKeyDownNextItem;
31
+ render(): import("lit").TemplateResult<1>;
32
+ }
@@ -0,0 +1,8 @@
1
+ import { SkfSegmentedButton } from './segmented-button.component';
2
+ export * from './segmented-button.component';
3
+ export default SkfSegmentedButton;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-segmented-button': SkfSegmentedButton;
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,36 @@
1
+ import '../icon/icon.js';
2
+ import { SkfElement } from '../../internal/components/skf-element';
3
+ import { type CSSResultGroup } from 'lit';
4
+ export interface SkfSegmentedButtonItemEvent {
5
+ item: SkfSegmentedButtonItem;
6
+ }
7
+ /**
8
+ * The `<skf-segmented-button-item>` is used in conjunction with the `<skf-segmented-button>` component
9
+ *
10
+ * @event {CustomEvent} my-tag-my-event - Fired when something happens
11
+ *
12
+ * @slot - The items label
13
+ *
14
+ * @tagname skf-segmented-button-item
15
+ */
16
+ export declare class SkfSegmentedButtonItem extends SkfElement {
17
+ static styles: CSSResultGroup;
18
+ static shadowRootOptions: {
19
+ delegatesFocus: boolean;
20
+ mode: ShadowRootMode;
21
+ serializable?: boolean;
22
+ slotAssignment?: SlotAssignmentMode;
23
+ };
24
+ /** If true, items is marked as disabled */
25
+ disabled: boolean;
26
+ /** Sets the item value */
27
+ value: string;
28
+ constructor();
29
+ /** @internal */
30
+ isMultiple: boolean;
31
+ /** @internal */
32
+ isSelected: boolean;
33
+ /** @internal */
34
+ private _handleClick;
35
+ render(): import("lit").TemplateResult<1>;
36
+ }
@@ -0,0 +1,8 @@
1
+ import { SkfSegmentedButtonItem } from './segmented-button-item.component';
2
+ export * from './segmented-button-item.component';
3
+ export default SkfSegmentedButtonItem;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-segmented-button-item': SkfSegmentedButtonItem;
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -7,7 +7,7 @@ import { raiseError as w } from "../../internal/helpers/raiseError.js";
7
7
  import { watch as $ } from "../../internal/helpers/watch.js";
8
8
  import { Asterisk as V } from "../../internal/templates/asterisk.js";
9
9
  import S from "../../styles/component.styles.js";
10
- import { html as n, nothing as C } from "lit";
10
+ import { nothing as C, html as n } from "lit";
11
11
  import { property as o, state as h, query as p } from "lit/decorators.js";
12
12
  import { classMap as E } from "lit/directives/class-map.js";
13
13
  import { ifDefined as m } from "lit/directives/if-defined.js";
@@ -237,7 +237,7 @@ const c = class c extends b {
237
237
  id="hint"
238
238
  severity=${m(x(this.severity, this._invalid))}
239
239
  >
240
- ${this.customInvalid ? this.customInvalid : this.hint}
240
+ ${this.customInvalid ?? this.hint}
241
241
  </skf-hint>
242
242
  `}
243
243
  </div>
@@ -1,10 +1,21 @@
1
1
  import type { SkfSelectOption } from '../select-option/select-option.component.js';
2
- import type { ReactiveController } from 'lit';
3
- import type { SkfSelect } from './select.component.js';
4
- type ControllerHost = SkfSelect;
2
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
3
+ /**
4
+ * Workaround for storybook helper not being able to import types
5
+ * E.g type ControllerHost = SkfSelect;
6
+ */
7
+ interface ControllerHostProps {
8
+ _expanded: boolean;
9
+ _optionsList: SkfSelectOption[];
10
+ localName: keyof HTMLElementTagNameMap;
11
+ min: number;
12
+ max: number;
13
+ multiple: boolean;
14
+ hideTags: boolean;
15
+ }
5
16
  export declare class GlobalClickController implements ReactiveController {
6
- host: ControllerHost;
7
- constructor(host: ControllerHost);
17
+ host?: ReactiveControllerHost & Partial<ControllerHostProps>;
18
+ constructor(host: ReactiveControllerHost);
8
19
  hostDisconnected(): void;
9
20
  hostUpdated(): void;
10
21
  _globalClickHandler: (event: MouseEvent) => void;
@@ -12,9 +23,9 @@ export declare class GlobalClickController implements ReactiveController {
12
23
  disableGlobalClickDetection(): void;
13
24
  }
14
25
  export declare class KeyboardNavigationController implements ReactiveController {
15
- host: ControllerHost;
26
+ host?: ReactiveControllerHost & Partial<ControllerHostProps>;
16
27
  _listenerActivated: boolean;
17
- constructor(host: ControllerHost);
28
+ constructor(host: ReactiveControllerHost);
18
29
  hostDisconnected(): void;
19
30
  hostUpdated(): void;
20
31
  setupKeyboardListener(): void;
@@ -26,8 +37,8 @@ export declare class KeyboardNavigationController implements ReactiveController
26
37
  get _selectableOptions(): SkfSelectOption[];
27
38
  }
28
39
  export declare class DeveloperFeedbackController implements ReactiveController {
29
- host: ControllerHost;
30
- constructor(host: ControllerHost);
40
+ host?: ReactiveControllerHost & Partial<ControllerHostProps>;
41
+ constructor(host: ReactiveControllerHost);
31
42
  hostConnected(): void;
32
43
  _badAttributeCombinationWarning(): void;
33
44
  }
@@ -1,9 +1,10 @@
1
- import { raiseError as l } from "../../internal/helpers/raiseError.js";
1
+ import { raiseError as a } from "../../internal/helpers/raiseError.js";
2
2
  class d {
3
3
  constructor(t) {
4
4
  this._globalClickHandler = (e) => {
5
- e.target.closest(this.host.localName) || (this.host._expanded = !1);
6
- }, this.host = t, t.addController(this);
5
+ var s;
6
+ !((s = this.host) != null && s.localName) || e.target.closest(this.host.localName) || (this.host._expanded = !1);
7
+ }, (this.host = t).addController(this);
7
8
  }
8
9
  // hostConnected() {
9
10
  // this.enableGlobalClickDetection();
@@ -12,7 +13,8 @@ class d {
12
13
  this.disableGlobalClickDetection();
13
14
  }
14
15
  hostUpdated() {
15
- this.host._expanded ? this.enableGlobalClickDetection() : this.disableGlobalClickDetection();
16
+ var t;
17
+ (t = this.host) != null && t._expanded ? this.enableGlobalClickDetection() : this.disableGlobalClickDetection();
16
18
  }
17
19
  enableGlobalClickDetection() {
18
20
  document.addEventListener("click", this._globalClickHandler);
@@ -35,18 +37,19 @@ class p {
35
37
  e.preventDefault(), this._selectFocusedOption(e.target);
36
38
  break;
37
39
  case "Escape":
38
- e.preventDefault(), this.host._expanded = !1, setTimeout(() => {
40
+ e.preventDefault(), this.host && (this.host._expanded = !1), setTimeout(() => {
39
41
  this.host.focus();
40
42
  });
41
43
  break;
42
44
  }
43
- }, this.host = t, t.addController(this), this._listenerActivated = !1;
45
+ }, (this.host = t).addController(this), this._listenerActivated = !1;
44
46
  }
45
47
  hostDisconnected() {
46
48
  this.removeKeyboardListener();
47
49
  }
48
50
  hostUpdated() {
49
- this.host._expanded && !this._listenerActivated && this.setupKeyboardListener(), !this.host._expanded && this._listenerActivated && this.removeKeyboardListener();
51
+ var t, e;
52
+ (t = this.host) != null && t._expanded && !this._listenerActivated && this.setupKeyboardListener(), !((e = this.host) != null && e._expanded) && this._listenerActivated && this.removeKeyboardListener();
50
53
  }
51
54
  setupKeyboardListener() {
52
55
  this._listenerActivated = !0, this.host.addEventListener("keydown", this._handleKeyDown);
@@ -61,47 +64,49 @@ class p {
61
64
  });
62
65
  }
63
66
  _focusSiblingOption(t) {
64
- const e = (n) => n === document.activeElement, s = this._selectableOptions.find((n) => e(n));
65
- if (!s) {
67
+ const e = (l) => l === document.activeElement, i = this._selectableOptions.find((l) => e(l));
68
+ if (!i) {
66
69
  this._focusFirstOption();
67
70
  return;
68
71
  }
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();
72
+ const s = this._selectableOptions.indexOf(i);
73
+ let o = s - 1, n = s + 1;
74
+ o < 0 && (o = this._selectableOptions.length - 1), n >= this._selectableOptions.length && (n = 0);
75
+ const h = this._selectableOptions[t === "next" ? n : o];
76
+ i.blur(), h.focus();
74
77
  }
75
78
  _selectFocusedOption(t) {
76
79
  t.selected = !0;
77
80
  }
78
81
  get _selectableOptions() {
79
- return this.host._optionsList.filter((t) => !t.disabled);
82
+ return !this.host || !this.host._optionsList ? [] : this.host._optionsList.filter((t) => !t.disabled);
80
83
  }
81
84
  }
82
85
  class b {
83
86
  constructor(t) {
84
- this.host = t, t.addController(this);
87
+ (this.host = t).addController(this);
85
88
  }
86
89
  hostConnected() {
87
90
  this._badAttributeCombinationWarning();
88
91
  }
89
92
  _badAttributeCombinationWarning() {
90
- l({
93
+ if (!this.host) return;
94
+ const t = this.host.localName ?? "never";
95
+ a({
91
96
  assert: (this.host.min ?? 0) <= (this.host.max ?? 1 / 0),
92
97
  reason: "attribute-mismatch",
93
- replaceStrings: [this.host.localName, "min", "smaller than max"]
94
- }), l({
98
+ replaceStrings: [t, "min", "smaller than max"]
99
+ }), a({
95
100
  assert: (
96
101
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
97
102
  (this.host.min || this.host.max) && this.host.multiple || !(this.host.min && this.host.max)
98
103
  ),
99
104
  reason: "attribute-mismatch",
100
- replaceStrings: [this.host.localName, "min or max", "together with multiple"]
101
- }), l({
105
+ replaceStrings: [t, "min or max", "together with multiple"]
106
+ }), a({
102
107
  assert: (this.host.hideTags && this.host.multiple) ?? !this.host.hideTags,
103
108
  reason: "attribute-mismatch",
104
- replaceStrings: [this.host.localName, "hide-tags", "together with multiple"]
109
+ replaceStrings: [t, "hide-tags", "together with multiple"]
105
110
  });
106
111
  }
107
112
  }
@@ -1,9 +1,15 @@
1
- import type { SkfSelectOption } from '../select-option/select-option.component.js';
2
- import type { ReactiveController } from 'lit';
3
- type ControllerHost = SkfSelectOption;
1
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ /**
3
+ * Workaround for storybook helper not being able to import types
4
+ * E.g type ControllerHost = SkfSelectOption;
5
+ */
6
+ interface ControllerHostProps {
7
+ localName: keyof HTMLElementTagNameMap;
8
+ _parent: HTMLElement | null;
9
+ }
4
10
  export declare class DeveloperFeedbackController implements ReactiveController {
5
- host: ControllerHost;
6
- constructor(host: ControllerHost);
11
+ host?: ReactiveControllerHost & Partial<ControllerHostProps>;
12
+ constructor(host: ReactiveControllerHost);
7
13
  hostUpdated(): void;
8
14
  }
9
15
  export {};
@@ -4,7 +4,7 @@ import { type CSSResultGroup } from 'lit';
4
4
  /**
5
5
  * The `<skf-stepper>` is a component that displays a list of actions or options.
6
6
  *
7
- * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
7
+ * @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/842a0a-stepper) for design principles
8
8
  *
9
9
  * @slot - One or more `<skf-stepper-item>`
10
10
  *
@@ -27,6 +27,7 @@ export declare class SkfStepper extends SkfElement {
27
27
  _handleActiveIndexChanged(): void;
28
28
  /** @internal */
29
29
  _handleLinearMode(): void;
30
+ /** @internal */
30
31
  private _handleSelected;
31
32
  /** @internal */
32
33
  private _resetActive;
@@ -11,7 +11,7 @@ import "lit";
11
11
  import { property as y, state as c } from "lit/decorators.js";
12
12
  import { classMap as $ } from "lit/directives/class-map.js";
13
13
  import { ifDefined as x } from "lit/directives/if-defined.js";
14
- import { literal as w, unsafeStatic as U, html as S } from "lit/static-html.js";
14
+ import { unsafeStatic as w, literal as U, html as S } from "lit/static-html.js";
15
15
  import { styles as I } from "./stepper-item.styles.js";
16
16
  var O = Object.defineProperty, P = Object.getOwnPropertyDescriptor, l = (e, i, t, s) => {
17
17
  for (var p = s > 1 ? void 0 : s ? P(i, t) : i, h = e.length - 1, m; h >= 0; h--)
@@ -60,7 +60,7 @@ const f = class f extends b {
60
60
  }), r(this, n, !1);
61
61
  }
62
62
  render() {
63
- const t = this._linear ? "div" : "button", s = w`${U(t)}`;
63
+ const t = this._linear ? "div" : "button", s = U`${w(t)}`;
64
64
  return S`
65
65
  <${s}
66
66
  @click=${this._handleClick}
@@ -4,10 +4,10 @@ import { type CSSResultGroup } from 'lit';
4
4
  /**
5
5
  * The `<skf-switch>` is a component that displays a list of actions or options
6
6
  *
7
- * @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
7
+ * See [zeroheight](https://zeroheight.com/853e936c9/p/7282a2-switch) for design principle
8
8
  *
9
- * @attribute {boolean} disabled - If true, sets disabled state
10
- * @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
9
+ * @attribute {boolean} [disabled=false] - If true, sets disabled state
10
+ * @attribute {boolean} [required=false] - If true, value is required or must be checked for the form to be submittable
11
11
  *
12
12
  * @slot - The Switchs label. Alternatively, you can use the `label` attribute.
13
13
  *
@@ -15,13 +15,14 @@ import { type CSSResultGroup } from 'lit';
15
15
  */
16
16
  export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
17
17
  static styles: CSSResultGroup;
18
+ /** @internal */
18
19
  private _initialChecked;
19
20
  /** If true, outputs helping hints in console */
20
- debug?: boolean;
21
+ debug: boolean;
21
22
  /** If true, outputs helping hints in console */
22
- checked?: boolean;
23
+ checked: boolean;
23
24
  /** If true, hides the label visually */
24
- hideLabel?: boolean;
25
+ hideLabel: boolean;
25
26
  /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
26
27
  label?: string;
27
28
  /** If defined, adds name to the input-element */
@@ -7,15 +7,15 @@ import { classMap as m } from "lit/directives/class-map.js";
7
7
  import { ifDefined as _ } from "lit/directives/if-defined.js";
8
8
  import { styles as b } from "./switch.styles.js";
9
9
  var y = Object.defineProperty, i = (d, e, a, g) => {
10
- for (var l = void 0, r = d.length - 1, n; r >= 0; r--)
11
- (n = d[r]) && (l = n(e, a, l) || l);
10
+ for (var l = void 0, h = d.length - 1, n; h >= 0; h--)
11
+ (n = d[h]) && (l = n(e, a, l) || l);
12
12
  return l && y(e, a, l), l;
13
13
  };
14
- const h = class h extends o {
14
+ const r = class r extends o {
15
15
  constructor() {
16
- super(...arguments), this._initialChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._handleChange = (e) => {
16
+ super(...arguments), this._initialChecked = !1, this.debug = !1, this.checked = !1, this.hideLabel = !1, this.size = "md", this.value = "", this._invalid = !1, this._handleChange = (e) => {
17
17
  var a;
18
- e.stopPropagation(), this.pristine = !1, this.checked = (a = this.$input) == null ? void 0 : a.checked, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(null), this.emitEvent("change");
18
+ e.stopPropagation(), this.pristine = !1, this.checked = ((a = this.$input) == null ? void 0 : a.checked) ?? !1, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(null), this.emitEvent("change");
19
19
  }, this._handleInvalid = (e) => {
20
20
  this.pristine = !1, this._invalid = !0, this.customErrorDisplay && e.preventDefault();
21
21
  }, this._resetValue = (e) => {
@@ -79,8 +79,8 @@ const h = class h extends o {
79
79
  `;
80
80
  }
81
81
  };
82
- h.styles = [p, b];
83
- let t = h;
82
+ r.styles = [p, b];
83
+ let t = r;
84
84
  i([
85
85
  s({ type: Boolean })
86
86
  ], t.prototype, "debug");
@@ -13,10 +13,12 @@ import { type CSSResultGroup } from 'lit';
13
13
  */
14
14
  export declare class SkfTag extends SkfElement {
15
15
  static styles: CSSResultGroup;
16
+ /** @internal */
16
17
  private _onClick?;
18
+ /** @internal */
17
19
  protected _onRemove?: (event: Event) => void;
18
20
  /** Specifies Tag size */
19
- size: 'sm' | 'md' | 'lg';
21
+ size: 'sm' | 'md';
20
22
  /**
21
23
  * If defined, displays leading/provided icon
22
24
  * @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" }
@@ -34,7 +36,7 @@ export declare class SkfTag extends SkfElement {
34
36
  set onRemove(onRemoveFn: ((event: Event) => void) | undefined);
35
37
  get onRemove(): ((event: Event) => void) | undefined;
36
38
  /** If true, adds trailing button to remove tag */
37
- removable?: boolean;
39
+ removable: boolean;
38
40
  /** @internal */
39
41
  $removeButton: HTMLButtonElement;
40
42
  connectedCallback(): void;
@@ -1,9 +1,9 @@
1
1
  import "../icon/icon.js";
2
2
  import { SkfElement as u } from "../../internal/components/skf-element.js";
3
3
  import f from "../../styles/component.styles.js";
4
- import { html as a, nothing as p } from "lit";
5
- import { property as l, query as d } from "lit/decorators.js";
6
- import { classMap as v } from "lit/directives/class-map.js";
4
+ import { nothing as p, html as a } from "lit";
5
+ import { property as l, query as v } from "lit/decorators.js";
6
+ import { classMap as d } from "lit/directives/class-map.js";
7
7
  import { ifDefined as _ } from "lit/directives/if-defined.js";
8
8
  import { styles as k } from "./tag.styles.js";
9
9
  var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (m, t, s, r) => {
@@ -13,7 +13,7 @@ var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (m, t, s
13
13
  };
14
14
  const h = class h extends u {
15
15
  constructor() {
16
- super(...arguments), this.size = "md", this._handleKeyDown = (t) => {
16
+ super(...arguments), this.size = "md", this.removable = !1, this._handleKeyDown = (t) => {
17
17
  (t.key === "Enter" || t.key === " ") && this.$removeButton.click();
18
18
  }, this._handleRemove = (t) => {
19
19
  this._onRemove && this._onRemove(t);
@@ -48,7 +48,7 @@ const h = class h extends u {
48
48
  render() {
49
49
  return a`
50
50
  <div
51
- class=${v({
51
+ class=${d({
52
52
  tag: !0,
53
53
  "tag--color-alert": this.color === "alert",
54
54
  "tag--color-error": this.color === "error",
@@ -97,7 +97,7 @@ i([
97
97
  l({ type: Boolean, reflect: !0 })
98
98
  ], o.prototype, "removable", 2);
99
99
  i([
100
- d("button")
100
+ v("button")
101
101
  ], o.prototype, "$removeButton", 2);
102
102
  export {
103
103
  o as SkfTag
@@ -3,7 +3,7 @@ import { FormBase as m } from "../../internal/components/formBase.js";
3
3
  import "../../internal/components/hint/hint.js";
4
4
  import { Asterisk as c } from "../../internal/templates/asterisk.js";
5
5
  import y from "../../styles/component.styles.js";
6
- import { html as p, nothing as v } from "lit";
6
+ import { nothing as p, html as v } from "lit";
7
7
  import { property as r, state as b, query as f } from "lit/decorators.js";
8
8
  import { ifDefined as n } from "lit/directives/if-defined.js";
9
9
  import g from "./textarea.styles.js";
@@ -22,7 +22,7 @@ const u = class u extends m {
22
22
  };
23
23
  }
24
24
  set customInvalid(t) {
25
- this.customError = t || "";
25
+ this.customError = t ?? "";
26
26
  }
27
27
  get customInvalid() {
28
28
  return this.customError;
@@ -77,7 +77,7 @@ const u = class u extends m {
77
77
  }
78
78
  render() {
79
79
  var t, s;
80
- return p`
80
+ return v`
81
81
  <div id="root">
82
82
  <label>
83
83
  <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
@@ -90,8 +90,8 @@ const u = class u extends m {
90
90
  ?required=${this.required}
91
91
  .value=${this.value}
92
92
  @input=${this._handleInput}
93
- aria-describedby=${n((t = this.hint) != null && t.trim() ? "hint" : v)}
94
- aria-errormessage=${n((s = this.hint) != null && s.trim() ? "hint" : v)}
93
+ aria-describedby=${n((t = this.hint) != null && t.trim() ? "hint" : p)}
94
+ aria-errormessage=${n((s = this.hint) != null && s.trim() ? "hint" : p)}
95
95
  aria-invalid=${!!this.invalid}
96
96
  cols=${n(this.cols)}
97
97
  maxlength=${n(this.maxLength)}
@@ -103,13 +103,13 @@ const u = class u extends m {
103
103
  </textarea>
104
104
  </div>
105
105
  </label>
106
- ${this.hint && p`
106
+ ${this.hint && v`
107
107
  <skf-hint
108
108
  aria-live=${this.invalid ? "assertive" : "polite"}
109
109
  id="hint"
110
110
  severity=${n(_(this.severity, this.invalid))}
111
111
  >
112
- ${this.customInvalid ? this.customInvalid : this.hint}
112
+ ${this.customInvalid ?? this.hint}
113
113
  </skf-hint>
114
114
  `}
115
115
  </div>
@@ -8,7 +8,7 @@ import { type CSSResultGroup } from 'lit';
8
8
  * Once the queue in the singleton is empty, the SkfToastWrapper will be removed from the DOM.
9
9
  */
10
10
  /**
11
- * A simple toast component that displays a message to the user. Use by appending a &lt;skf-toast&gt; tag to the DOM. Position in DOM is irrelevant.
11
+ * A simple toast component that displays a message to the user. Invoke a toast message by appending a &lt;skf-toast&gt; tag to the DOM. Position in DOM is irrelevant. A transient toast will disappear after a set amount of time. Once toast is dismissed it will be removed from the DOM.
12
12
  *
13
13
  * @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/98e432-toast) for design principles
14
14
  *
@@ -1,16 +1,15 @@
1
1
  import { SkfPopoverBase } from '../../internal/base-classes/popover/popover.base.js';
2
2
  import type { CSSResultGroup } from 'lit';
3
3
  /**
4
- * The `<skf-tooltip>` is a component that displays a list of actions or options.
4
+ * The `<skf-tooltip>` is a component that displays a tooltip.
5
5
  *
6
6
  * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
7
7
  *
8
- * @property {"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"} [placement='bottom-start'] - The placement of the dropdown
9
- * @property {boolean} [isOpen=false] - Whether the dropdown is open
10
- * @property {string} [anchor] - The id of the element the dropdown will be anchored to
8
+ * @attribute {"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"} [placement='bottom-start'] - The placement of the dropdown
9
+ * @attribute {string} [anchor] - The id of the element the dropdown will be anchored to
11
10
  *
12
- * @event open - Fired when the dropdown is opened
13
- * @event close - Fired when the dropdown is closed
11
+ * @event skf-opened - Fired when the dropdown is opened
12
+ * @event skf-closed - Fired when the dropdown is closed
14
13
  *
15
14
  * @slot - The tooltip popover content
16
15
  *
@@ -1,18 +1,18 @@
1
- import { styles as o } from "./tooltip.styles.js";
2
- import { SkfPopoverBase as s } from "../../internal/base-classes/popover/popover.base.js";
3
- const t = class t extends s {
1
+ import { styles as n } from "./tooltip.styles.js";
2
+ import { SkfPopoverBase as e } from "../../internal/base-classes/popover/popover.base.js";
3
+ const t = class t extends e {
4
4
  constructor() {
5
- super(), this.arrow = !0, this.offset = 8, this.placement = "top", s.classMap = { tooltip: !0 };
5
+ super(), this.arrow = !0, this.offset = 8, this.placement = "top", e.classMap = { tooltip: !0 };
6
6
  }
7
- addEventListeners(e) {
8
- e.addEventListener("blur", this.close), e.addEventListener("focus", this.open), e.addEventListener("mouseenter", this.open), e.addEventListener("mouseleave", this.close);
7
+ addEventListeners(s) {
8
+ s.addEventListener("blur", this.close, { signal: this.signal }), s.addEventListener("focus", this.open, { signal: this.signal }), s.addEventListener("mouseenter", this.open, { signal: this.signal }), s.addEventListener("mouseleave", this.close, { signal: this.signal });
9
9
  }
10
- removeEventListeners(e) {
11
- e.addEventListener("blur", this.close), e.addEventListener("focus", this.open), e.removeEventListener("mouseenter", this.open), e.removeEventListener("mouseleave", this.close);
10
+ removeEventListeners(s) {
11
+ s.addEventListener("blur", this.close), s.addEventListener("focus", this.open), s.removeEventListener("mouseenter", this.open), s.removeEventListener("mouseleave", this.close);
12
12
  }
13
13
  };
14
- t.styles = [s.styles, o];
15
- let r = t;
14
+ t.styles = [e.styles, n];
15
+ let i = t;
16
16
  export {
17
- r as SkfTooltip
17
+ i as SkfTooltip
18
18
  };