@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,37 +1,54 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import { html as c } from "lit";
|
4
|
-
import { property as o } from "lit/decorators.js";
|
5
|
-
import { when as d } from "lit/directives/when.js";
|
6
|
-
import f from "./divider.styles.js";
|
7
|
-
var v = Object.defineProperty, i = (s, l, n, u) => {
|
8
|
-
for (var r = void 0, t = s.length - 1, p; t >= 0; t--)
|
9
|
-
(p = s[t]) && (r = p(l, n, r) || r);
|
10
|
-
return r && v(l, n, r), r;
|
1
|
+
var h = (r) => {
|
2
|
+
throw TypeError(r);
|
11
3
|
};
|
12
|
-
|
4
|
+
var m = (r, e, t) => e.has(r) || h("Cannot " + t);
|
5
|
+
var c = (r, e, t) => (m(r, e, "read from private field"), t ? t.call(r) : e.get(r)), f = (r, e, t) => e.has(r) ? h("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), y = (r, e, t, a) => (m(r, e, "write to private field"), a ? a.call(r, t) : e.set(r, t), t);
|
6
|
+
import { SkfElement as u } from "../../internal/components/skf-element.js";
|
7
|
+
import b from "../../styles/component.styles.js";
|
8
|
+
import { html as C } from "lit";
|
9
|
+
import { property as n } from "lit/decorators.js";
|
10
|
+
import { classMap as _ } from "lit/directives/class-map.js";
|
11
|
+
import { styles as x } from "./divider.styles.js";
|
12
|
+
var B = Object.defineProperty, p = (r, e, t, a) => {
|
13
|
+
for (var o = void 0, l = r.length - 1, v; l >= 0; l--)
|
14
|
+
(v = r[l]) && (o = v(e, t, o) || o);
|
15
|
+
return o && B(e, t, o), o;
|
16
|
+
}, i;
|
17
|
+
const d = class d extends u {
|
13
18
|
constructor() {
|
14
|
-
super(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
super();
|
20
|
+
f(this, i);
|
21
|
+
this.color = "primary", this.decorative = !1, this.vertical = !1, y(this, i, this.attachInternals());
|
22
|
+
}
|
23
|
+
connectedCallback() {
|
24
|
+
super.connectedCallback(), c(this, i).role = this.decorative ? "generic" : "separator", c(this, i).ariaOrientation = this.vertical ? "vertical" : "horizontal";
|
19
25
|
}
|
20
26
|
render() {
|
21
|
-
return
|
27
|
+
return C`
|
28
|
+
<div
|
29
|
+
class=${_({
|
30
|
+
divider: !0,
|
31
|
+
"divider--color-emphasised": this.color === "emphasised",
|
32
|
+
"divider--color-inverse": this.color === "inverse",
|
33
|
+
"divider--color-secondary": this.color === "secondary",
|
34
|
+
"divider--color-tertiary": this.color === "tertiary",
|
35
|
+
"divider--vertical": this.vertical
|
36
|
+
})}
|
37
|
+
></div>
|
38
|
+
`;
|
22
39
|
}
|
23
40
|
};
|
24
|
-
|
25
|
-
let
|
26
|
-
|
27
|
-
|
28
|
-
],
|
29
|
-
|
30
|
-
|
31
|
-
],
|
32
|
-
|
33
|
-
|
34
|
-
],
|
41
|
+
i = new WeakMap(), d.styles = [b, x];
|
42
|
+
let s = d;
|
43
|
+
p([
|
44
|
+
n({ reflect: !0 })
|
45
|
+
], s.prototype, "color");
|
46
|
+
p([
|
47
|
+
n({ type: Boolean })
|
48
|
+
], s.prototype, "decorative");
|
49
|
+
p([
|
50
|
+
n({ type: Boolean, reflect: !0 })
|
51
|
+
], s.prototype, "vertical");
|
35
52
|
export {
|
36
|
-
|
53
|
+
s as SkfDivider
|
37
54
|
};
|
@@ -1,2 +1 @@
|
|
1
|
-
declare const
|
2
|
-
export default _default;
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -1,47 +1,43 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
#divider {
|
8
|
-
--_skf-divider-border-color: var(--skf-border-color-primary);
|
9
|
-
--_skf-divider-border: var(--skf-border-width-sm) solid var(--_skf-divider-border-color);
|
2
|
+
const d = r`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
4
|
+
.divider {
|
5
|
+
--_skf-divider-border: var(--skf-border-width-sm) solid
|
6
|
+
var(--_skf-divider-border-color, var(--skf-border-color-primary));
|
10
7
|
|
11
8
|
display: block;
|
12
9
|
|
13
|
-
|
10
|
+
&:not(.divider--vertical) {
|
14
11
|
border-top: var(--_skf-divider-border);
|
15
12
|
margin-block: var(--skf-divider-spacing, var(--skf-spacing-100));
|
16
13
|
margin-inline: var(--skf-divider-inset, 0);
|
17
14
|
}
|
15
|
+
}
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
17
|
+
.divider--vertical {
|
18
|
+
block-size: 100%;
|
19
|
+
border-left: var(--_skf-divider-border);
|
20
|
+
margin-block: var(--skf-divider-inset, 0);
|
21
|
+
margin-inline: var(--skf-divider-spacing, var(--skf-spacing-100));
|
22
|
+
}
|
26
23
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
/** Colors */
|
25
|
+
.divider--color-emphasised {
|
26
|
+
--_skf-divider-border-color: var(--skf-border-color-emphasised);
|
27
|
+
}
|
31
28
|
|
32
|
-
|
33
|
-
|
34
|
-
|
29
|
+
.divider--color-inverse {
|
30
|
+
--_skf-divider-border-color: var(--skf-border-color-inverse);
|
31
|
+
}
|
35
32
|
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
.divider--color-secondary {
|
34
|
+
--_skf-divider-border-color: var(--skf-border-color-secondary);
|
35
|
+
}
|
39
36
|
|
40
|
-
|
41
|
-
|
42
|
-
}
|
37
|
+
.divider--color-tertiary {
|
38
|
+
--_skf-divider-border-color: var(--skf-border-color-tertiary);
|
43
39
|
}
|
44
40
|
`;
|
45
41
|
export {
|
46
|
-
|
42
|
+
d as styles
|
47
43
|
};
|
@@ -1,17 +1,27 @@
|
|
1
|
-
import { SkfElement } from '
|
2
|
-
import type { HeadingType } from '
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
|
+
import type { HeadingType } from '../../internal/constants/heading.js';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
4
|
/**
|
5
5
|
* The `<Heading>` component is to deliniate content on a page. When using, take note not to skip heading levels.<br>
|
6
6
|
* It extends the interface of native html `<h1>` to `<h4>` elements.
|
7
7
|
*
|
8
|
+
* @slot - The headings content
|
9
|
+
*
|
8
10
|
* @tagname skf-heading
|
9
11
|
*/
|
10
12
|
export declare class SkfHeading extends SkfElement {
|
11
13
|
static styles: CSSResultGroup;
|
12
|
-
/**
|
14
|
+
/**
|
15
|
+
* Controls which heading element will be rendered. Should not be used to affect appearance
|
16
|
+
*
|
17
|
+
* @type { "h1" | "h2" | "h3" | "h4" }
|
18
|
+
*/
|
13
19
|
as: HeadingType;
|
14
|
-
/**
|
20
|
+
/**
|
21
|
+
* If provided, changes the appearance of the heading
|
22
|
+
*
|
23
|
+
* @type { "h1" | "h2" | "h3" | "h4" }
|
24
|
+
*/
|
15
25
|
styledAs?: HeadingType;
|
16
26
|
render(): import("lit").TemplateResult;
|
17
27
|
}
|
@@ -1,32 +1,32 @@
|
|
1
|
-
import { SkfElement as
|
1
|
+
import { SkfElement as n } from "../../internal/components/skf-element.js";
|
2
2
|
import u from "../../styles/component.styles.js";
|
3
3
|
import "lit";
|
4
4
|
import { property as a } from "lit/decorators.js";
|
5
|
-
import { html as
|
6
|
-
import
|
7
|
-
var
|
8
|
-
for (var t = void 0,
|
9
|
-
(m = o[
|
10
|
-
return t &&
|
5
|
+
import { html as y, unsafeStatic as l } from "lit/static-html.js";
|
6
|
+
import c from "./heading.styles.js";
|
7
|
+
var h = Object.defineProperty, f = (o, p, i, d) => {
|
8
|
+
for (var t = void 0, s = o.length - 1, m; s >= 0; s--)
|
9
|
+
(m = o[s]) && (t = m(p, i, t) || t);
|
10
|
+
return t && h(p, i, t), t;
|
11
11
|
};
|
12
|
-
const
|
12
|
+
const e = class e extends n {
|
13
13
|
constructor() {
|
14
14
|
super(...arguments), this.as = "h1";
|
15
15
|
}
|
16
16
|
render() {
|
17
|
-
return
|
18
|
-
<${l(this.as)} id="
|
17
|
+
return y`
|
18
|
+
<${l(this.as)} id="root">
|
19
19
|
<slot></slot>
|
20
20
|
</${l(this.as)}>
|
21
21
|
`;
|
22
22
|
}
|
23
23
|
};
|
24
|
-
|
25
|
-
let r =
|
26
|
-
|
24
|
+
e.styles = [u, c];
|
25
|
+
let r = e;
|
26
|
+
f([
|
27
27
|
a({ reflect: !0 })
|
28
28
|
], r.prototype, "as");
|
29
|
-
|
29
|
+
f([
|
30
30
|
a({ attribute: "styled-as" })
|
31
31
|
], r.prototype, "styledAs");
|
32
32
|
export {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SkfElement } from '
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
2
|
import { type Icon, type IconColor, type IconSize, type SeverityFgColor } from '@skf-design-system/ui-assets';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
4
|
/**
|
@@ -10,19 +10,25 @@ import { type CSSResultGroup } from 'lit';
|
|
10
10
|
*/
|
11
11
|
export declare class SkfIcon extends SkfElement {
|
12
12
|
static styles: CSSResultGroup;
|
13
|
-
/** @internal */
|
14
13
|
private _rootId;
|
15
|
-
/**
|
16
|
-
|
17
|
-
|
14
|
+
/**
|
15
|
+
* Sets the color of the icon
|
16
|
+
* @type { "primary" | "inverse" | "emphasised" | "secondary" | "success" | "info" | "warning" | "error" | "alert" }
|
17
|
+
*/
|
18
|
+
color: IconColor | SeverityFgColor;
|
19
|
+
/** If defined, adds an alternate description to use for assistive devices */
|
18
20
|
label?: string;
|
19
|
-
/**
|
21
|
+
/**
|
22
|
+
* Name of the icon to display
|
23
|
+
* @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" }
|
24
|
+
*/
|
20
25
|
name: Icon;
|
21
|
-
/**
|
26
|
+
/**
|
27
|
+
* Size of the icon
|
28
|
+
* @type { "xs" | "sm" | "md" | "lg" }
|
29
|
+
*/
|
22
30
|
size?: IconSize;
|
23
|
-
/** @internal */
|
24
31
|
private renderDecorativeIcon;
|
25
|
-
/** @internal */
|
26
32
|
private renderInformativeIcon;
|
27
33
|
render(): import("lit").TemplateResult<1>;
|
28
34
|
}
|
@@ -5,15 +5,15 @@ import { html as l } from "lit";
|
|
5
5
|
import { property as t } from "lit/decorators.js";
|
6
6
|
import { ifDefined as c } from "lit/directives/if-defined.js";
|
7
7
|
import { when as v } from "lit/directives/when.js";
|
8
|
-
import
|
9
|
-
var
|
8
|
+
import u from "./icon.styles.js";
|
9
|
+
var y = Object.defineProperty, o = (m, n, p, I) => {
|
10
10
|
for (var r = void 0, i = m.length - 1, a; i >= 0; i--)
|
11
11
|
(a = m[i]) && (r = a(n, p, r) || r);
|
12
|
-
return r &&
|
12
|
+
return r && y(n, p, r), r;
|
13
13
|
};
|
14
14
|
const s = class s extends f {
|
15
15
|
constructor() {
|
16
|
-
super(...arguments), this._rootId = "
|
16
|
+
super(...arguments), this._rootId = "root", this.color = "primary", this.size = "md", this.renderDecorativeIcon = () => l`
|
17
17
|
<div aria-hidden="true" id=${this._rootId}>${d[this.name]}</div>
|
18
18
|
`, this.renderInformativeIcon = () => l`
|
19
19
|
<div aria-label=${c(this.label)} id=${this._rootId} role="img">${d[this.name]}</div>
|
@@ -23,7 +23,7 @@ const s = class s extends f {
|
|
23
23
|
return v(!!this.label, this.renderInformativeIcon, this.renderDecorativeIcon);
|
24
24
|
}
|
25
25
|
};
|
26
|
-
s.styles = [h,
|
26
|
+
s.styles = [h, u];
|
27
27
|
let e = s;
|
28
28
|
o([
|
29
29
|
t({ reflect: !0 })
|
@@ -32,7 +32,7 @@ o([
|
|
32
32
|
t()
|
33
33
|
], e.prototype, "label");
|
34
34
|
o([
|
35
|
-
t(
|
35
|
+
t()
|
36
36
|
], e.prototype, "name");
|
37
37
|
o([
|
38
38
|
t({ reflect: !0 })
|
@@ -1,73 +1,75 @@
|
|
1
1
|
import { css as o } from "lit";
|
2
2
|
const r = o`
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
@layer components {
|
4
|
+
:host {
|
5
|
+
display: inline-flex;
|
6
|
+
}
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
#root {
|
9
|
+
--_skf-icon-size: var(--skf-icon-size-md);
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
block-size: var(--_skf-icon-size);
|
12
|
+
color: var(--_skf-icon-color, var(--skf-icon-color-primary));
|
13
|
+
display: inline-flex;
|
14
|
+
flex-shrink: 0; /* Prevents shrink when flex-child */
|
15
|
+
inline-size: var(--_skf-icon-size);
|
16
|
+
pointer-events: none;
|
17
|
+
user-select: none;
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
:host-context(.skf-icon-host) & {
|
20
|
+
color: inherit;
|
21
|
+
}
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
/**
|
24
|
+
* Colors
|
25
|
+
*/
|
26
|
+
:host([color='secondary']) & {
|
27
|
+
--_skf-icon-color: var(--skf-icon-color-secondary);
|
28
|
+
}
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
:host([color='inverse']) & {
|
31
|
+
--_skf-icon-color: var(--skf-icon-color-inverse);
|
32
|
+
}
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
:host([color='emphasised']) & {
|
35
|
+
--_skf-icon-color: var(--skf-icon-color-emphasised);
|
36
|
+
}
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
/* Severity */
|
39
|
+
:host([color='alert']) & {
|
40
|
+
--_skf-icon-color: var(--skf-severity-fg-color-alert);
|
41
|
+
}
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
:host([color='error']) & {
|
44
|
+
--_skf-icon-color: var(--skf-severity-fg-color-error);
|
45
|
+
}
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
:host([color='info']) & {
|
48
|
+
--_skf-icon-color: var(--skf-severity-fg-color-info);
|
49
|
+
}
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
:host([color='success']) & {
|
52
|
+
--_skf-icon-color: var(--skf-severity-fg-color-success);
|
53
|
+
}
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
:host([color='warning']) & {
|
56
|
+
--_skf-icon-color: var(--skf-severity-fg-color-warning);
|
57
|
+
}
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
59
|
+
/**
|
60
|
+
* Sizes
|
61
|
+
*/
|
62
|
+
:host([size='xs']) & {
|
63
|
+
--_skf-icon-size: var(--skf-icon-size-xs);
|
64
|
+
}
|
64
65
|
|
65
|
-
|
66
|
-
|
67
|
-
|
66
|
+
:host([size='sm']) & {
|
67
|
+
--_skf-icon-size: var(--skf-icon-size-sm);
|
68
|
+
}
|
68
69
|
|
69
|
-
|
70
|
-
|
70
|
+
:host([size='lg']) & {
|
71
|
+
--_skf-icon-size: var(--skf-icon-size-lg);
|
72
|
+
}
|
71
73
|
}
|
72
74
|
}
|
73
75
|
`;
|
@@ -1,8 +1,9 @@
|
|
1
|
-
import '
|
2
|
-
import { FormBase } from '
|
3
|
-
import '
|
4
|
-
import type { FormFieldBaseProps } from '
|
1
|
+
import '../icon/icon.js';
|
2
|
+
import { FormBase } from '../../internal/components/formBase.js';
|
3
|
+
import '../../internal/components/hint/hint';
|
4
|
+
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
5
5
|
import { type CSSResultGroup } from 'lit';
|
6
|
+
type AutocompleteValues = 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-amount' | 'transaction-currency' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'url' | 'photo' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'email' | 'impp' | 'password' | 'webauthn' | 'work' | (string & {});
|
6
7
|
/**
|
7
8
|
* The skf-text-field is used to create a text input field. It can be used inside a form element or standalone.
|
8
9
|
*
|
@@ -14,7 +15,7 @@ import { type CSSResultGroup } from 'lit';
|
|
14
15
|
* @event change - Fires when the value of the input changes
|
15
16
|
* @event invalid - Fires when the input is invalid
|
16
17
|
*
|
17
|
-
* @slot
|
18
|
+
* @slot - The Inputs label. Alternatively, you can use the `label` attribute.
|
18
19
|
*
|
19
20
|
* @tagname skf-input
|
20
21
|
*
|
@@ -24,57 +25,69 @@ import { type CSSResultGroup } from 'lit';
|
|
24
25
|
export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
25
26
|
static styles: CSSResultGroup;
|
26
27
|
private customError;
|
27
|
-
/**
|
28
|
+
/**
|
29
|
+
* Specifies what permission the browser has to provide assistance in filling out form field values. Refer to
|
30
|
+
* [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.
|
31
|
+
* @type { -m }
|
32
|
+
*/
|
33
|
+
autocomplete?: AutocompleteValues;
|
34
|
+
/** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
|
28
35
|
buttonAriaLabelClear: string;
|
29
|
-
/**
|
36
|
+
/** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
|
30
37
|
buttonAriaLabelHide: string;
|
31
|
-
/**
|
38
|
+
/** Custom aria-label for the visibility button **Notice!** Only applicable to type=password. */
|
32
39
|
buttonAriaLabelShow: string;
|
33
|
-
/** If
|
40
|
+
/** If defined, forces component to invalid state until removed. Its value is used as hint text. */
|
34
41
|
set customInvalid(value: string | undefined);
|
35
42
|
get customInvalid(): string | undefined;
|
36
|
-
/** If
|
37
|
-
debug
|
43
|
+
/** If true, outputs helping hints in console */
|
44
|
+
debug?: boolean;
|
38
45
|
/** If true, hides the label visually */
|
39
|
-
hideLabel
|
40
|
-
/** If
|
46
|
+
hideLabel?: boolean;
|
47
|
+
/** If defined, displays informational text below the field */
|
41
48
|
hint?: string;
|
42
|
-
/**
|
49
|
+
/** Tells what keyboard to use if applicable */
|
43
50
|
inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
44
|
-
/**
|
51
|
+
/** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
|
45
52
|
label?: string;
|
46
|
-
/** If
|
53
|
+
/** If defined, displays a prefix/adornment before the input-element */
|
47
54
|
leading?: string;
|
48
|
-
/** If
|
55
|
+
/** If defined, sets the maximum value to accept for this input */
|
49
56
|
max?: number | string;
|
50
|
-
/** If
|
57
|
+
/** If defined, sets the maximum character length to accept for this input */
|
51
58
|
maxLength?: number;
|
52
|
-
/** If
|
59
|
+
/** If defined, sets the minimum value to accept for this input */
|
53
60
|
min?: number | string;
|
54
|
-
/** If
|
61
|
+
/** If defined, sets the minimum character length to accept for this input */
|
55
62
|
minLength?: number;
|
56
|
-
/** If
|
63
|
+
/** If defined, adds name to the input-element */
|
57
64
|
name?: string;
|
58
|
-
/** If
|
65
|
+
/** If defined, adds name to the input-element */
|
59
66
|
pattern?: string;
|
60
|
-
/** If
|
67
|
+
/** If defined, displays placeholder text */
|
61
68
|
placeholder?: string;
|
62
69
|
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
63
70
|
readonly?: boolean;
|
64
|
-
/** If
|
71
|
+
/** If defined, renders an alternative A11y text for the asterisk */
|
65
72
|
requiredLabel?: string;
|
66
|
-
/**
|
73
|
+
/**
|
74
|
+
* If defined, displays provided severity state
|
75
|
+
* @type { "alert" | "success" | "info" | "warning" }
|
76
|
+
*/
|
67
77
|
severity?: FormFieldBaseProps['severity'];
|
68
|
-
/** If
|
78
|
+
/** If true, displays valid state after interaction */
|
69
79
|
showValid?: boolean;
|
70
|
-
/**
|
71
|
-
size
|
72
|
-
/** If
|
80
|
+
/** Size of the input */
|
81
|
+
size: 'sm' | 'md';
|
82
|
+
/** If defined, displays a suffix/adornment after the input-element */
|
73
83
|
trailing?: string;
|
74
|
-
/**
|
84
|
+
/**
|
85
|
+
* Type of input control
|
86
|
+
* @type { 'button' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' }
|
87
|
+
*/
|
75
88
|
type?: Exclude<FormFieldBaseProps['type'], 'checkbox' | 'radio'>;
|
76
|
-
/**
|
77
|
-
validateOn
|
89
|
+
/** Sets validation start */
|
90
|
+
validateOn: 'input' | 'change' | 'submit';
|
78
91
|
/** The current value of the input field */
|
79
92
|
value: string;
|
80
93
|
/** @internal */
|
@@ -85,10 +98,11 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
85
98
|
/** @internal */
|
86
99
|
$input: HTMLInputElement;
|
87
100
|
/** @internal */
|
101
|
+
_defaultSlot: Node[];
|
102
|
+
/** @internal */
|
88
103
|
private _numberController;
|
89
104
|
/** @internal */
|
90
105
|
private _passwordController;
|
91
|
-
constructor();
|
92
106
|
protected firstUpdated(): void;
|
93
107
|
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
94
108
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
@@ -121,3 +135,4 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
121
135
|
private _onBlur;
|
122
136
|
render(): import("lit").TemplateResult<1>;
|
123
137
|
}
|
138
|
+
export {};
|