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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +26 -6
  2. package/custom-elements.json +18265 -0
  3. package/dist/components/accordion/accordion.component.d.ts +9 -5
  4. package/dist/components/accordion/accordion.component.js +22 -19
  5. package/dist/components/accordion/accordion.d.ts +1 -1
  6. package/dist/components/accordion/accordion.styles.js +3 -3
  7. package/dist/components/alert/alert.component.d.ts +7 -4
  8. package/dist/components/alert/alert.component.js +21 -19
  9. package/dist/components/alert/alert.styles.js +50 -47
  10. package/dist/components/button/button.component.d.ts +24 -0
  11. package/dist/components/button/button.component.js +80 -56
  12. package/dist/components/button/button.styles.js +2 -1
  13. package/dist/components/card/card.component.d.ts +3 -3
  14. package/dist/components/card/card.component.js +16 -19
  15. package/dist/components/card/card.styles.js +11 -3
  16. package/dist/components/checkbox/checkbox.component.d.ts +17 -15
  17. package/dist/components/checkbox/checkbox.component.js +95 -89
  18. package/dist/components/checkbox/checkbox.styles.js +7 -2
  19. package/dist/components/checkbox/checkbox.test.d.ts +1 -0
  20. package/dist/components/collapse/collapse.component.d.ts +9 -6
  21. package/dist/components/collapse/collapse.component.js +39 -36
  22. package/dist/components/collapse/collapse.styles.js +3 -3
  23. package/dist/components/collapse/collapse.test.d.ts +1 -0
  24. package/dist/components/divider/divider.component.d.ts +13 -10
  25. package/dist/components/divider/divider.component.js +34 -29
  26. package/dist/components/divider/divider.styles.js +1 -5
  27. package/dist/components/heading/heading.component.d.ts +12 -2
  28. package/dist/components/heading/heading.component.js +14 -14
  29. package/dist/components/heading/heading.styles.js +1 -1
  30. package/dist/components/icon/icon.component.d.ts +14 -8
  31. package/dist/components/icon/icon.component.js +6 -6
  32. package/dist/components/icon/icon.styles.js +56 -54
  33. package/dist/components/input/input.component.d.ts +44 -29
  34. package/dist/components/input/input.component.js +118 -111
  35. package/dist/components/link/link.component.d.ts +15 -12
  36. package/dist/components/link/link.component.js +7 -7
  37. package/dist/components/link/link.styles.js +1 -1
  38. package/dist/components/loader/loader.component.d.ts +7 -7
  39. package/dist/components/loader/loader.component.js +35 -61
  40. package/dist/components/loader/loader.styles.js +42 -10
  41. package/dist/components/logo/logo.component.d.ts +5 -3
  42. package/dist/components/logo/logo.component.js +8 -8
  43. package/dist/components/logo/logo.styles.js +2 -2
  44. package/dist/components/progress/progress.component.d.ts +22 -0
  45. package/dist/components/progress/progress.component.js +40 -0
  46. package/dist/components/progress/progress.d.ts +8 -0
  47. package/dist/components/progress/progress.js +6 -0
  48. package/dist/components/progress/progress.styles.d.ts +1 -0
  49. package/dist/components/progress/progress.styles.js +47 -0
  50. package/dist/components/radio/radio.component.d.ts +18 -18
  51. package/dist/components/radio/radio.component.js +94 -78
  52. package/dist/components/radio/radio.styles.js +6 -1
  53. package/dist/components/select/select.component.d.ts +140 -0
  54. package/dist/components/select/select.component.js +327 -0
  55. package/dist/components/select/select.controllers.d.ts +59 -0
  56. package/dist/components/select/select.controllers.js +172 -0
  57. package/dist/components/select/select.d.ts +8 -0
  58. package/dist/components/select/select.js +6 -0
  59. package/dist/components/select/select.styles.d.ts +1 -0
  60. package/dist/components/select/select.styles.js +131 -0
  61. package/dist/components/select-option/select-option.component.d.ts +77 -0
  62. package/dist/components/select-option/select-option.component.js +123 -0
  63. package/dist/components/select-option/select-option.controllers.d.ts +9 -0
  64. package/dist/components/select-option/select-option.d.ts +8 -0
  65. package/dist/components/select-option/select-option.js +6 -0
  66. package/dist/components/select-option/select-option.styles.d.ts +1 -0
  67. package/dist/components/select-option/select-option.styles.js +53 -0
  68. package/dist/components/select-option-group/select-option-group.component.d.ts +16 -0
  69. package/dist/components/select-option-group/select-option-group.component.js +31 -0
  70. package/dist/components/select-option-group/select-option-group.d.ts +8 -0
  71. package/dist/components/select-option-group/select-option-group.js +6 -0
  72. package/dist/components/select-option-group/select-option-group.style.d.ts +1 -0
  73. package/dist/components/select-option-group/select-option-group.style.js +18 -0
  74. package/dist/components/switch/switch.component.d.ts +2 -3
  75. package/dist/components/switch/switch.component.js +5 -2
  76. package/dist/components/switch/switch.styles.js +6 -1
  77. package/dist/components/switch/switch.test.d.ts +1 -0
  78. package/dist/components/tab/tab.component.d.ts +29 -0
  79. package/dist/components/tab/tab.component.js +57 -0
  80. package/dist/components/tab/tab.d.ts +8 -0
  81. package/dist/components/tab/tab.js +6 -0
  82. package/dist/components/tab/tab.styles.d.ts +1 -0
  83. package/dist/components/tab/tab.styles.js +123 -0
  84. package/dist/components/tab-group/tab-group.component.d.ts +43 -0
  85. package/dist/components/tab-group/tab-group.component.js +98 -0
  86. package/dist/components/tab-group/tab-group.d.ts +8 -0
  87. package/dist/components/tab-group/tab-group.js +6 -0
  88. package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
  89. package/dist/components/tab-group/tab-group.styles.js +75 -0
  90. package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
  91. package/dist/components/tab-panel/tab-panel.component.js +36 -0
  92. package/dist/components/tab-panel/tab-panel.d.ts +8 -0
  93. package/dist/components/tab-panel/tab-panel.js +6 -0
  94. package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
  95. package/dist/components/tab-panel/tab-panel.styles.js +13 -0
  96. package/dist/components/tag/tag.component.d.ts +25 -4
  97. package/dist/components/tag/tag.component.js +66 -29
  98. package/dist/components/tag/tag.styles.js +6 -5
  99. package/dist/components/textarea/textarea.component.d.ts +26 -23
  100. package/dist/components/textarea/textarea.component.js +20 -17
  101. package/dist/components/toast/toast.component.d.ts +35 -0
  102. package/dist/components/toast/toast.component.js +52 -0
  103. package/dist/components/toast/toast.d.ts +8 -0
  104. package/dist/components/toast/toast.js +6 -0
  105. package/dist/components/toast/toast.singleton.d.ts +26 -0
  106. package/dist/components/toast/toast.singleton.js +53 -0
  107. package/dist/components/toast/toast.styles.d.ts +1 -0
  108. package/dist/components/toast/toast.styles.js +9 -0
  109. package/dist/components/toast-item/toast-item.component.d.ts +21 -0
  110. package/dist/components/toast-item/toast-item.component.js +65 -0
  111. package/dist/components/toast-item/toast-item.d.ts +6 -0
  112. package/dist/components/toast-item/toast-item.js +2 -0
  113. package/dist/components/toast-item/toast-item.styles.d.ts +2 -0
  114. package/dist/components/toast-item/toast-item.styles.js +16 -0
  115. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
  116. package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
  117. package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
  118. package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
  119. package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
  120. package/dist/components/toast-wrapper/toast-wrapper.styles.js +20 -0
  121. package/dist/custom-elements.json +2146 -616
  122. package/dist/index.d.ts +8 -0
  123. package/dist/index.js +60 -36
  124. package/dist/internal/components/formBase.d.ts +19 -1
  125. package/dist/internal/components/formBase.js +29 -17
  126. package/dist/internal/components/hint/hint.component.js +12 -10
  127. package/dist/internal/components/hint/hint.styles.js +26 -10
  128. package/dist/internal/components/skf-element.d.ts +4 -4
  129. package/dist/internal/components/skf-element.js +15 -19
  130. package/dist/internal/helpers/array.d.ts +4 -0
  131. package/dist/internal/helpers/findMatchingTags.d.ts +2 -0
  132. package/dist/internal/helpers/findMatchingTags.js +12 -0
  133. package/dist/internal/helpers/hintSeverity.d.ts +2 -0
  134. package/dist/internal/helpers/hintSeverity.js +6 -0
  135. package/dist/internal/helpers/raiseError.d.ts +28 -0
  136. package/dist/internal/helpers/raiseError.js +29 -0
  137. package/dist/internal/helpers/watch.d.ts +27 -0
  138. package/dist/internal/helpers/watch.js +28 -0
  139. package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -6
  140. package/dist/react/index.d.ts +9 -0
  141. package/dist/react/index.js +9 -0
  142. package/dist/react/skf-button/index.d.ts +7 -1
  143. package/dist/react/skf-button/index.js +5 -1
  144. package/dist/react/skf-progress/index.d.ts +3 -0
  145. package/dist/react/skf-progress/index.js +13 -0
  146. package/dist/react/skf-select/index.d.ts +21 -0
  147. package/dist/react/skf-select/index.js +21 -0
  148. package/dist/react/skf-select-option/index.d.ts +9 -0
  149. package/dist/react/skf-select-option/index.js +17 -0
  150. package/dist/react/skf-select-option-group/index.d.ts +3 -0
  151. package/dist/react/skf-select-option-group/index.js +13 -0
  152. package/dist/react/skf-tab/index.d.ts +12 -0
  153. package/dist/react/skf-tab/index.js +18 -0
  154. package/dist/react/skf-tab-group/index.d.ts +3 -0
  155. package/dist/react/skf-tab-group/index.js +13 -0
  156. package/dist/react/skf-tab-panel/index.d.ts +3 -0
  157. package/dist/react/skf-tab-panel/index.js +13 -0
  158. package/dist/react/skf-toast/index.d.ts +3 -0
  159. package/dist/react/skf-toast/index.js +13 -0
  160. package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
  161. package/dist/react/skf-toast-wrapper/index.js +13 -0
  162. package/dist/styles/form-field.styles.js +11 -7
  163. package/dist/types/jsx/custom-element-jsx.d.ts +166 -995
  164. package/dist/types/vue/index.d.ts +368 -94
  165. package/dist/vscode.html-custom-data.json +408 -106
  166. package/dist/web-types.json +932 -281
  167. package/package.json +39 -35
