@skf-design-system/ui-components 1.0.2-beta.2 → 1.0.2-beta.4

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 (131) hide show
  1. package/README.md +7 -1
  2. package/dist/components/accordion/accordion-item.component.js +49 -38
  3. package/dist/components/accordion/accordion.component.d.ts +1 -1
  4. package/dist/components/accordion/accordion.component.js +10 -10
  5. package/dist/components/alert/alert.component.d.ts +5 -1
  6. package/dist/components/alert/alert.component.js +57 -54
  7. package/dist/components/alert/alert.styles.js +51 -47
  8. package/dist/components/breadcrumb/breadcrumb-item.component.js +24 -25
  9. package/dist/components/breadcrumb/breadcrumb-item.d.ts +2 -2
  10. package/dist/components/breadcrumb/breadcrumb-item.styles.js +16 -15
  11. package/dist/components/breadcrumb/breadcrumb.component.d.ts +5 -2
  12. package/dist/components/breadcrumb/breadcrumb.component.js +51 -46
  13. package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
  14. package/dist/components/breadcrumb/breadcrumb.styles.js +13 -10
  15. package/dist/components/button/button.component.js +39 -39
  16. package/dist/components/button/button.styles.js +2 -1
  17. package/dist/components/card/card.component.d.ts +5 -0
  18. package/dist/components/card/card.component.js +46 -24
  19. package/dist/components/card/card.styles.js +31 -14
  20. package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +4 -1
  21. package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +7 -7
  22. package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
  23. package/dist/components/datepicker/datepicker-calendar.js +6 -0
  24. package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +5 -20
  25. package/dist/components/{date-picker/datepicker.component.js → datepicker/datepicker-popup.component.js} +12 -12
  26. package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
  27. package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
  28. package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
  29. package/dist/components/datepicker/datepicker-popup.js +6 -0
  30. package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
  31. package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +17 -12
  32. package/dist/components/{date-picker-input/datepicker-input.component.js → datepicker/datepicker.component.js} +110 -97
  33. package/dist/components/datepicker/datepicker.d.ts +8 -0
  34. package/dist/components/datepicker/datepicker.js +6 -0
  35. package/dist/components/dialog/dialog.component.js +1 -1
  36. package/dist/components/dialog/dialog.d.ts +2 -2
  37. package/dist/components/drawer/drawer.d.ts +2 -2
  38. package/dist/components/header/header.d.ts +2 -2
  39. package/dist/components/heading/heading.component.d.ts +5 -1
  40. package/dist/components/heading/heading.component.js +54 -27
  41. package/dist/components/heading/heading.styles.js +34 -36
  42. package/dist/components/icon/icon.component.d.ts +4 -0
  43. package/dist/components/icon/icon.component.js +52 -43
  44. package/dist/components/icon/icon.styles.js +60 -60
  45. package/dist/components/input/input.component.js +26 -26
  46. package/dist/components/logo/logo.component.d.ts +4 -1
  47. package/dist/components/logo/logo.component.js +55 -51
  48. package/dist/components/logo/logo.styles.js +26 -16
  49. package/dist/components/menu/menu-item.d.ts +2 -2
  50. package/dist/components/menu/menu.d.ts +2 -2
  51. package/dist/components/nav/nav-item.component.d.ts +2 -2
  52. package/dist/components/nav/nav.d.ts +2 -2
  53. package/dist/components/popover/popover.component.js +1 -1
  54. package/dist/components/popover/popover.d.ts +2 -2
  55. package/dist/components/progress/progress.d.ts +2 -2
  56. package/dist/components/progress/progress.styles.js +8 -6
  57. package/dist/components/segmented-button/segmented-button-item.d.ts +2 -2
  58. package/dist/components/segmented-button/segmented-button.d.ts +2 -2
  59. package/dist/components/select/select-option-group.d.ts +2 -2
  60. package/dist/components/select/select-option.component.d.ts +2 -2
  61. package/dist/components/select/select-option.component.js +9 -9
  62. package/dist/components/select/select.component.d.ts +2 -2
  63. package/dist/components/select/select.component.js +3 -4
  64. package/dist/components/select/select.controllers.js +11 -14
  65. package/dist/components/stepper/stepper-item.component.js +47 -47
  66. package/dist/components/stepper/stepper-item.d.ts +2 -2
  67. package/dist/components/stepper/stepper.d.ts +2 -2
  68. package/dist/components/switch/switch.d.ts +2 -2
  69. package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
  70. package/dist/components/{tab → tabs}/tab.component.d.ts +2 -2
  71. package/dist/components/{tab → tabs}/tab.d.ts +2 -2
  72. package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
  73. package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +35 -36
  74. package/dist/components/tabs/tabs.d.ts +8 -0
  75. package/dist/components/tabs/tabs.js +6 -0
  76. package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
  77. package/dist/components/tag/tag.component.d.ts +7 -2
  78. package/dist/components/tag/tag.component.js +69 -65
  79. package/dist/components/tag/tag.d.ts +2 -2
  80. package/dist/components/tag/tag.styles.js +63 -50
  81. package/dist/components/tooltip/tooltip.d.ts +2 -2
  82. package/dist/custom-elements.json +233 -126
  83. package/dist/index.d.ts +6 -5
  84. package/dist/index.js +96 -93
  85. package/dist/internal/base-classes/popover/popover.base.js +1 -1
  86. package/dist/internal/components/skf-element.d.ts +1 -3
  87. package/dist/internal/components/skf-element.js +4 -9
  88. package/dist/internal/helpers/stateMap.d.ts +14 -0
  89. package/dist/internal/helpers/stateMap.js +68 -0
  90. package/dist/internal/helpers/watch.d.ts +1 -1
  91. package/dist/internal/helpers/watch.js +12 -12
  92. package/dist/styles/component.styles.js +37 -36
  93. package/dist/styles/{global-without-fonts.css → global-alt.css} +1 -1
  94. package/dist/styles/global.css +1 -1
  95. package/dist/types/jsx/custom-element-jsx.d.ts +86 -44
  96. package/dist/types/vue/index.d.ts +86 -44
  97. package/dist/vscode.html-custom-data.json +103 -17
  98. package/dist/web-types.json +208 -55
  99. package/package.json +14 -20
  100. package/dist/components/accordion/accordion-item.test.d.ts +0 -1
  101. package/dist/components/accordion/accordion.test.d.ts +0 -1
  102. package/dist/components/checkbox/checkbox.test.d.ts +0 -1
  103. package/dist/components/date-picker/datepicker.d.ts +0 -10
  104. package/dist/components/date-picker/datepicker.helpers.js +0 -76
  105. package/dist/components/date-picker/datepicker.js +0 -8
  106. package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
  107. package/dist/components/date-picker-input/datepicker-input.js +0 -6
  108. package/dist/components/input/input.test.d.ts +0 -1
  109. package/dist/components/radio/radio.test.d.ts +0 -1
  110. package/dist/components/switch/switch.test.d.ts +0 -1
  111. package/dist/components/tab-group/tab-group.d.ts +0 -8
  112. package/dist/components/tab-group/tab-group.js +0 -6
  113. package/dist/internal/playwright/index.d.ts +0 -1
  114. /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
  115. /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
  116. /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
  117. /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
  118. /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
  119. /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
  120. /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +0 -0
  121. /package/dist/components/select/{select.stories.icons.d.ts → stories/select.stories.icons.d.ts} +0 -0
  122. /package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +0 -0
  123. /package/dist/components/{tab-panel → tabs}/tab-panel.component.js +0 -0
  124. /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
  125. /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
  126. /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
  127. /package/dist/components/{tab → tabs}/tab.component.js +0 -0
  128. /package/dist/components/{tab → tabs}/tab.js +0 -0
  129. /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
  130. /package/dist/components/{tab → tabs}/tab.styles.js +0 -0
  131. /package/dist/components/{tab-group/tab-group.styles.d.ts → tabs/tabs.styles.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
- import { SkfDrawer } from './drawer.component';
2
- export * from './drawer.component';
1
+ import { SkfDrawer } from './drawer.component.js';
2
+ export * from './drawer.component.js';
3
3
  export default SkfDrawer;
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
@@ -1,5 +1,5 @@
1
- import { SkfHeader } from './header.component';
2
- export * from './header.component';
1
+ import { SkfHeader } from './header.component.js';
2
+ export * from './header.component.js';
3
3
  export default SkfHeader;
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
@@ -10,10 +10,14 @@ import { type CSSResultGroup } from 'lit';
10
10
  * @tagname skf-heading
11
11
  */
12
12
  export declare class SkfHeading extends SkfElement {
13
+ #private;
13
14
  static styles: CSSResultGroup;
14
15
  /** Controls which heading element will be rendered. Should not be used to affect appearance */
15
16
  as: HeadingType;
16
17
  /** If defined, changes the appearance of the heading */
17
18
  styledAs?: HeadingType;
18
- render(): import("lit").TemplateResult;
19
+ connectedCallback(): void;
20
+ /** @internal */
21
+ _handleStateChange(): void;
22
+ render(): import("lit").TemplateResult<1>;
19
23
  }
@@ -1,35 +1,62 @@
1
- import { SkfElement as f } from "../../internal/components/skf-element.js";
2
- import { componentStyles as n } from "../../styles/component.styles.js";
3
- import "lit";
4
- import { property as i } from "lit/decorators.js";
5
- import { literal as u, html as c } from "lit/static-html.js";
6
- import { styles as y } from "./heading.styles.js";
7
- var d = Object.defineProperty, a = (l, r, p, h) => {
8
- for (var t = void 0, o = l.length - 1, m; o >= 0; o--)
9
- (m = l[o]) && (t = m(r, p, t) || t);
10
- return t && d(r, p, t), t;
1
+ var y = (t) => {
2
+ throw TypeError(t);
11
3
  };
12
- const s = class s extends f {
4
+ var d = (t, e, s) => e.has(t) || y("Cannot " + s);
5
+ var n = (t, e, s) => (d(t, e, "read from private field"), s ? s.call(t) : e.get(t)), c = (t, e, s) => e.has(t) ? y("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), m = (t, e, s, r) => (d(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
6
+ import { SkfElement as b } from "../../internal/components/skf-element.js";
7
+ import { stateMap as _ } from "../../internal/helpers/stateMap.js";
8
+ import { watch as C } from "../../internal/helpers/watch.js";
9
+ import { componentStyles as g } from "../../styles/component.styles.js";
10
+ import { html as w } from "lit";
11
+ import { property as v } from "lit/decorators.js";
12
+ import { styles as L } from "./heading.styles.js";
13
+ var O = Object.defineProperty, P = Object.getOwnPropertyDescriptor, f = (t, e, s, r) => {
14
+ for (var a = r > 1 ? void 0 : r ? P(e, s) : e, l = t.length - 1, p; l >= 0; l--)
15
+ (p = t[l]) && (a = (r ? p(e, s, a) : p(a)) || a);
16
+ return r && a && O(e, s, a), a;
17
+ }, h, i;
18
+ const u = class u extends b {
13
19
  constructor() {
14
- super(...arguments), this.as = "h2";
20
+ super(...arguments);
21
+ c(this, h);
22
+ c(this, i);
23
+ m(this, h, this.attachInternals()), m(this, i, n(this, h).states), this.as = "h2";
24
+ }
25
+ connectedCallback() {
26
+ switch (super.connectedCallback(), this.role = "heading", !0) {
27
+ case this.as === "h1":
28
+ this.ariaLevel = "1";
29
+ break;
30
+ case this.as === "h3":
31
+ this.ariaLevel = "3";
32
+ break;
33
+ case this.as === "h4":
34
+ this.ariaLevel = "4";
35
+ break;
36
+ default:
37
+ this.ariaLevel = "2";
38
+ break;
39
+ }
40
+ }
41
+ _handleStateChange() {
42
+ const s = ["h1", "h2", "h3", "h4"];
43
+ _(n(this, i), s).set(this.styledAs);
15
44
  }
16
45
  render() {
17
- const r = u`${this.as}`;
18
- return c`
19
- <${r} id="root">
20
- <slot></slot>
21
- </${r}>
22
- `;
46
+ return w`<slot data-as=${this.as} id="root"></slot>`;
23
47
  }
24
48
  };
25
- s.styles = [n, y];
26
- let e = s;
27
- a([
28
- i({ reflect: !0 })
29
- ], e.prototype, "as");
30
- a([
31
- i({ attribute: "styled-as", reflect: !0 })
32
- ], e.prototype, "styledAs");
49
+ h = new WeakMap(), i = new WeakMap(), u.styles = [g, L];
50
+ let o = u;
51
+ f([
52
+ v({ type: String, reflect: !0, useDefault: !0 })
53
+ ], o.prototype, "as", 2);
54
+ f([
55
+ v({ type: String, attribute: "styled-as" })
56
+ ], o.prototype, "styledAs", 2);
57
+ f([
58
+ C("styledAs")
59
+ ], o.prototype, "_handleStateChange", 1);
33
60
  export {
34
- e as SkfHeading
61
+ o as SkfHeading
35
62
  };
@@ -1,57 +1,55 @@
1
1
  import { css as s } from "lit";
2
2
  const t = s`
3
3
  @layer components {
4
- :host {
5
- display: contents;
6
- }
7
-
8
- #root {
9
- color: var(--skf-text-color-primary);
10
- font-size: var(--_skf-heading-size);
11
- font-weight: var(--_skf-heading-weight);
12
- line-height: 1.2;
13
-
14
- /* Defaults */
15
- :host([as='h1']) & {
16
- --_skf-heading-size: var(--skf-font-size-700);
17
- --_skf-heading-weight: var(--skf-font-weight-regular);
18
- }
19
-
20
- :host(:is([as='h2'], [as='h3'], [as='h4'])) & {
21
- --_skf-heading-weight: var(--skf-font-weight-bold);
22
- }
23
-
24
- :host([as='h2']) & {
25
- --_skf-heading-size: var(--skf-font-size-300);
26
- }
27
-
28
- :host([as='h3']) & {
29
- --_skf-heading-size: var(--skf-font-size-200);
30
- }
31
-
32
- :host([as='h4']) & {
33
- --_skf-heading-size: var(--skf-font-size-200);
4
+ @layer base {
5
+ #root {
6
+ color: var(--skf-text-color-primary);
7
+ font-size: var(--_skf-heading-size);
8
+ font-weight: var(--_skf-heading-weight);
9
+ line-height: 1.2;
10
+
11
+ &[data-as='h1'] {
12
+ --_skf-heading-size: var(--skf-font-size-700);
13
+ --_skf-heading-weight: var(--skf-font-weight-regular);
14
+ }
15
+
16
+ &:is([data-as='h2'], [data-as='h3'], [data-as='h4']) {
17
+ --_skf-heading-weight: var(--skf-font-weight-bold);
18
+ }
19
+
20
+ &[data-as='h2'] {
21
+ --_skf-heading-size: var(--skf-font-size-300);
22
+ }
23
+
24
+ &[data-as='h3'] {
25
+ --_skf-heading-size: var(--skf-font-size-200);
26
+ }
27
+
28
+ &[data-as='h4'] {
29
+ --_skf-heading-size: var(--skf-font-size-200);
30
+ }
34
31
  }
32
+ }
35
33
 
36
- /** Styled As */
37
- :host([styled-as='h1']) & {
34
+ @layer mods {
35
+ :host(:state(h1)) #root {
38
36
  --_skf-heading-size: var(--skf-font-size-700);
39
37
  --_skf-heading-weight: var(--skf-font-weight-regular);
40
38
  }
41
39
 
42
- :host(:is([styled-as='h2'], [styled-as='h3'], [styled-as='h4'])) & {
40
+ :host(:is(:state(h2), :state(h3), :state(h4))) #root {
43
41
  --_skf-heading-weight: var(--skf-font-weight-bold);
44
42
  }
45
43
 
46
- :host([styled-as='h2']) & {
44
+ :host(:state(h2)) #root {
47
45
  --_skf-heading-size: var(--skf-font-size-300);
48
46
  }
49
47
 
50
- :host([styled-as='h3']) & {
48
+ :host(:state(h3)) #root {
51
49
  --_skf-heading-size: var(--skf-font-size-200);
52
50
  }
53
51
 
54
- :host([styled-as='h4']) & {
52
+ :host(:state(h4)) #root {
55
53
  --_skf-heading-size: var(--skf-font-size-200);
56
54
  }
57
55
  }
@@ -11,6 +11,7 @@ type SkfIconSize = IconSize;
11
11
  * @tagname skf-icon
12
12
  */
13
13
  export declare class SkfIcon extends SkfElement {
14
+ #private;
14
15
  static styles: CSSResultGroup;
15
16
  /** Sets the color of the icon */
16
17
  color: IconColor;
@@ -20,6 +21,9 @@ export declare class SkfIcon extends SkfElement {
20
21
  name: Icon;
21
22
  /** Size of the icon */
22
23
  size: SkfIconSize;
24
+ connectedCallback(): void;
25
+ /** @internal */
26
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
23
27
  render(): import("lit").TemplateResult<1>;
24
28
  }
25
29
  export {};
@@ -1,51 +1,60 @@
1
- import { SkfElement as f } from "../../internal/components/skf-element.js";
2
- import { ICONS as c } from "@skf-design-system/ui-assets";
3
- import { componentStyles as d } from "../../styles/component.styles.js";
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 { styles as 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;
1
+ var u = (t) => {
2
+ throw TypeError(t);
13
3
  };
14
- const l = class l extends f {
4
+ var g = (t, e, r) => e.has(t) || u("Cannot " + r);
5
+ var c = (t, e, r) => (g(t, e, "read from private field"), r ? r.call(t) : e.get(t)), y = (t, e, r) => e.has(t) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), d = (t, e, r, o) => (g(t, e, "write to private field"), o ? o.call(t, r) : e.set(t, r), r);
6
+ import { SkfElement as v } from "../../internal/components/skf-element.js";
7
+ import { stateMap as b } from "../../internal/helpers/stateMap.js";
8
+ import { watch as _ } from "../../internal/helpers/watch.js";
9
+ import { ICONS as S } from "@skf-design-system/ui-assets";
10
+ import { componentStyles as C } from "../../styles/component.styles.js";
11
+ import { html as O } from "lit";
12
+ import { property as n } from "lit/decorators.js";
13
+ import { styles as w } from "./icon.styles.js";
14
+ var z = Object.defineProperty, P = Object.getOwnPropertyDescriptor, p = (t, e, r, o) => {
15
+ for (var s = o > 1 ? void 0 : o ? P(e, r) : e, m = t.length - 1, h; m >= 0; m--)
16
+ (h = t[m]) && (s = (o ? h(e, r, s) : h(s)) || s);
17
+ return o && s && z(e, r, s), s;
18
+ };
19
+ const x = {
20
+ color: ["emphasised", "error", "info", "inverse", "primary", "secondary", "success", "warning"],
21
+ size: ["lg", "md", "sm", "xs"]
22
+ };
23
+ var a, l;
24
+ const f = class f extends v {
15
25
  constructor() {
16
- super(...arguments), this.color = "primary", this.size = "md";
26
+ super(...arguments);
27
+ y(this, a);
28
+ y(this, l);
29
+ d(this, a, this.attachInternals()), d(this, l, c(this, a).states), this.color = "primary", this.size = "md";
30
+ }
31
+ connectedCallback() {
32
+ super.connectedCallback(), this.ariaHidden = this.label ? null : "true", this.ariaLabel = this.label ?? null, this.role = this.label ? "img" : null;
33
+ }
34
+ _handleStateChange(r, o, s) {
35
+ b(c(this, l), x[r]).set(s);
17
36
  }
18
37
  render() {
19
- return h`
20
- <div
21
- aria-hidden=${s(this.label ? void 0 : "true")}
22
- aria-label=${s(this.label)}
23
- class=${u({
24
- icon: !0,
25
- [`icon--color-${this.color}`]: !0,
26
- [`icon--size-${this.size}`]: !0
27
- })}
28
- role=${s(this.label ? "img" : void 0)}
29
- >
30
- ${c[this.name]}
31
- </div>
32
- `;
38
+ return O`<div id="root">${S[this.name]}</div>`;
33
39
  }
34
40
  };
35
- l.styles = [d, v];
36
- let e = l;
37
- o([
38
- t({ reflect: !0 })
39
- ], e.prototype, "color");
40
- o([
41
- t()
42
- ], e.prototype, "label");
43
- o([
44
- t()
45
- ], e.prototype, "name");
46
- o([
47
- t({ reflect: !0 })
48
- ], e.prototype, "size");
41
+ a = new WeakMap(), l = new WeakMap(), f.styles = [C, w];
42
+ let i = f;
43
+ p([
44
+ n({ type: String })
45
+ ], i.prototype, "color", 2);
46
+ p([
47
+ n({ type: String })
48
+ ], i.prototype, "label", 2);
49
+ p([
50
+ n({ type: String })
51
+ ], i.prototype, "name", 2);
52
+ p([
53
+ n({ type: String })
54
+ ], i.prototype, "size", 2);
55
+ p([
56
+ _(["color", "size"])
57
+ ], i.prototype, "_handleStateChange", 1);
49
58
  export {
50
- e as SkfIcon
59
+ i as SkfIcon
51
60
  };
@@ -1,84 +1,84 @@
1
1
  import { css as o } from "lit";
2
- const i = o`
3
- /* stylelint-disable selector-class-pattern */
2
+ const r = o`
4
3
  @layer components {
5
- :host {
6
- display: inline-flex;
7
- }
4
+ @layer base {
5
+ :host {
6
+ display: inline-flex;
7
+ }
8
8
 
9
- :host-context(.skf-icon-host) {
10
- color: inherit;
11
- }
9
+ #root {
10
+ --_skf-icon-color: var(--skf-icon-color-primary);
11
+ --_skf-icon-size: var(--skf-icon-size-md);
12
12
 
13
- .icon {
14
- block-size: var(--_skf-icon-size);
15
- display: inline-flex;
16
- flex-shrink: 0; /* Prevents shrink when flex-child */
17
- inline-size: var(--_skf-icon-size);
18
- pointer-events: none;
19
- user-select: none;
13
+ block-size: var(--_skf-icon-size);
14
+ flex-shrink: 0; /* Prevents shrink when flex-child */
15
+ inline-size: var(--_skf-icon-size);
16
+ pointer-events: none;
17
+ user-select: none;
20
18
 
21
- :not(:host-context(.skf-icon-host)) & {
22
- color: var(--_skf-icon-color, var(--skf-icon-color-primary));
19
+ :host(:not([data-color='custom'])) & {
20
+ color: var(--_skf-icon-color);
21
+ }
23
22
  }
24
23
  }
25
24
 
26
- /**
27
- * Colors
28
- */
29
- .icon--color-secondary {
30
- --_skf-icon-color: var(--skf-icon-color-secondary);
31
- }
25
+ @layer mods {
26
+ /**
27
+ * Color
28
+ */
29
+ :host([data-color='custom']) {
30
+ color: inherit;
31
+ }
32
32
 
33
- .icon--color-inverse {
34
- --_skf-icon-color: var(--skf-icon-color-inverse);
35
- }
33
+ :host(:state(secondary)) #root {
34
+ --_skf-icon-color: var(--skf-icon-color-secondary);
35
+ }
36
36
 
37
- .icon--color-emphasised {
38
- --_skf-icon-color: var(--skf-icon-color-emphasised);
39
- }
37
+ :host(:state(inverse)) #root {
38
+ --_skf-icon-color: var(--skf-icon-color-inverse);
39
+ }
40
40
 
41
- /* Severity */
42
- .icon--color-alert {
43
- --_skf-icon-color: var(--skf-severity-fg-color-alert);
44
- }
41
+ :host(:state(emphasised)) #root {
42
+ --_skf-icon-color: var(--skf-icon-color-emphasised);
43
+ }
45
44
 
46
- .icon--color-error {
47
- --_skf-icon-color: var(--skf-severity-fg-color-error);
48
- }
45
+ :host(:state(alert)) #root {
46
+ --_skf-icon-color: var(--skf-severity-fg-color-alert);
47
+ }
49
48
 
50
- .icon--color-info {
51
- --_skf-icon-color: var(--skf-severity-fg-color-info);
52
- }
49
+ :host(:state(error)) #root {
50
+ --_skf-icon-color: var(--skf-severity-fg-color-error);
51
+ }
53
52
 
54
- .icon--color-success {
55
- --_skf-icon-color: var(--skf-severity-fg-color-success);
56
- }
53
+ :host(:state(info)) #root {
54
+ --_skf-icon-color: var(--skf-severity-fg-color-info);
55
+ }
57
56
 
58
- .icon--color-warning {
59
- --_skf-icon-color: var(--skf-severity-fg-color-warning);
60
- }
57
+ :host(:state(success)) #root {
58
+ --_skf-icon-color: var(--skf-severity-fg-color-success);
59
+ }
61
60
 
62
- /**
63
- * Sizes
64
- */
65
- .icon--size-xs {
66
- --_skf-icon-size: var(--skf-icon-size-xs);
67
- }
61
+ :host(:state(warning)) #root {
62
+ --_skf-icon-color: var(--skf-severity-fg-color-warning);
63
+ }
68
64
 
69
- .icon--size-sm {
70
- --_skf-icon-size: var(--skf-icon-size-sm);
71
- }
65
+ /**
66
+ * Size
67
+ */
68
+ :host(:state(xs)) #root {
69
+ --_skf-icon-size: var(--skf-icon-size-xs);
70
+ }
72
71
 
73
- .icon--size-md {
74
- --_skf-icon-size: var(--skf-icon-size-md);
75
- }
72
+ :host(:state(sm)) #root {
73
+ --_skf-icon-size: var(--skf-icon-size-sm);
74
+ }
76
75
 
77
- .icon--size-lg {
78
- --_skf-icon-size: var(--skf-icon-size-lg);
76
+ :host(:state(lg)) #root {
77
+ --_skf-icon-size: var(--skf-icon-size-lg);
78
+ }
79
79
  }
80
80
  }
81
81
  `;
82
82
  export {
83
- i as styles
83
+ r as styles
84
84
  };
@@ -7,14 +7,14 @@ import { Asterisk as f } from "../../internal/templates/asterisk.js";
7
7
  import { componentStyles as _ } from "../../styles/component.styles.js";
8
8
  import { html as h, nothing as u } from "lit";
9
9
  import { state as p, property as s, query as $, queryAssignedNodes as g } from "lit/decorators.js";
10
- import { ifDefined as o } from "lit/directives/if-defined.js";
10
+ import { ifDefined as n } from "lit/directives/if-defined.js";
11
11
  import { live as w } from "lit/directives/live.js";
12
12
  import { InputNumberController as E, InputPasswordController as C } from "./input.controllers.js";
13
13
  import A from "./input.styles.js";
14
14
  var L = Object.defineProperty, P = Object.getOwnPropertyDescriptor, e = (v, t, r, a) => {
15
- for (var n = a > 1 ? void 0 : a ? P(t, r) : t, l = v.length - 1, d; l >= 0; l--)
16
- (d = v[l]) && (n = (a ? d(t, r, n) : d(n)) || n);
17
- return a && n && L(t, r, n), n;
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
18
  };
19
19
  const m = class m extends c {
20
20
  constructor() {
@@ -46,7 +46,7 @@ const m = class m extends c {
46
46
  `, this._renderPasswordButton = () => h`
47
47
  <button
48
48
  @click=${this._passwordController.toggleVisibility}
49
- aria-label=${o(this._passwordController._buttonAriaLabel)}
49
+ aria-label=${n(this._passwordController._buttonAriaLabel)}
50
50
  class="password skf-icon-host"
51
51
  type="button"
52
52
  @mousedown="${this._handlePressStart}"
@@ -61,7 +61,7 @@ const m = class m extends c {
61
61
  @mousedown=${this._handlePressStart}
62
62
  @mouseup=${this._handlePressEnd}
63
63
  @mouseleave=${this._handlePressEnd}
64
- aria-label=${o(this.buttonAriaLabelClear)}
64
+ aria-label=${n(this.buttonAriaLabelClear)}
65
65
  class="search skf-icon-host"
66
66
  type="button"
67
67
  >
@@ -124,12 +124,12 @@ const m = class m extends c {
124
124
  this.invalid = !this._pristine && !r.valid;
125
125
  let a;
126
126
  for (a in r) {
127
- const n = `data-${a.toString()}`;
128
- if (r[a] && !this.hasAttribute(n) && this.debug && console.log(
129
- `Add custom message on ${this.localName} using attribute: ${n.toUpperCase()}="Your custom message"`
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
130
  ), r[a]) {
131
131
  this.validationError = a.toString();
132
- const l = this.hasAttribute(n) ? this.getAttribute(n) : this.$input.validationMessage;
132
+ const l = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
133
133
  this._internals.setValidity(
134
134
  { [this.validationError]: !0, customError: this._internals.validity.customError },
135
135
  this.withFallback(l)
@@ -139,7 +139,7 @@ const m = class m extends c {
139
139
  }
140
140
  }
141
141
  render() {
142
- var r, a, n, l;
142
+ var r, a, o, l;
143
143
  const t = (this._defaultSlot.length === 0 || !((a = (r = this._defaultSlot[0]) == null ? void 0 : r.textContent) != null && a.trim())) && !this.label;
144
144
  return h`
145
145
  <div id="root">
@@ -151,31 +151,31 @@ const m = class m extends c {
151
151
  <div id="input">
152
152
  ${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : u}
153
153
  <div
154
- data-leading=${o(this.leading)}
155
- data-trailing=${o(this.trailing)}
154
+ data-leading=${n(this.leading)}
155
+ data-trailing=${n(this.trailing)}
156
156
  id="affix"
157
157
  >
158
158
  <input
159
159
  ?disabled=${this.disabled}
160
160
  ?readonly=${this.readonly}
161
161
  ?required=${this.required}
162
+ .autocomplete=${this.autocomplete ?? "off"}
162
163
  .value=${w(this.value)}
163
164
  @blur=${this._onBlur}
164
165
  @input=${this._handleInput}
165
- .autocomplete=${this.autocomplete}
166
- aria-describedby=${o((n = this.hint) != null && n.trim() ? "hint" : u)}
167
- aria-errormessage=${o((l = this.hint) != null && l.trim() ? "hint" : u)}
166
+ aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" : u)}
167
+ aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" : u)}
168
168
  aria-invalid=${!!this.invalid}
169
169
  data-testid="field-input"
170
- inputmode=${o(this.inputMode)}
171
- max=${o(this.max)}
172
- maxlength=${o(this.maxLength)}
173
- min=${o(this.min)}
174
- minlength=${o(this.minLength)}
175
- name=${o(this.name)}
176
- pattern=${o(this.pattern)}
177
- placeholder=${o(this.placeholder)}
178
- type=${o(
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(
179
179
  this.type === "password" ? this._passwordController._type : this.type
180
180
  )}
181
181
  />
@@ -193,7 +193,7 @@ const m = class m extends c {
193
193
  <skf-hint
194
194
  aria-live=${this.invalid ? "assertive" : "polite"}
195
195
  id="hint"
196
- severity=${o(b(this.invalid, this.severity))}
196
+ severity=${n(b(this.invalid, this.severity))}
197
197
  >${this.customInvalid ?? this.hint}
198
198
  </skf-hint>
199
199
  `}
@@ -5,16 +5,19 @@ type SkfLogoColor = Logo;
5
5
  /**
6
6
  * The `<skf-logo>` component is used to display the SKF logo.
7
7
  *
8
- * @cssproperty --skf-logo-height - The height of the logo
8
+ * @cssproperty --mod-logo-height - The height of the logo
9
9
  *
10
10
  * @tagname skf-logo
11
11
  */
12
12
  export declare class SkfLogo extends SkfElement {
13
+ #private;
13
14
  static styles: CSSResultGroup;
14
15
  /** Defines the title of the logo */
15
16
  title: string;
16
17
  /** Defines the color of the logo */
17
18
  color: SkfLogoColor;
19
+ /** @internal */
20
+ _handleStateChange(): void;
18
21
  render(): import("lit").TemplateResult<1>;
19
22
  }
20
23
  export {};