@skf-design-system/ui-components 1.0.0-beta.7 → 1.0.1-beta.1

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 (127) hide show
  1. package/dist/components/alert/alert.component.d.ts +2 -2
  2. package/dist/components/alert/alert.component.js +34 -34
  3. package/dist/components/breadcrumb/breadcrumb.component.d.ts +29 -0
  4. package/dist/components/breadcrumb/breadcrumb.d.ts +8 -0
  5. package/dist/components/breadcrumb/breadcrumb.styles.d.ts +1 -0
  6. package/dist/components/breadcrumb-item/breadcrumb-item.component.d.ts +25 -0
  7. package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +8 -0
  8. package/dist/components/breadcrumb-item/breadcrumb-item.styles.d.ts +1 -0
  9. package/dist/components/button/button.component.d.ts +6 -4
  10. package/dist/components/button/button.component.js +87 -70
  11. package/dist/components/button/button.styles.js +64 -45
  12. package/dist/components/checkbox/checkbox.component.d.ts +3 -1
  13. package/dist/components/checkbox/checkbox.component.js +71 -58
  14. package/dist/components/date-picker/datepicker.calendar.component.d.ts +72 -0
  15. package/dist/components/date-picker/datepicker.calendar.component.js +382 -0
  16. package/dist/components/date-picker/datepicker.calendar.styles.d.ts +1 -0
  17. package/dist/components/date-picker/datepicker.calendar.styles.js +192 -0
  18. package/dist/components/date-picker/datepicker.component.d.ts +74 -0
  19. package/dist/components/date-picker/datepicker.component.js +241 -0
  20. package/dist/components/date-picker/datepicker.d.ts +10 -0
  21. package/dist/components/date-picker/datepicker.helpers.d.ts +40 -0
  22. package/dist/components/date-picker/datepicker.helpers.js +69 -0
  23. package/dist/components/date-picker/datepicker.js +8 -0
  24. package/dist/components/date-picker/datepicker.styles.d.ts +1 -0
  25. package/dist/components/date-picker/datepicker.styles.js +99 -0
  26. package/dist/components/date-picker-input/datepicker-input.component.d.ts +107 -0
  27. package/dist/components/date-picker-input/datepicker-input.component.js +397 -0
  28. package/dist/components/date-picker-input/datepicker-input.d.ts +8 -0
  29. package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +4 -0
  30. package/dist/components/date-picker-input/datepicker-input.helpers.js +29 -0
  31. package/dist/components/date-picker-input/datepicker-input.js +6 -0
  32. package/dist/components/date-picker-input/datepicker-input.styles.d.ts +1 -0
  33. package/dist/components/date-picker-input/datepicker-input.styles.js +22 -0
  34. package/dist/components/dialog/dialog.component.d.ts +0 -1
  35. package/dist/components/dialog/dialog.component.js +2 -4
  36. package/dist/components/icon/icon.component.d.ts +1 -4
  37. package/dist/components/icon/icon.component.js +28 -19
  38. package/dist/components/icon/icon.styles.js +53 -47
  39. package/dist/components/input/input.component.d.ts +1 -0
  40. package/dist/components/input/input.component.js +87 -80
  41. package/dist/components/link/link.component.d.ts +1 -0
  42. package/dist/components/link/link.component.js +21 -21
  43. package/dist/components/menu/menu.component.d.ts +24 -0
  44. package/dist/components/menu/menu.component.js +18 -0
  45. package/dist/components/menu/menu.d.ts +8 -0
  46. package/dist/components/menu/menu.js +6 -0
  47. package/dist/components/menu/menu.styles.d.ts +1 -0
  48. package/dist/components/menu/menu.styles.js +11 -0
  49. package/dist/components/menu-item/menu-item.component.d.ts +25 -0
  50. package/dist/components/menu-item/menu-item.component.js +13 -0
  51. package/dist/components/menu-item/menu-item.d.ts +8 -0
  52. package/dist/components/menu-item/menu-item.js +6 -0
  53. package/dist/components/menu-item/menu-item.styles.d.ts +1 -0
  54. package/dist/components/menu-item/menu-item.styles.js +19 -0
  55. package/dist/components/popover/popover.component.d.ts +29 -0
  56. package/dist/components/popover/popover.component.js +37 -0
  57. package/dist/components/popover/popover.d.ts +8 -0
  58. package/dist/components/popover/popover.js +6 -0
  59. package/dist/components/popover/popover.styles.d.ts +1 -0
  60. package/dist/components/popover/popover.styles.js +12 -0
  61. package/dist/components/select/select.component.d.ts +8 -10
  62. package/dist/components/select/select.component.js +115 -118
  63. package/dist/components/select/select.controllers.d.ts +0 -25
  64. package/dist/components/select/select.controllers.js +35 -95
  65. package/dist/components/stepper/stepper.component.d.ts +38 -0
  66. package/dist/components/stepper/stepper.component.js +91 -0
  67. package/dist/components/stepper/stepper.d.ts +8 -0
  68. package/dist/components/stepper/stepper.helpers.d.ts +16 -0
  69. package/dist/components/stepper/stepper.helpers.js +18 -0
  70. package/dist/components/stepper/stepper.js +6 -0
  71. package/dist/components/stepper/stepper.styles.d.ts +1 -0
  72. package/dist/components/stepper/stepper.styles.js +15 -0
  73. package/dist/components/stepper-item/stepper-item.component.d.ts +47 -0
  74. package/dist/components/stepper-item/stepper-item.component.js +113 -0
  75. package/dist/components/stepper-item/stepper-item.d.ts +8 -0
  76. package/dist/components/stepper-item/stepper-item.js +6 -0
  77. package/dist/components/stepper-item/stepper-item.styles.d.ts +1 -0
  78. package/dist/components/stepper-item/stepper-item.styles.js +98 -0
  79. package/dist/components/toast/toast.component.d.ts +7 -4
  80. package/dist/components/toast/toast.component.js +24 -20
  81. package/dist/components/toast/toast.singleton.d.ts +2 -7
  82. package/dist/components/toast/toast.singleton.js +25 -25
  83. package/dist/components/toast-item/toast-item.component.js +15 -15
  84. package/dist/components/toast-item/toast-item.styles.js +13 -11
  85. package/dist/components/tooltip/tooltip.component.d.ts +24 -0
  86. package/dist/components/tooltip/tooltip.component.js +18 -0
  87. package/dist/components/tooltip/tooltip.d.ts +8 -0
  88. package/dist/components/tooltip/tooltip.js +6 -0
  89. package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
  90. package/dist/components/tooltip/tooltip.styles.js +12 -0
  91. package/dist/custom-elements.json +3278 -1321
  92. package/dist/index.d.ts +8 -0
  93. package/dist/index.js +78 -54
  94. package/dist/internal/base-classes/popover/popover.base.d.ts +29 -0
  95. package/dist/internal/base-classes/popover/popover.base.js +116 -0
  96. package/dist/internal/base-classes/popover/popover.styles.d.ts +1 -0
  97. package/dist/internal/base-classes/popover/popover.styles.js +29 -0
  98. package/dist/internal/controllers/popover.controller.d.ts +17 -0
  99. package/dist/internal/controllers/popover.controller.js +44 -0
  100. package/dist/internal/helpers/dateFormatter.d.ts +2 -0
  101. package/dist/internal/helpers/hintSeverity.d.ts +1 -1
  102. package/dist/internal/helpers/utilityTypes.d.ts +22 -0
  103. package/dist/react/index.d.ts +11 -2
  104. package/dist/react/index.js +11 -2
  105. package/dist/react/skf-breadcrumb/index.d.ts +9 -0
  106. package/dist/react/skf-breadcrumb/index.js +17 -0
  107. package/dist/react/skf-breadcrumb-item/index.d.ts +3 -0
  108. package/dist/react/skf-breadcrumb-item/index.js +13 -0
  109. package/dist/react/skf-datepicker/index.d.ts +12 -0
  110. package/dist/react/skf-datepicker/index.js +18 -0
  111. package/dist/react/skf-menu/index.d.ts +12 -0
  112. package/dist/react/skf-menu/index.js +18 -0
  113. package/dist/react/skf-menu-item/index.d.ts +27 -0
  114. package/dist/react/skf-menu-item/index.js +23 -0
  115. package/dist/react/skf-popover/index.d.ts +12 -0
  116. package/dist/react/skf-popover/index.js +18 -0
  117. package/dist/react/skf-stepper/index.d.ts +9 -0
  118. package/dist/react/skf-stepper/index.js +17 -0
  119. package/dist/react/skf-stepper-item/index.d.ts +9 -0
  120. package/dist/react/skf-stepper-item/index.js +17 -0
  121. package/dist/react/skf-tooltip/index.d.ts +12 -0
  122. package/dist/react/skf-tooltip/index.js +18 -0
  123. package/dist/types/jsx/custom-element-jsx.d.ts +628 -155
  124. package/dist/types/vue/index.d.ts +369 -74
  125. package/dist/vscode.html-custom-data.json +761 -391
  126. package/dist/web-types.json +936 -293
  127. package/package.json +34 -33