package/dist/index.d.ts CHANGED
@@ -11,7 +11,15 @@ export { default as SkfInput } from './components/input/input.js';
11
11
  export { default as SkfLink } from './components/link/link.js';
12
12
  export { default as SkfLoader } from './components/loader/loader.js';
13
13
  export { default as SkfLogo } from './components/logo/logo.js';
14
+ export { default as SkfProgress } from './components/progress/progress.js';
14
15
  export { default as SkfRadio } from './components/radio/radio.js';
16
+ export { default as SkfOptionGroup } from './components/select-option-group/select-option-group.js';
17
+ export { default as SkfOption } from './components/select-option/select-option.js';
18
+ export { default as SkfSelect } from './components/select/select.js';
15
19
  export { default as SkfSwitch } from './components/switch/switch.js';
20
+ export { default as SkfTabGoup } from './components/tab-group/tab-group.js';
21
+ export { default as SkfTabPanel } from './components/tab-panel/tab-panel.js';
22
+ export { default as SkfTab } from './components/tab/tab.js';
16
23
  export { default as SkfTag } from './components/tag/tag.js';
17
24
  export { default as SkfTextArea } from './components/textarea/textarea.js';
25
+ export { default as SkfToast } from './components/toast/toast.js';
package/dist/index.js CHANGED
@@ -11,45 +11,69 @@ import "./components/input/input.js";
11
11
  import "./components/link/link.js";
