@skf-design-system/ui-components 1.0.2-beta.4 → 1.0.2-beta.6

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 (71) hide show
  1. package/custom-elements.json +25490 -0
  2. package/dist/components/accordion/accordion.component.d.ts +1 -1
  3. package/dist/components/accordion/accordion.component.js +2 -2
  4. package/dist/components/datepicker/datepicker.component.js +1 -0
  5. package/dist/components/divider/divider.component.d.ts +3 -0
  6. package/dist/components/divider/divider.component.js +43 -22
  7. package/dist/components/divider/divider.styles.js +8 -8
  8. package/dist/components/drawer/drawer.component.d.ts +8 -2
  9. package/dist/components/drawer/drawer.component.js +74 -54
  10. package/dist/components/drawer/drawer.styles.js +47 -40
  11. package/dist/components/input/input.component.js +1 -0
  12. package/dist/components/link/link.component.d.ts +15 -18
  13. package/dist/components/link/link.component.js +99 -108
  14. package/dist/components/link/link.styles.js +45 -45
  15. package/dist/components/loader/loader.component.d.ts +5 -1
  16. package/dist/components/loader/loader.component.js +43 -29
  17. package/dist/components/loader/loader.styles.js +5 -9
  18. package/dist/components/menu/menu-item.component.d.ts +1 -1
  19. package/dist/components/menu/menu-item.component.js +8 -8
  20. package/dist/components/menu/menu-item.styles.js +8 -5
  21. package/dist/components/menu/menu.component.d.ts +1 -1
  22. package/dist/components/menu/menu.component.js +8 -8
  23. package/dist/components/nav/nav-item.component.d.ts +4 -0
  24. package/dist/components/nav/nav-item.component.js +44 -25
  25. package/dist/components/nav/nav-item.styles.js +29 -25
  26. package/dist/components/nav/nav.component.d.ts +6 -0
  27. package/dist/components/nav/nav.component.js +42 -21
  28. package/dist/components/nav/nav.styles.js +15 -9
  29. package/dist/components/popover/popover.component.d.ts +4 -0
  30. package/dist/components/popover/popover.component.js +30 -22
  31. package/dist/components/progress/progress.component.d.ts +2 -0
  32. package/dist/components/progress/progress.component.js +38 -29
  33. package/dist/components/progress/progress.styles.js +3 -3
  34. package/dist/components/select/select-option-group.component.d.ts +4 -0
  35. package/dist/components/select/select-option-group.component.js +37 -18
  36. package/dist/components/select/select-option-group.style.js +12 -6
  37. package/dist/components/select/select-option.component.d.ts +6 -1
  38. package/dist/components/select/select-option.component.js +73 -53
  39. package/dist/components/select/select-option.styles.js +43 -31
  40. package/dist/components/select/select.component.d.ts +5 -1
  41. package/dist/components/select/select.component.js +47 -29
  42. package/dist/components/select/select.controllers.js +2 -1
  43. package/dist/components/select/select.styles.js +8 -2
  44. package/dist/components/stepper/stepper-item.component.d.ts +1 -1
  45. package/dist/components/stepper/stepper-item.component.js +26 -23
  46. package/dist/components/tabs/tab-panel.component.d.ts +1 -1
  47. package/dist/components/tabs/tab-panel.component.js +19 -16
  48. package/dist/components/tabs/tab.component.d.ts +1 -1
  49. package/dist/components/tabs/tab.component.js +17 -14
  50. package/dist/components/textarea/textarea.component.js +5 -4
  51. package/dist/components/toast/toast-item.styles.js +13 -10
  52. package/dist/components/toast/toast.component.js +9 -9
  53. package/dist/components/toast/toast.singleton.d.ts +1 -1
  54. package/dist/components/toast/toast.singleton.js +18 -18
  55. package/dist/components/tooltip/tooltip.component.d.ts +1 -0
  56. package/dist/components/tooltip/tooltip.component.js +10 -7
  57. package/dist/custom-elements.json +803 -704
  58. package/dist/index.d.ts +2 -2
  59. package/dist/index.js +20 -20
  60. package/dist/internal/base-classes/popover/popover.base.d.ts +3 -3
  61. package/dist/internal/base-classes/popover/popover.base.js +27 -26
  62. package/dist/internal/base-classes/popover/popover.styles.js +4 -5
  63. package/dist/internal/components/hint/hint.component.d.ts +4 -0
  64. package/dist/internal/components/hint/hint.component.js +47 -20
  65. package/dist/internal/components/hint/hint.styles.js +29 -25
  66. package/dist/internal/types.d.ts +4 -0
  67. package/dist/types/jsx/custom-element-jsx.d.ts +184 -81
  68. package/dist/types/vue/index.d.ts +77 -80
  69. package/dist/vscode.html-custom-data.json +93 -97
  70. package/dist/web-types.json +210 -215
  71. package/package.json +28 -28
