@skf-design-system/ui-components 1.0.2-beta.5 → 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 (124) hide show
  1. package/README.md +18 -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/alert/alert.component.d.ts +3 -2
  5. package/dist/components/alert/alert.component.js +39 -33
  6. package/dist/components/button/button.styles.js +3 -3
  7. package/dist/components/checkbox/checkbox.component.d.ts +4 -2
  8. package/dist/components/checkbox/checkbox.component.js +73 -65
  9. package/dist/components/checkbox/checkbox.styles.js +1 -1
  10. package/dist/components/datepicker/datepicker-calendar.component.d.ts +4 -0
  11. package/dist/components/datepicker/datepicker-calendar.component.js +134 -127
  12. package/dist/components/datepicker/datepicker-popup.component.d.ts +4 -0
  13. package/dist/components/datepicker/datepicker-popup.component.js +100 -88
  14. package/dist/components/datepicker/datepicker.component.d.ts +4 -2
  15. package/dist/components/datepicker/datepicker.component.js +151 -140
  16. package/dist/components/dialog/dialog.component.d.ts +3 -2
  17. package/dist/components/dialog/dialog.component.js +39 -37
  18. package/dist/components/divider/divider.component.d.ts +3 -0
  19. package/dist/components/divider/divider.component.js +43 -22
  20. package/dist/components/divider/divider.styles.js +9 -9
  21. package/dist/components/drawer/drawer.component.d.ts +11 -4
  22. package/dist/components/drawer/drawer.component.js +77 -55
  23. package/dist/components/drawer/drawer.styles.js +47 -40
  24. package/dist/components/header/header.component.d.ts +4 -2
  25. package/dist/components/header/header.component.js +66 -57
  26. package/dist/components/header/header.styles.js +2 -2
  27. package/dist/components/icon/icon.component.js +7 -7
  28. package/dist/components/icon/icon.styles.js +2 -2
  29. package/dist/components/input/input.component.d.ts +4 -8
  30. package/dist/components/input/input.component.js +147 -147
  31. package/dist/components/input/input.controllers.d.ts +0 -1
  32. package/dist/components/input/input.controllers.js +12 -12
  33. package/dist/components/link/link.component.d.ts +15 -18
  34. package/dist/components/link/link.component.js +105 -107
  35. package/dist/components/link/link.styles.js +53 -45
  36. package/dist/components/loader/loader.component.d.ts +5 -3
  37. package/dist/components/loader/loader.component.js +39 -28
  38. package/dist/components/loader/loader.styles.js +6 -10
  39. package/dist/components/menu/menu-item.component.d.ts +1 -1
  40. package/dist/components/menu/menu-item.component.js +8 -8
  41. package/dist/components/menu/menu-item.styles.js +13 -9
  42. package/dist/components/menu/menu.component.d.ts +5 -2
  43. package/dist/components/menu/menu.component.js +8 -8
  44. package/dist/components/nav/nav-item.component.d.ts +4 -0
  45. package/dist/components/nav/nav-item.component.js +44 -25
  46. package/dist/components/nav/nav-item.styles.js +29 -25
  47. package/dist/components/nav/nav.component.d.ts +9 -0
  48. package/dist/components/nav/nav.component.js +47 -21
  49. package/dist/components/nav/nav.styles.js +15 -9
  50. package/dist/components/popover/popover.component.d.ts +10 -3
  51. package/dist/components/popover/popover.component.js +30 -22
  52. package/dist/components/progress/progress.component.d.ts +2 -0
  53. package/dist/components/progress/progress.component.js +38 -29
  54. package/dist/components/progress/progress.styles.js +4 -4
  55. package/dist/components/radio/radio.component.d.ts +4 -2
  56. package/dist/components/radio/radio.component.js +91 -83
  57. package/dist/components/radio/radio.styles.js +1 -1
  58. package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
  59. package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
  60. package/dist/components/select/select-option-group.component.d.ts +4 -0
  61. package/dist/components/select/select-option-group.component.js +37 -18
  62. package/dist/components/select/select-option-group.style.js +12 -6
  63. package/dist/components/select/select-option.component.d.ts +7 -2
  64. package/dist/components/select/select-option.component.js +70 -53
  65. package/dist/components/select/select-option.styles.js +43 -31
  66. package/dist/components/select/select.component.d.ts +18 -10
  67. package/dist/components/select/select.component.js +175 -132
  68. package/dist/components/select/select.controllers.js +2 -1
  69. package/dist/components/select/select.styles.js +8 -2
  70. package/dist/components/stepper/stepper-item.component.d.ts +1 -1
  71. package/dist/components/stepper/stepper-item.component.js +26 -23
  72. package/dist/components/stepper/stepper-item.styles.js +4 -4
  73. package/dist/components/switch/switch.component.d.ts +4 -2
  74. package/dist/components/switch/switch.component.js +64 -56
  75. package/dist/components/switch/switch.styles.js +1 -1
  76. package/dist/components/tabs/tab-panel.component.d.ts +1 -1
  77. package/dist/components/tabs/tab-panel.component.js +19 -16
  78. package/dist/components/tabs/tab.component.d.ts +1 -1
  79. package/dist/components/tabs/tab.component.js +17 -14
  80. package/dist/components/tabs/tab.styles.js +2 -2
  81. package/dist/components/tag/tag.component.d.ts +3 -0
  82. package/dist/components/tag/tag.component.js +50 -41
  83. package/dist/components/textarea/textarea.component.d.ts +4 -2
  84. package/dist/components/textarea/textarea.component.js +127 -118
  85. package/dist/components/toast/toast-item.styles.js +13 -10
  86. package/dist/components/toast/toast.component.js +9 -9
  87. package/dist/components/toast/toast.singleton.d.ts +1 -1
  88. package/dist/components/toast/toast.singleton.js +18 -18
  89. package/dist/components/tooltip/tooltip.component.d.ts +9 -2
  90. package/dist/components/tooltip/tooltip.component.js +13 -7
  91. package/dist/custom-elements.json +1305 -946
  92. package/dist/index.d.ts +2 -2
  93. package/dist/index.js +20 -20
  94. package/dist/internal/base-classes/popover/popover.base.d.ts +24 -5
  95. package/dist/internal/base-classes/popover/popover.base.js +28 -29
  96. package/dist/internal/base-classes/popover/popover.styles.js +4 -5
  97. package/dist/internal/components/hint/hint.component.d.ts +4 -0
  98. package/dist/internal/components/hint/hint.component.js +47 -20
  99. package/dist/internal/components/hint/hint.styles.js +29 -25
  100. package/dist/internal/controllers/popover.controller.d.ts +2 -0
  101. package/dist/internal/helpers/uuid.d.ts +8 -10
  102. package/dist/internal/helpers/uuid.js +4 -11
  103. package/dist/internal/helpers/watch.d.ts +1 -1
  104. package/dist/internal/templates/asterisk.d.ts +1 -1
  105. package/dist/internal/templates/asterisk.js +4 -4
  106. package/dist/internal/types.d.ts +4 -0
  107. package/dist/styles/global-alt.css +1 -1
  108. package/dist/styles/global.css +1 -1
  109. package/dist/translations/en.d.ts +3 -0
  110. package/dist/translations/en.js +27 -0
  111. package/dist/translations/es.d.ts +3 -0
  112. package/dist/translations/es.js +27 -0
  113. package/dist/translations/index.d.ts +4 -0
  114. package/dist/translations/pt.d.ts +3 -0
  115. package/dist/translations/pt.js +27 -0
  116. package/dist/translations/sv.d.ts +3 -0
  117. package/dist/translations/sv.js +27 -0
  118. package/dist/types/jsx/custom-element-jsx.d.ts +243 -128
  119. package/dist/types/vue/index.d.ts +136 -127
  120. package/dist/utilities/localize.d.ts +28 -0
  121. package/dist/utilities/localize.js +13 -0
  122. package/dist/vscode.html-custom-data.json +168 -177
  123. package/dist/web-types.json +411 -381
  124. package/package.json +34 -41