12
12
  import "./components/loader/loader.js";
13
13
  import "./components/logo/logo.js";
14
+ import "./components/progress/progress.js";
14
15
  import "./components/radio/radio.js";
16
+ import "./components/select-option-group/select-option-group.js";
17
+ import "./components/select-option/select-option.js";
18
+ import "./components/select/select.js";
15
19
  import "./components/switch/switch.js";
20
+ import "./components/tab-group/tab-group.js";
21
+ import "./components/tab-panel/tab-panel.js";
22
+ import "./components/tab/tab.js";
16
23
  import "./components/tag/tag.js";
17
24
  import "./components/textarea/textarea.js";
18
- import { SkfAccordion as I } from "./components/accordion/accordion.component.js";
19
- import { SkfAlert as h } from "./components/alert/alert.component.js";
20
- import { SkfButton as T } from "./components/button/button.component.js";
21
- import { SkfCard as s } from "./components/card/card.component.js";
22
- import { SkfCheckbox as w } from "./components/checkbox/checkbox.component.js";
23
- import { SkfCollapse as D } from "./components/collapse/collapse.component.js";
24
- import { SkfDivider as R } from "./components/divider/divider.component.js";
25
- import { SkfHeading as q } from "./components/heading/heading.component.js";
26
- import { SkfIcon as z } from "./components/icon/icon.component.js";
27
- import { SkfInput as F } from "./components/input/input.component.js";
28
- import { SkfLink as J } from "./components/link/link.component.js";
29
- import { SkfLoader as M } from "./components/loader/loader.component.js";
30
- import { SkfLogo as O } from "./components/logo/logo.component.js";
31
- import { SkfRadio as Q } from "./components/radio/radio.component.js";
32
- import { SkfSwitch as V } from "./components/switch/switch.component.js";
33
- import { SkfTag as X } from "./components/tag/tag.component.js";
34
- import { SkfTextArea as Z } from "./components/textarea/textarea.component.js";
35
- import { SkfAccordionItem as $ } from "./components/accordion/accordion-item.js";
25
+ import "./components/toast/toast.js";
26
+ import { SkfAccordion as h } from "./components/accordion/accordion.component.js";
27
+ import { SkfAlert as v } from "./components/alert/alert.component.js";
28
+ import { SkfButton as B } from "./components/button/button.component.js";
29
+ import { SkfCard as H } from "./components/card/card.component.js";
30
+ import { SkfCheckbox as j } from "./components/checkbox/checkbox.component.js";
31
+ import { SkfCollapse as y } from "./components/collapse/collapse.component.js";
32
+ import { SkfDivider as E } from "./components/divider/divider.component.js";
33
+ import { SkfHeading as J } from "./components/heading/heading.component.js";
34
+ import { SkfIcon as M } from "./components/icon/icon.component.js";
35
+ import { SkfInput as Q } from "./components/input/input.component.js";
36
+ import { SkfLink as V } from "./components/link/link.component.js";
37
+ import { SkfLoader as X } from "./components/loader/loader.component.js";
38
+ import { SkfLogo as Z } from "./components/logo/logo.component.js";
39
+ import { SkfProgress as $ } from "./components/progress/progress.component.js";
40
+ import { SkfRadio as ro } from "./components/radio/radio.component.js";
41
+ import { SkfSelectOptionGroup as po } from "./components/select-option-group/select-option-group.component.js";
42
+ import { SkfSelectOption as mo } from "./components/select-option/select-option.component.js";
43
+ import { SkfSelect as io } from "./components/select/select.component.js";
44
+ import { SkfSwitch as ko } from "./components/switch/switch.component.js";
45
+ import { SkfTabGroup as ao } from "./components/tab-group/tab-group.component.js";
46
+ import { SkfTabPanel as co } from "./components/tab-panel/tab-panel.component.js";
47
+ import { SkfTab as so } from "./components/tab/tab.component.js";
48
+ import { SkfTag as uo } from "./components/tag/tag.component.js";
49
+ import { SkfTextArea as go } from "./components/textarea/textarea.component.js";
50
+ import { SkfToast as Go } from "./components/toast/toast.component.js";
51
+ import { SkfAccordionItem as Co } from "./components/accordion/accordion-item.js";
36
52
  export {
37
- I as SkfAccordion,
38
- $ as SkfAccordionItem,
39
- h as SkfAlert,
40
- T as SkfButton,
41
- s as SkfCard,
42
- w as SkfCheckbox,
43
- D as SkfCollapse,
44
- R as SkfDivider,
45
- q as SkfHeading,
46
- z as SkfIcon,
47
- F as SkfInput,
48
- J as SkfLink,
49
- M as SkfLoader,
50
- O as SkfLogo,
51
- Q as SkfRadio,
52
- V as SkfSwitch,
53
- X as SkfTag,
54
- Z as SkfTextArea
53
+ h as SkfAccordion,
54
+ Co as SkfAccordionItem,
55
+ v as SkfAlert,
56
+ B as SkfButton,
57
+ H as SkfCard,
58
+ j as SkfCheckbox,
59
+ y as SkfCollapse,
60
+ E as SkfDivider,
61
+ J as SkfHeading,
62
+ M as SkfIcon,
63
+ Q as SkfInput,
64
+ V as SkfLink,
65
+ X as SkfLoader,
66
+ Z as SkfLogo,
67
+ mo as SkfOption,
68
+ po as SkfOptionGroup,
69
+ $ as SkfProgress,
70
+ ro as SkfRadio,
71
+ io as SkfSelect,
72
+ ko as SkfSwitch,
73
+ so as SkfTab,
74
+ ao as SkfTabGoup,
75
+ co as SkfTabPanel,
76
+ uo as SkfTag,
77
+ go as SkfTextArea,
78
+ Go as SkfToast
55
79
  };
