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

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 (88) 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/button/button.styles.js +3 -3
  5. package/dist/components/checkbox/checkbox.component.d.ts +4 -2
  6. package/dist/components/checkbox/checkbox.component.js +73 -65
  7. package/dist/components/checkbox/checkbox.styles.js +1 -1
  8. package/dist/components/datepicker/datepicker-calendar.component.d.ts +4 -0
  9. package/dist/components/datepicker/datepicker-calendar.component.js +134 -127
  10. package/dist/components/datepicker/datepicker-popup.component.d.ts +4 -0
  11. package/dist/components/datepicker/datepicker-popup.component.js +100 -88
  12. package/dist/components/datepicker/datepicker.component.d.ts +4 -2
  13. package/dist/components/datepicker/datepicker.component.js +150 -140
  14. package/dist/components/dialog/dialog.component.d.ts +3 -2
  15. package/dist/components/dialog/dialog.component.js +39 -37
  16. package/dist/components/divider/divider.component.js +13 -13
  17. package/dist/components/divider/divider.styles.js +2 -2
  18. package/dist/components/drawer/drawer.component.d.ts +3 -2
  19. package/dist/components/drawer/drawer.component.js +37 -35
  20. package/dist/components/drawer/drawer.styles.js +1 -1
  21. package/dist/components/header/header.component.d.ts +4 -2
  22. package/dist/components/header/header.component.js +66 -57
  23. package/dist/components/header/header.styles.js +2 -2
  24. package/dist/components/icon/icon.component.js +7 -7
  25. package/dist/components/icon/icon.styles.js +2 -2
  26. package/dist/components/input/input.component.d.ts +4 -8
  27. package/dist/components/input/input.component.js +146 -147
  28. package/dist/components/input/input.controllers.d.ts +0 -1
  29. package/dist/components/input/input.controllers.js +12 -12
  30. package/dist/components/link/link.component.js +19 -12
  31. package/dist/components/link/link.styles.js +11 -3
  32. package/dist/components/loader/loader.component.d.ts +0 -2
  33. package/dist/components/loader/loader.component.js +27 -30
  34. package/dist/components/loader/loader.styles.js +1 -1
  35. package/dist/components/menu/menu-item.styles.js +8 -7
  36. package/dist/components/menu/menu.component.d.ts +4 -1
  37. package/dist/components/nav/nav.component.d.ts +3 -0
  38. package/dist/components/nav/nav.component.js +38 -33
  39. package/dist/components/popover/popover.component.d.ts +6 -3
  40. package/dist/components/progress/progress.styles.js +3 -3
  41. package/dist/components/radio/radio.component.d.ts +4 -2
  42. package/dist/components/radio/radio.component.js +91 -83
  43. package/dist/components/radio/radio.styles.js +1 -1
  44. package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
  45. package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
  46. package/dist/components/select/select-option.component.d.ts +2 -2
  47. package/dist/components/select/select-option.component.js +16 -19
  48. package/dist/components/select/select.component.d.ts +13 -9
  49. package/dist/components/select/select.component.js +169 -144
  50. package/dist/components/stepper/stepper-item.styles.js +4 -4
  51. package/dist/components/switch/switch.component.d.ts +4 -2
  52. package/dist/components/switch/switch.component.js +64 -56
  53. package/dist/components/switch/switch.styles.js +1 -1
  54. package/dist/components/tabs/tab.styles.js +2 -2
  55. package/dist/components/tag/tag.component.d.ts +3 -0
  56. package/dist/components/tag/tag.component.js +50 -41
  57. package/dist/components/textarea/textarea.component.d.ts +4 -2
  58. package/dist/components/textarea/textarea.component.js +126 -118
  59. package/dist/components/tooltip/tooltip.component.d.ts +8 -2
  60. package/dist/components/tooltip/tooltip.component.js +3 -0
  61. package/dist/custom-elements.json +569 -309
  62. package/dist/internal/base-classes/popover/popover.base.d.ts +21 -2
  63. package/dist/internal/base-classes/popover/popover.base.js +10 -12
  64. package/dist/internal/controllers/popover.controller.d.ts +2 -0
  65. package/dist/internal/helpers/uuid.d.ts +8 -10
  66. package/dist/internal/helpers/uuid.js +4 -11
  67. package/dist/internal/helpers/watch.d.ts +1 -1
  68. package/dist/internal/templates/asterisk.d.ts +1 -1
  69. package/dist/internal/templates/asterisk.js +4 -4
  70. package/dist/styles/global-alt.css +1 -1
  71. package/dist/styles/global.css +1 -1
  72. package/dist/translations/en.d.ts +3 -0
  73. package/dist/translations/en.js +27 -0
  74. package/dist/translations/es.d.ts +3 -0
  75. package/dist/translations/es.js +27 -0
  76. package/dist/translations/index.d.ts +4 -0
  77. package/dist/translations/pt.d.ts +3 -0
  78. package/dist/translations/pt.js +27 -0
  79. package/dist/translations/sv.d.ts +3 -0
  80. package/dist/translations/sv.js +27 -0
  81. package/dist/types/jsx/custom-element-jsx.d.ts +59 -47
  82. package/dist/types/vue/index.d.ts +59 -47
  83. package/dist/utilities/localize.d.ts +28 -0
  84. package/dist/utilities/localize.js +13 -0
  85. package/dist/vscode.html-custom-data.json +75 -80
  86. package/dist/web-types.json +201 -166
  87. package/package.json +26 -33
  88. package/custom-elements.json +0 -25490
