@skf-design-system/ui-components 1.0.0-beta.4 → 1.0.0-beta.7
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-item.d.ts +1 -1
- package/dist/components/accordion/accordion.component.d.ts +13 -9
- package/dist/components/accordion/accordion.component.js +34 -30
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/accordion.styles.d.ts +1 -2
- package/dist/components/accordion/accordion.styles.js +5 -4
- package/dist/components/alert/alert.component.d.ts +10 -7
- package/dist/components/alert/alert.component.js +50 -37
- package/dist/components/alert/alert.styles.d.ts +1 -2
- package/dist/components/alert/alert.styles.js +42 -34
- package/dist/components/button/button.component.d.ts +28 -4
- package/dist/components/button/button.component.js +80 -56
- package/dist/components/button/button.styles.js +2 -1
- package/dist/components/card/card.component.d.ts +1 -1
- package/dist/components/card/card.component.js +29 -21
- package/dist/components/card/card.styles.d.ts +1 -2
- package/dist/components/card/card.styles.js +22 -12
- package/dist/components/checkbox/checkbox.component.d.ts +20 -18
- package/dist/components/checkbox/checkbox.component.js +95 -89
- 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 +8 -5
- package/dist/components/collapse/collapse.component.js +50 -39
- package/dist/components/collapse/collapse.styles.js +13 -12
- package/dist/components/collapse/collapse.test.d.ts +1 -0
- package/dist/components/dialog/dialog.component.d.ts +75 -0
- package/dist/components/dialog/dialog.component.js +189 -0
- package/dist/components/dialog/dialog.d.ts +8 -0
- package/dist/components/dialog/dialog.js +6 -0
- package/dist/components/dialog/dialog.styles.d.ts +1 -0
- package/dist/components/dialog/dialog.styles.js +91 -0
- package/dist/components/divider/divider.component.d.ts +14 -11
- package/dist/components/divider/divider.component.js +46 -29
- package/dist/components/divider/divider.styles.d.ts +1 -2
- package/dist/components/divider/divider.styles.js +26 -30
- package/dist/components/heading/heading.component.d.ts +14 -4
- 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 +15 -9
- 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 +48 -33
- package/dist/components/input/input.component.js +108 -99
- package/dist/components/link/link.component.d.ts +20 -17
- package/dist/components/link/link.component.js +20 -14
- package/dist/components/link/link.styles.js +36 -40
- package/dist/components/loader/loader.component.d.ts +7 -7
- package/dist/components/loader/loader.component.js +42 -61
- package/dist/components/loader/loader.styles.js +44 -11
- package/dist/components/logo/logo.component.d.ts +7 -5
- package/dist/components/logo/logo.component.js +25 -14
- package/dist/components/logo/logo.styles.d.ts +1 -2
- package/dist/components/logo/logo.styles.js +12 -10
- package/dist/components/progress/progress.component.d.ts +22 -0
- package/dist/components/progress/progress.component.js +49 -0
- package/dist/components/progress/progress.d.ts +8 -0
- package/dist/components/progress/progress.js +6 -0
- package/dist/components/progress/progress.styles.d.ts +1 -0
- package/dist/components/progress/progress.styles.js +48 -0
- package/dist/components/radio/radio.component.d.ts +21 -21
- package/dist/components/radio/radio.component.js +94 -78
- package/dist/components/radio/radio.styles.js +6 -1
- package/dist/components/select/select.component.d.ts +14 -12
- package/dist/components/select/select.component.js +119 -103
- package/dist/components/select/select.controllers.d.ts +1 -1
- 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 +3 -3
- package/dist/components/select-option/select-option.component.js +16 -10
- package/dist/components/select-option/select-option.controllers.d.ts +1 -1
- package/dist/components/select-option-group/select-option-group.component.d.ts +1 -1
- package/dist/components/switch/switch.component.d.ts +4 -5
- package/dist/components/switch/switch.component.js +17 -7
- package/dist/components/switch/switch.styles.js +19 -11
- package/dist/components/switch/switch.test.d.ts +1 -0
- package/dist/components/tab/tab.component.d.ts +29 -0
- package/dist/components/tab/tab.component.js +57 -0
- package/dist/components/tab/tab.d.ts +8 -0
- package/dist/components/tab/tab.js +6 -0
- package/dist/components/tab/tab.styles.d.ts +1 -0
- package/dist/components/tab/tab.styles.js +123 -0
- package/dist/components/tab-group/tab-group.component.d.ts +43 -0
- package/dist/components/tab-group/tab-group.component.js +98 -0
- package/dist/components/tab-group/tab-group.d.ts +8 -0
- package/dist/components/tab-group/tab-group.js +6 -0
- package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
- package/dist/components/tab-group/tab-group.styles.js +75 -0
- package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
- package/dist/components/tab-panel/tab-panel.component.js +36 -0
- package/dist/components/tab-panel/tab-panel.d.ts +8 -0
- package/dist/components/tab-panel/tab-panel.js +6 -0
- package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
- package/dist/components/tab-panel/tab-panel.styles.js +13 -0
- package/dist/components/tag/tag.component.d.ts +14 -9
- package/dist/components/tag/tag.component.js +63 -47
- package/dist/components/tag/tag.styles.js +35 -28
- package/dist/components/textarea/textarea.component.d.ts +30 -27
- package/dist/components/textarea/textarea.component.js +20 -17
- 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.styles.d.ts +1 -0
- package/dist/components/toast/toast.styles.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.styles.d.ts +2 -0
- package/dist/components/toast-item/toast-item.styles.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.styles.d.ts +1 -0
- package/dist/components/toast-wrapper/toast-wrapper.styles.js +20 -0
- package/dist/custom-elements.json +3090 -1993
- package/dist/index.d.ts +6 -0
- package/dist/index.js +60 -42
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -11
- package/dist/internal/components/hint/hint.component.d.ts +2 -2
- package/dist/internal/components/hint/hint.component.js +12 -10
- package/dist/internal/components/hint/hint.styles.js +26 -10
- package/dist/internal/components/skf-element.js +26 -25
- package/dist/internal/helpers/hintSeverity.d.ts +1 -1
- package/dist/internal/helpers/watch.d.ts +27 -0
- package/dist/internal/helpers/watch.js +28 -0
- package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -8
- package/dist/internal/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +7 -6
- package/dist/react/index.d.ts +10 -3
- package/dist/react/index.js +10 -3
- package/dist/react/skf-button/index.d.ts +7 -1
- package/dist/react/skf-button/index.js +5 -1
- package/dist/react/skf-dialog/index.d.ts +15 -0
- package/dist/react/skf-dialog/index.js +19 -0
- package/dist/react/skf-progress/index.d.ts +3 -0
- package/dist/react/skf-progress/index.js +13 -0
- package/dist/react/skf-tab/index.d.ts +12 -0
- package/dist/react/skf-tab/index.js +18 -0
- package/dist/react/skf-tab-group/index.d.ts +3 -0
- package/dist/react/skf-tab-group/index.js +13 -0
- package/dist/react/skf-tab-panel/index.d.ts +3 -0
- package/dist/react/skf-tab-panel/index.js +13 -0
- 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/component.styles.js +15 -2
- package/dist/styles/form-field.styles.js +5 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +300 -117
- package/dist/types/vue/index.d.ts +266 -76
- package/dist/vscode.html-custom-data.json +349 -216
- package/dist/web-types.json +686 -292
- package/package.json +33 -32
@@ -1,21 +1,21 @@
|
|
1
|
-
import { SkfElement } from '
|
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
16
|
invert: boolean;
|
15
|
-
/**
|
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,52 @@
|
|
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 v = (r) => {
|
2
|
+
throw TypeError(r);
|
11
3
|
};
|
12
|
-
|
4
|
+
var f = (r, e, t) => e.has(r) || v("Cannot " + t);
|
5
|
+
var p = (r, e, t) => (f(r, e, "read from private field"), t ? t.call(r) : e.get(r)), h = (r, e, t) => e.has(r) ? v("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), u = (r, e, t, a) => (f(r, e, "write to private field"), a ? a.call(r, t) : e.set(r, t), t);
|
6
|
+
import { SkfElement as y } from "../../internal/components/skf-element.js";
|
7
|
+
import _ from "../../styles/component.styles.js";
|
8
|
+
import { html as b } from "lit";
|
9
|
+
import { property as n } from "lit/decorators.js";
|
10
|
+
import { classMap as g } from "lit/directives/class-map.js";
|
11
|
+
import z from "./loader.styles.js";
|
12
|
+
var x = Object.defineProperty, c = (r, e, t, a) => {
|
13
|
+
for (var i = void 0, o = r.length - 1, m; o >= 0; o--)
|
14
|
+
(m = r[o]) && (i = m(e, t, i) || i);
|
15
|
+
return i && x(e, t, i), i;
|
16
|
+
}, s;
|
17
|
+
const d = class d extends y {
|
13
18
|
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
|
-
`;
|
19
|
+
super();
|
20
|
+
h(this, s);
|
21
|
+
this.ariaLabel = "Loading...", this.invert = !1, this.size = "md", u(this, s, this.attachInternals()), p(this, s).role = "progressbar", p(this, s).ariaLive = "polite";
|
39
22
|
}
|
40
23
|
render() {
|
41
|
-
return
|
42
|
-
<div
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
>
|
52
|
-
${[this.getCircle(6, 0.1), this.getCircle(26, 0.2), this.getCircle(46, 0.3)]}
|
53
|
-
</svg>
|
24
|
+
return b`
|
25
|
+
<div
|
26
|
+
class=${g({
|
27
|
+
loader: !0,
|
28
|
+
"loader--invert": this.invert,
|
29
|
+
"loader--small": this.size === "sm"
|
30
|
+
})}
|
31
|
+
>
|
32
|
+
<div class="loader__circle"></div>
|
33
|
+
<div class="loader__circle"></div>
|
34
|
+
<div class="loader__circle"></div>
|
54
35
|
</div>
|
55
36
|
`;
|
56
37
|
}
|
57
38
|
};
|
58
|
-
|
59
|
-
let
|
60
|
-
|
61
|
-
|
62
|
-
],
|
63
|
-
|
64
|
-
|
65
|
-
],
|
66
|
-
|
67
|
-
|
68
|
-
],
|
39
|
+
s = new WeakMap(), d.styles = [_, z];
|
40
|
+
let l = d;
|
41
|
+
c([
|
42
|
+
n({ reflect: !0, attribute: "aria-label" })
|
43
|
+
], l.prototype, "ariaLabel");
|
44
|
+
c([
|
45
|
+
n({ type: Boolean })
|
46
|
+
], l.prototype, "invert");
|
47
|
+
c([
|
48
|
+
n({ type: String, reflect: !0 })
|
49
|
+
], l.prototype, "size");
|
69
50
|
export {
|
70
|
-
|
51
|
+
l as SkfLoader
|
71
52
|
};
|
@@ -1,18 +1,51 @@
|
|
1
|
-
import { css as
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
import { css as a } from "lit";
|
2
|
+
const s = a`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
4
|
+
@layer components {
|
5
|
+
:host {
|
6
|
+
display: inline-flex;
|
7
|
+
}
|
8
|
+
|
9
|
+
.loader {
|
10
|
+
display: flex;
|
11
|
+
gap: var(--_skf-loader-gap, var(--skf-spacing-50));
|
12
|
+
}
|
13
|
+
|
14
|
+
.loader--small {
|
15
|
+
--_skf-loader-gap: var(--skf-spacing-25);
|
16
|
+
}
|
6
17
|
|
7
|
-
|
8
|
-
|
9
|
-
|
18
|
+
.loader__circle {
|
19
|
+
animation: skf-loader 0.5s infinite ease-in alternate;
|
20
|
+
aspect-ratio: 1;
|
21
|
+
background-color: var(--_skf-loader-color, var(--skf-bg-color-emphasised));
|
22
|
+
border-radius: 50%;
|
23
|
+
inline-size: var(--_skf-loader-size, var(--skf-size-12));
|
24
|
+
|
25
|
+
&:nth-child(2) {
|
26
|
+
animation-delay: 0.1s;
|
27
|
+
}
|
28
|
+
|
29
|
+
&:nth-child(3) {
|
30
|
+
animation-delay: 0.2s;
|
31
|
+
}
|
32
|
+
|
33
|
+
.loader--invert & {
|
34
|
+
--_skf-loader-color: var(--skf-bg-color-neutral-1);
|
35
|
+
}
|
36
|
+
|
37
|
+
.loader--small & {
|
38
|
+
--_skf-loader-size: var(--skf-size-4);
|
39
|
+
}
|
40
|
+
}
|
10
41
|
|
11
|
-
|
12
|
-
|
42
|
+
@keyframes skf-loader {
|
43
|
+
to {
|
44
|
+
opacity: 0;
|
45
|
+
}
|
13
46
|
}
|
14
47
|
}
|
15
48
|
`;
|
16
49
|
export {
|
17
|
-
|
50
|
+
s as default
|
18
51
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SkfElement } from '
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
2
|
import type { Logo } from '@skf-design-system/ui-assets';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
4
|
/**
|
@@ -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
|
-
|
17
|
-
|
15
|
+
/**
|
16
|
+
* Defines the color of the logo
|
17
|
+
* @type { "primary" | "secondary" | "inverse" }
|
18
|
+
*/
|
19
|
+
color: Logo;
|
18
20
|
render(): import("lit").TemplateResult<1>;
|
19
21
|
}
|
@@ -1,20 +1,31 @@
|
|
1
1
|
import { SkfElement as i } from "../../internal/components/skf-element.js";
|
2
2
|
import m from "../../styles/component.styles.js";
|
3
3
|
import { html as n } from "lit";
|
4
|
-
import { property as
|
5
|
-
import a from "
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
import { property as p } from "lit/decorators.js";
|
5
|
+
import { classMap as a } from "lit/directives/class-map.js";
|
6
|
+
import { styles as d } from "./logo.styles.js";
|
7
|
+
var g = Object.defineProperty, v = (e, l, s, y) => {
|
8
|
+
for (var c = void 0, r = e.length - 1, h; r >= 0; r--)
|
9
|
+
(h = e[r]) && (c = h(l, s, c) || c);
|
10
|
+
return c && g(l, s, c), c;
|
10
11
|
};
|
11
|
-
const
|
12
|
+
const o = class o extends i {
|
12
13
|
constructor() {
|
13
14
|
super(...arguments), this.title = "SKF logotype", this.color = "primary";
|
14
15
|
}
|
15
16
|
render() {
|
16
17
|
return n`
|
17
|
-
<svg
|
18
|
+
<svg
|
19
|
+
class=${a({
|
20
|
+
logo: !0,
|
21
|
+
"logo--color-inverse": this.color === "inverse",
|
22
|
+
"logo--color-secondary": this.color === "secondary"
|
23
|
+
})}
|
24
|
+
viewBox="0 0 1300 300"
|
25
|
+
xmlns="http://www.w3.org/2000/svg"
|
26
|
+
x="0px"
|
27
|
+
y="0px"
|
28
|
+
>
|
18
29
|
<title>${this.title}</title>
|
19
30
|
<g>
|
20
31
|
<g>
|
@@ -55,13 +66,13 @@ c0,5.8-4.3,6.1-9.1,6.1H1230.9z"
|
|
55
66
|
`;
|
56
67
|
}
|
57
68
|
};
|
58
|
-
|
59
|
-
let t =
|
60
|
-
|
61
|
-
|
69
|
+
o.styles = [m, d];
|
70
|
+
let t = o;
|
71
|
+
v([
|
72
|
+
p()
|
62
73
|
], t.prototype, "title");
|
63
|
-
|
64
|
-
|
74
|
+
v([
|
75
|
+
p()
|
65
76
|
], t.prototype, "color");
|
66
77
|
export {
|
67
78
|
t as SkfLogo
|
@@ -1,2 +1 @@
|
|
1
|
-
declare const
|
2
|
-
export default _default;
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -1,23 +1,25 @@
|
|
1
1
|
import { css as o } from "lit";
|
2
|
-
const
|
2
|
+
const s = o`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
4
|
+
|
3
5
|
:host {
|
4
|
-
display:
|
6
|
+
display: inline-flex;
|
5
7
|
}
|
6
8
|
|
7
|
-
|
9
|
+
.logo {
|
8
10
|
aspect-ratio: 13 / 3;
|
9
11
|
block-size: var(--skf-logo-height, var(--skf-size-32));
|
10
12
|
fill: var(--_skf-logo-color, var(--skf-logo-primary));
|
13
|
+
}
|
11
14
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
+
.logo--color-secondary {
|
16
|
+
--_skf-logo-color: var(--skf-logo-secondary);
|
17
|
+
}
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
}
|
19
|
+
.logo--color-inverse {
|
20
|
+
--_skf-logo-color: var(--skf-logo-inverse);
|
19
21
|
}
|
20
22
|
`;
|
21
23
|
export {
|
22
|
-
|
24
|
+
s as styles
|
23
25
|
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element';
|
2
|
+
import { type CSSResultGroup } from 'lit';
|
3
|
+
/**
|
4
|
+
* The `<skf-progress>` element displays an indicator showing the completion progress of a task, typically displayed as a progress bar
|
5
|
+
*
|
6
|
+
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
7
|
+
*
|
8
|
+
* @tagname skf-progress
|
9
|
+
*/
|
10
|
+
export declare class SkfProgress extends SkfElement {
|
11
|
+
#private;
|
12
|
+
static styles: CSSResultGroup;
|
13
|
+
static formAssociated: boolean;
|
14
|
+
/** If true, the progress-bar's fill value is animated */
|
15
|
+
animated: boolean;
|
16
|
+
/** Describes how much work the task indicated by the progress element requires */
|
17
|
+
max: number;
|
18
|
+
/** Specifies how much of the task that has been completed */
|
19
|
+
value: number;
|
20
|
+
constructor();
|
21
|
+
render(): import("lit").TemplateResult<1>;
|
22
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
var h = (t) => {
|
2
|
+
throw TypeError(t);
|
3
|
+
};
|
4
|
+
var f = (t, e, r) => e.has(t) || h("Cannot " + r);
|
5
|
+
var c = (t, e, r) => (f(t, e, "read from private field"), r ? r.call(t) : e.get(t)), d = (t, e, r) => e.has(t) ? h("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), v = (t, e, r, p) => (f(t, e, "write to private field"), p ? p.call(t, r) : e.set(t, r), r);
|
6
|
+
import { SkfElement as y } from "../../internal/components/skf-element.js";
|
7
|
+
import x from "../../styles/component.styles.js";
|
8
|
+
import { html as b } from "lit";
|
9
|
+
import { property as l } from "lit/decorators.js";
|
10
|
+
import { classMap as _ } from "lit/directives/class-map.js";
|
11
|
+
import { styles as g } from "./progress.styles.js";
|
12
|
+
var N = Object.defineProperty, n = (t, e, r, p) => {
|
13
|
+
for (var s = void 0, m = t.length - 1, u; m >= 0; m--)
|
14
|
+
(u = t[m]) && (s = u(e, r, s) || s);
|
15
|
+
return s && N(e, r, s), s;
|
16
|
+
}, o;
|
17
|
+
const i = class i extends y {
|
18
|
+
constructor() {
|
19
|
+
super();
|
20
|
+
d(this, o);
|
21
|
+
this.animated = !1, this.max = 1, this.value = 0, v(this, o, this.attachInternals()), c(this, o).role = "progressbar";
|
22
|
+
}
|
23
|
+
render() {
|
24
|
+
const r = this.value / this.max * 100;
|
25
|
+
return b`
|
26
|
+
<div
|
27
|
+
class=${_({
|
28
|
+
progress: !0,
|
29
|
+
"progress--animated": this.animated
|
30
|
+
})}
|
31
|
+
style="--_skf-progress-value: ${r}%"
|
32
|
+
></div>
|
33
|
+
`;
|
34
|
+
}
|
35
|
+
};
|
36
|
+
o = new WeakMap(), i.styles = [x, g], i.formAssociated = !0;
|
37
|
+
let a = i;
|
38
|
+
n([
|
39
|
+
l({ type: Boolean, reflect: !0 })
|
40
|
+
], a.prototype, "animated");
|
41
|
+
n([
|
42
|
+
l({ type: Number })
|
43
|
+
], a.prototype, "max");
|
44
|
+
n([
|
45
|
+
l({ type: Number })
|
46
|
+
], a.prototype, "value");
|
47
|
+
export {
|
48
|
+
a as SkfProgress
|
49
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { css as r } from "lit";
|
2
|
+
const s = r`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
4
|
+
@layer components {
|
5
|
+
.progress {
|
6
|
+
background: var(--skf-bg-color-neutral-3);
|
7
|
+
block-size: var(--skf-size-8);
|
8
|
+
border-radius: 0.25rem; /* Missing token */
|
9
|
+
overflow: hidden;
|
10
|
+
|
11
|
+
&::after {
|
12
|
+
background-color: var(--skf-bg-color-emphasised);
|
13
|
+
block-size: inherit;
|
14
|
+
border-radius: inherit;
|
15
|
+
content: '';
|
16
|
+
display: block;
|
17
|
+
inline-size: var(--_skf-progress-value, auto);
|
18
|
+
transition: inline-size calc(var(--skf-motion-duration-slow) * 1ms)
|
19
|
+
cubic-bezier(0.4, 0.93, 0.71, 0.89);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
.progress--animated::after {
|
24
|
+
animation: skf-progress-animation calc(var(--skf-motion-duration-slow) * 1ms) linear infinite
|
25
|
+
reverse;
|
26
|
+
background-image: linear-gradient(
|
27
|
+
-45deg,
|
28
|
+
rgba(255 255 255 / 20%) 25%,
|
29
|
+
transparent 25%,
|
30
|
+
transparent 50%,
|
31
|
+
rgba(255 255 255 / 20%) 50%,
|
32
|
+
rgba(255 255 255 / 20%) 75%,
|
33
|
+
transparent 75%,
|
34
|
+
transparent
|
35
|
+
);
|
36
|
+
background-size: 50px 50px;
|
37
|
+
}
|
38
|
+
|
39
|
+
@keyframes skf-progress-animation {
|
40
|
+
to {
|
41
|
+
background-position: 50px 50px;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
`;
|
46
|
+
export {
|
47
|
+
s as styles
|
48
|
+
};
|
@@ -1,44 +1,44 @@
|
|
1
|
-
import '
|
2
|
-
import { FormBase } from '
|
3
|
-
import type { FormFieldBaseProps } from '
|
1
|
+
import '../icon/icon.js';
|
2
|
+
import { FormBase } from '../../internal/components/formBase.js';
|
3
|
+
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
4
4
|
import { type CSSResultGroup } from 'lit';
|
5
5
|
/**
|
6
6
|
* The `<skf-radio>` component is used to create a radio input
|
7
7
|
*
|
8
|
-
* @documentation See [
|
8
|
+
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/78d5dd-radio-button) for design principles
|
9
9
|
*
|
10
10
|
* @attribute {boolean} disabled - If true, sets disabled state
|
11
11
|
* @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
|
12
12
|
*
|
13
13
|
* @event change {object} - When the value of the input changes
|
14
14
|
*
|
15
|
-
* @slot
|
15
|
+
* @slot - The radios label. Alternatively, you can use the `label` attribute.
|
16
16
|
*
|
17
17
|
* @tagname skf-radio
|
18
18
|
*/
|
19
19
|
export declare class SkfRadio extends FormBase implements FormFieldBaseProps {
|
20
20
|
static styles: CSSResultGroup;
|
21
|
-
/** @internal */
|
22
21
|
private _initialChecked;
|
23
|
-
/** If
|
24
|
-
debug?: boolean
|
22
|
+
/** If true, outputs helping hints in console */
|
23
|
+
debug?: boolean;
|
25
24
|
/** If true, outputs helping hints in console */
|
26
25
|
checked?: boolean;
|
27
26
|
/** If true, forces component to invalid state until removed */
|
28
27
|
customInvalid?: boolean;
|
29
|
-
/** If
|
30
|
-
hideLabel: boolean;
|
31
|
-
/** The input's label. Alternatively, you can use the `label` attribute. */
|
28
|
+
/** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
|
32
29
|
label?: string;
|
33
|
-
/** If
|
30
|
+
/** If defined, adds name to the input-element */
|
34
31
|
name?: string;
|
35
|
-
/** If
|
32
|
+
/** If defined, renders an alternative A11y text for the asterisk */
|
36
33
|
requiredLabel?: string;
|
37
|
-
/**
|
38
|
-
size
|
39
|
-
/**
|
34
|
+
/** Size of the Radio */
|
35
|
+
size: 'sm' | 'md';
|
36
|
+
/**
|
37
|
+
* If defined, displays provided severity state
|
38
|
+
* @type {"success" | "info" | "warning" | "alert"}
|
39
|
+
*/
|
40
40
|
severity?: FormFieldBaseProps['severity'];
|
41
|
-
/** If
|
41
|
+
/** If true, displays valid state after interaction */
|
42
42
|
showValid?: boolean;
|
43
43
|
/** The current value of the input field */
|
44
44
|
value: string;
|
@@ -48,11 +48,11 @@ export declare class SkfRadio extends FormBase implements FormFieldBaseProps {
|
|
48
48
|
/** @internal */
|
49
49
|
private $input?;
|
50
50
|
connectedCallback(): void;
|
51
|
-
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
52
51
|
protected firstUpdated(): void;
|
53
|
-
|
54
|
-
|
55
|
-
|
52
|
+
handleInvalidChange(): void;
|
53
|
+
handleDebugInvalid(): void;
|
54
|
+
handleCheckedChanged(): void;
|
55
|
+
handleCustomInvalidChange(): void;
|
56
56
|
/** @internal */
|
57
57
|
private _resetValue;
|
58
58
|
/** @internal */
|