@skf-design-system/ui-components 0.0.1-beta.4 → 1.0.0-alpha.27
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.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 +1 -1
- package/dist/components/alert/alert.styles.js +1 -1
- package/dist/components/button/button.component.js +1 -1
- 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 +16 -9
- package/dist/components/checkbox/checkbox.component.js +32 -31
- 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 +34 -29
- package/dist/components/input/input.component.js +43 -43
- 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 +137 -0
- package/dist/components/select/select.component.js +312 -0
- package/dist/components/select/select.controllers.d.ts +59 -0
- package/dist/components/select/select.controllers.js +169 -0
- package/dist/components/select/select.d.ts +8 -0
- package/dist/components/select/select.js +6 -0
- package/dist/components/select/select.styles.d.ts +1 -0
- package/dist/components/select/select.styles.js +131 -0
- package/dist/components/select-option/select-option.component.d.ts +77 -0
- package/dist/components/select-option/select-option.component.js +123 -0
- package/dist/components/select-option/select-option.controllers.d.ts +9 -0
- package/dist/components/select-option/select-option.d.ts +8 -0
- package/dist/components/select-option/select-option.js +6 -0
- package/dist/components/select-option/select-option.styles.d.ts +1 -0
- package/dist/components/select-option/select-option.styles.js +53 -0
- package/dist/components/select-option-group/select-option-group.component.d.ts +16 -0
- package/dist/components/select-option-group/select-option-group.component.js +31 -0
- package/dist/components/select-option-group/select-option-group.d.ts +8 -0
- package/dist/components/select-option-group/select-option-group.js +6 -0
- package/dist/components/select-option-group/select-option-group.style.d.ts +1 -0
- package/dist/components/select-option-group/select-option-group.style.js +18 -0
- 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 +25 -4
- package/dist/components/tag/tag.component.js +66 -29
- package/dist/components/tag/tag.styles.js +6 -5
- package/dist/components/textarea/textarea.component.d.ts +26 -23
- package/dist/components/textarea/textarea.component.js +15 -12
- package/dist/custom-elements.json +969 -295
- package/dist/index.d.ts +3 -0
- package/dist/index.js +39 -30
- package/dist/internal/components/formBase.d.ts +18 -1
- package/dist/internal/components/formBase.js +25 -13
- 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.d.ts +4 -4
- package/dist/internal/components/skf-element.js +15 -19
- package/dist/internal/helpers/array.d.ts +4 -0
- package/dist/internal/helpers/findMatchingTags.d.ts +2 -0
- package/dist/internal/helpers/findMatchingTags.js +12 -0
- package/dist/internal/helpers/hintSeverity.d.ts +2 -0
- package/dist/internal/helpers/hintSeverity.js +6 -0
- package/dist/internal/helpers/raiseError.d.ts +28 -0
- package/dist/internal/helpers/raiseError.js +29 -0
- package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -6
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +3 -0
- package/dist/react/skf-select/index.d.ts +21 -0
- package/dist/react/skf-select/index.js +21 -0
- package/dist/react/skf-select-option/index.d.ts +9 -0
- package/dist/react/skf-select-option/index.js +17 -0
- package/dist/react/skf-select-option-group/index.d.ts +3 -0
- package/dist/react/skf-select-option-group/index.js +13 -0
- package/dist/styles/form-field.styles.js +11 -7
- package/dist/types/jsx/custom-element-jsx.d.ts +292 -140
- package/dist/types/vue/index.d.ts +225 -90
- package/dist/vscode.html-custom-data.json +299 -97
- package/dist/web-types.json +624 -242
- package/package.json +34 -30
@@ -1,17 +1,18 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
2
|
import { SkfElement as h } from "../../internal/components/skf-element.js";
|
3
3
|
import m from "../../styles/component.styles.js";
|
4
|
-
import { property as
|
5
|
-
import {
|
6
|
-
import u from "
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
import { property as i } from "lit/decorators.js";
|
5
|
+
import { ifDefined as c } from "lit/directives/if-defined.js";
|
6
|
+
import { html as u, unsafeStatic as l } from "lit/static-html.js";
|
7
|
+
import f from "./collapse.styles.js";
|
8
|
+
var y = Object.defineProperty, o = (a, s, d, g) => {
|
9
|
+
for (var t = void 0, r = a.length - 1, p; r >= 0; r--)
|
10
|
+
(p = a[r]) && (t = p(s, d, t) || t);
|
11
|
+
return t && y(s, d, t), t;
|
11
12
|
};
|
12
13
|
const n = class n extends h {
|
13
14
|
constructor() {
|
14
|
-
super(...arguments), this.
|
15
|
+
super(...arguments), this.headingAs = "h2", this._toggle = () => {
|
15
16
|
this.dispatchEvent(
|
16
17
|
new CustomEvent("skf-collapse-toggle", {
|
17
18
|
bubbles: !0,
|
@@ -30,45 +31,47 @@ const n = class n extends h {
|
|
30
31
|
this.expanded = !0;
|
31
32
|
}
|
32
33
|
render() {
|
33
|
-
return
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
<div id="
|
47
|
-
<
|
34
|
+
return u`
|
35
|
+
<div id="root">
|
36
|
+
<${l(this.headingAs)} id="heading">
|
37
|
+
<button
|
38
|
+
@click=${this._toggle}
|
39
|
+
aria-controls="main"
|
40
|
+
aria-expanded=${c(this.expanded ? "true" : "false")}
|
41
|
+
type="button"
|
42
|
+
>
|
43
|
+
<span id="label">${this.heading}</span>
|
44
|
+
<skf-icon name=${this.expanded ? "caretUp" : "caretDown"}></skf-icon>
|
45
|
+
</button>
|
46
|
+
</${l(this.headingAs)}>
|
47
|
+
<div id="body">
|
48
|
+
<div id="main" data-testid="main">
|
49
|
+
<slot></slot>
|
50
|
+
</div>
|
48
51
|
</div>
|
49
52
|
</div>
|
50
53
|
`;
|
51
54
|
}
|
52
55
|
};
|
53
|
-
n.styles = [m,
|
56
|
+
n.styles = [m, f];
|
54
57
|
let e = n;
|
55
|
-
|
56
|
-
|
58
|
+
o([
|
59
|
+
i({ type: Boolean, reflect: !0 })
|
57
60
|
], e.prototype, "animated");
|
58
|
-
|
59
|
-
|
61
|
+
o([
|
62
|
+
i({ type: Boolean, reflect: !0 })
|
60
63
|
], e.prototype, "expanded");
|
61
|
-
|
62
|
-
|
64
|
+
o([
|
65
|
+
i()
|
63
66
|
], e.prototype, "heading");
|
64
|
-
|
65
|
-
|
67
|
+
o([
|
68
|
+
i({ attribute: "heading-as" })
|
66
69
|
], e.prototype, "headingAs");
|
67
|
-
|
68
|
-
|
70
|
+
o([
|
71
|
+
i({ type: Boolean, reflect: !0 })
|
69
72
|
], e.prototype, "small");
|
70
|
-
|
71
|
-
|
73
|
+
o([
|
74
|
+
i({ type: Boolean, reflect: !0 })
|
72
75
|
], e.prototype, "truncate");
|
73
76
|
export {
|
74
77
|
e as SkfCollapse
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { css as
|
2
|
-
const s =
|
1
|
+
import { css as o } from "lit";
|
2
|
+
const s = o`
|
3
3
|
@layer components {
|
4
|
-
|
4
|
+
#root {
|
5
5
|
background: var(--skf-bg-color-neutral-1);
|
6
6
|
border-bottom: var(--skf-border-width-sm) solid var(--skf-border-color-tertiary);
|
7
7
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -2,7 +2,9 @@ import { SkfElement } from '@internal/components/skf-element.js';
|
|
2
2
|
import type { BorderColor } from '@skf-design-system/ui-assets';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
4
|
/**
|
5
|
-
* The `<Divider>` component can separate items from each other, to visually emphasize their lack of a relationship between groups of information
|
5
|
+
* The `<Divider>` component can separate items from each other, to visually emphasize their lack of a relationship between groups of information
|
6
|
+
*
|
7
|
+
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/3831f1-divider) for design principles
|
6
8
|
*
|
7
9
|
* @cssproperty --skf-divider-spacing - The amount of space the divider occupies. Pass valid CSS **margin-block** values when horizontal and **margin-inline** when vertical
|
8
10
|
* @cssproperty --skf-divider-inset - The amount of space the divider should be indented. Pass valid CSS **margin-inline** values when horizontal and **margin-block** when vertical
|
@@ -10,17 +12,18 @@ import { type CSSResultGroup } from 'lit';
|
|
10
12
|
* @tagname skf-divider
|
11
13
|
*/
|
12
14
|
export declare class SkfDivider extends SkfElement {
|
15
|
+
#private;
|
13
16
|
static styles: CSSResultGroup;
|
14
|
-
/**
|
15
|
-
|
16
|
-
|
17
|
+
/**
|
18
|
+
* Defines the Divider color
|
19
|
+
* @type { "emphasised" | "primary" | "secondary" | "tertiary" | "inverse" }
|
20
|
+
*/
|
21
|
+
color: BorderColor;
|
17
22
|
/** If true, renders a div for presentational purpose instead of the semantic hr-element */
|
18
|
-
decorative?: boolean
|
23
|
+
decorative?: boolean;
|
19
24
|
/** If true, renders the divider vertically */
|
20
|
-
vertical?: boolean
|
21
|
-
|
22
|
-
|
23
|
-
/** @internal */
|
24
|
-
private renderDefault;
|
25
|
+
vertical?: boolean;
|
26
|
+
constructor();
|
27
|
+
connectedCallback(): void;
|
25
28
|
render(): import("lit").TemplateResult<1>;
|
26
29
|
}
|
@@ -1,37 +1,42 @@
|
|
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 f = (t) => {
|
2
|
+
throw TypeError(t);
|
11
3
|
};
|
12
|
-
|
4
|
+
var d = (t, r, e) => r.has(t) || f("Cannot " + e);
|
5
|
+
var s = (t, r, e) => (d(t, r, "read from private field"), e ? e.call(t) : r.get(t)), v = (t, r, e) => r.has(t) ? f("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), y = (t, r, e, l) => (d(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 C } from "lit";
|
9
|
+
import { property as p } from "lit/decorators.js";
|
10
|
+
import _ from "./divider.styles.js";
|
11
|
+
var x = Object.defineProperty, c = (t, r, e, l) => {
|
12
|
+
for (var o = void 0, n = t.length - 1, h; n >= 0; n--)
|
13
|
+
(h = t[n]) && (o = h(r, e, o) || o);
|
14
|
+
return o && x(r, e, o), o;
|
15
|
+
}, i;
|
16
|
+
const m = class m extends u {
|
13
17
|
constructor() {
|
14
|
-
super(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
18
|
+
super();
|
19
|
+
v(this, i);
|
20
|
+
this.color = "primary", y(this, i, this.attachInternals());
|
21
|
+
}
|
22
|
+
connectedCallback() {
|
23
|
+
super.connectedCallback(), s(this, i).role = this.decorative ? "generic" : "separator", s(this, i).ariaOrientation = this.vertical ? "vertical" : "horizontal";
|
19
24
|
}
|
20
25
|
render() {
|
21
|
-
return
|
26
|
+
return C`<div id="root"></div>`;
|
22
27
|
}
|
23
28
|
};
|
24
|
-
|
25
|
-
let
|
26
|
-
|
27
|
-
|
28
|
-
],
|
29
|
-
|
30
|
-
|
31
|
-
],
|
32
|
-
|
33
|
-
|
34
|
-
],
|
29
|
+
i = new WeakMap(), m.styles = [b, _];
|
30
|
+
let a = m;
|
31
|
+
c([
|
32
|
+
p({ reflect: !0 })
|
33
|
+
], a.prototype, "color");
|
34
|
+
c([
|
35
|
+
p({ type: Boolean })
|
36
|
+
], a.prototype, "decorative");
|
37
|
+
c([
|
38
|
+
p({ type: Boolean, reflect: !0 })
|
39
|
+
], a.prototype, "vertical");
|
35
40
|
export {
|
36
|
-
|
41
|
+
a as SkfDivider
|
37
42
|
};
|
@@ -1,10 +1,6 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
2
|
const i = r`
|
3
|
-
|
4
|
-
display: contents;
|
5
|
-
}
|
6
|
-
|
7
|
-
#divider {
|
3
|
+
#root {
|
8
4
|
--_skf-divider-border-color: var(--skf-border-color-primary);
|
9
5
|
--_skf-divider-border: var(--skf-border-width-sm) solid var(--_skf-divider-border-color);
|
10
6
|
|
@@ -5,13 +5,23 @@ import { type CSSResultGroup } from 'lit';
|
|
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 {
|
@@ -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
|
`;
|