@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.
- package/dist/components/alert/alert.component.d.ts +2 -2
- package/dist/components/alert/alert.component.js +34 -34
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +29 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +8 -0
- package/dist/components/breadcrumb/breadcrumb.styles.d.ts +1 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.component.d.ts +25 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +8 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.styles.d.ts +1 -0
- package/dist/components/button/button.component.d.ts +6 -4
- package/dist/components/button/button.component.js +87 -70
- package/dist/components/button/button.styles.js +64 -45
- package/dist/components/checkbox/checkbox.component.d.ts +3 -1
- package/dist/components/checkbox/checkbox.component.js +71 -58
- package/dist/components/date-picker/datepicker.calendar.component.d.ts +72 -0
- package/dist/components/date-picker/datepicker.calendar.component.js +382 -0
- package/dist/components/date-picker/datepicker.calendar.styles.d.ts +1 -0
- package/dist/components/date-picker/datepicker.calendar.styles.js +192 -0
- package/dist/components/date-picker/datepicker.component.d.ts +74 -0
- package/dist/components/date-picker/datepicker.component.js +241 -0
- package/dist/components/date-picker/datepicker.d.ts +10 -0
- package/dist/components/date-picker/datepicker.helpers.d.ts +40 -0
- package/dist/components/date-picker/datepicker.helpers.js +69 -0
- package/dist/components/date-picker/datepicker.js +8 -0
- package/dist/components/date-picker/datepicker.styles.d.ts +1 -0
- package/dist/components/date-picker/datepicker.styles.js +99 -0
- package/dist/components/date-picker-input/datepicker-input.component.d.ts +107 -0
- package/dist/components/date-picker-input/datepicker-input.component.js +397 -0
- package/dist/components/date-picker-input/datepicker-input.d.ts +8 -0
- package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +4 -0
- package/dist/components/date-picker-input/datepicker-input.helpers.js +29 -0
- package/dist/components/date-picker-input/datepicker-input.js +6 -0
- package/dist/components/date-picker-input/datepicker-input.styles.d.ts +1 -0
- package/dist/components/date-picker-input/datepicker-input.styles.js +22 -0
- package/dist/components/dialog/dialog.component.d.ts +0 -1
- package/dist/components/dialog/dialog.component.js +2 -4
- package/dist/components/icon/icon.component.d.ts +1 -4
- package/dist/components/icon/icon.component.js +28 -19
- package/dist/components/icon/icon.styles.js +53 -47
- package/dist/components/input/input.component.d.ts +1 -0
- package/dist/components/input/input.component.js +87 -80
- package/dist/components/link/link.component.d.ts +1 -0
- package/dist/components/link/link.component.js +21 -21
- package/dist/components/menu/menu.component.d.ts +24 -0
- package/dist/components/menu/menu.component.js +18 -0
- package/dist/components/menu/menu.d.ts +8 -0
- package/dist/components/menu/menu.js +6 -0
- package/dist/components/menu/menu.styles.d.ts +1 -0
- package/dist/components/menu/menu.styles.js +11 -0
- package/dist/components/menu-item/menu-item.component.d.ts +25 -0
- package/dist/components/menu-item/menu-item.component.js +13 -0
- package/dist/components/menu-item/menu-item.d.ts +8 -0
- package/dist/components/menu-item/menu-item.js +6 -0
- package/dist/components/menu-item/menu-item.styles.d.ts +1 -0
- package/dist/components/menu-item/menu-item.styles.js +19 -0
- package/dist/components/popover/popover.component.d.ts +29 -0
- package/dist/components/popover/popover.component.js +37 -0
- package/dist/components/popover/popover.d.ts +8 -0
- package/dist/components/popover/popover.js +6 -0
- package/dist/components/popover/popover.styles.d.ts +1 -0
- package/dist/components/popover/popover.styles.js +12 -0
- package/dist/components/select/select.component.d.ts +8 -10
- package/dist/components/select/select.component.js +115 -118
- package/dist/components/select/select.controllers.d.ts +0 -25
- package/dist/components/select/select.controllers.js +35 -95
- package/dist/components/stepper/stepper.component.d.ts +38 -0
- package/dist/components/stepper/stepper.component.js +91 -0
- package/dist/components/stepper/stepper.d.ts +8 -0
- package/dist/components/stepper/stepper.helpers.d.ts +16 -0
- package/dist/components/stepper/stepper.helpers.js +18 -0
- package/dist/components/stepper/stepper.js +6 -0
- package/dist/components/stepper/stepper.styles.d.ts +1 -0
- package/dist/components/stepper/stepper.styles.js +15 -0
- package/dist/components/stepper-item/stepper-item.component.d.ts +47 -0
- package/dist/components/stepper-item/stepper-item.component.js +113 -0
- package/dist/components/stepper-item/stepper-item.d.ts +8 -0
- package/dist/components/stepper-item/stepper-item.js +6 -0
- package/dist/components/stepper-item/stepper-item.styles.d.ts +1 -0
- package/dist/components/stepper-item/stepper-item.styles.js +98 -0
- package/dist/components/toast/toast.component.d.ts +7 -4
- package/dist/components/toast/toast.component.js +24 -20
- package/dist/components/toast/toast.singleton.d.ts +2 -7
- package/dist/components/toast/toast.singleton.js +25 -25
- package/dist/components/toast-item/toast-item.component.js +15 -15
- package/dist/components/toast-item/toast-item.styles.js +13 -11
- package/dist/components/tooltip/tooltip.component.d.ts +24 -0
- package/dist/components/tooltip/tooltip.component.js +18 -0
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/components/tooltip/tooltip.js +6 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
- package/dist/components/tooltip/tooltip.styles.js +12 -0
- package/dist/custom-elements.json +3278 -1321
- package/dist/index.d.ts +8 -0
- package/dist/index.js +78 -54
- package/dist/internal/base-classes/popover/popover.base.d.ts +29 -0
- package/dist/internal/base-classes/popover/popover.base.js +116 -0
- package/dist/internal/base-classes/popover/popover.styles.d.ts +1 -0
- package/dist/internal/base-classes/popover/popover.styles.js +29 -0
- package/dist/internal/controllers/popover.controller.d.ts +17 -0
- package/dist/internal/controllers/popover.controller.js +44 -0
- package/dist/internal/helpers/dateFormatter.d.ts +2 -0
- package/dist/internal/helpers/hintSeverity.d.ts +1 -1
- package/dist/internal/helpers/utilityTypes.d.ts +22 -0
- package/dist/react/index.d.ts +11 -2
- package/dist/react/index.js +11 -2
- package/dist/react/skf-breadcrumb/index.d.ts +9 -0
- package/dist/react/skf-breadcrumb/index.js +17 -0
- package/dist/react/skf-breadcrumb-item/index.d.ts +3 -0
- package/dist/react/skf-breadcrumb-item/index.js +13 -0
- package/dist/react/skf-datepicker/index.d.ts +12 -0
- package/dist/react/skf-datepicker/index.js +18 -0
- package/dist/react/skf-menu/index.d.ts +12 -0
- package/dist/react/skf-menu/index.js +18 -0
- package/dist/react/skf-menu-item/index.d.ts +27 -0
- package/dist/react/skf-menu-item/index.js +23 -0
- package/dist/react/skf-popover/index.d.ts +12 -0
- package/dist/react/skf-popover/index.js +18 -0
- package/dist/react/skf-stepper/index.d.ts +9 -0
- package/dist/react/skf-stepper/index.js +17 -0
- package/dist/react/skf-stepper-item/index.d.ts +9 -0
- package/dist/react/skf-stepper-item/index.js +17 -0
- package/dist/react/skf-tooltip/index.d.ts +12 -0
- package/dist/react/skf-tooltip/index.js +18 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +628 -155
- package/dist/types/vue/index.d.ts +369 -74
- package/dist/vscode.html-custom-data.json +761 -391
- package/dist/web-types.json +936 -293
- 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
|
4
|
-
import { html as
|
5
|
-
import { property as
|
6
|
-
import { classMap as
|
7
|
-
import { ifDefined as
|
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
|
10
|
-
for (var
|
11
|
-
(
|
12
|
-
return
|
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
|
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
|
21
|
+
return m`
|
22
22
|
<div
|
23
23
|
aria-describedby="main"
|
24
|
-
|
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.
|
33
|
+
role=${this.persistent ? "status" : "alert"}
|
34
34
|
>
|
35
35
|
<skf-icon
|
36
|
-
color=${
|
37
|
-
name=${
|
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.
|
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
|
-
` :
|
53
|
+
` : h}
|
54
54
|
</div>
|
55
55
|
`;
|
56
56
|
}
|
57
57
|
};
|
58
|
-
|
59
|
-
let
|
60
|
-
|
61
|
-
|
62
|
-
],
|
63
|
-
|
64
|
-
|
65
|
-
],
|
66
|
-
|
67
|
-
|
68
|
-
],
|
69
|
-
|
70
|
-
|
71
|
-
],
|
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
|
-
|
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 @@
|
|
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 @@
|
|
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
|
35
|
-
|
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
|
-
|
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
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
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,
|
23
|
-
const t = !((e = this._internals.form) != null && e.reportValidity()),
|
24
|
-
(
|
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 = () =>
|
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
|
-
|
37
|
-
|
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
|
56
|
+
return d`
|
55
57
|
<button
|
56
58
|
?disabled=${this.disabled || this.loading}
|
57
59
|
aria-busy=${this.loading}
|
58
|
-
|
59
|
-
|
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=${
|
73
|
+
title=${/* An empty title prevents browser validation tooltips from appearing on hover */
|
74
|
+
this.title}
|
62
75
|
>
|
63
|
-
${this.variant === "primary" && this._loaderVisible ?
|
64
|
-
<div id="body">
|
65
|
-
${this.icon && this.iconPosition === "left" ? this._renderIcon() :
|
66
|
-
|
67
|
-
|
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
|
-
|
76
|
-
let i =
|
77
|
-
|
78
|
-
|
79
|
-
], i.prototype, "destructive");
|
80
|
-
|
81
|
-
|
82
|
-
], i.prototype, "disabled");
|
83
|
-
|
84
|
-
|
85
|
-
], i.prototype, "icon");
|
86
|
-
|
87
|
-
|
88
|
-
], i.prototype, "
|
89
|
-
|
90
|
-
|
91
|
-
], i.prototype, "
|
92
|
-
|
93
|
-
|
94
|
-
], i.prototype, "
|
95
|
-
|
96
|
-
|
97
|
-
], i.prototype, "
|
98
|
-
|
99
|
-
|
100
|
-
], i.prototype, "
|
101
|
-
|
102
|
-
|
103
|
-
], i.prototype, "
|
104
|
-
|
105
|
-
|
106
|
-
], i.prototype, "
|
107
|
-
|
108
|
-
|
109
|
-
], i.prototype, "
|
110
|
-
|
111
|
-
|
112
|
-
], i.prototype, "$
|
113
|
-
|
114
|
-
|
115
|
-
], i.prototype, "$
|
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
|
-
|
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
|
-
|
47
|
-
|
48
|
-
|
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
|
-
|
54
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
63
|
+
.btn--size-md {
|
64
|
+
--_skf-button-block-size: var(--skf-size-44);
|
65
|
+
}
|
60
66
|
|
61
|
-
|
62
|
-
|
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
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
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
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
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
|
-
|
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
|
-
|
116
|
+
.btn__body {
|
99
117
|
align-items: center;
|
100
118
|
display: flex;
|
101
119
|
gap: var(--skf-spacing-50);
|
102
120
|
}
|
103
121
|
|
104
|
-
|
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
|
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;
|