@skf-design-system/ui-components 1.0.0-alpha.27 → 1.0.0-alpha.28

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 (91) hide show
  1. package/README.md +26 -6
  2. package/custom-elements.json +18265 -0
  3. package/dist/components/alert/alert.component.js +20 -18
  4. package/dist/components/alert/alert.styles.js +50 -47
  5. package/dist/components/button/button.component.d.ts +24 -0
  6. package/dist/components/button/button.component.js +79 -55
  7. package/dist/components/button/button.styles.js +1 -0
  8. package/dist/components/checkbox/checkbox.component.d.ts +3 -8
  9. package/dist/components/checkbox/checkbox.component.js +95 -90
  10. package/dist/components/checkbox/checkbox.styles.js +2 -2
  11. package/dist/components/input/input.component.d.ts +10 -0
  12. package/dist/components/input/input.component.js +89 -82
  13. package/dist/components/progress/progress.component.d.ts +22 -0
  14. package/dist/components/progress/progress.component.js +40 -0
  15. package/dist/components/progress/progress.d.ts +8 -0
  16. package/dist/components/progress/progress.js +6 -0
  17. package/dist/components/progress/progress.styles.d.ts +1 -0
  18. package/dist/components/progress/progress.styles.js +47 -0
  19. package/dist/components/radio/radio.component.d.ts +4 -6
  20. package/dist/components/radio/radio.component.js +93 -77
  21. package/dist/components/select/select.component.d.ts +5 -2
  22. package/dist/components/select/select.component.js +103 -88
  23. package/dist/components/select/select.controllers.js +5 -2
  24. package/dist/components/switch/switch.component.js +4 -1
  25. package/dist/components/tab/tab.component.d.ts +29 -0
  26. package/dist/components/tab/tab.component.js +57 -0
  27. package/dist/components/tab/tab.d.ts +8 -0
  28. package/dist/components/tab/tab.js +6 -0
  29. package/dist/components/tab/tab.styles.d.ts +1 -0
  30. package/dist/components/tab/tab.styles.js +123 -0
  31. package/dist/components/tab-group/tab-group.component.d.ts +43 -0
  32. package/dist/components/tab-group/tab-group.component.js +98 -0
  33. package/dist/components/tab-group/tab-group.d.ts +8 -0
  34. package/dist/components/tab-group/tab-group.js +6 -0
  35. package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
  36. package/dist/components/tab-group/tab-group.styles.js +75 -0
  37. package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
  38. package/dist/components/tab-panel/tab-panel.component.js +36 -0
  39. package/dist/components/tab-panel/tab-panel.d.ts +8 -0
  40. package/dist/components/tab-panel/tab-panel.js +6 -0
  41. package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
  42. package/dist/components/tab-panel/tab-panel.styles.js +13 -0
  43. package/dist/components/textarea/textarea.component.js +5 -5
  44. package/dist/components/toast/toast.component.d.ts +35 -0
  45. package/dist/components/toast/toast.component.js +52 -0
  46. package/dist/components/toast/toast.d.ts +8 -0
  47. package/dist/components/toast/toast.js +6 -0
  48. package/dist/components/toast/toast.singleton.d.ts +26 -0
  49. package/dist/components/toast/toast.singleton.js +53 -0
  50. package/dist/components/toast/toast.styles.d.ts +1 -0
  51. package/dist/components/toast/toast.styles.js +9 -0
  52. package/dist/components/toast-item/toast-item.component.d.ts +21 -0
  53. package/dist/components/toast-item/toast-item.component.js +65 -0
  54. package/dist/components/toast-item/toast-item.d.ts +6 -0
  55. package/dist/components/toast-item/toast-item.js +2 -0
  56. package/dist/components/toast-item/toast-item.styles.d.ts +2 -0
  57. package/dist/components/toast-item/toast-item.styles.js +16 -0
  58. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
  59. package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
  60. package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
  61. package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
  62. package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
  63. package/dist/components/toast-wrapper/toast-wrapper.styles.js +20 -0
  64. package/dist/custom-elements.json +1167 -311
  65. package/dist/index.d.ts +5 -0
  66. package/dist/index.js +57 -42
  67. package/dist/internal/components/formBase.d.ts +1 -0
  68. package/dist/internal/components/formBase.js +11 -11
  69. package/dist/internal/helpers/watch.d.ts +27 -0
  70. package/dist/internal/helpers/watch.js +28 -0
  71. package/dist/react/index.d.ts +6 -0
  72. package/dist/react/index.js +6 -0
  73. package/dist/react/skf-button/index.d.ts +7 -1
  74. package/dist/react/skf-button/index.js +5 -1
  75. package/dist/react/skf-progress/index.d.ts +3 -0
  76. package/dist/react/skf-progress/index.js +13 -0
  77. package/dist/react/skf-tab/index.d.ts +12 -0
  78. package/dist/react/skf-tab/index.js +18 -0
  79. package/dist/react/skf-tab-group/index.d.ts +3 -0
  80. package/dist/react/skf-tab-group/index.js +13 -0
  81. package/dist/react/skf-tab-panel/index.d.ts +3 -0
  82. package/dist/react/skf-tab-panel/index.js +13 -0
  83. package/dist/react/skf-toast/index.d.ts +3 -0
  84. package/dist/react/skf-toast/index.js +13 -0
  85. package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
  86. package/dist/react/skf-toast-wrapper/index.js +13 -0
  87. package/dist/types/jsx/custom-element-jsx.d.ts +115 -1096
  88. package/dist/types/vue/index.d.ts +147 -8
  89. package/dist/vscode.html-custom-data.json +116 -16
  90. package/dist/web-types.json +304 -35
  91. package/package.json +27 -27