@@ -1,123 +1,121 @@
1
+ var b = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var g = (e, i, t) => i.has(e) || b("Cannot " + t);
5
+ var d = (e, i, t) => (g(e, i, "read from private field"), t ? t.call(e) : i.get(e)), f = (e, i, t) => i.has(e) ? b("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), m = (e, i, t, o) => (g(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 { componentStyles as y } from "../../styles/component.styles.js";
4
- import "lit";
5
- import { property as r } from "lit/decorators.js";
6
- import { classMap as u } from "lit/directives/class-map.js";
7
- import { ifDefined as l } from "lit/directives/if-defined.js";
8
- import { html as f, literal as d } from "lit/static-html.js";
9
- import { styles as k } from "./link.styles.js";
10
- var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (h, t, i, n) => {
11
- for (var c = n > 1 ? void 0 : n ? b(t, i) : t, p = h.length - 1, a; p >= 0; p--)
12
- (a = h[p]) && (c = (n ? a(t, i, c) : a(c)) || c);
13
- return n && c && v(t, i, c), c;
14
- }, s;
15
- const e = (s = class extends m {
7
+ import { SkfElement as C } from "../../internal/components/skf-element.js";
8
+ import { stateMap as k } from "../../internal/helpers/stateMap.js";
9
+ import { watch as v } from "../../internal/helpers/watch.js";
10
+ import { componentStyles as S } from "../../styles/component.styles.js";
11
+ import { nothing as y } 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;
20
+ };
21
+ const w = {
22
+ color: ["inverse", "primary"],
23
+ stretch: "stretch"
24
+ };
25
+ var a, l;
26
+ const u = class u extends C {
16
27
  constructor() {
17
- super(...arguments), this.as = "a", this.color = "primary", this.disabled = !1, this.iconPlacement = "left", this.stretch = !1, this.type = "button", this._preprocessOnClick = (t) => {
18
- this.as === "a" && this.onClick && t.preventDefault(), t.stopPropagation(), this.emit("click");
19
- };
20
- }
21
- set onClick(t) {
22
- if (!t) return;
23
- this._onClick = t;
24
- const i = (n) => {
25
- t(n, this.href ?? this.route);
28
+ super(...arguments);
29
+ f(this, a);
30
+ f(this, l);
31
+ m(this, a, this.attachInternals()), m(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())))
34
+ if (this.target)
35
+ window.open(this.href, this.target);
36
+ 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);
39
+ } else
40
+ window.location.href = this.href;
26
41
  };
