@skf-design-system/ui-components 1.0.2-beta.5 → 1.0.2-beta.6
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/custom-elements.json +25490 -0
- package/dist/components/accordion/accordion.component.d.ts +1 -1
- package/dist/components/accordion/accordion.component.js +2 -2
- package/dist/components/datepicker/datepicker.component.js +1 -0
- package/dist/components/divider/divider.component.d.ts +3 -0
- package/dist/components/divider/divider.component.js +43 -22
- package/dist/components/divider/divider.styles.js +8 -8
- package/dist/components/drawer/drawer.component.d.ts +8 -2
- package/dist/components/drawer/drawer.component.js +74 -54
- package/dist/components/drawer/drawer.styles.js +47 -40
- package/dist/components/input/input.component.js +1 -0
- package/dist/components/link/link.component.d.ts +15 -18
- package/dist/components/link/link.component.js +99 -108
- package/dist/components/link/link.styles.js +45 -45
- package/dist/components/loader/loader.component.d.ts +5 -1
- package/dist/components/loader/loader.component.js +43 -29
- package/dist/components/loader/loader.styles.js +5 -9
- package/dist/components/menu/menu-item.component.d.ts +1 -1
- package/dist/components/menu/menu-item.component.js +8 -8
- package/dist/components/menu/menu-item.styles.js +8 -5
- package/dist/components/menu/menu.component.d.ts +1 -1
- package/dist/components/menu/menu.component.js +8 -8
- package/dist/components/nav/nav-item.component.d.ts +4 -0
- package/dist/components/nav/nav-item.component.js +44 -25
- package/dist/components/nav/nav-item.styles.js +29 -25
- package/dist/components/nav/nav.component.d.ts +6 -0
- package/dist/components/nav/nav.component.js +42 -21
- package/dist/components/nav/nav.styles.js +15 -9
- package/dist/components/popover/popover.component.d.ts +4 -0
- package/dist/components/popover/popover.component.js +30 -22
- package/dist/components/progress/progress.component.d.ts +2 -0
- package/dist/components/progress/progress.component.js +38 -29
- package/dist/components/progress/progress.styles.js +3 -3
- package/dist/components/select/select-option-group.component.d.ts +4 -0
- package/dist/components/select/select-option-group.component.js +37 -18
- package/dist/components/select/select-option-group.style.js +12 -6
- package/dist/components/select/select-option.component.d.ts +6 -1
- package/dist/components/select/select-option.component.js +73 -53
- package/dist/components/select/select-option.styles.js +43 -31
- package/dist/components/select/select.component.d.ts +5 -1
- package/dist/components/select/select.component.js +47 -29
- package/dist/components/select/select.controllers.js +2 -1
- package/dist/components/select/select.styles.js +8 -2
- package/dist/components/stepper/stepper-item.component.d.ts +1 -1
- package/dist/components/stepper/stepper-item.component.js +26 -23
- package/dist/components/tabs/tab-panel.component.d.ts +1 -1
- package/dist/components/tabs/tab-panel.component.js +19 -16
- package/dist/components/tabs/tab.component.d.ts +1 -1
- package/dist/components/tabs/tab.component.js +17 -14
- package/dist/components/textarea/textarea.component.js +5 -4
- package/dist/components/toast/toast-item.styles.js +13 -10
- package/dist/components/toast/toast.component.js +9 -9
- package/dist/components/toast/toast.singleton.d.ts +1 -1
- package/dist/components/toast/toast.singleton.js +18 -18
- package/dist/components/tooltip/tooltip.component.d.ts +1 -0
- package/dist/components/tooltip/tooltip.component.js +10 -7
- package/dist/custom-elements.json +803 -704
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -20
- package/dist/internal/base-classes/popover/popover.base.d.ts +3 -3
- package/dist/internal/base-classes/popover/popover.base.js +27 -26
- package/dist/internal/base-classes/popover/popover.styles.js +4 -5
- package/dist/internal/components/hint/hint.component.d.ts +4 -0
- package/dist/internal/components/hint/hint.component.js +47 -20
- package/dist/internal/components/hint/hint.styles.js +29 -25
- package/dist/internal/types.d.ts +4 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +184 -81
- package/dist/types/vue/index.d.ts +77 -80
- package/dist/vscode.html-custom-data.json +93 -97
- package/dist/web-types.json +210 -215
- package/package.json +28 -28
@@ -25,7 +25,7 @@ export declare class SkfAccordion extends SkfElement {
|
|
25
25
|
/** If true, will truncate all headings in collapsed state */
|
26
26
|
truncate: boolean;
|
27
27
|
/** @internal */
|
28
|
-
private
|
28
|
+
private _accordionItems;
|
29
29
|
protected updated(_changedProperties: PropertyValues): void;
|
30
30
|
/** @internal */
|
31
31
|
private get items();
|
@@ -22,7 +22,7 @@ const n = class n extends p {
|
|
22
22
|
}
|
23
23
|
/** @internal */
|
24
24
|
get items() {
|
25
|
-
return [...this
|
25
|
+
return [...this._accordionItems].filter((t) => t.localName === "skf-accordion-item");
|
26
26
|
}
|
27
27
|
_onChildToggle(t) {
|
28
28
|
if (this.multiple || t.defaultPrevented) return;
|
@@ -66,7 +66,7 @@ s([
|
|
66
66
|
], e.prototype, "truncate");
|
67
67
|
s([
|
68
68
|
d()
|
69
|
-
], e.prototype, "
|
69
|
+
], e.prototype, "_accordionItems");
|
70
70
|
export {
|
71
71
|
e as SkfAccordion
|
72
72
|
};
|
@@ -13,6 +13,7 @@ type SkfDividerColor = BorderColor;
|
|
13
13
|
* @tagname skf-divider
|
14
14
|
*/
|
15
15
|
export declare class SkfDivider extends SkfElement {
|
16
|
+
#private;
|
16
17
|
static styles: CSSResultGroup;
|
17
18
|
/** Defines the Divider color */
|
18
19
|
color: SkfDividerColor;
|
@@ -21,5 +22,7 @@ export declare class SkfDivider extends SkfElement {
|
|
21
22
|
/** If true, renders the divider vertically */
|
22
23
|
vertical: boolean;
|
23
24
|
connectedCallback(): void;
|
25
|
+
/** @internal */
|
26
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
24
27
|
}
|
25
28
|
export {};
|
@@ -1,32 +1,53 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
var _ = (t) => {
|
2
|
+
throw TypeError(t);
|
3
|
+
};
|
4
|
+
var d = (t, e, r) => e.has(t) || _("Cannot " + r);
|
5
|
+
var h = (t, e, r) => (d(t, e, "read from private field"), r ? r.call(t) : e.get(t)), m = (t, e, r) => e.has(t) ? _("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), y = (t, e, r, s) => (d(t, e, "write to private field"), s ? s.call(t, r) : e.set(t, r), r);
|
6
|
+
import { SkfElement as O } from "../../internal/components/skf-element.js";
|
7
|
+
import { stateMap as b } from "../../internal/helpers/stateMap.js";
|
8
|
+
import { watch as g } from "../../internal/helpers/watch.js";
|
9
|
+
import { componentStyles as C } from "../../styles/component.styles.js";
|
3
10
|
import "lit";
|
4
|
-
import { property as
|
5
|
-
import { styles as
|
6
|
-
var
|
7
|
-
for (var
|
8
|
-
(
|
9
|
-
return
|
11
|
+
import { property as v } from "lit/decorators.js";
|
12
|
+
import { styles as P } from "./divider.styles.js";
|
13
|
+
var j = Object.defineProperty, w = Object.getOwnPropertyDescriptor, c = (t, e, r, s) => {
|
14
|
+
for (var o = s > 1 ? void 0 : s ? w(e, r) : e, l = t.length - 1, n; l >= 0; l--)
|
15
|
+
(n = t[l]) && (o = (s ? n(e, r, o) : n(o)) || o);
|
16
|
+
return s && o && j(e, r, o), o;
|
17
|
+
};
|
18
|
+
const u = {
|
19
|
+
color: ["emphasised", "inverse", "primary", "secondary", "tertiary"],
|
20
|
+
vertical: "vertical"
|
10
21
|
};
|
11
|
-
|
22
|
+
var i, p;
|
23
|
+
const f = class f extends O {
|
12
24
|
constructor() {
|
13
|
-
super(...arguments)
|
25
|
+
super(...arguments);
|
26
|
+
m(this, i);
|
27
|
+
m(this, p);
|
28
|
+
y(this, i, this.attachInternals()), y(this, p, h(this, i).states), this.color = "primary", this.decorative = !1, this.vertical = !1;
|
14
29
|
}
|
15
30
|
connectedCallback() {
|
16
31
|
super.connectedCallback(), this.role = this.decorative ? "generic" : "separator", this.ariaOrientation = this.vertical ? "vertical" : "horizontal";
|
17
32
|
}
|
33
|
+
_handleStateChange(r, s, o) {
|
34
|
+
b(h(this, p), u[r]).set(o);
|
35
|
+
}
|
18
36
|
};
|
19
|
-
i.styles = [
|
20
|
-
let
|
21
|
-
|
22
|
-
|
23
|
-
],
|
24
|
-
|
25
|
-
|
26
|
-
],
|
27
|
-
|
28
|
-
|
29
|
-
],
|
37
|
+
i = new WeakMap(), p = new WeakMap(), f.styles = [C, P];
|
38
|
+
let a = f;
|
39
|
+
c([
|
40
|
+
v({ type: String })
|
41
|
+
], a.prototype, "color", 2);
|
42
|
+
c([
|
43
|
+
v({ type: Boolean })
|
44
|
+
], a.prototype, "decorative", 2);
|
45
|
+
c([
|
46
|
+
v({ type: Boolean })
|
47
|
+
], a.prototype, "vertical", 2);
|
48
|
+
c([
|
49
|
+
g(Object.keys(u))
|
50
|
+
], a.prototype, "_handleStateChange", 1);
|
30
51
|
export {
|
31
|
-
|
52
|
+
a as SkfDivider
|
32
53
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
2
|
+
const o = r`
|
3
3
|
@layer components {
|
4
4
|
@layer base {
|
5
5
|
:host {
|
@@ -9,7 +9,7 @@ const e = r`
|
|
9
9
|
display: block;
|
10
10
|
}
|
11
11
|
|
12
|
-
:host(:not(
|
12
|
+
:host(:not(:state(vertical))) {
|
13
13
|
border-top: var(--_skf-divider-border);
|
14
14
|
margin-block: var(--skf-divider-spacing, var(--skf-spacing-100));
|
15
15
|
margin-inline: var(--skf-divider-inset, 0);
|
@@ -17,31 +17,31 @@ const e = r`
|
|
17
17
|
}
|
18
18
|
|
19
19
|
@layer mods {
|
20
|
-
:host(
|
20
|
+
:host(:state(vertical)) {
|
21
21
|
block-size: 100%;
|
22
22
|
border-left: var(--_skf-divider-border);
|
23
23
|
margin-block: var(--skf-divider-inset, 0);
|
24
24
|
margin-inline: var(--skf-divider-spacing, var(--skf-spacing-100));
|
25
25
|
}
|
26
26
|
|
27
|
-
:host(
|
27
|
+
:host(:state(emphasised)) {
|
28
28
|
--_skf-divider-border-color: var(--skf-border-color-emphasised);
|
29
29
|
}
|
30
30
|
|
31
|
-
:host(
|
31
|
+
:host(:state(inverse)) {
|
32
32
|
--_skf-divider-border-color: var(--skf-border-color-inverse);
|
33
33
|
}
|
34
34
|
|
35
|
-
:host(
|
35
|
+
:host(:state(secondary)) {
|
36
36
|
--_skf-divider-border-color: var(--skf-border-color-secondary);
|
37
37
|
}
|
38
38
|
|
39
|
-
:host(
|
39
|
+
:host(:state(tertiary)) {
|
40
40
|
--_skf-divider-border-color: var(--skf-border-color-tertiary);
|
41
41
|
}
|
42
42
|
}
|
43
43
|
}
|
44
44
|
`;
|
45
45
|
export {
|
46
|
-
|
46
|
+
o as styles
|
47
47
|
};
|
@@ -8,6 +8,8 @@ import { type CSSResultGroup } from 'lit';
|
|
8
8
|
* - add tests
|
9
9
|
* - add documentation
|
10
10
|
*/
|
11
|
+
type Placement = 'left' | 'right';
|
12
|
+
type Size = 'sm' | 'md' | 'lg';
|
11
13
|
/**
|
12
14
|
* The `<skf-drawer>` is a modal component that displays content and toggle by sliding from left/right viewport edge
|
13
15
|
*
|
@@ -22,6 +24,7 @@ import { type CSSResultGroup } from 'lit';
|
|
22
24
|
* @tagname skf-drawer
|
23
25
|
*/
|
24
26
|
export declare class SkfDrawer extends SkfElement {
|
27
|
+
#private;
|
25
28
|
static styles: CSSResultGroup;
|
26
29
|
/** @internal */
|
27
30
|
private _abortController?;
|
@@ -32,15 +35,17 @@ export declare class SkfDrawer extends SkfElement {
|
|
32
35
|
/** Heading for the Drawer */
|
33
36
|
heading?: string;
|
34
37
|
/** Sets the max-width */
|
35
|
-
size:
|
38
|
+
size: Size;
|
36
39
|
/** If true, Drawer is open */
|
37
40
|
open: boolean;
|
38
41
|
/** Placement of the Drawer */
|
39
|
-
placement:
|
42
|
+
placement: Placement;
|
40
43
|
/** @internal */
|
41
44
|
$dialog: HTMLDialogElement;
|
42
45
|
disconnectedCallback(): void;
|
43
46
|
/** @internal */
|
47
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
48
|
+
/** @internal */
|
44
49
|
_placementChanged: () => void;
|
45
50
|
/** @internal */
|
46
51
|
_openChanged(): Promise<void>;
|
@@ -59,3 +64,4 @@ export declare class SkfDrawer extends SkfElement {
|
|
59
64
|
close(): void;
|
60
65
|
render(): import("lit").TemplateResult<1>;
|
61
66
|
}
|
67
|
+
export {};
|
@@ -1,21 +1,35 @@
|
|
1
|
+
var _ = (e) => {
|
2
|
+
throw TypeError(e);
|
3
|
+
};
|
4
|
+
var y = (e, i, t) => i.has(e) || _("Cannot " + t);
|
5
|
+
var d = (e, i, t) => (y(e, i, "read from private field"), t ? t.call(e) : i.get(e)), m = (e, i, t) => i.has(e) ? _("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), g = (e, i, t, o) => (y(e, i, "write to private field"), o ? o.call(e, t) : i.set(e, t), t);
|
1
6
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
import { SkfElement as I } from "../../internal/components/skf-element.js";
|
8
|
+
import { stateMap as D } from "../../internal/helpers/stateMap.js";
|
9
|
+
import { watch as f } from "../../internal/helpers/watch.js";
|
10
|
+
import { MOTION_DURATIONS as b } from "@skf-design-system/ui-assets";
|
11
|
+
import { componentStyles as k } from "../../styles/component.styles.js";
|
12
|
+
import { html as C } from "lit";
|
13
|
+
import { property as p, query as $ } from "lit/decorators.js";
|
14
|
+
import { styles as E } from "./drawer.styles.js";
|
15
|
+
var A = Object.defineProperty, v = Object.getOwnPropertyDescriptor, n = (e, i, t, o) => {
|
16
|
+
for (var s = o > 1 ? void 0 : o ? v(i, t) : i, r = e.length - 1, l; r >= 0; r--)
|
17
|
+
(l = e[r]) && (s = (o ? l(i, t, s) : l(s)) || s);
|
18
|
+
return o && s && A(i, t, s), s;
|
19
|
+
};
|
20
|
+
const w = {
|
21
|
+
placement: ["left", "right"],
|
22
|
+
size: ["sm", "md", "lg"]
|
13
23
|
};
|
14
|
-
|
24
|
+
var h, c;
|
25
|
+
const u = class u extends I {
|
15
26
|
constructor() {
|
16
|
-
super(...arguments)
|
17
|
-
|
18
|
-
|
27
|
+
super(...arguments);
|
28
|
+
m(this, h);
|
29
|
+
m(this, c);
|
30
|
+
g(this, h, this.attachInternals()), g(this, c, d(this, h).states), this.closeButtonAriaLabel = "Close dialog", this.size = "md", this.open = !1, this.placement = "right", this._placementChanged = () => {
|
31
|
+
this.$dialog.getAnimations().forEach((o) => {
|
32
|
+
o.cancel();
|
19
33
|
});
|
20
34
|
}, this._clickstartInDialog = !1, this._handleMouseDown = (t) => {
|
21
35
|
this._clickIsInsideElement(t, this.$dialog) && (this._clickstartInDialog = !0);
|
@@ -30,6 +44,9 @@ const c = class c extends m {
|
|
30
44
|
var t;
|
31
45
|
super.disconnectedCallback(), (t = this._abortController) == null || t.abort();
|
32
46
|
}
|
47
|
+
_handleStateChange(t, o, s) {
|
48
|
+
D(d(this, c), w[t]).set(s);
|
49
|
+
}
|
33
50
|
async _openChanged() {
|
34
51
|
var t;
|
35
52
|
this.open ? (this._abortController = new AbortController(), this._signal = this._abortController.signal, this.$dialog.showModal(), this._startListeners(), await this._animateDrawer(), this.emit("skf-drawer-opened")) : ((t = this._abortController) == null || t.abort(), this.emit("skf-drawer-closing"), await this._animateDrawer(), this.emit("skf-drawer-closed"), this.$dialog.close());
|
@@ -47,26 +64,26 @@ const c = class c extends m {
|
|
47
64
|
});
|
48
65
|
}
|
49
66
|
/** @internal */
|
50
|
-
_clickIsInsideElement(t,
|
51
|
-
const
|
52
|
-
return
|
67
|
+
_clickIsInsideElement(t, o) {
|
68
|
+
const s = o.getBoundingClientRect();
|
69
|
+
return s.top <= t.clientY && t.clientY <= s.top + s.height && s.left <= t.clientX && t.clientX <= s.left + s.width;
|
53
70
|
}
|
54
71
|
/** @internal */
|
55
72
|
_animateDrawer() {
|
56
|
-
const t = this.open ? [{ opacity: 0 }, { opacity: 0.4 }] : [{ opacity: 0 }],
|
57
|
-
return new Promise((
|
73
|
+
const t = this.open ? [{ opacity: 0 }, { opacity: 0.4 }] : [{ opacity: 0 }], o = this.open ? [{ translate: "0" }] : [{ translate: this.placement === "right" ? "100%" : "-100%" }];
|
74
|
+
return new Promise((s) => {
|
58
75
|
requestAnimationFrame(() => {
|
59
|
-
const
|
60
|
-
duration:
|
76
|
+
const r = this.$dialog.animate(t, {
|
77
|
+
duration: b.normal,
|
61
78
|
fill: "forwards",
|
62
79
|
pseudoElement: "::backdrop"
|
63
|
-
}),
|
64
|
-
duration:
|
80
|
+
}), l = this.$dialog.animate(o, {
|
81
|
+
duration: b.normal,
|
65
82
|
easing: "ease-out",
|
66
83
|
fill: "forwards"
|
67
84
|
});
|
68
|
-
Promise.all([
|
69
|
-
|
85
|
+
Promise.all([r.finished, l.finished]).then(() => {
|
86
|
+
s("Animations finished");
|
70
87
|
}).catch(() => {
|
71
88
|
throw new Error("Animation failed");
|
72
89
|
});
|
@@ -77,7 +94,7 @@ const c = class c extends m {
|
|
77
94
|
this.open = !1;
|
78
95
|
}
|
79
96
|
render() {
|
80
|
-
return
|
97
|
+
return C`
|
81
98
|
<dialog @mousedown="${this._handleMouseDown}" @mouseup="${this._handleMouseUp}">
|
82
99
|
<header>
|
83
100
|
<h2>${this.heading}</h2>
|
@@ -94,32 +111,35 @@ const c = class c extends m {
|
|
94
111
|
`;
|
95
112
|
}
|
96
113
|
};
|
97
|
-
c.styles = [
|
98
|
-
let
|
99
|
-
|
100
|
-
|
101
|
-
],
|
102
|
-
|
103
|
-
|
104
|
-
],
|
105
|
-
|
106
|
-
|
107
|
-
],
|
108
|
-
|
109
|
-
|
110
|
-
],
|
111
|
-
|
112
|
-
|
113
|
-
],
|
114
|
-
|
115
|
-
|
116
|
-
],
|
117
|
-
|
118
|
-
|
119
|
-
],
|
120
|
-
|
121
|
-
|
122
|
-
],
|
114
|
+
h = new WeakMap(), c = new WeakMap(), u.styles = [k, E];
|
115
|
+
let a = u;
|
116
|
+
n([
|
117
|
+
p({ type: String, attribute: "close-button-aria-label" })
|
118
|
+
], a.prototype, "closeButtonAriaLabel", 2);
|
119
|
+
n([
|
120
|
+
p({ type: String })
|
121
|
+
], a.prototype, "heading", 2);
|
122
|
+
n([
|
123
|
+
p({ type: String })
|
124
|
+
], a.prototype, "size", 2);
|
125
|
+
n([
|
126
|
+
p({ type: Boolean, reflect: !0, useDefault: !0 })
|
127
|
+
], a.prototype, "open", 2);
|
128
|
+
n([
|
129
|
+
p({ type: String })
|
130
|
+
], a.prototype, "placement", 2);
|
131
|
+
n([
|
132
|
+
$("dialog")
|
133
|
+
], a.prototype, "$dialog", 2);
|
134
|
+
n([
|
135
|
+
f(Object.keys(w))
|
136
|
+
], a.prototype, "_handleStateChange", 1);
|
137
|
+
n([
|
138
|
+
f("placement", { waitUntilFirstUpdate: !0 })
|
139
|
+
], a.prototype, "_placementChanged", 2);
|
140
|
+
n([
|
141
|
+
f("open", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
142
|
+
], a.prototype, "_openChanged", 1);
|
123
143
|
export {
|
124
|
-
|
144
|
+
a as SkfDrawer
|
125
145
|
};
|
@@ -1,19 +1,20 @@
|
|
1
1
|
import { css as e } from "lit";
|
2
2
|
const o = e`
|
3
3
|
@layer components {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
flex-direction: column;
|
9
|
-
inline-size: min(100%, var(--_skf-drawer-size, 540px));
|
10
|
-
inset-block: 0;
|
11
|
-
inset-inline: var(--_skf-drawer-inset, auto 0);
|
12
|
-
position: fixed;
|
13
|
-
translate: 100% 0;
|
4
|
+
@layer base {
|
5
|
+
dialog {
|
6
|
+
--_skf-drawer-inset: auto 0;
|
7
|
+
--_skf-drawer-size: 540px;
|
14
8
|
|
15
|
-
|
16
|
-
|
9
|
+
all: unset;
|
10
|
+
background-color: var(--skf-bg-color-neutral-1);
|
11
|
+
display: none;
|
12
|
+
flex-direction: column;
|
13
|
+
inline-size: min(100%, var(--_skf-drawer-size));
|
14
|
+
inset-block: 0;
|
15
|
+
inset-inline: var(--_skf-drawer-inset);
|
16
|
+
position: fixed;
|
17
|
+
translate: 100% 0;
|
17
18
|
|
18
19
|
&::backdrop {
|
19
20
|
background-color: var(--skf-bg-color-neutral-7);
|
@@ -21,48 +22,54 @@ const o = e`
|
|
21
22
|
}
|
22
23
|
}
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
header {
|
26
|
+
align-items: center;
|
27
|
+
background-color: var(--skf-bg-color-emphasised);
|
28
|
+
block-size: var(--skf-size-48);
|
29
|
+
color: var(--skf-text-color-inverse);
|
30
|
+
display: flex;
|
31
|
+
justify-content: space-between;
|
32
|
+
padding-inline: var(--skf-box-spacing);
|
33
|
+
}
|
26
34
|
|
27
|
-
|
35
|
+
h2 {
|
36
|
+
font-size: var(--skf-font-size-200);
|
28
37
|
}
|
29
38
|
|
30
|
-
|
31
|
-
|
39
|
+
#close-button {
|
40
|
+
display: inline-flex;
|
32
41
|
}
|
33
42
|
|
34
|
-
|
35
|
-
|
43
|
+
#body {
|
44
|
+
display: block;
|
45
|
+
flex: auto;
|
46
|
+
padding: var(--skf-box-spacing);
|
36
47
|
}
|
37
48
|
}
|
38
49
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
display: flex;
|
45
|
-
justify-content: space-between;
|
46
|
-
padding-inline: var(--skf-box-spacing);
|
50
|
+
@layer states {
|
51
|
+
#close-button:focus-visible {
|
52
|
+
border-radius: var(--skf-border-radius-sm);
|
53
|
+
outline: var(--skf-border-width-sm) solid var(--skf-interactive-text-color-inverse);
|
54
|
+
}
|
47
55
|
}
|
48
56
|
|
49
|
-
|
50
|
-
|
51
|
-
|
57
|
+
@layer mods {
|
58
|
+
dialog[open] {
|
59
|
+
display: flex;
|
60
|
+
}
|
52
61
|
|
53
|
-
|
54
|
-
|
62
|
+
:host(:state(left)) dialog {
|
63
|
+
--_skf-drawer-inset: 0 auto;
|
64
|
+
}
|
55
65
|
|
56
|
-
|
57
|
-
|
58
|
-
outline: var(--skf-border-width-sm) solid var(--skf-interactive-text-color-inverse);
|
66
|
+
:host(:state(sm)) dialog {
|
67
|
+
--_skf-drawer-size: 400px;
|
59
68
|
}
|
60
|
-
}
|
61
69
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
padding: var(--skf-box-spacing);
|
70
|
+
:host(:state(lg)) dialog {
|
71
|
+
--_skf-drawer-size: 680px;
|
72
|
+
}
|
66
73
|
}
|
67
74
|
}
|
68
75
|
`;
|
@@ -2,54 +2,51 @@ import '../icon/icon.js';
|
|
2
2
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
3
3
|
import type { Icon } from '../../internal/types.js';
|
4
4
|
import { type CSSResultGroup } from 'lit';
|
5
|
-
type
|
5
|
+
type Color = 'primary' | 'inverse';
|
6
6
|
/**
|
7
|
-
* The `<skf-link>` can be used as either a regular link or a
|
7
|
+
* The `<skf-link>` can be used as either a regular link or a semantic button. The button variant is
|
8
|
+
* intended to be used for triggering javascript functions, not handling forms.
|
8
9
|
*
|
9
10
|
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
10
11
|
*
|
12
|
+
* @event {CustomEvent} skf-link-click - Fired when the link is clicked
|
13
|
+
*
|
11
14
|
* @slot - The links' main content
|
12
15
|
*
|
13
16
|
* @tagname skf-link
|
14
17
|
*/
|
15
18
|
export declare class SkfLink extends SkfElement {
|
19
|
+
#private;
|
16
20
|
static styles: CSSResultGroup;
|
17
|
-
static classMap: {};
|
18
|
-
/** @internal */
|
19
|
-
private _onClick?;
|
20
21
|
/** Defines the semantic element to render */
|
21
|
-
as: 'button' | '
|
22
|
+
as: 'button' | 'link';
|
22
23
|
/** Defines the text-color */
|
23
|
-
color:
|
24
|
+
color: Color;
|
24
25
|
/** If true, disables the link */
|
25
26
|
disabled: boolean;
|
26
27
|
/** If defined, downloads the url */
|
27
|
-
download
|
28
|
+
download: boolean;
|
28
29
|
/** If defined, loads url on click */
|
29
30
|
href?: string;
|
30
31
|
/** If defined, renders an icon before or after the text */
|
31
32
|
icon?: Icon;
|
32
|
-
/**
|
33
|
-
|
34
|
-
/** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
|
35
|
-
set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
|
36
|
-
get onClick(): ((event: Event, route?: string) => void) | undefined;
|
33
|
+
/** If true, the icon is placed to the right in relation to the text */
|
34
|
+
iconRight: boolean;
|
37
35
|
/** If defined, describes the relationship between a linked resource and the current document */
|
38
36
|
rel?: string;
|
39
|
-
/** If defined, used on conjunction with onClick property
|
37
|
+
/** If defined, used on conjunction with onClick property. **Notice!** Only applicable to as=button. */
|
40
38
|
route?: string;
|
41
39
|
/** If true, fills the parents horizontal axis */
|
42
40
|
stretch: boolean;
|
43
41
|
/** If defined, specifies where to open the linked document */
|
44
42
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
45
|
-
/** Defines the type of button */
|
46
|
-
type: SkfLinkType;
|
47
43
|
connectedCallback(): void;
|
44
|
+
_handleAsChange(): void;
|
48
45
|
/** @internal */
|
49
|
-
|
46
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
50
47
|
/** @internal */
|
51
48
|
/** retargets click event to host */
|
52
|
-
private
|
49
|
+
private _handleClick;
|
53
50
|
/** @internal */
|
54
51
|
private _renderIcon;
|
55
52
|
render(): import("lit").TemplateResult;
|