@@ -1,65 +1,67 @@
1
1
  import "../icon/icon.js";
2
- import { FormBase as p } from "../../internal/components/formBase.js";
3
- import { Asterisk as c } from "../../internal/templates/asterisk.js";
4
- import v from "../../styles/component.styles.js";
5
- import { html as u, nothing as m } from "lit";
6
- import { property as s, state as f, query as y } from "lit/decorators.js";
2
+ import { FormBase as c } from "../../internal/components/formBase.js";
3
+ import { watch as h } from "../../internal/helpers/watch.js";
4
+ import { Asterisk as v } from "../../internal/templates/asterisk.js";
5
+ import m from "../../styles/component.styles.js";
6
+ import { html as p, nothing as y } from "lit";
7
+ import { property as r, state as f, query as _ } from "lit/decorators.js";
7
8
  import { ifDefined as b } from "lit/directives/if-defined.js";
8
- import _ from "./checkbox.styles.js";
9
- var g = Object.defineProperty, i = (h, t, a, l) => {
10
- for (var r = void 0, o = h.length - 1, d; o >= 0; o--)
11
- (d = h[o]) && (r = d(t, a, r) || r);
12
- return r && g(t, a, r), r;
9
+ import g from "./checkbox.styles.js";
10
+ var $ = Object.defineProperty, I = Object.getOwnPropertyDescriptor, e = (u, i, s, a) => {
11
+ for (var l = a > 1 ? void 0 : a ? I(i, s) : i, o = u.length - 1, n; o >= 0; o--)
12
+ (n = u[o]) && (l = (a ? n(i, s, l) : n(l)) || l);
13
+ return a && l && $(i, s, l), l;
13
14
  };
14
- const n = class n extends p {
15
+ const d = class d extends c {
15
16
  constructor() {
16
- super(...arguments), this._initiallyChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (t) => {
17
- t.stopPropagation(), this.checked = this._initiallyChecked, this.$input && (this.$input.checked = !!this._initiallyChecked), this.setFormValue(this.checked ? this.value : null);
18
- }, this._renderIcon = (t) => u`
19
- <skf-icon color="inverse" name=${t} size=${this.size === "sm" ? "sm" : "md"}></skf-icon>
17
+ super(...arguments), this._initiallyChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (i) => {
18
+ i.stopPropagation(), this.checked = this._initiallyChecked, this.$input && (this.$input.checked = !!this._initiallyChecked), this.setFormValue(this.checked ? this.value : null);
19
+ }, this._renderIcon = (i) => p`
20
+ <skf-icon color="inverse" name=${i} size=${this.size === "sm" ? "sm" : "md"}></skf-icon>
20
21
  `;
21
22
  }
22
- connectedCallback() {
23
- super.connectedCallback(), this._validateInput();
23
+ handleInvalidChange() {
24
+ this._invalid ? (this.setAttribute("invalid", ""), this.showValid && this.removeAttribute("valid"), this.checkValidity()) : (this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true"));
24
25
  }
25
- willUpdate(t) {
26
- if (t.has("customInvalid"))
27
- if (this.customInvalid) {
28
- const a = this.getAttribute("data-customerror") ?? "Custom error";
29
- this.pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, a), this.showValid && this.removeAttribute("valid"), this.checkValidity();
30
- } else
31
- console.log("remove invalid"), this.invalid = !1, !this.pristine && this.showValid && this.setAttribute("valid", "true"), this.setValidity({}), this._validateInput();
32
- t.has("_invalid") && (this.invalid = this._invalid);
26
+ handleDebugInvalid() {
27
+ this._invalid && this.debug && !this.validity.valid && console.log(`Checkbox invalidity reason: ${this.validationMessage}`);
33
28
  }
34
- firstUpdated() {
35
- var t;
36
- (t = this.$input) == null || t.addEventListener("change", (a) => {
37
- var l;
38
- a.stopPropagation(), this.pristine = !1, this.checked = (l = this.$input) == null ? void 0 : l.checked, this._validateInput(), this.checked ? (this.indeterminate = !1, this.setFormValue(this.value)) : this.setFormValue(null), this.emitEvent("change");
39
- }), this.addEventListener("invalid", (a) => {
40
- this.pristine = !1, this._invalid = !0, this.customErrorDisplay && a.preventDefault();
41
- }), this._initiallyChecked = this.checked, this.addEventListener("reset", this._resetValue);
42
- }
43
- updated(t) {
44
- super.updated(t), t.has("_invalid") && this._invalid && this.debug && this.debugOutput();
29
+ handleCustomInvalidChange() {
30
+ if (this.customInvalid) {
31
+ const s = (
32
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
33
+ this.getAttribute("data-customerror") || "Set a custom error message using the data-customerror attribute"
34
+ );
35
+ this.pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, s), this.checkValidity();
36
+ } else
37
+ this.setValidity({}), this._validateInput();
45
38
  }
46
- debugOutput() {
47
- this.debug && !this.validity.valid && console.log(`Checkbox invalidity reason: ${this.validationMessage}`);
39
+ firstUpdated() {
40
+ var i;
41
+ (i = this.$input) == null || i.addEventListener("change", (s) => {
42
+ var a;
43
+ s.stopPropagation(), this.pristine = !1, this.checked = (a = this.$input) == null ? void 0 : a.checked, this._validateInput(), this.checked ? (this.indeterminate = !1, this.setFormValue(this.value)) : this.setFormValue(null), this.emitEvent("change");
44
+ }), this.addEventListener("invalid", (s) => {
45
+ this.pristine = !1, this._invalid = !0, this.customErrorDisplay && s.preventDefault();
46
+ }), this._initiallyChecked = this.checked, this.addEventListener("reset", this._resetValue), this._validateInput();
48
47
  }
49
48
  /** @internal */
50
49
  _validateInput() {
51
- var t;
50
+ var i;
52
51
  if (this._invalid = !1, this.customInvalid)
53
52
  this.setValidity({ customError: !0 }, "Custom error"), this._invalid = !0;
54
53
  else if (this.required && !this.checked) {
55
54
  this.pristine || (this._invalid = !0);
56
- const a = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : ((t = this.$input) == null ? void 0 : t.validationMessage) ?? "Please check this box if you want to proceed";
57
- this.setValidity({ valueMissing: !0 }, String(a));
55
+ const s = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : (
56
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
57
+ ((i = this.$input) == null ? void 0 : i.validationMessage) || "Please check this box if you want to proceed"
58
+ );
59
+ this.setValidity({ valueMissing: !0 }, String(s));
58
60
  } else
59
61
  this.setValidity({});
60
62
  }
61
63
  render() {
62
- return u`
64
+ return p`
63
65
  <label id="root">
64
66
  <input
65
67
  ?checked=${this.checked}
@@ -74,59 +76,62 @@ const n = class n extends p {
74
76
  ${this._renderIcon("check")} ${this._renderIcon("removeMinus")}
75
77
  <div id="label">
76
78
  <slot>${this.label}</slot>
77
- ${this.required ? c(this.requiredLabel) : m}
79
+ ${this.required ? v(this.requiredLabel) : y}
78
80
  </div>
79
81
  </label>
80
82
  `;
81
83
  }
82
84
  };
83
- n.styles = [v, _];
84
- let e = n;
85
- i([
86
- s({ type: Boolean })
87
- ], e.prototype, "debug");
88
- i([
89
- s({ type: Boolean, reflect: !0 })
90
- ], e.prototype, "checked");
91
- i([
92
- s({ type: Boolean, attribute: "custom-invalid", reflect: !0 })
93
- ], e.prototype, "customInvalid");
94
- i([
95
- s({ type: Boolean, attribute: "hide-label", reflect: !0 })
96
- ], e.prototype, "hideLabel");
97
- i([
98
- s({ type: Boolean, reflect: !0 })
99
- ], e.prototype, "indeterminate");
100
- i([
101
- s({ type: Boolean, reflect: !0 })
102
- ], e.prototype, "invalid");
103
- i([
104
- s()
105
- ], e.prototype, "label");
106
- i([
107
- s()
108
- ], e.prototype, "name");
109
- i([
110
- s({ attribute: "required-label" })
111
- ], e.prototype, "requiredLabel");
112
- i([
113
- s({ reflect: !0 })
114
- ], e.prototype, "severity");
115
- i([
116
- s({ type: Boolean, attribute: "show-valid" })
117
- ], e.prototype, "showValid");
118
- i([
119
- s({ reflect: !0 })
120
- ], e.prototype, "size");
121
- i([
122
- s()
123
- ], e.prototype, "value");
124
- i([
85
+ d.styles = [m, g];
86
+ let t = d;
87
+ e([
88
+ r({ type: Boolean })
89
+ ], t.prototype, "debug", 2);
90
+ e([
91
+ r({ type: Boolean, reflect: !0 })
92
+ ], t.prototype, "checked", 2);
93
+ e([
94
+ r({ type: Boolean, attribute: "custom-invalid", reflect: !0 })
95
+ ], t.prototype, "customInvalid", 2);
96
+ e([
97
+ r({ type: Boolean, reflect: !0 })
98
+ ], t.prototype, "indeterminate", 2);
99
+ e([
100
+ r()
101
+ ], t.prototype, "label", 2);
102
+ e([
103
+ r()
104
+ ], t.prototype, "name", 2);
105
+ e([
106
+ r({ attribute: "required-label" })
107
+ ], t.prototype, "requiredLabel", 2);
108
+ e([
109
+ r({ reflect: !0 })
110
+ ], t.prototype, "severity", 2);
111
+ e([
112
+ r({ type: Boolean, attribute: "show-valid" })
113
+ ], t.prototype, "showValid", 2);
114
+ e([
115
+ r({ reflect: !0 })
116
+ ], t.prototype, "size", 2);
117
+ e([
118
+ r()
119
+ ], t.prototype, "value", 2);
120
+ e([
125
121
  f()
126
- ], e.prototype, "_invalid");
127
- i([
128
- y("input")
129
- ], e.prototype, "$input");
122
+ ], t.prototype, "_invalid", 2);
123
+ e([
124
+ _("input")
125
+ ], t.prototype, "$input", 2);
126
+ e([
127
+ h("_invalid")
128
+ ], t.prototype, "handleInvalidChange", 1);
129
+ e([
130
+ h("_invalid", { afterUpdate: !0 })
131
+ ], t.prototype, "handleDebugInvalid", 1);
132
+ e([
133
+ h("customInvalid")
134
+ ], t.prototype, "handleCustomInvalidChange", 1);
130
135
  export {
131
- e as SkfCheckbox
136
+ t as SkfCheckbox
132
137
  };
@@ -57,12 +57,12 @@ const i = [
57
57
  --_skf-checkbox-border-color: var(--skf-interactive-border-color-disabled);
58
58
  }
59
59
 
60
- &[aria-invalid='true'] {
60
+ :host([invalid]) & {
61
61
  --_skf-checkbox-border-color: var(--skf-severity-fg-color-error);
62
62
  }
63
63
 
64
64
  :host([valid]) & {
65
- --_skf-checkbox-border-color: var(--skf-severity-fg-color-error);
65
+ --_skf-checkbox-border-color: var(--skf-severity-fg-color-success);
66
66
  }
67
67
 
68
68
  :host([severity='alert']:not([invalid], [valid])) & {
@@ -3,6 +3,7 @@ import { FormBase } from '@internal/components/formBase.js';
3
3
  import '@internal/components/hint/hint';
4
4
  import type { FormFieldBaseProps } from '@internal/types/formField.js';
5
5
  import { type CSSResultGroup } from 'lit';
6
+ type AutocompleteValues = 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-amount' | 'transaction-currency' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'url' | 'photo' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'email' | 'impp' | 'password' | 'webauthn' | 'work' | (string & {});
6
7
  /**
7
8
  * The skf-text-field is used to create a text input field. It can be used inside a form element or standalone.
8
9
  *
@@ -24,6 +25,12 @@ import { type CSSResultGroup } from 'lit';
24
25
  export declare class SkfInput extends FormBase implements FormFieldBaseProps {
25
26
  static styles: CSSResultGroup;
26
27
  private customError;
28
+ /**
29
+ * Specifies what permission the browser has to provide assistance in filling out form field values. Refer to
30
+ * [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.
31
+ * @type { -m }
32
+ */
33
+ autocomplete?: AutocompleteValues;
27
34
  /** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
28
35
  buttonAriaLabelClear: string;
29
36
  /** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
@@ -91,6 +98,8 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
91
98
  /** @internal */
92
99
  $input: HTMLInputElement;
93
100
  /** @internal */
101
+ _defaultSlot: Node[];
102
+ /** @internal */
94
103
  private _numberController;
95
104
  /** @internal */
96
105
  private _passwordController;
@@ -126,3 +135,4 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
126
135
  private _onBlur;
127
136
  render(): import("lit").TemplateResult<1>;
128
137
  }
138
+ export {};
@@ -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 c, query as _ } from "lit/decorators.js";
9
- import { ifDefined as a } from "lit/directives/if-defined.js";
10
- import { live as $ } from "lit/directives/live.js";
11
- import { InputNumberController as g, InputPasswordController as w } from "./input.controllers.js";
12
- import E from "./input.styles.js";
13
- var A = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (m, e, r, n) => {
14
- for (var o = n > 1 ? void 0 : n ? C(e, r) : e, l = m.length - 1, u; l >= 0; l--)
15
- (u = m[l]) && (o = (n ? u(e, r, o) : u(o)) || o);
16
- return n && o && A(e, r, o), o;
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
+ import { live as g } from "lit/directives/live.js";
11
+ import { InputNumberController as w, InputPasswordController as E } from "./input.controllers.js";
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
18
  const p = class p extends b {
19
19
  constructor() {
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 g(this), this._passwordController = new w(this), this._handleInput = () => {
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 p = class p 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
  >
@@ -69,8 +69,8 @@ const p = class p extends b {
69
69
  this._buttonDown && this.$input.focus();
70
70
  };
71
71
  }
72
- set customInvalid(e) {
73
- this.customError = e || "";
72
+ set customInvalid(s) {
73
+ this.customError = s || "";
74
74
  }
75
75
  get customInvalid() {
76
76
  return this.customError;
@@ -78,12 +78,12 @@ const p = class p extends b {
78
78
  firstUpdated() {
79
79
  this.$input.addEventListener("change", () => {
80
80
  this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
81
- }), this.addEventListener("invalid", (e) => {
82
- this._pristine = !1, this.invalid = !0, this.customErrorDisplay && e.preventDefault();
81
+ }), this.addEventListener("invalid", (s) => {
82
+ this._pristine = !1, this.invalid = !0, this.customErrorDisplay && s.preventDefault();
83
83
  }), this.addEventListener("reset", this._resetValue), this.validateInput();
84
84
  }
85
- willUpdate(e) {
86
- if (e.has("invalid"))
85
+ willUpdate(s) {
86
+ if (s.has("invalid"))
87
87
  if (this.invalid) {
88
88
  this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
89
89
  const r = this._internals.validationMessage;
@@ -91,10 +91,10 @@ const p = class p extends b {
91
91
  } else
92
92
  this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
93
93
  }
94
- attributeChangedCallback(e, r, n) {
95
- if (super.attributeChangedCallback(e, r, n), e === "value" && this._internals.setFormValue(n), e === "custom-invalid")
96
- if (typeof n == "string") {
97
- 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);
98
98
  this._pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
99
99
  } else
100
100
  this._internals.setValidity({}), this.validateInput();
@@ -107,60 +107,61 @@ const p = class p extends b {
107
107
  this._internals.setValidity({ customError: this._internals.validity.customError });
108
108
  else {
109
109
  this.invalid = !this._pristine && !r.valid;
110
- let n;
111
- for (n in r) {
112
- const o = `data-${n.toString()}`;
113
- 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(
114
114
  `Add custom message on ${this.localName} using attribute: ${o.toUpperCase()}="Your custom message"`
115
- ), r[n]) {
116
- this.validationError = n.toString();
115
+ ), r[a]) {
116
+ this.validationError = a.toString();
117
117
  const l = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
118
118
  this._internals.setValidity(
119
119
  { [this.validationError]: !0, customError: this._internals.validity.customError },
120
- l ?? ""
120
+ this.withFallback(l)
121
121
  ), this.invalid && this.customErrorDisplay && this.checkValidity();
122
122
  }
123
123
  }
124
124
  }
125
125
  }
126
126
  render() {
127
- 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;
128
129
  return h`
129
130
  <div id="root">
130
131
  <label>
131
- <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
132
+ <div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${s} id="label">
132
133
  <slot>${this.label}</slot>
133
134
  ${this.required ? y(this.requiredLabel) : null}
134
135
  </div>
135
136
  <div id="input">
136
137
  ${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : d}
137
138
  <div
138
- data-leading=${a(this.leading)}
139
- data-trailing=${a(this.trailing)}
139
+ data-leading=${n(this.leading)}
140
+ data-trailing=${n(this.trailing)}
140
141
  id="affix"
141
142
  >
142
143
  <input
143
144
  ?disabled=${this.disabled}
144
145
  ?readonly=${this.readonly}
145
146
  ?required=${this.required}
146
- .value=${$(this.value)}
147
+ .value=${g(this.value)}
147
148
  @blur=${this._onBlur}
148
149
  @input=${this._handleInput}
149
- aria-describedby=${a((e = this.hint) != null && e.trim() ? "hint" : d)}
150
- 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)}
151
153
  aria-invalid=${!!this.invalid}
152
154
  autocomplete="off"
153
155
  data-testid="field-input"
154
- inputmode=${a(this.inputMode)}
155
- max=${a(this.max)}
156
- maxlength=${a(this.maxLength)}
157
- min=${a(this.min)}
158
- minlength=${a(this.minLength)}
159
- name=${a(this.name)}
160
- pattern=${a(this.pattern)}
161
- placeholder=${a(this.placeholder)}
162
- title=""
163
- 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(
164
165
  this.type === "password" ? this._passwordController._type : this.type
165
166
  )}
166
167
  />
@@ -178,7 +179,7 @@ const p = class p extends b {
178
179
  <skf-hint
179
180
  aria-live=${this.invalid ? "assertive" : "polite"}
180
181
  id="hint"
181
- severity=${a(v(this.severity, this.invalid))}
182
+ severity=${n(v(this.severity, this.invalid))}
182
183
  >${this.customInvalid ? this.customInvalid : this.hint}
183
184
  </skf-hint>
184
185
  `}
@@ -186,85 +187,88 @@ const p = class p extends b {
186
187
  `;
187
188
  }
188
189
  };
189
- p.styles = [f, E];
190
+ p.styles = [f, A];
190
191
  let t = p;
191
192
  i([
192
- s({ attribute: "button-aria-label-clear" })
193
+ e({ type: String })
194
+ ], t.prototype, "autocomplete", 2);
195
+ i([
196
+ e({ attribute: "button-aria-label-clear" })
193
197
  ], t.prototype, "buttonAriaLabelClear", 2);
194
198
  i([
195
- s({ attribute: "button-aria-label-hide" })
199
+ e({ attribute: "button-aria-label-hide" })
196
200
  ], t.prototype, "buttonAriaLabelHide", 2);
197
201
  i([
198
- s({ attribute: "button-aria-label-show" })
202
+ e({ attribute: "button-aria-label-show" })
199
203
  ], t.prototype, "buttonAriaLabelShow", 2);
200
204
  i([
201
- s({ attribute: "custom-invalid", reflect: !0 })
205
+ e({ attribute: "custom-invalid", reflect: !0 })
202
206
  ], t.prototype, "customInvalid", 1);
203
207
  i([
204
- s({ type: Boolean })
208
+ e({ type: Boolean })
205
209
  ], t.prototype, "debug", 2);
206
210
  i([
207
- s({ type: Boolean, attribute: "hide-label" })
211
+ e({ type: Boolean, attribute: "hide-label" })
208
212
  ], t.prototype, "hideLabel", 2);
209
213
  i([
210
- s()
214
+ e()
211
215
  ], t.prototype, "hint", 2);
212
216
  i([
213
- s({ type: String })
217
+ e({ type: String })
214
218
  ], t.prototype, "inputmode", 2);
215
219
  i([
216
- s()
220
+ e()
217
221
  ], t.prototype, "label", 2);
218
222
  i([
219
- s()
223
+ e()
220
224
  ], t.prototype, "leading", 2);
221
225
  i([
222
- s()
226
+ e()
223
227
  ], t.prototype, "max", 2);
224
228
  i([
225
- s({ type: Number, attribute: "maxlength" })
229
+ e({ type: Number, attribute: "maxlength" })
226
230
  ], t.prototype, "maxLength", 2);
227
231
  i([
228
- s()
232
+ e()
229
233
  ], t.prototype, "min", 2);
230
234
  i([
231
- s({ type: Number, attribute: "minlength" })
235
+ e({ type: Number, attribute: "minlength" })
232
236
  ], t.prototype, "minLength", 2);
233
237
  i([
234
- s()
238
+ e()
235
239
  ], t.prototype, "name", 2);
236
240
  i([
237
- s()
241
+ e()
238
242
  ], t.prototype, "pattern", 2);
239
243
  i([
240
- s()
244
+ e()
241
245
  ], t.prototype, "placeholder", 2);
242
246
  i([
243
- s({ type: Boolean })
247
+ e({ type: Boolean })
244
248
  ], t.prototype, "readonly", 2);
245
249
  i([
246
- s({ attribute: "required-label" })
250
+ e({ attribute: "required-label" })
247
251
  ], t.prototype, "requiredLabel", 2);
248
252
  i([
249
- s({ reflect: !0 })
253
+ e({ reflect: !0 })
250
254
  ], t.prototype, "severity", 2);
251
255
  i([
252
- s({ type: Boolean, attribute: "show-valid" })
256
+ e({ type: Boolean, attribute: "show-valid" })
253
257
  ], t.prototype, "showValid", 2);
254
258
  i([
255
- s({ reflect: !0 })
259
+ e({ reflect: !0 })
256
260
  ], t.prototype, "size", 2);
257
261
  i([
258
- s()
262
+ e()
259
263
  ], t.prototype, "trailing", 2);
260
264
  i([
261
- s()
265
+ e()
262
266
  ], t.prototype, "type", 2);
263
267
  i([
264
- s({ type: String, attribute: "validate-on" })
268
+ e({ type: String, attribute: "validate-on" })
265
269
  ], t.prototype, "validateOn", 2);
266
270
  i([
267
- s()
271
+ e()
268
272
  ], t.prototype, "value", 2);
269
273
  i([
270
274
  c()
@@ -275,6 +279,9 @@ i([
275
279
  i([
276
280
  _("input")
277
281
  ], t.prototype, "$input", 2);
282
+ i([
283
+ $({ flatten: !0 })
284
+ ], t.prototype, "_defaultSlot", 2);
278
285
  export {
279
286
  t as SkfInput
280
287
  };
@@ -0,0 +1,22 @@
1
+ import { SkfElement } from '@internal/components/skf-element';
2
+ import { type CSSResultGroup } from 'lit';
3
+ /**
4
+ * The `<skf-progress>` element displays an indicator showing the completion progress of a task, typically displayed as a progress bar
5
+ *
6
+ * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
7
+ *
8
+ * @tagname skf-progress
9
+ */
10
+ export declare class SkfProgress extends SkfElement {
11
+ #private;
12
+ static styles: CSSResultGroup;
13
+ static formAssociated: boolean;
14
+ /** If true, the progress-bar's fill value is animated */
15
+ animated?: boolean;
16
+ /** Describes how much work the task indicated by the progress element requires */
17
+ max: number;
18
+ /** Specifies how much of the task that has been completed */
19
+ value: number;
20
+ constructor();
21
+ render(): import("lit").TemplateResult<1>;
22
+ }