@skf-design-system/ui-components 1.0.0-beta.5 → 1.0.0-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 (130) hide show
  1. package/dist/components/accordion/accordion-item.d.ts +1 -1
  2. package/dist/components/accordion/accordion.component.d.ts +4 -4
  3. package/dist/components/accordion/accordion.component.js +18 -17
  4. package/dist/components/accordion/accordion.styles.d.ts +1 -2
  5. package/dist/components/accordion/accordion.styles.js +5 -4
  6. package/dist/components/alert/alert.component.d.ts +3 -3
  7. package/dist/components/alert/alert.component.js +44 -33
  8. package/dist/components/alert/alert.styles.d.ts +1 -2
  9. package/dist/components/alert/alert.styles.js +29 -24
  10. package/dist/components/button/button.component.d.ts +26 -4
  11. package/dist/components/button/button.component.js +78 -54
  12. package/dist/components/button/button.styles.js +1 -0
  13. package/dist/components/card/card.component.d.ts +4 -4
  14. package/dist/components/card/card.component.js +35 -24
  15. package/dist/components/card/card.styles.d.ts +1 -2
  16. package/dist/components/card/card.styles.js +14 -12
  17. package/dist/components/checkbox/checkbox.component.d.ts +11 -12
  18. package/dist/components/checkbox/checkbox.component.js +95 -89
  19. package/dist/components/collapse/collapse.component.d.ts +8 -8
  20. package/dist/components/collapse/collapse.component.js +42 -34
  21. package/dist/components/collapse/collapse.styles.js +15 -14
  22. package/dist/components/dialog/dialog.component.d.ts +75 -0
  23. package/dist/components/dialog/dialog.component.js +189 -0
  24. package/dist/components/dialog/dialog.d.ts +8 -0
  25. package/dist/components/dialog/dialog.js +6 -0
  26. package/dist/components/dialog/dialog.styles.js +91 -0
  27. package/dist/components/divider/divider.component.d.ts +3 -3
  28. package/dist/components/divider/divider.component.js +39 -27
  29. package/dist/components/divider/divider.styles.d.ts +1 -2
  30. package/dist/components/divider/divider.styles.js +26 -26
  31. package/dist/components/heading/heading.component.d.ts +2 -2
  32. package/dist/components/icon/icon.component.d.ts +1 -1
  33. package/dist/components/input/input.component.d.ts +12 -11
  34. package/dist/components/input/input.component.js +88 -89
  35. package/dist/components/link/link.component.d.ts +6 -6
  36. package/dist/components/link/link.component.js +20 -14
  37. package/dist/components/link/link.styles.js +36 -40
  38. package/dist/components/loader/loader.component.d.ts +2 -2
  39. package/dist/components/loader/loader.component.js +32 -25
  40. package/dist/components/loader/loader.styles.js +11 -10
  41. package/dist/components/logo/logo.component.d.ts +3 -3
  42. package/dist/components/logo/logo.component.js +25 -14
  43. package/dist/components/logo/logo.styles.d.ts +1 -2
  44. package/dist/components/logo/logo.styles.js +11 -9
  45. package/dist/components/progress/progress.component.d.ts +22 -0
  46. package/dist/components/progress/progress.component.js +49 -0
  47. package/dist/components/progress/progress.d.ts +8 -0
  48. package/dist/components/progress/progress.js +6 -0
  49. package/dist/components/progress/progress.styles.js +48 -0
  50. package/dist/components/radio/radio.component.d.ts +7 -9
  51. package/dist/components/radio/radio.component.js +93 -77
  52. package/dist/components/select/select.component.d.ts +2 -2
  53. package/dist/components/select/select.component.js +16 -13
  54. package/dist/components/select/select.controllers.d.ts +1 -1
  55. package/dist/components/select-option/select-option.component.d.ts +1 -1
  56. package/dist/components/select-option/select-option.controllers.d.ts +1 -1
  57. package/dist/components/select-option-group/select-option-group.component.d.ts +1 -1
  58. package/dist/components/switch/switch.component.d.ts +2 -2
  59. package/dist/components/switch/switch.component.js +17 -7
  60. package/dist/components/switch/switch.styles.js +16 -13
  61. package/dist/components/tab/tab.component.d.ts +29 -0
  62. package/dist/components/tab/tab.component.js +57 -0
  63. package/dist/components/tab/tab.d.ts +8 -0
  64. package/dist/components/tab/tab.js +6 -0
  65. package/dist/components/tab/tab.styles.d.ts +1 -0
  66. package/dist/components/tab/tab.styles.js +123 -0
  67. package/dist/components/tab-group/tab-group.component.d.ts +43 -0
  68. package/dist/components/tab-group/tab-group.component.js +98 -0
  69. package/dist/components/tab-group/tab-group.d.ts +8 -0
  70. package/dist/components/tab-group/tab-group.js +6 -0
  71. package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
  72. package/dist/components/tab-group/tab-group.styles.js +75 -0
  73. package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
  74. package/dist/components/tab-panel/tab-panel.component.js +36 -0
  75. package/dist/components/tab-panel/tab-panel.d.ts +8 -0
  76. package/dist/components/tab-panel/tab-panel.js +6 -0
  77. package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
  78. package/dist/components/tab-panel/tab-panel.styles.js +13 -0
  79. package/dist/components/tag/tag.component.d.ts +2 -2
  80. package/dist/components/tag/tag.component.js +61 -45
  81. package/dist/components/tag/tag.styles.js +30 -28
  82. package/dist/components/textarea/textarea.component.d.ts +4 -4
  83. package/dist/components/textarea/textarea.component.js +5 -5
  84. package/dist/components/toast/toast.component.d.ts +1 -1
  85. package/dist/components/toast/toast.component.js +13 -13
  86. package/dist/components/toast/toast.singleton.d.ts +3 -3
  87. package/dist/components/toast/toast.styles.d.ts +1 -0
  88. package/dist/components/toast-item/toast-item.component.d.ts +1 -1
  89. package/dist/components/toast-item/toast-item.component.js +1 -1
  90. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +2 -2
  91. package/dist/components/toast-wrapper/toast-wrapper.component.js +1 -1
  92. package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
  93. package/dist/custom-elements.json +1170 -511
  94. package/dist/index.d.ts +5 -0
  95. package/dist/index.js +59 -44
  96. package/dist/internal/components/formBase.d.ts +1 -0
  97. package/dist/internal/components/formBase.js +11 -11
  98. package/dist/internal/components/hint/hint.component.d.ts +2 -2
  99. package/dist/internal/components/skf-element.js +26 -25
  100. package/dist/internal/helpers/hintSeverity.d.ts +1 -1
  101. package/dist/internal/helpers/watch.d.ts +27 -0
  102. package/dist/internal/helpers/watch.js +28 -0
  103. package/dist/internal/templates/asterisk.d.ts +1 -1
  104. package/dist/internal/templates/asterisk.js +7 -6
  105. package/dist/react/index.d.ts +7 -2
  106. package/dist/react/index.js +7 -2
  107. package/dist/react/skf-button/index.d.ts +7 -1
  108. package/dist/react/skf-button/index.js +5 -1
  109. package/dist/react/skf-dialog/index.d.ts +15 -0
  110. package/dist/react/skf-dialog/index.js +19 -0
  111. package/dist/react/skf-progress/index.d.ts +3 -0
  112. package/dist/react/skf-progress/index.js +13 -0
  113. package/dist/react/skf-tab/index.d.ts +12 -0
  114. package/dist/react/skf-tab/index.js +18 -0
  115. package/dist/react/skf-tab-group/index.d.ts +3 -0
  116. package/dist/react/skf-tab-group/index.js +13 -0
  117. package/dist/react/skf-tab-panel/index.d.ts +3 -0
  118. package/dist/react/skf-tab-panel/index.js +13 -0
  119. package/dist/styles/component.styles.js +15 -2
  120. package/dist/types/jsx/custom-element-jsx.d.ts +246 -101
  121. package/dist/types/vue/index.d.ts +215 -65
  122. package/dist/vscode.html-custom-data.json +276 -182
  123. package/dist/web-types.json +556 -248
  124. package/package.json +33 -32
  125. /package/dist/components/{toast-wrapper/toast-wrapper.style.d.ts → dialog/dialog.styles.d.ts} +0 -0
  126. /package/dist/components/{toast/toast.style.d.ts → progress/progress.styles.d.ts} +0 -0
  127. /package/dist/components/toast/{toast.style.js → toast.styles.js} +0 -0
  128. /package/dist/components/toast-item/{toast-item.style.d.ts → toast-item.styles.d.ts} +0 -0
  129. /package/dist/components/toast-item/{toast-item.style.js → toast-item.styles.js} +0 -0
  130. /package/dist/components/toast-wrapper/{toast-wrapper.style.js → toast-wrapper.styles.js} +0 -0
