@skf-design-system/ui-components 1.0.0-alpha.36 → 1.0.0-alpha.38

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.
@@ -1,5 +1,6 @@
1
1
  import { SkfElement } from '../../internal/components/skf-element.js';
2
2
  import { type CSSResultGroup } from 'lit';
3
+ type Size = 'md' | 'sm';
3
4
  /**
4
5
  * The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities
5
6
  *
@@ -15,7 +16,10 @@ export declare class SkfLoader extends SkfElement {
15
16
  /** If true, inverts the color (to be used on colored backgrounds) */
16
17
  invert: boolean;
17
18
  /** Defines the size of the loader */
18
- size?: 'md' | 'sm';
19
+ size: Size;
19
20
  connectedCallback(): void;
21
+ /** @internal */
22
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
20
23
  render(): import("lit").TemplateResult<1>;
21
24
  }
25
+ export {};
@@ -1,29 +1,40 @@
1
- var m = (t) => {
1
+ var y = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var f = (t, e, r) => e.has(t) || m("Cannot " + r);
5
- var n = (t, e, r) => (f(t, e, "read from private field"), r ? r.call(t) : e.get(t)), h = (t, e, r) => e.has(t) ? m("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), u = (t, e, r, l) => (f(t, e, "write to private field"), l ? l.call(t, r) : e.set(t, r), r);
6
- import { SkfElement as b } from "../../internal/components/skf-element.js";
7
- import { componentStyles as y } from "../../styles/component.styles.js";
8
- import { html as g } from "lit";
9
- import { property as c } from "lit/decorators.js";
10
- import { styles as C } from "./loader.styles.js";
11
- var _ = Object.defineProperty, p = (t, e, r, l) => {
12
- for (var i = void 0, o = t.length - 1, v; o >= 0; o--)
13
- (v = t[o]) && (i = v(e, r, i) || i);
14
- return i && _(e, r, i), i;
15
- }, s;
16
- const d = class d extends b {
4
+ var b = (t, e, r) => e.has(t) || y("Cannot " + r);
5
+ var m = (t, e, r) => (b(t, e, "read from private field"), r ? r.call(t) : e.get(t)), v = (t, e, r) => e.has(t) ? y("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), h = (t, e, r, i) => (b(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
6
+ import { SkfElement as _ } from "../../internal/components/skf-element.js";
7
+ import { stateMap as g } from "../../internal/helpers/stateMap.js";
8
+ import { watch as C } from "../../internal/helpers/watch.js";
9
+ import { componentStyles as O } from "../../styles/component.styles.js";
10
+ import { html as P } from "lit";
11
+ import { property as d } from "lit/decorators.js";
12
+ import { styles as S } from "./loader.styles.js";
13
+ var j = Object.defineProperty, w = Object.getOwnPropertyDescriptor, l = (t, e, r, i) => {
14
+ for (var s = i > 1 ? void 0 : i ? w(e, r) : e, n = t.length - 1, c; n >= 0; n--)
15
+ (c = t[n]) && (s = (i ? c(e, r, s) : c(s)) || s);
16
+ return i && s && j(e, r, s), s;
17
+ };
18
+ const u = {
19
+ invert: "invert",
20
+ size: ["md", "sm"]
21
+ };
22
+ var o, p;
23
+ const f = class f extends _ {
17
24
  constructor() {
18
25
  super(...arguments);
19
- h(this, s);
20
- u(this, s, this.attachInternals()), this.ariaLabel = "Loading...", this.invert = !1, this.size = "md";
26
+ v(this, o);
27
+ v(this, p);
28
+ h(this, o, this.attachInternals()), h(this, p, m(this, o).states), this.ariaLabel = "Loading...", this.invert = !1, this.size = "md";
21
29
  }
22
30
  connectedCallback() {
23
- super.connectedCallback(), n(this, s).role = "progressbar", n(this, s).ariaLive = "polite";
31
+ super.connectedCallback(), this.role = "progressbar", this.ariaLive = "polite";
32
+ }
33
+ _handleStateChange(r, i, s) {
34
+ g(m(this, p), u[r]).set(s);
24
35
  }
25
36
  render() {
26
- return g`
37
+ return P`
27
38
  <div id="root">
28
39
  <div class="circle"></div>
29
40
  <div class="circle"></div>
@@ -32,17 +43,20 @@ const d = class d extends b {
32
43
  `;
33
44
  }
34
45
  };
35
- s = new WeakMap(), d.styles = [y, C];
36
- let a = d;
37
- p([
38
- c({ reflect: !0, attribute: "aria-label" })
39
- ], a.prototype, "ariaLabel");
40
- p([
41
- c({ type: Boolean })
42
- ], a.prototype, "invert");
43
- p([
44
- c({ reflect: !0 })
45
- ], a.prototype, "size");
46
+ o = new WeakMap(), p = new WeakMap(), f.styles = [O, S];
47
+ let a = f;
48
+ l([
49
+ d({ type: String, attribute: "aria-label" })
50
+ ], a.prototype, "ariaLabel", 2);
51
+ l([
52
+ d({ type: Boolean })
53
+ ], a.prototype, "invert", 2);
54
+ l([
55
+ d({ type: String })
56
+ ], a.prototype, "size", 2);
57
+ l([
58
+ C(Object.keys(u))
59
+ ], a.prototype, "_handleStateChange", 1);
46
60
  export {
47
61
  a as SkfLoader
48
62
  };
@@ -33,17 +33,13 @@ const o = a`
33
33
  }
34
34
 
35
35
  @layer mods {
36
- :host([invert]) {
37
- #root {
38
- --_skf-loader-color: var(--skf-bg-color-neutral-1);
39
- }
36
+ :host(:state(invert)) #root {
37
+ --_skf-loader-color: var(--skf-bg-color-neutral-1);
40
38
  }
41
39
 
42
- :host([size='sm']) {
43
- #root {
44
- --_skf-loader-gap: var(--skf-spacing-25);
45
- --_skf-loader-size: var(--skf-size-4);
46
- }
40
+ :host(:state(sm)) #root {
41
+ --_skf-loader-gap: var(--skf-spacing-25);
42
+ --_skf-loader-size: var(--skf-size-4);
47
43
  }
48
44
  }
49
45
  }
@@ -6,7 +6,7 @@ const s = class s extends t {
6
6
  }
7
7
  /** @internal */
8
8
  addEventListeners(i) {
9
- i.addEventListener(this.triggerEvent, this.open.bind(this), { signal: this.signal });
9
+ i.addEventListener(this.triggerEvent, this.open, { signal: this.signal });
10
10
  }
11
11
  };
12
12
  s.styles = [t.styles, r];
@@ -52,6 +52,7 @@ const t = [
52
52
  gap: 0 var(--skf-spacing-75);
53
53
  justify-content: space-between;
54
54
  padding-inline: var(--skf-spacing-75);
55
+ white-space: nowrap;
55
56
 
56
57
  &:hover {
57
58
  --_skf-select-button-bg-color: var(--skf-interactive-bg-color-secondary-hover);
@@ -820,6 +820,22 @@
820
820
  "description": "The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities",
821
821
  "name": "SkfLoader",
822
822
  "members": [
823
+ {
824
+ "kind": "field",
825
+ "name": "#internals",
826
+ "privacy": "private",
827
+ "type": {
828
+ "text": "ElementInternals"
829
+ }
830
+ },
831
+ {
832
+ "kind": "field",
833
+ "name": "#states",
834
+ "privacy": "private",
835
+ "type": {
836
+ "text": "CustomStateSet"
837
+ }
838
+ },
823
839
  {
824
840
  "kind": "field",
825
841
  "name": "ariaLabel",
@@ -828,8 +844,7 @@
828
844
  },
829
845
  "default": "'Loading...'",
830
846
  "description": "Defines the aria-label",
831
- "attribute": "aria-label",
832
- "reflects": true
847
+ "attribute": "aria-label"
833
848
  },
834
849
  {
835
850
  "kind": "field",
@@ -845,12 +860,14 @@
845
860
  "kind": "field",
846
861
  "name": "size",
847
862
  "type": {
848
- "text": "'md' | 'sm' | undefined"
863
+ "text": "Size"
849
864
  },
850
865
  "default": "'md'",
851
866
  "description": "Defines the size of the loader",
852
867
  "attribute": "size",
853
- "reflects": true
868
+ "expandedType": {
869
+ "text": "'sm' | 'md'"
870
+ }
854
871
  }
855
872
  ],
856
873
  "attributes": [
@@ -875,11 +892,14 @@
875
892
  {
876
893
  "name": "size",
877
894
  "type": {
878
- "text": "'md' | 'sm' | undefined"
895
+ "text": "Size"
879
896
  },
880
897
  "default": "'md'",
881
898
  "description": "Defines the size of the loader",
882
- "fieldName": "size"
899
+ "fieldName": "size",
900
+ "expandedType": {
901
+ "text": "'sm' | 'md'"
902
+ }
883
903
  }
884
904
  ],
885
905
  "superclass": {
@@ -16,8 +16,8 @@ export declare class SkfPopoverBase extends SkfElement {
16
16
  /** @internal */
17
17
  triggerEvent: 'mouseenter' | 'click';
18
18
  $arrow: HTMLElement;
19
- abortEventsController: AbortController;
20
- signal: AbortSignal;
19
+ protected abortEventsController: AbortController;
20
+ protected signal: AbortSignal;
21
21
  protected popoverController: PopoverController;
22
22
  constructor();
23
23
  disconnectedCallback(): void;
@@ -28,7 +28,7 @@ export declare class SkfPopoverBase extends SkfElement {
28
28
  handleAnchorChange: () => Promise<void>;
29
29
  reposition: () => Promise<void>;
30
30
  handleEscapeKey: (e: KeyboardEvent) => void;
31
- open(e: Event): void;
31
+ open: (e: Event) => void;
32
32
  /** @internal add additional open tasks here in UI component */
33
33
  openExtended(): void;
34
34
  close(): void;
@@ -56,6 +56,8 @@ const s = (p = class extends S {
56
56
  }
57
57
  }, this.handleEscapeKey = (t) => {
58
58
  t.key === "Escape" && this.close();
59
+ }, this.open = (t) => {
60
+ t.stopPropagation(), this._toggleOpen(!0), this.abortEventsController = new AbortController(), this.signal = this.abortEventsController.signal, document.addEventListener("keydown", this.handleEscapeKey, { signal: this.signal }), this.openExtended();
59
61
  }, this.setAttribute("popover", "");
60
62
  }
61
63
  disconnectedCallback() {
@@ -80,9 +82,6 @@ const s = (p = class extends S {
80
82
  { signal: this.signal }
81
83
  ), this.$popover.id = _(this.$anchor.id), ["popup", "menu"].includes(this.variant) && (this.$anchor.setAttribute("aria-haspopup", "true"), this.setAttribute("aria-labelledby", this.$anchor.id)), ["menu"].includes(this.variant) && this.$anchor.setAttribute("aria-controls", this.$popover.id), ["popup"].includes(this.variant) && t && (this.role = "dialog"), ["tooltip"].includes(this.variant) && this.$anchor.addEventListener("focusin", this.open.bind(this), { signal: this.signal });
82
84
  }
83
- open(t) {
84
- t.stopPropagation(), this._toggleOpen(!0), this.abortEventsController = new AbortController(), this.signal = this.abortEventsController.signal, document.addEventListener("keydown", this.handleEscapeKey.bind(this), { signal: this.signal }), this.openExtended();
85
- }
86
85
  /** @internal add additional open tasks here in UI component */
87
86
  openExtended() {
88
87
  }
@@ -176,7 +176,7 @@
176
176
  {
177
177
  "name": "size",
178
178
  "description": "Defines the size of the loader",
179
- "values": [{ "name": "md" }, { "name": "sm" }]
179
+ "values": [{ "name": "Size" }]
180
180
  }
181
181
  ],
182
182
  "references": []
@@ -393,7 +393,7 @@
393
393
  {
394
394
  "name": "size",
395
395
  "description": "Defines the size of the loader",
396
- "value": { "type": "'md' | 'sm' | undefined", "default": "'md'" }
396
+ "value": { "type": "Size", "default": "'md'" }
397
397
  }
398
398
  ],
399
399
  "events": [],
@@ -412,7 +412,7 @@
412
412
  {
413
413
  "name": "size",
414
414
  "description": "Defines the size of the loader",
415
- "type": "'md' | 'sm' | undefined"
415
+ "type": "Size"
416
416
  }
417
417
  ],
418
418
  "events": []
package/package.json CHANGED
@@ -34,15 +34,15 @@
34
34
  "sideEffects": true,
35
35
  "type": "module",
36
36
  "types": "./dist/index.d.ts",
37
- "version": "1.0.0-alpha.36",
37
+ "version": "1.0.0-alpha.38",
38
38
  "dependencies": {
39
39
  "@floating-ui/dom": "^1.7.0",
40
40
  "@js-temporal/polyfill": "^0.5.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@chromatic-com/storybook": "^3.2.6",
44
- "@commitlint/cli": "^19.8.0",
45
- "@commitlint/config-conventional": "^19.8.0",
44
+ "@commitlint/cli": "^19.8.1",
45
+ "@commitlint/config-conventional": "^19.8.1",
46
46
  "@custom-elements-manifest/analyzer": "^0.10.4",
47
47
  "@eslint/js": "^9.26.0",
48
48
  "@skf-design-system/ui-assets": "0.1.3-beta.4",
@@ -56,7 +56,7 @@
56
56
  "@storybook/theming": "^8.6.12",
57
57
  "@storybook/web-components": "^8.6.12",
58
58
  "@storybook/web-components-vite": "^8.6.12",
59
- "@types/node": "^22.15.12",
59
+ "@types/node": "^22.15.17",
60
60
  "@wc-toolkit/module-path-resolver": "^1.0.0",
61
61
  "@wc-toolkit/storybook-helpers": "^1.1.2",
62
62
  "@wc-toolkit/type-parser": "^1.0.3",
@@ -70,7 +70,7 @@
70
70
  "eslint-plugin-lit-a11y": "^4.1.4",
71
71
  "eslint-plugin-wc": "^3.0.1",
72
72
  "husky": "^9.1.7",
73
- "lint-staged": "^15.5.1",
73
+ "lint-staged": "^16.0.0",
74
74
  "lit": "^3.3.0",
75
75
  "postcss-styled-syntax": "^0.7.1",
76
76
  "prettier": "3.5.3",
@@ -82,7 +82,7 @@
82
82
  "stylelint-value-no-unknown-custom-properties": "^6.0.1",
83
83
  "tsc-alias": "^1.8.16",
84
84
  "typescript": "^5.8.3",
85
- "typescript-eslint": "^8.32.0",
85
+ "typescript-eslint": "^8.32.1",
86
86
  "vite": "^6.3.5",
87
87
  "vite-tsconfig-paths": "^5.1.4"
88
88
  },