@@ -17,12 +17,12 @@ import { type CSSResultGroup } from 'lit';
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 (alertdialog) with an close button */
21
- closeable?: boolean;
22
20
  /** Close button aria-label */
23
21
  buttonLabel: string;
24
22
  /** If defined, displays leading icon */
25
23
  icon?: SkfIcon['name'];
24
+ /** If true, renders with an close button and sets aria-role to `status` */
25
+ persistent?: boolean;
26
26
  /**
27
27
  * If defined, gives the supplied appearance
28
28
  * @type { "error" | "info" | "warning" | "success" | "alert" }
@@ -1,47 +1,47 @@
1
1
  import "../icon/icon.js";
2
2
  import { SkfElement as y } from "../../internal/components/skf-element.js";
3
- import b from "../../styles/component.styles.js";
4
- import { html as p, nothing as f } from "lit";
5
- import { property as r } from "lit/decorators.js";
6
- import { classMap as h } from "lit/directives/class-map.js";
7
- import { ifDefined as o } from "lit/directives/if-defined.js";
3
+ import f from "../../styles/component.styles.js";
4
+ import { html as m, nothing as h } from "lit";
5
+ import { property as s } from "lit/decorators.js";
6
+ import { classMap as u } from "lit/directives/class-map.js";
7
+ import { ifDefined as p } from "lit/directives/if-defined.js";
8
8
  import { styles as v } from "./alert.styles.js";
9
- var u = Object.defineProperty, s = (a, n, c, d) => {
10
- for (var e = void 0, i = a.length - 1, m; i >= 0; i--)
11
- (m = a[i]) && (e = m(n, c, e) || e);
12
- return e && u(n, c, e), e;
9
+ var b = Object.defineProperty, r = (l, a, n, d) => {
10
+ for (var t = void 0, i = l.length - 1, c; i >= 0; i--)
11
+ (c = l[i]) && (t = c(a, n, t) || t);
12
+ return t && b(a, n, t), t;
13
13
  };
14
- const l = class l extends y {
14
+ const o = class o extends y {
15
15
  constructor() {
16
16
  super(...arguments), this.buttonLabel = "Close", this._handleClose = () => {
17
17
  this.emit("skf-alert-close");
18
18
  };
19
19
  }
20
20
  render() {
21
- return p`
21
+ return m`
22
22
  <div
23
23
  aria-describedby="main"
24
- aria-modal=${o(this.closeable && "true")}
25
- class=${h({
24
+ class=${u({
26
25
  alert: !0,
27
26
  "alert--severity-alert": this.severity === "alert",
28
27
  "alert--severity-error": this.severity === "error",
29
28
  "alert--severity-info": this.severity === "info",
30
29
  "alert--severity-success": this.severity === "success",
31
- "alert--severity-warning": this.severity === "warning"
30
+ "alert--severity-warning": this.severity === "warning",
31
+ [this.className]: !0
32
32
  })}
33
- role=${this.closeable ? "alertdialog" : "alert"}
33
+ role=${this.persistent ? "status" : "alert"}
34
34
  >
35
35
  <skf-icon
36
- color=${o(this.severity ?? "secondary")}
37
- name=${o(this.icon)}
36
+ color=${p(this.severity ?? "secondary")}
37
+ name=${p(this.icon ?? "info")}
38
38
  size="sm"
39
39
  ></skf-icon>
40
40
  <div class="alert__body">
41
41
  <slot class="alert__main" id="main"></slot>
42
42
  <slot name="link"></slot>
43
43
  </div>
44
- ${this.closeable ? p`
44
+ ${this.persistent ? m`
45
45
  <button
46
46
  @click="${this._handleClose}"
47
47
  aria-label=${this.buttonLabel}
@@ -50,25 +50,25 @@ const l = class l extends y {
50
50
  >
51
51
  <skf-icon name="close" size="sm"></skf-icon>
52
52
  </button>
53
- ` : f}
53
+ ` : h}
54
54
  </div>
55
55
  `;
56
56
  }
57
57
  };
58
- l.styles = [b, v];
59
- let t = l;
60
- s([
61
- r({ type: Boolean, reflect: !0 })
62
- ], t.prototype, "closeable");
63
- s([
64
- r({ attribute: "button-label" })
65
- ], t.prototype, "buttonLabel");
66
- s([
67
- r()
68
- ], t.prototype, "icon");
69
- s([
70
- r({ reflect: !0 })
71
- ], t.prototype, "severity");
58
+ o.styles = [f, v];
59
+ let e = o;
60
+ r([
61
+ s({ attribute: "button-label" })
62
+ ], e.prototype, "buttonLabel");
63
+ r([
64
+ s()
65
+ ], e.prototype, "icon");
66
+ r([
67
+ s({ type: Boolean, reflect: !0 })
68
+ ], e.prototype, "persistent");
69
+ r([
70
+ s({ reflect: !0 })
71
+ ], e.prototype, "severity");
72
72
  export {
73
- t as SkfAlert
73
+ e as SkfAlert
74
74
  };
@@ -0,0 +1,29 @@
1
+ import type { SkfBreadcrumbItem } from '../breadcrumb-item/breadcrumb-item.component.js';
2
+ import { SkfElement } from '../../internal/components/skf-element';
3
+ import { type CSSResultGroup } from 'lit';
4
+ /**
5
+ * The `<skf-breadcrumb>` component consists of multiple `<skf-breadcrumb-item>`, working together.
6
+ *
7
+ * @documentation See [zeroheight](https://zeroheight.com/****) for design principles
8
+ *
9
+ * @event click - Fired when the item is clicked
10
+ *
11
+ * @slot - One or more `<skf-breadcrumb-item>`
12
+ *
13
+ * @tagname skf-breadcrumb
14
+ */
15
+ export declare class SkfBreadcrumb extends SkfElement {
16
+ static styles: CSSResultGroup;
17
+ /** aria-label for the breadcrumb control */
18
+ label: string;
19
+ /** Displays an alternative size */
20
+ size: 'md' | 'sm';
21
+ /** @internal */
22
+ _isDynamic: boolean;
23
+ /** @internal */
24
+ _items: NodeListOf<SkfBreadcrumbItem>;
25
+ firstUpdated(): void;
26
+ /** @internal */
27
+ private _handleSlotChange;
28
+ render(): import("lit").TemplateResult;
29
+ }
@@ -0,0 +1,8 @@
1
+ import { SkfBreadcrumb } from './breadcrumb.component';
2
+ export * from './breadcrumb.component';
3
+ export default SkfBreadcrumb;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-breadcrumb': SkfBreadcrumb;
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,25 @@
1
+ import '../icon/icon.js';
2
+ import { SkfElement } from '../../internal/components/skf-element';
3
+ import { type CSSResultGroup } from 'lit';
4
+ /**
5
+ * The `<skf-breadcrumb-item>` is used in conjunction with the `<skf-breadcrumb>` component
6
+ *
7
+ * @slot - Label of the breadcrumb item
8
+ *
9
+ * @tagname skf-breadcrumb-item
10
+ */
11
+ export declare class SkfBreadcrumbItem extends SkfElement {
12
+ static styles: CSSResultGroup;
13
+ private _onClick?;
14
+ /** If defined, loads url on click */
15
+ href?: string;
16
+ /** If defined, custom onClick where the second return parameter enables custom routing. **Notice!** Only applicable if `href` is defined. */
17
+ set onClick(onClickFn: ((event: Event, route: string) => void) | undefined);
18
+ get onClick(): ((event: Event, route: string) => void) | undefined;
19
+ /** @internal */
20
+ _isCurrent: boolean;
21
+ connectedCallback(): void;
22
+ /** @internal */
23
+ private _clickHandler;
24
+ render(): import("lit").TemplateResult<1>;
25
+ }
@@ -0,0 +1,8 @@
1
+ import { SkfBreadcrumbItem } from './breadcrumb-item.component';
2
+ export * from './breadcrumb-item.component';
3
+ export default SkfBreadcrumbItem;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-breadcrumb-item': SkfBreadcrumbItem;
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -31,8 +31,10 @@ export declare class SkfButton extends SkfElement {
31
31
  /** If provided, renders an icon before or after the text */
32
32
  /** @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" } */
33
33
  icon?: SkfIcon['name'];
34
- /** If provided, determines the positioning of the icon in relation to the text */
35
- iconPosition?: 'left' | 'right';
34
+ /** If true, removes border */
35
+ iconOnly: boolean;
36
+ /** Determines the positioning of the icon in relation to the text */
37
+ iconPosition: 'left' | 'right';
36
38
  /** If true, hides text & icon and shows loading indicator. **Notice!** Only applicable if `variant` is `primary`. */
37
39
  loading: boolean;
38
40
  noValidate: boolean;
@@ -42,7 +44,7 @@ export declare class SkfButton extends SkfElement {
42
44
  /** @type { 'button' | 'submit' | 'reset' } */
43
45
  type: HTMLButtonElement['type'];
44
46
  /** If provided, alters the appearance */
45
- variant: 'primary' | 'secondary';
47
+ variant: 'primary' | 'secondary' | 'tertiary';
46
48
  /** @internal */
47
49
  private _loaderVisible;
48
50
  /** @internal */
@@ -53,7 +55,7 @@ export declare class SkfButton extends SkfElement {
53
55
  private $button?;
54
56
  constructor();
55
57
  protected firstUpdated(_changedProperties: PropertyValues): void;
56
- attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
58
+ _handleLoadingChange(): void;
57
59
  /** @internal */
58
60
  _handleClick: (e: MouseEvent) => void;
59
61
  /** @internal */
@@ -1,31 +1,33 @@
1
1
  import "../icon/icon.js";
2
2
  import "../loader/loader.js";
3
- import { SkfElement as f } from "../../internal/components/skf-element.js";
4
- import b from "../../styles/component.styles.js";
5
- import { html as h, LitElement as m } from "lit";
6
- import { property as s, state as u, query as p } from "lit/decorators.js";
7
- import { ifDefined as y } from "lit/directives/if-defined.js";
8
- import _ from "./button.styles.js";
9
- var $ = Object.defineProperty, o = (c, t, r, n) => {
10
- for (var e = void 0, a = c.length - 1, l; a >= 0; a--)
11
- (l = c[a]) && (e = l(t, r, e) || e);
12
- return e && $(t, r, e), e;
3
+ import { SkfElement as m } from "../../internal/components/skf-element.js";
4
+ import { watch as f } from "../../internal/helpers/watch.js";
5
+ import u from "../../styles/component.styles.js";
6
+ import { html as d, LitElement as _, nothing as p } from "lit";
7
+ import { property as o, state as v, query as c } from "lit/decorators.js";
8
+ import { classMap as $ } from "lit/directives/class-map.js";
9
+ import { ifDefined as b } from "lit/directives/if-defined.js";
10
+ import g from "./button.styles.js";
11
+ var O = Object.defineProperty, V = Object.getOwnPropertyDescriptor, s = (y, t, l, r) => {
12
+ for (var e = r > 1 ? void 0 : r ? V(t, l) : t, a = y.length - 1, n; a >= 0; a--)
13
+ (n = y[a]) && (e = (r ? n(t, l, e) : n(e)) || e);
14
+ return r && e && O(t, l, e), e;
13
15
  };
14
- const d = class d extends f {
16
+ const h = class h extends m {
15
17
  constructor() {
16
18
  super(), this._transitionOptions = {
17
19
  duration: 200,
18
20
  fill: "forwards"
19
- }, this.destructive = !1, this.disabled = !1, this.iconPosition = "left", this.loading = !1, this.noValidate = !1, this.size = "md", this.type = "button", this.variant = "primary", this._loaderVisible = !1, this._handleClick = (t) => {
21
+ }, this.destructive = !1, this.disabled = !1, this.iconOnly = !1, this.iconPosition = "left", this.loading = !1, this.noValidate = !1, this.size = "md", this.type = "button", this.variant = "primary", this._loaderVisible = !1, this._handleClick = (t) => {
20
22
  t.preventDefault(), t.stopPropagation(), !(this.disabled || this.loading) && (this.dispatchEvent(new CustomEvent("click", { bubbles: !0, composed: !0, detail: t })), this.type === "submit" && this._submitForm(), this.type === "reset" && this._resetForm());
21
23
  }, this._submitForm = () => {
22
- var e, a, l;
23
- const t = !((e = this._internals.form) != null && e.reportValidity()), r = !this.noValidate, n = !((a = this._internals.form) != null && a.hasAttribute("no-validate"));
24
- (r || n) && t || (l = this._internals.form) == null || l.submit();
24
+ var e, a, n;
25
+ const t = !((e = this._internals.form) != null && e.reportValidity()), l = !this.noValidate, r = !((a = this._internals.form) != null && a.hasAttribute("no-validate"));
26
+ (l || r) && t || (n = this._internals.form) == null || n.requestSubmit();
25
27
  }, this._resetForm = () => {
26
28
  var t;
27
29
  (t = this._internals.form) == null || t.reset();
28
- }, this._renderIcon = () => h`<skf-icon class="skf-icon-host" name=${y(this.icon)}></skf-icon>`, this._internals = this.attachInternals();
30
+ }, this._renderIcon = () => d`<skf-icon class="skf-icon-host" name=${b(this.icon)}></skf-icon>`, this._internals = this.attachInternals();
29
31
  }
30
32
  firstUpdated(t) {
31
33
  if (t.has("loading") && this.loading) {
@@ -33,8 +35,8 @@ const d = class d extends f {
33
35
  this._loaderVisible = !0, this.$body.style.opacity = "0", this.$loader.style.opacity = "1";
34
36
  }
35
37
  }
36
- attributeChangedCallback(t, r, n) {
37
- super.attributeChangedCallback(t, r, n), t === "loading" && (n !== null ? this._showLoader() : this._hideLoader());
38
+ _handleLoadingChange() {
39
+ this.loading ? this._showLoader() : this._hideLoader();
38
40
  }
39
41
  /** Simulates a click on the button. */
40
42
  click() {
@@ -51,68 +53,83 @@ const d = class d extends f {
51
53
  !this.$body || !this.$loader || (await this.$loader.animate({ opacity: 0 }, this._transitionOptions).finished, this._loaderVisible = !1, this.$body.animate({ opacity: 1 }, this._transitionOptions));
52
54
  }
53
55
  render() {
54
- return h`
56
+ return d`
55
57
  <button
56
58
  ?disabled=${this.disabled || this.loading}
57
59
  aria-busy=${this.loading}
58
- id="root"
59
- type=${y(this.type)}
60
+ class=${$({
61
+ btn: !0,
62
+ "btn--destructive": this.destructive,
63
+ "btn--icon-only": this.iconOnly,
64
+ "btn--size-lg": this.size === "lg",
65
+ "btn--size-md": this.size === "md",
66
+ "btn--size-sm": this.size === "sm",
67
+ "btn--variant-primary": this.variant === "primary",
68
+ "btn--variant-secondary": this.variant === "secondary",
69
+ "btn--variant-tertiary": this.variant === "tertiary"
70
+ })}
71
+ type=${b(this.type)}
60
72
  @click=${this._handleClick}
61
- title=${this.title}
73
+ title=${/* An empty title prevents browser validation tooltips from appearing on hover */
74
+ this.title}
62
75
  >
63
- ${this.variant === "primary" && this._loaderVisible ? h`<skf-loader invert size="sm"></skf-loader>` : ""}
64
- <div id="body">
65
- ${this.icon && this.iconPosition === "left" ? this._renderIcon() : ""}
66
- <div id="label">
67
- <slot></slot>
68
- </div>
69
- ${this.icon && this.iconPosition === "right" ? this._renderIcon() : ""}
76
+ ${this.variant === "primary" && this._loaderVisible ? d`<skf-loader class="btn__loader" invert size="sm"></skf-loader>` : ""}
77
+ <div class="btn__body" id="body">
78
+ ${this.icon && this.iconPosition === "left" ? this._renderIcon() : p}
79
+ ${this.iconOnly ? p : d`<slot class="btn__label"></slot>`}
80
+ ${this.icon && this.iconPosition === "right" ? this._renderIcon() : p}
70
81
  </div>
71
82
  </button>
72
83
  `;
73
84
  }
74
85
  };
75
- d.formAssociated = !0, d.shadowRootOptions = { ...m.shadowRootOptions, delegatesFocus: !0 }, d.styles = [b, _];
76
- let i = d;
77
- o([
78
- s({ type: Boolean })
79
- ], i.prototype, "destructive");
80
- o([
81
- s({ type: Boolean })
82
- ], i.prototype, "disabled");
83
- o([
84
- s()
85
- ], i.prototype, "icon");
86
- o([
87
- s({ attribute: "icon-position" })
88
- ], i.prototype, "iconPosition");
89
- o([
90
- s({ type: Boolean })
91
- ], i.prototype, "loading");
92
- o([
93
- s({ type: Boolean, attribute: "no-validate" })
94
- ], i.prototype, "noValidate");
95
- o([
96
- s({ reflect: !0 })
97
- ], i.prototype, "size");
98
- o([
99
- s()
100
- ], i.prototype, "type");
101
- o([
102
- s({ reflect: !0 })
103
- ], i.prototype, "variant");
104
- o([
105
- u()
106
- ], i.prototype, "_loaderVisible");
107
- o([
108
- p("skf-loader")
109
- ], i.prototype, "$loader");
110
- o([
111
- p("#body")
112
- ], i.prototype, "$body");
113
- o([
114
- p("button")
115
- ], i.prototype, "$button");
86
+ h.formAssociated = !0, h.shadowRootOptions = { ..._.shadowRootOptions, delegatesFocus: !0 }, h.styles = [u, g];
87
+ let i = h;
88
+ s([
89
+ o({ type: Boolean })
90
+ ], i.prototype, "destructive", 2);
91
+ s([
92
+ o({ type: Boolean })
93
+ ], i.prototype, "disabled", 2);
94
+ s([
95
+ o()
96
+ ], i.prototype, "icon", 2);
97
+ s([
98
+ o({ type: Boolean })
99
+ ], i.prototype, "iconOnly", 2);
100
+ s([
101
+ o({ attribute: "icon-position" })
102
+ ], i.prototype, "iconPosition", 2);
103
+ s([
104
+ o({ type: Boolean, reflect: !0 })
105
+ ], i.prototype, "loading", 2);
106
+ s([
107
+ o({ type: Boolean, attribute: "no-validate" })
108
+ ], i.prototype, "noValidate", 2);
109
+ s([
110
+ o({ reflect: !0 })
111
+ ], i.prototype, "size", 2);
112
+ s([
113
+ o()
114
+ ], i.prototype, "type", 2);
115
+ s([
116
+ o({ reflect: !0 })
117
+ ], i.prototype, "variant", 2);
118
+ s([
119
+ v()
120
+ ], i.prototype, "_loaderVisible", 2);
121
+ s([
122
+ c("skf-loader")
123
+ ], i.prototype, "$loader", 2);
124
+ s([
125
+ c("#body")
126
+ ], i.prototype, "$body", 2);
127
+ s([
128
+ c("button")
129
+ ], i.prototype, "$button", 2);
130
+ s([
131
+ f("loading", { afterUpdate: !0 })
132
+ ], i.prototype, "_handleLoadingChange", 1);
116
133
  export {
117
134
  i as SkfButton
118
135
  };
@@ -1,12 +1,13 @@
1
1
  import { css as o } from "lit";
2
2
  const r = o`
3
+ /* stylelint-disable selector-class-pattern */
3
4
  @layer components {
4
5
  :host {
5
6
  contain: initial;
6
7
  display: inline-flex;
7
8
  }
8
9
 
9
- #root {
10
+ .btn {
10
11
  background-color: var(--_skf-button-state-bg-color, var(--_skf-button-bg-color));
11
12
  block-size: var(--_skf-button-block-size);
12
13
  border: var(--skf-border-width-sm) solid
@@ -16,10 +17,13 @@ const r = o`
16
17
  font-size: var(--_skf-button-font-size, var(--skf-font-size-100));
17
18
  font-weight: var(--skf-font-weight-bold);
18
19
  max-inline-size: min(100%, 23ch);
19
- min-inline-size: 64px;
20
- padding-inline: var(--skf-spacing-100);
21
20
  position: relative;
22
21
 
22
+ &:not(.btn--icon-only) {
23
+ min-inline-size: 64px;
24
+ padding-inline: var(--skf-spacing-100);
25
+ }
26
+
23
27
  /**
24
28
  * State
25
29
  */
@@ -41,67 +45,82 @@ const r = o`
41
45
  &:active:not(:disabled) {
42
46
  --_skf-button-state-bg-color: var(--_skf-button-bg-color-active);
43
47
  }
48
+ }
44
49
 
45
- /**
46
- * Size
47
- */
48
- :host([size='sm']) & {
49
- --_skf-button-block-size: var(--skf-size-32);
50
- --_skf-button-font-size: var(--skf-font-size-75);
51
- }
50
+ .btn--icon-only {
51
+ aspect-ratio: 1;
52
+ place-items: center;
53
+ }
52
54
 
53
- :host([size='md']) & {
54
- --_skf-button-block-size: var(--skf-size-44);
55
- }
55
+ /**
56
+ * Size
57
+ */
58
+ .btn--size-sm {
59
+ --_skf-button-block-size: var(--skf-size-32);
60
+ --_skf-button-font-size: var(--skf-font-size-75);
61
+ }
56
62
 
57
- :host([size='lg']) & {
58
- --_skf-button-block-size: var(--skf-size-56);
59
- }
63
+ .btn--size-md {
64
+ --_skf-button-block-size: var(--skf-size-44);
65
+ }
60
66
 
61
- /**
62
- * Variants
63
- */
64
- :host([variant='primary']) & {
65
- --_skf-button-bg-color: var(--skf-interactive-bg-color-primary);
66
- --_skf-button-bg-color-disabled: var(--skf-interactive-bg-color-disabled);
67
- --_skf-button-bg-color-active: var(--skf-interactive-bg-color-primary-active);
68
- --_skf-button-bg-color-hover: var(--skf-interactive-bg-color-primary-hover);
69
- --_skf-button-border-color: transparent;
70
- --_skf-button-color: var(--skf-text-color-inverse);
71
- --_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
72
- }
67
+ .btn--size-lg {
68
+ --_skf-button-block-size: var(--skf-size-56);
69
+ }
73
70
 
74
- :host([variant='secondary']) & {
75
- --_skf-button-bg-color: var(--skf-interactive-bg-color-secondary);
76
- --_skf-button-bg-color-active: var(--skf-interactive-bg-color-secondary-active);
77
- --_skf-button-bg-color-hover: var(--skf-interactive-bg-color-secondary-hover);
78
- --_skf-button-border-color: var(--skf-border-color-emphasised);
79
- --_skf-button-border-color-disabled: var(--skf-interactive-border-color-disabled);
80
- --_skf-button-color: var(--skf-text-color-emphasised);
81
- --_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
82
- }
71
+ /**
72
+ * Variants
73
+ */
74
+ .btn--variant-primary {
75
+ --_skf-button-bg-color: var(--skf-interactive-bg-color-primary);
76
+ --_skf-button-bg-color-disabled: var(--skf-interactive-bg-color-disabled);
77
+ --_skf-button-bg-color-active: var(--skf-interactive-bg-color-primary-active);
78
+ --_skf-button-bg-color-hover: var(--skf-interactive-bg-color-primary-hover);
79
+ --_skf-button-border-color: transparent;
80
+ --_skf-button-color: var(--skf-text-color-inverse);
81
+ --_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
82
+ }
83
83
 
84
- :host([destructive]:not([variant='secondary'])) & {
85
- --_skf-button-bg-color: var(--skf-interactive-bg-color-destructive);
86
- --_skf-button-bg-color-active: var(--skf-interactive-bg-color-destructive-active);
87
- --_skf-button-bg-color-hover: var(--skf-interactive-bg-color-destructive-hover);
88
- }
84
+ .btn--variant-secondary {
85
+ --_skf-button-bg-color: var(--skf-interactive-bg-color-secondary);
86
+ --_skf-button-bg-color-active: var(--skf-interactive-bg-color-secondary-active);
87
+ --_skf-button-bg-color-hover: var(--skf-interactive-bg-color-secondary-hover);
88
+ --_skf-button-border-color: var(--skf-border-color-emphasised);
89
+ --_skf-button-border-color-disabled: var(--skf-interactive-border-color-disabled);
90
+ --_skf-button-color: var(--skf-text-color-emphasised);
91
+ --_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
92
+ }
93
+
94
+ .btn--variant-tertiary {
95
+ --_skf-button-bg-color: transparent;
96
+ --_skf-button-bg-color-active: var(--skf-interactive-bg-color-secondary-active);
97
+ --_skf-button-bg-color-hover: var(--skf-interactive-bg-color-secondary-hover);
98
+ --_skf-button-border-color: transparent;
99
+ --_skf-button-color: var(--skf-text-color-emphasised);
100
+ --_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
101
+ }
102
+
103
+ .btn--destructive:not(.btn--variant-secondary, .btn--variant-tertiary) {
104
+ --_skf-button-bg-color: var(--skf-interactive-bg-color-destructive);
105
+ --_skf-button-bg-color-active: var(--skf-interactive-bg-color-destructive-active);
106
+ --_skf-button-bg-color-hover: var(--skf-interactive-bg-color-destructive-hover);
89
107
  }
90
108
 
91
- skf-loader {
109
+ .btn__loader {
92
110
  inset: 50% auto auto 50%;
93
111
  opacity: 0;
94
112
  position: absolute;
95
113
  transform: translate(-50%, -50%);
96
114
  }
97
115
 
98
- #body {
116
+ .btn__body {
99
117
  align-items: center;
100
118
  display: flex;
101
119
  gap: var(--skf-spacing-50);
102
120
  }
103
121
 
104
- #label {
122
+ .btn__label {
123
+ display: block;
105
124
  overflow: hidden;
106
125
  text-overflow: ellipsis;
107
126
  white-space: nowrap;
@@ -26,7 +26,8 @@ export declare class SkfCheckbox extends FormBase implements FormFieldBaseProps
26
26
  /** If defined, outputs helping hints in console */
27
27
  debug?: boolean;
28
28
  /** If true, outputs helping hints in console */
29
- checked?: boolean;
29
+ get checked(): boolean | undefined;
30
+ set checked(value: boolean | undefined);
30
31
  /** If true, forces component to invalid state until removed */
31
32
  customInvalid?: boolean;
32
33
  /** If true and the checkbox is unchecked, the checkbox will appear indeterminate */
@@ -53,6 +54,7 @@ export declare class SkfCheckbox extends FormBase implements FormFieldBaseProps
53
54
  private _invalid;
54
55
  /** @internal */
55
56
  private $input?;
57
+ handleCheckedChange(): void;
56
58
  handleInvalidChange(): void;
57
59
  handleDebugInvalid(): void;
58
60
  handleCustomInvalidChange(): void;