@@ -1,4 +1,9 @@
1
1
  import { SkfElement } from './skf-element.js';
2
+ interface OptionsOverride {
3
+ bubbles?: boolean;
4
+ composed?: boolean;
5
+ cancelable?: boolean;
6
+ }
2
7
  /**
3
8
  * Then in your form component:
4
9
  *
@@ -17,6 +22,7 @@ export declare class FormBase extends SkfElement {
17
22
  protected customErrorDisplay: boolean;
18
23
  protected pristine: boolean;
19
24
  protected validateOnChange: boolean;
25
+ protected withFallback: (message?: string | null) => string;
20
26
  static shadowRootOptions: {
21
27
  delegatesFocus: boolean;
22
28
  mode: ShadowRootMode;
@@ -46,5 +52,17 @@ export declare class FormBase extends SkfElement {
46
52
  /** emits a change event, triggers native UI popup and returns false if the form is invalid */
47
53
  reportValidity(): boolean;
48
54
  formDisabledCallback(disabled: boolean): void;
49
- emitEvent(event: 'change' | 'input' | 'invalid' | 'reset'): boolean;
55
+ /**
56
+ * Dispatches a synthetic/custom event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
57
+ *
58
+ * Options object:
59
+ * bubbles: true: This option allows the event to bubble up through the DOM.
60
+ * composed: true: This option allows the event to pierce the shadow DOM boundary.
61
+ * cancelable: false: This option indicates that the event cannot be canceled.
62
+ *
63
+ * @param event
64
+ * @returns
65
+ */
66
+ emitEvent(event: string, optionsOverride?: OptionsOverride): boolean;
50
67
  }
68
+ export {};
@@ -1,14 +1,14 @@
1
1
  import { LitElement as c } from "lit";
2
2
  import { property as d } from "lit/decorators.js";
3
3
  import { SkfElement as u } from "./skf-element.js";