27
- this._assertValidOnClick(t), this.removeEventListener("click", i), this.addEventListener("click", i);
28
- }
29
- get onClick() {
30
- return this._onClick;
31
42
  }
32
43
  connectedCallback() {
33
- super.connectedCallback(), this.addEventListener("keydown", (t) => {
34
- (t.key === "Enter" || t.key === " ") && this._preprocessOnClick(t);
35
- });
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();
48
+ }), this.addEventListener("click", this._handleClick);
36
49
  }
37
- /** @internal */
38
- _assertValidOnClick(t) {
39
- console.assert(
40
- typeof t == "function",
41
- `${this.localName}: onClick must be a function. Set the onClick tag property instead of through the attribute API. Read the documentation for more info.`
42
- );
50
+ _handleAsChange() {
51
+ this.as === "button" ? this.setAttribute("type", "button") : this.removeAttribute("type");
52
+ }
53
+ _handleStateChange(t, o, h) {
54
+ k(d(this, l), w[t]).set(h);
43
55
  }
44
56
  /** @internal */
45
57
  _renderIcon() {
46
- const t = Object.freeze({
47
- primary: "emphasised",
48
- inverse: "inverse"
49
- });
50
- return f`
51
- <skf-icon color=${t[this.color]} name=${l(this.icon)} size="sm"></skf-icon>
58
+ const t = this.color === "inverse" ? "inverse" : "emphasized";
59
+ return _`
60
+ <skf-icon
61
+ color=${t}
62
+ data-color=${this.disabled ? "custom" : y}
63
+ name=${x(this.icon)}
64
+ size="sm"
65
+ ></skf-icon>
52
66
  `;
53
67
  }
54
68
  render() {
55
- const t = this.as === "a", i = t ? d`a` : d`button`;
56
- return f`
57
- <${i}
58
- ?disabled=${l(t ? void 0 : this.disabled)}
59
- @click=${this._preprocessOnClick}
60
- class=${u({
61
- link: !0,
62
- "link--color-inverse": this.color === "inverse",
63
- "link--color-primary": this.color === "primary",
64
- "link--icon-right": this.iconPlacement === "right",
65
- "link--stretch": this.stretch,
66
- ...s.classMap
67
- })}
68
- download=${l(t ? this.download : void 0)}
69
- href=${l(t ? this.href : void 0)}
70
- part="root"
71
- rel=${l(t ? this.rel : void 0)}
72
- target=${l(t ? this.target : void 0)}
73
- type=${l(t ? void 0 : this.type)}
74
- >
75
- ${this.icon && this._renderIcon()}
76
- <slot>Default link text</slot>
77
- </${i}>
69
+ return _`
70
+ <div id="root" part="root">
71
+ ${this.icon && !this.iconRight ? this._renderIcon() : y}
72
+ <slot></slot>
73
+ ${this.icon && this.iconRight ? this._renderIcon() : y}
74
+ </div>
78
75
  `;
79
76
  }
80
- }, s.styles = [y, k], s.classMap = {}, s);
81
- o([
82
- r({ reflect: !0 })
83
- ], e.prototype, "as", 2);
84
- o([
85
- r({ reflect: !0 })
86
- ], e.prototype, "color", 2);
87
- o([
88
- r({ type: Boolean, reflect: !0 })
89
- ], e.prototype, "disabled", 2);
90
- o([
91
- r()
92
- ], e.prototype, "download", 2);
93
- o([
94
- r()
95
- ], e.prototype, "href", 2);
96
- o([
97
- r()
98
- ], e.prototype, "icon", 2);
99
- o([
100
- r({ attribute: "icon-placement", reflect: !0 })
101
- ], e.prototype, "iconPlacement", 2);
102
- o([
103
- r({ type: Object, attribute: !1 })
104
- ], e.prototype, "onClick", 1);
105
- o([
106
- r()
107
- ], e.prototype, "rel", 2);
108
- o([
109
- r({ reflect: !0 })
110
- ], e.prototype, "route", 2);
111
- o([
112
- r({ type: Boolean, reflect: !0 })
113
- ], e.prototype, "stretch", 2);
114
- o([
115
- r()
116
- ], e.prototype, "target", 2);
117
- o([
118
- r()
119
- ], e.prototype, "type", 2);
120
- let L = e;
77
+ };
78
+ a = new WeakMap(), l = new WeakMap(), u.styles = [S, A];
79
+ let r = u;
80
+ s([
81
+ n({ type: String })
82
+ ], r.prototype, "as", 2);
83
+ s([
84
+ n({ type: String })
85
+ ], r.prototype, "color", 2);
86
+ s([
87
+ n({ type: Boolean })
88
+ ], r.prototype, "disabled", 2);
89
+ s([
90
+ n({ type: Boolean })
91
+ ], r.prototype, "download", 2);
92
+ s([
93
+ n({ type: String })
94
+ ], r.prototype, "href", 2);
95
+ s([
96
+ n({ type: String })
97
+ ], r.prototype, "icon", 2);
98
+ s([
99
+ n({ type: Boolean, attribute: "icon-right" })
100
+ ], r.prototype, "iconRight", 2);
101
+ s([
102
+ n({ type: String })
103
+ ], r.prototype, "rel", 2);
104
+ s([
105
+ n({ type: String })
106
+ ], r.prototype, "route", 2);
107
+ s([
108
+ n({ type: Boolean })
109
+ ], r.prototype, "stretch", 2);
110
+ s([
111
+ n({ type: String })
112
+ ], r.prototype, "target", 2);
113
+ s([
114
+ v("as")
115
+ ], r.prototype, "_handleAsChange", 1);
116
+ s([
117
+ v(Object.keys(w))
118
+ ], r.prototype, "_handleStateChange", 1);
121
119
  export {
122
- L as SkfLink
120
+ r as SkfLink
123
121
  };
