@skf-design-system/ui-components 1.0.0-alpha.38 → 1.0.0-alpha.39

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 (117) hide show
  1. package/README.md +18 -0
  2. package/dist/components/alert/alert.component.d.ts +3 -2
  3. package/dist/components/alert/alert.component.js +39 -33
  4. package/dist/components/breadcrumb/breadcrumb-item.component.js +11 -12
  5. package/dist/components/button/button.component.js +32 -36
  6. package/dist/components/button/button.styles.js +3 -3
  7. package/dist/components/checkbox/checkbox.component.d.ts +6 -5
  8. package/dist/components/checkbox/checkbox.component.js +67 -69
  9. package/dist/components/checkbox/checkbox.styles.js +1 -1
  10. package/dist/components/datepicker/datepicker-calendar.component.d.ts +1 -0
  11. package/dist/components/datepicker/datepicker-calendar.component.js +107 -116
  12. package/dist/components/datepicker/datepicker-popup.component.d.ts +4 -0
  13. package/dist/components/datepicker/datepicker-popup.component.js +112 -100
  14. package/dist/components/datepicker/datepicker-popup.helpers.js +1 -1
  15. package/dist/components/datepicker/datepicker.component.d.ts +4 -2
  16. package/dist/components/datepicker/datepicker.component.js +159 -160
  17. package/dist/components/dialog/dialog.component.d.ts +3 -2
  18. package/dist/components/dialog/dialog.component.js +48 -48
  19. package/dist/components/divider/divider.component.d.ts +3 -0
  20. package/dist/components/divider/divider.component.js +43 -22
  21. package/dist/components/divider/divider.styles.js +9 -9
  22. package/dist/components/drawer/drawer.component.d.ts +12 -4
  23. package/dist/components/drawer/drawer.component.js +84 -61
  24. package/dist/components/drawer/drawer.styles.js +47 -40
  25. package/dist/components/header/header.component.d.ts +4 -2
  26. package/dist/components/header/header.component.js +64 -57
  27. package/dist/components/header/header.styles.js +2 -2
  28. package/dist/components/icon/icon.component.js +26 -16
  29. package/dist/components/icon/icon.styles.js +4 -4
  30. package/dist/components/input/input.component.d.ts +11 -10
  31. package/dist/components/input/input.component.js +115 -111
  32. package/dist/components/input/input.controllers.d.ts +0 -1
  33. package/dist/components/input/input.controllers.js +14 -19
  34. package/dist/components/link/link.component.d.ts +1 -0
  35. package/dist/components/link/link.component.js +86 -74
  36. package/dist/components/link/link.styles.js +7 -3
  37. package/dist/components/loader/loader.component.d.ts +0 -2
  38. package/dist/components/loader/loader.component.js +27 -30
  39. package/dist/components/loader/loader.styles.js +1 -1
  40. package/dist/components/menu/menu-item.styles.js +8 -7
  41. package/dist/components/menu/menu.component.d.ts +5 -2
  42. package/dist/components/menu/menu.component.js +7 -7
  43. package/dist/components/nav/nav.component.d.ts +3 -0
  44. package/dist/components/nav/nav.component.js +38 -33
  45. package/dist/components/popover/popover.component.d.ts +6 -7
  46. package/dist/components/popover/popover.component.js +23 -31
  47. package/dist/components/progress/progress.styles.js +3 -3
  48. package/dist/components/radio/radio.component.d.ts +4 -2
  49. package/dist/components/radio/radio.component.js +96 -91
  50. package/dist/components/radio/radio.styles.js +1 -1
  51. package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
  52. package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
  53. package/dist/components/segmented-button/segmented-button.component.js +22 -24
  54. package/dist/components/select/select-option.component.d.ts +2 -1
  55. package/dist/components/select/select-option.component.js +31 -36
  56. package/dist/components/select/select.component.d.ts +20 -10
  57. package/dist/components/select/select.component.js +139 -104
  58. package/dist/components/select/select.controllers.js +14 -17
  59. package/dist/components/select/select.styles.js +8 -3
  60. package/dist/components/stepper/stepper-item.component.d.ts +1 -1
  61. package/dist/components/stepper/stepper-item.component.js +26 -23
  62. package/dist/components/stepper/stepper-item.styles.js +4 -4
  63. package/dist/components/stepper/stepper.component.js +2 -3
  64. package/dist/components/stepper/stepper.helpers.js +6 -7
  65. package/dist/components/switch/switch.component.d.ts +4 -2
  66. package/dist/components/switch/switch.component.js +64 -58
  67. package/dist/components/switch/switch.styles.js +1 -1
  68. package/dist/components/tabs/tab-panel.component.d.ts +1 -1
  69. package/dist/components/tabs/tab-panel.component.js +19 -16
  70. package/dist/components/tabs/tab.component.d.ts +1 -1
  71. package/dist/components/tabs/tab.component.js +17 -14
  72. package/dist/components/tabs/tab.styles.js +2 -2
  73. package/dist/components/tabs/tabs.component.js +6 -6
  74. package/dist/components/tag/tag.component.d.ts +9 -6
  75. package/dist/components/tag/tag.component.js +78 -72
  76. package/dist/components/tag/tag.styles.js +5 -0
  77. package/dist/components/textarea/textarea.component.d.ts +4 -2
  78. package/dist/components/textarea/textarea.component.js +101 -95
  79. package/dist/components/toast/toast-item.styles.js +13 -10
  80. package/dist/components/toast/toast.singleton.js +6 -7
  81. package/dist/components/tooltip/tooltip.component.d.ts +7 -4
  82. package/dist/components/tooltip/tooltip.component.js +22 -14
  83. package/dist/custom-elements.json +835 -422
  84. package/dist/index.d.ts +2 -2
  85. package/dist/index.js +20 -20
  86. package/dist/internal/base-classes/popover/popover.base.d.ts +28 -8
  87. package/dist/internal/base-classes/popover/popover.base.js +78 -74
  88. package/dist/internal/components/formBase.d.ts +1 -0
  89. package/dist/internal/components/formBase.js +11 -19
  90. package/dist/internal/controllers/popover.controller.d.ts +2 -0
  91. package/dist/internal/controllers/popover.controller.js +11 -14
  92. package/dist/internal/helpers/stateMap.js +3 -3
  93. package/dist/internal/helpers/uuid.d.ts +8 -10
  94. package/dist/internal/helpers/uuid.js +4 -11
  95. package/dist/internal/helpers/watch.d.ts +1 -1
  96. package/dist/internal/templates/asterisk.d.ts +1 -1
  97. package/dist/internal/templates/asterisk.js +4 -4
  98. package/dist/internal/types.d.ts +4 -0
  99. package/dist/styles/global-alt.css +1 -1
  100. package/dist/styles/global.css +1 -1
  101. package/dist/translations/en.d.ts +3 -0
  102. package/dist/translations/en.js +27 -0
  103. package/dist/translations/es.d.ts +3 -0
  104. package/dist/translations/es.js +27 -0
  105. package/dist/translations/index.d.ts +4 -0
  106. package/dist/translations/pt.d.ts +3 -0
  107. package/dist/translations/pt.js +27 -0
  108. package/dist/translations/sv.d.ts +3 -0
  109. package/dist/translations/sv.js +27 -0
  110. package/dist/types/jsx/custom-element-jsx.d.ts +1840 -858
  111. package/dist/types/vue/index.d.ts +69 -64
  112. package/dist/utilities/localize.d.ts +28 -0
  113. package/dist/utilities/localize.js +13 -0
  114. package/dist/vscode.html-custom-data.json +75 -83
  115. package/dist/web-types.json +229 -190
  116. package/package.json +29 -35
  117. package/custom-elements.json +0 -25490
