@skf-design-system/ui-components 1.0.0-alpha.30 → 1.0.0-alpha.31

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,6 +1,6 @@
1
1
  import { SkfElement } from '../../internal/components/skf-element.js';
2
2
  import type { Icon, IconColor, IconSize, SeverityFgColor } from '@skf-design-system/ui-assets';
3
- import { type CSSResultGroup } from 'lit';
3
+ import { type CSSResultGroup, type TemplateResult } from 'lit';
4
4
  /**
5
5
  * The `<skf-icon>` component is used to clarify interface elements. When used, should always be paired with (possibly invisible) text
6
6
  *
@@ -22,10 +22,12 @@ export declare class SkfIcon extends SkfElement {
22
22
  * @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" }
23
23
  */
24
24
  name: Icon;
25
+ private _icon;
26
+ handleNameChanged(): void;
25
27
  /**
26
28
  * Size of the icon
27
29
  * @type { "xs" | "sm" | "md" | "lg" }
28
30
  */
29
31
  size: IconSize;
30
- render(): import("lit").TemplateResult<1>;
32
+ render(): TemplateResult<1>;
31
33
  }
@@ -1,51 +1,64 @@
1
1
  import { SkfElement as f } from "../../internal/components/skf-element.js";
2
- import * as c from "@skf-design-system/ui-assets";
3
- import d from "../../styles/component.styles.js";
2
+ import { watch as d } from "../../internal/helpers/watch.js";
3
+ import u from "../../styles/component.styles.js";
4
4
  import { html as h } from "lit";
5
- import { property as t } from "lit/decorators.js";
6
- import { classMap as u } from "lit/directives/class-map.js";
7
- import { ifDefined as s } from "lit/directives/if-defined.js";
8
- import v from "./icon.styles.js";
9
- var y = Object.defineProperty, o = (m, p, a, $) => {
10
- for (var r = void 0, i = m.length - 1, n; i >= 0; i--)
11
- (n = m[i]) && (r = n(p, a, r) || r);
12
- return r && y(p, a, r), r;
5
+ import { property as s, state as y } from "lit/decorators.js";
6
+ import { classMap as v } from "lit/directives/class-map.js";
7
+ import { ifDefined as m } from "lit/directives/if-defined.js";
8
+ import _ from "./icon.styles.js";
9
+ var b = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, o = (c, e, p, i) => {
10
+ for (var t = i > 1 ? void 0 : i ? $(e, p) : e, l = c.length - 1, a; l >= 0; l--)
11
+ (a = c[l]) && (t = (i ? a(e, p, t) : a(t)) || t);
12
+ return i && t && b(e, p, t), t;
13
13
  };
14
- const l = class l extends f {
14
+ const n = class n extends f {
15
15
  constructor() {
16
- super(...arguments), this.color = "primary", this.size = "md";
16
+ super(...arguments), this.color = "primary", this._icon = h``, this.size = "md";
17
+ }
18
+ handleNameChanged() {
19
+ import("@skf-design-system/ui-assets").then((e) => {
20
+ this._icon = e[this.name];
21
+ }).catch((e) => {
22
+ console.error(e);
23
+ });
17
24
  }
18
25
  render() {
19
26
  return h`
20
27
  <div
21
- aria-hidden=${s(this.label ? void 0 : "true")}
22
- aria-label=${s(this.label)}
23
- class=${u({
28
+ aria-hidden=${m(this.label ? void 0 : "true")}
29
+ aria-label=${m(this.label)}
30
+ class=${v({
24
31
  icon: !0,
25
32
  [`icon--color-${this.color}`]: !0,
26
33
  [`icon--size-${this.size}`]: !0
27
34
  })}
28
- role=${s(this.label ? "img" : void 0)}
35
+ role=${m(this.label ? "img" : void 0)}
29
36
  >
30
- ${c[this.name]}
37
+ ${this._icon}
31
38
  </div>
32
39
  `;
33
40
  }
34
41
  };
35
- l.styles = [d, v];
36
- let e = l;
42
+ n.styles = [u, _];
43
+ let r = n;
44
+ o([
45
+ s({ reflect: !0 })
46
+ ], r.prototype, "color", 2);
47
+ o([
48
+ s()
49
+ ], r.prototype, "label", 2);
37
50
  o([
38
- t({ reflect: !0 })
39
- ], e.prototype, "color");
51
+ s()
52
+ ], r.prototype, "name", 2);
40
53
  o([
41
- t()
42
- ], e.prototype, "label");
54
+ y()
55
+ ], r.prototype, "_icon", 2);
43
56
  o([
44
- t()
45
- ], e.prototype, "name");
57
+ d("name")
58
+ ], r.prototype, "handleNameChanged", 1);
46
59
  o([
47
- t({ reflect: !0 })
48
- ], e.prototype, "size");
60
+ s({ reflect: !0 })
61
+ ], r.prototype, "size", 2);
49
62
  export {
50
- e as SkfIcon
63
+ r as SkfIcon
51
64
  };
@@ -1486,6 +1486,19 @@
1486
1486
  "description": "Name of the icon to display",
1487
1487
  "attribute": "name"
1488
1488
  },
1489
+ {
1490
+ "kind": "field",
1491
+ "name": "_icon",
1492
+ "type": {
1493
+ "text": "TemplateResult"
1494
+ },
1495
+ "privacy": "private",
1496
+ "default": "html``"
1497
+ },
1498
+ {
1499
+ "kind": "method",
1500
+ "name": "handleNameChanged"
1501
+ },
1489
1502
  {
1490
1503
  "kind": "field",
1491
1504
  "name": "size",
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "sideEffects": true,
35
35
  "type": "module",
36
36
  "types": "./dist/index.d.ts",
37
- "version": "1.0.0-alpha.30",
37
+ "version": "1.0.0-alpha.31",
38
38
  "dependencies": {
39
39
  "@floating-ui/dom": "^1.6.12"
40
40
  },
@@ -46,7 +46,7 @@
46
46
  "@eslint/js": "^9.16.0",
47
47
  "@lit/react": "^1.0.6",
48
48
  "@playwright/test": "^1.49.0",
49
- "@skf-design-system/ui-assets": "0.1.3-beta.8",
49
+ "@skf-design-system/ui-assets": "0.1.3-beta.9",
50
50
  "@skf-design-system/wc-storybook-helpers": "^0.1.0",
51
51
  "@storybook/addon-a11y": "^8.4.7",
52
52
  "@storybook/addon-essentials": "^8.4.7",