@skf-design-system/ui-components 1.0.2-beta.21 → 1.0.2-beta.22

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.
@@ -32,11 +32,11 @@ const f = class f extends L {
32
32
  constructor() {
33
33
  super();
34
34
  g(this, d);
35
- y(this, d, new F(this)), this._componentIsConnected = !1, this.selectDelay = 200, this._optionsList = [], this.hideLabel = !1, this.hideTags = !1, this.label = "", this.lang = "en", this.multiple = !1, this.showValid = !1, this.size = "md", this._expanded = !1, this._invalid = !1, this.globalClickController = new M(this), this.keyboardNavController = new N(this), this.developerFeedbackController = new H(this), this.popoverController = new k(this), this._handleOptionSelected = (t) => {
35
+ y(this, d, new F(this)), this._componentIsConnected = !1, this.selectDelay = 200, this._optionsList = [], this.hideLabel = !1, this.hideTags = !1, this.label = "", this.lang = "en", this.multiple = !1, this.showValid = !1, this.size = "md", this._expanded = !1, this._invalid = !1, this.globalClickController = new M(this), this.keyboardNavController = new N(this), this.developerFeedbackController = new H(this), this.popoverController = new k(this), this._handleOptionSelected = ((t) => {
36
36
  this._pristine = !1;
37
37
  const e = this._selectedOptions.length > 0;
38
38
  this.setFormValue(e ? this.selectedValues.join(",") : null), this._updateState(t);
39
- }, this._handleReset = () => {
39
+ }), this._handleReset = () => {
40
40
  this.emit("reset"), this._resetSelectedOptions();
41
41
  }, this._updateWidth = () => {
42
42
  setTimeout(() => {
@@ -9,6 +9,8 @@ type Size = 'sm' | 'md';
9
9
  *
10
10
  * @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/28bdd6-tags) for design principles
11
11
  *
12
+ * @event {CustomEvent} skf-tag-remove - Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM.
13
+ *
12
14
  * @slot - The component's placeholder content
13
15
  *
14
16
  * @tagname skf-tag
@@ -73,7 +73,6 @@ export declare class SkfTextArea extends FormBase implements SkfTextAreaProps {
73
73
  /** @internal */
74
74
  private $input?;
75
75
  firstUpdated(): void;
76
- willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
77
76
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
78
77
  _invalidChanged(): void;
79
78
  _hintChanged(): void;
@@ -2,24 +2,24 @@ var $ = (a) => {
2
2
  throw TypeError(a);
3
3
  };
4
4
  var _ = (a, r, t) => r.has(a) || $("Cannot " + t);
5
- var p = (a, r, t) => (_(a, r, "read from private field"), t ? t.call(a) : r.get(a)), c = (a, r, t) => r.has(a) ? $("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, t), m = (a, r, t, n) => (_(a, r, "write to private field"), n ? n.call(a, t) : r.set(a, t), t);
5
+ var p = (a, r, t) => (_(a, r, "read from private field"), t ? t.call(a) : r.get(a)), c = (a, r, t) => r.has(a) ? $("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, t), v = (a, r, t, n) => (_(a, r, "write to private field"), n ? n.call(a, t) : r.set(a, t), t);
6
6
  import "../icon/icon.js";
7
7
  import { FormBase as V } from "../../internal/components/formBase.js";
8
8
  import "../../internal/components/hint/hint.js";
9
- import { hintSeverity as w } from "../../internal/helpers/hintSeverity.js";
9
+ import { hintSeverity as C } from "../../internal/helpers/hintSeverity.js";
10
10
  import { watch as g } from "../../internal/helpers/watch.js";
11
- import { Asterisk as C } from "../../internal/templates/asterisk.js";
11
+ import { Asterisk as w } from "../../internal/templates/asterisk.js";
12
12
  import { componentStyles as I } from "../../styles/component.styles.js";
13
13
  import { LocalizeController as x } from "../../utilities/localize.js";
14
14
  import { nothing as f, html as E } from "lit";
15
15
  import { property as s, query as L } from "lit/decorators.js";
16
- import { ifDefined as o } from "lit/directives/if-defined.js";
17
- import A from "./textarea.styles.js";
18
- var M = Object.defineProperty, O = Object.getOwnPropertyDescriptor, e = (a, r, t, n) => {
19
- for (var l = n > 1 ? void 0 : n ? O(r, t) : r, h = a.length - 1, d; h >= 0; h--)
20
- (d = a[h]) && (l = (n ? d(r, t, l) : d(l)) || l);
21
- return n && l && M(r, t, l), l;
22
- }, y, u, v;
16
+ import { ifDefined as h } from "lit/directives/if-defined.js";
17
+ import O from "./textarea.styles.js";
18
+ var S = Object.defineProperty, F = Object.getOwnPropertyDescriptor, e = (a, r, t, n) => {
19
+ for (var l = n > 1 ? void 0 : n ? F(r, t) : r, o = a.length - 1, d; o >= 0; o--)
20
+ (d = a[o]) && (l = (n ? d(r, t, l) : d(l)) || l);
21
+ return n && l && S(r, t, l), l;
22
+ }, y, u, m;
23
23
  const b = class b extends V {
24
24
  constructor() {
25
25
  super(...arguments);
@@ -27,8 +27,8 @@ const b = class b extends V {
27
27
  /** @internal */
28
28
  c(this, u);
29
29
  /** @internal */
30
- c(this, v);
31
- m(this, y, new x(this)), this.debug = !1, this.hideLabel = !1, this.invalid = !1, this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.validateOn = "change", this.value = "", this._resetValue = (t) => {
30
+ c(this, m);
31
+ v(this, y, new x(this)), this.debug = !1, this.hideLabel = !1, this.invalid = !1, this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.validateOn = "change", this.value = "", this._resetValue = (t) => {
32
32
  t.stopPropagation(), this.value = p(this, u) ?? "", this._internals.setFormValue(this.value);
33
33
  }, this._handleInput = () => {
34
34
  this.value = this.$input?.value ?? "", this.validateOn === "input" && (this.pristine = !1, this.validateInput());
@@ -47,23 +47,14 @@ const b = class b extends V {
47
47
  this.pristine = !1, this.invalid = !0, this.customErrorDisplay && t.preventDefault();
48
48
  }), this.addEventListener("reset", this._resetValue), this.validateInput();
49
49
  }
50
- willUpdate(t) {
51
- if (t.has("invalid"))
52
- if (this.invalid) {
53
- this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
54
- const n = this._internals.validationMessage;
55
- this.hint = n !== "" ? this._internals.validationMessage : "unspecified error", this.checkValidity();
56
- } else
57
- this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = p(this, v) ?? "";
58
- }
59
50
  attributeChangedCallback(t, n, l) {
60
- if (super.attributeChangedCallback(t, n, l), t === "value" && l !== p(this, u) && m(this, u, void 0), t === "custom-invalid")
51
+ if (super.attributeChangedCallback(t, n, l), t === "value" && l !== p(this, u) && v(this, u, void 0), t === "custom-invalid")
61
52
  if (typeof l == "string") {
62
53
  const d = this.withFallback(l);
63
54
  this.pristine = !1, this._internals.setValidity({ customError: !0 }, d), this.invalid = !0, this.hint = d, this.checkValidity();
64
55
  } else
65
56
  this._internals.setValidity({}), this.validateInput();
66
- t === "hint" && m(this, v, this.getAttribute("hint") ?? "");
57
+ t === "hint" && v(this, m, this.getAttribute("hint") ?? "");
67
58
  }
68
59
  _invalidChanged() {
69
60
  if (this.invalid) {
@@ -71,13 +62,13 @@ const b = class b extends V {
71
62
  const t = this._internals.validationMessage;
72
63
  this.hint = t !== "" ? this._internals.validationMessage : "", this.checkValidity();
73
64
  } else
74
- !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = p(this, v) ?? "";
65
+ !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = p(this, m) ?? "";
75
66
  }
76
67
  _hintChanged() {
77
- p(this, v) ?? m(this, v, this.hint);
68
+ p(this, m) ?? v(this, m, this.hint);
78
69
  }
79
70
  _valueChanged() {
80
- p(this, u) ?? m(this, u, this.value), this._internals.setFormValue(this.value), this.validateInput();
71
+ p(this, u) ?? v(this, u, this.value), this._internals.setFormValue(this.value), this.validateInput();
81
72
  }
82
73
  /** @internal */
83
74
  validateInput() {
@@ -89,12 +80,12 @@ const b = class b extends V {
89
80
  this.invalid = !this.pristine && !n.valid;
90
81
  let l;
91
82
  for (l in n) {
92
- const h = `data-${l}`;
93
- if (n[l] && !this.hasAttribute(h) && this.debug && console.log(
94
- `Add custom message on ${this.localName} using attribute: ${h.toUpperCase()}="Your custom message"`
83
+ const o = `data-${l}`;
84
+ if (n[l] && !this.hasAttribute(o) && this.debug && console.log(
85
+ `Add custom message on ${this.localName} using attribute: ${o.toUpperCase()}="Your custom message"`
95
86
  ), n[l]) {
96
87
  this.validationError = l;
97
- const d = this.hasAttribute(h) ? this.getAttribute(h) : this.$input.validationMessage;
88
+ const d = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
98
89
  this._internals.setValidity(
99
90
  { [this.validationError]: !0, customError: this._internals.validity.customError },
100
91
  this.withFallback(d)
@@ -108,7 +99,7 @@ const b = class b extends V {
108
99
  <div id="root">
109
100
  <label>
110
101
  <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
111
- <slot>${this.label}</slot> ${this.required ? C(p(this, y).term("required")) : f}
102
+ <slot>${this.label}</slot> ${this.required ? w(p(this, y).term("required")) : f}
112
103
  </div>
113
104
  <div id="input">
114
105
  <textarea
@@ -117,15 +108,15 @@ const b = class b extends V {
117
108
  ?required=${this.required}
118
109
  .value=${this.value}
119
110
  @input=${this._handleInput}
120
- aria-describedby=${o(this.hint?.trim() ? "hint" : f)}
121
- aria-errormessage=${o(this.hint?.trim() ? "hint" : f)}
111
+ aria-describedby=${h(this.hint?.trim() ? "hint" : f)}
112
+ aria-errormessage=${h(this.hint?.trim() ? "hint" : f)}
122
113
  aria-invalid=${!!this.invalid}
123
- cols=${o(this.cols)}
124
- maxlength=${o(this.maxLength)}
125
- minlength=${o(this.minLength)}
126
- name=${o(this.name)}
127
- placeholder=${o(this.placeholder)}
128
- rows=${o(this.rows)}
114
+ cols=${h(this.cols)}
115
+ maxlength=${h(this.maxLength)}
116
+ minlength=${h(this.minLength)}
117
+ name=${h(this.name)}
118
+ placeholder=${h(this.placeholder)}
119
+ rows=${h(this.rows)}
129
120
  >
130
121
  </textarea>
131
122
  </div>
@@ -135,7 +126,7 @@ const b = class b extends V {
135
126
  ?disabled=${this.disabled}
136
127
  aria-live=${this.invalid ? "assertive" : "polite"}
137
128
  id="hint"
138
- severity=${o(w(this.invalid, this.severity))}
129
+ severity=${h(C(this.invalid, this.severity))}
139
130
  >
140
131
  ${this.customInvalid ?? this.hint}
141
132
  </skf-hint>
@@ -144,7 +135,7 @@ const b = class b extends V {
144
135
  `;
145
136
  }
146
137
  };
147
- y = new WeakMap(), u = new WeakMap(), v = new WeakMap(), b.styles = [I, A];
138
+ y = new WeakMap(), u = new WeakMap(), m = new WeakMap(), b.styles = [I, O];
148
139
  let i = b;
149
140
  e([
150
141
  s({ type: Number })
@@ -5964,6 +5964,15 @@
5964
5964
  "attribute": "removable"
5965
5965
  }
5966
5966
  ],
5967
+ "events": [
5968
+ {
5969
+ "type": {
5970
+ "text": "CustomEvent"
5971
+ },
5972
+ "description": "Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM.",
5973
+ "name": "skf-tag-remove"
5974
+ }
5975
+ ],
5967
5976
  "attributes": [
5968
5977
  {
5969
5978
  "name": "size",
@@ -949,7 +949,8 @@ export type SkfTagProps = {
949
949
  /** If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. */
950
950
  "callbackOnRemove"?: SkfTag['callbackOnRemove'];
951
951
 
952
-
952
+ /** Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM. */
953
+ "onskf-tag-remove"?: (e: CustomEvent<CustomEvent>) => void;
953
954
  }
954
955
 
955
956
 
@@ -2193,6 +2194,12 @@ export type SkfTooltipProps = {
2193
2194
  * - `clickCallback`: If defined, accepts a function that runs on click (property only)
2194
2195
  * - `callbackOnRemove`: If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. (property only)
2195
2196
  *
2197
+ * #### Events
2198
+ *
2199
+ * Events that will be emitted by the component.
2200
+ *
2201
+ * - `skf-tag-remove`: Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM.
2202
+ *
2196
2203
  * #### Slots
2197
2204
  *
2198
2205
  * Areas where markup can be added to the component.
@@ -34,7 +34,7 @@ import type {
34
34
  } from "../../components/segmented-button-item/segmented-button-item.component.js";
35
35
  import type { SkfSegmentedButton } from "../../components/segmented-button/segmented-button.component.js";
36
36
  import type { SkfSelectOptionGroup } from "../../components/select-option-group/select-option-group.component.js";
37
- import type { SkfTag } from "../../components/tag/tag.component.js";
37
+ import type { SkfTag, CustomEvent } from "../../components/tag/tag.component.js";
38
38
  import type { SkfSelect, Event, CustomEvent } from "../../components/select/select.component.js";
39
39
  import type { SkfSelectOption } from "../../components/select-option/select-option.component.js";
40
40
  import type { SkfStepperItem } from "../../components/stepper-item/stepper-item.component.js";
@@ -617,6 +617,8 @@ type SkfTagProps = {
617
617
  clickCallback?: SkfTag["clickCallback"];
618
618
  /** If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. */
619
619
  callbackOnRemove?: SkfTag["callbackOnRemove"];
620
+ /** Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM. */
621
+ "onskf-tag-remove"?: (e: CustomEvent<CustomEvent>) => void;
620
622
  };
621
623
 
622
624
  type SkfSelectProps = {
@@ -1274,6 +1276,9 @@ export type CustomElements = {
1274
1276
  * ---
1275
1277
  *
1276
1278
  *
1279
+ * ### **Events:**
1280
+ * - **skf-tag-remove** - Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM.
1281
+ *
1277
1282
  * ### **Slots:**
1278
1283
  * - _default_ - The component's placeholder content
1279
1284
  */
@@ -1147,7 +1147,7 @@
1147
1147
  },
1148
1148
  {
1149
1149
  "name": "skf-tag",
1150
- "description": "The `<skf-tag>` is a component that displays a list of actions or options\n---\n\n\n### **Slots:**\n - _default_ - The component's placeholder content",
1150
+ "description": "The `<skf-tag>` is a component that displays a list of actions or options\n---\n\n\n### **Events:**\n - **skf-tag-remove** - Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM.\n\n### **Slots:**\n - _default_ - The component's placeholder content",
1151
1151
  "attributes": [
1152
1152
  {
1153
1153
  "name": "size",
@@ -2559,7 +2559,7 @@
2559
2559
  },
2560
2560
  {
2561
2561
  "name": "skf-tag",
2562
- "description": "The `<skf-tag>` is a component that displays a list of actions or options\n---\n\n\n### **Slots:**\n - _default_ - The component's placeholder content",
2562
+ "description": "The `<skf-tag>` is a component that displays a list of actions or options\n---\n\n\n### **Events:**\n - **skf-tag-remove** - Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM.\n\n### **Slots:**\n - _default_ - The component's placeholder content",
2563
2563
  "doc-url": "",
2564
2564
  "attributes": [
2565
2565
  {
@@ -2596,7 +2596,13 @@
2596
2596
  "slots": [
2597
2597
  { "name": "", "description": "The component's placeholder content" }
2598
2598
  ],
2599
- "events": [],
2599
+ "events": [
2600
+ {
2601
+ "name": "skf-tag-remove",
2602
+ "type": "CustomEvent",
2603
+ "description": "Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM."
2604
+ }
2605
+ ],
2600
2606
  "js": {
2601
2607
  "properties": [
2602
2608
  {
@@ -2638,7 +2644,13 @@
2638
2644
  "type": "boolean"
2639
2645
  }
2640
2646
  ],
2641
- "events": []
2647
+ "events": [
2648
+ {
2649
+ "name": "skf-tag-remove",
2650
+ "type": "CustomEvent",
2651
+ "description": "Fired when the tag is removed. Convenient to use together with the `prevent-dom-updates` property to avoid bypassing internal state management/React Virtual DOM."
2652
+ }
2653
+ ]
2642
2654
  }
2643
2655
  },
2644
2656
  {
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "pnpm": ">=10"
11
11
  },
12
12
  "engineStrict": true,
13
- "customElements": "./dist/custom-elements.json",
13
+ "customElements": "dist/custom-elements.json",
14
14
  "exports": {
15
15
  ".": {
16
16
  "types": "./dist/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  "sideEffects": true,
36
36
  "type": "module",
37
37
  "types": "./dist/index.d.ts",
38
- "version": "1.0.2-beta.21",
38
+ "version": "1.0.2-beta.22",
39
39
  "dependencies": {
40
40
  "@floating-ui/dom": "^1.7.3",
41
41
  "@js-temporal/polyfill": "^0.5.1",
@@ -44,17 +44,17 @@
44
44
  "lit": "^3.3.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@changesets/cli": "^2.29.5",
47
+ "@changesets/cli": "^2.29.6",
48
48
  "@chromatic-com/storybook": "^4.1.0",
49
49
  "@commitlint/cli": "^19.8.1",
50
50
  "@commitlint/config-conventional": "^19.8.1",
51
- "@custom-elements-manifest/analyzer": "^0.10.4",
51
+ "@custom-elements-manifest/analyzer": "^0.10.5",
52
52
  "@eslint/js": "^9.33.0",
53
- "@storybook/addon-a11y": "^9.1.1",
54
- "@storybook/addon-docs": "^9.1.1",
55
- "@storybook/addon-links": "^9.1.1",
56
- "@storybook/web-components-vite": "^9.1.1",
57
- "@types/node": "^24.2.1",
53
+ "@storybook/addon-a11y": "^9.1.2",
54
+ "@storybook/addon-docs": "^9.1.2",
55
+ "@storybook/addon-links": "^9.1.2",
56
+ "@storybook/web-components-vite": "^9.1.2",
57
+ "@types/node": "^24.3.0",
58
58
  "@wc-toolkit/jsx-types": "^1.3.0",
59
59
  "@wc-toolkit/module-path-resolver": "^1.0.0",
60
60
  "@wc-toolkit/storybook-helpers": "^9.0.1",
@@ -66,13 +66,13 @@
66
66
  "eslint": "^9.33.0",
67
67
  "eslint-plugin-lit": "^2.1.1",
68
68
  "eslint-plugin-lit-a11y": "^5.1.1",
69
- "eslint-plugin-storybook": "9.1.1",
69
+ "eslint-plugin-storybook": "9.1.2",
70
70
  "eslint-plugin-wc": "^3.0.1",
71
71
  "husky": "^9.1.7",
72
72
  "lint-staged": "^16.1.5",
73
73
  "postcss-styled-syntax": "^0.7.1",
74
74
  "prettier": "3.6.2",
75
- "storybook": "^9.1.1",
75
+ "storybook": "^9.1.2",
76
76
  "stylelint": "^16.23.1",
77
77
  "stylelint-config-standard": "^39.0.0",
78
78
  "stylelint-no-unsupported-browser-features": "^8.0.4",
@@ -80,8 +80,8 @@
80
80
  "stylelint-value-no-unknown-custom-properties": "^6.0.1",
81
81
  "tsc-alias": "^1.8.16",
82
82
  "typescript": "^5.9.2",
83
- "typescript-eslint": "^8.39.0",
84
- "vite": "^7.1.1",
83
+ "typescript-eslint": "^8.40.0",
84
+ "vite": "^7.1.3",
85
85
  "vite-tsconfig-paths": "^5.1.4"
86
86
  },
87
87
  "scripts": {