@skf-design-system/ui-components 1.0.0-beta.4 → 1.0.0-beta.5

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 (98) hide show
  1. package/README.md +26 -6
  2. package/dist/components/accordion/accordion.component.d.ts +9 -5
  3. package/dist/components/accordion/accordion.component.js +22 -19
  4. package/dist/components/accordion/accordion.d.ts +1 -1
  5. package/dist/components/accordion/accordion.styles.js +3 -3
  6. package/dist/components/alert/alert.component.d.ts +7 -4
  7. package/dist/components/alert/alert.component.js +21 -19
  8. package/dist/components/alert/alert.styles.js +50 -47
  9. package/dist/components/button/button.component.d.ts +2 -0
  10. package/dist/components/button/button.component.js +6 -6
  11. package/dist/components/button/button.styles.js +1 -1
  12. package/dist/components/card/card.component.d.ts +3 -3
  13. package/dist/components/card/card.component.js +16 -19
  14. package/dist/components/card/card.styles.js +11 -3
  15. package/dist/components/checkbox/checkbox.component.d.ts +9 -6
  16. package/dist/components/checkbox/checkbox.component.js +7 -7
  17. package/dist/components/checkbox/checkbox.styles.js +7 -2
  18. package/dist/components/checkbox/checkbox.test.d.ts +1 -0
  19. package/dist/components/collapse/collapse.component.d.ts +9 -6
  20. package/dist/components/collapse/collapse.component.js +39 -36
  21. package/dist/components/collapse/collapse.styles.js +3 -3
  22. package/dist/components/collapse/collapse.test.d.ts +1 -0
  23. package/dist/components/divider/divider.component.d.ts +13 -10
  24. package/dist/components/divider/divider.component.js +34 -29
  25. package/dist/components/divider/divider.styles.js +1 -5
  26. package/dist/components/heading/heading.component.d.ts +12 -2
  27. package/dist/components/heading/heading.component.js +14 -14
  28. package/dist/components/heading/heading.styles.js +1 -1
  29. package/dist/components/icon/icon.component.d.ts +14 -8
  30. package/dist/components/icon/icon.component.js +6 -6
  31. package/dist/components/icon/icon.styles.js +56 -54
  32. package/dist/components/input/input.component.d.ts +43 -29
  33. package/dist/components/input/input.component.js +46 -36
  34. package/dist/components/link/link.component.d.ts +15 -12
  35. package/dist/components/link/link.component.js +7 -7
  36. package/dist/components/link/link.styles.js +1 -1
  37. package/dist/components/loader/loader.component.d.ts +7 -7
  38. package/dist/components/loader/loader.component.js +35 -61
  39. package/dist/components/loader/loader.styles.js +42 -10
  40. package/dist/components/logo/logo.component.d.ts +5 -3
  41. package/dist/components/logo/logo.component.js +8 -8
  42. package/dist/components/logo/logo.styles.js +2 -2
  43. package/dist/components/radio/radio.component.d.ts +15 -13
  44. package/dist/components/radio/radio.component.js +3 -3
  45. package/dist/components/radio/radio.styles.js +6 -1
  46. package/dist/components/select/select.component.d.ts +12 -10
  47. package/dist/components/select/select.component.js +113 -100
  48. package/dist/components/select/select.controllers.js +5 -2
  49. package/dist/components/select/select.styles.js +18 -3
  50. package/dist/components/select-option/select-option.component.d.ts +2 -2
  51. package/dist/components/select-option/select-option.component.js +16 -10
  52. package/dist/components/switch/switch.component.d.ts +2 -3
  53. package/dist/components/switch/switch.component.js +1 -1
  54. package/dist/components/switch/switch.styles.js +6 -1
  55. package/dist/components/switch/switch.test.d.ts +1 -0
  56. package/dist/components/tag/tag.component.d.ts +12 -7
  57. package/dist/components/tag/tag.component.js +24 -24
  58. package/dist/components/tag/tag.styles.js +6 -1
  59. package/dist/components/textarea/textarea.component.d.ts +26 -23
  60. package/dist/components/textarea/textarea.component.js +15 -12
  61. package/dist/components/toast/toast.component.d.ts +35 -0
  62. package/dist/components/toast/toast.component.js +52 -0
  63. package/dist/components/toast/toast.d.ts +8 -0
  64. package/dist/components/toast/toast.js +6 -0
  65. package/dist/components/toast/toast.singleton.d.ts +26 -0
  66. package/dist/components/toast/toast.singleton.js +53 -0
  67. package/dist/components/toast/toast.style.d.ts +1 -0
  68. package/dist/components/toast/toast.style.js +9 -0
  69. package/dist/components/toast-item/toast-item.component.d.ts +21 -0
  70. package/dist/components/toast-item/toast-item.component.js +65 -0
  71. package/dist/components/toast-item/toast-item.d.ts +6 -0
  72. package/dist/components/toast-item/toast-item.js +2 -0
  73. package/dist/components/toast-item/toast-item.style.d.ts +2 -0
  74. package/dist/components/toast-item/toast-item.style.js +16 -0
  75. package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
  76. package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
  77. package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
  78. package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
  79. package/dist/components/toast-wrapper/toast-wrapper.style.d.ts +1 -0
  80. package/dist/components/toast-wrapper/toast-wrapper.style.js +20 -0
  81. package/dist/custom-elements.json +676 -238
  82. package/dist/index.d.ts +1 -0
  83. package/dist/index.js +43 -40
  84. package/dist/internal/components/hint/hint.component.js +12 -10
  85. package/dist/internal/components/hint/hint.styles.js +26 -10
  86. package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -8
  87. package/dist/react/index.d.ts +5 -3
  88. package/dist/react/index.js +5 -3
  89. package/dist/react/skf-toast/index.d.ts +3 -0
  90. package/dist/react/skf-toast/index.js +13 -0
  91. package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
  92. package/dist/react/skf-toast-wrapper/index.js +13 -0
  93. package/dist/styles/form-field.styles.js +5 -1
  94. package/dist/types/jsx/custom-element-jsx.d.ts +88 -50
  95. package/dist/types/vue/index.d.ts +91 -51
  96. package/dist/vscode.html-custom-data.json +101 -62
  97. package/dist/web-types.json +208 -122
  98. package/package.json +3 -3
