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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/dist/components/accordion/accordion-item.d.ts +1 -1
  2. package/dist/components/accordion/accordion.component.d.ts +4 -4
  3. package/dist/components/accordion/accordion.component.js +18 -17
  4. package/dist/components/accordion/accordion.styles.d.ts +1 -2
  5. package/dist/components/accordion/accordion.styles.js +5 -4
  6. package/dist/components/alert/alert.component.d.ts +5 -5
  7. package/dist/components/alert/alert.component.js +46 -35
  8. package/dist/components/alert/alert.styles.d.ts +1 -2
  9. package/dist/components/alert/alert.styles.js +29 -24
  10. package/dist/components/breadcrumb/breadcrumb.component.d.ts +29 -0
  11. package/dist/components/breadcrumb/breadcrumb.d.ts +8 -0
  12. package/dist/components/breadcrumb-item/breadcrumb-item.component.d.ts +25 -0
  13. package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +8 -0
  14. package/dist/components/button/button.component.d.ts +29 -5
  15. package/dist/components/button/button.component.js +89 -52
  16. package/dist/components/button/button.styles.js +65 -45
  17. package/dist/components/card/card.component.d.ts +4 -4
  18. package/dist/components/card/card.component.js +35 -24
  19. package/dist/components/card/card.styles.d.ts +1 -2
  20. package/dist/components/card/card.styles.js +14 -12
  21. package/dist/components/checkbox/checkbox.component.d.ts +11 -12
  22. package/dist/components/checkbox/checkbox.component.js +96 -90
  23. package/dist/components/collapse/collapse.component.d.ts +8 -8
  24. package/dist/components/collapse/collapse.component.js +42 -34
  25. package/dist/components/collapse/collapse.styles.js +15 -14
  26. package/dist/components/dialog/dialog.component.d.ts +74 -0
  27. package/dist/components/dialog/dialog.component.js +187 -0
  28. package/dist/components/dialog/dialog.d.ts +8 -0
  29. package/dist/components/dialog/dialog.js +6 -0
  30. package/dist/components/dialog/dialog.styles.d.ts +1 -0
  31. package/dist/components/dialog/dialog.styles.js +91 -0
  32. package/dist/components/divider/divider.component.d.ts +3 -3
  33. package/dist/components/divider/divider.component.js +39 -27
  34. package/dist/components/divider/divider.styles.d.ts +1 -2
  35. package/dist/components/divider/divider.styles.js +26 -26
  36. package/dist/components/heading/heading.component.d.ts +2 -2
  37. package/dist/components/heading/heading.component.js +13 -13
  38. package/dist/components/icon/icon.component.d.ts +2 -5
  39. package/dist/components/icon/icon.component.js +32 -23
  40. package/dist/components/icon/icon.styles.js +53 -47
  41. package/dist/components/input/input.component.d.ts +12 -11
  42. package/dist/components/input/input.component.js +88 -89
  43. package/dist/components/link/link.component.d.ts +7 -6
  44. package/dist/components/link/link.component.js +49 -43
  45. package/dist/components/link/link.styles.js +36 -40
  46. package/dist/components/loader/loader.component.d.ts +2 -2
  47. package/dist/components/loader/loader.component.js +39 -32
  48. package/dist/components/loader/loader.styles.js +11 -10
  49. package/dist/components/logo/logo.component.d.ts +3 -3
  50. package/dist/components/logo/logo.component.js +28 -17
  51. package/dist/components/logo/logo.styles.d.ts +1 -2
  52. package/dist/components/logo/logo.styles.js +11 -9
  53. package/dist/components/menu/menu.component.d.ts +24 -0
  54. package/dist/components/menu/menu.component.js +18 -0
  55. package/dist/components/menu/menu.d.ts +8 -0
  56. package/dist/components/menu/menu.js +6 -0
  57. package/dist/components/menu/menu.styles.d.ts +1 -0
  58. package/dist/components/menu/menu.styles.js +11 -0
  59. package/dist/components/menu-item/menu-item.component.d.ts +25 -0
  60. package/dist/components/menu-item/menu-item.component.js +13 -0
  61. package/dist/components/menu-item/menu-item.d.ts +8 -0
  62. package/dist/components/menu-item/menu-item.js +6 -0
  63. package/dist/components/menu-item/menu-item.styles.d.ts +1 -0
  64. package/dist/components/menu-item/menu-item.styles.js +19 -0
  65. package/dist/components/popover/popover.component.d.ts +29 -0
  66. package/dist/components/popover/popover.component.js +37 -0
  67. package/dist/components/popover/popover.d.ts +8 -0
  68. package/dist/components/popover/popover.js +6 -0
  69. package/dist/components/popover/popover.styles.d.ts +1 -0
  70. package/dist/components/popover/popover.styles.js +12 -0
  71. package/dist/components/progress/progress.component.d.ts +22 -0
  72. package/dist/components/progress/progress.component.js +49 -0
  73. package/dist/components/progress/progress.d.ts +8 -0
  74. package/dist/components/progress/progress.js +6 -0
  75. package/dist/components/progress/progress.styles.d.ts +1 -0
  76. package/dist/components/progress/progress.styles.js +48 -0
  77. package/dist/components/radio/radio.component.d.ts +7 -9
  78. package/dist/components/radio/radio.component.js +95 -79
  79. package/dist/components/select/select.component.d.ts +10 -12
  80. package/dist/components/select/select.component.js +120 -120
  81. package/dist/components/select/select.controllers.d.ts +1 -26
  82. package/dist/components/select/select.controllers.js +35 -95
  83. package/dist/components/select-option/select-option.component.d.ts +1 -1
  84. package/dist/components/select-option/select-option.controllers.d.ts +1 -1
  85. package/dist/components/select-option-group/select-option-group.component.d.ts +1 -1
  86. package/dist/components/select-option-group/select-option-group.component.js +9 -9
  87. package/dist/components/stepper/stepper.component.d.ts +38 -0
  88. package/dist/components/stepper/stepper.component.js +91 -0
  89. package/dist/components/stepper/stepper.d.ts +8 -0
  90. package/dist/components/stepper/stepper.helpers.d.ts +16 -0
  91. package/dist/components/stepper/stepper.helpers.js +18 -0
  92. package/dist/components/stepper/stepper.js +6 -0
  93. package/dist/components/stepper/stepper.styles.d.ts +1 -0
  94. package/dist/components/stepper/stepper.styles.js +15 -0
  95. package/dist/components/stepper-item/stepper-item.component.d.ts +47 -0
  96. package/dist/components/stepper-item/stepper-item.component.js +113 -0
  97. package/dist/components/stepper-item/stepper-item.d.ts +8 -0
  98. package/dist/components/stepper-item/stepper-item.js +6 -0
  99. package/dist/components/stepper-item/stepper-item.styles.d.ts +1 -0
  100. package/dist/components/stepper-item/stepper-item.styles.js +98 -0
  101. package/dist/components/switch/switch.component.d.ts +2 -2
  102. package/dist/components/switch/switch.component.js +17 -7
  103. package/dist/components/switch/switch.styles.js +16 -13
  104. package/dist/components/tab/tab.component.d.ts +29 -0
  105. package/dist/components/tab/tab.component.js +57 -0
  106. package/dist/components/tab/tab.d.ts +8 -0
  107. package/dist/components/tab/tab.js +6 -0
  108. package/dist/components/tab/tab.styles.d.ts +1 -0
  109. package/dist/components/tab/tab.styles.js +123 -0
  110. package/dist/components/tab-group/tab-group.component.d.ts +43 -0
  111. package/dist/components/tab-group/tab-group.component.js +98 -0
  112. package/dist/components/tab-group/tab-group.d.ts +8 -0
  113. package/dist/components/tab-group/tab-group.js +6 -0
  114. package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
  115. package/dist/components/tab-group/tab-group.styles.js +75 -0
  116. package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
  117. package/dist/components/tab-panel/tab-panel.component.js +36 -0
  118. package/dist/components/tab-panel/tab-panel.d.ts +8 -0
  119. package/dist/components/tab-panel/tab-panel.js +6 -0
  120. package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
  121. package/dist/components/tab-panel/tab-panel.styles.js +13 -0
  122. package/dist/components/tag/tag.component.d.ts +2 -2
  123. package/dist/components/tag/tag.component.js +61 -45
  124. package/dist/components/tag/tag.styles.js +30 -28
  125. package/dist/components/textarea/textarea.component.d.ts +4 -4
  126. package/dist/components/textarea/textarea.component.js +2 -2
  127. package/dist/components/toast/toast.component.d.ts +8 -5
  128. package/dist/components/toast/toast.component.js +30 -26
  129. package/dist/components/toast/toast.singleton.d.ts +5 -10
  130. package/dist/components/toast/toast.singleton.js +25 -25
  131. package/dist/components/toast/toast.styles.d.ts +1 -0
  132. package/dist/components/toast-item/toast-item.component.d.ts +1 -1
  133. package/dist/components/toast-item/toast-item.component.js +15 -15
  134. package/dist/components/toast-item/toast-item.styles.js +18 -0
  135. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +2 -2
  136. package/dist/components/toast-wrapper/toast-wrapper.component.js +11 -11
  137. package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
  138. package/dist/components/tooltip/tooltip.component.d.ts +24 -0
  139. package/dist/components/tooltip/tooltip.component.js +18 -0
  140. package/dist/components/tooltip/tooltip.d.ts +8 -0
  141. package/dist/components/tooltip/tooltip.js +6 -0
  142. package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
  143. package/dist/components/tooltip/tooltip.styles.js +12 -0
  144. package/dist/custom-elements.json +2465 -629
  145. package/dist/index.d.ts +11 -0
  146. package/dist/index.js +77 -44
  147. package/dist/internal/base-classes/popover/popover.base.d.ts +29 -0
  148. package/dist/internal/base-classes/popover/popover.base.js +116 -0
  149. package/dist/internal/base-classes/popover/popover.styles.d.ts +1 -0
  150. package/dist/internal/base-classes/popover/popover.styles.js +29 -0
  151. package/dist/internal/components/formBase.d.ts +1 -0
  152. package/dist/internal/components/formBase.js +11 -11
  153. package/dist/internal/components/hint/hint.component.d.ts +2 -2
  154. package/dist/internal/components/hint/hint.component.js +13 -13
  155. package/dist/internal/components/skf-element.js +26 -25
  156. package/dist/internal/controllers/popover.controller.d.ts +16 -0
  157. package/dist/internal/controllers/popover.controller.js +44 -0
  158. package/dist/internal/helpers/hintSeverity.d.ts +2 -2
  159. package/dist/internal/helpers/watch.d.ts +27 -0
  160. package/dist/internal/helpers/watch.js +28 -0
  161. package/dist/internal/templates/asterisk.d.ts +1 -1
  162. package/dist/internal/templates/asterisk.js +7 -6
  163. package/dist/react/index.d.ts +13 -0
  164. package/dist/react/index.js +13 -0
  165. package/dist/react/skf-breadcrumb/index.d.ts +9 -0
  166. package/dist/react/skf-breadcrumb/index.js +17 -0
  167. package/dist/react/skf-breadcrumb-item/index.d.ts +3 -0
  168. package/dist/react/skf-breadcrumb-item/index.js +13 -0
  169. package/dist/react/skf-button/index.d.ts +7 -1
  170. package/dist/react/skf-button/index.js +5 -1
  171. package/dist/react/skf-dialog/index.d.ts +15 -0
  172. package/dist/react/skf-dialog/index.js +19 -0
  173. package/dist/react/skf-menu/index.d.ts +12 -0
  174. package/dist/react/skf-menu/index.js +18 -0
  175. package/dist/react/skf-menu-item/index.d.ts +27 -0
  176. package/dist/react/skf-menu-item/index.js +23 -0
  177. package/dist/react/skf-popover/index.d.ts +12 -0
  178. package/dist/react/skf-popover/index.js +18 -0
  179. package/dist/react/skf-progress/index.d.ts +3 -0
  180. package/dist/react/skf-progress/index.js +13 -0
  181. package/dist/react/skf-stepper/index.d.ts +9 -0
  182. package/dist/react/skf-stepper/index.js +17 -0
  183. package/dist/react/skf-stepper-item/index.d.ts +9 -0
  184. package/dist/react/skf-stepper-item/index.js +17 -0
  185. package/dist/react/skf-tab/index.d.ts +12 -0
  186. package/dist/react/skf-tab/index.js +18 -0
  187. package/dist/react/skf-tab-group/index.d.ts +3 -0
  188. package/dist/react/skf-tab-group/index.js +13 -0
  189. package/dist/react/skf-tab-panel/index.d.ts +3 -0
  190. package/dist/react/skf-tab-panel/index.js +13 -0
  191. package/dist/react/skf-tooltip/index.d.ts +12 -0
  192. package/dist/react/skf-tooltip/index.js +18 -0
  193. package/dist/styles/component.styles.js +15 -2
  194. package/dist/types/jsx/custom-element-jsx.d.ts +603 -27
  195. package/dist/types/vue/index.d.ts +413 -11
  196. package/dist/vscode.html-custom-data.json +462 -36
  197. package/dist/web-types.json +944 -90
  198. package/package.json +43 -42
  199. package/dist/components/toast-item/toast-item.style.js +0 -16
  200. /package/dist/components/{toast/toast.style.d.ts → breadcrumb/breadcrumb.styles.d.ts} +0 -0
  201. /package/dist/components/{toast-wrapper/toast-wrapper.style.d.ts → breadcrumb-item/breadcrumb-item.styles.d.ts} +0 -0
  202. /package/dist/components/toast/{toast.style.js → toast.styles.js} +0 -0
  203. /package/dist/components/toast-item/{toast-item.style.d.ts → toast-item.styles.d.ts} +0 -0
  204. /package/dist/components/toast-wrapper/{toast-wrapper.style.js → toast-wrapper.styles.js} +0 -0