@@ -1,61 +1,69 @@
1
- import { css as r } from "lit";
2
- const e = r`
3
- /* stylelint-disable selector-class-pattern */
1
+ import { css as o } from "lit";
2
+ const e = o`
4
3
  @layer components {
5
- :host {
6
- contain: layout;
7
- display: inline;
8
- }
4
+ @layer base {
5
+ :host {
6
+ contain: layout;
7
+ cursor: pointer;
8
+ display: inline;
9
+ }
9
10
 
10
- .link {
11
- align-items: center;
12
- color: var(--_skf-link-state-color, var(--_skf-link-color));
13
- display: inline-flex;
14
- font-weight: var(--skf-font-weight-bold);
15
- gap: 0 var(--skf-spacing-25);
16
- vertical-align: top;
11
+ #root {
12
+ --_skf-link-color: var(--skf-interactive-text-color-primary);
13
+ --_skf-link-color-active: var(--skf-interactive-text-color-primary-active);
14
+ --_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
15
+ --_skf-link-color-hover: var(--skf-interactive-text-color-primary-hover);
16
+ --_skf-link-outline-color: var(--skf-interactive-text-color-primary);
17
17
 
18
- &:is(a) {
19
- text-decoration: none;
18
+ align-items: center;
19
+ color: var(--_skf-link-color);
20
+ display: inline-flex;
21
+ font-weight: var(--skf-font-weight-bold);
22
+ gap: 0 var(--skf-spacing-25);
23
+ vertical-align: top;
20
24
  }
25
+ }
21
26
 
22
- &:disabled {
23
- --_skf-link-state-color: var(--_skf-link-color-disabled);
24
- }
27
+ @layer states {
28
+ :host(:focus-visible) {
29
+ outline: unset;
25
30
 
26
- &:hover {
27
- --_skf-link-state-color: var(--_skf-link-color-hover);
31
+ #root {
32
+ border-radius: var(--skf-border-radius-sm);
33
+ outline: var(--skf-border-width-md) solid var(--_skf-link-outline-color);
34
+ outline-offset: var(--skf-size-2);
35
+ }
28
36
  }
29
37
 
30
- &:focus-visible {
31
- border-radius: var(--skf-border-radius-sm);
32
- outline: var(--skf-border-width-md) solid var(--_skf-link-outline-color);
33
- outline-offset: var(--skf-size-2);
34
- }
35
- }
38
+ :host([aria-disabled]) {
39
+ #root {
40
+ --_skf-link-color: var(--_skf-link-color-disabled);
36
41
 
37
- .link--color-primary {
38
- --_skf-link-color: var(--skf-interactive-text-color-primary);
39
- --_skf-link-color-active: var(--skf-interactive-text-color-primary-active);
40
- --_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
41
- --_skf-link-color-hover: var(--skf-interactive-text-color-primary-hover);
42
- --_skf-link-outline-color: var(--skf-interactive-text-color-primary);
43
- }
42
+ cursor: not-allowed;
43
+ }
44
44
 
45
- .link--color-inverse {
46
- --_skf-link-color: var(--skf-interactive-text-color-inverse);
47
- --_skf-link-color-active: var(--skf-interactive-text-color-inverse-active);
48
- --_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
49
- --_skf-link-color-hover: var(--skf-interactive-text-color-inverse-hover);
50
- --_skf-link-outline-color: var(--skf-interactive-text-color-inverse);
51
- }
45
+ skf-icon {
46
+ color: inherit;
47
+ }
48
+ }
52
49
 
53
- .link--icon-right {
54
- flex-direction: row-reverse;
50
+ :host(:not([aria-disabled]):hover) #root {
51
+ --_skf-link-color: var(--_skf-link-color-hover);
52
+ }
55
53
  }
