@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
package/README.md
CHANGED
@@ -1,13 +1,33 @@
|
|
1
1
|
<div align="center">
|
2
|
-
<!--img alt="Ferris Logotype" src="./.github/assets/ferris_logo_dark.svg" width="128"/ -->
|
3
2
|
|
4
3
|
# SKF UI Components
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div align="center">
|
8
|
+
<a href="https://www.npmjs.com/package/@skf-design-system/ui-components">
|
9
|
+
<img alt="NPM Version" src="https://img.shields.io/npm/v/%40skf-design-system%2Fui-components?style=for-the-badge&logo=npm">
|
10
|
+
</a>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
---
|
14
|
+
|
15
|
+
<div align="center">
|
16
|
+
<a href="https://codesandbox.io/p/sandbox/exciting-leftpad-hz6sgm">
|
17
|
+
<img alt="CodeSandbox" src="https://img.shields.io/badge/Codesandbox-040404?style=for-the-badge&logo=codesandbox&logoColor=DBDBDB" />
|
18
|
+
</a>
|
19
|
+
<a href="https://github.com/SKF-Internal/ui-components/issues">
|
20
|
+
<img alt="GitHub - Issues" src="https://img.shields.io/badge/Issues-%23121011.svg?style=for-the-badge&logo=github&logoColor=white" />
|
21
|
+
</a>
|
22
|
+
<a href="https://teams.microsoft.com/l/team/19%3A15d8521717e14c419998b0fed71289a5%40thread.tacv2/conversations?groupId=286b39ed-ed94-43da-8a3f-383319f6c9dc&tenantId=41875f2b-33e8-4670-92a8-f643afbb243a">
|
23
|
+
<img alt="MS Teams" src="https://img.shields.io/badge/MS Teams-4E5FBF?style=for-the-badge&logo=windows&logoColor=white">
|
24
|
+
</a>
|
25
|
+
<a href="https://beta--641c13cdbf6bbfbd6da88a83.chromatic.com">
|
26
|
+
<img alt="Storybook - Stable" src="https://img.shields.io/badge/Stable-FF4785?style=for-the-badge&logo=storybook&logoColor=white">
|
27
|
+
</a>
|
28
|
+
<a href="https://zeroheight.com/853e936c9/p/07d378-component-overview">
|
29
|
+
<img alt="Storybook - Beta" src="https://img.shields.io/badge/zeroheight-F63E7C?style=for-the-badge">
|
30
|
+
</a>
|
11
31
|
</div>
|
12
32
|
|
13
33
|
## Introduction
|
@@ -1,24 +1,27 @@
|
|
1
|
-
import '
|
2
|
-
import { SkfElement } from '
|
3
|
-
import type { HeadingType } from '
|
4
|
-
import { type CSSResultGroup } from 'lit';
|
1
|
+
import '../collapse/collapse.js';
|
2
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
3
|
+
import type { HeadingType } from '../../internal/constants/heading.js';
|
4
|
+
import { type CSSResultGroup, type PropertyValues } from 'lit';
|
5
5
|
/**
|
6
6
|
* The `<skf-accordion>` component consists of multiple `<skf-collapse>`, working together.
|
7
7
|
*
|
8
|
-
* See [
|
8
|
+
* See [zeroheight](https://zeroheight.com/853e936c9/p/6590bf-accordion) for design principles.
|
9
9
|
*
|
10
10
|
* @slot - Expects one or more <skf-accordion-item> element(s)
|
11
11
|
*
|
12
|
-
* @
|
12
|
+
* @tagname skf-accordion
|
13
13
|
*/
|
14
14
|
export declare class SkfAccordion extends SkfElement {
|
15
15
|
static styles: CSSResultGroup;
|
16
16
|
/** If true, will animate the expand/collapse state */
|
17
17
|
animated?: boolean;
|
18
|
-
/**
|
18
|
+
/**
|
19
|
+
* Defines which heading element will be rendered
|
20
|
+
* @type { "h1" | "h2" | "h3" | "h4" }
|
21
|
+
*/
|
19
22
|
headingAs: Exclude<HeadingType, 'h1'>;
|
20
|
-
/** If
|
21
|
-
gap
|
23
|
+
/** If true, adds a gap between each item */
|
24
|
+
gap: boolean;
|
22
25
|
/** If true, allowes multiple accordion items to open */
|
23
26
|
multiple?: boolean;
|
24
27
|
/** If true, renders the small version */
|
@@ -27,6 +30,7 @@ export declare class SkfAccordion extends SkfElement {
|
|
27
30
|
truncate?: boolean;
|
28
31
|
/** @internal */
|
29
32
|
private $accordionItems;
|
33
|
+
protected updated(_changedProperties: PropertyValues): void;
|
30
34
|
/** @internal */
|
31
35
|
private get items();
|
32
36
|
/** @internal */
|
@@ -1,22 +1,26 @@
|
|
1
1
|
import "../collapse/collapse.js";
|
2
|
-
import { SkfElement as
|
2
|
+
import { SkfElement as h } from "../../internal/components/skf-element.js";
|
3
3
|
import m from "../../styles/component.styles.js";
|
4
|
-
import { html as
|
5
|
-
import { property as
|
6
|
-
import c from "
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
import { html as f } from "lit";
|
5
|
+
import { property as a, queryAssignedNodes as d } from "lit/decorators.js";
|
6
|
+
import { classMap as c } from "lit/directives/class-map.js";
|
7
|
+
import { styles as g } from "./accordion.styles.js";
|
8
|
+
var y = Object.defineProperty, s = (p, t, i, o) => {
|
9
|
+
for (var r = void 0, l = p.length - 1, u; l >= 0; l--)
|
10
|
+
(u = p[l]) && (r = u(t, i, r) || r);
|
11
|
+
return r && y(t, i, r), r;
|
11
12
|
};
|
12
|
-
const n = class n extends
|
13
|
+
const n = class n extends h {
|
13
14
|
constructor() {
|
14
|
-
super(...arguments), this.headingAs = "h2", this._setItemAttributes = () => {
|
15
|
+
super(...arguments), this.headingAs = "h2", this.gap = !1, this._setItemAttributes = () => {
|
15
16
|
this.items.forEach((t) => {
|
16
|
-
t.setAttribute("heading-as", this.headingAs), this.animated
|
17
|
+
t.setAttribute("heading-as", this.headingAs), this.animated ? t.setAttribute("animated", "") : t.hasAttribute("animated") && t.removeAttribute("animated"), this.small ? t.setAttribute("small", "") : t.hasAttribute("small") && t.removeAttribute("small"), this.truncate ? t.setAttribute("truncate", "") : t.hasAttribute("truncate") && t.removeAttribute("truncate");
|
17
18
|
});
|
18
19
|
};
|
19
20
|
}
|
21
|
+
updated(t) {
|
22
|
+
(t.has("animated") || t.has("headingAs") || t.has("small") || t.has("truncate")) && this._setItemAttributes();
|
23
|
+
}
|
20
24
|
/** @internal */
|
21
25
|
get items() {
|
22
26
|
return [...this.$accordionItems].filter((t) => t.localName === "skf-accordion-item");
|
@@ -24,13 +28,13 @@ const n = class n extends u {
|
|
24
28
|
_onChildToggle(t) {
|
25
29
|
if (this.multiple || t.defaultPrevented) return;
|
26
30
|
const i = t.target;
|
27
|
-
this.items.length && this.items.forEach((
|
28
|
-
|
31
|
+
this.items.length && this.items.forEach((o) => {
|
32
|
+
o !== i && o.hasAttribute("expanded") && o.setClose();
|
29
33
|
});
|
30
34
|
}
|
31
35
|
render() {
|
32
|
-
return
|
33
|
-
<div
|
36
|
+
return f`
|
37
|
+
<div class=${c({ "accordion--gap": this.gap })}>
|
34
38
|
<slot
|
35
39
|
@skf-collapse-toggle=${(t) => {
|
36
40
|
this._onChildToggle(t);
|
@@ -41,28 +45,28 @@ const n = class n extends u {
|
|
41
45
|
`;
|
42
46
|
}
|
43
47
|
};
|
44
|
-
n.styles = [
|
48
|
+
n.styles = [g, m];
|
45
49
|
let e = n;
|
46
|
-
|
47
|
-
|
50
|
+
s([
|
51
|
+
a({ type: Boolean, reflect: !0 })
|
48
52
|
], e.prototype, "animated");
|
49
|
-
|
50
|
-
|
53
|
+
s([
|
54
|
+
a({ attribute: "heading-as" })
|
51
55
|
], e.prototype, "headingAs");
|
52
|
-
|
53
|
-
|
56
|
+
s([
|
57
|
+
a({ type: Boolean, reflect: !0 })
|
54
58
|
], e.prototype, "gap");
|
55
|
-
|
56
|
-
|
59
|
+
s([
|
60
|
+
a({ type: Boolean })
|
57
61
|
], e.prototype, "multiple");
|
58
|
-
|
59
|
-
|
62
|
+
s([
|
63
|
+
a({ type: Boolean, reflect: !0 })
|
60
64
|
], e.prototype, "small");
|
61
|
-
|
62
|
-
|
65
|
+
s([
|
66
|
+
a({ type: Boolean, reflect: !0 })
|
63
67
|
], e.prototype, "truncate");
|
64
|
-
|
65
|
-
|
68
|
+
s([
|
69
|
+
d()
|
66
70
|
], e.prototype, "$accordionItems");
|
67
71
|
export {
|
68
72
|
e as SkfAccordion
|
@@ -1,2 +1 @@
|
|
1
|
-
declare const
|
2
|
-
export default _default;
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { css as
|
2
|
-
const
|
1
|
+
import { css as s } from "lit";
|
2
|
+
const l = s`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
3
4
|
@layer components {
|
4
|
-
|
5
|
+
.accordion--gap {
|
5
6
|
display: flex;
|
6
7
|
flex-direction: column;
|
7
8
|
gap: var(--skf-spacing-300);
|
@@ -9,5 +10,5 @@ const a = o`
|
|
9
10
|
}
|
10
11
|
`;
|
11
12
|
export {
|
12
|
-
|
13
|
+
l as styles
|
13
14
|
};
|
@@ -1,29 +1,32 @@
|
|
1
|
-
import type { SkfIcon } from '
|
2
|
-
import '
|
3
|
-
import { SkfElement } from '
|
1
|
+
import type { SkfIcon } from '../icon/icon.component.js';
|
2
|
+
import '../icon/icon.js';
|
3
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
4
4
|
import type { SeverityFgColor } from '@skf-design-system/ui-assets';
|
5
5
|
import { type CSSResultGroup } from 'lit';
|
6
6
|
/**
|
7
7
|
* The `<skf-alert>` is a type of notification that appears in-line
|
8
8
|
*
|
9
|
-
* @documentation See [
|
9
|
+
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/990ec5-alert) for design principles
|
10
10
|
*
|
11
11
|
* @event skf-alert-close - Fires when the close button is clicked
|
12
12
|
*
|
13
13
|
* @slot - Alert message. **Notice!** See design principles for approved content
|
14
|
-
* @slot link -
|
14
|
+
* @slot link - Slot for the link
|
15
15
|
*
|
16
16
|
* @tagname skf-alert
|
17
17
|
*/
|
18
18
|
export declare class SkfAlert extends SkfElement {
|
19
19
|
static styles: CSSResultGroup;
|
20
|
-
/** If true, alert is being used as a toast with an close button */
|
20
|
+
/** If true, alert is being used as a toast (alertdialog) with an close button */
|
21
21
|
closeable?: boolean;
|
22
22
|
/** Close button aria-label */
|
23
23
|
buttonLabel: string;
|
24
24
|
/** If defined, displays leading icon */
|
25
25
|
icon?: SkfIcon['name'];
|
26
|
-
/**
|
26
|
+
/**
|
27
|
+
* If defined, gives the supplied appearance
|
28
|
+
* @type { "error" | "info" | "warning" | "success" | "alert" }
|
29
|
+
*/
|
27
30
|
severity?: SeverityFgColor;
|
28
31
|
/** @internal */
|
29
32
|
private _handleClose;
|
@@ -1,40 +1,53 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
2
|
+
import { SkfElement as y } from "../../internal/components/skf-element.js";
|
3
3
|
import b from "../../styles/component.styles.js";
|
4
|
-
import { html as
|
5
|
-
import { property as
|
6
|
-
import {
|
7
|
-
import
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
import { html as p, nothing as f } from "lit";
|
5
|
+
import { property as r } from "lit/decorators.js";
|
6
|
+
import { classMap as h } from "lit/directives/class-map.js";
|
7
|
+
import { ifDefined as o } from "lit/directives/if-defined.js";
|
8
|
+
import { styles as v } from "./alert.styles.js";
|
9
|
+
var u = Object.defineProperty, s = (a, n, c, d) => {
|
10
|
+
for (var e = void 0, i = a.length - 1, m; i >= 0; i--)
|
11
|
+
(m = a[i]) && (e = m(n, c, e) || e);
|
12
|
+
return e && u(n, c, e), e;
|
12
13
|
};
|
13
|
-
const l = class l extends
|
14
|
+
const l = class l extends y {
|
14
15
|
constructor() {
|
15
|
-
super(...arguments), this.buttonLabel = "Close", this._handleClose = () =>
|
16
|
+
super(...arguments), this.buttonLabel = "Close", this._handleClose = () => {
|
17
|
+
this.emit("skf-alert-close");
|
18
|
+
};
|
16
19
|
}
|
17
20
|
render() {
|
18
|
-
return
|
21
|
+
return p`
|
19
22
|
<div
|
20
|
-
id="alert"
|
21
23
|
aria-describedby="main"
|
22
|
-
aria-modal=${
|
24
|
+
aria-modal=${o(this.closeable && "true")}
|
25
|
+
class=${h({
|
26
|
+
alert: !0,
|
27
|
+
"alert--severity-alert": this.severity === "alert",
|
28
|
+
"alert--severity-error": this.severity === "error",
|
29
|
+
"alert--severity-info": this.severity === "info",
|
30
|
+
"alert--severity-success": this.severity === "success",
|
31
|
+
"alert--severity-warning": this.severity === "warning"
|
32
|
+
})}
|
23
33
|
role=${this.closeable ? "alertdialog" : "alert"}
|
24
34
|
>
|
25
35
|
<skf-icon
|
26
|
-
color=${
|
27
|
-
name=${
|
36
|
+
color=${o(this.severity ?? "secondary")}
|
37
|
+
name=${o(this.icon)}
|
28
38
|
size="sm"
|
29
39
|
></skf-icon>
|
30
|
-
<div
|
31
|
-
<
|
32
|
-
<slot></slot>
|
33
|
-
</div>
|
40
|
+
<div class="alert__body">
|
41
|
+
<slot class="alert__main" id="main"></slot>
|
34
42
|
<slot name="link"></slot>
|
35
43
|
</div>
|
36
|
-
${this.closeable ?
|
37
|
-
<button
|
44
|
+
${this.closeable ? p`
|
45
|
+
<button
|
46
|
+
@click="${this._handleClose}"
|
47
|
+
aria-label=${this.buttonLabel}
|
48
|
+
class="alert__btn"
|
49
|
+
type="button"
|
50
|
+
>
|
38
51
|
<skf-icon name="close" size="sm"></skf-icon>
|
39
52
|
</button>
|
40
53
|
` : f}
|
@@ -42,20 +55,20 @@ const l = class l extends c {
|
|
42
55
|
`;
|
43
56
|
}
|
44
57
|
};
|
45
|
-
l.styles = [b,
|
46
|
-
let
|
47
|
-
|
48
|
-
|
49
|
-
],
|
50
|
-
|
51
|
-
|
52
|
-
],
|
53
|
-
|
54
|
-
|
55
|
-
],
|
56
|
-
|
57
|
-
|
58
|
-
],
|
58
|
+
l.styles = [b, v];
|
59
|
+
let t = l;
|
60
|
+
s([
|
61
|
+
r({ type: Boolean, reflect: !0 })
|
62
|
+
], t.prototype, "closeable");
|
63
|
+
s([
|
64
|
+
r({ attribute: "button-label" })
|
65
|
+
], t.prototype, "buttonLabel");
|
66
|
+
s([
|
67
|
+
r()
|
68
|
+
], t.prototype, "icon");
|
69
|
+
s([
|
70
|
+
r({ reflect: !0 })
|
71
|
+
], t.prototype, "severity");
|
59
72
|
export {
|
60
|
-
|
73
|
+
t as SkfAlert
|
61
74
|
};
|
@@ -1,2 +1 @@
|
|
1
|
-
declare const
|
2
|
-
export default _default;
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -1,63 +1,71 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
2
|
const s = r`
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
4
|
+
@layer components {
|
5
|
+
:host {
|
6
|
+
contain: layout;
|
7
|
+
}
|
8
|
+
|
9
|
+
.alert {
|
10
|
+
background-color: var(--_skf-alert-bg-color, var(--skf-bg-color-neutral-2));
|
11
|
+
border: var(--skf-border-width-sm) solid
|
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
|
+
}
|
6
21
|
|
7
|
-
|
8
|
-
background-color: var(--_skf-alert-bg-color, var(--skf-bg-color-neutral-2));
|
9
|
-
border: var(--skf-border-width-sm) solid
|
10
|
-
var(--_skf-alert-border-color, var(--skf-border-color-primary));
|
11
|
-
border-radius: var(--skf-border-radius-sm);
|
12
|
-
box-shadow: var(--skf-shadow-md);
|
13
|
-
display: flex;
|
14
|
-
font-size: var(--skf-font-size-75);
|
15
|
-
gap: var(--skf-spacing-50);
|
16
|
-
padding-block: var(--skf-spacing-75);
|
17
|
-
padding-inline: var(--skf-spacing-50);
|
18
|
-
|
19
|
-
:host([severity='alert']) & {
|
22
|
+
.alert--severity-alert {
|
20
23
|
--_skf-alert-bg-color: var(--skf-severity-bg-color-alert);
|
21
24
|
--_skf-alert-border-color: var(--skf-severity-fg-color-alert);
|
22
25
|
}
|
23
26
|
|
24
|
-
|
27
|
+
.alert--severity-error {
|
25
28
|
--_skf-alert-bg-color: var(--skf-severity-bg-color-error);
|
26
29
|
--_skf-alert-border-color: var(--skf-severity-fg-color-error);
|
27
30
|
}
|
28
31
|
|
29
|
-
|
32
|
+
.alert--severity-info {
|
30
33
|
--_skf-alert-bg-color: var(--skf-severity-bg-color-info);
|
31
34
|
--_skf-alert-border-color: var(--skf-severity-fg-color-info);
|
32
35
|
}
|
33
36
|
|
34
|
-
|
37
|
+
.alert--severity-success {
|
35
38
|
--_skf-alert-bg-color: var(--skf-severity-bg-color-success);
|
36
39
|
--_skf-alert-border-color: var(--skf-severity-fg-color-success);
|
37
40
|
}
|
38
41
|
|
39
|
-
|
42
|
+
.alert--severity-warning {
|
40
43
|
--_skf-alert-bg-color: var(--skf-severity-bg-color-warning);
|
41
44
|
--_skf-alert-border-color: var(--skf-severity-fg-color-warning);
|
42
45
|
}
|
43
|
-
}
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
.alert__body {
|
48
|
+
display: flex;
|
49
|
+
flex: auto;
|
50
|
+
flex-wrap: wrap;
|
51
|
+
gap: var(--skf-spacing-25) var(--skf-spacing-100);
|
52
|
+
justify-content: space-between;
|
53
|
+
}
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
.alert__main {
|
56
|
+
display: block;
|
57
|
+
}
|
56
58
|
|
57
|
-
|
58
|
-
|
59
|
+
::slotted(skf-link) {
|
60
|
+
text-transform: uppercase;
|
61
|
+
}
|
62
|
+
|
63
|
+
.alert__btn {
|
64
|
+
cursor: pointer;
|
65
|
+
display: inline-flex;
|
66
|
+
}
|
59
67
|
}
|
60
68
|
`;
|
61
69
|
export {
|
62
|
-
s as
|
70
|
+
s as styles
|
63
71
|
};
|
@@ -1,19 +1,29 @@
|
|
1
|
-
import type { SkfIcon } from '
|
2
|
-
import '
|
3
|
-
import '
|
4
|
-
import { SkfElement } from '
|
1
|
+
import type { SkfIcon } from '../icon/icon.component.js';
|
2
|
+
import '../icon/icon.js';
|
3
|
+
import '../loader/loader.js';
|
4
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
5
5
|
import { type CSSResultGroup, type PropertyValues } from 'lit';
|
6
6
|
/**
|
7
7
|
* Component to be used in forms or for interactivity
|
8
8
|
*
|
9
9
|
* @slot - The Primary content
|
10
10
|
*
|
11
|
+
* @event click - Fires when the button is clicked
|
12
|
+
*
|
11
13
|
* @tagname skf-button
|
12
14
|
*/
|
13
15
|
export declare class SkfButton extends SkfElement {
|
16
|
+
static formAssociated: boolean;
|
17
|
+
static shadowRootOptions: {
|
18
|
+
delegatesFocus: boolean;
|
19
|
+
mode: ShadowRootMode;
|
20
|
+
serializable?: boolean;
|
21
|
+
slotAssignment?: SlotAssignmentMode;
|
22
|
+
};
|
14
23
|
static styles: CSSResultGroup;
|
15
24
|
/** @internal */
|
16
25
|
private _transitionOptions;
|
26
|
+
_internals: ElementInternals;
|
17
27
|
/** If true, gives destructive appearance. **Notice!** Only applicable if `variant` is `primary`. */
|
18
28
|
destructive: boolean;
|
19
29
|
/** If true, removes border */
|
@@ -25,6 +35,7 @@ export declare class SkfButton extends SkfElement {
|
|
25
35
|
iconPosition?: 'left' | 'right';
|
26
36
|
/** If true, hides text & icon and shows loading indicator. **Notice!** Only applicable if `variant` is `primary`. */
|
27
37
|
loading: boolean;
|
38
|
+
noValidate: boolean;
|
28
39
|
/** If provided, displays an alternative size */
|
29
40
|
size: 'sm' | 'md' | 'lg';
|
30
41
|
/** If provided, changes the button type */
|
@@ -38,9 +49,22 @@ export declare class SkfButton extends SkfElement {
|
|
38
49
|
private $loader?;
|
39
50
|
/** @internal */
|
40
51
|
private $body?;
|
52
|
+
/** @internal */
|
53
|
+
private $button?;
|
54
|
+
constructor();
|
41
55
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
42
56
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
57
|
+
/** @internal */
|
58
|
+
_handleClick: (e: MouseEvent) => void;
|
59
|
+
/** @internal */
|
60
|
+
_submitForm: () => void;
|
61
|
+
/** @internal */
|
62
|
+
_resetForm: () => void;
|
63
|
+
/** Simulates a click on the button. */
|
64
|
+
click(): void;
|
65
|
+
/** @internal */
|
43
66
|
private _showLoader;
|
67
|
+
/** @internal */
|
44
68
|
private _hideLoader;
|
45
69
|
/** @internal */
|
46
70
|
private _renderIcon;
|