@@ -0,0 +1,6 @@
1
+ import { SkfMenuItem as e } from "./menu-item.component.js";
2
+ e.define("skf-menu-item");
3
+ export {
4
+ e as SkfMenuItem,
5
+ e as default
6
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,19 @@
1
+ import { css as e } from "lit";
2
+ const s = e`
3
+ @layer components {
4
+ .menu-item {
5
+ block-size: var(--skf-size-44);
6
+ display: flex;
7
+ padding-inline: var(--skf-spacing-75);
8
+
9
+ @media screen and (any-hover: hover) {
10
+ &:hover {
11
+ background-color: var(--skf-color-blue-lighest);
12
+ }
13
+ }
14
+ }
15
+ }
16
+ `;
17
+ export {
18
+ s as styles
19
+ };
@@ -0,0 +1,29 @@
1
+ import { SkfPopoverBase } from '../../internal/base-classes/popover/popover.base.js';
2
+ import type { CSSResultGroup } from 'lit';
3
+ /**
4
+ * The `<skf-popover>` is a general purpose component that displays the slot content.
5
+ *
6
+ * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
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 menu
9
+ * @property {boolean} [isOpen=false] - Whether the menu is open
10
+ * @property {string} [anchor] - The id of the element the menu will be anchored to
11
+ *
12
+ * @event open - Fired when the menu is opened
13
+ * @event close - Fired when the menu is closed
14
+ *
15
+ * @slot - The popover content
16
+ *
17
+ * @tagname skf-popover
18
+ */
19
+ export declare class SkfPopover extends SkfPopoverBase {
20
+ static styles: CSSResultGroup;
21
+ /** If defined, sets a custom offset for the popover */
22
+ offset: number;
23
+ /** If true, hides the arrow */
24
+ hideArrow: boolean;
25
+ constructor();
26
+ hideArrowChanged(): void;
27
+ addEventListeners($element: HTMLElement | Element): void;
28
+ removeEventListeners($element: HTMLElement | Element): void;
29
+ }
@@ -0,0 +1,37 @@
1
+ import { SkfPopoverBase as n } from "../../internal/base-classes/popover/popover.base.js";
2
+ import { watch as d } from "../../internal/helpers/watch.js";
3
+ import { property as f } from "lit/decorators.js";
4
+ import { styles as w } from "./popover.styles.js";
5
+ var l = Object.defineProperty, v = Object.getOwnPropertyDescriptor, h = (m, e, o, s) => {
6
+ for (var r = s > 1 ? void 0 : s ? v(e, o) : e, i = m.length - 1, p; i >= 0; i--)
7
+ (p = m[i]) && (r = (s ? p(e, o, r) : p(r)) || r);
8
+ return s && r && l(e, o, r), r;
9
+ };
10
+ const a = class a extends n {
11
+ constructor() {
12
+ super(), this.offset = 8, this.hideArrow = !1, this.arrow = !this.hideArrow, this.placement = "bottom-start", n.classMap = { popover: !0 };
13
+ }
14
+ hideArrowChanged() {
15
+ this.arrow = !this.hideArrow;
16
+ }
17
+ addEventListeners(e) {
18
+ e.addEventListener("mouseenter", this.open);
19
+ }
20
+ removeEventListeners(e) {
21
+ e.removeEventListener("mouseenter", this.open);
22
+ }
23
+ };
24
+ a.styles = [n.styles, w];
25
+ let t = a;
26
+ h([
27
+ f({ type: Number })
28
+ ], t.prototype, "offset", 2);
29
+ h([
30
+ f({ type: Boolean })
31
+ ], t.prototype, "hideArrow", 2);
32
+ h([
33
+ d("hideArrow")
34
+ ], t.prototype, "hideArrowChanged", 1);
35
+ export {
36
+ t as SkfPopover
37
+ };
@@ -0,0 +1,8 @@
1
+ import { SkfPopover } from './popover.component';
2
+ export * from './popover.component';
3
+ export default SkfPopover;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-popover': SkfPopover;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ import { SkfPopover as o } from "./popover.component.js";
2
+ o.define("skf-popover");
3
+ export {
4
+ o as SkfPopover,
5
+ o as default
6
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,12 @@
1
+ import { css as s } from "lit";
2
+ const e = s`
3
+ @layer components {
4
+ .popover {
5
+ font-size: var(--skf-font-size-75);
6
+ padding: var(--skf-spacing-50);
7
+ }
8
+ }
9
+ `;
10
+ export {
11
+ e as styles
12
+ };
@@ -0,0 +1,22 @@
1
+ import { SkfElement } from '../../internal/components/skf-element';
2
+ import { type CSSResultGroup } from 'lit';
3
+ /**
4
+ * The `<skf-progress>` element displays an indicator showing the completion progress of a task, typically displayed as a progress bar
5
+ *
6
+ * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
7
+ *
8
+ * @tagname skf-progress
9
+ */
10
+ export declare class SkfProgress extends SkfElement {
11
+ #private;
12
+ static styles: CSSResultGroup;
13
+ static formAssociated: boolean;
14
+ /** If true, the progress-bar's fill value is animated */
15
+ animated: boolean;
16
+ /** Describes how much work the task indicated by the progress element requires */
17
+ max: number;
18
+ /** Specifies how much of the task that has been completed */
19
+ value: number;
20
+ constructor();
21
+ render(): import("lit").TemplateResult<1>;
22
+ }
@@ -0,0 +1,49 @@
1
+ var f = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var h = (t, e, r) => e.has(t) || f("Cannot " + r);
5
+ var d = (t, e, r) => (h(t, e, "read from private field"), r ? r.call(t) : e.get(t)), c = (t, e, r) => e.has(t) ? f("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), y = (t, e, r, p) => (h(t, e, "write to private field"), p ? p.call(t, r) : e.set(t, r), r);
6
+ import { SkfElement as v } from "../../internal/components/skf-element.js";
7
+ import x from "../../styles/component.styles.js";
8
+ import { html as b } from "lit";
9
+ import { property as l } from "lit/decorators.js";
10
+ import { classMap as _ } from "lit/directives/class-map.js";
11
+ import { styles as g } from "./progress.styles.js";
12
+ var N = Object.defineProperty, n = (t, e, r, p) => {
13
+ for (var s = void 0, m = t.length - 1, u; m >= 0; m--)
14
+ (u = t[m]) && (s = u(e, r, s) || s);
15
+ return s && N(e, r, s), s;
16
+ }, o;
17
+ const i = class i extends v {
18
+ constructor() {
19
+ super();
20
+ c(this, o);
21
+ this.animated = !1, this.max = 1, this.value = 0, y(this, o, this.attachInternals()), d(this, o).role = "progressbar";
22
+ }
23
+ render() {
24
+ const r = this.value / this.max * 100;
25
+ return b`
26
+ <div
27
+ class=${_({
28
+ progress: !0,
29
+ "progress--animated": this.animated
30
+ })}
31
+ style="--_skf-progress-value: ${r}%"
32
+ ></div>
33
+ `;
34
+ }
35
+ };
36
+ o = new WeakMap(), i.styles = [x, g], i.formAssociated = !0;
37
+ let a = i;
38
+ n([
39
+ l({ type: Boolean, reflect: !0 })
40
+ ], a.prototype, "animated");
41
+ n([
42
+ l({ type: Number })
43
+ ], a.prototype, "max");
44
+ n([
45
+ l({ type: Number })
46
+ ], a.prototype, "value");
47
+ export {
48
+ a as SkfProgress
49
+ };
@@ -0,0 +1,8 @@
1
+ import { SkfProgress } from './progress.component';
2
+ export * from './progress.component';
3
+ export default SkfProgress;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-progress': SkfProgress;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ import { SkfProgress as r } from "./progress.component.js";
2
+ r.define("skf-progress");
3
+ export {
4
+ r as SkfProgress,
5
+ r as default
6
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,48 @@
1
+ import { css as r } from "lit";
2
+ const s = r`
3
+ /* stylelint-disable selector-class-pattern */
4
+ @layer components {
5
+ .progress {
6
+ background: var(--skf-bg-color-neutral-3);
7
+ block-size: var(--skf-size-8);
8
+ border-radius: 0.25rem; /* Missing token */
9
+ overflow: hidden;
10
+
11
+ &::after {
12
+ background-color: var(--skf-bg-color-emphasised);
13
+ block-size: inherit;
14
+ border-radius: inherit;
15
+ content: '';
16
+ display: block;
17
+ inline-size: var(--_skf-progress-value, auto);
18
+ transition: inline-size calc(var(--skf-motion-duration-slow) * 1ms)
19
+ cubic-bezier(0.4, 0.93, 0.71, 0.89);
20
+ }
21
+ }
22
+
23
+ .progress--animated::after {
24
+ animation: skf-progress-animation calc(var(--skf-motion-duration-slow) * 1ms) linear infinite
25
+ reverse;
26
+ background-image: linear-gradient(
27
+ -45deg,
28
+ rgba(255 255 255 / 20%) 25%,
29
+ transparent 25%,
30
+ transparent 50%,
31
+ rgba(255 255 255 / 20%) 50%,
32
+ rgba(255 255 255 / 20%) 75%,
33
+ transparent 75%,
34
+ transparent
35
+ );
36
+ background-size: 50px 50px;
37
+ }
38
+
39
+ @keyframes skf-progress-animation {
40
+ to {
41
+ background-position: 50px 50px;
42
+ }
43
+ }
44
+ }
45
+ `;
46
+ export {
47
+ s as styles
48
+ };
@@ -1,6 +1,6 @@
1
- import '@components/icon/icon.js';
2
- import { FormBase } from '@internal/components/formBase.js';
3
- import type { FormFieldBaseProps } from '@internal/types/formField.js';
1
+ import '../icon/icon.js';
2
+ import { FormBase } from '../../internal/components/formBase.js';
3
+ import type { FormFieldBaseProps } from '../../internal/types/formField.js';
4
4
  import { type CSSResultGroup } from 'lit';
5
5
  /**
6
6
  * The `<skf-radio>` component is used to create a radio input
@@ -25,8 +25,6 @@ export declare class SkfRadio extends FormBase implements FormFieldBaseProps {
25
25
  checked?: boolean;
26
26
  /** If true, forces component to invalid state until removed */
27
27
  customInvalid?: boolean;
28
- /** If true, hides the label visually */
29
- hideLabel?: boolean;
30
28
  /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
31
29
  label?: string;
32
30
  /** If defined, adds name to the input-element */
@@ -50,11 +48,11 @@ export declare class SkfRadio extends FormBase implements FormFieldBaseProps {
50
48
  /** @internal */
51
49
  private $input?;
52
50
  connectedCallback(): void;
53
- willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
54
51
  protected firstUpdated(): void;
55
- updated(changedProperties: Map<string | number | symbol, unknown>): void;
56
- attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
57
- debugOutput(): void;
52
+ handleInvalidChange(): void;
53
+ handleDebugInvalid(): void;
54
+ handleCheckedChanged(): void;
55
+ handleCustomInvalidChange(): void;
58
56
  /** @internal */
59
57
  private _resetValue;
60
58
  /** @internal */
@@ -1,134 +1,150 @@
1
1
  import "../icon/icon.js";
2
- import { FormBase as u } from "../../internal/components/formBase.js";
3
- import { Asterisk as c } from "../../internal/templates/asterisk.js";
4
- import p from "../../styles/component.styles.js";
5
- import { html as m } from "lit";
6
- import { property as a, state as v, query as f } from "lit/decorators.js";
7
- import { ifDefined as y } from "lit/directives/if-defined.js";
8
- import { live as b } from "lit/directives/live.js";
9
- import _ from "./radio.styles.js";
10
- var k = Object.defineProperty, i = (n, t, r, l) => {
11
- for (var s = void 0, o = n.length - 1, h; o >= 0; o--)
12
- (h = n[o]) && (s = h(t, r, s) || s);
13
- return s && k(t, r, s), s;
2
+ import { FormBase as c } from "../../internal/components/formBase.js";
3
+ import { watch as n } from "../../internal/helpers/watch.js";
4
+ import { Asterisk as p } from "../../internal/templates/asterisk.js";
5
+ import m from "../../styles/component.styles.js";
6
+ import { html as v } from "lit";
7
+ import { property as r, state as f, query as y } from "lit/decorators.js";
8
+ import { ifDefined as b } from "lit/directives/if-defined.js";
9
+ import { live as _ } from "lit/directives/live.js";
10
+ import g from "./radio.styles.js";
11
+ var k = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (u, e, s, o) => {
12
+ for (var a = o > 1 ? void 0 : o ? C(e, s) : e, l = u.length - 1, h; l >= 0; l--)
13
+ (h = u[l]) && (a = (o ? h(e, s, a) : h(a)) || a);
14
+ return o && a && k(e, s, a), a;
14
15
  };
15
- const d = class d extends u {
16
+ const d = class d extends c {
16
17
  constructor() {
17
- super(...arguments), this._initialChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (t) => {
18
- t.stopPropagation(), this.checked = this._initialChecked, this.$input && (this.$input.checked = !!this._initialChecked), this.setFormValue(this.checked ? this.value : "");
18
+ super(...arguments), this._initialChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (e) => {
19
+ e.stopPropagation(), this.checked = this._initialChecked, this.$input && (this.$input.checked = !!this._initialChecked), this.setFormValue(this.checked ? this.value : "");
19
20
  };
20
21
  }
21
22
  connectedCallback() {
22
23
  super.connectedCallback(), this._validateInput();
23
24
  }
24
- willUpdate(t) {
25
- t.has("_invalid") && (this._invalid ? (this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid"), this.checkValidity()) : (this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true")));
26
- }
27
25
  firstUpdated() {
28
- var t;
29
- (t = this.$input) == null || t.addEventListener("change", (r) => {
30
- var l;
31
- r.stopPropagation(), this.pristine = !1, this.checked = (l = this.$input) == null ? void 0 : l.checked, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(""), this.emitEvent("change");
32
- }), this.addEventListener("invalid", (r) => {
33
- this.pristine = !1, this._invalid = !0, this.customErrorDisplay && r.preventDefault();
26
+ var e;
27
+ (e = this.$input) == null || e.addEventListener("change", (s) => {
28
+ var o;
29
+ s.stopPropagation(), this.pristine = !1, this.checked = (o = this.$input) == null ? void 0 : o.checked, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(""), this.emitEvent("change");
30
+ }), this.addEventListener("invalid", (s) => {
31
+ this.pristine = !1, this._invalid = !0, this.customErrorDisplay && s.preventDefault();
34
32
  }), this._initialChecked = this.checked, this.addEventListener("reset", this._resetValue);
35
33
  }
36
- updated(t) {
37
- super.updated(t), t.has("_invalid") && this._invalid && this.debug && this.debugOutput(), t.has("checked") && this.form && this.setFormValue(this.checked ? this.value : null);
34
+ handleInvalidChange() {
35
+ this._invalid ? (this.setAttribute("invalid", ""), this.showValid && this.removeAttribute("valid"), this.checkValidity()) : (this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true"));
36
+ }
37
+ handleDebugInvalid() {
38
+ this._invalid && this.debug && !this.validity.valid && console.log(`Radio invalidity reason: ${this._internals.validationMessage}`);
38
39
  }
39
- attributeChangedCallback(t, r, l) {
40
- if (super.attributeChangedCallback(t, r, l), t === "checked" && l !== null && this._uncheckSiblingRadios(), t === "custom-invalid")
41
- if (typeof l == "string") {
42
- const o = String(l).trim() || "Custom error";
43
- this.pristine = !1, this._invalid = !0, this._internals.setValidity({ customError: !0 }, o), this.checkValidity();
44
- } else
45
- this.setValidity({}), this._validateInput();
40
+ handleCheckedChanged() {
41
+ this.setFormValue(this.checked ? this.value : null), this.checked && this._uncheckSiblingRadios();
46
42
  }
47
- debugOutput() {
48
- this.debug && !this._internals.validity.valid && console.log(`Radio invalidity reason: ${this._internals.validationMessage}`);
43
+ handleCustomInvalidChange() {
44
+ if (this.customInvalid) {
45
+ const s = (
46
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
47
+ this.getAttribute("data-customerror") || "Set a custom error message using the data-customerror attribute"
48
+ );
49
+ this.pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, s), this.checkValidity();
50
+ } else
51
+ this.setValidity({}), this._validateInput();
49
52
  }
50
53
  /** @internal */
51
54
  _uncheckSiblingRadios() {
52
- const t = this.name;
53
- if (!t) return;
54
- (this.form ?? document).querySelectorAll(`skf-radio[name="${t}"]`).forEach((s) => {
55
- const o = this.form === s.form, h = !this.form && !s.form;
56
- s !== this && (o || h) && (s.checked = !1);
55
+ const e = this.name;
56
+ if (!e) return;
57
+ (this.form ?? document).querySelectorAll(`skf-radio[name="${e}"]`).forEach((a) => {
58
+ const l = this.form === a.form, h = !this.form && !a.form;
59
+ a !== this && (l || h) && (a.checked = !1);
57
60
  });
58
61
  }
59
62
  /** @internal */
60
63
  _validateInput() {
61
- var t;
62
- if (this._invalid = !1, this.customInvalid)
63
- this.setValidity({ customError: !0 }, "Custom error"), this._invalid = !0;
64
- else if (this.required && !this.checked) {
64
+ var e;
65
+ if (this._invalid = !1, this.customInvalid) {
66
+ const s = this.getAttribute("data-customerror");
67
+ this.setValidity({ customError: !0 }, this.withFallback(s)), this._invalid = !0;
68
+ } else if (this.required && !this.checked) {
65
69
  this.pristine || (this._invalid = !0);
66
- const r = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : ((t = this.$input) == null ? void 0 : t.validationMessage) ?? "Please check this box if you want to proceed";
67
- this.setValidity({ valueMissing: !0 }, String(r));
70
+ const s = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : (
71
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
72
+ ((e = this.$input) == null ? void 0 : e.validationMessage) || "Please check this radio if you want to proceed"
73
+ );
74
+ this.setValidity({ valueMissing: !0 }, this.withFallback(s));
68
75
  } else
69
76
  this.setValidity({});
70
77
  }
71
78
  render() {
72
- return m`
79
+ return v`
73
80
  <label id="root">
74
81
  <input
75
82
  ?disabled=${this.disabled}
76
83
  ?required=${this.required}
77
- .checked=${b(!!this.checked)}
84
+ .checked=${_(!!this.checked)}
78
85
  aria-invalid=${!!this._invalid}
79
- name=${y(this.name)}
86
+ name=${b(this.name)}
80
87
  type="radio"
81
88
  value=${this.value}
82
89
  />
83
90
  <div id="label">
84
91
  <slot>${this.label}</slot>
85
- ${this.required ? c(this.requiredLabel) : null}
92
+ ${this.required ? p(this.requiredLabel) : null}
86
93
  </div>
87
94
  </label>
88
95
  `;
89
96
  }
90
97
  };
91
- d.styles = [p, _];
92
- let e = d;
98
+ d.styles = [m, g];
99
+ let t = d;
100
+ i([
101
+ r({ type: Boolean })
102
+ ], t.prototype, "debug", 2);
103
+ i([
104
+ r({ type: Boolean, reflect: !0 })
105
+ ], t.prototype, "checked", 2);
106
+ i([
107
+ r({ type: Boolean, attribute: "custom-invalid" })
108
+ ], t.prototype, "customInvalid", 2);
93
109
  i([
94
- a({ type: Boolean })
95
- ], e.prototype, "debug");
110
+ r()
111
+ ], t.prototype, "label", 2);
96
112
  i([
97
- a({ type: Boolean, reflect: !0 })
98
- ], e.prototype, "checked");
113
+ r()
114
+ ], t.prototype, "name", 2);
99
115
  i([
100
- a({ type: Boolean, attribute: "custom-invalid" })
101
- ], e.prototype, "customInvalid");
116
+ r({ attribute: "required-label" })
117
+ ], t.prototype, "requiredLabel", 2);
102
118
  i([
103
- a({ type: Boolean, attribute: "hide-label", reflect: !0 })
104
- ], e.prototype, "hideLabel");
119
+ r({ reflect: !0 })
120
+ ], t.prototype, "size", 2);
105
121
  i([
106
- a()
107
- ], e.prototype, "label");
122
+ r()
123
+ ], t.prototype, "severity", 2);
108
124
  i([
109
- a()
110
- ], e.prototype, "name");
125
+ r({ type: Boolean, attribute: "show-valid" })
126
+ ], t.prototype, "showValid", 2);
111
127
  i([
112
- a({ attribute: "required-label" })
113
- ], e.prototype, "requiredLabel");
128
+ r()
129
+ ], t.prototype, "value", 2);
114
130
  i([
115
- a({ reflect: !0 })
116
- ], e.prototype, "size");
131
+ f()
132
+ ], t.prototype, "_invalid", 2);
117
133
  i([
118
- a()
119
- ], e.prototype, "severity");
134
+ y("input")
135
+ ], t.prototype, "$input", 2);
120
136
  i([
121
- a({ type: Boolean, attribute: "show-valid" })
122
- ], e.prototype, "showValid");
137
+ n("_invalid")
138
+ ], t.prototype, "handleInvalidChange", 1);
123
139
  i([
124
- a()
125
- ], e.prototype, "value");
140
+ n("_invalid", { afterUpdate: !0 })
141
+ ], t.prototype, "handleDebugInvalid", 1);
126
142
  i([
127
- v()
128
- ], e.prototype, "_invalid");
143
+ n("checked")
144
+ ], t.prototype, "handleCheckedChanged", 1);
129
145
  i([
130
- f("input")
131
- ], e.prototype, "$input");
146
+ n("customInvalid")
147
+ ], t.prototype, "handleCustomInvalidChange", 1);
132
148
  export {
133
- e as SkfRadio
149
+ t as SkfRadio
134
150
  };
@@ -1,10 +1,11 @@
1
- import { FormBase } from '@internal/components/formBase.js';
2
- import type { FormFieldBaseProps } from '@internal/types/formField.js';
1
+ import { FormBase } from '../../internal/components/formBase.js';
2
+ import { PopoverController } from '../../internal/controllers/popover.controller.js';
3
+ import type { FormFieldBaseProps } from '../../internal/types/formField.js';
3
4
  import { type CSSResultGroup } from 'lit';
4
5
  import '../../internal/components/hint/hint';
5
6
  import type { SelectOptionEvent, SkfSelectOption } from '../select-option/select-option.component.js';
6
7
  import '../tag/tag';
7
- import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationController, ResizeController, ScrollController } from './select.controllers.js';
8
+ import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationController } from './select.controllers.js';
8
9
  /**
9
10
  * TODO: abstract the popover logic to a separate component/helper/partial, and use it in both select and in input[datalist], combobox etc
10
11
  *
@@ -84,25 +85,23 @@ export declare class SkfSelect extends FormBase {
84
85
  /** True if the internal state is invalid */
85
86
  private _invalid;
86
87
  /** @internal */
87
- private $selectBtn?;
88
+ $anchor: HTMLButtonElement;
88
89
  /** @internal */
89
90
  private $selectedValue?;
90
91
  /** @internal */
91
- private $dropdown?;
92
- /** @internal */
93
- protected scrollController: ScrollController;
94
- /** @internal */
95
- protected resizeController: ResizeController;
92
+ $popover: HTMLDivElement;
96
93
  /** @internal */
97
94
  protected globalClickController: GlobalClickController;
98
95
  /** @internal */
99
96
  protected keyboardNavController: KeyboardNavigationController;
100
97
  /** @internal */
101
98
  protected developerFeedbackController: DeveloperFeedbackController;
99
+ /** @internal */
100
+ protected popoverController: PopoverController;
102
101
  constructor();
103
102
  willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
104
103
  firstUpdated(): void;
105
- updated(changedProperties: Map<string, unknown>): void;
104
+ handleExpandedChange(): void;
106
105
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
107
106
  disconnectedCallback(): void;
108
107
  /** @internal */
@@ -119,8 +118,7 @@ export declare class SkfSelect extends FormBase {
119
118
  /** @internal */
120
119
  _updateWidth: () => void;
121
120
  /** @internal */
122
- /** this runs only from the 'updated' lifecycle, by setting source-of-truth _expanded=false */
123
- private _managePopover;
121
+ reposition: () => Promise<void>;
124
122
  /** @internal */
125
123
  _handleDropdownToggle: (e: Event) => void;
126
124
  /** @internal