@skf-design-system/ui-components 1.0.0-beta.4 → 1.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -6
- package/dist/components/accordion/accordion.component.d.ts +9 -5
- package/dist/components/accordion/accordion.component.js +22 -19
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/accordion.styles.js +3 -3
- package/dist/components/alert/alert.component.d.ts +7 -4
- package/dist/components/alert/alert.component.js +21 -19
- package/dist/components/alert/alert.styles.js +50 -47
- package/dist/components/button/button.component.d.ts +2 -0
- package/dist/components/button/button.component.js +6 -6
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/card/card.component.d.ts +3 -3
- package/dist/components/card/card.component.js +16 -19
- package/dist/components/card/card.styles.js +11 -3
- package/dist/components/checkbox/checkbox.component.d.ts +9 -6
- package/dist/components/checkbox/checkbox.component.js +7 -7
- package/dist/components/checkbox/checkbox.styles.js +7 -2
- package/dist/components/checkbox/checkbox.test.d.ts +1 -0
- package/dist/components/collapse/collapse.component.d.ts +9 -6
- package/dist/components/collapse/collapse.component.js +39 -36
- package/dist/components/collapse/collapse.styles.js +3 -3
- package/dist/components/collapse/collapse.test.d.ts +1 -0
- package/dist/components/divider/divider.component.d.ts +13 -10
- package/dist/components/divider/divider.component.js +34 -29
- package/dist/components/divider/divider.styles.js +1 -5
- package/dist/components/heading/heading.component.d.ts +12 -2
- package/dist/components/heading/heading.component.js +14 -14
- package/dist/components/heading/heading.styles.js +1 -1
- package/dist/components/icon/icon.component.d.ts +14 -8
- package/dist/components/icon/icon.component.js +6 -6
- package/dist/components/icon/icon.styles.js +56 -54
- package/dist/components/input/input.component.d.ts +43 -29
- package/dist/components/input/input.component.js +46 -36
- package/dist/components/link/link.component.d.ts +15 -12
- package/dist/components/link/link.component.js +7 -7
- package/dist/components/link/link.styles.js +1 -1
- package/dist/components/loader/loader.component.d.ts +7 -7
- package/dist/components/loader/loader.component.js +35 -61
- package/dist/components/loader/loader.styles.js +42 -10
- package/dist/components/logo/logo.component.d.ts +5 -3
- package/dist/components/logo/logo.component.js +8 -8
- package/dist/components/logo/logo.styles.js +2 -2
- package/dist/components/radio/radio.component.d.ts +15 -13
- package/dist/components/radio/radio.component.js +3 -3
- package/dist/components/radio/radio.styles.js +6 -1
- package/dist/components/select/select.component.d.ts +12 -10
- package/dist/components/select/select.component.js +113 -100
- package/dist/components/select/select.controllers.js +5 -2
- package/dist/components/select/select.styles.js +18 -3
- package/dist/components/select-option/select-option.component.d.ts +2 -2
- package/dist/components/select-option/select-option.component.js +16 -10
- package/dist/components/switch/switch.component.d.ts +2 -3
- package/dist/components/switch/switch.component.js +1 -1
- package/dist/components/switch/switch.styles.js +6 -1
- package/dist/components/switch/switch.test.d.ts +1 -0
- package/dist/components/tag/tag.component.d.ts +12 -7
- package/dist/components/tag/tag.component.js +24 -24
- package/dist/components/tag/tag.styles.js +6 -1
- package/dist/components/textarea/textarea.component.d.ts +26 -23
- package/dist/components/textarea/textarea.component.js +15 -12
- package/dist/components/toast/toast.component.d.ts +35 -0
- package/dist/components/toast/toast.component.js +52 -0
- package/dist/components/toast/toast.d.ts +8 -0
- package/dist/components/toast/toast.js +6 -0
- package/dist/components/toast/toast.singleton.d.ts +26 -0
- package/dist/components/toast/toast.singleton.js +53 -0
- package/dist/components/toast/toast.style.d.ts +1 -0
- package/dist/components/toast/toast.style.js +9 -0
- package/dist/components/toast-item/toast-item.component.d.ts +21 -0
- package/dist/components/toast-item/toast-item.component.js +65 -0
- package/dist/components/toast-item/toast-item.d.ts +6 -0
- package/dist/components/toast-item/toast-item.js +2 -0
- package/dist/components/toast-item/toast-item.style.d.ts +2 -0
- package/dist/components/toast-item/toast-item.style.js +16 -0
- package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
- package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
- package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
- package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
- package/dist/components/toast-wrapper/toast-wrapper.style.d.ts +1 -0
- package/dist/components/toast-wrapper/toast-wrapper.style.js +20 -0
- package/dist/custom-elements.json +676 -238
- package/dist/index.d.ts +1 -0
- package/dist/index.js +43 -40
- package/dist/internal/components/hint/hint.component.js +12 -10
- package/dist/internal/components/hint/hint.styles.js +26 -10
- package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -8
- package/dist/react/index.d.ts +5 -3
- package/dist/react/index.js +5 -3
- package/dist/react/skf-toast/index.d.ts +3 -0
- package/dist/react/skf-toast/index.js +13 -0
- package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
- package/dist/react/skf-toast-wrapper/index.js +13 -0
- package/dist/styles/form-field.styles.js +5 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +88 -50
- package/dist/types/vue/index.d.ts +91 -51
- package/dist/vscode.html-custom-data.json +101 -62
- package/dist/web-types.json +208 -122
- package/package.json +3 -3
@@ -14,7 +14,7 @@ import { type CSSResultGroup } from 'lit';
|
|
14
14
|
* @event change - Fires when the value of the input changes
|
15
15
|
* @event invalid - Fires when the input is invalid
|
16
16
|
*
|
17
|
-
* @slot
|
17
|
+
* @slot - The Inputs label. Alternatively, you can use the `label` attribute.
|
18
18
|
*
|
19
19
|
* @tagname skf-input
|
20
20
|
*
|
@@ -24,57 +24,68 @@ import { type CSSResultGroup } from 'lit';
|
|
24
24
|
export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
25
25
|
static styles: CSSResultGroup;
|
26
26
|
private customError;
|
27
|
-
/**
|
27
|
+
/** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
|
28
28
|
buttonAriaLabelClear: string;
|
29
|
-
/**
|
29
|
+
/** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
|
30
30
|
buttonAriaLabelHide: string;
|
31
|
-
/**
|
31
|
+
/** Custom aria-label for the visibility button **Notice!** Only applicable to type=password. */
|
32
32
|
buttonAriaLabelShow: string;
|
33
|
-
/** If
|
33
|
+
/** If defined, forces component to invalid state until removed. Its value is used as hint text. */
|
34
34
|
set customInvalid(value: string | undefined);
|
35
35
|
get customInvalid(): string | undefined;
|
36
|
-
/** If
|
37
|
-
debug
|
36
|
+
/** If true, outputs helping hints in console */
|
37
|
+
debug?: boolean;
|
38
38
|
/** If true, hides the label visually */
|
39
|
-
hideLabel
|
40
|
-
/** If
|
39
|
+
hideLabel?: boolean;
|
40
|
+
/** If defined, displays informational text below the field */
|
41
41
|
hint?: string;
|
42
|
-
/**
|
42
|
+
/** Tells what keyboard to use if applicable */
|
43
43
|
inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
44
|
-
/**
|
44
|
+
/** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
|
45
45
|
label?: string;
|
46
|
-
/** If
|
46
|
+
/** If defined, displays a prefix/adornment before the input-element */
|
47
47
|
leading?: string;
|
48
|
-
/** If
|
48
|
+
/** If defined, sets the maximum value to accept for this input */
|
49
49
|
max?: number | string;
|
50
|
-
/** If
|
50
|
+
/** If defined, sets the maximum character length to accept for this input */
|
51
51
|
maxLength?: number;
|
52
|
-
/** If
|
52
|
+
/** If defined, sets the minimum value to accept for this input */
|
53
53
|
min?: number | string;
|
54
|
-
/** If
|
54
|
+
/** If defined, sets the minimum character length to accept for this input */
|
55
55
|
minLength?: number;
|
56
|
-
/** If
|
56
|
+
/** If defined, adds name to the input-element */
|
57
57
|
name?: string;
|
58
|
-
/**
|
58
|
+
/**
|
59
|
+
* @internal
|
60
|
+
* If true, hide empty label element
|
61
|
+
*/
|
62
|
+
protected _noLabel: boolean | undefined;
|
63
|
+
/** If defined, adds name to the input-element */
|
59
64
|
pattern?: string;
|
60
|
-
/** If
|
65
|
+
/** If defined, displays placeholder text */
|
61
66
|
placeholder?: string;
|
62
67
|
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
63
68
|
readonly?: boolean;
|
64
|
-
/** If
|
69
|
+
/** If defined, renders an alternative A11y text for the asterisk */
|
65
70
|
requiredLabel?: string;
|
66
|
-
/**
|
71
|
+
/**
|
72
|
+
* If defined, displays provided severity state
|
73
|
+
* @type { "alert" | "success" | "info" | "warning" }
|
74
|
+
*/
|
67
75
|
severity?: FormFieldBaseProps['severity'];
|
68
|
-
/** If
|
76
|
+
/** If true, displays valid state after interaction */
|
69
77
|
showValid?: boolean;
|
70
|
-
/**
|
71
|
-
size
|
72
|
-
/** If
|
78
|
+
/** Size of the input */
|
79
|
+
size: 'sm' | 'md';
|
80
|
+
/** If defined, displays a suffix/adornment after the input-element */
|
73
81
|
trailing?: string;
|
74
|
-
/**
|
82
|
+
/**
|
83
|
+
* Type of input control
|
84
|
+
* @type { 'button' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' }
|
85
|
+
*/
|
75
86
|
type?: Exclude<FormFieldBaseProps['type'], 'checkbox' | 'radio'>;
|
76
|
-
/**
|
77
|
-
validateOn
|
87
|
+
/** Sets validation start */
|
88
|
+
validateOn: 'input' | 'change' | 'submit';
|
78
89
|
/** The current value of the input field */
|
79
90
|
value: string;
|
80
91
|
/** @internal */
|
@@ -85,10 +96,11 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
85
96
|
/** @internal */
|
86
97
|
$input: HTMLInputElement;
|
87
98
|
/** @internal */
|
99
|
+
_defaultSlot: Node[];
|
100
|
+
/** @internal */
|
88
101
|
private _numberController;
|
89
102
|
/** @internal */
|
90
103
|
private _passwordController;
|
91
|
-
constructor();
|
92
104
|
protected firstUpdated(): void;
|
93
105
|
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
94
106
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
@@ -119,5 +131,7 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
119
131
|
private _renderSearchButton;
|
120
132
|
/** @internal */
|
121
133
|
private _onBlur;
|
134
|
+
/** @internal */
|
135
|
+
_handleSlotChange: () => void;
|
122
136
|
render(): import("lit").TemplateResult<1>;
|
123
137
|
}
|
@@ -1,23 +1,23 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { FormBase as
|
2
|
+
import { FormBase as b } from "../../internal/components/formBase.js";
|
3
3
|
import "../../internal/components/hint/hint.js";
|
4
|
-
import { hintSeverity as
|
4
|
+
import { hintSeverity as v } from "../../internal/helpers/hintSeverity.js";
|
5
5
|
import { Asterisk as y } from "../../internal/templates/asterisk.js";
|
6
6
|
import f from "../../styles/component.styles.js";
|
7
7
|
import { html as h, nothing as d } from "lit";
|
8
|
-
import { property as s, state as
|
8
|
+
import { property as s, state as p, query as _, queryAssignedNodes as $ } from "lit/decorators.js";
|
9
9
|
import { ifDefined as a } from "lit/directives/if-defined.js";
|
10
|
-
import { live as
|
11
|
-
import { InputNumberController as
|
12
|
-
import
|
13
|
-
var
|
14
|
-
for (var o = n > 1 ? void 0 : n ?
|
15
|
-
(u =
|
16
|
-
return n && o &&
|
10
|
+
import { live as g } from "lit/directives/live.js";
|
11
|
+
import { InputNumberController as w, InputPasswordController as E } from "./input.controllers.js";
|
12
|
+
import C from "./input.styles.js";
|
13
|
+
var S = Object.defineProperty, L = Object.getOwnPropertyDescriptor, i = (c, e, r, n) => {
|
14
|
+
for (var o = n > 1 ? void 0 : n ? L(e, r) : e, l = c.length - 1, u; l >= 0; l--)
|
15
|
+
(u = c[l]) && (o = (n ? u(e, r, o) : u(o)) || o);
|
16
|
+
return n && o && S(e, r, o), o;
|
17
17
|
};
|
18
|
-
const
|
18
|
+
const m = class m extends b {
|
19
19
|
constructor() {
|
20
|
-
super(), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.
|
20
|
+
super(...arguments), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.inputmode = "text", this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this.invalid = !1, this._buttonDown = !1, this._numberController = new w(this), this._passwordController = new E(this), this._handleInput = () => {
|
21
21
|
this.value = this.$input.value || "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
22
22
|
}, this._resetValue = (e) => {
|
23
23
|
var r;
|
@@ -36,7 +36,7 @@ const p = class p extends v {
|
|
36
36
|
@mouseup=${this._handlePressEnd}
|
37
37
|
@mouseleave=${this._handlePressEnd}
|
38
38
|
aria-label="${e === "inc" ? "Increment" : "Decrement"}"
|
39
|
-
class="number"
|
39
|
+
class="number skf-icon-host"
|
40
40
|
type="button"
|
41
41
|
>
|
42
42
|
<skf-icon name="${e === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
|
@@ -45,7 +45,7 @@ const p = class p extends v {
|
|
45
45
|
<button
|
46
46
|
@click=${this._passwordController.toggleVisibility}
|
47
47
|
aria-label=${a(this._passwordController._buttonAriaLabel)}
|
48
|
-
class="password"
|
48
|
+
class="password skf-icon-host"
|
49
49
|
type="button"
|
50
50
|
@mousedown="${this._handlePressStart}"
|
51
51
|
@mouseup="${this._handlePressEnd}"
|
@@ -60,17 +60,20 @@ const p = class p extends v {
|
|
60
60
|
@mouseup=${this._handlePressEnd}
|
61
61
|
@mouseleave=${this._handlePressEnd}
|
62
62
|
aria-label=${a(this.buttonAriaLabelClear)}
|
63
|
-
class="search"
|
63
|
+
class="search skf-icon-host"
|
64
64
|
type="button"
|
65
65
|
>
|
66
66
|
<skf-icon name="close" size="sm"></skf-icon>
|
67
67
|
</button>
|
68
68
|
`, this._onBlur = () => {
|
69
69
|
this._buttonDown && this.$input.focus();
|
70
|
-
}, this.
|
70
|
+
}, this._handleSlotChange = () => {
|
71
|
+
var e, r;
|
72
|
+
console.log("slot change"), this._noLabel = (this._defaultSlot.length === 0 || !((r = (e = this._defaultSlot[0]) == null ? void 0 : e.textContent) != null && r.trim())) && !this.label;
|
73
|
+
};
|
71
74
|
}
|
72
75
|
set customInvalid(e) {
|
73
|
-
this.customError =
|
76
|
+
this.customError = e || "";
|
74
77
|
}
|
75
78
|
get customInvalid() {
|
76
79
|
return this.customError;
|
@@ -80,7 +83,7 @@ const p = class p extends v {
|
|
80
83
|
this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
|
81
84
|
}), this.addEventListener("invalid", (e) => {
|
82
85
|
this._pristine = !1, this.invalid = !0, this.customErrorDisplay && e.preventDefault();
|
83
|
-
}), this.addEventListener("reset", this._resetValue), this.validateInput();
|
86
|
+
}), this.addEventListener("reset", this._resetValue), this._handleSlotChange(), this.validateInput();
|
84
87
|
}
|
85
88
|
willUpdate(e) {
|
86
89
|
if (e.has("invalid"))
|
@@ -126,31 +129,30 @@ const p = class p extends v {
|
|
126
129
|
render() {
|
127
130
|
var e, r;
|
128
131
|
return h`
|
129
|
-
<div id="
|
132
|
+
<div id="root">
|
130
133
|
<label>
|
131
|
-
<div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
|
132
|
-
<slot>${this.label}</slot>
|
134
|
+
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${this._noLabel} id="label">
|
135
|
+
<slot @slotchange=${this._handleSlotChange}>${this.label}</slot>
|
133
136
|
${this.required ? y(this.requiredLabel) : null}
|
134
137
|
</div>
|
135
138
|
<div id="input">
|
136
|
-
${this.type === "search" ? h`<skf-icon name="search" size="sm"></skf-icon>` : d}
|
139
|
+
${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : d}
|
137
140
|
<div
|
138
141
|
data-leading=${a(this.leading)}
|
139
142
|
data-trailing=${a(this.trailing)}
|
140
143
|
id="affix"
|
141
144
|
>
|
142
145
|
<input
|
143
|
-
autocomplete="off"
|
144
|
-
title=""
|
145
146
|
?disabled=${this.disabled}
|
146
147
|
?readonly=${this.readonly}
|
147
148
|
?required=${this.required}
|
148
|
-
.value=${
|
149
|
-
@input=${this._handleInput}
|
149
|
+
.value=${g(this.value)}
|
150
150
|
@blur=${this._onBlur}
|
151
|
+
@input=${this._handleInput}
|
151
152
|
aria-describedby=${a((e = this.hint) != null && e.trim() ? "hint" : d)}
|
152
153
|
aria-errormessage=${a((r = this.hint) != null && r.trim() ? "hint" : d)}
|
153
154
|
aria-invalid=${!!this.invalid}
|
155
|
+
autocomplete="off"
|
154
156
|
data-testid="field-input"
|
155
157
|
inputmode=${a(this.inputMode)}
|
156
158
|
max=${a(this.max)}
|
@@ -165,9 +167,11 @@ const p = class p extends v {
|
|
165
167
|
)}
|
166
168
|
/>
|
167
169
|
</div>
|
168
|
-
${this.type === "number" ? h
|
169
|
-
|
170
|
-
|
170
|
+
${this.type === "number" ? h`
|
171
|
+
<div id="action">
|
172
|
+
${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
|
173
|
+
</div>
|
174
|
+
` : d}
|
171
175
|
${this.type === "password" ? this._renderPasswordButton() : d}
|
172
176
|
${this.type === "search" && this.value.length > 0 ? this._renderSearchButton() : d}
|
173
177
|
</div>
|
@@ -176,16 +180,16 @@ const p = class p extends v {
|
|
176
180
|
<skf-hint
|
177
181
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
178
182
|
id="hint"
|
179
|
-
severity=${a(
|
180
|
-
>${this.hint}
|
183
|
+
severity=${a(v(this.severity, this.invalid))}
|
184
|
+
>${this.customInvalid ? this.customInvalid : this.hint}
|
181
185
|
</skf-hint>
|
182
186
|
`}
|
183
187
|
</div>
|
184
188
|
`;
|
185
189
|
}
|
186
190
|
};
|
187
|
-
|
188
|
-
let t =
|
191
|
+
m.styles = [f, C];
|
192
|
+
let t = m;
|
189
193
|
i([
|
190
194
|
s({ attribute: "button-aria-label-clear" })
|
191
195
|
], t.prototype, "buttonAriaLabelClear", 2);
|
@@ -231,6 +235,9 @@ i([
|
|
231
235
|
i([
|
232
236
|
s()
|
233
237
|
], t.prototype, "name", 2);
|
238
|
+
i([
|
239
|
+
p()
|
240
|
+
], t.prototype, "_noLabel", 2);
|
234
241
|
i([
|
235
242
|
s()
|
236
243
|
], t.prototype, "pattern", 2);
|
@@ -244,7 +251,7 @@ i([
|
|
244
251
|
s({ attribute: "required-label" })
|
245
252
|
], t.prototype, "requiredLabel", 2);
|
246
253
|
i([
|
247
|
-
s()
|
254
|
+
s({ reflect: !0 })
|
248
255
|
], t.prototype, "severity", 2);
|
249
256
|
i([
|
250
257
|
s({ type: Boolean, attribute: "show-valid" })
|
@@ -265,14 +272,17 @@ i([
|
|
265
272
|
s()
|
266
273
|
], t.prototype, "value", 2);
|
267
274
|
i([
|
268
|
-
|
275
|
+
p()
|
269
276
|
], t.prototype, "invalid", 2);
|
270
277
|
i([
|
271
|
-
|
278
|
+
p()
|
272
279
|
], t.prototype, "_buttonDown", 2);
|
273
280
|
i([
|
274
281
|
_("input")
|
275
282
|
], t.prototype, "$input", 2);
|
283
|
+
i([
|
284
|
+
$({ flatten: !0 })
|
285
|
+
], t.prototype, "_defaultSlot", 2);
|
276
286
|
export {
|
277
287
|
t as SkfInput
|
278
288
|
};
|
@@ -9,38 +9,41 @@ import { type CSSResultGroup } from 'lit';
|
|
9
9
|
*
|
10
10
|
* @property {function} onClick - If provided, custom function triggered by click where the second return parameter enables custom routing.
|
11
11
|
*
|
12
|
-
* @slot
|
12
|
+
* @slot - The links' main content
|
13
13
|
*
|
14
14
|
* @tagname skf-link
|
15
15
|
*/
|
16
16
|
export declare class SkfLink extends SkfElement {
|
17
17
|
static styles: CSSResultGroup;
|
18
18
|
private _onClick?;
|
19
|
-
/**
|
19
|
+
/** Defines the semantic element to render */
|
20
20
|
as: 'button' | 'a';
|
21
|
-
/**
|
21
|
+
/** Defines the text-color */
|
22
22
|
color: 'primary' | 'inverse';
|
23
23
|
/** If true, disables the link */
|
24
24
|
disabled?: boolean;
|
25
|
-
/** If
|
25
|
+
/** If defined, downloads the url */
|
26
26
|
download?: string;
|
27
|
-
/** If
|
27
|
+
/** If defined, loads url on click */
|
28
28
|
href?: string;
|
29
|
-
/**
|
29
|
+
/**
|
30
|
+
* If defined, renders an icon before or after the text
|
31
|
+
* @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" }
|
32
|
+
*/
|
30
33
|
icon?: SkfIcon['name'];
|
31
|
-
/**
|
34
|
+
/** Defines the position of the icon in relation to the text */
|
32
35
|
iconPlacement: 'left' | 'right';
|
33
|
-
/**
|
36
|
+
/** Defines the relationship of the target object to the link object */
|
34
37
|
rel: string;
|
35
|
-
/** If
|
38
|
+
/** If defined, used on conjunction with onClick property, second argument */
|
36
39
|
route?: string;
|
37
40
|
/** If true, fills the parents horizontal axis */
|
38
41
|
stretch?: boolean;
|
39
|
-
/** If
|
42
|
+
/** If defined, specifies where to open the linked document */
|
40
43
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
41
|
-
/**
|
44
|
+
/** Defines the type of button */
|
42
45
|
type: 'button' | 'submit' | 'reset';
|
43
|
-
/** If
|
46
|
+
/** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
|
44
47
|
set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
|
45
48
|
get onClick(): ((event: Event, route?: string) => void) | undefined;
|
46
49
|
connectedCallback(): void;
|
@@ -6,10 +6,10 @@ import "lit";
|
|
6
6
|
import { property as r } from "lit/decorators.js";
|
7
7
|
import { ifDefined as n } from "lit/directives/if-defined.js";
|
8
8
|
import { html as f, literal as d } from "lit/static-html.js";
|
9
|
-
var k = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (h, t, i,
|
10
|
-
for (var s =
|
11
|
-
(c = h[
|
12
|
-
return
|
9
|
+
var k = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (h, t, i, p) => {
|
10
|
+
for (var s = p > 1 ? void 0 : p ? v(t, i) : t, l = h.length - 1, c; l >= 0; l--)
|
11
|
+
(c = h[l]) && (s = (p ? c(t, i, s) : c(s)) || s);
|
12
|
+
return p && s && k(t, i, s), s;
|
13
13
|
};
|
14
14
|
const a = class a extends m {
|
15
15
|
constructor() {
|
@@ -20,8 +20,8 @@ const a = class a extends m {
|
|
20
20
|
set onClick(t) {
|
21
21
|
if (!t) return;
|
22
22
|
this._onClick = t;
|
23
|
-
const i = (
|
24
|
-
t(
|
23
|
+
const i = (p) => {
|
24
|
+
t(p, this.href ?? this.route);
|
25
25
|
};
|
26
26
|
this._assertValidOnClick(t), this.removeEventListener("click", i), this.addEventListener("click", i);
|
27
27
|
}
|
@@ -58,7 +58,7 @@ const a = class a extends m {
|
|
58
58
|
@click=${this._preprocessOnClick}
|
59
59
|
download=${n(t ? this.download : void 0)}
|
60
60
|
href=${n(t ? this.href : void 0)}
|
61
|
-
id="
|
61
|
+
id="root"
|
62
62
|
rel=${n(t ? this.rel : void 0)}
|
63
63
|
target=${n(t ? this.target : void 0)}
|
64
64
|
title=${this.title}
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { SkfElement } from '@internal/components/skf-element.js';
|
2
2
|
import { type CSSResultGroup } from 'lit';
|
3
3
|
/**
|
4
|
-
* The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities
|
4
|
+
* The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities
|
5
5
|
*
|
6
|
-
* @documentation See [
|
6
|
+
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/8188a9-loader) for design principles
|
7
7
|
*
|
8
8
|
* @tagname skf-loader
|
9
9
|
*/
|
10
10
|
export declare class SkfLoader extends SkfElement {
|
11
|
+
#private;
|
11
12
|
static styles: CSSResultGroup;
|
13
|
+
/** Defines the aria-label */
|
12
14
|
ariaLabel: string;
|
13
15
|
/** If true, inverts the color (to be used on colored backgrounds) */
|
14
|
-
invert
|
15
|
-
/**
|
16
|
+
invert?: boolean;
|
17
|
+
/** Defines the size of the loader */
|
16
18
|
size?: 'md' | 'sm';
|
17
|
-
|
18
|
-
/** @internal */
|
19
|
-
private getCircle;
|
19
|
+
constructor();
|
20
20
|
render(): import("lit").TemplateResult<1>;
|
21
21
|
}
|
@@ -1,71 +1,45 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import m from "../../styles/component.styles.js";
|
4
|
-
import { svg as d, html as h } from "lit";
|
5
|
-
import { property as a } from "lit/decorators.js";
|
6
|
-
import v from "./loader.styles.js";
|
7
|
-
var f = Object.defineProperty, o = (l, t, i, g) => {
|
8
|
-
for (var e = void 0, s = l.length - 1, p; s >= 0; s--)
|
9
|
-
(p = l[s]) && (e = p(t, i, e) || e);
|
10
|
-
return e && f(t, i, e), e;
|
1
|
+
var m = (t) => {
|
2
|
+
throw TypeError(t);
|
11
3
|
};
|
12
|
-
|
4
|
+
var f = (t, r, e) => r.has(t) || m("Cannot " + e);
|
5
|
+
var p = (t, r, e) => (f(t, r, "read from private field"), e ? e.call(t) : r.get(t)), h = (t, r, e) => r.has(t) ? m("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), y = (t, r, e, l) => (f(t, r, "write to private field"), l ? l.call(t, e) : r.set(t, e), e);
|
6
|
+
import { SkfElement as u } from "../../internal/components/skf-element.js";
|
7
|
+
import b from "../../styles/component.styles.js";
|
8
|
+
import { html as g } from "lit";
|
9
|
+
import { property as n } from "lit/decorators.js";
|
10
|
+
import _ from "./loader.styles.js";
|
11
|
+
var x = Object.defineProperty, c = (t, r, e, l) => {
|
12
|
+
for (var i = void 0, a = t.length - 1, d; a >= 0; a--)
|
13
|
+
(d = t[a]) && (i = d(r, e, i) || i);
|
14
|
+
return i && x(r, e, i), i;
|
15
|
+
}, s;
|
16
|
+
const v = class v extends u {
|
13
17
|
constructor() {
|
14
|
-
super(
|
15
|
-
|
16
|
-
|
17
|
-
super.connectedCallback(), this.setAttribute("role", "progressbar"), this.setAttribute("aria-live", "polite");
|
18
|
-
}
|
19
|
-
/** @internal */
|
20
|
-
getCircle(t, i) {
|
21
|
-
return d`
|
22
|
-
<circle
|
23
|
-
cx=${t}
|
24
|
-
cy="26"
|
25
|
-
fill=${this.invert ? c.neutralWhite : c.brandBase}
|
26
|
-
key=${t}
|
27
|
-
r="6"
|
28
|
-
stroke="none"
|
29
|
-
>
|
30
|
-
<animate
|
31
|
-
attributeName="opacity"
|
32
|
-
begin=${i}
|
33
|
-
dur="1s"
|
34
|
-
repeatCount="indefinite"
|
35
|
-
values="0;1;0"
|
36
|
-
/>
|
37
|
-
</circle>
|
38
|
-
`;
|
18
|
+
super();
|
19
|
+
h(this, s);
|
20
|
+
this.ariaLabel = "Loading...", this.size = "md", y(this, s, this.attachInternals()), p(this, s).role = "progressbar", p(this, s).ariaLive = "polite";
|
39
21
|
}
|
40
22
|
render() {
|
41
|
-
return
|
42
|
-
<div
|
43
|
-
<
|
44
|
-
|
45
|
-
|
46
|
-
version="1.1"
|
47
|
-
viewBox="0 0 52 52"
|
48
|
-
width="100%"
|
49
|
-
x="0px"
|
50
|
-
y="0px"
|
51
|
-
>
|
52
|
-
${[this.getCircle(6, 0.1), this.getCircle(26, 0.2), this.getCircle(46, 0.3)]}
|
53
|
-
</svg>
|
23
|
+
return g`
|
24
|
+
<div id="root">
|
25
|
+
<div class="circle"></div>
|
26
|
+
<div class="circle"></div>
|
27
|
+
<div class="circle"></div>
|
54
28
|
</div>
|
55
29
|
`;
|
56
30
|
}
|
57
31
|
};
|
58
|
-
|
59
|
-
let
|
60
|
-
|
61
|
-
|
62
|
-
],
|
63
|
-
|
64
|
-
|
65
|
-
],
|
66
|
-
|
67
|
-
|
68
|
-
],
|
32
|
+
s = new WeakMap(), v.styles = [b, _];
|
33
|
+
let o = v;
|
34
|
+
c([
|
35
|
+
n({ reflect: !0, attribute: "aria-label" })
|
36
|
+
], o.prototype, "ariaLabel");
|
37
|
+
c([
|
38
|
+
n({ type: Boolean })
|
39
|
+
], o.prototype, "invert");
|
40
|
+
c([
|
41
|
+
n({ type: String, reflect: !0 })
|
42
|
+
], o.prototype, "size");
|
69
43
|
export {
|
70
|
-
|
44
|
+
o as SkfLoader
|
71
45
|
};
|
@@ -1,18 +1,50 @@
|
|
1
1
|
import { css as s } from "lit";
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
const e = s`
|
3
|
+
@layer components {
|
4
|
+
:host {
|
5
|
+
display: inline-flex;
|
6
|
+
}
|
7
|
+
|
8
|
+
#root {
|
9
|
+
display: flex;
|
10
|
+
gap: var(--_skf-loader-gap, var(--skf-spacing-50));
|
11
|
+
|
12
|
+
:host([size='sm']) & {
|
13
|
+
--_skf-loader-gap: var(--skf-spacing-25);
|
14
|
+
}
|
15
|
+
}
|
6
16
|
|
7
|
-
|
8
|
-
|
9
|
-
|
17
|
+
.circle {
|
18
|
+
animation: skf-loader 0.5s infinite ease-in alternate;
|
19
|
+
aspect-ratio: 1;
|
20
|
+
background-color: var(--_skf-loader-color, var(--skf-bg-color-emphasised));
|
21
|
+
border-radius: 50%;
|
22
|
+
inline-size: var(--_skf-loader-size, var(--skf-size-12));
|
23
|
+
|
24
|
+
&:nth-child(2) {
|
25
|
+
animation-delay: 0.1s;
|
26
|
+
}
|
27
|
+
|
28
|
+
&:nth-child(3) {
|
29
|
+
animation-delay: 0.2s;
|
30
|
+
}
|
31
|
+
|
32
|
+
:host([invert]) & {
|
33
|
+
--_skf-loader-color: var(--skf-bg-color-neutral-1);
|
34
|
+
}
|
35
|
+
|
36
|
+
:host([size='sm']) & {
|
37
|
+
--_skf-loader-size: var(--skf-size-4);
|
38
|
+
}
|
39
|
+
}
|
10
40
|
|
11
|
-
|
12
|
-
|
41
|
+
@keyframes skf-loader {
|
42
|
+
to {
|
43
|
+
opacity: 0;
|
44
|
+
}
|
13
45
|
}
|
14
46
|
}
|
15
47
|
`;
|
16
48
|
export {
|
17
|
-
|
49
|
+
e as default
|
18
50
|
};
|
@@ -10,10 +10,12 @@ import { type CSSResultGroup } from 'lit';
|
|
10
10
|
*/
|
11
11
|
export declare class SkfLogo extends SkfElement {
|
12
12
|
static styles: CSSResultGroup;
|
13
|
-
/**
|
13
|
+
/** Defines the title of the logo */
|
14
14
|
title: string;
|
15
|
-
/**
|
16
|
-
|
15
|
+
/**
|
16
|
+
* If defined, sets color of the logo
|
17
|
+
* @type { "primary" | "secondary" | "inverse" }
|
18
|
+
*/
|
17
19
|
color?: Logo;
|
18
20
|
render(): import("lit").TemplateResult<1>;
|
19
21
|
}
|