@@ -5,46 +5,46 @@ import { hintSeverity as v } from "../../internal/helpers/hintSeverity.js";
5
5
  import { Asterisk as y } from "../../internal/templates/asterisk.js";
6
6
  import f from "../../styles/component.styles.js";
7
7
  import { html as h, nothing as d } from "lit";
8
- import { property as s, state as p, query as _, queryAssignedNodes as $ } from "lit/decorators.js";
9
- import { ifDefined as a } from "lit/directives/if-defined.js";
8
+ import { property as e, state as c, query as _, queryAssignedNodes as $ } from "lit/decorators.js";
9
+ import { ifDefined as n } from "lit/directives/if-defined.js";
10
10
  import { live as g } from "lit/directives/live.js";
11
11
  import { InputNumberController as w, InputPasswordController as E } from "./input.controllers.js";
12
- import C from "./input.styles.js";
13
- var S = Object.defineProperty, L = Object.getOwnPropertyDescriptor, i = (c, e, r, n) => {
14
- for (var o = n > 1 ? void 0 : n ? L(e, r) : e, l = c.length - 1, u; l >= 0; l--)
15
- (u = c[l]) && (o = (n ? u(e, r, o) : u(o)) || o);
16
- return n && o && S(e, r, o), o;
12
+ import A from "./input.styles.js";
13
+ var C = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (m, s, r, a) => {
14
+ for (var o = a > 1 ? void 0 : a ? S(s, r) : s, l = m.length - 1, u; l >= 0; l--)
15
+ (u = m[l]) && (o = (a ? u(s, r, o) : u(o)) || o);
16
+ return a && o && C(s, r, o), o;
17
17
  };
18
- const m = class m extends b {
18
+ const p = class p extends b {
19
19
  constructor() {
20
20
  super(...arguments), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.inputmode = "text", this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this.invalid = !1, this._buttonDown = !1, this._numberController = new w(this), this._passwordController = new E(this), this._handleInput = () => {
21
21
  this.value = this.$input.value || "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
22
- }, this._resetValue = (e) => {
22
+ }, this._resetValue = (s) => {
23
23
  var r;
24
- e.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._internals.setFormValue(this.value), this.$input.focus();
25
- }, this._handlePressStart = (e) => {
26
- this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(e);
24
+ s.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._internals.setFormValue(this.value), this.$input.focus();
25
+ }, this._handlePressStart = (s) => {
26
+ this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(s);
27
27
  }, this._handlePressEnd = () => {
28
28
  this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
29
- }, this._renderNumberButton = (e) => h`
29
+ }, this._renderNumberButton = (s) => h`
30
30
  <button
31
31
  ?disabled=${this.disabled}
32
32
  @click=${(r) => {
33
- this._numberController.handleActionBtnClick(r, e);
33
+ this._numberController.handleActionBtnClick(r, s);
34
34
  }}
35
35
  @mousedown=${this._handlePressStart}
36
36
  @mouseup=${this._handlePressEnd}
37
37
  @mouseleave=${this._handlePressEnd}
38
- aria-label="${e === "inc" ? "Increment" : "Decrement"}"
38
+ aria-label="${s === "inc" ? "Increment" : "Decrement"}"
39
39
  class="number skf-icon-host"
40
40
  type="button"
41
41
  >
42
- <skf-icon name="${e === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
42
+ <skf-icon name="${s === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
43
43
  </button>
44
44
  `, this._renderPasswordButton = () => h`
45
45
  <button
46
46
  @click=${this._passwordController.toggleVisibility}
47
- aria-label=${a(this._passwordController._buttonAriaLabel)}
47
+ aria-label=${n(this._passwordController._buttonAriaLabel)}
48
48
  class="password skf-icon-host"
49
49
  type="button"
50
50
  @mousedown="${this._handlePressStart}"
@@ -59,7 +59,7 @@ const m = class m extends b {
59
59
  @mousedown=${this._handlePressStart}
60
60
  @mouseup=${this._handlePressEnd}
61
61
  @mouseleave=${this._handlePressEnd}
62
- aria-label=${a(this.buttonAriaLabelClear)}
62
+ aria-label=${n(this.buttonAriaLabelClear)}
63
63
  class="search skf-icon-host"
64
64
  type="button"
65
65
  >
@@ -67,13 +67,10 @@ const m = class m extends b {
67
67
  </button>
68
68
  `, this._onBlur = () => {
69
69
  this._buttonDown && this.$input.focus();
70
- }, this._handleSlotChange = () => {
71
- var e, r;
72
- console.log("slot change"), this._noLabel = (this._defaultSlot.length === 0 || !((r = (e = this._defaultSlot[0]) == null ? void 0 : e.textContent) != null && r.trim())) && !this.label;
73
70
  };
74
71
  }
75
- set customInvalid(e) {
76
- this.customError = e || "";
72
+ set customInvalid(s) {
73
+ this.customError = s || "";
77
74
  }
78
75
  get customInvalid() {
79
76
  return this.customError;
@@ -81,12 +78,12 @@ const m = class m extends b {
81
78
  firstUpdated() {
82
79
  this.$input.addEventListener("change", () => {
83
80
  this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
84
- }), this.addEventListener("invalid", (e) => {
85
- this._pristine = !1, this.invalid = !0, this.customErrorDisplay && e.preventDefault();
86
- }), this.addEventListener("reset", this._resetValue), this._handleSlotChange(), this.validateInput();
81
+ }), this.addEventListener("invalid", (s) => {
82
+ this._pristine = !1, this.invalid = !0, this.customErrorDisplay && s.preventDefault();
83
+ }), this.addEventListener("reset", this._resetValue), this.validateInput();
87
84
  }
88
- willUpdate(e) {
89
- if (e.has("invalid"))
85
+ willUpdate(s) {
86
+ if (s.has("invalid"))
90
87
  if (this.invalid) {
91
88
  this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
92
89
  const r = this._internals.validationMessage;
@@ -94,10 +91,10 @@ const m = class m extends b {
94
91
  } else
95
92
  this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
96
93
  }
97
- attributeChangedCallback(e, r, n) {
98
- if (super.attributeChangedCallback(e, r, n), e === "value" && this._internals.setFormValue(n), e === "custom-invalid")
99
- if (typeof n == "string") {
100
- const l = String(n).trim();
94
+ attributeChangedCallback(s, r, a) {
95
+ if (super.attributeChangedCallback(s, r, a), s === "value" && this._internals.setFormValue(a), s === "custom-invalid")
96
+ if (typeof a == "string") {
97
+ const l = this.withFallback(a);
101
98
  this._pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
102
99
  } else
103
100
  this._internals.setValidity({}), this.validateInput();
@@ -110,36 +107,37 @@ const m = class m extends b {
110
107
  this._internals.setValidity({ customError: this._internals.validity.customError });
111
108
  else {
112
109
  this.invalid = !this._pristine && !r.valid;
113
- let n;
114
- for (n in r) {
115
- const o = `data-${n.toString()}`;
116
- if (r[n] && !this.hasAttribute(o) && this.debug && console.log(
110
+ let a;
111
+ for (a in r) {
112
+ const o = `data-${a.toString()}`;
113
+ if (r[a] && !this.hasAttribute(o) && this.debug && console.log(
117
114
  `Add custom message on ${this.localName} using attribute: ${o.toUpperCase()}="Your custom message"`
118
- ), r[n]) {
119
- this.validationError = n.toString();
115
+ ), r[a]) {
116
+ this.validationError = a.toString();
120
117
  const l = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
121
118
  this._internals.setValidity(
122
119
  { [this.validationError]: !0, customError: this._internals.validity.customError },
123
- l ?? ""
120
+ this.withFallback(l)
124
121
  ), this.invalid && this.customErrorDisplay && this.checkValidity();
125
122
  }
126
123
  }
127
124
  }
128
125
  }
129
126
  render() {
130
- var e, r;
127
+ var r, a, o, l;
128
+ const s = (this._defaultSlot.length === 0 || !((a = (r = this._defaultSlot[0]) == null ? void 0 : r.textContent) != null && a.trim())) && !this.label;
131
129
  return h`
132
130
  <div id="root">
133
131
  <label>
134
- <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${this._noLabel} id="label">
135
- <slot @slotchange=${this._handleSlotChange}>${this.label}</slot>
132
+ <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${s} id="label">
133
+ <slot>${this.label}</slot>
136
134
  ${this.required ? y(this.requiredLabel) : null}
137
135
  </div>
138
136
  <div id="input">
139
137
  ${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : d}
140
138
  <div
141
- data-leading=${a(this.leading)}
142
- data-trailing=${a(this.trailing)}
139
+ data-leading=${n(this.leading)}
140
+ data-trailing=${n(this.trailing)}
143
141
  id="affix"
144
142
  >
145
143
  <input
@@ -149,20 +147,21 @@ const m = class m extends b {
149
147
  .value=${g(this.value)}
150
148
  @blur=${this._onBlur}
151
149
  @input=${this._handleInput}
152
- aria-describedby=${a((e = this.hint) != null && e.trim() ? "hint" : d)}
153
- aria-errormessage=${a((r = this.hint) != null && r.trim() ? "hint" : d)}
150
+ autocomplete=${this.autocomplete}
151
+ aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" : d)}
152
+ aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" : d)}
154
153
  aria-invalid=${!!this.invalid}
155
154
  autocomplete="off"
156
155
  data-testid="field-input"
157
- inputmode=${a(this.inputMode)}
158
- max=${a(this.max)}
159
- maxlength=${a(this.maxLength)}
160
- min=${a(this.min)}
161
- minlength=${a(this.minLength)}
162
- name=${a(this.name)}
163
- pattern=${a(this.pattern)}
164
- placeholder=${a(this.placeholder)}
165
- type=${a(
156
+ inputmode=${n(this.inputMode)}
157
+ max=${n(this.max)}
158
+ maxlength=${n(this.maxLength)}
159
+ min=${n(this.min)}
160
+ minlength=${n(this.minLength)}
161
+ name=${n(this.name)}
162
+ pattern=${n(this.pattern)}
163
+ placeholder=${n(this.placeholder)}
164
+ type=${n(
166
165
  this.type === "password" ? this._passwordController._type : this.type
167
166
  )}
168
167
  />
@@ -180,7 +179,7 @@ const m = class m extends b {
180
179
  <skf-hint
181
180
  aria-live=${this.invalid ? "assertive" : "polite"}
182
181
  id="hint"
183
- severity=${a(v(this.severity, this.invalid))}
182
+ severity=${n(v(this.severity, this.invalid))}
184
183
  >${this.customInvalid ? this.customInvalid : this.hint}
185
184
  </skf-hint>
186
185
  `}
@@ -188,94 +187,94 @@ const m = class m extends b {
188
187
  `;
189
188
  }
190
189
  };
191
- m.styles = [f, C];
192
- let t = m;
190
+ p.styles = [f, A];
191
+ let t = p;
193
192
  i([
194
- s({ attribute: "button-aria-label-clear" })
193
+ e({ type: String })
194
+ ], t.prototype, "autocomplete", 2);
195
+ i([
196
+ e({ attribute: "button-aria-label-clear" })
195
197
  ], t.prototype, "buttonAriaLabelClear", 2);
196
198
  i([
197
- s({ attribute: "button-aria-label-hide" })
199
+ e({ attribute: "button-aria-label-hide" })
198
200
  ], t.prototype, "buttonAriaLabelHide", 2);
199
201
  i([
200
- s({ attribute: "button-aria-label-show" })
202
+ e({ attribute: "button-aria-label-show" })
201
203
  ], t.prototype, "buttonAriaLabelShow", 2);
202
204
  i([
203
- s({ attribute: "custom-invalid", reflect: !0 })
205
+ e({ attribute: "custom-invalid", reflect: !0 })
204
206
  ], t.prototype, "customInvalid", 1);
205
207
  i([
206
- s({ type: Boolean })
208
+ e({ type: Boolean })
207
209
  ], t.prototype, "debug", 2);
208
210
  i([
209
- s({ type: Boolean, attribute: "hide-label" })
211
+ e({ type: Boolean, attribute: "hide-label" })
210
212
  ], t.prototype, "hideLabel", 2);
211
213
  i([
212
- s()
214
+ e()
213
215
  ], t.prototype, "hint", 2);
214
216
  i([
215
- s({ type: String })
217
+ e({ type: String })
216
218
  ], t.prototype, "inputmode", 2);
217
219
  i([
218
- s()
220
+ e()
219
221
  ], t.prototype, "label", 2);
220
222
  i([
221
- s()
223
+ e()
222
224
  ], t.prototype, "leading", 2);
223
225
  i([
224
- s()
226
+ e()
225
227
  ], t.prototype, "max", 2);
226
228
  i([
227
- s({ type: Number, attribute: "maxlength" })
229
+ e({ type: Number, attribute: "maxlength" })
228
230
  ], t.prototype, "maxLength", 2);
229
231
  i([
230
- s()
232
+ e()
231
233
  ], t.prototype, "min", 2);
232
234
  i([
233
- s({ type: Number, attribute: "minlength" })
235
+ e({ type: Number, attribute: "minlength" })
234
236
  ], t.prototype, "minLength", 2);
235
237
  i([
236
- s()
238
+ e()
237
239
  ], t.prototype, "name", 2);
238
240
  i([
239
- p()
240
- ], t.prototype, "_noLabel", 2);
241
- i([
242
- s()
241
+ e()
243
242
  ], t.prototype, "pattern", 2);
244
243
  i([
245
- s()
244
+ e()
246
245
  ], t.prototype, "placeholder", 2);
247
246
  i([
248
- s({ type: Boolean })
247
+ e({ type: Boolean })
249
248
  ], t.prototype, "readonly", 2);
250
249
  i([
251
- s({ attribute: "required-label" })
250
+ e({ attribute: "required-label" })
252
251
  ], t.prototype, "requiredLabel", 2);
253
252
  i([
254
- s({ reflect: !0 })
253
+ e({ reflect: !0 })
255
254
  ], t.prototype, "severity", 2);
256
255
  i([
257
- s({ type: Boolean, attribute: "show-valid" })
256
+ e({ type: Boolean, attribute: "show-valid" })
258
257
  ], t.prototype, "showValid", 2);
259
258
  i([
260
- s({ reflect: !0 })
259
+ e({ reflect: !0 })
261
260
  ], t.prototype, "size", 2);
262
261
  i([
263
- s()
262
+ e()
264
263
  ], t.prototype, "trailing", 2);
265
264
  i([
266
- s()
265
+ e()
267
266
  ], t.prototype, "type", 2);
268
267
  i([
269
- s({ type: String, attribute: "validate-on" })
268
+ e({ type: String, attribute: "validate-on" })
270
269
  ], t.prototype, "validateOn", 2);
271
270
  i([
272
- s()
271
+ e()
273
272
  ], t.prototype, "value", 2);
274
273
  i([
275
- p()
274
+ c()
276
275
  ], t.prototype, "invalid", 2);
277
276
  i([
278
- p()
277
+ c()
279
278
  ], t.prototype, "_buttonDown", 2);
280
279
  i([
281
280
  _("input")
@@ -1,6 +1,6 @@
1
- import type { SkfIcon } from '@components/icon/icon.component.js';
2
- import '@components/icon/icon.js';
3
- import { SkfElement } from '@internal/components/skf-element.js';
1
+ import type { SkfIcon } from '../icon/icon.component.js';
2
+ import '../icon/icon.js';
3
+ import { SkfElement } from '../../internal/components/skf-element.js';
4
4
  import { type CSSResultGroup } from 'lit';
5
5
  /**
6
6
  * The `<skf-link>` can be used as either a regular link or a link styled semantic button
@@ -33,12 +33,12 @@ export declare class SkfLink extends SkfElement {
33
33
  icon?: SkfIcon['name'];
34
34
  /** Defines the position of the icon in relation to the text */
35
35
  iconPlacement: 'left' | 'right';
36
- /** Defines the relationship of the target object to the link object */
37
- rel: string;
36
+ /** If defined, describes the relationship between a linked resource and the current document */
37
+ rel?: string;
38
38
  /** If defined, used on conjunction with onClick property, second argument */
39
39
  route?: string;
40
40
  /** If true, fills the parents horizontal axis */
41
- stretch?: boolean;
41
+ stretch: boolean;
42
42
  /** If defined, specifies where to open the linked document */
43
43
  target?: '_blank' | '_parent' | '_self' | '_top';
44
44
  /** Defines the type of button */
@@ -1,27 +1,28 @@
1
1
  import "../icon/icon.js";
2
2
  import y from "./link.styles.js";
3
- import { SkfElement as m } from "../../internal/components/skf-element.js";
3
+ import { SkfElement as d } from "../../internal/components/skf-element.js";
4
4
  import u from "../../styles/component.styles.js";
5
5
  import "lit";
6
6
  import { property as r } from "lit/decorators.js";
7
+ import { classMap as k } from "lit/directives/class-map.js";
7
8
  import { ifDefined as n } from "lit/directives/if-defined.js";
8
- import { html as f, literal as d } from "lit/static-html.js";
9
- var k = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (h, t, i, p) => {
10
- for (var s = p > 1 ? void 0 : p ? v(t, i) : t, l = h.length - 1, c; l >= 0; l--)
11
- (c = h[l]) && (s = (p ? c(t, i, s) : c(s)) || s);
12
- return p && s && k(t, i, s), s;
9
+ import { html as f, literal as m } from "lit/static-html.js";
10
+ var v = Object.defineProperty, g = Object.getOwnPropertyDescriptor, o = (h, t, i, c) => {
11
+ for (var s = c > 1 ? void 0 : c ? g(t, i) : t, l = h.length - 1, p; l >= 0; l--)
12
+ (p = h[l]) && (s = (c ? p(t, i, s) : p(s)) || s);
13
+ return c && s && v(t, i, s), s;
13
14
  };
14
- const a = class a extends m {
15
+ const a = class a extends d {
15
16
  constructor() {
16
- super(...arguments), this.as = "a", this.color = "primary", this.iconPlacement = "left", this.rel = "noreferrer noopener", this.type = "button", this._preprocessOnClick = (t) => {
17
+ super(...arguments), this.as = "a", this.color = "primary", this.iconPlacement = "left", this.stretch = !1, this.type = "button", this._preprocessOnClick = (t) => {
17
18
  this.as === "a" && this.onClick && t.preventDefault(), t.stopPropagation(), this.emit("click");
18
19
  };
19
20
  }
20
21
  set onClick(t) {
21
22
  if (!t) return;
22
23
  this._onClick = t;
23
- const i = (p) => {
24
- t(p, this.href ?? this.route);
24
+ const i = (c) => {
25
+ t(c, this.href ?? this.route);
25
26
  };
26
27
  this._assertValidOnClick(t), this.removeEventListener("click", i), this.addEventListener("click", i);
27
28
  }
@@ -51,17 +52,22 @@ const a = class a extends m {
51
52
  `;
52
53
  }
53
54
  render() {
54
- const t = this.as === "a", i = t ? d`a` : d`button`;
55
+ const t = this.as === "a", i = t ? m`a` : m`button`;
55
56
  return f`
56
57
  <${i}
57
58
  ?disabled=${n(t ? void 0 : this.disabled)}
58
59
  @click=${this._preprocessOnClick}
60
+ class=${k({
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
+ })}
59
67
  download=${n(t ? this.download : void 0)}
60
68
  href=${n(t ? this.href : void 0)}
61
- id="root"
62
69
  rel=${n(t ? this.rel : void 0)}
63
70
  target=${n(t ? this.target : void 0)}
64
- title=${this.title}
65
71
  type=${n(t ? void 0 : this.type)}
66
72
  >
67
73
  ${this.icon && this._renderIcon()}
@@ -85,7 +91,7 @@ o([
85
91
  r({ type: String })
86
92
  ], e.prototype, "download", 2);
87
93
  o([
88
- r({ type: String, reflect: !0 })
94
+ r({ type: String })
89
95
  ], e.prototype, "href", 2);
90
96
  o([
91
97
  r({ type: String })
@@ -1,36 +1,36 @@
1
1
  import { css as r } from "lit";
2
- const e = r`
3
- :host {
4
- display: contents;
5
- }
6
-
7
- #root {
8
- align-items: center;
9
- color: var(--state-color, var(--color));
10
- display: inline-flex;
11
- flex-direction: var(--flex-direction, rows);
12
- font-weight: var(--skf-font-weight-bold);
13
- gap: var(--skf-spacing-50);
14
- justify-content: flex-start;
15
-
16
- &:disabled {
17
- --state-color: var(--color-disabled);
18
- }
19
-
20
- &:hover {
21
- --state-color: var(--color-hover);
22
- }
23
-
24
- &:focus-visible {
25
- border-radius: var(--skf-border-radius-sm);
26
- outline: var(--skf-border-width-md) solid var(--outline-color);
27
- outline-offset: var(--skf-size-2);
28
- }
29
-
30
- /**
31
- * Colors
32
- */
33
- :host([color='primary']) & {
2
+ const o = r`
3
+ /* stylelint-disable selector-class-pattern */
4
+ @layer components {
5
+ .link {
6
+ align-items: center;
7
+ color: var(--state-color, var(--color));
8
+ display: inline-flex;
9
+ flex-direction: var(--flex-direction, rows);
10
+ font-weight: var(--skf-font-weight-bold);
11
+ gap: var(--skf-spacing-50);
12
+ justify-content: flex-start;
13
+
14
+ &:is(a) {
15
+ text-decoration: none;
16
+ }
17
+
18
+ &:disabled {
19
+ --state-color: var(--color-disabled);
20
+ }
21
+
22
+ &:hover {
23
+ --state-color: var(--color-hover);
24
+ }
25
+
26
+ &:focus-visible {
27
+ border-radius: var(--skf-border-radius-sm);
28
+ outline: var(--skf-border-width-md) solid var(--outline-color);
29
+ outline-offset: var(--skf-size-2);
30
+ }
31
+ }
32
+
33
+ .link--color-primary {
34
34
  --color: var(--skf-interactive-text-color-primary);
35
35
  --color-active: var(--skf-interactive-text-color-primary-active);
36
36
  --color-disabled: var(--skf-interactive-text-color-disabled);
@@ -38,7 +38,7 @@ const e = r`
38
38
  --outline-color: var(--skf-interactive-text-color-primary);
39
39
  }
40
40
 
41
- :host([color='inverse']) & {
41
+ .link--color-inverse {
42
42
  --color: var(--skf-interactive-text-color-inverse);
43
43
  --color-active: var(--skf-interactive-text-color-inverse-active);
44
44
  --color-disabled: var(--skf-interactive-text-color-disabled);
@@ -46,19 +46,15 @@ const e = r`
46
46
  --outline-color: var(--skf-interactive-text-color-inverse);
47
47
  }
48
48
 
49
- :host([as='a']) & {
50
- text-decoration: none;
51
- }
52
-
53
- :host([icon-placement='right']) & {
49
+ .link--icon-right {
54
50
  --flex-direction: row-reverse;
55
51
  }
56
52
 
57
- :host([stretch]) & {
53
+ .link--stretch {
58
54
  inline-size: 100%;
59
55
  }
60
56
  }
61
57
  `;
62
58
  export {
63
- e as default
59
+ o as default
64
60
  };
@@ -1,4 +1,4 @@
1
- import { SkfElement } from '@internal/components/skf-element.js';
1
+ import { SkfElement } from '../../internal/components/skf-element.js';
2
2
  import { type CSSResultGroup } from 'lit';
3
3
  /**
4
4
  * The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities
@@ -13,7 +13,7 @@ export declare class SkfLoader extends SkfElement {
13
13
  /** Defines the aria-label */
14
14
  ariaLabel: string;
15
15
  /** If true, inverts the color (to be used on colored backgrounds) */
16
- invert?: boolean;
16
+ invert: boolean;
17
17
  /** Defines the size of the loader */
18
18
  size?: 'md' | 'sm';
19
19
  constructor();
@@ -1,45 +1,52 @@
1
- var m = (t) => {
2
- throw TypeError(t);
1
+ var v = (r) => {
2
+ throw TypeError(r);
3
3
  };
4
- var f = (t, r, e) => r.has(t) || m("Cannot " + e);
5
- var p = (t, r, e) => (f(t, r, "read from private field"), e ? e.call(t) : r.get(t)), h = (t, r, e) => r.has(t) ? m("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), y = (t, r, e, l) => (f(t, r, "write to private field"), l ? l.call(t, e) : r.set(t, e), e);
6
- import { SkfElement as u } from "../../internal/components/skf-element.js";
7
- import b from "../../styles/component.styles.js";
8
- import { html as g } from "lit";
4
+ var f = (r, e, t) => e.has(r) || v("Cannot " + t);
5
+ var p = (r, e, t) => (f(r, e, "read from private field"), t ? t.call(r) : e.get(r)), h = (r, e, t) => e.has(r) ? v("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), u = (r, e, t, a) => (f(r, e, "write to private field"), a ? a.call(r, t) : e.set(r, t), t);
6
+ import { SkfElement as y } from "../../internal/components/skf-element.js";
7
+ import _ from "../../styles/component.styles.js";
8
+ import { html as b } from "lit";
9
9
  import { property as n } from "lit/decorators.js";
10
- import _ from "./loader.styles.js";
11
- var x = Object.defineProperty, c = (t, r, e, l) => {
12
- for (var i = void 0, a = t.length - 1, d; a >= 0; a--)
13
- (d = t[a]) && (i = d(r, e, i) || i);
14
- return i && x(r, e, i), i;
10
+ import { classMap as g } from "lit/directives/class-map.js";
11
+ import z from "./loader.styles.js";
12
+ var x = Object.defineProperty, c = (r, e, t, a) => {
13
+ for (var i = void 0, o = r.length - 1, m; o >= 0; o--)
14
+ (m = r[o]) && (i = m(e, t, i) || i);
15
+ return i && x(e, t, i), i;
15
16
  }, s;
16
- const v = class v extends u {
17
+ const d = class d extends y {
17
18
  constructor() {
18
19
  super();
19
20
  h(this, s);
20
- this.ariaLabel = "Loading...", this.size = "md", y(this, s, this.attachInternals()), p(this, s).role = "progressbar", p(this, s).ariaLive = "polite";
21
+ this.ariaLabel = "Loading...", this.invert = !1, this.size = "md", u(this, s, this.attachInternals()), p(this, s).role = "progressbar", p(this, s).ariaLive = "polite";
21
22
  }
22
23
  render() {
23
- return g`
24
- <div id="root">
25
- <div class="circle"></div>
26
- <div class="circle"></div>
27
- <div class="circle"></div>
24
+ return b`
25
+ <div
26
+ class=${g({
27
+ loader: !0,
28
+ "loader--invert": this.invert,
29
+ "loader--small": this.size === "sm"
30
+ })}
31
+ >
32
+ <div class="loader__circle"></div>
33
+ <div class="loader__circle"></div>
34
+ <div class="loader__circle"></div>
28
35
  </div>
29
36
  `;
30
37
  }
31
38
  };
32
- s = new WeakMap(), v.styles = [b, _];
33
- let o = v;
39
+ s = new WeakMap(), d.styles = [_, z];
40
+ let l = d;
34
41
  c([
35
42
  n({ reflect: !0, attribute: "aria-label" })
36
- ], o.prototype, "ariaLabel");
43
+ ], l.prototype, "ariaLabel");
37
44
  c([
38
45
  n({ type: Boolean })
39
- ], o.prototype, "invert");
46
+ ], l.prototype, "invert");
40
47
  c([
41
48
  n({ type: String, reflect: !0 })
42
- ], o.prototype, "size");
49
+ ], l.prototype, "size");
43
50
  export {
44
- o as SkfLoader
51
+ l as SkfLoader
45
52
  };