@@ -25,7 +25,7 @@ export declare class SkfAccordion extends SkfElement {
25
25
  /** If true, will truncate all headings in collapsed state */
26
26
  truncate: boolean;
27
27
  /** @internal */
28
- private $accordionItems;
28
+ private _accordionItems;
29
29
  protected updated(_changedProperties: PropertyValues): void;
30
30
  /** @internal */
31
31
  private get items();
@@ -22,7 +22,7 @@ const n = class n extends p {
22
22
  }
23
23
  /** @internal */
24
24
  get items() {
25
- return [...this.$accordionItems].filter((t) => t.localName === "skf-accordion-item");
25
+ return [...this._accordionItems].filter((t) => t.localName === "skf-accordion-item");
26
26
  }
27
27
  _onChildToggle(t) {
28
28
  if (this.multiple || t.defaultPrevented) return;
@@ -66,7 +66,7 @@ s([
66
66
  ], e.prototype, "truncate");
67
67
  s([
68
68
  d()
69
- ], e.prototype, "$accordionItems");
69
+ ], e.prototype, "_accordionItems");
70
70
  export {
71
71
  e as SkfAccordion
72
72
  };
@@ -344,6 +344,7 @@ const _ = class _ extends C {
344
344
  </label>
345
345
  ${this.hint && y`
346
346
  <skf-hint
347
+ ?disabled=${this.disabled}
347
348
  aria-live=${this.invalid ? "assertive" : "polite"}
348
349
  id="hint"
349
350
  severity=${u(O(this.invalid, this.severity))}
@@ -13,6 +13,7 @@ type SkfDividerColor = BorderColor;
13
13
  * @tagname skf-divider
14
14
  */
15
15
  export declare class SkfDivider extends SkfElement {
16
+ #private;
16
17
  static styles: CSSResultGroup;
17
18
  /** Defines the Divider color */
18
19
  color: SkfDividerColor;
@@ -21,5 +22,7 @@ export declare class SkfDivider extends SkfElement {
21
22
  /** If true, renders the divider vertically */
22
23
  vertical: boolean;
23
24
  connectedCallback(): void;
25
+ /** @internal */
26
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
24
27
  }
25
28
  export {};
@@ -1,32 +1,53 @@
1
- import { SkfElement as n } from "../../internal/components/skf-element.js";
2
- import { componentStyles as m } from "../../styles/component.styles.js";
1
+ var _ = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var d = (t, e, r) => e.has(t) || _("Cannot " + r);
5
+ var h = (t, e, r) => (d(t, e, "read from private field"), r ? r.call(t) : e.get(t)), m = (t, e, r) => e.has(t) ? _("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), y = (t, e, r, s) => (d(t, e, "write to private field"), s ? s.call(t, r) : e.set(t, r), r);
6
+ import { SkfElement as O } from "../../internal/components/skf-element.js";
7
+ import { stateMap as b } from "../../internal/helpers/stateMap.js";
8
+ import { watch as g } from "../../internal/helpers/watch.js";
9
+ import { componentStyles as C } from "../../styles/component.styles.js";
3
10
  import "lit";
4
- import { property as o } from "lit/decorators.js";
5
- import { styles as f } from "./divider.styles.js";
6
- var h = Object.defineProperty, a = (l, s, c, v) => {
7
- for (var t = void 0, r = l.length - 1, p; r >= 0; r--)
8
- (p = l[r]) && (t = p(s, c, t) || t);
9
- return t && h(s, c, t), t;
11
+ import { property as v } from "lit/decorators.js";
12
+ import { styles as P } from "./divider.styles.js";
13
+ var j = Object.defineProperty, w = Object.getOwnPropertyDescriptor, c = (t, e, r, s) => {
14
+ for (var o = s > 1 ? void 0 : s ? w(e, r) : e, l = t.length - 1, n; l >= 0; l--)
15
+ (n = t[l]) && (o = (s ? n(e, r, o) : n(o)) || o);
16
+ return s && o && j(e, r, o), o;
17
+ };
18
+ const u = {
19
+ color: ["emphasised", "inverse", "primary", "secondary", "tertiary"],
20
+ vertical: "vertical"
10
21
  };
11
- const i = class i extends n {
22
+ var i, p;
23
+ const f = class f extends O {
12
24
  constructor() {
13
- super(...arguments), this.color = "primary", this.decorative = !1, this.vertical = !1;
25
+ super(...arguments);
26
+ m(this, i);
27
+ m(this, p);
28
+ y(this, i, this.attachInternals()), y(this, p, h(this, i).states), this.color = "primary", this.decorative = !1, this.vertical = !1;
14
29
  }
15
30
  connectedCallback() {
16
31
  super.connectedCallback(), this.role = this.decorative ? "generic" : "separator", this.ariaOrientation = this.vertical ? "vertical" : "horizontal";
17
32
  }
33
+ _handleStateChange(r, s, o) {
34
+ b(h(this, p), u[r]).set(o);
35
+ }
18
36
  };
19
- i.styles = [m, f];
20
- let e = i;
21
- a([
22
- o({ reflect: !0 })
23
- ], e.prototype, "color");
24
- a([
25
- o({ type: Boolean })
26
- ], e.prototype, "decorative");
27
- a([
28
- o({ type: Boolean, reflect: !0 })
29
- ], e.prototype, "vertical");
37
+ i = new WeakMap(), p = new WeakMap(), f.styles = [C, P];
38
+ let a = f;
39
+ c([
40
+ v({ type: String })
41
+ ], a.prototype, "color", 2);
42
+ c([
43
+ v({ type: Boolean })
44
+ ], a.prototype, "decorative", 2);
45
+ c([
46
+ v({ type: Boolean })
47
+ ], a.prototype, "vertical", 2);
48
+ c([
49
+ g(Object.keys(u))
50
+ ], a.prototype, "_handleStateChange", 1);
30
51
  export {
31
- e as SkfDivider
52
+ a as SkfDivider
32
53
  };
@@ -1,5 +1,5 @@
1
1
  import { css as r } from "lit";
2
- const e = r`
2
+ const o = r`
3
3
  @layer components {
4
4
  @layer base {
5
5
  :host {
@@ -9,7 +9,7 @@ const e = r`
9
9
  display: block;
10
10
  }
11
11
 
12
- :host(:not([vertical])) {
12
+ :host(:not(:state(vertical))) {
13
13
  border-top: var(--_skf-divider-border);
14
14
  margin-block: var(--skf-divider-spacing, var(--skf-spacing-100));
15
15
  margin-inline: var(--skf-divider-inset, 0);
@@ -17,31 +17,31 @@ const e = r`
17
17
  }
18
18
 
19
19
  @layer mods {
20
- :host([vertical]) {
20
+ :host(:state(vertical)) {
21
21
  block-size: 100%;
22
22
  border-left: var(--_skf-divider-border);
23
23
  margin-block: var(--skf-divider-inset, 0);
24
24
  margin-inline: var(--skf-divider-spacing, var(--skf-spacing-100));
25
25
  }
26
26
 
27
- :host([color='emphasised']) {
27
+ :host(:state(emphasised)) {
28
28
  --_skf-divider-border-color: var(--skf-border-color-emphasised);
29
29
  }
30
30
 
31
- :host([color='inverse']) {
31
+ :host(:state(inverse)) {
32
32
  --_skf-divider-border-color: var(--skf-border-color-inverse);
33
33
  }
34
34
 
35
- :host([color='secondary']) {
35
+ :host(:state(secondary)) {
36
36
  --_skf-divider-border-color: var(--skf-border-color-secondary);
37
37
  }
38
38
 
39
- :host([color='tertiary']) {
39
+ :host(:state(tertiary)) {
40
40
  --_skf-divider-border-color: var(--skf-border-color-tertiary);
41
41
  }
42
42
  }
43
43
  }
44
44
  `;
45
45
  export {
46
- e as styles
46
+ o as styles
47
47
  };
@@ -8,6 +8,8 @@ import { type CSSResultGroup } from 'lit';
8
8
  * - add tests
9
9
  * - add documentation
10
10
  */
11
+ type Placement = 'left' | 'right';
12
+ type Size = 'sm' | 'md' | 'lg';
11
13
  /**
12
14
  * The `<skf-drawer>` is a modal component that displays content and toggle by sliding from left/right viewport edge
13
15
  *
@@ -22,6 +24,7 @@ import { type CSSResultGroup } from 'lit';
22
24
  * @tagname skf-drawer
23
25
  */
24
26
  export declare class SkfDrawer extends SkfElement {
27
+ #private;
25
28
  static styles: CSSResultGroup;
26
29
  /** @internal */
27
30
  private _abortController?;
@@ -32,15 +35,17 @@ export declare class SkfDrawer extends SkfElement {
32
35
  /** Heading for the Drawer */
33
36
  heading?: string;
34
37
  /** Sets the max-width */
35
- size: 'sm' | 'md' | 'lg';
38
+ size: Size;
36
39
  /** If true, Drawer is open */
37
40
  open: boolean;
38
41
  /** Placement of the Drawer */
39
- placement: 'left' | 'right';
42
+ placement: Placement;
40
43
  /** @internal */
41
44
  $dialog: HTMLDialogElement;
42
45
  disconnectedCallback(): void;
43
46
  /** @internal */
47
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
48
+ /** @internal */
44
49
  _placementChanged: () => void;
45
50
  /** @internal */
46
51
  _openChanged(): Promise<void>;
@@ -59,3 +64,4 @@ export declare class SkfDrawer extends SkfElement {
59
64
  close(): void;
60
65
  render(): import("lit").TemplateResult<1>;
61
66
  }
67
+ export {};
@@ -1,21 +1,35 @@
1
+ var _ = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var y = (e, i, t) => i.has(e) || _("Cannot " + t);
5
+ var d = (e, i, t) => (y(e, i, "read from private field"), t ? t.call(e) : i.get(e)), m = (e, i, t) => i.has(e) ? _("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), g = (e, i, t, o) => (y(e, i, "write to private field"), o ? o.call(e, t) : i.set(e, t), t);
1
6
  import "../icon/icon.js";
2
- import { SkfElement as m } from "../../internal/components/skf-element.js";
3
- import { watch as d } from "../../internal/helpers/watch.js";
4
- import { MOTION_DURATIONS as p } from "@skf-design-system/ui-assets";
5
- import { componentStyles as f } from "../../styles/component.styles.js";
6
- import { html as g } from "lit";
7
- import { property as r, query as u } from "lit/decorators.js";
8
- import { styles as _ } from "./drawer.styles.js";
9
- var b = Object.defineProperty, w = Object.getOwnPropertyDescriptor, a = (h, t, i, e) => {
10
- for (var o = e > 1 ? void 0 : e ? w(t, i) : t, n = h.length - 1, l; n >= 0; n--)
11
- (l = h[n]) && (o = (e ? l(t, i, o) : l(o)) || o);
12
- return e && o && b(t, i, o), o;
7
+ import { SkfElement as I } from "../../internal/components/skf-element.js";
8
+ import { stateMap as D } from "../../internal/helpers/stateMap.js";
9
+ import { watch as f } from "../../internal/helpers/watch.js";
10
+ import { MOTION_DURATIONS as b } from "@skf-design-system/ui-assets";
11
+ import { componentStyles as k } from "../../styles/component.styles.js";
12
+ import { html as C } from "lit";
13
+ import { property as p, query as $ } from "lit/decorators.js";
14
+ import { styles as E } from "./drawer.styles.js";
15
+ var A = Object.defineProperty, v = Object.getOwnPropertyDescriptor, n = (e, i, t, o) => {
16
+ for (var s = o > 1 ? void 0 : o ? v(i, t) : i, r = e.length - 1, l; r >= 0; r--)
17
+ (l = e[r]) && (s = (o ? l(i, t, s) : l(s)) || s);
18
+ return o && s && A(i, t, s), s;
19
+ };
20
+ const w = {
21
+ placement: ["left", "right"],
22
+ size: ["sm", "md", "lg"]
13
23
  };
14
- const c = class c extends m {
24
+ var h, c;
25
+ const u = class u extends I {
15
26
  constructor() {
16
- super(...arguments), this.closeButtonAriaLabel = "Close dialog", this.size = "md", this.open = !1, this.placement = "right", this._placementChanged = () => {
17
- this.$dialog.getAnimations().forEach((i) => {
18
- i.cancel();
27
+ super(...arguments);
28
+ m(this, h);
29
+ m(this, c);
30
+ g(this, h, this.attachInternals()), g(this, c, d(this, h).states), this.closeButtonAriaLabel = "Close dialog", this.size = "md", this.open = !1, this.placement = "right", this._placementChanged = () => {
31
+ this.$dialog.getAnimations().forEach((o) => {
32
+ o.cancel();
19
33
  });
20
34
  }, this._clickstartInDialog = !1, this._handleMouseDown = (t) => {
21
35
  this._clickIsInsideElement(t, this.$dialog) && (this._clickstartInDialog = !0);
@@ -30,6 +44,9 @@ const c = class c extends m {
30
44
  var t;
31
45
  super.disconnectedCallback(), (t = this._abortController) == null || t.abort();
32
46
  }
47
+ _handleStateChange(t, o, s) {
48
+ D(d(this, c), w[t]).set(s);
49
+ }
33
50
  async _openChanged() {
34
51
  var t;
35
52
  this.open ? (this._abortController = new AbortController(), this._signal = this._abortController.signal, this.$dialog.showModal(), this._startListeners(), await this._animateDrawer(), this.emit("skf-drawer-opened")) : ((t = this._abortController) == null || t.abort(), this.emit("skf-drawer-closing"), await this._animateDrawer(), this.emit("skf-drawer-closed"), this.$dialog.close());
@@ -47,26 +64,26 @@ const c = class c extends m {
47
64
  });
48
65
  }
49
66
  /** @internal */
50
- _clickIsInsideElement(t, i) {
51
- const e = i.getBoundingClientRect();
52
- return e.top <= t.clientY && t.clientY <= e.top + e.height && e.left <= t.clientX && t.clientX <= e.left + e.width;
67
+ _clickIsInsideElement(t, o) {
68
+ const s = o.getBoundingClientRect();
69
+ return s.top <= t.clientY && t.clientY <= s.top + s.height && s.left <= t.clientX && t.clientX <= s.left + s.width;
53
70
  }
54
71
  /** @internal */
55
72
  _animateDrawer() {
56
- const t = this.open ? [{ opacity: 0 }, { opacity: 0.4 }] : [{ opacity: 0 }], i = this.open ? [{ translate: "0" }] : [{ translate: this.placement === "right" ? "100%" : "-100%" }];
57
- return new Promise((e) => {
73
+ const t = this.open ? [{ opacity: 0 }, { opacity: 0.4 }] : [{ opacity: 0 }], o = this.open ? [{ translate: "0" }] : [{ translate: this.placement === "right" ? "100%" : "-100%" }];
74
+ return new Promise((s) => {
58
75
  requestAnimationFrame(() => {
59
- const o = this.$dialog.animate(t, {
60
- duration: p.normal,
76
+ const r = this.$dialog.animate(t, {
77
+ duration: b.normal,
61
78
  fill: "forwards",
62
79
  pseudoElement: "::backdrop"
63
- }), n = this.$dialog.animate(i, {
64
- duration: p.normal,
80
+ }), l = this.$dialog.animate(o, {
81
+ duration: b.normal,
65
82
  easing: "ease-out",
66
83
  fill: "forwards"
67
84
  });
68
- Promise.all([o.finished, n.finished]).then(() => {
69
- e("Animations finished");
85
+ Promise.all([r.finished, l.finished]).then(() => {
86
+ s("Animations finished");
70
87
  }).catch(() => {
71
88
  throw new Error("Animation failed");
72
89
  });
@@ -77,7 +94,7 @@ const c = class c extends m {
77
94
  this.open = !1;
78
95
  }
79
96
  render() {
80
- return g`
97
+ return C`
81
98
  <dialog @mousedown="${this._handleMouseDown}" @mouseup="${this._handleMouseUp}">
82
99
  <header>
83
100
  <h2>${this.heading}</h2>
@@ -94,32 +111,35 @@ const c = class c extends m {
94
111
  `;
95
112
  }
96
113
  };
97
- c.styles = [f, _];
98
- let s = c;
99
- a([
100
- r({ attribute: "close-button-aria-label" })
101
- ], s.prototype, "closeButtonAriaLabel", 2);
102
- a([
103
- r()
104
- ], s.prototype, "heading", 2);
105
- a([
106
- r({ reflect: !0 })
107
- ], s.prototype, "size", 2);
108
- a([
109
- r({ type: Boolean, reflect: !0 })
110
- ], s.prototype, "open", 2);
111
- a([
112
- r({ reflect: !0 })
113
- ], s.prototype, "placement", 2);
114
- a([
115
- u("dialog")
116
- ], s.prototype, "$dialog", 2);
117
- a([
118
- d("placement", { waitUntilFirstUpdate: !0 })
119
- ], s.prototype, "_placementChanged", 2);
120
- a([
121
- d("open", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
122
- ], s.prototype, "_openChanged", 1);
114
+ h = new WeakMap(), c = new WeakMap(), u.styles = [k, E];
115
+ let a = u;
116
+ n([
117
+ p({ type: String, attribute: "close-button-aria-label" })
118
+ ], a.prototype, "closeButtonAriaLabel", 2);
119
+ n([
120
+ p({ type: String })
121
+ ], a.prototype, "heading", 2);
122
+ n([
123
+ p({ type: String })
124
+ ], a.prototype, "size", 2);
125
+ n([
126
+ p({ type: Boolean, reflect: !0, useDefault: !0 })
127
+ ], a.prototype, "open", 2);
128
+ n([
129
+ p({ type: String })
130
+ ], a.prototype, "placement", 2);
131
+ n([
132
+ $("dialog")
133
+ ], a.prototype, "$dialog", 2);
134
+ n([
135
+ f(Object.keys(w))
136
+ ], a.prototype, "_handleStateChange", 1);
137
+ n([
138
+ f("placement", { waitUntilFirstUpdate: !0 })
139
+ ], a.prototype, "_placementChanged", 2);
140
+ n([
141
+ f("open", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
142
+ ], a.prototype, "_openChanged", 1);
123
143
  export {
124
- s as SkfDrawer
144
+ a as SkfDrawer
125
145
  };
@@ -1,19 +1,20 @@
1
1
  import { css as e } from "lit";
2
2
  const o = e`
3
3
  @layer components {
4
- dialog {
5
- all: unset;
6
- background-color: var(--skf-bg-color-neutral-1);
7
- display: none;
8
- flex-direction: column;
9
- inline-size: min(100%, var(--_skf-drawer-size, 540px));
10
- inset-block: 0;
11
- inset-inline: var(--_skf-drawer-inset, auto 0);
12
- position: fixed;
13
- translate: 100% 0;
4
+ @layer base {
5
+ dialog {
6
+ --_skf-drawer-inset: auto 0;
7
+ --_skf-drawer-size: 540px;
14
8
 
15
- &[open] {
16
- display: flex;
9
+ all: unset;
10
+ background-color: var(--skf-bg-color-neutral-1);
11
+ display: none;
12
+ flex-direction: column;
13
+ inline-size: min(100%, var(--_skf-drawer-size));
14
+ inset-block: 0;
15
+ inset-inline: var(--_skf-drawer-inset);
16
+ position: fixed;
17
+ translate: 100% 0;
17
18
 
18
19
  &::backdrop {
19
20
  background-color: var(--skf-bg-color-neutral-7);
@@ -21,48 +22,54 @@ const o = e`
21
22
  }
22
23
  }
23
24
 
24
- :host([placement='left']) & {
25
- --_skf-drawer-inset: 0 auto;
25
+ header {
26
+ align-items: center;
27
+ background-color: var(--skf-bg-color-emphasised);
28
+ block-size: var(--skf-size-48);
29
+ color: var(--skf-text-color-inverse);
30
+ display: flex;
31
+ justify-content: space-between;
32
+ padding-inline: var(--skf-box-spacing);
33
+ }
26
34
 
27
- translate: -100% 0;
35
+ h2 {
36
+ font-size: var(--skf-font-size-200);
28
37
  }
29
38
 
30
- :host([size='sm']) & {
31
- --_skf-drawer-size: 400px;
39
+ #close-button {
40
+ display: inline-flex;
32
41
  }
33
42
 
34
- :host([size='lg']) & {
35
- --_skf-drawer-size: 680px;
43
+ #body {
44
+ display: block;
45
+ flex: auto;
46
+ padding: var(--skf-box-spacing);
36
47
  }
37
48
  }
38
49
 
39
- header {
40
- align-items: center;
41
- background-color: var(--skf-bg-color-emphasised);
42
- block-size: var(--skf-size-48);
43
- color: var(--skf-text-color-inverse);
44
- display: flex;
45
- justify-content: space-between;
46
- padding-inline: var(--skf-box-spacing);
50
+ @layer states {
51
+ #close-button:focus-visible {
52
+ border-radius: var(--skf-border-radius-sm);
53
+ outline: var(--skf-border-width-sm) solid var(--skf-interactive-text-color-inverse);
54
+ }
47
55
  }
48
56
 
49
- h2 {
50
- font-size: var(--skf-font-size-200);
51
- }
57
+ @layer mods {
58
+ dialog[open] {
59
+ display: flex;
60
+ }
52
61
 
53
- #close-button {
54
- display: inline-flex;
62
+ :host(:state(left)) dialog {
63
+ --_skf-drawer-inset: 0 auto;
64
+ }
55
65
 
56
- &:focus-visible {
57
- border-radius: var(--skf-border-radius-sm);
58
- outline: var(--skf-border-width-sm) solid var(--skf-interactive-text-color-inverse);
66
+ :host(:state(sm)) dialog {
67
+ --_skf-drawer-size: 400px;
59
68
  }
60
- }
61
69
 
62
- #body {
63
- display: block;
64
- flex: auto;
65
- padding: var(--skf-box-spacing);
70
+ :host(:state(lg)) dialog {
71
+ --_skf-drawer-size: 680px;
72
+ }
66
73
  }
67
74
  }
68
75
  `;
@@ -191,6 +191,7 @@ const m = class m extends c {
191
191
  </label>
192
192
  ${this.hint && h`
193
193
  <skf-hint
194
+ ?disabled=${this.disabled}
194
195
  aria-live=${this.invalid ? "assertive" : "polite"}
195
196
  id="hint"
196
197
  severity=${n(b(this.invalid, this.severity))}
@@ -2,54 +2,51 @@ import '../icon/icon.js';
2
2
  import { SkfElement } from '../../internal/components/skf-element.js';
3
3
  import type { Icon } from '../../internal/types.js';
4
4
  import { type CSSResultGroup } from 'lit';
5
- type SkfLinkType = HTMLButtonElement['type'];
5
+ type Color = 'primary' | 'inverse';
6
6
  /**
7
- * The `<skf-link>` can be used as either a regular link or a link styled semantic button
7
+ * The `<skf-link>` can be used as either a regular link or a semantic button. The button variant is
8
+ * intended to be used for triggering javascript functions, not handling forms.
8
9
  *
9
10
  * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
10
11
  *
12
+ * @event {CustomEvent} skf-link-click - Fired when the link is clicked
13
+ *
11
14
  * @slot - The links' main content
12
15
  *
13
16
  * @tagname skf-link
14
17
  */
15
18
  export declare class SkfLink extends SkfElement {
19
+ #private;
16
20
  static styles: CSSResultGroup;
17
- static classMap: {};
18
- /** @internal */
19
- private _onClick?;
20
21
  /** Defines the semantic element to render */
21
- as: 'button' | 'a';
22
+ as: 'button' | 'link';
22
23
  /** Defines the text-color */
23
- color: 'primary' | 'inverse';
24
+ color: Color;
24
25
  /** If true, disables the link */
25
26
  disabled: boolean;
26
27
  /** If defined, downloads the url */
27
- download?: string;
28
+ download: boolean;
28
29
  /** If defined, loads url on click */
29
30
  href?: string;
30
31
  /** If defined, renders an icon before or after the text */
31
32
  icon?: Icon;
32
- /** Defines the position of the icon in relation to the text */
33
- iconPlacement: 'left' | 'right';
34
- /** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
35
- set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
36
- get onClick(): ((event: Event, route?: string) => void) | undefined;
33
+ /** If true, the icon is placed to the right in relation to the text */
34
+ iconRight: boolean;
37
35
  /** If defined, describes the relationship between a linked resource and the current document */
38
36
  rel?: string;
39
- /** If defined, used on conjunction with onClick property, second argument */
37
+ /** If defined, used on conjunction with onClick property. **Notice!** Only applicable to as=button. */
40
38
  route?: string;
41
39
  /** If true, fills the parents horizontal axis */
42
40
  stretch: boolean;
43
41
  /** If defined, specifies where to open the linked document */
44
42
  target?: '_blank' | '_parent' | '_self' | '_top';
45
- /** Defines the type of button */
46
- type: SkfLinkType;
47
43
  connectedCallback(): void;
44
+ _handleAsChange(): void;
48
45
  /** @internal */
49
- private _assertValidOnClick;
46
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
50
47
  /** @internal */
51
48
  /** retargets click event to host */
52
- private _preprocessOnClick;
49
+ private _handleClick;
53
50
  /** @internal */
54
51
  private _renderIcon;
55
52
  render(): import("lit").TemplateResult;