56
54
 
57
- .link--stretch {
58
- inline-size: 100%;
55
+ @layer mods {
56
+ :host(:state(inverse)) #root {
57
+ --_skf-link-color: var(--skf-interactive-text-color-inverse);
58
+ --_skf-link-color-active: var(--skf-interactive-text-color-inverse-active);
59
+ --_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
60
+ --_skf-link-color-hover: var(--skf-interactive-text-color-inverse-hover);
61
+ --_skf-link-outline-color: var(--skf-interactive-text-color-inverse);
62
+ }
63
+
64
+ :host(:state(stretch)) #root {
65
+ inline-size: 100%;
66
+ }
59
67
  }
60
68
  }
61
69
  `;
@@ -1,5 +1,6 @@
1
1
  import { SkfElement } from '../../internal/components/skf-element.js';
2
2
  import { type CSSResultGroup } from 'lit';
3
+ type Size = 'md' | 'sm';
3
4
  /**
4
5
  * The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities
5
6
  *
@@ -10,12 +11,13 @@ import { type CSSResultGroup } from 'lit';
10
11
  export declare class SkfLoader extends SkfElement {
11
12
  #private;
12
13
  static styles: CSSResultGroup;
13
- /** Defines the aria-label */
14
- ariaLabel: string;
15
14
  /** If true, inverts the color (to be used on colored backgrounds) */
16
15
  invert: boolean;
17
16
  /** Defines the size of the loader */
18
- size?: 'md' | 'sm';
17
+ size: Size;
19
18
  connectedCallback(): void;
19
+ /** @internal */
20
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
20
21
  render(): import("lit").TemplateResult<1>;
21
22
  }
23
+ export {};
@@ -1,29 +1,40 @@
1
- var m = (t) => {
1
+ var f = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var f = (t, e, r) => e.has(t) || m("Cannot " + r);
5
- var n = (t, e, r) => (f(t, e, "read from private field"), r ? r.call(t) : e.get(t)), h = (t, e, r) => e.has(t) ? m("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), u = (t, e, r, l) => (f(t, e, "write to private field"), l ? l.call(t, r) : e.set(t, r), r);
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
6
  import { SkfElement as b } from "../../internal/components/skf-element.js";
7
- import { componentStyles as y } from "../../styles/component.styles.js";
8
- import { html as g } from "lit";
9
- import { property as c } from "lit/decorators.js";
10
- import { styles as C } from "./loader.styles.js";
11
- var _ = Object.defineProperty, p = (t, e, r, l) => {
12
- for (var i = void 0, o = t.length - 1, v; o >= 0; o--)
13
- (v = t[o]) && (i = v(e, r, i) || i);
14
- return i && _(e, r, i), i;
15
- }, s;
7
+ import { stateMap as g } from "../../internal/helpers/stateMap.js";
8
+ import { watch as C } from "../../internal/helpers/watch.js";
9
+ import { componentStyles as O } from "../../styles/component.styles.js";
10
+ import { html as P } from "lit";
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
+ };
18
+ const u = {
19
+ invert: "invert",
20
+ size: ["md", "sm"]
21
+ };
22
+ var a, p;
16
23
  const d = class d extends b {
17
24
  constructor() {
18
25
  super(...arguments);
19
- h(this, s);
20
- u(this, s, this.attachInternals()), 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";
21
29
  }
22
30
  connectedCallback() {
23
- super.connectedCallback(), n(this, s).role = "progressbar", n(this, s).ariaLive = "polite";
31
+ super.connectedCallback(), this.role = "progressbar", this.ariaLive = "polite";
32
+ }
33
+ _handleStateChange(r, i, s) {
34
+ g(c(this, p), u[r]).set(s);
24
35
  }
25
36
  render() {
26
- return g`
37
+ return P`
27
38
  <div id="root">
28
39
  <div class="circle"></div>
29
40
  <div class="circle"></div>
@@ -32,17 +43,17 @@ const d = class d extends b {
32
43
  `;
