@skf-design-system/ui-components 1.0.2-beta.2 → 1.0.2-beta.4
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 +7 -1
- package/dist/components/accordion/accordion-item.component.js +49 -38
- package/dist/components/accordion/accordion.component.d.ts +1 -1
- package/dist/components/accordion/accordion.component.js +10 -10
- package/dist/components/alert/alert.component.d.ts +5 -1
- package/dist/components/alert/alert.component.js +57 -54
- package/dist/components/alert/alert.styles.js +51 -47
- package/dist/components/breadcrumb/breadcrumb-item.component.js +24 -25
- package/dist/components/breadcrumb/breadcrumb-item.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +16 -15
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +5 -2
- package/dist/components/breadcrumb/breadcrumb.component.js +51 -46
- package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.styles.js +13 -10
- package/dist/components/button/button.component.js +39 -39
- package/dist/components/button/button.styles.js +2 -1
- package/dist/components/card/card.component.d.ts +5 -0
- package/dist/components/card/card.component.js +46 -24
- package/dist/components/card/card.styles.js +31 -14
- package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +4 -1
- package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +7 -7
- package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
- package/dist/components/datepicker/datepicker-calendar.js +6 -0
- package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +5 -20
- package/dist/components/{date-picker/datepicker.component.js → datepicker/datepicker-popup.component.js} +12 -12
- package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
- package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
- package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
- package/dist/components/datepicker/datepicker-popup.js +6 -0
- package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
- package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +17 -12
- package/dist/components/{date-picker-input/datepicker-input.component.js → datepicker/datepicker.component.js} +110 -97
- package/dist/components/datepicker/datepicker.d.ts +8 -0
- package/dist/components/datepicker/datepicker.js +6 -0
- package/dist/components/dialog/dialog.component.js +1 -1
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/header/header.d.ts +2 -2
- package/dist/components/heading/heading.component.d.ts +5 -1
- package/dist/components/heading/heading.component.js +54 -27
- package/dist/components/heading/heading.styles.js +34 -36
- package/dist/components/icon/icon.component.d.ts +4 -0
- package/dist/components/icon/icon.component.js +52 -43
- package/dist/components/icon/icon.styles.js +60 -60
- package/dist/components/input/input.component.js +26 -26
- package/dist/components/logo/logo.component.d.ts +4 -1
- package/dist/components/logo/logo.component.js +55 -51
- package/dist/components/logo/logo.styles.js +26 -16
- package/dist/components/menu/menu-item.d.ts +2 -2
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/nav/nav-item.component.d.ts +2 -2
- package/dist/components/nav/nav.d.ts +2 -2
- package/dist/components/popover/popover.component.js +1 -1
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/progress.styles.js +8 -6
- package/dist/components/segmented-button/segmented-button-item.d.ts +2 -2
- package/dist/components/segmented-button/segmented-button.d.ts +2 -2
- package/dist/components/select/select-option-group.d.ts +2 -2
- package/dist/components/select/select-option.component.d.ts +2 -2
- package/dist/components/select/select-option.component.js +9 -9
- package/dist/components/select/select.component.d.ts +2 -2
- package/dist/components/select/select.component.js +3 -4
- package/dist/components/select/select.controllers.js +11 -14
- package/dist/components/stepper/stepper-item.component.js +47 -47
- package/dist/components/stepper/stepper-item.d.ts +2 -2
- package/dist/components/stepper/stepper.d.ts +2 -2
- package/dist/components/switch/switch.d.ts +2 -2
- package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.component.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.d.ts +2 -2
- package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
- package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +35 -36
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
- package/dist/components/tag/tag.component.d.ts +7 -2
- package/dist/components/tag/tag.component.js +69 -65
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.styles.js +63 -50
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/custom-elements.json +233 -126
- package/dist/index.d.ts +6 -5
- package/dist/index.js +96 -93
- package/dist/internal/base-classes/popover/popover.base.js +1 -1
- package/dist/internal/components/skf-element.d.ts +1 -3
- package/dist/internal/components/skf-element.js +4 -9
- package/dist/internal/helpers/stateMap.d.ts +14 -0
- package/dist/internal/helpers/stateMap.js +68 -0
- package/dist/internal/helpers/watch.d.ts +1 -1
- package/dist/internal/helpers/watch.js +12 -12
- package/dist/styles/component.styles.js +37 -36
- package/dist/styles/{global-without-fonts.css → global-alt.css} +1 -1
- package/dist/styles/global.css +1 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +86 -44
- package/dist/types/vue/index.d.ts +86 -44
- package/dist/vscode.html-custom-data.json +103 -17
- package/dist/web-types.json +208 -55
- package/package.json +14 -20
- package/dist/components/accordion/accordion-item.test.d.ts +0 -1
- package/dist/components/accordion/accordion.test.d.ts +0 -1
- package/dist/components/checkbox/checkbox.test.d.ts +0 -1
- package/dist/components/date-picker/datepicker.d.ts +0 -10
- package/dist/components/date-picker/datepicker.helpers.js +0 -76
- package/dist/components/date-picker/datepicker.js +0 -8
- package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
- package/dist/components/date-picker-input/datepicker-input.js +0 -6
- package/dist/components/input/input.test.d.ts +0 -1
- package/dist/components/radio/radio.test.d.ts +0 -1
- package/dist/components/switch/switch.test.d.ts +0 -1
- package/dist/components/tab-group/tab-group.d.ts +0 -8
- package/dist/components/tab-group/tab-group.js +0 -6
- package/dist/internal/playwright/index.d.ts +0 -1
- /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
- /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
- /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +0 -0
- /package/dist/components/select/{select.stories.icons.d.ts → stories/select.stories.icons.d.ts} +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.component.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
- /package/dist/components/{tab → tabs}/tab.component.js +0 -0
- /package/dist/components/{tab → tabs}/tab.js +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.js +0 -0
- /package/dist/components/{tab-group/tab-group.styles.d.ts → tabs/tabs.styles.d.ts} +0 -0
package/README.md
CHANGED
@@ -87,10 +87,16 @@ How you get started using our components is of course a bit different depending
|
|
87
87
|
|
88
88
|
In order for our components to work as intended you need to import our global styles where appropiate e.g. App.tsx.
|
89
89
|
|
90
|
-
```
|
90
|
+
```ts
|
91
91
|
import '@skf-design-system/ui-components/styles/global.css';
|
92
92
|
```
|
93
93
|
|
94
|
+
If you want to handle the loading of the SKF fonts yourself, you can use the alternative global css file:
|
95
|
+
|
96
|
+
```ts
|
97
|
+
import '@skf-design-system/ui-components/styles/global-alt.css';
|
98
|
+
```
|
99
|
+
|
94
100
|
### Angular
|
95
101
|
|
96
102
|
In order for our components to get the correct styling you need add our global styling to your project. In angular you can do that in the angular.json like this:
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
3
|
-
import { componentStyles as
|
4
|
-
import { property as
|
5
|
-
import { classMap as
|
6
|
-
import { ifDefined as
|
7
|
-
import { literal as
|
2
|
+
import { SkfElement as p } from "../../internal/components/skf-element.js";
|
3
|
+
import { componentStyles as m } from "../../styles/component.styles.js";
|
4
|
+
import { property as i } from "lit/decorators.js";
|
5
|
+
import { classMap as h } from "lit/directives/class-map.js";
|
6
|
+
import { ifDefined as u } from "lit/directives/if-defined.js";
|
7
|
+
import { literal as r, html as f } from "lit/static-html.js";
|
8
8
|
import { styles as _ } from "./accordion-item.styles.js";
|
9
|
-
var
|
10
|
-
for (var
|
11
|
-
(
|
12
|
-
return
|
9
|
+
var g = Object.defineProperty, s = (d, e, c, y) => {
|
10
|
+
for (var a = void 0, o = d.length - 1, l; o >= 0; o--)
|
11
|
+
(l = d[o]) && (a = l(e, c, a) || a);
|
12
|
+
return a && g(e, c, a), a;
|
13
13
|
};
|
14
|
-
const n = class n extends
|
14
|
+
const n = class n extends p {
|
15
15
|
constructor() {
|
16
16
|
super(...arguments), this.animated = !1, this.expanded = !1, this.headingAs = "h2", this.small = !1, this.truncate = !1, this._toggle = () => {
|
17
17
|
this.dispatchEvent(
|
@@ -32,27 +32,38 @@ const n = class n extends l {
|
|
32
32
|
this.expanded = !0;
|
33
33
|
}
|
34
34
|
render() {
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
let e;
|
36
|
+
switch (!0) {
|
37
|
+
case this.headingAs === "h3":
|
38
|
+
e = r`h3`;
|
39
|
+
break;
|
40
|
+
case this.headingAs === "h4":
|
41
|
+
e = r`h4`;
|
42
|
+
break;
|
43
|
+
default:
|
44
|
+
e = r`h2`;
|
45
|
+
break;
|
46
|
+
}
|
47
|
+
return f`
|
48
|
+
<div class=${h({
|
38
49
|
"accordion-item": !0,
|
39
50
|
"accordion-item--animated": this.animated,
|
40
51
|
"accordion-item--expanded": this.expanded,
|
41
52
|
"accordion-item--small": this.small,
|
42
53
|
"accordion-item--truncate": this.truncate
|
43
54
|
})}>
|
44
|
-
<${
|
55
|
+
<${e} class="accordion-item__heading">
|
45
56
|
<button
|
46
57
|
@click=${this._toggle}
|
47
58
|
aria-controls="main"
|
48
|
-
aria-expanded=${
|
59
|
+
aria-expanded=${u(this.expanded ? "true" : "false")}
|
49
60
|
class="accordion-item__btn"
|
50
61
|
type="button"
|
51
62
|
>
|
52
63
|
<span class="accordion-item__label">${this.heading}</span>
|
53
64
|
<skf-icon class="accordion-item__icon" name=${this.expanded ? "caretUp" : "caretDown"}></skf-icon>
|
54
65
|
</button>
|
55
|
-
</${
|
66
|
+
</${e}>
|
56
67
|
<div class="accordion-item__body">
|
57
68
|
<div class="accordion-item__main" data-testid="main" id="main">
|
58
69
|
<slot></slot>
|
@@ -62,26 +73,26 @@ const n = class n extends l {
|
|
62
73
|
`;
|
63
74
|
}
|
64
75
|
};
|
65
|
-
n.styles = [
|
66
|
-
let
|
67
|
-
|
68
|
-
|
69
|
-
],
|
70
|
-
|
71
|
-
|
72
|
-
],
|
73
|
-
|
74
|
-
|
75
|
-
],
|
76
|
-
|
77
|
-
|
78
|
-
],
|
79
|
-
|
80
|
-
|
81
|
-
],
|
82
|
-
|
83
|
-
|
84
|
-
],
|
76
|
+
n.styles = [m, _];
|
77
|
+
let t = n;
|
78
|
+
s([
|
79
|
+
i({ type: Boolean, reflect: !0 })
|
80
|
+
], t.prototype, "animated");
|
81
|
+
s([
|
82
|
+
i({ type: Boolean, reflect: !0 })
|
83
|
+
], t.prototype, "expanded");
|
84
|
+
s([
|
85
|
+
i()
|
86
|
+
], t.prototype, "heading");
|
87
|
+
s([
|
88
|
+
i({ attribute: "heading-as" })
|
89
|
+
], t.prototype, "headingAs");
|
90
|
+
s([
|
91
|
+
i({ type: Boolean, reflect: !0 })
|
92
|
+
], t.prototype, "small");
|
93
|
+
s([
|
94
|
+
i({ type: Boolean, reflect: !0 })
|
95
|
+
], t.prototype, "truncate");
|
85
96
|
export {
|
86
|
-
|
97
|
+
t as SkfAccordionItem
|
87
98
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
2
|
import { type CSSResultGroup, type PropertyValues } from 'lit';
|
3
|
-
import type { SkfAccordionItemHeadingType } from './accordion-item.js';
|
3
|
+
import type { SkfAccordionItemHeadingType } from './accordion-item.component.js';
|
4
4
|
/**
|
5
5
|
* The `<skf-accordion>` component consists of one or more `<skf-accordion-item>` item(s) working together
|
6
6
|
*
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { SkfElement as p } from "../../internal/components/skf-element.js";
|
2
|
-
import { componentStyles as
|
3
|
-
import { html as
|
2
|
+
import { componentStyles as m } from "../../styles/component.styles.js";
|
3
|
+
import { html as f } from "lit";
|
4
4
|
import { property as a, queryAssignedNodes as d } from "lit/decorators.js";
|
5
5
|
import { classMap as c } from "lit/directives/class-map.js";
|
6
6
|
import { styles as g } from "./accordion.styles.js";
|
7
|
-
var y = Object.defineProperty, s = (u, t, i,
|
8
|
-
for (var r = void 0,
|
9
|
-
(h = u[
|
7
|
+
var y = Object.defineProperty, s = (u, t, i, o) => {
|
8
|
+
for (var r = void 0, l = u.length - 1, h; l >= 0; l--)
|
9
|
+
(h = u[l]) && (r = h(t, i, r) || r);
|
10
10
|
return r && y(t, i, r), r;
|
11
11
|
};
|
12
12
|
const n = class n extends p {
|
@@ -27,15 +27,15 @@ const n = class n extends p {
|
|
27
27
|
_onChildToggle(t) {
|
28
28
|
if (this.multiple || t.defaultPrevented) return;
|
29
29
|
const i = t.target;
|
30
|
-
this.items.length && this.items.forEach((
|
31
|
-
|
30
|
+
this.items.length && this.items.forEach((o) => {
|
31
|
+
o !== i && o.hasAttribute("expanded") && o.setClose();
|
32
32
|
});
|
33
33
|
}
|
34
34
|
render() {
|
35
|
-
return
|
35
|
+
return f`
|
36
36
|
<div class=${c({ "accordion--gap": this.gap })}>
|
37
37
|
<slot
|
38
|
-
@skf-
|
38
|
+
@skf-accordion-item-toggle=${(t) => {
|
39
39
|
this._onChildToggle(t);
|
40
40
|
}}
|
41
41
|
@slotchange=${this._setItemAttributes}
|
@@ -44,7 +44,7 @@ const n = class n extends p {
|
|
44
44
|
`;
|
45
45
|
}
|
46
46
|
};
|
47
|
-
n.styles = [g,
|
47
|
+
n.styles = [g, m];
|
48
48
|
let e = n;
|
49
49
|
s([
|
50
50
|
a({ type: Boolean, reflect: !0 })
|
@@ -7,7 +7,7 @@ import { type CSSResultGroup } from 'lit';
|
|
7
7
|
*
|
8
8
|
* See [zeroheight](https://zeroheight.com/853e936c9/p/990ec5-alert) for design principles
|
9
9
|
*
|
10
|
-
* @event skf-alert-close - Fires when the close button is clicked
|
10
|
+
* @event {CustomEvent} skf-alert-close - Fires when the close button is clicked
|
11
11
|
*
|
12
12
|
* @slot - Alert message. **Notice!** See design principles for approved content
|
13
13
|
* @slot link - Slot for the link
|
@@ -15,6 +15,7 @@ import { type CSSResultGroup } from 'lit';
|
|
15
15
|
* @tagname skf-alert
|
16
16
|
*/
|
17
17
|
export declare class SkfAlert extends SkfElement {
|
18
|
+
#private;
|
18
19
|
static styles: CSSResultGroup;
|
19
20
|
/** Close button aria-label */
|
20
21
|
buttonLabel: string;
|
@@ -24,6 +25,9 @@ export declare class SkfAlert extends SkfElement {
|
|
24
25
|
persistent: boolean;
|
25
26
|
/** If defined, gives the supplied appearance */
|
26
27
|
severity?: Severity;
|
28
|
+
connectedCallback(): void;
|
29
|
+
/** @internal */
|
30
|
+
_handleStateChange(): void;
|
27
31
|
/** @internal */
|
28
32
|
private _handleClose;
|
29
33
|
render(): import("lit").TemplateResult<1>;
|
@@ -1,73 +1,76 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import { componentStyles as y } from "../../styles/component.styles.js";
|
4
|
-
import { nothing as h, html as p } from "lit";
|
5
|
-
import { property as s } from "lit/decorators.js";
|
6
|
-
import { classMap as u } from "lit/directives/class-map.js";
|
7
|
-
import { ifDefined as m } from "lit/directives/if-defined.js";
|
8
|
-
import { styles as v } from "./alert.styles.js";
|
9
|
-
var b = Object.defineProperty, r = (n, l, a, d) => {
|
10
|
-
for (var t = void 0, i = n.length - 1, c; i >= 0; i--)
|
11
|
-
(c = n[i]) && (t = c(l, a, t) || t);
|
12
|
-
return t && b(l, a, t), t;
|
1
|
+
var u = (t) => {
|
2
|
+
throw TypeError(t);
|
13
3
|
};
|
14
|
-
|
4
|
+
var d = (t, e, s) => e.has(t) || u("Cannot " + s);
|
5
|
+
var m = (t, e, s) => (d(t, e, "read from private field"), s ? s.call(t) : e.get(t)), f = (t, e, s) => e.has(t) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), y = (t, e, s, o) => (d(t, e, "write to private field"), o ? o.call(t, s) : e.set(t, s), s);
|
6
|
+
import "../icon/icon.js";
|
7
|
+
import { SkfElement as g } from "../../internal/components/skf-element.js";
|
8
|
+
import { stateMap as C } from "../../internal/helpers/stateMap.js";
|
9
|
+
import { watch as S } from "../../internal/helpers/watch.js";
|
10
|
+
import { componentStyles as $ } from "../../styles/component.styles.js";
|
11
|
+
import { nothing as w, html as v } from "lit";
|
12
|
+
import { property as p } from "lit/decorators.js";
|
13
|
+
import { ifDefined as _ } from "lit/directives/if-defined.js";
|
14
|
+
import { styles as O } from "./alert.styles.js";
|
15
|
+
var P = Object.defineProperty, k = Object.getOwnPropertyDescriptor, l = (t, e, s, o) => {
|
16
|
+
for (var i = o > 1 ? void 0 : o ? k(e, s) : e, c = t.length - 1, h; c >= 0; c--)
|
17
|
+
(h = t[c]) && (i = (o ? h(e, s, i) : h(i)) || i);
|
18
|
+
return o && i && P(e, s, i), i;
|
19
|
+
}, n, a;
|
20
|
+
const b = class b extends g {
|
15
21
|
constructor() {
|
16
|
-
super(...arguments)
|
22
|
+
super(...arguments);
|
23
|
+
f(this, n);
|
24
|
+
f(this, a);
|
25
|
+
y(this, n, this.attachInternals()), y(this, a, m(this, n).states), this.buttonLabel = "Close", this.persistent = !1, this._handleClose = () => {
|
17
26
|
this.emit("skf-alert-close");
|
18
27
|
};
|
19
28
|
}
|
29
|
+
connectedCallback() {
|
30
|
+
super.connectedCallback(), this.role = this.persistent ? "status" : "alert";
|
31
|
+
}
|
32
|
+
_handleStateChange() {
|
33
|
+
const s = ["error", "info", "success", "warning"];
|
34
|
+
C(m(this, a), s).set(this.severity);
|
35
|
+
}
|
20
36
|
render() {
|
21
|
-
return
|
22
|
-
<div
|
23
|
-
aria-describedby="main"
|
24
|
-
class=${u({
|
25
|
-
alert: !0,
|
26
|
-
"alert--severity-error": this.severity === "error",
|
27
|
-
"alert--severity-info": this.severity === "info",
|
28
|
-
"alert--severity-success": this.severity === "success",
|
29
|
-
"alert--severity-warning": this.severity === "warning",
|
30
|
-
[this.className]: !0
|
31
|
-
})}
|
32
|
-
role=${this.persistent ? "status" : "alert"}
|
33
|
-
>
|
37
|
+
return v`
|
38
|
+
<div id="root">
|
34
39
|
<skf-icon
|
35
|
-
color=${
|
36
|
-
name=${
|
40
|
+
color=${_(this.severity ?? "secondary")}
|
41
|
+
name=${_(this.icon ?? "info")}
|
37
42
|
size="sm"
|
38
43
|
></skf-icon>
|
39
|
-
<div
|
40
|
-
<slot
|
44
|
+
<div id="body">
|
45
|
+
<slot id="main"></slot>
|
41
46
|
<slot name="link"></slot>
|
42
47
|
</div>
|
43
|
-
${this.persistent ?
|
44
|
-
<button
|
45
|
-
@click="${this._handleClose}"
|
46
|
-
aria-label=${this.buttonLabel}
|
47
|
-
class="alert__btn"
|
48
|
-
type="button"
|
49
|
-
>
|
48
|
+
${this.persistent ? v`
|
49
|
+
<button @click="${this._handleClose}" aria-label=${this.buttonLabel} type="button">
|
50
50
|
<skf-icon name="close" size="sm"></skf-icon>
|
51
51
|
</button>
|
52
|
-
` :
|
52
|
+
` : w}
|
53
53
|
</div>
|
54
54
|
`;
|
55
55
|
}
|
56
56
|
};
|
57
|
-
|
58
|
-
let
|
59
|
-
|
60
|
-
|
61
|
-
],
|
62
|
-
|
63
|
-
|
64
|
-
],
|
65
|
-
|
66
|
-
|
67
|
-
],
|
68
|
-
|
69
|
-
|
70
|
-
],
|
57
|
+
n = new WeakMap(), a = new WeakMap(), b.styles = [$, O];
|
58
|
+
let r = b;
|
59
|
+
l([
|
60
|
+
p({ type: String, attribute: "button-label" })
|
61
|
+
], r.prototype, "buttonLabel", 2);
|
62
|
+
l([
|
63
|
+
p({ type: String })
|
64
|
+
], r.prototype, "icon", 2);
|
65
|
+
l([
|
66
|
+
p({ type: Boolean })
|
67
|
+
], r.prototype, "persistent", 2);
|
68
|
+
l([
|
69
|
+
p({ type: String })
|
70
|
+
], r.prototype, "severity", 2);
|
71
|
+
l([
|
72
|
+
S("severity")
|
73
|
+
], r.prototype, "_handleStateChange", 1);
|
71
74
|
export {
|
72
|
-
|
75
|
+
r as SkfAlert
|
73
76
|
};
|
@@ -1,63 +1,67 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
2
|
const s = r`
|
3
|
-
/* stylelint-disable selector-class-pattern */
|
4
3
|
@layer components {
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
@layer base {
|
5
|
+
:host {
|
6
|
+
contain: layout;
|
7
|
+
}
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
var(--_skf-alert-border-color, var(--skf-border-color-primary));
|
13
|
-
border-radius: var(--skf-border-radius-sm);
|
14
|
-
box-shadow: var(--skf-shadow-md);
|
15
|
-
display: flex;
|
16
|
-
font-size: var(--skf-font-size-75);
|
17
|
-
gap: var(--skf-spacing-50);
|
18
|
-
padding-block: var(--skf-spacing-75);
|
19
|
-
padding-inline: var(--skf-spacing-50);
|
20
|
-
}
|
9
|
+
#root {
|
10
|
+
--_skf-alert-bg-color: var(--skf-bg-color-neutral-2);
|
11
|
+
--_skf-alert-border-color: var(--skf-border-color-primary);
|
21
12
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
background-color: var(--_skf-alert-bg-color);
|
14
|
+
border: var(--skf-border-width-sm) solid var(--_skf-alert-border-color);
|
15
|
+
border-radius: var(--skf-border-radius-sm);
|
16
|
+
box-shadow: var(--skf-shadow-md);
|
17
|
+
display: flex;
|
18
|
+
font-size: var(--skf-font-size-75);
|
19
|
+
gap: var(--skf-spacing-50);
|
20
|
+
padding-block: var(--skf-spacing-75);
|
21
|
+
padding-inline: var(--skf-spacing-50);
|
22
|
+
}
|
26
23
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
#body {
|
25
|
+
display: flex;
|
26
|
+
flex: auto;
|
27
|
+
flex-wrap: wrap;
|
28
|
+
gap: var(--skf-spacing-25) var(--skf-spacing-100);
|
29
|
+
justify-content: space-between;
|
30
|
+
}
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
32
|
+
#main {
|
33
|
+
display: block;
|
34
|
+
}
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
36
|
+
button {
|
37
|
+
display: inline-flex;
|
38
|
+
}
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
flex-wrap: wrap;
|
46
|
-
gap: var(--skf-spacing-25) var(--skf-spacing-100);
|
47
|
-
justify-content: space-between;
|
40
|
+
::slotted(skf-link) {
|
41
|
+
text-transform: uppercase;
|
42
|
+
}
|
48
43
|
}
|
49
44
|
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
@layer mods {
|
46
|
+
:host(:state(error)) #root {
|
47
|
+
--_skf-alert-bg-color: var(--skf-severity-bg-color-error);
|
48
|
+
--_skf-alert-border-color: var(--skf-severity-fg-color-error);
|
49
|
+
}
|
53
50
|
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
:host(:state(info)) #root {
|
52
|
+
--_skf-alert-bg-color: var(--skf-severity-bg-color-info);
|
53
|
+
--_skf-alert-border-color: var(--skf-severity-fg-color-info);
|
54
|
+
}
|
55
|
+
|
56
|
+
:host(:state(success)) #root {
|
57
|
+
--_skf-alert-bg-color: var(--skf-severity-bg-color-success);
|
58
|
+
--_skf-alert-border-color: var(--skf-severity-fg-color-success);
|
59
|
+
}
|
57
60
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
+
:host(:state(warning)) #root {
|
62
|
+
--_skf-alert-bg-color: var(--skf-severity-bg-color-warning);
|
63
|
+
--_skf-alert-border-color: var(--skf-severity-fg-color-warning);
|
64
|
+
}
|
61
65
|
}
|
62
66
|
}
|
63
67
|
`;
|
@@ -1,17 +1,16 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
3
|
-
import { componentStyles as
|
4
|
-
import { html as
|
5
|
-
import { property as
|
6
|
-
import {
|
7
|
-
import { ifDefined as b } from "lit/directives/if-defined.js";
|
2
|
+
import { SkfElement as h } from "../../internal/components/skf-element.js";
|
3
|
+
import { componentStyles as m } from "../../styles/component.styles.js";
|
4
|
+
import { html as n } from "lit";
|
5
|
+
import { property as f, state as _ } from "lit/decorators.js";
|
6
|
+
import { ifDefined as u } from "lit/directives/if-defined.js";
|
8
7
|
import { styles as C } from "./breadcrumb-item.styles.js";
|
9
|
-
var
|
10
|
-
for (var e = r > 1 ? void 0 : r ?
|
11
|
-
(l =
|
12
|
-
return r && e &&
|
8
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, p = (a, t, s, r) => {
|
9
|
+
for (var e = r > 1 ? void 0 : r ? y(t, s) : t, o = a.length - 1, l; o >= 0; o--)
|
10
|
+
(l = a[o]) && (e = (r ? l(t, s, e) : l(e)) || e);
|
11
|
+
return r && e && v(t, s, e), e;
|
13
12
|
};
|
14
|
-
const
|
13
|
+
const c = class c extends h {
|
15
14
|
constructor() {
|
16
15
|
super(...arguments), this._isCurrent = !1, this._clickHandler = (t, s) => {
|
17
16
|
var r;
|
@@ -28,32 +27,32 @@ const n = class n extends f {
|
|
28
27
|
super.connectedCallback(), this.role = "listitem";
|
29
28
|
}
|
30
29
|
render() {
|
31
|
-
return
|
32
|
-
<div
|
33
|
-
${this.href ?
|
30
|
+
return n`
|
31
|
+
<div id="root">
|
32
|
+
${this.href ? n`
|
34
33
|
<a
|
35
34
|
@click=${this._clickHandler}
|
36
|
-
aria-current=${
|
37
|
-
class="
|
35
|
+
aria-current=${u(this._isCurrent ? "page" : void 0)}
|
36
|
+
class="label"
|
38
37
|
href=${this.href}
|
39
38
|
>
|
40
39
|
<slot></slot>
|
41
40
|
</a>
|
42
|
-
` :
|
43
|
-
<span
|
41
|
+
` : n`<slot class="label"></slot>`}
|
42
|
+
<span>/</span>
|
44
43
|
</div>
|
45
44
|
`;
|
46
45
|
}
|
47
46
|
};
|
48
|
-
|
49
|
-
let i =
|
50
|
-
|
51
|
-
|
47
|
+
c.styles = [m, C];
|
48
|
+
let i = c;
|
49
|
+
p([
|
50
|
+
f({ type: String })
|
52
51
|
], i.prototype, "href", 2);
|
53
|
-
|
54
|
-
|
52
|
+
p([
|
53
|
+
f({ attribute: !1 })
|
55
54
|
], i.prototype, "onClick", 1);
|
56
|
-
|
55
|
+
p([
|
57
56
|
_()
|
58
57
|
], i.prototype, "_isCurrent", 2);
|
59
58
|
export {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { SkfBreadcrumbItem } from './breadcrumb-item.component';
|
2
|
-
export * from './breadcrumb-item.component';
|
1
|
+
import { SkfBreadcrumbItem } from './breadcrumb-item.component.js';
|
2
|
+
export * from './breadcrumb-item.component.js';
|
3
3
|
export default SkfBreadcrumbItem;
|
4
4
|
declare global {
|
5
5
|
interface HTMLElementTagNameMap {
|
@@ -1,18 +1,28 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
3
|
-
/* stylelint-disable selector-class-pattern */
|
2
|
+
const e = r`
|
4
3
|
@layer components {
|
5
4
|
:host {
|
6
5
|
contain: layout;
|
7
6
|
}
|
8
7
|
|
9
|
-
|
8
|
+
#root {
|
9
|
+
--_skf-breadcrumb-item-color: inherit;
|
10
|
+
|
10
11
|
align-items: center;
|
11
12
|
display: flex;
|
12
13
|
}
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
span {
|
16
|
+
display: block;
|
17
|
+
margin-inline: var(--skf-spacing-25);
|
18
|
+
|
19
|
+
:host(:last-of-type) & {
|
20
|
+
display: none;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
.label {
|
25
|
+
color: var(--_skf-breadcrumb-item-color);
|
16
26
|
|
17
27
|
&:is(slot) {
|
18
28
|
display: inline;
|
@@ -46,17 +56,8 @@ const o = r`
|
|
46
56
|
}
|
47
57
|
}
|
48
58
|
}
|
49
|
-
|
50
|
-
.breadcrumb-item__separator {
|
51
|
-
display: block;
|
52
|
-
margin-inline: var(--skf-spacing-25);
|
53
|
-
|
54
|
-
:host(:last-of-type) & {
|
55
|
-
display: none;
|
56
|
-
}
|
57
|
-
}
|
58
59
|
}
|
59
60
|
`;
|
60
61
|
export {
|
61
|
-
|
62
|
+
e as styles
|
62
63
|
};
|
@@ -13,17 +13,20 @@ import type { SkfBreadcrumbItem } from './breadcrumb-item.component.js';
|
|
13
13
|
* @tagname skf-breadcrumb
|
14
14
|
*/
|
15
15
|
export declare class SkfBreadcrumb extends SkfElement {
|
16
|
+
#private;
|
16
17
|
static styles: CSSResultGroup;
|
17
18
|
/** aria-label for the breadcrumb control */
|
18
19
|
label: string;
|
19
|
-
/**
|
20
|
-
|
20
|
+
/** If true, renders a smaller version */
|
21
|
+
small: boolean;
|
21
22
|
/** @internal */
|
22
23
|
_isDynamic: boolean;
|
23
24
|
/** @internal */
|
24
25
|
_items: NodeListOf<SkfBreadcrumbItem>;
|
25
26
|
firstUpdated(): void;
|
26
27
|
/** @internal */
|
28
|
+
_handleStateChange(): void;
|
29
|
+
/** @internal */
|
27
30
|
private _handleSlotChange;
|
28
31
|
render(): import("lit").TemplateResult;
|
29
32
|
}
|