@@ -1,114 +1,126 @@
1
- var u = (e) => {
1
+ var g = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
- var b = (e, i, t) => i.has(e) || u("Cannot " + t);
5
- var d = (e, i, t) => (b(e, i, "read from private field"), t ? t.call(e) : i.get(e)), f = (e, i, t) => i.has(e) ? u("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), y = (e, i, t, o) => (b(e, i, "write to private field"), o ? o.call(e, t) : i.set(e, t), t);
4
+ var _ = (e, i, t) => i.has(e) || g("Cannot " + t);
5
+ var c = (e, i, t) => (_(e, i, "read from private field"), t ? t.call(e) : i.get(e)), f = (e, i, t) => i.has(e) ? g("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), y = (e, i, t, h) => (_(e, i, "write to private field"), h ? h.call(e, t) : i.set(e, t), t);
6
6
  import "../icon/icon.js";
7
- import { SkfElement as C } from "../../internal/components/skf-element.js";
7
+ import { SkfElement as w } from "../../internal/components/skf-element.js";
8
8
  import { stateMap as k } from "../../internal/helpers/stateMap.js";
9
- import { watch as v } from "../../internal/helpers/watch.js";
9
+ import { watch as b } from "../../internal/helpers/watch.js";
10
10
  import { componentStyles as S } from "../../styles/component.styles.js";
11
- import { nothing as g } from "lit";
12
- import { property as n } from "lit/decorators.js";
13
- import { ifDefined as x } from "lit/directives/if-defined.js";
14
- import { html as _ } from "lit/static-html.js";
15
- import { styles as A } from "./link.styles.js";
16
- var D = Object.defineProperty, E = Object.getOwnPropertyDescriptor, s = (e, i, t, o) => {
17
- for (var h = o > 1 ? void 0 : o ? E(i, t) : i, p = e.length - 1, c; p >= 0; p--)
18
- (c = e[p]) && (h = (o ? c(i, t, h) : c(h)) || h);
19
- return o && h && D(i, t, h), h;
11
+ import { nothing as m } from "lit";
12
+ import { property as s } from "lit/decorators.js";
13
+ import { ifDefined as D } from "lit/directives/if-defined.js";
14
+ import { html as v } from "lit/static-html.js";
15
+ import { styles as x } from "./link.styles.js";
16
+ var A = Object.defineProperty, E = Object.getOwnPropertyDescriptor, r = (e, i, t, h) => {
17
+ for (var n = h > 1 ? void 0 : h ? E(i, t) : i, p = e.length - 1, d; p >= 0; p--)
18
+ (d = e[p]) && (n = (h ? d(i, t, n) : d(n)) || n);
19
+ return h && n && A(i, t, n), n;
20
20
  };
21
- const w = {
21
+ const C = {
22
22
  color: ["inverse", "primary"],
23
23
  stretch: "stretch"
24
24
  };
25
25
  var a, l;
26
- const m = class m extends C {
26
+ const u = class u extends w {
27
27
  constructor() {
28
28
  super(...arguments);
29
29
  f(this, a);
30
30
  f(this, l);
31
- y(this, a, this.attachInternals()), y(this, l, d(this, a).states), this.as = "link", this.color = "primary", this.disabled = !1, this.download = !1, this.iconRight = !1, this.stretch = !1, this._handleClick = () => {
32
- var t;
33
- if (!(this.as === "button" && this.disabled) && (this.emit("skf-link-click", { detail: { href: this.href, route: this.route } }), this.as === "link" && !this.route && ((t = this.href) != null && t.trim())))
31
+ y(this, a, this.attachInternals()), y(this, l, c(this, a).states), this.as = "link", this.color = "primary", this.disabled = !1, this.download = !1, this.iconRight = !1, this.stretch = !1, this._handleClick = () => {
32
+ if (!(this.as === "button" && this.disabled) && (this.emit("skf-link-click", { detail: { href: this.href, route: this.route } }), this.as === "link" && !this.route && this.href?.trim()))
34
33
  if (this.target)
35
34
  window.open(this.href, this.target);
36
35
  else if (this.download) {
37
- const o = document.createElement("a");
38
- o.href = this.href, o.download = this.href, document.body.appendChild(o), o.click(), document.body.removeChild(o);
36
+ const t = document.createElement("a");
37
+ t.href = this.href, t.download = this.href, document.body.appendChild(t), t.click(), document.body.removeChild(t);
39
38
  } else
40
39
  window.location.href = this.href;
41
40
  };
42
41
  }
43
42
  connectedCallback() {
44
- super.connectedCallback(), this.ariaDisabled = this.as === "button" && this.disabled ? "true" : null, this.role = this.as;
45
- const t = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : 0;
46
- this.ariaDisabled !== "true" && (this.tabIndex = t), this.addEventListener("keydown", (o) => {
47
- (o.key === "Enter" || o.key === " ") && this._handleClick();
43
+ super.connectedCallback(), this.role = this.as, this.addEventListener("keydown", (t) => {
44
+ (t.key === "Enter" || t.key === " ") && this._handleClick();
48
45
  }), this.addEventListener("click", this._handleClick);
49
46
  }
50
47
  _handleAsChange() {
51
48
  this.as === "button" ? this.setAttribute("type", "button") : this.removeAttribute("type");
52
49
  }
53
- _handleStateChange(t, o, h) {
54
- k(d(this, l), w[t]).set(h);
50
+ _handleDisabledChange() {
51
+ this.ariaDisabled = this.as === "button" && this.disabled ? "true" : null;
52
+ const t = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : 0;
53
+ this.ariaDisabled !== "true" && (this.tabIndex = t);
54
+ }
55
+ _handleStateChange(t, h, n) {
56
+ k(c(this, l), C[t]).set(n);
55
57
  }
56
58
  /** @internal */
57
59
  _renderIcon() {
58
- const t = this.color === "inverse" ? "inverse" : "emphasised";
59
- return _`<skf-icon color=${t} name=${x(this.icon)} size="sm"></skf-icon>`;
60
+ const t = this.color === "inverse" ? "inverse" : "emphasized";
61
+ return v`
62
+ <skf-icon
63
+ color=${t}
64
+ data-color=${this.disabled ? "custom" : m}
65
+ name=${D(this.icon)}
66
+ size="sm"
67
+ ></skf-icon>
68
+ `;
60
69
  }
61
70
  render() {
62
- return _`
71
+ return v`
63
72
  <div id="root" part="root">
64
- ${this.icon && !this.iconRight ? this._renderIcon() : g}
73
+ ${this.icon && !this.iconRight ? this._renderIcon() : m}
65
74
  <slot></slot>
66
- ${this.icon && this.iconRight ? this._renderIcon() : g}
75
+ ${this.icon && this.iconRight ? this._renderIcon() : m}
67
76
  </div>
68
77
  `;
69
78
  }
70
79
  };
71
- a = new WeakMap(), l = new WeakMap(), m.styles = [S, A];
72
- let r = m;
73
- s([
74
- n({ type: String })
75
- ], r.prototype, "as", 2);
76
- s([
77
- n({ type: String })
78
- ], r.prototype, "color", 2);
79
- s([
80
- n({ type: Boolean })
81
- ], r.prototype, "disabled", 2);
82
- s([
83
- n({ type: Boolean })
84
- ], r.prototype, "download", 2);
85
- s([
86
- n({ type: String })
87
- ], r.prototype, "href", 2);
88
- s([
89
- n({ type: String })
90
- ], r.prototype, "icon", 2);
91
- s([
92
- n({ type: Boolean, attribute: "icon-right" })
93
- ], r.prototype, "iconRight", 2);
94
- s([
95
- n({ type: String })
96
- ], r.prototype, "rel", 2);
97
- s([
98
- n({ type: String })
99
- ], r.prototype, "route", 2);
100
- s([
101
- n({ type: Boolean })
102
- ], r.prototype, "stretch", 2);
103
- s([
104
- n({ type: String })
105
- ], r.prototype, "target", 2);
106
- s([
107
- v("as")
108
- ], r.prototype, "_handleAsChange", 1);
109
- s([
110
- v(Object.keys(w))
111
- ], r.prototype, "_handleStateChange", 1);
80
+ a = new WeakMap(), l = new WeakMap(), u.styles = [S, x];
81
+ let o = u;
82
+ r([
83
+ s({ type: String })
84
+ ], o.prototype, "as", 2);
85
+ r([
86
+ s({ type: String })
87
+ ], o.prototype, "color", 2);
88
+ r([
89
+ s({ type: Boolean })
90
+ ], o.prototype, "disabled", 2);
91
+ r([
92
+ s({ type: Boolean })
93
+ ], o.prototype, "download", 2);
94
+ r([
95
+ s({ type: String })
96
+ ], o.prototype, "href", 2);
97
+ r([
98
+ s({ type: String })
99
+ ], o.prototype, "icon", 2);
100
+ r([
101
+ s({ type: Boolean, attribute: "icon-right" })
102
+ ], o.prototype, "iconRight", 2);
103
+ r([
104
+ s({ type: String })
105
+ ], o.prototype, "rel", 2);
106
+ r([
107
+ s({ type: String })
108
+ ], o.prototype, "route", 2);
109
+ r([
110
+ s({ type: Boolean })
111
+ ], o.prototype, "stretch", 2);
112
+ r([
113
+ s({ type: String })
114
+ ], o.prototype, "target", 2);
115
+ r([
116
+ b("as")
117
+ ], o.prototype, "_handleAsChange", 1);
118
+ r([
119
+ b("disabled")
120
+ ], o.prototype, "_handleDisabledChange", 1);
121
+ r([
122
+ b(Object.keys(C))
123
+ ], o.prototype, "_handleStateChange", 1);
112
124
  export {
113
- r as SkfLink
125
+ o as SkfLink
114
126
  };
@@ -35,11 +35,15 @@ const e = o`
35
35
  }
36
36
  }
37
37
 
38
- :host(:disabled) #root {
39
- --_skf-link-color: var(--_skf-link-color-disabled);
38
+ :host([aria-disabled]) {
39
+ #root {
40
+ --_skf-link-color: var(--_skf-link-color-disabled);
41
+
42
+ cursor: not-allowed;
43
+ }
40
44
  }
41
45
 
42
- :host(:hover) #root {
46
+ :host(:not([aria-disabled]):hover) #root {
43
47
  --_skf-link-color: var(--_skf-link-color-hover);
44
48
  }
45
49
  }
@@ -11,8 +11,6 @@ type Size = 'md' | 'sm';
11
11
  export declare class SkfLoader extends SkfElement {
12
12
  #private;
13
13
  static styles: CSSResultGroup;
14
- /** Defines the aria-label */
15
- ariaLabel: string;
16
14
  /** If true, inverts the color (to be used on colored backgrounds) */
17
15
  invert: boolean;
18
16
  /** Defines the size of the loader */
@@ -1,37 +1,37 @@
1
- var y = (t) => {
1
+ var f = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var b = (t, e, r) => e.has(t) || y("Cannot " + r);
5
- var m = (t, e, r) => (b(t, e, "read from private field"), r ? r.call(t) : e.get(t)), v = (t, e, r) => e.has(t) ? y("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), h = (t, e, r, i) => (b(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
6
- import { SkfElement as _ } from "../../internal/components/skf-element.js";
4
+ var y = (t, e, r) => e.has(t) || f("Cannot " + r);
5
+ var c = (t, e, r) => (y(t, e, "read from private field"), r ? r.call(t) : e.get(t)), m = (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), v = (t, e, r, i) => (y(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
6
+ import { SkfElement as b } from "../../internal/components/skf-element.js";
7
7
  import { stateMap as g } from "../../internal/helpers/stateMap.js";
8
8
  import { watch as C } from "../../internal/helpers/watch.js";
9
9
  import { componentStyles as O } from "../../styles/component.styles.js";
10
10
  import { html as P } from "lit";
11
- import { property as d } from "lit/decorators.js";
12
- import { styles as S } from "./loader.styles.js";
13
- var j = Object.defineProperty, w = Object.getOwnPropertyDescriptor, l = (t, e, r, i) => {
14
- for (var s = i > 1 ? void 0 : i ? w(e, r) : e, n = t.length - 1, c; n >= 0; n--)
15
- (c = t[n]) && (s = (i ? c(e, r, s) : c(s)) || s);
16
- return i && s && j(e, r, s), s;
11
+ import { property as _ } from "lit/decorators.js";
12
+ import { styles as j } from "./loader.styles.js";
13
+ var w = Object.defineProperty, z = Object.getOwnPropertyDescriptor, h = (t, e, r, i) => {
14
+ for (var s = i > 1 ? void 0 : i ? z(e, r) : e, n = t.length - 1, l; n >= 0; n--)
15
+ (l = t[n]) && (s = (i ? l(e, r, s) : l(s)) || s);
16
+ return i && s && w(e, r, s), s;
17
17
  };
18
18
  const u = {
19
19
  invert: "invert",
20
20
  size: ["md", "sm"]
21
21
  };
22
- var o, p;
23
- const f = class f extends _ {
22
+ var a, p;
23
+ const d = class d extends b {
24
24
  constructor() {
25
25
  super(...arguments);
26
- v(this, o);
27
- v(this, p);
28
- h(this, o, this.attachInternals()), h(this, p, m(this, o).states), this.ariaLabel = "Loading...", this.invert = !1, this.size = "md";
26
+ m(this, a);
27
+ m(this, p);
28
+ v(this, a, this.attachInternals()), v(this, p, c(this, a).states), this.invert = !1, this.size = "md";
29
29
  }
30
30
  connectedCallback() {
31
31
  super.connectedCallback(), this.role = "progressbar", this.ariaLive = "polite";
32
32
  }
33
33
  _handleStateChange(r, i, s) {
34
- g(m(this, p), u[r]).set(s);
34
+ g(c(this, p), u[r]).set(s);
35
35
  }
36
36
  render() {
37
37
  return P`
@@ -43,20 +43,17 @@ const f = class f extends _ {
43
43
  `;
44
44
  }
45
45
  };
46
- o = new WeakMap(), p = new WeakMap(), f.styles = [O, S];
47
- let a = f;
48
- l([
49
- d({ type: String, attribute: "aria-label" })
50
- ], a.prototype, "ariaLabel", 2);
51
- l([
52
- d({ type: Boolean })
53
- ], a.prototype, "invert", 2);
54
- l([
55
- d({ type: String })
56
- ], a.prototype, "size", 2);
57
- l([
46
+ a = new WeakMap(), p = new WeakMap(), d.styles = [O, j];
47
+ let o = d;
48
+ h([
49
+ _({ type: Boolean })
50
+ ], o.prototype, "invert", 2);
51
+ h([
52
+ _({ type: String })
53
+ ], o.prototype, "size", 2);
54
+ h([
58
55
  C(Object.keys(u))
59
- ], a.prototype, "_handleStateChange", 1);
56
+ ], o.prototype, "_handleStateChange", 1);
60
57
  export {
61
- a as SkfLoader
58
+ o as SkfLoader
62
59
  };
@@ -7,7 +7,7 @@ const o = a`
7
7
  }
8
8
 
9
9
  #root {
10
- --_skf-loader-color: var(--skf-bg-color-emphasised);
10
+ --_skf-loader-color: var(--skf-bg-color-emphasized);
11
11
  --_skf-loader-gap: var(--skf-spacing-50);
12
12
  --_skf-loader-size: var(--skf-size-12);
13
13
 
@@ -1,5 +1,5 @@
1
1
  import { css as o } from "lit";
2
- const e = o`
2
+ const r = o`
3
3
  @layer components {
4
4
  :host {
5
5
  display: block;
@@ -7,16 +7,17 @@ const e = o`
7
7
 
8
8
  #root {
9
9
  block-size: var(--skf-size-44);
10
+ display: flex;
10
11
  padding-inline: var(--skf-spacing-75);
12
+ }
13
+ }
11
14
 
12
- @media screen and (any-hover: hover) {
13
- &:hover {
14
- background-color: var(--skf-color-blue-lighest);
15
- }
16
- }
15
+ @layer states {
16
+ :host(:not([aria-disabled]):hover) #root {
17
+ background-color: var(--skf-color-blue-lightest);
17
18
  }
18
19
  }
19
20
  `;
20
21
  export {
21
- e as styles
22
+ r as styles
22
23
  };
@@ -11,16 +11,19 @@ import type { CSSResultGroup } from 'lit';
11
11
  * @attribute {"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"} [placement='bottom-start'] - The placement of the menu
12
12
  * @attribute {string} anchor - The id of the element the menu will be anchored to
13
13
  *
14
+ * @property {(void) => void} open() - Method that opens the menu
15
+ * @property {(void) => void} close() - Method that closes the menu
16
+ *
14
17
  * @event {CustomEvent} skf-opened - Fired when the menu is opened
15
18
  * @event {CustomEvent} skf-closed - Fired when the menu is closed
16
19
  *
17
- * @slot - The menu popover content
20
+ * @slot - The menu content
18
21
  *
19
22
  * @tagname skf-menu
20
23
  */
21
24
  export declare class SkfMenu extends SkfPopoverBase {
22
25
  static styles: CSSResultGroup;
23
- constructor();
26
+ connectedCallback(): void;
24
27
  /** @internal */
25
28
  addEventListeners($element: HTMLElement | Element): void;
26
29
  }
@@ -1,16 +1,16 @@
1
1
  import { SkfPopoverBase as t } from "../../internal/base-classes/popover/popover.base.js";
2
- import { styles as r } from "./menu.styles.js";
3
- const s = class s extends t {
4
- constructor() {
5
- super(), this.placement = "bottom-start", this.role = "menu", this.triggerEvent = "click", this.variant = "menu", t.classMap = { menu: !0 };
2
+ import { styles as a } from "./menu.styles.js";
3
+ const e = class e extends t {
4
+ connectedCallback() {
5
+ super.connectedCallback(), this.placement = "bottom-start", this.role = "menu", this.triggerEvent = "click", this.variant = "menu", t.classMap = { menu: !0 };
6
6
  }
7
7
  /** @internal */
8
8
  addEventListeners(i) {
9
9
  i.addEventListener(this.triggerEvent, this.open, { signal: this.signal });
10
10
  }
11
11
  };
12
- s.styles = [t.styles, r];
13
- let e = s;
12
+ e.styles = [t.styles, a];
13
+ let s = e;
14
14
  export {
15
- e as SkfMenu
15
+ s as SkfMenu
16
16
  };
@@ -1,4 +1,5 @@
1
1
  import { SkfElement } from '../../internal/components/skf-element';
2
+ import { type Language } from '../../utilities/localize.js';
2
3
  import { type CSSResultGroup } from 'lit';
3
4
  /**
4
5
  * The `<skf-nav>` is a component that displays a list of <nav-items>.
@@ -12,6 +13,8 @@ import { type CSSResultGroup } from 'lit';
12
13
  export declare class SkfNav extends SkfElement {
13
14
  #private;
14
15
  static styles: CSSResultGroup;
16
+ /** Sets the internal language of the component */
17
+ lang: Language;
15
18
  /** If true, the navigation will be displayed vertically */
16
19
  vertical: boolean;
17
20
  /** @internal */
@@ -1,55 +1,60 @@
1
1
  var u = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var y = (t, e, r) => e.has(t) || u("Cannot " + r);
5
- var c = (t, e, r) => (y(t, e, "read from private field"), r ? r.call(t) : e.get(t)), m = (t, e, r) => e.has(t) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), h = (t, e, r, i) => (y(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
6
- import { SkfElement as _ } from "../../internal/components/skf-element.js";
7
- import { stateMap as d } from "../../internal/helpers/stateMap.js";
4
+ var g = (t, e, r) => e.has(t) || u("Cannot " + r);
5
+ var p = (t, e, r) => (g(t, e, "read from private field"), r ? r.call(t) : e.get(t)), c = (t, e, r) => e.has(t) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), m = (t, e, r, i) => (g(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
6
+ import { SkfElement as d } from "../../internal/components/skf-element.js";
7
+ import { stateMap as C } from "../../internal/helpers/stateMap.js";
8
8
  import { watch as b } from "../../internal/helpers/watch.js";
9
- import { componentStyles as g } from "../../styles/component.styles.js";
10
- import { html as C } from "lit";
11
- import { property as O, queryAssignedElements as P } from "lit/decorators.js";
12
- import { ifDefined as w } from "lit/directives/if-defined.js";
13
- import { styles as D } from "./nav.styles.js";
14
- var E = Object.defineProperty, j = Object.getOwnPropertyDescriptor, f = (t, e, r, i) => {
15
- for (var s = i > 1 ? void 0 : i ? j(e, r) : e, n = t.length - 1, p; n >= 0; n--)
16
- (p = t[n]) && (s = (i ? p(e, r, s) : p(s)) || s);
17
- return i && s && E(e, r, s), s;
18
- }, o, l;
19
- const v = class v extends _ {
9
+ import { componentStyles as w } from "../../styles/component.styles.js";
10
+ import { LocalizeController as O } from "../../utilities/localize.js";
11
+ import { html as P } from "lit";
12
+ import { property as _, queryAssignedElements as D } from "lit/decorators.js";
13
+ import { ifDefined as E } from "lit/directives/if-defined.js";
14
+ import { styles as S } from "./nav.styles.js";
15
+ var j = Object.defineProperty, x = Object.getOwnPropertyDescriptor, h = (t, e, r, i) => {
16
+ for (var o = i > 1 ? void 0 : i ? x(e, r) : e, f = t.length - 1, v; f >= 0; f--)
17
+ (v = t[f]) && (o = (i ? v(e, r, o) : v(o)) || o);
18
+ return i && o && j(e, r, o), o;
19
+ }, a, l, n;
20
+ const y = class y extends d {
20
21
  constructor() {
21
22
  super(...arguments);
22
- m(this, o);
23
- m(this, l);
24
- h(this, o, this.attachInternals()), h(this, l, c(this, o).states), this.vertical = !1;
23
+ c(this, a);
24
+ c(this, l);
25
+ c(this, n);
26
+ m(this, a, new O(this)), m(this, l, this.attachInternals()), m(this, n, p(this, l).states), this.lang = "en", this.vertical = !1;
25
27
  }
26
28
  connectedCallback() {
27
- super.connectedCallback(), this.ariaLabel = this.ariaLabel ?? "Main navigation", this.role = "navigation";
29
+ super.connectedCallback(), this.ariaLabel = p(this, a).term("mainNavigation"), this.role = "navigation";
28
30
  }
29
31
  _handleStateChange() {
30
- d(c(this, l), "vertical").set(this.vertical), this._items.forEach((r) => {
32
+ C(p(this, n), "vertical").set(this.vertical), this._items.forEach((r) => {
31
33
  r.vertical = this.vertical;
32
34
  });
33
35
  }
34
36
  render() {
35
- return C`
36
- <ul aria-orientation=${w(this.vertical ? "vertical" : void 0)}>
37
+ return P`
38
+ <ul aria-orientation=${E(this.vertical ? "vertical" : void 0)}>
37
39
  <slot></slot>
38
40
  </ul>
39
41
  `;
40
42
  }
41
43
  };
42
- o = new WeakMap(), l = new WeakMap(), v.styles = [g, D];
43
- let a = v;
44
- f([
45
- O({ type: Boolean })
46
- ], a.prototype, "vertical", 2);
47
- f([
48
- P({ selector: "skf-nav-item" })
49
- ], a.prototype, "_items", 2);
50
- f([
44
+ a = new WeakMap(), l = new WeakMap(), n = new WeakMap(), y.styles = [w, S];
45
+ let s = y;
46
+ h([
47
+ _({ type: String })
48
+ ], s.prototype, "lang", 2);
49
+ h([
50
+ _({ type: Boolean })
51
+ ], s.prototype, "vertical", 2);
52
+ h([
53
+ D({ selector: "skf-nav-item" })
54
+ ], s.prototype, "_items", 2);
55
+ h([
51
56
  b("vertical")
52
- ], a.prototype, "_handleStateChange", 1);
57
+ ], s.prototype, "_handleStateChange", 1);
53
58
  export {
54
- a as SkfNav
59
+ s as SkfNav
55
60
  };
@@ -9,10 +9,13 @@ import type { CSSResultGroup } from 'lit';
9
9
  * See [zeroheight](https://zeroheight.com/853e936c9/p/983e5d-popover) for design principles
10
10
  *
11
11
  * @attribute {"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"} [placement='bottom-start'] - The placement of the popover
12
- * @attribute {string} anchor - The id of the element the menu will be anchored to
12
+ * @attribute {string} anchor - The id of the element the popover will be anchored to
13
13
  *
14
- * @event {CustomEvent} skf-opened - Fired when the menu is opened
15
- * @event {CustomEvent} skf-closed - Fired when the menu is closed
14
+ * @property {(void) => void} open() - Method that opens the popover
15
+ * @property {(void) => void} close() - Method that closes the popover
16
+ *
17
+ * @event {CustomEvent} skf-opened - Fired when the popover is opened
18
+ * @event {CustomEvent} skf-closed - Fired when the popover is closed
16
19
  *
17
20
  * @slot - The popover content
18
21
  *
@@ -28,9 +31,5 @@ export declare class SkfPopover extends SkfPopoverBase {
28
31
  /** @internal */
29
32
  hideArrowChanged(): void;
30
33
  /** @internal */
31
- openExtended(): void;
32
- /** @internal */
33
34
  addEventListeners($element: HTMLElement | Element): void;
34
- /** @internal */
35
- _checkClickOutside: (e: Event) => void;
36
35
  }
@@ -1,43 +1,35 @@
1
- import { SkfPopoverBase as p } from "../../internal/base-classes/popover/popover.base.js";
2
- import { watch as l } from "../../internal/helpers/watch.js";
3
- import { property as c } from "lit/decorators.js";
1
+ import { SkfPopoverBase as h } 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
4
  import { styles as w } from "./popover.styles.js";
5
- var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, n = (d, t, r, s) => {
6
- for (var e = s > 1 ? void 0 : s ? v(t, r) : t, o = d.length - 1, h; o >= 0; o--)
7
- (h = d[o]) && (e = (s ? h(t, r, e) : h(e)) || e);
8
- return s && e && f(t, r, e), e;
5
+ var c = Object.defineProperty, m = Object.getOwnPropertyDescriptor, a = (l, r, o, s) => {
6
+ for (var t = s > 1 ? void 0 : s ? m(r, o) : r, i = l.length - 1, p; i >= 0; i--)
7
+ (p = l[i]) && (t = (s ? p(r, o, t) : p(t)) || t);
8
+ return s && t && c(r, o, t), t;
9
9
  };
10
- const a = class a extends p {
10
+ const n = class n extends h {
11
11
  constructor() {
12
- super(), this.offset = 8, this.hideArrow = !1, this._checkClickOutside = (t) => {
13
- this.isOpen && !this.contains(t.target) && this.close();
14
- }, this.arrow = !this.hideArrow, this.placement = "bottom-start", this.triggerEvent = "click", this.variant = "popup", p.classMap = { popover: !0 };
12
+ super(), this.offset = 8, this.hideArrow = !1, this.arrow = !this.hideArrow, this.placement = "bottom-start", this.triggerEvent = "click", this.variant = "popup", h.classMap = { popover: !0 };
15
13
  }
16
14
  hideArrowChanged() {
17
15
  this.arrow = !this.hideArrow;
18
16
  }
19
17
  /** @internal */
20
- openExtended() {
21
- window.top && window.self !== window.top && window.top.addEventListener("click", this._checkClickOutside, {
22
- signal: this.signal
23
- });
24
- }
25
- /** @internal */
26
- addEventListeners(t) {
27
- t.addEventListener(this.triggerEvent, this.open.bind(this), { signal: this.signal });
18
+ addEventListeners(r) {
19
+ r.addEventListener(this.triggerEvent, this.open, { signal: this.signal });
28
20
  }
29
21
  };
30
- a.styles = [p.styles, w];
31
- let i = a;
32
- n([
33
- c({ type: Number })
34
- ], i.prototype, "offset", 2);
35
- n([
36
- c({ type: Boolean })
37
- ], i.prototype, "hideArrow", 2);
38
- n([
39
- l("hideArrow")
40
- ], i.prototype, "hideArrowChanged", 1);
22
+ n.styles = [h.styles, w];
23
+ let e = n;
24
+ a([
25
+ f({ type: Number })
26
+ ], e.prototype, "offset", 2);
27
+ a([
28
+ f({ type: Boolean })
29
+ ], e.prototype, "hideArrow", 2);
30
+ a([
31
+ d("hideArrow")
32
+ ], e.prototype, "hideArrowChanged", 1);
41
33
  export {
42
- i as SkfPopover
34
+ e as SkfPopover
43
35
  };
@@ -1,5 +1,5 @@
1
1
  import { css as r } from "lit";
2
- const s = r`
2
+ const a = r`
3
3
  @layer components {
4
4
  @layer base {
5
5
  #root {
@@ -11,7 +11,7 @@ const s = r`
11
11
  overflow: hidden;
12
12
 
13
13
  &::after {
14
- background-color: var(--skf-bg-color-emphasised);
14
+ background-color: var(--skf-bg-color-emphasized);
15
15
  block-size: inherit;
16
16
  border-radius: inherit;
17
17
  content: '';
@@ -51,5 +51,5 @@ const s = r`
51
51
  }
52
52
  `;
53
53
  export {
54
- s as styles
54
+ a as styles
55
55
  };