@skf-design-system/ui-components 1.0.0-beta.7 → 1.0.1-beta.0
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/accordion/accordion.component.js +3 -3
- package/dist/components/alert/alert.component.d.ts +2 -2
- package/dist/components/alert/alert.component.js +32 -32
- 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 +3 -1
- package/dist/components/button/button.component.js +60 -47
- package/dist/components/button/button.styles.js +64 -45
- package/dist/components/card/card.component.js +4 -4
- package/dist/components/checkbox/checkbox.component.js +4 -4
- package/dist/components/dialog/dialog.component.d.ts +0 -1
- package/dist/components/dialog/dialog.component.js +21 -23
- package/dist/components/divider/divider.component.js +12 -12
- package/dist/components/heading/heading.component.js +13 -13
- package/dist/components/icon/icon.component.d.ts +1 -4
- package/dist/components/icon/icon.component.js +32 -23
- package/dist/components/icon/icon.styles.js +53 -47
- package/dist/components/link/link.component.d.ts +1 -0
- package/dist/components/link/link.component.js +42 -42
- package/dist/components/loader/loader.component.js +19 -19
- package/dist/components/logo/logo.component.js +6 -6
- 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/progress/progress.component.js +7 -7
- package/dist/components/radio/radio.component.js +4 -4
- 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/select-option-group/select-option-group.component.js +9 -9
- 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/tab/tab.component.js +4 -4
- package/dist/components/tab-panel/tab-panel.component.js +12 -12
- package/dist/components/tag/tag.component.js +9 -9
- package/dist/components/textarea/textarea.component.js +3 -3
- package/dist/components/toast/toast.component.d.ts +7 -4
- package/dist/components/toast/toast.component.js +30 -26
- 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/toast-wrapper/toast-wrapper.component.js +10 -10
- 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 +2179 -1002
- package/dist/index.d.ts +6 -0
- package/dist/index.js +72 -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/components/hint/hint.component.js +13 -13
- package/dist/internal/controllers/popover.controller.d.ts +16 -0
- package/dist/internal/controllers/popover.controller.js +44 -0
- package/dist/internal/helpers/hintSeverity.d.ts +1 -1
- package/dist/react/index.d.ts +10 -2
- package/dist/react/index.js +10 -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-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 +594 -163
- package/dist/types/vue/index.d.ts +326 -74
- package/dist/vscode.html-custom-data.json +722 -390
- package/dist/web-types.json +836 -290
- package/package.json +33 -33
@@ -5,9 +5,9 @@ import { html as f } from "lit";
|
|
5
5
|
import { property as a, queryAssignedNodes as d } from "lit/decorators.js";
|
6
6
|
import { classMap as c } from "lit/directives/class-map.js";
|
7
7
|
import { styles as g } from "./accordion.styles.js";
|
8
|
-
var y = Object.defineProperty, s = (
|
9
|
-
for (var r = void 0, l =
|
10
|
-
(
|
8
|
+
var y = Object.defineProperty, s = (u, t, i, o) => {
|
9
|
+
for (var r = void 0, l = u.length - 1, p; l >= 0; l--)
|
10
|
+
(p = u[l]) && (r = p(t, i, r) || r);
|
11
11
|
return r && y(t, i, r), r;
|
12
12
|
};
|
13
13
|
const n = class n extends h {
|
@@ -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
|
3
|
+
import f from "../../styles/component.styles.js";
|
4
|
+
import { html as m, nothing as u } from "lit";
|
5
|
+
import { property as s } from "lit/decorators.js";
|
6
6
|
import { classMap as h } from "lit/directives/class-map.js";
|
7
|
-
import { ifDefined as
|
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 = (n, l, a, d) => {
|
10
|
+
for (var t = void 0, i = n.length - 1, c; i >= 0; i--)
|
11
|
+
(c = n[i]) && (t = c(l, a, t) || t);
|
12
|
+
return t && b(l, a, 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
|
-
aria-modal=${o(this.closeable && "true")}
|
25
24
|
class=${h({
|
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
|
+
` : u}
|
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,6 +31,8 @@ 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 true, removes border */
|
35
|
+
iconOnly: boolean;
|
34
36
|
/** If provided, determines the positioning of the icon in relation to the text */
|
35
37
|
iconPosition?: 'left' | 'right';
|
36
38
|
/** If true, hides text & icon and shows loading indicator. **Notice!** Only applicable if `variant` is `primary`. */
|
@@ -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 */
|
@@ -1,27 +1,28 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
2
|
import "../loader/loader.js";
|
3
|
-
import { SkfElement as
|
4
|
-
import
|
5
|
-
import { html as h, LitElement as m } from "lit";
|
6
|
-
import { property as
|
3
|
+
import { SkfElement as b } from "../../internal/components/skf-element.js";
|
4
|
+
import f from "../../styles/component.styles.js";
|
5
|
+
import { html as h, LitElement as m, nothing as u } from "lit";
|
6
|
+
import { property as e, state as _, query as p } from "lit/decorators.js";
|
7
|
+
import { classMap as v } from "lit/directives/class-map.js";
|
7
8
|
import { ifDefined as y } from "lit/directives/if-defined.js";
|
8
|
-
import
|
9
|
-
var
|
10
|
-
for (var
|
11
|
-
(l = c[
|
12
|
-
return
|
9
|
+
import $ from "./button.styles.js";
|
10
|
+
var g = Object.defineProperty, s = (c, t, a, n) => {
|
11
|
+
for (var o = void 0, r = c.length - 1, l; r >= 0; r--)
|
12
|
+
(l = c[r]) && (o = l(t, a, o) || o);
|
13
|
+
return o && g(t, a, o), o;
|
13
14
|
};
|
14
|
-
const d = class d extends
|
15
|
+
const d = class d extends b {
|
15
16
|
constructor() {
|
16
17
|
super(), this._transitionOptions = {
|
17
18
|
duration: 200,
|
18
19
|
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) => {
|
20
|
+
}, 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
21
|
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
22
|
}, this._submitForm = () => {
|
22
|
-
var
|
23
|
-
const t = !((
|
24
|
-
(
|
23
|
+
var o, r, l;
|
24
|
+
const t = !((o = this._internals.form) != null && o.reportValidity()), a = !this.noValidate, n = !((r = this._internals.form) != null && r.hasAttribute("no-validate"));
|
25
|
+
(a || n) && t || (l = this._internals.form) == null || l.submit();
|
25
26
|
}, this._resetForm = () => {
|
26
27
|
var t;
|
27
28
|
(t = this._internals.form) == null || t.reset();
|
@@ -33,8 +34,8 @@ const d = class d extends f {
|
|
33
34
|
this._loaderVisible = !0, this.$body.style.opacity = "0", this.$loader.style.opacity = "1";
|
34
35
|
}
|
35
36
|
}
|
36
|
-
attributeChangedCallback(t,
|
37
|
-
super.attributeChangedCallback(t,
|
37
|
+
attributeChangedCallback(t, a, n) {
|
38
|
+
super.attributeChangedCallback(t, a, n), t === "loading" && (n !== null ? this._showLoader() : this._hideLoader());
|
38
39
|
}
|
39
40
|
/** Simulates a click on the button. */
|
40
41
|
click() {
|
@@ -55,62 +56,74 @@ const d = class d extends f {
|
|
55
56
|
<button
|
56
57
|
?disabled=${this.disabled || this.loading}
|
57
58
|
aria-busy=${this.loading}
|
58
|
-
|
59
|
+
class=${v({
|
60
|
+
btn: !0,
|
61
|
+
"btn--destructive": this.destructive,
|
62
|
+
"btn--icon-only": this.iconOnly,
|
63
|
+
"btn--size-lg": this.size === "lg",
|
64
|
+
"btn--size-md": this.size === "md",
|
65
|
+
"btn--size-sm": this.size === "sm",
|
66
|
+
"btn--variant-primary": this.variant === "primary",
|
67
|
+
"btn--variant-secondary": this.variant === "secondary",
|
68
|
+
"btn--variant-tertiary": this.variant === "tertiary"
|
69
|
+
})}
|
59
70
|
type=${y(this.type)}
|
60
71
|
@click=${this._handleClick}
|
61
|
-
title=${
|
72
|
+
title=${/* An empty title prevents browser validation tooltips from appearing on hover */
|
73
|
+
this.title}
|
62
74
|
>
|
63
|
-
${this.variant === "primary" && this._loaderVisible ? h`<skf-loader invert size="sm"></skf-loader>` : ""}
|
64
|
-
<div id="body">
|
75
|
+
${this.variant === "primary" && this._loaderVisible ? h`<skf-loader class="btn__loader" invert size="sm"></skf-loader>` : ""}
|
76
|
+
<div class="btn__body" id="body">
|
65
77
|
${this.icon && this.iconPosition === "left" ? this._renderIcon() : ""}
|
66
|
-
|
67
|
-
<slot></slot>
|
68
|
-
</div>
|
78
|
+
${this.iconOnly ? u : h`<slot class="btn__label"></slot>`}
|
69
79
|
${this.icon && this.iconPosition === "right" ? this._renderIcon() : ""}
|
70
80
|
</div>
|
71
81
|
</button>
|
72
82
|
`;
|
73
83
|
}
|
74
84
|
};
|
75
|
-
d.formAssociated = !0, d.shadowRootOptions = { ...m.shadowRootOptions, delegatesFocus: !0 }, d.styles = [
|
85
|
+
d.formAssociated = !0, d.shadowRootOptions = { ...m.shadowRootOptions, delegatesFocus: !0 }, d.styles = [f, $];
|
76
86
|
let i = d;
|
77
|
-
|
78
|
-
|
87
|
+
s([
|
88
|
+
e({ type: Boolean })
|
79
89
|
], i.prototype, "destructive");
|
80
|
-
|
81
|
-
|
90
|
+
s([
|
91
|
+
e({ type: Boolean })
|
82
92
|
], i.prototype, "disabled");
|
83
|
-
|
84
|
-
|
93
|
+
s([
|
94
|
+
e()
|
85
95
|
], i.prototype, "icon");
|
86
|
-
|
87
|
-
|
96
|
+
s([
|
97
|
+
e({ type: Boolean })
|
98
|
+
], i.prototype, "iconOnly");
|
99
|
+
s([
|
100
|
+
e({ attribute: "icon-position" })
|
88
101
|
], i.prototype, "iconPosition");
|
89
|
-
|
90
|
-
|
102
|
+
s([
|
103
|
+
e({ type: Boolean })
|
91
104
|
], i.prototype, "loading");
|
92
|
-
|
93
|
-
|
105
|
+
s([
|
106
|
+
e({ type: Boolean, attribute: "no-validate" })
|
94
107
|
], i.prototype, "noValidate");
|
95
|
-
|
96
|
-
|
108
|
+
s([
|
109
|
+
e({ reflect: !0 })
|
97
110
|
], i.prototype, "size");
|
98
|
-
|
99
|
-
|
111
|
+
s([
|
112
|
+
e()
|
100
113
|
], i.prototype, "type");
|
101
|
-
|
102
|
-
|
114
|
+
s([
|
115
|
+
e({ reflect: !0 })
|
103
116
|
], i.prototype, "variant");
|
104
|
-
|
105
|
-
|
117
|
+
s([
|
118
|
+
_()
|
106
119
|
], i.prototype, "_loaderVisible");
|
107
|
-
|
120
|
+
s([
|
108
121
|
p("skf-loader")
|
109
122
|
], i.prototype, "$loader");
|
110
|
-
|
123
|
+
s([
|
111
124
|
p("#body")
|
112
125
|
], i.prototype, "$body");
|
113
|
-
|
126
|
+
s([
|
114
127
|
p("button")
|
115
128
|
], i.prototype, "$button");
|
116
129
|
export {
|
@@ -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;
|
@@ -4,10 +4,10 @@ import { html as m } from "lit";
|
|
4
4
|
import { property as o } from "lit/decorators.js";
|
5
5
|
import { classMap as f } from "lit/directives/class-map.js";
|
6
6
|
import { styles as h } from "./card.styles.js";
|
7
|
-
var u = Object.defineProperty, s = (i,
|
8
|
-
for (var t = void 0, e = i.length - 1,
|
9
|
-
(
|
10
|
-
return t && u(
|
7
|
+
var u = Object.defineProperty, s = (i, d, p, y) => {
|
8
|
+
for (var t = void 0, e = i.length - 1, a; e >= 0; e--)
|
9
|
+
(a = i[e]) && (t = a(d, p, t) || t);
|
10
|
+
return t && u(d, p, t), t;
|
11
11
|
};
|
12
12
|
const n = class n extends l {
|
13
13
|
constructor() {
|
@@ -3,8 +3,8 @@ import { FormBase as c } from "../../internal/components/formBase.js";
|
|
3
3
|
import { watch as h } from "../../internal/helpers/watch.js";
|
4
4
|
import { Asterisk as v } from "../../internal/templates/asterisk.js";
|
5
5
|
import m from "../../styles/component.styles.js";
|
6
|
-
import { html as p, nothing as
|
7
|
-
import { property as r, state as
|
6
|
+
import { html as p, nothing as f } from "lit";
|
7
|
+
import { property as r, state as y, query as _ } from "lit/decorators.js";
|
8
8
|
import { ifDefined as b } from "lit/directives/if-defined.js";
|
9
9
|
import g from "./checkbox.styles.js";
|
10
10
|
var $ = Object.defineProperty, I = Object.getOwnPropertyDescriptor, e = (u, i, s, a) => {
|
@@ -76,7 +76,7 @@ const d = class d extends c {
|
|
76
76
|
${this._renderIcon("check")} ${this._renderIcon("removeMinus")}
|
77
77
|
<div id="label">
|
78
78
|
<slot>${this.label}</slot>
|
79
|
-
${this.required ? v(this.requiredLabel) :
|
79
|
+
${this.required ? v(this.requiredLabel) : f}
|
80
80
|
</div>
|
81
81
|
</label>
|
82
82
|
`;
|
@@ -118,7 +118,7 @@ e([
|
|
118
118
|
r()
|
119
119
|
], t.prototype, "value", 2);
|
120
120
|
e([
|
121
|
-
|
121
|
+
y()
|
122
122
|
], t.prototype, "_invalid", 2);
|
123
123
|
e([
|
124
124
|
_("input")
|
@@ -16,7 +16,6 @@ import { type CSSResultGroup } from 'lit';
|
|
16
16
|
* @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
|
17
17
|
*
|
18
18
|
* @slot - The dialog component's content
|
19
|
-
* @slot heading - The dialog component's heading
|
20
19
|
* @slot footer - The dialog component's buttons goes here
|
21
20
|
*
|
22
21
|
* @event skf-dialog-open - Fires when the dialog is opened (after transitioned in)
|