package/README.md CHANGED
@@ -1,13 +1,33 @@
1
1
  <div align="center">
2
- <!--img alt="Ferris Logotype" src="./.github/assets/ferris_logo_dark.svg" width="128"/ -->
3
2
 
4
3
  # SKF UI Components
5
4
 
6
- <p>
7
- <a href="https://teams.microsoft.com/l/team/19%3a15d8521717e14c419998b0fed71289a5%40thread.tacv2/conversations?groupId=286b39ed-ed94-43da-8a3f-383319f6c9dc&tenantId=41875f2b-33e8-4670-92a8-f643afbb243a">MS Teams</a> |
8
- <a href="https://develop--661e8ae0ef9b24dadeea9b18.chromatic.com/">Storybook Beta</a> |
9
- <a href="https://github.com/SKF-Internal/ui-components/issues" target="_blank">Report Issues</a>
10
- </p>
5
+ </div>
6
+
7
+ <div align="center">
8
+ <a href="https://www.npmjs.com/package/@skf-design-system/ui-components">
9
+ <img alt="NPM Version" src="https://img.shields.io/npm/v/%40skf-design-system%2Fui-components?style=for-the-badge&logo=npm">
10
+ </a>
11
+ </div>
12
+
13
+ ---
14
+
15
+ <div align="center">
16
+ <a href="https://codesandbox.io/p/sandbox/exciting-leftpad-hz6sgm">
17
+ <img alt="CodeSandbox" src="https://img.shields.io/badge/Codesandbox-040404?style=for-the-badge&logo=codesandbox&logoColor=DBDBDB" />
18
+ </a>
19
+ <a href="https://github.com/SKF-Internal/ui-components/issues">
20
+ <img alt="GitHub - Issues" src="https://img.shields.io/badge/Issues-%23121011.svg?style=for-the-badge&logo=github&logoColor=white" />
21
+ </a>
22
+ <a href="https://teams.microsoft.com/l/team/19%3A15d8521717e14c419998b0fed71289a5%40thread.tacv2/conversations?groupId=286b39ed-ed94-43da-8a3f-383319f6c9dc&tenantId=41875f2b-33e8-4670-92a8-f643afbb243a">
23
+ <img alt="MS Teams" src="https://img.shields.io/badge/MS Teams-4E5FBF?style=for-the-badge&logo=windows&logoColor=white">
24
+ </a>
25
+ <a href="https://beta--641c13cdbf6bbfbd6da88a83.chromatic.com">
26
+ <img alt="Storybook - Stable" src="https://img.shields.io/badge/Stable-FF4785?style=for-the-badge&logo=storybook&logoColor=white">
27
+ </a>
28
+ <a href="https://zeroheight.com/853e936c9/p/07d378-component-overview">
29
+ <img alt="Storybook - Beta" src="https://img.shields.io/badge/zeroheight-F63E7C?style=for-the-badge">
30
+ </a>
11
31
  </div>