33
44
  }
34
45
  };
35
- s = new WeakMap(), d.styles = [y, C];
36
- let a = d;
37
- p([
38
- c({ reflect: !0, attribute: "aria-label" })
39
- ], a.prototype, "ariaLabel");
40
- p([
41
- c({ type: Boolean })
42
- ], a.prototype, "invert");
43
- p([
44
- c({ reflect: !0 })
45
- ], a.prototype, "size");
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([
55
+ C(Object.keys(u))
56
+ ], o.prototype, "_handleStateChange", 1);
46
57
  export {
47
- a as SkfLoader
58
+ o as SkfLoader
48
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
 
@@ -33,17 +33,13 @@ const o = a`
33
33
  }
34
34
 
35
35
  @layer mods {
36
- :host([invert]) {
37
- #root {
38
- --_skf-loader-color: var(--skf-bg-color-neutral-1);
39
- }
36
+ :host(:state(invert)) #root {
37
+ --_skf-loader-color: var(--skf-bg-color-neutral-1);
40
38
  }
41
39
 
42
- :host([size='sm']) {
43
- #root {
44
- --_skf-loader-gap: var(--skf-spacing-25);
45
- --_skf-loader-size: var(--skf-size-4);
46
- }
40
+ :host(:state(sm)) #root {
41
+ --_skf-loader-gap: var(--skf-spacing-25);
42
+ --_skf-loader-size: var(--skf-size-4);
47
43
  }
48
44
  }
49
45
  }
@@ -9,5 +9,5 @@ import { type CSSResultGroup } from 'lit';
9
9
  */
10
10
  export declare class SkfMenuItem extends SkfLink {
11
11
  static styles: CSSResultGroup;
12
- constructor();
12
+ connectedCallback(): void;
13
13
  }
@@ -1,13 +1,13 @@
1
- import { SkfLink as s } from "../link/link.component.js";
1
+ import { SkfLink as t } from "../link/link.component.js";
2
2
  import "lit";
3
- import { styles as e } from "./menu-item.styles.js";
4
- const t = class t extends s {
5
- constructor() {
6
- super(), this.role = "menuitem", s.classMap = { "menu-item": !0 };
3
+ import { styles as l } from "./menu-item.styles.js";
4
+ const s = class s extends t {
5
+ connectedCallback() {
6
+ super.connectedCallback(), this.role = "menuitem";
7
7
  }
8
8
  };
9
- t.styles = [s.styles, e];
10
- let r = t;
9
+ s.styles = [t.styles, l];
10
+ let e = s;
11
11
  export {
12
- r as SkfMenuItem
12
+ e as SkfMenuItem
13
13
  };
@@ -1,19 +1,23 @@
1
- import { css as e } from "lit";
2
- const s = e`
1
+ import { css as o } from "lit";
2
+ const r = o`
3
3
  @layer components {
4
- .menu-item {
4
+ :host {
5
+ display: block;
6
+ }
7
+
8
+ #root {
5
9
  block-size: var(--skf-size-44);
6
10
  display: flex;
7
11
  padding-inline: var(--skf-spacing-75);
12
+ }
13
+ }
8
14
 
9
- @media screen and (any-hover: hover) {
10
- &:hover {
11
- background-color: var(--skf-color-blue-lighest);
12
- }
13
- }
15
+ @layer states {
16
+ :host(:not([aria-disabled]):hover) #root {
17
+ background-color: var(--skf-color-blue-lightest);
14
18
  }
15
19
  }
16
20
  `;
17
21
  export {
18
- s as styles
22
+ r as styles
19
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
- i.addEventListener(this.triggerEvent, this.open.bind(this), { signal: this.signal });
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
  };
@@ -10,9 +10,13 @@ import { type CSSResultGroup } from 'lit';
10
10
  * @tagname skf-nav-item
11
11
  */
12
12
  export declare class SkfNavItem extends SkfElement {
13
+ #private;
13
14
  static styles: CSSResultGroup;
14
15
  href: string;
15
16
  icon?: Icon;
17
+ vertical: boolean;
16
18
  connectedCallback(): void;
19
+ /** @internal */
20
+ _handleStateChange(): void;
17
21
  render(): import("lit").TemplateResult<1>;
18
22
  }