4
- var p = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, h = (n, t, i, l) => {
5
- for (var e = _(t, i), a = n.length - 1, o; a >= 0; a--)
6
- (o = n[a]) && (e = o(t, i, e) || e);
7
- return e && p(t, i, e), e;
4
+ var p = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, h = (l, t, e, r) => {
5
+ for (var i = _(t, e), n = l.length - 1, o; n >= 0; n--)
6
+ (o = l[n]) && (i = o(t, e, i) || i);
7
+ return i && p(t, e, i), i;
8
8
  };
9
- const s = class s extends u {
9
+ const a = class a extends u {
10
10
  constructor() {
11
- super(), this._disabled = !1, this._pristine = !0, this.validationError = "", this.customErrorDisplay = !1, this.pristine = !0, this.validateOnChange = !0, this._dispatchResetEvent = () => {
11
+ super(), this._disabled = !1, this._pristine = !0, this.validationError = "", this.customErrorDisplay = !1, this.pristine = !0, this.validateOnChange = !0, this.withFallback = (t) => String(t).trim() || "A unspecified form validation error occured.", this._dispatchResetEvent = () => {
12
12
  this.dispatchEvent(new Event("reset", { bubbles: !0, composed: !0, cancelable: !1 }));
13
13
  }, this._internals = this.attachInternals(), this._required = !1;
14
14
  }
@@ -59,8 +59,8 @@ const s = class s extends u {
59
59
  get willValidate() {
60
60
  return this._internals.willValidate;
61
61
  }
62
- setValidity(t, i, l) {
63
- this._internals.setValidity(t, i, l);
62
+ setValidity(t, e, r) {
63
+ this._internals.setValidity(t, e, r);
64
64
  }
65
65
  setFormValue(t) {
66
66
  this._internals.setFormValue(t);
@@ -76,20 +76,32 @@ const s = class s extends u {
76
76
  formDisabledCallback(t) {
77
77
  this.disabled = t;
78
78
  }
79
- emitEvent(t) {
80
- return this.dispatchEvent(
81
- new Event(t, { bubbles: !0, composed: !0, cancelable: !1 })
82
- );
79
+ /**
80
+ * Dispatches a synthetic/custom event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
81
+ *
82
+ * Options object:
83
+ * bubbles: true: This option allows the event to bubble up through the DOM.
84
+ * composed: true: This option allows the event to pierce the shadow DOM boundary.
85
+ * cancelable: false: This option indicates that the event cannot be canceled.
86
+ *
87
+ * @param event
88
+ * @returns
89
+ */
90
+ emitEvent(t, e = {}) {
91
+ const r = { bubbles: !0, composed: !0, cancelable: !0 };
92
+ return t.startsWith("skf-") ? this.dispatchEvent(
93
+ new CustomEvent(t, { detail: null, ...r, ...e })
94
+ ) : this.dispatchEvent(new Event(t, { ...r, ...e }));
83
95
  }
84
96
  };
85
- s.formAssociated = !0, s.shadowRootOptions = { ...c.shadowRootOptions, delegatesFocus: !0 };
86
- let r = s;
97
+ a.formAssociated = !0, a.shadowRootOptions = { ...c.shadowRootOptions, delegatesFocus: !0 };
98
+ let s = a;
87
99
  h([
88
100
  d({ type: Boolean })
89
- ], r.prototype, "required");
101
+ ], s.prototype, "required");
90
102
  h([
91
103
  d({ type: Boolean, attribute: "native-validation" })
92
- ], r.prototype, "nativeValidation");
104
+ ], s.prototype, "nativeValidation");
93
105
  export {
94
- r as FormBase
106
+ s as FormBase
95
107
  };
@@ -4,26 +4,28 @@ import { ICON_SEVERITY as n } from "../../constants/iconSeverity.js";
4
4
  import v from "../../../styles/component.styles.js";
5
5
  import { html as f } from "lit";
6
6
  import { property as y } from "lit/decorators.js";
7
- import a from "./hint.styles.js";
8
- var c = Object.defineProperty, h = (s, i, m, d) => {
7
+ import d from "./hint.styles.js";
8
+ var a = Object.defineProperty, c = (s, i, m, h) => {
9
9
  for (var r = void 0, t = s.length - 1, p; t >= 0; t--)
10
10
  (p = s[t]) && (r = p(i, m, r) || r);
11
- return r && c(i, m, r), r;
11
+ return r && a(i, m, r), r;
12
12
  };
13
13
  const o = class o extends l {
14
14
  render() {
15
15
  return f`
16
- ${this.severity && f`
17
- <skf-icon color=${this.severity} name="${n[this.severity]}" size="xs">
18
- </skf-icon>
19
- `}
20
- <slot></slot>
16
+ <div id="root">
17
+ ${this.severity && f`
18
+ <skf-icon color=${this.severity} name="${n[this.severity]}" size="xs">
19
+ </skf-icon>
20
+ `}
21
+ <slot></slot>
22
+ </div>
21
23
  `;
22
24
  }
23
25
  };
24
- o.styles = [v, a];
26
+ o.styles = [v, d];
25
27
  let e = o;
26
- h([
28
+ c([
27
29
  y()
28
30
  ], e.prototype, "severity");
29
31
  export {
@@ -1,22 +1,38 @@
1
- import { css as s } from "lit";
2
- const o = s`
3
- :host {
1
+ import { css as r } from "lit";
2
+ const s = r`
3
+ #root {
4
4
  align-items: center;
5
5
  color: var(--_skf-hint-color, var(--skf-text-color-secondary));
6
6
  display: flex;
7
7
  font-size: var(--skf-font-size-75);
8
8
  font-weight: var(--skf-font-weight-medium);
9
9
  gap: var(--skf-spacing-25);
10
- }
11
10
 
12
- :host([severity='error']) {
13
- --_skf-hint-color: var(--skf-severity-fg-color-error);
14
- }
11
+ :host-context(:disabled) & {
12
+ color: inherit;
13
+ }
14
+
15
+ :host([severity='alert']) & {
16
+ --_skf-hint-color: var(--skf-severity-fg-color-alert);
17
+ }
18
+
19
+ :host([severity='error']) & {
20
+ --_skf-hint-color: var(--skf-severity-fg-color-error);
21
+ }
22
+
23
+ :host([severity='info']) & {
24
+ --_skf-hint-color: var(--skf-severity-fg-color-info);
25
+ }
26
+
27
+ :host([severity='success']) & {
28
+ --_skf-hint-color: var(--skf-severity-fg-color-success);
29
+ }
15
30
 
16
- :host([severity='success']) {
17
- --_skf-hint-color: var(--skf-severity-fg-color-success);
31
+ :host([severity='warning']) & {
32
+ --_skf-hint-color: var(--skf-severity-fg-color-warning);
33
+ }
18
34
  }
19
35
  `;
20
36
  export {
21
- o as default
37
+ s as default
22
38
  };
@@ -1,10 +1,10 @@
1
- import { LitElement } from 'lit';
1
+ import { CSSResult, LitElement } from 'lit';
2
2
  export declare class SkfElement extends LitElement {
3
3
  static define(name: string, elementConstructor?: CustomElementConstructor, options?: ElementDefinitionOptions): void;
4
4
  static dependencies: Record<string, typeof SkfElement>;
5
5
  constructor();
6
- /** Custom event emitter helper function. Transmits user actions or component state change. */
6
+ /** Custom event emitter helper function. Transmits user actions or component state change. Use composed=false for event that should not pierce shadowDom. */
7
7
  emit(name: string, options?: CustomEventInit): Event;
8
- /** Slot change listener helper function. Listens for change in a slot emitted by the component. */
9
- _initiateSlotChangeObserver(callback?: () => void, name?: string): void;
8
+ /** This let's a component set styles in the light DOM. Scope css selectors with custom tag name to just target the slot. */
9
+ protected _setSlotStyles(slottedStyles: CSSResult): void;
10
10
  }
@@ -1,9 +1,9 @@
1
1
  import { LitElement as d } from "lit";
2
- const n = class n extends d {
3
- static define(e, t = this, o = {}) {
2
+ const s = class s extends d {
3
+ static define(e, t = this, n = {}) {
4
4
  if (!customElements.get(e)) {
5
5
  customElements.define(e, class extends t {
6
- }, o);
6
+ }, n);
7
7
  return;
8
8
  }
9
9
  }
@@ -14,7 +14,7 @@ const n = class n extends d {
14
14
  }
15
15
  );
16
16
  }
17
- /** Custom event emitter helper function. Transmits user actions or component state change. */
17
+ /** Custom event emitter helper function. Transmits user actions or component state change. Use composed=false for event that should not pierce shadowDom. */
18
18
  emit(e, t = {}) {
19
19
  if ([
20
20
  "click",
@@ -55,35 +55,31 @@ const n = class n extends d {
55
55
  "progress",
56
56
  "error"
57
57
  ].includes(e)) {
58
- const i = {
58
+ const u = {
59
59
  bubbles: !0,
60
- cancelable: !1,
60
+ cancelable: !0,
61
61
  composed: !0,
62
62
  ...t
63
63
  };
64
- return this.dispatchEvent(new Event(e, i)), new Event(e, t);
64
+ return this.dispatchEvent(new Event(e, u)), new Event(e, t);
65
65
  }
66
66
  const r = new CustomEvent(e, {
67
67
  bubbles: !0,
68
- cancelable: !1,
68
+ cancelable: !0,
69
69
  composed: !0,
70
70
  detail: {},
71
71
  ...t
72
72
  });
73
73
  return this.dispatchEvent(r), r;
74
74
  }
75
- /** Slot change listener helper function. Listens for change in a slot emitted by the component. */
76
- _initiateSlotChangeObserver(e, t = "") {
77
- if (!this.shadowRoot) return;
78
- e ?? (e = () => {
79
- console.log("slot updated");
80
- });
81
- const o = t ? `slot[name="${t}"]` : "slot", s = this.shadowRoot.querySelector(o);
82
- s == null || s.addEventListener("slotchange", e);
75
+ /** This let's a component set styles in the light DOM. Scope css selectors with custom tag name to just target the slot. */
76
+ _setSlotStyles(e) {
77
+ const t = new CSSStyleSheet();
78
+ t.replaceSync(e.cssText), document.adoptedStyleSheets = [...document.adoptedStyleSheets, t];
83
79
  }
84
80
  };
85
- n.dependencies = {};
86
- let c = n;
81
+ s.dependencies = {};
82
+ let o = s;
87
83
  export {
88
- c as SkfElement
84
+ o as SkfElement
89
85
  };
@@ -0,0 +1,4 @@
1
+ export declare const arrayDiff: <T>(a: T[], b: T[]) => T[];
2
+ export declare const arrayIntersect: <T>(a: T[], b: T[]) => T[];
3
+ export declare const arraySymDiff: <T>(a: T[], b: T[]) => T[];
4
+ export declare const arrayUnion: <T>(a: T[], b: T[]) => T[];
@@ -0,0 +1,2 @@
1
+ /** Recursively traverses a DOM tree starting from a given node, collecting all elements that match a specified tag name returning the result in an array. */
2
+ export declare function findMatchingTags(node: Node, tagName: string): unknown[];
@@ -0,0 +1,12 @@
1
+ function s(o, n) {
2
+ const t = [];
3
+ function a(e) {
4
+ e.nodeType === Node.ELEMENT_NODE && e.tagName.toLowerCase() === n.toLowerCase() && t.push(e), e.childNodes.forEach((r) => {
5
+ a(r);
6
+ });
7
+ }
8
+ return a(o), t;
9
+ }
10
+ export {
11
+ s as findMatchingTags
12
+ };
@@ -0,0 +1,2 @@
1
+ import type { FormFieldBaseProps } from '@internal/types/formField.js';
2
+ export declare function hintSeverity(hostSeverity: FormFieldBaseProps['severity'], invalid: boolean): "error" | ("info" | "warning" | "success" | "alert") | undefined;
@@ -0,0 +1,6 @@
1
+ function t(r, e) {
2
+ return e ? "error" : r;
3
+ }
4
+ export {
5
+ t as hintSeverity
6
+ };
@@ -0,0 +1,28 @@
1
+ interface ErrorMapBase {
2
+ assert?: unknown;
3
+ type?: 'error' | 'warning' | 'info';
4
+ }
5
+ interface ErrorMapWithReason extends ErrorMapBase {
6
+ reason: keyof typeof errorMap;
7
+ replaceStrings: string[];
8
+ customMessage?: never;
9
+ }
10
+ interface ErrorMapWithCustomMessage extends ErrorMapBase {
11
+ customMessage: string;
12
+ reason?: never;
13
+ replaceStrings?: never;
14
+ }
15
+ type ErrorMap = ErrorMapWithReason | ErrorMapWithCustomMessage;
16
+ declare const errorMap: {
17
+ 'no-parent': string;
18
+ 'no-children': string;
19
+ 'attribute-mismatch': string;
20
+ };
21
+ /**
22
+ * assert = check something exist/is truish. Also send in !this.debug to only run in debug mode.
23
+ * reason = key of error map,
24
+ * type = console warning, stopping error or info,
25
+ * replaceString = dynamic text parts
26
+ */
27
+ export declare const raiseError: ({ assert, reason, type, replaceStrings, customMessage, }: ErrorMap) => void | never;
28
+ export {};
@@ -0,0 +1,29 @@
1
+ const a = {
2
+ "no-parent": "{0} tag needs to be a nested child of a skf-select tag.",
3
+ "no-children": "{0} tag needs to have {1} tags as children.",
4
+ "attribute-mismatch": "{0} tag needs to have {1} attribute set {2}."
5
+ }, f = ({
6
+ assert: n = !1,
7
+ reason: e,
8
+ type: o = "error",
9
+ replaceStrings: c,
10
+ customMessage: r
11
+ }) => {
12
+ if (n) return;
13
+ switch (o) {
14
+ case "error":
15
+ throw new Error(r ?? t(a[e], c));
16
+ case "warning":
17
+ console.warn(r ?? t(a[e]));
18
+ break;
19
+ case "info":
20
+ console.info(r ?? t(a[e]));
21
+ break;
22
+ }
23
+ function t(i, s = []) {
24
+ return s.reduce((l, d, h) => l.replace(`{${String(h)}}`, d), i);
25
+ }
26
+ };
27
+ export {
28
+ f as raiseError
29
+ };
@@ -0,0 +1,27 @@
1
+ import type { LitElement } from 'lit';
2
+ type UpdateHandler = (prev?: unknown, next?: unknown) => void;
3
+ type NonUndefined<A> = A extends undefined ? never : A;
4
+ type UpdateHandlerFunctionKeys<T extends object> = {
5
+ [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;
6
+ }[keyof T];
7
+ interface WatchOptions {
8
+ /**
9
+ * If true, will only start watching after the initial update/render
10
+ */
11
+ waitUntilFirstUpdate?: boolean;
12
+ afterUpdate?: boolean;
13
+ }
14
+ /**
15
+ * Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an
16
+ * update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the
17
+ * initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.
18
+ *
19
+ * Usage:
20
+ *
21
+ * @watch('propName')
22
+ * handlePropChange(oldValue, newValue) {
23
+ * ...
24
+ * }
25
+ */
26
+ export declare function watch(propertyName: string | string[], options?: WatchOptions): <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => void;
27
+ export {};
@@ -0,0 +1,28 @@
1
+ function o(f, U) {
2
+ const e = {
3
+ waitUntilFirstUpdate: !1,
4
+ afterUpdate: !1,
5
+ ...U
6
+ };
7
+ return (l, c) => {
8
+ const { update: d } = l, h = Array.isArray(f) ? f : [f];
9
+ l.update = function(i) {
10
+ e.afterUpdate || h.forEach((n) => {
11
+ const t = n;
12
+ if (i.has(t)) {
13
+ const a = i.get(t), s = this[t];
14
+ a !== s && (!e.waitUntilFirstUpdate || this.hasUpdated) && this[c](a, s);
15
+ }
16
+ }), d.call(this, i), e.afterUpdate && h.forEach((n) => {
17
+ const t = n;
18
+ if (i.has(t)) {
19
+ const a = i.get(t), s = this[t];
20
+ a !== s && (!e.waitUntilFirstUpdate || this.hasUpdated) && this[c](a, s);
21
+ }
22
+ });
23
+ };
24
+ };
25
+ }
26
+ export {
27
+ o as watch
28
+ };
@@ -1,8 +1,18 @@
1
- import { queries, within } from '@storybook/test';
2
- type WithinShadowRootPromise = Promise<ReturnType<typeof within<typeof queries>>>;
3
1
  /**
4
- * Workaround solution for testing shadow DOM elements
5
- * @see {@link https://github.com/storybookjs/testing-library/issues/24#issuecomment-1593709872|GitHub}
2
+ * Workaround solution to get shadow DOM elements. Throws an error if the element is not found.
3
+ *
4
+ * @usage getWithinShadowRoot(canvasElement, 'my-custom-element', 'button')
6
5
  */
7
- export declare function withinShadowRoot(customElement: HTMLElement, selector: string): WithinShadowRootPromise;
8
- export {};
6
+ export declare const getWithinShadowRoot: (canvasElement: HTMLElement, ...selectors: string[]) => {
7
+ element: HTMLElement;
8
+ shadowRoot: HTMLElement;
9
+ };
10
+ /**
11
+ * Workaround solution to get shadow DOM elements. Returns undefined if the element is not found.
12
+ *
13
+ * @usage findWithinShadowRoot(canvasElement, 'my-custom-element', 'button')
14
+ */
15
+ export declare const findWithinShadowRoot: (canvasElement: HTMLElement, ...selectors: string[]) => {
16
+ element: HTMLElement;
17
+ shadowRoot: HTMLElement;
18
+ } | undefined;
@@ -11,7 +11,16 @@ export { default as SkfInput } from './skf-input/index.js';
11
11
  export { default as SkfLink } from './skf-link/index.js';
12
12
  export { default as SkfLoader } from './skf-loader/index.js';
13
13
  export { default as SkfLogo } from './skf-logo/index.js';
14
+ export { default as SkfProgress } from './skf-progress/index.js';
14
15
  export { default as SkfRadio } from './skf-radio/index.js';
16
+ export { default as SkfSelect } from './skf-select/index.js';
17
+ export { default as SkfSelectOption } from './skf-select-option/index.js';
18
+ export { default as SkfSelectOptionGroup } from './skf-select-option-group/index.js';
15
19
  export { default as SkfSwitch } from './skf-switch/index.js';
20
+ export { default as SkfTab } from './skf-tab/index.js';
21
+ export { default as SkfTabGroup } from './skf-tab-group/index.js';
22
+ export { default as SkfTabPanel } from './skf-tab-panel/index.js';
16
23
  export { default as SkfTag } from './skf-tag/index.js';
17
24
  export { default as SkfTextArea } from './skf-textarea/index.js';
25
+ export { default as SkfToast } from './skf-toast/index.js';
26
+ export { default as SkfToastWrapper } from './skf-toast-wrapper/index.js';
@@ -11,7 +11,16 @@ export { default as SkfInput } from './skf-input/index.js';
11
11
  export { default as SkfLink } from './skf-link/index.js';
12
12
  export { default as SkfLoader } from './skf-loader/index.js';
13
13
  export { default as SkfLogo } from './skf-logo/index.js';
14
+ export { default as SkfProgress } from './skf-progress/index.js';
14
15
  export { default as SkfRadio } from './skf-radio/index.js';
16
+ export { default as SkfSelect } from './skf-select/index.js';
17
+ export { default as SkfSelectOption } from './skf-select-option/index.js';
18
+ export { default as SkfSelectOptionGroup } from './skf-select-option-group/index.js';
15
19
  export { default as SkfSwitch } from './skf-switch/index.js';
20
+ export { default as SkfTab } from './skf-tab/index.js';
21
+ export { default as SkfTabGroup } from './skf-tab-group/index.js';
22
+ export { default as SkfTabPanel } from './skf-tab-panel/index.js';
16
23
  export { default as SkfTag } from './skf-tag/index.js';
17
24
  export { default as SkfTextArea } from './skf-textarea/index.js';
25
+ export { default as SkfToast } from './skf-toast/index.js';
26
+ export { default as SkfToastWrapper } from './skf-toast-wrapper/index.js';
@@ -1,3 +1,9 @@
1
1
  import Component from '../../components/button/button.js';
2
- declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
2
+ import { type SkfButton } from '../../components/button/button.js';
3
+ import { type EventName } from '@lit/react';
4
+ declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
5
+ onClick: EventName<Event & {
6
+ target: SkfButton;
7
+ }>;
8
+ }>;
3
9
  export default reactWrapper;