12
32
 
13
33
  ## Introduction
@@ -1,23 +1,26 @@
1
1
  import '@components/collapse/collapse.js';
2
2
  import { SkfElement } from '@internal/components/skf-element.js';
3
3
  import type { HeadingType } from '@internal/constants/heading.js';
4
- import { type CSSResultGroup } from 'lit';
4
+ import { type CSSResultGroup, type PropertyValues } from 'lit';
5
5
  /**
6
6
  * The `<skf-accordion>` component consists of multiple `<skf-collapse>`, working together.
7
7
  *
8
- * See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6256cb1b44eba592d319d92e) for design principles.
8
+ * See [zeroheight](https://zeroheight.com/853e936c9/p/6590bf-accordion) for design principles.
9
9
  *
10
10
  * @slot - Expects one or more <skf-accordion-item> element(s)
11
11
  *
12
- * @tag skf-accordion
12
+ * @tagname skf-accordion
13
13
  */
14
14
  export declare class SkfAccordion extends SkfElement {
15
15
  static styles: CSSResultGroup;
16
16
  /** If true, will animate the expand/collapse state */
17
17
  animated?: boolean;
18
- /** Controls which heading element will be rendered */
18
+ /**
19
+ * Defines which heading element will be rendered
20
+ * @type { "h1" | "h2" | "h3" | "h4" }
21
+ */
19
22
  headingAs: Exclude<HeadingType, 'h1'>;
20
- /** If provided, adds a gap between each item */
23
+ /** If true, adds a gap between each item */
21
24
  gap?: boolean;
22
25
  /** If true, allowes multiple accordion items to open */
23
26
  multiple?: boolean;
@@ -27,6 +30,7 @@ export declare class SkfAccordion extends SkfElement {
27
30
  truncate?: boolean;
28
31
  /** @internal */
29
32
  private $accordionItems;
33
+ protected updated(_changedProperties: PropertyValues): void;
30
34
  /** @internal */
31
35
  private get items();
32
36
  /** @internal */
@@ -1,22 +1,25 @@
1
1
  import "../collapse/collapse.js";
2
- import { SkfElement as u } from "../../internal/components/skf-element.js";
2
+ import { SkfElement as p } from "../../internal/components/skf-element.js";
3
3
  import m from "../../styles/component.styles.js";
4
- import { html as d } from "lit";
5
- import { property as o, queryAssignedNodes as f } from "lit/decorators.js";
4
+ import { html as f } from "lit";
5
+ import { property as a, queryAssignedNodes as d } from "lit/decorators.js";
6
6
  import c from "./accordion.styles.js";
7
- var g = Object.defineProperty, r = (p, t, i, a) => {
8
- for (var s = void 0, l = p.length - 1, h; l >= 0; l--)
9
- (h = p[l]) && (s = h(t, i, s) || s);
7
+ var g = Object.defineProperty, r = (u, t, i, o) => {
8
+ for (var s = void 0, l = u.length - 1, h; l >= 0; l--)
9
+ (h = u[l]) && (s = h(t, i, s) || s);
10
10
  return s && g(t, i, s), s;
11
11
  };
12
- const n = class n extends u {
12
+ const n = class n extends p {
13
13
  constructor() {
14
14
  super(...arguments), this.headingAs = "h2", this._setItemAttributes = () => {
15
15
  this.items.forEach((t) => {
16
- t.setAttribute("heading-as", this.headingAs), this.animated && t.setAttribute("animated", ""), this.small && t.setAttribute("small", ""), this.truncate && t.setAttribute("truncate", "");
16
+ t.setAttribute("heading-as", this.headingAs), this.animated ? t.setAttribute("animated", "") : t.hasAttribute("animated") && t.removeAttribute("animated"), this.small ? t.setAttribute("small", "") : t.hasAttribute("small") && t.removeAttribute("small"), this.truncate ? t.setAttribute("truncate", "") : t.hasAttribute("truncate") && t.removeAttribute("truncate");
17
17
  });
18
18
  };
19
19
  }
20
+ updated(t) {
21
+ (t.has("animated") || t.has("headingAs") || t.has("small") || t.has("truncate")) && this._setItemAttributes();
22
+ }
20
23
  /** @internal */
21
24
  get items() {
22
25
  return [...this.$accordionItems].filter((t) => t.localName === "skf-accordion-item");
@@ -24,13 +27,13 @@ const n = class n extends u {
24
27
  _onChildToggle(t) {
25
28
  if (this.multiple || t.defaultPrevented) return;
26
29
  const i = t.target;
27
- this.items.length && this.items.forEach((a) => {
28
- a !== i && a.hasAttribute("expanded") && a.setClose();
30
+ this.items.length && this.items.forEach((o) => {
31
+ o !== i && o.hasAttribute("expanded") && o.setClose();
29
32
  });
30
33
  }
31
34
  render() {
32
- return d`
33
- <div id="accordion">
35
+ return f`
36
+ <div id="root">
34
37
  <slot
35
38
  @skf-collapse-toggle=${(t) => {
36
39
  this._onChildToggle(t);
@@ -44,25 +47,25 @@ const n = class n extends u {
44
47
  n.styles = [c, m];
45
48
  let e = n;
46
49
  r([
47
- o({ type: Boolean, reflect: !0 })
50
+ a({ type: Boolean, reflect: !0 })
48
51
  ], e.prototype, "animated");
49
52
  r([
50
- o({ attribute: "heading-as" })
53
+ a({ attribute: "heading-as" })
51
54
  ], e.prototype, "headingAs");
52
55
  r([
53
- o({ type: Boolean, reflect: !0 })
56
+ a({ type: Boolean, reflect: !0 })
54
57
  ], e.prototype, "gap");
55
58
  r([
56
- o({ type: Boolean })
59
+ a({ type: Boolean })
57
60
  ], e.prototype, "multiple");
58
61
  r([
59
- o({ type: Boolean, reflect: !0 })
62
+ a({ type: Boolean, reflect: !0 })
60
63
  ], e.prototype, "small");
61
64
  r([
62
- o({ type: Boolean, reflect: !0 })
65
+ a({ type: Boolean, reflect: !0 })
63
66
  ], e.prototype, "truncate");
64
67
  r([
65
- f()
68
+ d()
66
69
  ], e.prototype, "$accordionItems");
67
70
  export {
68
71
  e as SkfAccordion
@@ -1,4 +1,4 @@
1
- import { SkfAccordion } from '@components/accordion/accordion.component.js';
1
+ import { SkfAccordion } from './accordion.component.js';
2
2
  export * from './accordion-item.js';
3
3
  export * from './accordion.component.js';
4
4
  export default SkfAccordion;
@@ -1,7 +1,7 @@
1
1
  import { css as o } from "lit";
2
- const a = o`
2
+ const t = o`
3
3
  @layer components {
4
- :host([gap]) #accordion {
4
+ :host([gap]) #root {
5
5
  display: flex;
6
6
  flex-direction: column;
7
7
  gap: var(--skf-spacing-300);
@@ -9,5 +9,5 @@ const a = o`
9
9
  }
10
10
  `;
11
11
  export {
12
- a as default
12
+ t as default
13
13
  };
@@ -6,24 +6,27 @@ import { type CSSResultGroup } from 'lit';
6
6
  /**
7
7
  * The `<skf-alert>` is a type of notification that appears in-line
8
8
  *
9
- * @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
9
+ * @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/990ec5-alert) for design principles
10
10
  *
11
11
  * @event skf-alert-close - Fires when the close button is clicked
12
12
  *
13
13
  * @slot - Alert message. **Notice!** See design principles for approved content
14
- * @slot link - lodjvodjvodjo
14
+ * @slot link - Slot for the link
15
15
  *
16
16
  * @tagname skf-alert
17
17
  */
18
18
  export declare class SkfAlert extends SkfElement {
19
19
  static styles: CSSResultGroup;
20
- /** If true, alert is being used as a toast with an close button */
20
+ /** If true, alert is being used as a toast (alertdialog) with an close button */
21
21
  closeable?: boolean;
22
22
  /** Close button aria-label */
23
23
  buttonLabel: string;
24
24
  /** If defined, displays leading icon */
25
25
  icon?: SkfIcon['name'];
26
- /** If defined, gives the supplied appearance */
26
+ /**
27
+ * If defined, gives the supplied appearance
28
+ * @type { "error" | "info" | "warning" | "success" | "alert" }
29
+ */
27
30
  severity?: SeverityFgColor;
28
31
  /** @internal */
29
32
  private _handleClose;
@@ -1,30 +1,32 @@
1
1
  import "../icon/icon.js";
2
- import { SkfElement as c } from "../../internal/components/skf-element.js";
2
+ import { SkfElement as d } from "../../internal/components/skf-element.js";
3
3
  import b from "../../styles/component.styles.js";
4
- import { html as d, nothing as f } from "lit";
4
+ import { html as p, nothing as f } from "lit";
5
5
  import { property as o } from "lit/decorators.js";
6
- import { ifDefined as r } from "lit/directives/if-defined.js";
7
- import h from "./alert.styles.js";
8
- var u = Object.defineProperty, i = (n, a, m, y) => {
9
- for (var t = void 0, s = n.length - 1, p; s >= 0; s--)
10
- (p = n[s]) && (t = p(a, m, t) || t);
11
- return t && u(a, m, t), t;
6
+ import { ifDefined as s } from "lit/directives/if-defined.js";
7
+ import u from "./alert.styles.js";
8
+ var h = Object.defineProperty, i = (n, a, m, y) => {
9
+ for (var t = void 0, r = n.length - 1, c; r >= 0; r--)
10
+ (c = n[r]) && (t = c(a, m, t) || t);
11
+ return t && h(a, m, t), t;
12
12
  };
13
- const l = class l extends c {
13
+ const l = class l extends d {
14
14
  constructor() {
15
- super(...arguments), this.buttonLabel = "Close", this._handleClose = () => this.emit("skf-alert-close");
15
+ super(...arguments), this.buttonLabel = "Close", this._handleClose = () => {
16
+ this.emit("skf-alert-close");
17
+ };
16
18
  }
17
19
  render() {
18
- return d`
20
+ return p`
19
21
  <div
20
- id="alert"
22
+ id="root"
21
23
  aria-describedby="main"
22
- aria-modal=${r(this.closeable && "true")}
24
+ aria-modal=${s(this.closeable && "true")}
23
25
  role=${this.closeable ? "alertdialog" : "alert"}
24
26
  >
25
27
  <skf-icon
26
- color=${r(this.severity ?? "secondary")}
27
- name=${r(this.icon)}
28
+ color=${s(this.severity ?? "secondary")}
29
+ name=${s(this.icon)}
28
30
  size="sm"
29
31
  ></skf-icon>
30
32
  <div id="body">
@@ -33,7 +35,7 @@ const l = class l extends c {
33
35
  </div>
34
36
  <slot name="link"></slot>
35
37
  </div>
36
- ${this.closeable ? d`
38
+ ${this.closeable ? p`
37
39
  <button @click="${this._handleClose}" aria-label=${this.buttonLabel} type="button">
38
40
  <skf-icon name="close" size="sm"></skf-icon>
39
41
  </button>
@@ -42,10 +44,10 @@ const l = class l extends c {
42
44
  `;
43
45
  }
44
46
  };
45
- l.styles = [b, h];
47
+ l.styles = [b, u];
46
48
  let e = l;
47
49
  i([
48
- o({ type: Boolean })
50
+ o({ type: Boolean, reflect: !0 })
49
51
  ], e.prototype, "closeable");
50
52
  i([
51
53
  o({ attribute: "button-label" })
@@ -54,7 +56,7 @@ i([
54
56
  o()
55
57
  ], e.prototype, "icon");
56
58
  i([
57
- o()
59
+ o({ reflect: !0 })
58
60
  ], e.prototype, "severity");
59
61
  export {
60
62
  e as SkfAlert
@@ -1,61 +1,64 @@
1
1
  import { css as r } from "lit";
2
2
  const s = r`
3
- :host {
4
- contain: layout;
5
- }
6
-
7
- #alert {
8
- background-color: var(--_skf-alert-bg-color, var(--skf-bg-color-neutral-2));
9
- border: var(--skf-border-width-sm) solid
10
- var(--_skf-alert-border-color, var(--skf-border-color-primary));
11
- border-radius: var(--skf-border-radius-sm);
12
- box-shadow: var(--skf-shadow-md);
13
- display: flex;
14
- font-size: var(--skf-font-size-75);
15
- gap: var(--skf-spacing-50);
16
- padding-block: var(--skf-spacing-75);
17
- padding-inline: var(--skf-spacing-50);
18
-
19
- :host([severity='alert']) & {
20
- --_skf-alert-bg-color: var(--skf-severity-bg-color-alert);
21
- --_skf-alert-border-color: var(--skf-severity-fg-color-alert);
3
+ @layer components {
4
+ :host {
5
+ contain: layout;
22
6
  }
23
7
 
24
- :host([severity='error']) & {
25
- --_skf-alert-bg-color: var(--skf-severity-bg-color-error);
26
- --_skf-alert-border-color: var(--skf-severity-fg-color-error);
27
- }
8
+ #root {
9
+ background-color: var(--_skf-alert-bg-color, var(--skf-bg-color-neutral-2));
10
+ border: var(--skf-border-width-sm) solid
11
+ var(--_skf-alert-border-color, var(--skf-border-color-primary));
12
+ border-radius: var(--skf-border-radius-sm);
13
+ box-shadow: var(--skf-shadow-md);
14
+ display: flex;
15
+ font-size: var(--skf-font-size-75);
16
+ gap: var(--skf-spacing-50);
17
+ padding-block: var(--skf-spacing-75);
18
+ padding-inline: var(--skf-spacing-50);
28
19
 
29
- :host([severity='info']) & {
30
- --_skf-alert-bg-color: var(--skf-severity-bg-color-info);
31
- --_skf-alert-border-color: var(--skf-severity-fg-color-info);
32
- }
20
+ :host([severity='alert']) & {
21
+ --_skf-alert-bg-color: var(--skf-severity-bg-color-alert);
22
+ --_skf-alert-border-color: var(--skf-severity-fg-color-alert);
23
+ }
33
24
 
34
- :host([severity='success']) & {
35
- --_skf-alert-bg-color: var(--skf-severity-bg-color-success);
36
- --_skf-alert-border-color: var(--skf-severity-fg-color-success);
37
- }
25
+ :host([severity='error']) & {
26
+ --_skf-alert-bg-color: var(--skf-severity-bg-color-error);
27
+ --_skf-alert-border-color: var(--skf-severity-fg-color-error);
28
+ }
29
+
30
+ :host([severity='info']) & {
31
+ --_skf-alert-bg-color: var(--skf-severity-bg-color-info);
32
+ --_skf-alert-border-color: var(--skf-severity-fg-color-info);
33
+ }
34
+
35
+ :host([severity='success']) & {
36
+ --_skf-alert-bg-color: var(--skf-severity-bg-color-success);
37
+ --_skf-alert-border-color: var(--skf-severity-fg-color-success);
38
+ }
38
39
 
39
- :host([severity='warning']) & {
40
- --_skf-alert-bg-color: var(--skf-severity-bg-color-warning);
41
- --_skf-alert-border-color: var(--skf-severity-fg-color-warning);
40
+ :host([severity='warning']) & {
41
+ --_skf-alert-bg-color: var(--skf-severity-bg-color-warning);
42
+ --_skf-alert-border-color: var(--skf-severity-fg-color-warning);
43
+ }
42
44
  }
43
- }
44
45
 
45
- #body {
46
- display: flex;
47
- flex: auto;
48
- flex-wrap: wrap;
49
- gap: var(--skf-spacing-25) var(--skf-spacing-100);
50
- justify-content: space-between;
51
- }
46
+ #body {
47
+ display: flex;
48
+ flex: auto;
49
+ flex-wrap: wrap;
50
+ gap: var(--skf-spacing-25) var(--skf-spacing-100);
51
+ justify-content: space-between;
52
+ }
52
53
 
53
- ::slotted(skf-link) {
54
- text-transform: uppercase;
55
- }
54
+ ::slotted(skf-link) {
55
+ text-transform: uppercase;
56
+ }
56
57
 
57
- button {
58
- display: inline-flex;
58
+ button {
59
+ cursor: pointer;
60
+ display: inline-flex;
61
+ }
59
62
  }
60
63
  `;
61
64
  export {
@@ -14,6 +14,7 @@ export declare class SkfButton extends SkfElement {
14
14
  static styles: CSSResultGroup;
15
15
  /** @internal */
16
16
  private _transitionOptions;
17
+ _internals: ElementInternals;
17
18
  /** If true, gives destructive appearance. **Notice!** Only applicable if `variant` is `primary`. */
18
19
  destructive: boolean;
19
20
  /** If true, removes border */
@@ -38,6 +39,7 @@ export declare class SkfButton extends SkfElement {
38
39
  private $loader?;
39
40
  /** @internal */
40
41
  private $body?;
42
+ constructor();
41
43
  protected firstUpdated(_changedProperties: PropertyValues): void;
42
44
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
43
45
  private _showLoader;
@@ -6,17 +6,17 @@ import { html as d } from "lit";
6
6
  import { property as e, state as m, query as f } from "lit/decorators.js";
7
7
  import { ifDefined as y } from "lit/directives/if-defined.js";
8
8
  import u from "./button.styles.js";
9
- var _ = Object.defineProperty, i = (p, o, r, a) => {
10
- for (var s = void 0, n = p.length - 1, h; n >= 0; n--)
11
- (h = p[n]) && (s = h(o, r, s) || s);
9
+ var _ = Object.defineProperty, i = (h, o, r, a) => {
10
+ for (var s = void 0, n = h.length - 1, p; n >= 0; n--)
11
+ (p = h[n]) && (s = p(o, r, s) || s);
12
12
  return s && _(o, r, s), s;
13
13
  };
14
14
  const l = class l extends c {
15
15
  constructor() {
16
- super(...arguments), this._transitionOptions = {
16
+ super(), this._transitionOptions = {
17
17
  duration: 200,
18
18
  fill: "forwards"
19
- }, this.destructive = !1, this.disabled = !1, this.iconPosition = "left", this.loading = !1, this.size = "md", this.type = "button", this.variant = "primary", this._loaderVisible = !1, this._renderIcon = () => d`<skf-icon class="skf-icon-host" name=${y(this.icon)}></skf-icon>`;
19
+ }, this.destructive = !1, this.disabled = !1, this.iconPosition = "left", this.loading = !1, this.size = "md", this.type = "button", this.variant = "primary", this._loaderVisible = !1, this._renderIcon = () => d`<skf-icon class="skf-icon-host" name=${y(this.icon)}></skf-icon>`, this._internals = this.attachInternals();
20
20
  }
21
21
  firstUpdated(o) {
22
22
  if (o.has("loading") && this.loading) {
@@ -39,7 +39,7 @@ const l = class l extends c {
39
39
  <button
40
40
  ?disabled=${this.disabled || this.loading}
41
41
  aria-busy=${this.loading}
42
- id="button"
42
+ id="root"
43
43
  type=${y(this.type)}
44
44
  >
45
45
  ${this.variant === "primary" && this._loaderVisible ? d`<skf-loader invert size="sm"></skf-loader>` : ""}
@@ -5,7 +5,7 @@ const r = o`
5
5
  contain: initial;
6
6
  }
7
7
 
8
- #button {
8
+ #root {
9
9
  background-color: var(--_skf-button-state-bg-color, var(--_skf-button-bg-color));
10
10
  block-size: var(--_skf-button-block-size);
11
11
  border: var(--skf-border-width-sm) solid
@@ -12,10 +12,10 @@ import { type CSSResultGroup } from 'lit';
12
12
  export declare class SkfCard extends SkfElement {
13
13
  static styles: CSSResultGroup;
14
14
  /** If true, removes border */
15
- noBorder: boolean;
15
+ noBorder?: boolean;
16
16
  /** If true, removes padding */
17
- noPadding: boolean;
17
+ noPadding?: boolean;
18
18
  /** If true, the Card fills the parent element height */
19
- stretch: boolean;
19
+ stretch?: boolean;
20
20
  render(): import("lit").TemplateResult<1>;
21
21
  }
@@ -1,36 +1,33 @@
1
1
  import { SkfElement as d } from "../../internal/components/skf-element.js";
2
- import m from "../../styles/component.styles.js";
2
+ import a from "../../styles/component.styles.js";
3
3
  import { html as f } from "lit";
4
4
  import { property as r } from "lit/decorators.js";
5
5
  import y from "./card.styles.js";
6
- var c = Object.defineProperty, s = (p, i, l, h) => {
7
- for (var t = void 0, o = p.length - 1, a; o >= 0; o--)
8
- (a = p[o]) && (t = a(i, l, t) || t);
9
- return t && c(i, l, t), t;
6
+ var v = Object.defineProperty, p = (i, l, s, u) => {
7
+ for (var t = void 0, e = i.length - 1, m; e >= 0; e--)
8
+ (m = i[e]) && (t = m(l, s, t) || t);
9
+ return t && v(l, s, t), t;
10
10
  };
11
11
  const n = class n extends d {
12
- constructor() {
13
- super(...arguments), this.noBorder = !1, this.noPadding = !1, this.stretch = !1;
14
- }
15
12
  render() {
16
13
  return f`
17
- <div id="card">
14
+ <div id="root">
18
15
  <slot></slot>
19
16
  </div>
20
17
  `;
21
18
  }
22
19
  };
23
- n.styles = [m, y];
24
- let e = n;
25
- s([
20
+ n.styles = [a, y];
21
+ let o = n;
22
+ p([
26
23
  r({ type: Boolean, attribute: "no-border" })
27
- ], e.prototype, "noBorder");
28
- s([
24
+ ], o.prototype, "noBorder");
25
+ p([
29
26
  r({ type: Boolean, attribute: "no-padding" })
30
- ], e.prototype, "noPadding");
31
- s([
32
- r({ type: Boolean })
33
- ], e.prototype, "stretch");
27
+ ], o.prototype, "noPadding");
28
+ p([
29
+ r({ type: Boolean, reflect: !0 })
30
+ ], o.prototype, "stretch");
34
31
  export {
35
- e as SkfCard
32
+ o as SkfCard
36
33
  };
@@ -1,6 +1,14 @@
1
1
  import { css as r } from "lit";
2
- const d = r`
3
- #card {
2
+ const s = r`
3
+ :host {
4
+ contain: layout;
5
+ }
6
+
7
+ :host([stretch]) {
8
+ block-size: 100%;
9
+ }
10
+
11
+ #root {
4
12
  background-color: var(--skf-bg-color-neutral-1);
5
13
  border: var(--skf-border-width-sm) solid
6
14
  var(--_skf-card-border-color, var(--skf-border-color-tertiary));
@@ -22,5 +30,5 @@ const d = r`
22
30
  }
23
31
  `;
24
32
  export {
25
- d as default
33
+ s as default
26
34
  };
@@ -5,14 +5,14 @@ import { type CSSResultGroup } from 'lit';
5
5
  /**
6
6
  * The `<skf-checkbox>` component is used to create a checkbox input
7
7
  *
8
- * @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
8
+ * @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/94464f-checkbox) for design principles
9
9
  *
10
10
  * @attribute {boolean} disabled - If true, sets disabled state
11
11
  * @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
12
12
  *
13
13
  * @event change {object} - When the value of the input changes
14
14
  *
15
- * @slot Default - Alternatively, you can use the `label` attribute
15
+ * @slot - The Radios label. Alternatively, you can use the `label` attribute.
16
16
  *
17
17
  * @tagname skf-checkbox
18
18
  */
@@ -36,12 +36,15 @@ export declare class SkfCheckbox extends FormBase implements FormFieldBaseProps
36
36
  name?: string;
37
37
  /** If defined, renders an alternative A11y text for the asterisk */
38
38
  requiredLabel?: string;
39
- /** Size of the checkbox */
40
- size: 'sm' | 'md';
41
- /** If defined, styles checkbox using provided severity */
39
+ /**
40
+ * If defined, styles checkbox using provided severity
41
+ * @type { "alert" | "success" | "info" | "warning" }
42
+ */
42
43
  severity?: FormFieldBaseProps['severity'];
43
- /** If defined, displays valid state after interaction */
44
+ /** If true, displays valid state after interaction */
44
45
  showValid?: boolean;
46
+ /** Size of the checkbox */
47
+ size: 'sm' | 'md';
45
48
  /** The current value of the input field */
46
49
  value: string;
47
50
  /** @internal */
@@ -6,10 +6,10 @@ import { html as u, nothing as m } from "lit";
6
6
  import { property as s, state as f, query as y } from "lit/decorators.js";
7
7
  import { ifDefined as b } from "lit/directives/if-defined.js";
8
8
  import _ from "./checkbox.styles.js";
9
- var k = Object.defineProperty, i = (n, t, r, a) => {
9
+ var g = Object.defineProperty, i = (n, t, r, a) => {
10
10
  for (var l = void 0, o = n.length - 1, d; o >= 0; o--)
11
11
  (d = n[o]) && (l = d(t, r, l) || l);
12
- return l && k(t, r, l), l;
12
+ return l && g(t, r, l), l;
13
13
  };
14
14
  const h = class h extends p {
15
15
  constructor() {
@@ -62,7 +62,7 @@ const h = class h extends p {
62
62
  }
63
63
  render() {
64
64
  return u`
65
- <label id="checkbox">
65
+ <label id="root">
66
66
  <input
67
67
  ?checked=${this.checked}
68
68
  ?disabled=${this.disabled}
@@ -74,7 +74,7 @@ const h = class h extends p {
74
74
  value=${this.value}
75
75
  />
76
76
  ${this._renderIcon("check")} ${this._renderIcon("removeMinus")}
77
- <div id="label">
77
+ <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
78
78
  <slot>${this.label}</slot>
79
79
  ${this.required ? c(this.requiredLabel) : m}
80
80
  </div>
@@ -108,15 +108,15 @@ i([
108
108
  i([
109
109
  s({ attribute: "required-label" })
110
110
  ], e.prototype, "requiredLabel");
111
- i([
112
- s({ reflect: !0 })
113
- ], e.prototype, "size");
114
111
  i([
115
112
  s({ reflect: !0 })
116
113
  ], e.prototype, "severity");
117
114
  i([
118
115
  s({ type: Boolean, attribute: "show-valid" })
119
116
  ], e.prototype, "showValid");
117
+ i([
118
+ s({ reflect: !0 })
119
+ ], e.prototype, "size");
120
120
  i([
121
121
  s()
122
122
  ], e.prototype, "value");