@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,38 +1,46 @@
1
+ var f = (n) => {
2
+ throw TypeError(n);
3
+ };
4
+ var b = (n, o, t) => o.has(n) || f("Cannot " + t);
5
+ var c = (n, o, t) => (b(n, o, "read from private field"), t ? t.call(n) : o.get(n)), _ = (n, o, t) => o.has(n) ? f("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(n) : o.set(n, t), $ = (n, o, t, e) => (b(n, o, "write to private field"), e ? e.call(n, t) : o.set(n, t), t);
1
6
  import "../icon/icon.js";
2
- import { FormBase as c } from "../../internal/components/formBase.js";
7
+ import { FormBase as g } from "../../internal/components/formBase.js";
3
8
  import "../../internal/components/hint/hint.js";
4
- import { hintSeverity as b } from "../../internal/helpers/hintSeverity.js";
5
- import { watch as y } from "../../internal/helpers/watch.js";
6
- import { Asterisk as f } from "../../internal/templates/asterisk.js";
7
- import { componentStyles as _ } from "../../styles/component.styles.js";
8
- import { html as h, nothing as u } from "lit";
9
- import { state as p, property as s, query as $, queryAssignedNodes as g } from "lit/decorators.js";
10
- import { ifDefined as n } from "lit/directives/if-defined.js";
11
- import { live as w } from "lit/directives/live.js";
12
- import { InputNumberController as E, InputPasswordController as C } from "./input.controllers.js";
13
- import A from "./input.styles.js";
14
- var L = Object.defineProperty, P = Object.getOwnPropertyDescriptor, e = (v, t, r, a) => {
15
- for (var o = a > 1 ? void 0 : a ? P(t, r) : t, l = v.length - 1, d; l >= 0; l--)
16
- (d = v[l]) && (o = (a ? d(t, r, o) : d(o)) || o);
17
- return a && o && L(t, r, o), o;
18
- };
19
- const m = class m extends c {
9
+ import { hintSeverity as w } from "../../internal/helpers/hintSeverity.js";
10
+ import { watch as E } from "../../internal/helpers/watch.js";
11
+ import { Asterisk as P } from "../../internal/templates/asterisk.js";
12
+ import { componentStyles as C } from "../../styles/component.styles.js";
13
+ import { LocalizeController as k } from "../../utilities/localize.js";
14
+ import { html as p, nothing as m } from "lit";
15
+ import { state as v, property as a, query as S, queryAssignedNodes as x } from "lit/decorators.js";
16
+ import { ifDefined as l } from "lit/directives/if-defined.js";
17
+ import { live as B } from "lit/directives/live.js";
18
+ import { InputNumberController as A, InputPasswordController as V } from "./input.controllers.js";
19
+ import I from "./input.styles.js";
20
+ var L = Object.defineProperty, D = Object.getOwnPropertyDescriptor, s = (n, o, t, e) => {
21
+ for (var r = e > 1 ? void 0 : e ? D(o, t) : o, h = n.length - 1, d; h >= 0; h--)
22
+ (d = n[h]) && (r = (e ? d(o, t, r) : d(r)) || r);
23
+ return e && r && L(o, t, r), r;
24
+ }, u;
25
+ const y = class y extends g {
20
26
  constructor() {
21
- super(...arguments), this._value = "", this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.readonly = !1, this.showValid = !1, this.size = "md", this.type = "text", this.validateOn = "change", this.invalid = !1, this._buttonDown = !1, this._numberController = new E(this), this._passwordController = new C(this), this._handleInput = () => {
27
+ super(...arguments);
28
+ _(this, u);
29
+ $(this, u, new k(this)), this._value = "", this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.type = "text", this.validateOn = "change", this.invalid = !1, this._buttonDown = !1, this._numberController = new A(this), this._passwordController = new V(this), this._handleInput = () => {
22
30
  var t;
23
31
  this._value = ((t = this.$input) == null ? void 0 : t.value) ?? "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
24
32
  }, this._resetValue = (t) => {
25
- var r, a;
26
- t.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._value = this.value, this._internals.setFormValue(this.value), (a = this.$input) == null || a.focus();
33
+ var e, r;
34
+ t.stopPropagation(), this.value = ((e = this.getAttribute("value")) == null ? void 0 : e.trim()) ?? "", this._value = this.value, this._internals.setFormValue(this.value), (r = this.$input) == null || r.focus();
27
35
  }, this._handlePressStart = (t) => {
28
36
  this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(t);
29
37
  }, this._handlePressEnd = () => {
30
38
  this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
31
- }, this._renderNumberButton = (t) => h`
39
+ }, this._renderNumberButton = (t) => p`
32
40
  <button
33
41
  ?disabled=${this.disabled}
34
- @click=${(r) => {
35
- this._numberController.handleActionBtnClick(r, t);
42
+ @click=${(e) => {
43
+ this._numberController.handleActionBtnClick(e, t);
36
44
  }}
37
45
  @mousedown=${this._handlePressStart}
38
46
  @mouseup=${this._handlePressEnd}
@@ -43,10 +51,10 @@ const m = class m extends c {
43
51
  >
44
52
  <skf-icon name="${t === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
45
53
  </button>
46
- `, this._renderPasswordButton = () => h`
54
+ `, this._renderPasswordButton = () => p`
47
55
  <button
48
56
  @click=${this._passwordController.toggleVisibility}
49
- aria-label=${n(this._passwordController._buttonAriaLabel)}
57
+ aria-label=${this._passwordController._type === "password" ? c(this, u).term("showPassword") : c(this, u).term("hidePassword")}
50
58
  class="password skf-icon-host"
51
59
  type="button"
52
60
  @mousedown="${this._handlePressStart}"
@@ -55,13 +63,13 @@ const m = class m extends c {
55
63
  >
56
64
  <skf-icon name=${this._passwordController._icon} size="sm"></skf-icon>
57
65
  </button>
58
- `, this._renderSearchButton = () => h`
66
+ `, this._renderSearchButton = () => p`
59
67
  <button
60
68
  @click=${this._resetValue}
61
69
  @mousedown=${this._handlePressStart}
62
70
  @mouseup=${this._handlePressEnd}
63
71
  @mouseleave=${this._handlePressEnd}
64
- aria-label=${n(this.buttonAriaLabelClear)}
72
+ aria-label=${c(this, u).term("clearEntry")}
65
73
  class="search skf-icon-host"
66
74
  type="button"
67
75
  >
@@ -88,71 +96,71 @@ const m = class m extends c {
88
96
  firstUpdated() {
89
97
  var t;
90
98
  (t = this.$input) == null || t.addEventListener("change", () => {
91
- var r;
92
- this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(((r = this.$input) == null ? void 0 : r.value) ?? ""), this.emitEvent("change"), this.validateInput();
93
- }), this.addEventListener("invalid", (r) => {
94
- this._pristine = !1, this.invalid = !0, this.customErrorDisplay && r.preventDefault();
99
+ var e;
100
+ this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(((e = this.$input) == null ? void 0 : e.value) ?? ""), this.emitEvent("change"), this.validateInput();
101
+ }), this.addEventListener("invalid", (e) => {
102
+ this._pristine = !1, this.invalid = !0, this.customErrorDisplay && e.preventDefault();
95
103
  }), this.addEventListener("reset", this._resetValue), this.validateInput();
96
104
  }
97
105
  willUpdate(t) {
98
106
  if (t.has("invalid"))
99
107
  if (this.invalid) {
100
108
  this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
101
- const r = this._internals.validationMessage;
102
- this.hint = r !== "" ? this._internals.validationMessage : "", this.checkValidity();
109
+ const e = this._internals.validationMessage;
110
+ this.hint = e !== "" ? this._internals.validationMessage : "", this.checkValidity();
103
111
  } else
104
112
  this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
105
113
  }
106
114
  valueChanged() {
107
115
  this._internals.setFormValue(this.value), this.validateInput();
108
116
  }
109
- attributeChangedCallback(t, r, a) {
110
- if (super.attributeChangedCallback(t, r, a), t === "value" && this._internals.setFormValue(a), t === "custom-invalid")
111
- if (typeof a == "string") {
112
- const l = this.withFallback(a);
113
- this._pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
117
+ attributeChangedCallback(t, e, r) {
118
+ if (super.attributeChangedCallback(t, e, r), t === "value" && this._internals.setFormValue(r), t === "custom-invalid")
119
+ if (typeof r == "string") {
120
+ const d = this.withFallback(r);
121
+ this._pristine = !1, this._internals.setValidity({ customError: !0 }, d), this.invalid = !0, this.hint = d, this.checkValidity();
114
122
  } else
115
123
  this._internals.setValidity({}), this.validateInput();
116
124
  }
117
125
  /** @internal */
118
126
  validateInput() {
119
127
  if (this._internals.validity.customError || !this.$input) return;
120
- const r = this.$input.validity;
121
- if (this.invalid = !1, r.valid)
128
+ const e = this.$input.validity;
129
+ if (this.invalid = !1, e.valid)
122
130
  this._internals.setValidity({ customError: this._internals.validity.customError });
123
131
  else {
124
- this.invalid = !this._pristine && !r.valid;
125
- let a;
126
- for (a in r) {
127
- const o = `data-${a.toString()}`;
128
- if (r[a] && !this.hasAttribute(o) && this.debug && console.log(
129
- `Add custom message on ${this.localName} using attribute: ${o.toUpperCase()}="Your custom message"`
130
- ), r[a]) {
131
- this.validationError = a.toString();
132
- const l = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
132
+ this.invalid = !this._pristine && !e.valid;
133
+ let r;
134
+ for (r in e) {
135
+ const h = `data-${r.toString()}`;
136
+ if (e[r] && !this.hasAttribute(h) && this.debug && console.log(
137
+ `Add custom message on ${this.localName} using attribute: ${h.toUpperCase()}="Your custom message"`
138
+ ), e[r]) {
139
+ this.validationError = r.toString();
140
+ const d = this.hasAttribute(h) ? this.getAttribute(h) : this.$input.validationMessage;
133
141
  this._internals.setValidity(
134
142
  { [this.validationError]: !0, customError: this._internals.validity.customError },
135
- this.withFallback(l)
143
+ this.withFallback(d)
136
144
  ), this.invalid && this.customErrorDisplay && this.checkValidity();
137
145
  }
138
146
  }
139
147
  }
140
148
  }
141
149
  render() {
142
- var r, a, o, l;
143
- const t = (this._defaultSlot.length === 0 || !((a = (r = this._defaultSlot[0]) == null ? void 0 : r.textContent) != null && a.trim())) && !this.label;
144
- return h`
150
+ var e, r, h, d;
151
+ const t = (this._defaultSlot.length === 0 || !((r = (e = this._defaultSlot[0]) == null ? void 0 : e.textContent) != null && r.trim())) && !this.label;
152
+ return p`
145
153
  <div id="root">
146
154
  <label>
147
155
  <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${t} id="label">
148
156
  <slot>${this.label}</slot>
149
- ${this.required ? f(this.requiredLabel) : null}
157
+ ${this.required ? P(c(this, u).term("required")) : m}
150
158
  </div>
151
159
  <div id="input">
152
- ${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : u}
160
+ ${this.type === "search" ? p`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : m}
153
161
  <div
154
- data-leading=${n(this.leading)}
155
- data-trailing=${n(this.trailing)}
162
+ data-leading=${l(this.leading)}
163
+ data-trailing=${l(this.trailing)}
156
164
  id="affix"
157
165
  >
158
166
  <input
@@ -160,40 +168,41 @@ const m = class m extends c {
160
168
  ?readonly=${this.readonly}
161
169
  ?required=${this.required}
162
170
  .autocomplete=${this.autocomplete ?? "off"}
163
- .value=${w(this.value)}
171
+ .value=${B(this.value)}
164
172
  @blur=${this._onBlur}
165
173
  @input=${this._handleInput}
166
- aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" : u)}
167
- aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" : u)}
174
+ aria-describedby=${l((h = this.hint) != null && h.trim() ? "hint" : m)}
175
+ aria-errormessage=${l((d = this.hint) != null && d.trim() ? "hint" : m)}
168
176
  aria-invalid=${!!this.invalid}
169
177
  data-testid="field-input"
170
- inputmode=${n(this.inputMode)}
171
- max=${n(this.max)}
172
- maxlength=${n(this.maxLength)}
173
- min=${n(this.min)}
174
- minlength=${n(this.minLength)}
175
- name=${n(this.name)}
176
- pattern=${n(this.pattern)}
177
- placeholder=${n(this.placeholder)}
178
- type=${n(
178
+ inputmode=${l(this.inputMode)}
179
+ max=${l(this.max)}
180
+ maxlength=${l(this.maxLength)}
181
+ min=${l(this.min)}
182
+ minlength=${l(this.minLength)}
183
+ name=${l(this.name)}
184
+ pattern=${l(this.pattern)}
185
+ placeholder=${l(this.placeholder)}
186
+ type=${l(
179
187
  this.type === "password" ? this._passwordController._type : this.type
180
188
  )}
181
189
  />
182
190
  </div>
183
- ${this.type === "number" ? h`
191
+ ${this.type === "number" ? p`
184
192
  <div id="action">
185
193
  ${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
186
194
  </div>
187
- ` : u}
188
- ${this.type === "password" ? this._renderPasswordButton() : u}
189
- ${this.type === "search" && this._value.length > 0 ? this._renderSearchButton() : u}
195
+ ` : m}
196
+ ${this.type === "password" ? this._renderPasswordButton() : m}
197
+ ${this.type === "search" && this._value.length > 0 ? this._renderSearchButton() : m}
190
198
  </div>
191
199
  </label>
192
- ${this.hint && h`
200
+ ${this.hint && p`
193
201
  <skf-hint
202
+ ?disabled=${this.disabled}
194
203
  aria-live=${this.invalid ? "assertive" : "polite"}
195
204
  id="hint"
196
- severity=${n(b(this.invalid, this.severity))}
205
+ severity=${l(w(this.invalid, this.severity))}
197
206
  >${this.customInvalid ?? this.hint}
198
207
  </skf-hint>
199
208
  `}
@@ -201,106 +210,97 @@ const m = class m extends c {
201
210
  `;
202
211
  }
203
212
  };
204
- m.styles = [_, A];
205
- let i = m;
206
- e([
207
- p()
213
+ u = new WeakMap(), y.styles = [C, I];
214
+ let i = y;
215
+ s([
216
+ v()
208
217
  ], i.prototype, "_value", 2);
209
- e([
210
- s()
218
+ s([
219
+ a()
211
220
  ], i.prototype, "autocomplete", 2);
212
- e([
213
- s({ attribute: "button-aria-label-clear" })
214
- ], i.prototype, "buttonAriaLabelClear", 2);
215
- e([
216
- s({ attribute: "button-aria-label-hide" })
217
- ], i.prototype, "buttonAriaLabelHide", 2);
218
- e([
219
- s({ attribute: "button-aria-label-show" })
220
- ], i.prototype, "buttonAriaLabelShow", 2);
221
- e([
222
- s({ attribute: "custom-invalid", reflect: !0 })
221
+ s([
222
+ a({ attribute: "custom-invalid", reflect: !0 })
223
223
  ], i.prototype, "customInvalid", 1);
224
- e([
225
- s({ type: Boolean })
224
+ s([
225
+ a({ type: Boolean })
226
226
  ], i.prototype, "debug", 2);
227
- e([
228
- s({ type: Boolean, attribute: "hide-label" })
227
+ s([
228
+ a({ type: Boolean, attribute: "hide-label" })
229
229
  ], i.prototype, "hideLabel", 2);
230
- e([
231
- s()
230
+ s([
231
+ a()
232
232
  ], i.prototype, "hint", 2);
233
- e([
234
- s()
233
+ s([
234
+ a()
235
235
  ], i.prototype, "inputmode", 2);
236
- e([
237
- s()
236
+ s([
237
+ a()
238
238
  ], i.prototype, "label", 2);
239
- e([
240
- s()
239
+ s([
240
+ a({ type: String })
241
+ ], i.prototype, "lang", 2);
242
+ s([
243
+ a()
241
244
  ], i.prototype, "leading", 2);
242
- e([
243
- s()
245
+ s([
246
+ a()
244
247
  ], i.prototype, "max", 2);
245
- e([
246
- s({ type: Number, attribute: "maxlength" })
248
+ s([
249
+ a({ type: Number, attribute: "maxlength" })
247
250
  ], i.prototype, "maxLength", 2);
248
- e([
249
- s()
251
+ s([
252
+ a()
250
253
  ], i.prototype, "min", 2);
251
- e([
252
- s({ type: Number, attribute: "minlength" })
254
+ s([
255
+ a({ type: Number, attribute: "minlength" })
253
256
  ], i.prototype, "minLength", 2);
254
- e([
255
- s({ reflect: !0 })
257
+ s([
258
+ a({ reflect: !0 })
256
259
  ], i.prototype, "name", 2);
257
- e([
258
- s()
260
+ s([
261
+ a()
259
262
  ], i.prototype, "pattern", 2);
260
- e([
261
- s()
263
+ s([
264
+ a()
262
265
  ], i.prototype, "placeholder", 2);
263
- e([
264
- s({ type: Boolean })
266
+ s([
267
+ a({ type: Boolean })
265
268
  ], i.prototype, "readonly", 2);
266
- e([
267
- s({ attribute: "required-label" })
268
- ], i.prototype, "requiredLabel", 2);
269
- e([
270
- s({ reflect: !0 })
269
+ s([
270
+ a({ reflect: !0 })
271
271
  ], i.prototype, "severity", 2);
272
- e([
273
- s({ type: Boolean, attribute: "show-valid" })
272
+ s([
273
+ a({ type: Boolean, attribute: "show-valid" })
274
274
  ], i.prototype, "showValid", 2);
275
- e([
276
- s({ reflect: !0 })
275
+ s([
276
+ a({ reflect: !0 })
277
277
  ], i.prototype, "size", 2);
278
- e([
279
- s()
278
+ s([
279
+ a()
280
280
  ], i.prototype, "trailing", 2);
281
- e([
282
- s()
281
+ s([
282
+ a()
283
283
  ], i.prototype, "type", 2);
284
- e([
285
- s({ attribute: "validate-on" })
284
+ s([
285
+ a({ attribute: "validate-on" })
286
286
  ], i.prototype, "validateOn", 2);
287
- e([
288
- s({})
287
+ s([
288
+ a({})
289
289
  ], i.prototype, "value", 1);
290
- e([
291
- p()
290
+ s([
291
+ v()
292
292
  ], i.prototype, "invalid", 2);
293
- e([
294
- p()
293
+ s([
294
+ v()
295
295
  ], i.prototype, "_buttonDown", 2);
296
- e([
297
- $("input")
296
+ s([
297
+ S("input")
298
298
  ], i.prototype, "$input", 2);
299
- e([
300
- g({ flatten: !0 })
299
+ s([
300
+ x({ flatten: !0 })
301
301
  ], i.prototype, "_defaultSlot", 2);
302
- e([
303
- y("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
302
+ s([
303
+ E("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
304
304
  ], i.prototype, "valueChanged", 1);
305
305
  export {
306
306
  i as SkfInput
@@ -38,7 +38,6 @@ export declare class InputPasswordController implements ReactiveController {
38
38
  host?: ReactiveControllerHost & Partial<ControllerHostProps>;
39
39
  _inputElement?: HTMLInputElement;
40
40
  _icon: Extract<Icon, 'visibility' | 'visibilityOff'>;
41
- _buttonAriaLabel: string;
42
41
  _type: Extract<SkfInput['type'], 'password' | 'text'>;
43
42
  constructor(host: ReactiveControllerHost);
44
43
  hostUpdated(): void;
@@ -1,14 +1,14 @@
1
- class l {
1
+ class o {
2
2
  constructor(t) {
3
- this.handleActionBtnClick = (i, s) => {
3
+ this.handleActionBtnClick = (s, i) => {
4
4
  var h, n;
5
5
  const e = this._inputElement;
6
- !e || !this.host || (s === "inc" ? e.stepUp() : e.stepDown(), this.host.value = ((h = this._inputElement) == null ? void 0 : h.value) ?? "", (n = this.host._internals) == null || n.setFormValue(this.host.value), this.host.validateInput && this.host.validateInput());
7
- }, this.handleActionBtnLongPressStart = (i) => {
8
- const s = i.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
6
+ !e || !this.host || (i === "inc" ? e.stepUp() : e.stepDown(), this.host.value = ((h = this._inputElement) == null ? void 0 : h.value) ?? "", (n = this.host._internals) == null || n.setFormValue(this.host.value), this.host.validateInput && this.host.validateInput());
7
+ }, this.handleActionBtnLongPressStart = (s) => {
8
+ const i = s.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
9
9
  this._longPressId = setTimeout(() => {
10
10
  this._repeaterId = setInterval(() => {
11
- this.handleActionBtnClick(i, s);
11
+ this.handleActionBtnClick(s, i);
12
12
  }, 50);
13
13
  }, 400);
14
14
  }, this.handleActionBtnLongPressEnd = () => {
@@ -23,12 +23,12 @@ class l {
23
23
  class a {
24
24
  constructor(t) {
25
25
  this._icon = "visibility", this._type = "password", this.handleFieldLoaded = () => {
26
- var i;
27
- !this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host.value = this._inputElement.value, this.host._handleInput());
26
+ var s;
27
+ !this._inputElement || !((s = this.host) != null && s._handleInput) || (this.host.value = this._inputElement.value, this.host._handleInput());
28
28
  }, this.toggleVisibility = () => {
29
- var i;
30
- !this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host._handleInput(), this._type === "text" ? (this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "", this._icon = "visibility", this._type = "password") : (this._buttonAriaLabel = this.host.buttonAriaLabelHide ?? "", this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
31
- }, (this.host = t).addController(this), this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "";
29
+ var s;
30
+ !this._inputElement || !((s = this.host) != null && s._handleInput) || (this.host._handleInput(), this._type === "text" ? (this._icon = "visibility", this._type = "password") : (this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
31
+ }, (this.host = t).addController(this);
32
32
  }
33
33
  hostUpdated() {
34
34
  var t;
@@ -36,6 +36,6 @@ class a {
36
36
  }
37
37
  }
38
38
  export {
39
- l as InputNumberController,
39
+ o as InputNumberController,
40
40
  a as InputPasswordController
41
41
  };
@@ -2,54 +2,51 @@ import '../icon/icon.js';
2
2
  import { SkfElement } from '../../internal/components/skf-element.js';
3
3
  import type { Icon } from '../../internal/types.js';
4
4
  import { type CSSResultGroup } from 'lit';
5
- type SkfLinkType = HTMLButtonElement['type'];
5
+ type Color = 'primary' | 'inverse';
6
6
  /**
7
- * The `<skf-link>` can be used as either a regular link or a link styled semantic button
7
+ * The `<skf-link>` can be used as either a regular link or a semantic button. The button variant is
8
+ * intended to be used for triggering javascript functions, not handling forms.
8
9
  *
9
10
  * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
10
11
  *
12
+ * @event {CustomEvent} skf-link-click - Fired when the link is clicked
13
+ *
11
14
  * @slot - The links' main content
12
15
  *
13
16
  * @tagname skf-link
14
17
  */
15
18
  export declare class SkfLink extends SkfElement {
19
+ #private;
16
20
  static styles: CSSResultGroup;
17
- static classMap: {};
18
- /** @internal */
19
- private _onClick?;
20
21
  /** Defines the semantic element to render */
21
- as: 'button' | 'a';
22
+ as: 'button' | 'link';
22
23
  /** Defines the text-color */
23
- color: 'primary' | 'inverse';
24
+ color: Color;
24
25
  /** If true, disables the link */
25
26
  disabled: boolean;
26
27
  /** If defined, downloads the url */
27
- download?: string;
28
+ download: boolean;
28
29
  /** If defined, loads url on click */
29
30
  href?: string;
30
31
  /** If defined, renders an icon before or after the text */
31
32
  icon?: Icon;
32
- /** Defines the position of the icon in relation to the text */
33
- iconPlacement: 'left' | 'right';
34
- /** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
35
- set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
36
- get onClick(): ((event: Event, route?: string) => void) | undefined;
33
+ /** If true, the icon is placed to the right in relation to the text */
34
+ iconRight: boolean;
37
35
  /** If defined, describes the relationship between a linked resource and the current document */
38
36
  rel?: string;
39
- /** If defined, used on conjunction with onClick property, second argument */
37
+ /** If defined, used on conjunction with onClick property. **Notice!** Only applicable to as=button. */
40
38
  route?: string;
41
39
  /** If true, fills the parents horizontal axis */
42
40
  stretch: boolean;
43
41
  /** If defined, specifies where to open the linked document */
44
42
  target?: '_blank' | '_parent' | '_self' | '_top';
45
- /** Defines the type of button */
46
- type: SkfLinkType;
47
43
  connectedCallback(): void;
44
+ _handleAsChange(): void;
48
45
  /** @internal */
49
- private _assertValidOnClick;
46
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
50
47
  /** @internal */
51
48
  /** retargets click event to host */
52
- private _preprocessOnClick;
49
+ private _handleClick;
53
50
  /** @internal */
54
51
  private _renderIcon;
55
52
  render(): import("lit").TemplateResult;