@@ -1,30 +1,32 @@
1
- var m = (e) => {
1
+ var _ = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
- var _ = (e, i, t) => i.has(e) || m("Cannot " + t);
5
- var u = (e, i, t) => (_(e, i, "read from private field"), t ? t.call(e) : i.get(e)), g = (e, i, t) => i.has(e) ? m("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), p = (e, i, t, o) => (_(e, i, "write to private field"), o ? o.call(e, t) : i.set(e, t), t);
4
+ var $ = (e, i, t) => i.has(e) || _("Cannot " + t);
5
+ var h = (e, i, t) => ($(e, i, "read from private field"), t ? t.call(e) : i.get(e)), f = (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), d = (e, i, t, o) => ($(e, i, "write to private field"), o ? o.call(e, t) : i.set(e, t), t);
6
6
  import "../button/button.js";
7
7
  import "../heading/heading.js";
8
8
  import "../icon/icon.js";
9
- import { SkfElement as C } from "../../internal/components/skf-element.js";
10
- import { watch as v } from "../../internal/helpers/watch.js";
9
+ import { SkfElement as b } from "../../internal/components/skf-element.js";
10
+ import { watch as k } from "../../internal/helpers/watch.js";
11
11
  import { componentStyles as B } from "../../styles/component.styles.js";
12
- import { nothing as k, html as $ } from "lit";
13
- import { property as c, state as b, query as P, queryAssignedElements as E } from "lit/decorators.js";
14
- import { classMap as w } from "lit/directives/class-map.js";
15
- import { styles as O } from "./dialog.styles.js";
16
- var x = Object.defineProperty, A = Object.getOwnPropertyDescriptor, n = (e, i, t, o) => {
17
- for (var l = o > 1 ? void 0 : o ? A(i, t) : i, a = e.length - 1, r; a >= 0; a--)
12
+ import { LocalizeController as P } from "../../utilities/localize.js";
13
+ import { nothing as E, html as w } from "lit";
14
+ import { property as c, state as v, query as O, queryAssignedElements as x } from "lit/decorators.js";
15
+ import { classMap as C } from "lit/directives/class-map.js";
16
+ import { styles as D } from "./dialog.styles.js";
17
+ var F = Object.defineProperty, M = Object.getOwnPropertyDescriptor, n = (e, i, t, o) => {
18
+ for (var l = o > 1 ? void 0 : o ? M(i, t) : i, a = e.length - 1, r; a >= 0; a--)
18
19
  (r = e[a]) && (l = (o ? r(i, t, l) : r(l)) || l);
19
- return o && l && x(i, t, l), l;
20
- }, h, f, d;
21
- const y = class y extends C {
20
+ return o && l && F(i, t, l), l;
21
+ }, u, g, y, p;
22
+ const m = class m extends b {
22
23
  constructor() {
23
24
  super(...arguments);
24
- g(this, h);
25
- g(this, f);
26
- g(this, d);
27
- p(this, h, 0), p(this, f, 20), p(this, d, !1), this.fullscreen = !1, this.noCloseButton = !1, this.noPadding = !1, this.open = !1, this.onClose = null, this.renderFoot = !1, this._handleBackdropClick = (t) => {
25
+ f(this, u);
26
+ f(this, g);
27
+ f(this, y);
28
+ f(this, p);
29
+ d(this, u, new P(this)), d(this, g, 0), d(this, y, 20), d(this, p, !1), this.fullscreen = !1, this.lang = "en", this.noCloseButton = !1, this.noPadding = !1, this.open = !1, this.onClose = null, this.renderFoot = !1, this._handleBackdropClick = (t) => {
28
30
  t.target === this.$dialog && this.close();
29
31
  }, this._handleClose = (t) => {
30
32
  this.onClose && this.onClose(t), this.close();
@@ -44,7 +46,7 @@ const y = class y extends C {
44
46
  /** @internal */
45
47
  _transition() {
46
48
  const t = this.fullscreen ? {} : {
47
- translate: `${String(u(this, h))} ${String(u(this, f))}px`
49
+ translate: `${String(h(this, g))} ${String(h(this, y))}px`
48
50
  };
49
51
  return { entry: () => new Promise((a) => {
50
52
  if (!this.$dialog) {
@@ -109,15 +111,15 @@ const y = class y extends C {
109
111
  }
110
112
  /** Method that closes the dialog */
111
113
  async close() {
112
- if (u(this, d) || !this.open) return;
113
- p(this, d, !0);
114
+ if (h(this, p) || !this.open) return;
115
+ d(this, p, !0);
114
116
  async function t(o) {
115
- return o.$dialog ? (o.emit("skf-dialog-closing"), await o._transition().exit(), o.$dialog.close(), o.open = !1, p(o, d, !1), !0) : !1;
117
+ return o.$dialog ? (o.emit("skf-dialog-closing"), await o._transition().exit(), o.$dialog.close(), o.open = !1, d(o, p, !1), !0) : !1;
116
118
  }
117
119
  return await t(this);
118
120
  }
119
121
  render() {
120
- return $`
122
+ return w`
121
123
  <dialog
122
124
  @close=${this._handleClose}
123
125
  @mousedown=${this._handleBackdropClick}
@@ -125,7 +127,7 @@ const y = class y extends C {
125
127
  @keydown=${this._handleKeyDown}
126
128
  aria-modal="true"
127
129
  autofocus
128
- class=${w({
130
+ class=${C({
129
131
  dialog: !0,
130
132
  "dialog--fullscreen": this.fullscreen,
131
133
  "dialog--no-padding": this.noPadding
@@ -133,10 +135,10 @@ const y = class y extends C {
133
135
  >
134
136
  <div class="dialog__head">
135
137
  <h2 class="dialog__heading">${this.heading}</h2>
136
- ${this.noCloseButton ? k : $`
138
+ ${this.noCloseButton ? E : w`
137
139
  <button
138
140
  @click=${this._handleClose}
139
- aria-label=${this.closeButtonAriaLabel ?? "Close dialog"}
141
+ aria-label=${h(this, u).term("close")}
140
142
  class="dialog__close-btn"
141
143
  >
142
144
  <skf-icon name="close" color="inverse"></skf-icon>
@@ -146,7 +148,7 @@ const y = class y extends C {
146
148
  <div class="dialog__body">
147
149
  <slot class="dialog__main"></slot>
148
150
  <slot
149
- class=${w({
151
+ class=${C({
150
152
  dialog__foot: !0,
151
153
  "dialog__foot--hidden": !this.renderFoot
152
154
  })}
@@ -157,17 +159,17 @@ const y = class y extends C {
157
159
  `;
158
160
  }
159
161
  };
160
- h = new WeakMap(), f = new WeakMap(), d = new WeakMap(), y.styles = [B, O];
161
- let s = y;
162
- n([
163
- c({ attribute: "close-button-aria-label" })
164
- ], s.prototype, "closeButtonAriaLabel", 2);
162
+ u = new WeakMap(), g = new WeakMap(), y = new WeakMap(), p = new WeakMap(), m.styles = [B, D];
163
+ let s = m;
165
164
  n([
166
165
  c()
167
166
  ], s.prototype, "heading", 2);
168
167
  n([
169
168
  c({ type: Boolean })
170
169
  ], s.prototype, "fullscreen", 2);
170
+ n([
171
+ c({ type: String })
172
+ ], s.prototype, "lang", 2);
171
173
  n([
172
174
  c({ type: Boolean, attribute: "no-close-button" })
173
175
  ], s.prototype, "noCloseButton", 2);
@@ -178,19 +180,19 @@ n([
178
180
  c({ type: Boolean, reflect: !0 })
179
181
  ], s.prototype, "open", 2);
180
182
  n([
181
- b()
183
+ v()
182
184
  ], s.prototype, "onClose", 2);
183
185
  n([
184
- b()
186
+ v()
185
187
  ], s.prototype, "renderFoot", 2);
186
188
  n([
187
- P("dialog")
189
+ O("dialog")
188
190
  ], s.prototype, "$dialog", 2);
189
191
  n([
190
- E({ slot: "footer" })
192
+ x({ slot: "footer" })
191
193
  ], s.prototype, "footerEls", 2);
192
194
  n([
193
- v("open")
195
+ k("open")
194
196
  ], s.prototype, "handleOpenChange", 1);
195
197
  export {
196
198
  s as SkfDialog
@@ -2,7 +2,7 @@ var _ = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
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);
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, a) => (d(t, e, "write to private field"), a ? a.call(t, r) : e.set(t, r), r);
6
6
  import { SkfElement as O } from "../../internal/components/skf-element.js";
7
7
  import { stateMap as b } from "../../internal/helpers/stateMap.js";
8
8
  import { watch as g } from "../../internal/helpers/watch.js";
@@ -10,13 +10,13 @@ import { componentStyles as C } from "../../styles/component.styles.js";
10
10
  import "lit";
11
11
  import { property as v } from "lit/decorators.js";
12
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;
13
+ var j = Object.defineProperty, w = Object.getOwnPropertyDescriptor, c = (t, e, r, a) => {
14
+ for (var o = a > 1 ? void 0 : a ? w(e, r) : e, l = t.length - 1, n; l >= 0; l--)
15
+ (n = t[l]) && (o = (a ? n(e, r, o) : n(o)) || o);
16
+ return a && o && j(e, r, o), o;
17
17
  };
18
18
  const u = {
19
- color: ["emphasised", "inverse", "primary", "secondary", "tertiary"],
19
+ color: ["emphasized", "inverse", "primary", "secondary", "tertiary"],
20
20
  vertical: "vertical"
21
21
  };
22
22
  var i, p;
@@ -30,24 +30,24 @@ const f = class f extends O {
30
30
  connectedCallback() {
31
31
  super.connectedCallback(), this.role = this.decorative ? "generic" : "separator", this.ariaOrientation = this.vertical ? "vertical" : "horizontal";
32
32
  }
33
- _handleStateChange(r, s, o) {
33
+ _handleStateChange(r, a, o) {
34
34
  b(h(this, p), u[r]).set(o);
35
35
  }
36
36
  };
37
37
  i = new WeakMap(), p = new WeakMap(), f.styles = [C, P];
38
- let a = f;
38
+ let s = f;
39
39
  c([
40
40
  v({ type: String })
41
- ], a.prototype, "color", 2);
41
+ ], s.prototype, "color", 2);
42
42
  c([
43
43
  v({ type: Boolean })
44
- ], a.prototype, "decorative", 2);
44
+ ], s.prototype, "decorative", 2);
45
45
  c([
46
46
  v({ type: Boolean })
47
- ], a.prototype, "vertical", 2);
47
+ ], s.prototype, "vertical", 2);
48
48
  c([
49
49
  g(Object.keys(u))
50
- ], a.prototype, "_handleStateChange", 1);
50
+ ], s.prototype, "_handleStateChange", 1);
51
51
  export {
52
- a as SkfDivider
52
+ s as SkfDivider
53
53
  };
@@ -24,8 +24,8 @@ const o = r`
24
24
  margin-inline: var(--skf-divider-spacing, var(--skf-spacing-100));
25
25
  }
26
26
 
27
- :host(:state(emphasised)) {
28
- --_skf-divider-border-color: var(--skf-border-color-emphasised);
27
+ :host(:state(emphasized)) {
28
+ --_skf-divider-border-color: var(--skf-border-color-emphasized);
29
29
  }
30
30
 
31
31
  :host(:state(inverse)) {
@@ -1,5 +1,6 @@
1
1
  import '../icon/icon.js';
2
2
  import { SkfElement } from '../../internal/components/skf-element';
3
+ import { type Language } from '../../utilities/localize.js';
3
4
  import { type CSSResultGroup } from 'lit';
4
5
  /**
5
6
  * TODO:
@@ -30,10 +31,10 @@ export declare class SkfDrawer extends SkfElement {
30
31
  private _abortController?;
31
32
  /** @internal */
32
33
  private _signal?;
33
- /** If defined, sets the aria-label for the close button */
34
- closeButtonAriaLabel: string;
35
34
  /** Heading for the Drawer */
36
35
  heading?: string;
36
+ /** Sets the internal language of the component */
37
+ lang: Language;
37
38
  /** Sets the max-width */
38
39
  size: Size;
39
40
  /** If true, Drawer is open */
@@ -1,33 +1,35 @@
1
- var _ = (e) => {
1
+ var y = (e) => {
2
2
  throw TypeError(e);
3
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);
4
+ var w = (e, i, t) => i.has(e) || y("Cannot " + t);
5
+ var m = (e, i, t) => (w(e, i, "read from private field"), t ? t.call(e) : i.get(e)), g = (e, i, t) => i.has(e) ? y("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), f = (e, i, t, o) => (w(e, i, "write to private field"), o ? o.call(e, t) : i.set(e, t), t);
6
6
  import "../icon/icon.js";
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";
7
+ import { SkfElement as D } from "../../internal/components/skf-element.js";
8
+ import { stateMap as k } from "../../internal/helpers/stateMap.js";
9
+ import { watch as u } from "../../internal/helpers/watch.js";
10
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--)
11
+ import { componentStyles as C } from "../../styles/component.styles.js";
12
+ import { LocalizeController as $ } from "../../utilities/localize.js";
13
+ import { html as E } from "lit";
14
+ import { property as d, query as v } from "lit/decorators.js";
15
+ import { styles as O } from "./drawer.styles.js";
16
+ var P = Object.defineProperty, U = Object.getOwnPropertyDescriptor, n = (e, i, t, o) => {
17
+ for (var s = o > 1 ? void 0 : o ? U(i, t) : i, r = e.length - 1, l; r >= 0; r--)
17
18
  (l = e[r]) && (s = (o ? l(i, t, s) : l(s)) || s);
18
- return o && s && A(i, t, s), s;
19
+ return o && s && P(i, t, s), s;
19
20
  };
20
- const w = {
21
+ const I = {
21
22
  placement: ["left", "right"],
22
23
  size: ["sm", "md", "lg"]
23
24
  };
24
- var h, c;
25
- const u = class u extends I {
25
+ var h, c, p;
26
+ const _ = class _ extends D {
26
27
  constructor() {
27
28
  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 = () => {
29
+ g(this, h);
30
+ g(this, c);
31
+ g(this, p);
32
+ f(this, h, new $(this)), f(this, c, this.attachInternals()), f(this, p, m(this, c).states), this.lang = "en", this.size = "md", this.open = !1, this.placement = "right", this._placementChanged = () => {
31
33
  this.$dialog.getAnimations().forEach((o) => {
32
34
  o.cancel();
33
35
  });
@@ -45,7 +47,7 @@ const u = class u extends I {
45
47
  super.disconnectedCallback(), (t = this._abortController) == null || t.abort();
46
48
  }
47
49
  _handleStateChange(t, o, s) {
48
- D(d(this, c), w[t]).set(s);
50
+ k(m(this, p), I[t]).set(s);
49
51
  }
50
52
  async _openChanged() {
51
53
  var t;
@@ -94,12 +96,12 @@ const u = class u extends I {
94
96
  this.open = !1;
95
97
  }
96
98
  render() {
97
- return C`
99
+ return E`
98
100
  <dialog @mousedown="${this._handleMouseDown}" @mouseup="${this._handleMouseUp}">
99
101
  <header>
100
102
  <h2>${this.heading}</h2>
101
103
  <button
102
- aria-label=${this.closeButtonAriaLabel}
104
+ aria-label=${m(this, h).term("close")}
103
105
  id="close-button"
104
106
  @click="${() => this.open = !1}"
105
107
  >
@@ -111,34 +113,34 @@ const u = class u extends I {
111
113
  `;
112
114
  }
113
115
  };
114
- h = new WeakMap(), c = new WeakMap(), u.styles = [k, E];
115
- let a = u;
116
+ h = new WeakMap(), c = new WeakMap(), p = new WeakMap(), _.styles = [C, O];
117
+ let a = _;
116
118
  n([
117
- p({ type: String, attribute: "close-button-aria-label" })
118
- ], a.prototype, "closeButtonAriaLabel", 2);
119
- n([
120
- p({ type: String })
119
+ d({ type: String })
121
120
  ], a.prototype, "heading", 2);
122
121
  n([
123
- p({ type: String })
122
+ d({ type: String })
123
+ ], a.prototype, "lang", 2);
124
+ n([
125
+ d({ type: String })
124
126
  ], a.prototype, "size", 2);
125
127
  n([
126
- p({ type: Boolean, reflect: !0, useDefault: !0 })
128
+ d({ type: Boolean, reflect: !0, useDefault: !0 })
127
129
  ], a.prototype, "open", 2);
128
130
  n([
129
- p({ type: String })
131
+ d({ type: String })
130
132
  ], a.prototype, "placement", 2);
131
133
  n([
132
- $("dialog")
134
+ v("dialog")
133
135
  ], a.prototype, "$dialog", 2);
134
136
  n([
135
- f(Object.keys(w))
137
+ u(Object.keys(I))
136
138
  ], a.prototype, "_handleStateChange", 1);
137
139
  n([
138
- f("placement", { waitUntilFirstUpdate: !0 })
140
+ u("placement", { waitUntilFirstUpdate: !0 })
139
141
  ], a.prototype, "_placementChanged", 2);
140
142
  n([
141
- f("open", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
143
+ u("open", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
142
144
  ], a.prototype, "_openChanged", 1);
143
145
  export {
144
146
  a as SkfDrawer
@@ -24,7 +24,7 @@ const o = e`
24
24
 
25
25
  header {
26
26
  align-items: center;
27
- background-color: var(--skf-bg-color-emphasised);
27
+ background-color: var(--skf-bg-color-emphasized);
28
28
  block-size: var(--skf-size-48);
29
29
  color: var(--skf-text-color-inverse);
30
30
  display: flex;
@@ -2,6 +2,7 @@ import '../button/button.js';
2
2
  import '../drawer/drawer.js';
3
3
  import '../logo/logo.js';
4
4
  import { SkfElement } from '../../internal/components/skf-element';
5
+ import { type Language } from '../../utilities/localize.js';
5
6
  import { type CSSResultGroup } from 'lit';
6
7
  /**
7
8
  * The `<skf-header>` component is to be used as the site-header in the app. The navigation will be collapsed to mobile-view if the menu items exceed the available width.
@@ -13,6 +14,7 @@ import { type CSSResultGroup } from 'lit';
13
14
  * @tagname skf-header
14
15
  */
15
16
  export declare class SkfHeader extends SkfElement {
17
+ #private;
16
18
  static styles: CSSResultGroup;
17
19
  /** @internal */
18
20
  private _dynamicBreakpoint?;
@@ -21,8 +23,8 @@ export declare class SkfHeader extends SkfElement {
21
23
  /** If true, sets header to display in compact mode only (hanburger menu and drawer) */
22
24
  set compact(value: boolean);
23
25
  get compact(): boolean;
24
- /** If defined, sets the aria-label for the hamburger button */
25
- hamburgerAriaLabel: string;
26
+ /** Sets the internal language of the component */
27
+ lang: Language;
26
28
  /** If defined, sets the app or site's name */
27
29
  siteName?: string;
28
30
  /** If defined, sets the site's base-url for the "logo-link" */
@@ -1,24 +1,32 @@
1
+ var v = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var d = (e, r, t) => r.has(e) || v("Cannot " + t);
5
+ var f = (e, r, t) => (d(e, r, "read from private field"), t ? t.call(e) : r.get(e)), u = (e, r, t) => r.has(e) ? v("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), b = (e, r, t, o) => (d(e, r, "write to private field"), o ? o.call(e, t) : r.set(e, t), t);
1
6
  import "../button/button.js";
2
7
  import "../drawer/drawer.js";
3
8
  import "../logo/logo.js";
4
- import { SkfElement as d } from "../../internal/components/skf-element.js";
5
- import { componentStyles as b } from "../../styles/component.styles.js";
6
- import { nothing as u, html as o } from "lit";
7
- import { property as s, state as f, queryAssignedElements as w, query as _ } from "lit/decorators.js";
8
- import { ifDefined as m } from "lit/directives/if-defined.js";
9
- import { literal as v, html as y } from "lit/static-html.js";
10
- import { styles as $ } from "./header.styles.js";
11
- var g = Object.defineProperty, C = Object.getOwnPropertyDescriptor, r = (c, e, n, a) => {
12
- for (var i = a > 1 ? void 0 : a ? C(e, n) : e, p = c.length - 1, h; p >= 0; p--)
13
- (h = c[p]) && (i = (a ? h(e, n, i) : h(i)) || i);
14
- return a && i && g(e, n, i), i;
15
- };
16
- const l = class l extends d {
9
+ import { SkfElement as y } from "../../internal/components/skf-element.js";
10
+ import { componentStyles as $ } from "../../styles/component.styles.js";
11
+ import { LocalizeController as g } from "../../utilities/localize.js";
12
+ import { nothing as C, html as h } from "lit";
13
+ import { property as p, state as O, queryAssignedElements as W, query as D } from "lit/decorators.js";
14
+ import { ifDefined as w } from "lit/directives/if-defined.js";
15
+ import { literal as _, html as N } from "lit/static-html.js";
16
+ import { styles as k } from "./header.styles.js";
17
+ var z = Object.defineProperty, B = Object.getOwnPropertyDescriptor, s = (e, r, t, o) => {
18
+ for (var a = o > 1 ? void 0 : o ? B(r, t) : r, l = e.length - 1, c; l >= 0; l--)
19
+ (c = e[l]) && (a = (o ? c(r, t, a) : c(a)) || a);
20
+ return o && a && z(r, t, a), a;
21
+ }, n;
22
+ const m = class m extends y {
17
23
  constructor() {
18
- super(...arguments), this.hamburgerAriaLabel = "Show navigation", this.isCompact = !1, this.openDrawer = !1;
24
+ super(...arguments);
25
+ u(this, n);
26
+ b(this, n, new g(this)), this.lang = "en", this.isCompact = !1, this.openDrawer = !1;
19
27
  }
20
- set compact(e) {
21
- this.isCompact = e;
28
+ set compact(t) {
29
+ this.isCompact = t;
22
30
  }
23
31
  get compact() {
24
32
  return this.isCompact;
@@ -35,82 +43,83 @@ const l = class l extends d {
35
43
  /** @internal */
36
44
  _observeHostWidth() {
37
45
  this._widthObserver = new ResizeObserver(() => {
38
- var e;
39
- this.clientWidth > (this._dynamicBreakpoint ?? 0) && (this._dynamicBreakpoint = null, (e = this._widthObserver) == null || e.disconnect(), this.isCompact = !1, this.nav[0].vertical = !1, this._observeNavContainer());
46
+ var t;
47
+ this.clientWidth > (this._dynamicBreakpoint ?? 0) && (this._dynamicBreakpoint = null, (t = this._widthObserver) == null || t.disconnect(), this.isCompact = !1, this.nav[0].vertical = !1, this._observeNavContainer());
40
48
  }), this._widthObserver.observe(this);
41
49
  }
42
50
  /** @internal */
43
51
  _observeNavContainer() {
44
52
  this._widthObserver = new ResizeObserver(() => {
45
- var e;
46
- this.$navWrapper.clientWidth < this.$navWrapper.scrollWidth && (this._dynamicBreakpoint = this.clientWidth, (e = this._widthObserver) == null || e.disconnect(), this.isCompact = !0, this.nav[0].vertical = !0, this._observeHostWidth());
53
+ var t;
54
+ this.$navWrapper.clientWidth < this.$navWrapper.scrollWidth && (this._dynamicBreakpoint = this.clientWidth, (t = this._widthObserver) == null || t.disconnect(), this.isCompact = !0, this.nav[0].vertical = !0, this._observeHostWidth());
47
55
  }), this._widthObserver.observe(this.$navWrapper);
48
56
  }
49
57
  /** @internal */
50
58
  _renderMeta() {
51
- const e = this.siteUrl ? v`a` : v`div`;
52
- return y`
53
- <${e} href=${m(this.siteUrl)} id="meta">
59
+ const t = this.siteUrl ? _`a` : _`div`;
60
+ return N`
61
+ <${t} href=${w(this.siteUrl)} id="meta">
54
62
  <skf-logo color="inverse"></skf-logo>
55
- ${this.siteName ? o`<h2>${this.siteName}</h2>` : u}
56
- </${e}>
63
+ ${this.siteName ? h`<h2>${this.siteName}</h2>` : C}
64
+ </${t}>
57
65
  `;
58
66
  }
59
67
  render() {
60
- return o`
68
+ return h`
61
69
  <header role="banner">
62
70
  ${this._renderMeta()}
63
71
  <div id="nav-wrapper">
64
- ${this.isCompact ? o`
72
+ ${this.isCompact ? h`
65
73
  <button
66
74
  @click=${() => this.openDrawer = !this.openDrawer}
67
75
  aria-controls="drawer"
68
76
  aria-expanded=${this.openDrawer}
69
- aria-label=${this.hamburgerAriaLabel}
77
+ aria-label=${f(this, n).term("showMenu")}
70
78
  >
71
79
  <skf-icon color="inverse" name="hamburgerMenu" size="lg"></skf-icon>
72
80
  </button>
73
81
  <skf-drawer
74
82
  ?open=${this.openDrawer}
75
83
  @close=${() => this.openDrawer = !1}
76
- heading=${m(this.siteName)}
84
+ heading=${w(this.siteName)}
77
85
  id="drawer"
86
+ lang=${this.lang}
78
87
  placement="right"
79
88
  >
80
89
  <slot></slot>
81
90
  </skf-drawer>
82
- ` : o`<slot></slot>`}
91
+ ` : h`<slot></slot>`}
83
92
  </div>
84
93
  </header>
85
94
  `;
86
95
  }
87
96
  };
88
- l.styles = [b, $];
89
- let t = l;
90
- r([
91
- s({ type: Boolean, reflect: !0 })
92
- ], t.prototype, "compact", 1);
93
- r([
94
- s({ attribute: "hamburger-aria-label" })
95
- ], t.prototype, "hamburgerAriaLabel", 2);
96
- r([
97
- s({ attribute: "site-name" })
98
- ], t.prototype, "siteName", 2);
99
- r([
100
- s({ attribute: "site-url" })
101
- ], t.prototype, "siteUrl", 2);
102
- r([
103
- s({ type: Boolean, reflect: !0, state: !0, attribute: "is-compact" })
104
- ], t.prototype, "isCompact", 2);
105
- r([
106
- f()
107
- ], t.prototype, "openDrawer", 2);
108
- r([
109
- w({ selector: "skf-nav" })
110
- ], t.prototype, "nav", 2);
111
- r([
112
- _("#nav-wrapper")
113
- ], t.prototype, "$navWrapper", 2);
97
+ n = new WeakMap(), m.styles = [$, k];
98
+ let i = m;
99
+ s([
100
+ p({ type: Boolean, reflect: !0 })
101
+ ], i.prototype, "compact", 1);
102
+ s([
103
+ p({ type: String })
104
+ ], i.prototype, "lang", 2);
105
+ s([
106
+ p({ attribute: "site-name" })
107
+ ], i.prototype, "siteName", 2);
108
+ s([
109
+ p({ attribute: "site-url" })
110
+ ], i.prototype, "siteUrl", 2);
111
+ s([
112
+ p({ type: Boolean, reflect: !0, state: !0, attribute: "is-compact" })
113
+ ], i.prototype, "isCompact", 2);
114
+ s([
115
+ O()
116
+ ], i.prototype, "openDrawer", 2);
117
+ s([
118
+ W({ selector: "skf-nav" })
119
+ ], i.prototype, "nav", 2);
120
+ s([
121
+ D("#nav-wrapper")
122
+ ], i.prototype, "$navWrapper", 2);
114
123
  export {
115
- t as SkfHeader
124
+ i as SkfHeader
116
125
  };
@@ -7,7 +7,7 @@ const a = e`
7
7
 
8
8
  header {
9
9
  align-items: center;
10
- background-color: var(--skf-bg-color-emphasised);
10
+ background-color: var(--skf-bg-color-emphasized);
11
11
  block-size: var(--skf-header-height);
12
12
  display: flex;
13
13
  gap: var(--skf-spacing-125);
@@ -48,7 +48,7 @@ const a = e`
48
48
  }
49
49
 
50
50
  skf-drawer::part(body) {
51
- background-color: var(--skf-bg-color-emphasised);
51
+ background-color: var(--skf-bg-color-emphasized);
52
52
  padding: 0;
53
53
  }
54
54
 
@@ -8,16 +8,16 @@ import { stateMap as b } from "../../internal/helpers/stateMap.js";
8
8
  import { watch as _ } from "../../internal/helpers/watch.js";
9
9
  import { ICONS as S } from "@skf-design-system/ui-assets";
10
10
  import { componentStyles as C } from "../../styles/component.styles.js";
11
- import { html as O } from "lit";
11
+ import { html as z } from "lit";
12
12
  import { property as n } from "lit/decorators.js";
13
- import { styles as w } from "./icon.styles.js";
14
- var z = Object.defineProperty, P = Object.getOwnPropertyDescriptor, p = (t, e, r, o) => {
13
+ import { styles as O } from "./icon.styles.js";
14
+ var w = Object.defineProperty, P = Object.getOwnPropertyDescriptor, p = (t, e, r, o) => {
15
15
  for (var s = o > 1 ? void 0 : o ? P(e, r) : e, m = t.length - 1, h; m >= 0; m--)
16
16
  (h = t[m]) && (s = (o ? h(e, r, s) : h(s)) || s);
17
- return o && s && z(e, r, s), s;
17
+ return o && s && w(e, r, s), s;
18
18
  };
19
19
  const x = {
20
- color: ["emphasised", "error", "info", "inverse", "primary", "secondary", "success", "warning"],
20
+ color: ["emphasized", "error", "info", "inverse", "primary", "secondary", "success", "warning"],
21
21
  size: ["lg", "md", "sm", "xs"]
22
22
  };
23
23
  var a, l;
@@ -35,10 +35,10 @@ const f = class f extends v {
35
35
  b(c(this, l), x[r]).set(s);
36
36
  }
37
37
  render() {
38
- return O`<div id="root">${S[this.name]}</div>`;
38
+ return z`<div id="root">${S[this.name]}</div>`;
39
39
  }
40
40
  };
41
- a = new WeakMap(), l = new WeakMap(), f.styles = [C, w];
41
+ a = new WeakMap(), l = new WeakMap(), f.styles = [C, O];
42
42
  let i = f;
43
43
  p([
44
44
  n({ type: String })