@skf-design-system/ui-components 1.0.0-alpha.29 → 1.0.0-alpha.31
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-item.d.ts +1 -1
- package/dist/components/accordion/accordion.component.d.ts +4 -4
- package/dist/components/accordion/accordion.component.js +18 -17
- 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 +3 -3
- package/dist/components/alert/alert.component.js +44 -33
- package/dist/components/alert/alert.styles.d.ts +1 -2
- package/dist/components/alert/alert.styles.js +29 -24
- package/dist/components/button/button.component.d.ts +6 -4
- package/dist/components/button/button.component.js +59 -47
- package/dist/components/button/button.styles.js +55 -45
- package/dist/components/card/card.component.d.ts +4 -4
- package/dist/components/card/card.component.js +35 -24
- package/dist/components/card/card.styles.d.ts +1 -2
- package/dist/components/card/card.styles.js +14 -12
- package/dist/components/checkbox/checkbox.component.d.ts +3 -3
- package/dist/components/collapse/collapse.component.d.ts +8 -8
- package/dist/components/collapse/collapse.component.js +42 -34
- package/dist/components/collapse/collapse.styles.js +15 -14
- 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 +3 -3
- package/dist/components/divider/divider.component.js +39 -27
- package/dist/components/divider/divider.styles.d.ts +1 -2
- package/dist/components/divider/divider.styles.js +26 -26
- package/dist/components/heading/heading.component.d.ts +2 -2
- package/dist/components/icon/icon.component.d.ts +7 -8
- package/dist/components/icon/icon.component.js +51 -29
- package/dist/components/icon/icon.styles.js +53 -47
- package/dist/components/input/input.component.d.ts +4 -4
- package/dist/components/link/link.component.d.ts +7 -6
- package/dist/components/link/link.component.js +33 -27
- package/dist/components/link/link.styles.js +36 -40
- package/dist/components/loader/loader.component.d.ts +2 -2
- package/dist/components/loader/loader.component.js +32 -25
- package/dist/components/loader/loader.styles.js +11 -10
- package/dist/components/logo/logo.component.d.ts +3 -3
- 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 +11 -9
- package/dist/components/menu/menu.component.d.ts +24 -0
- package/dist/components/menu/menu.component.js +18 -0
- package/dist/components/menu/menu.d.ts +8 -0
- package/dist/components/menu/menu.js +6 -0
- package/dist/components/menu/menu.styles.d.ts +1 -0
- package/dist/components/menu/menu.styles.js +11 -0
- package/dist/components/menu-item/menu-item.component.d.ts +25 -0
- package/dist/components/menu-item/menu-item.component.js +13 -0
- package/dist/components/menu-item/menu-item.d.ts +8 -0
- package/dist/components/menu-item/menu-item.js +6 -0
- package/dist/components/menu-item/menu-item.styles.d.ts +1 -0
- package/dist/components/menu-item/menu-item.styles.js +19 -0
- package/dist/components/popover/popover.component.d.ts +29 -0
- package/dist/components/popover/popover.component.js +37 -0
- package/dist/components/popover/popover.d.ts +8 -0
- package/dist/components/popover/popover.js +6 -0
- package/dist/components/popover/popover.styles.d.ts +1 -0
- package/dist/components/popover/popover.styles.js +12 -0
- package/dist/components/progress/progress.component.d.ts +2 -2
- package/dist/components/progress/progress.component.js +31 -22
- package/dist/components/progress/progress.styles.js +19 -18
- package/dist/components/radio/radio.component.d.ts +3 -3
- package/dist/components/select/select.component.d.ts +10 -12
- package/dist/components/select/select.component.js +115 -118
- package/dist/components/select/select.controllers.d.ts +1 -26
- package/dist/components/select/select.controllers.js +35 -95
- package/dist/components/select-option/select-option.component.d.ts +1 -1
- 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/stepper/stepper.component.d.ts +38 -0
- package/dist/components/stepper/stepper.component.js +91 -0
- package/dist/components/stepper/stepper.d.ts +8 -0
- package/dist/components/stepper/stepper.helpers.d.ts +16 -0
- package/dist/components/stepper/stepper.helpers.js +18 -0
- package/dist/components/stepper/stepper.js +6 -0
- package/dist/components/stepper/stepper.styles.d.ts +1 -0
- package/dist/components/stepper/stepper.styles.js +15 -0
- package/dist/components/stepper-item/stepper-item.component.d.ts +47 -0
- package/dist/components/stepper-item/stepper-item.component.js +113 -0
- package/dist/components/stepper-item/stepper-item.d.ts +8 -0
- package/dist/components/stepper-item/stepper-item.js +6 -0
- package/dist/components/stepper-item/stepper-item.styles.d.ts +1 -0
- package/dist/components/stepper-item/stepper-item.styles.js +98 -0
- package/dist/components/switch/switch.component.d.ts +2 -2
- package/dist/components/switch/switch.component.js +13 -6
- package/dist/components/switch/switch.styles.js +16 -13
- package/dist/components/tab/tab.component.d.ts +2 -2
- package/dist/components/tab-group/tab-group.component.d.ts +2 -2
- package/dist/components/tab-panel/tab-panel.component.d.ts +1 -1
- package/dist/components/tag/tag.component.d.ts +2 -2
- package/dist/components/tag/tag.component.js +61 -45
- package/dist/components/tag/tag.styles.js +30 -28
- package/dist/components/textarea/textarea.component.d.ts +4 -4
- package/dist/components/toast/toast.component.d.ts +1 -1
- package/dist/components/toast/toast.singleton.d.ts +3 -3
- package/dist/components/toast-item/toast-item.component.d.ts +1 -1
- package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +2 -2
- package/dist/components/tooltip/tooltip.component.d.ts +24 -0
- package/dist/components/tooltip/tooltip.component.js +18 -0
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/components/tooltip/tooltip.js +6 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
- package/dist/components/tooltip/tooltip.styles.js +12 -0
- package/dist/custom-elements.json +1329 -79
- package/dist/index.d.ts +7 -0
- package/dist/index.js +73 -52
- package/dist/internal/base-classes/popover/popover.base.d.ts +29 -0
- package/dist/internal/base-classes/popover/popover.base.js +116 -0
- package/dist/internal/base-classes/popover/popover.styles.d.ts +1 -0
- package/dist/internal/base-classes/popover/popover.styles.js +29 -0
- package/dist/internal/components/hint/hint.component.d.ts +2 -2
- package/dist/internal/components/skf-element.js +26 -25
- package/dist/internal/controllers/popover.controller.d.ts +16 -0
- package/dist/internal/controllers/popover.controller.js +44 -0
- package/dist/internal/helpers/hintSeverity.d.ts +2 -2
- package/dist/internal/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +7 -6
- package/dist/react/index.d.ts +7 -0
- package/dist/react/index.js +7 -0
- package/dist/react/skf-dialog/index.d.ts +15 -0
- package/dist/react/skf-dialog/index.js +19 -0
- package/dist/react/skf-menu/index.d.ts +12 -0
- package/dist/react/skf-menu/index.js +18 -0
- package/dist/react/skf-menu-item/index.d.ts +27 -0
- package/dist/react/skf-menu-item/index.js +23 -0
- package/dist/react/skf-popover/index.d.ts +12 -0
- package/dist/react/skf-popover/index.js +18 -0
- package/dist/react/skf-stepper/index.d.ts +9 -0
- package/dist/react/skf-stepper/index.js +17 -0
- package/dist/react/skf-stepper-item/index.d.ts +9 -0
- package/dist/react/skf-stepper-item/index.js +17 -0
- package/dist/react/skf-tooltip/index.d.ts +12 -0
- package/dist/react/skf-tooltip/index.js +18 -0
- package/dist/styles/component.styles.js +15 -2
- package/dist/types/jsx/custom-element-jsx.d.ts +1263 -228
- package/dist/types/vue/index.d.ts +260 -2
- package/dist/vscode.html-custom-data.json +335 -8
- package/dist/web-types.json +623 -38
- package/package.json +31 -30
- package/custom-elements.json +0 -18265
@@ -1,12 +1,13 @@
|
|
1
1
|
import { css as o } from "lit";
|
2
2
|
const r = o`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
3
4
|
@layer components {
|
4
5
|
:host {
|
5
6
|
contain: initial;
|
6
7
|
display: inline-flex;
|
7
8
|
}
|
8
9
|
|
9
|
-
|
10
|
+
.btn {
|
10
11
|
background-color: var(--_skf-button-state-bg-color, var(--_skf-button-bg-color));
|
11
12
|
block-size: var(--_skf-button-block-size);
|
12
13
|
border: var(--skf-border-width-sm) solid
|
@@ -16,10 +17,13 @@ const r = o`
|
|
16
17
|
font-size: var(--_skf-button-font-size, var(--skf-font-size-100));
|
17
18
|
font-weight: var(--skf-font-weight-bold);
|
18
19
|
max-inline-size: min(100%, 23ch);
|
19
|
-
min-inline-size: 64px;
|
20
|
-
padding-inline: var(--skf-spacing-100);
|
21
20
|
position: relative;
|
22
21
|
|
22
|
+
&:not(.btn--icon-only) {
|
23
|
+
min-inline-size: 64px;
|
24
|
+
padding-inline: var(--skf-spacing-100);
|
25
|
+
}
|
26
|
+
|
23
27
|
/**
|
24
28
|
* State
|
25
29
|
*/
|
@@ -41,67 +45,73 @@ const r = o`
|
|
41
45
|
&:active:not(:disabled) {
|
42
46
|
--_skf-button-state-bg-color: var(--_skf-button-bg-color-active);
|
43
47
|
}
|
48
|
+
}
|
44
49
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
--_skf-button-block-size: var(--skf-size-32);
|
50
|
-
--_skf-button-font-size: var(--skf-font-size-75);
|
51
|
-
}
|
50
|
+
.btn--icon-only {
|
51
|
+
aspect-ratio: 1;
|
52
|
+
place-items: center;
|
53
|
+
}
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
/**
|
56
|
+
* Size
|
57
|
+
*/
|
58
|
+
.btn--size-sm {
|
59
|
+
--_skf-button-block-size: var(--skf-size-32);
|
60
|
+
--_skf-button-font-size: var(--skf-font-size-75);
|
61
|
+
}
|
56
62
|
|
57
|
-
|
58
|
-
|
59
|
-
|
63
|
+
.btn--size-md {
|
64
|
+
--_skf-button-block-size: var(--skf-size-44);
|
65
|
+
}
|
60
66
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
:host([variant='primary']) & {
|
65
|
-
--_skf-button-bg-color: var(--skf-interactive-bg-color-primary);
|
66
|
-
--_skf-button-bg-color-disabled: var(--skf-interactive-bg-color-disabled);
|
67
|
-
--_skf-button-bg-color-active: var(--skf-interactive-bg-color-primary-active);
|
68
|
-
--_skf-button-bg-color-hover: var(--skf-interactive-bg-color-primary-hover);
|
69
|
-
--_skf-button-border-color: transparent;
|
70
|
-
--_skf-button-color: var(--skf-text-color-inverse);
|
71
|
-
--_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
|
72
|
-
}
|
67
|
+
.btn--size-lg {
|
68
|
+
--_skf-button-block-size: var(--skf-size-56);
|
69
|
+
}
|
73
70
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
71
|
+
/**
|
72
|
+
* Variants
|
73
|
+
*/
|
74
|
+
.btn--variant-primary {
|
75
|
+
--_skf-button-bg-color: var(--skf-interactive-bg-color-primary);
|
76
|
+
--_skf-button-bg-color-disabled: var(--skf-interactive-bg-color-disabled);
|
77
|
+
--_skf-button-bg-color-active: var(--skf-interactive-bg-color-primary-active);
|
78
|
+
--_skf-button-bg-color-hover: var(--skf-interactive-bg-color-primary-hover);
|
79
|
+
--_skf-button-border-color: transparent;
|
80
|
+
--_skf-button-color: var(--skf-text-color-inverse);
|
81
|
+
--_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
|
82
|
+
}
|
83
83
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
84
|
+
.btn--variant-secondary {
|
85
|
+
--_skf-button-bg-color: var(--skf-interactive-bg-color-secondary);
|
86
|
+
--_skf-button-bg-color-active: var(--skf-interactive-bg-color-secondary-active);
|
87
|
+
--_skf-button-bg-color-hover: var(--skf-interactive-bg-color-secondary-hover);
|
88
|
+
--_skf-button-border-color: var(--skf-border-color-emphasised);
|
89
|
+
--_skf-button-border-color-disabled: var(--skf-interactive-border-color-disabled);
|
90
|
+
--_skf-button-color: var(--skf-text-color-emphasised);
|
91
|
+
--_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
|
92
|
+
}
|
93
|
+
|
94
|
+
.btn--destructive:not(.btn--variant-secondary) {
|
95
|
+
--_skf-button-bg-color: var(--skf-interactive-bg-color-destructive);
|
96
|
+
--_skf-button-bg-color-active: var(--skf-interactive-bg-color-destructive-active);
|
97
|
+
--_skf-button-bg-color-hover: var(--skf-interactive-bg-color-destructive-hover);
|
89
98
|
}
|
90
99
|
|
91
|
-
|
100
|
+
.btn__loader {
|
92
101
|
inset: 50% auto auto 50%;
|
93
102
|
opacity: 0;
|
94
103
|
position: absolute;
|
95
104
|
transform: translate(-50%, -50%);
|
96
105
|
}
|
97
106
|
|
98
|
-
|
107
|
+
.btn__body {
|
99
108
|
align-items: center;
|
100
109
|
display: flex;
|
101
110
|
gap: var(--skf-spacing-50);
|
102
111
|
}
|
103
112
|
|
104
|
-
|
113
|
+
.btn__label {
|
114
|
+
display: block;
|
105
115
|
overflow: hidden;
|
106
116
|
text-overflow: ellipsis;
|
107
117
|
white-space: nowrap;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SkfElement } from '
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
2
|
import { type CSSResultGroup } from 'lit';
|
3
3
|
/**
|
4
4
|
* The `<skf-card>` can be used to group related subjects in a container
|
@@ -12,10 +12,10 @@ import { type CSSResultGroup } from 'lit';
|
|
12
12
|
export declare class SkfCard extends SkfElement {
|
13
13
|
static styles: CSSResultGroup;
|
14
14
|
/** If true, removes border */
|
15
|
-
noBorder
|
15
|
+
noBorder: boolean;
|
16
16
|
/** If true, removes padding */
|
17
|
-
noPadding
|
17
|
+
noPadding: boolean;
|
18
18
|
/** If true, the Card fills the parent element height */
|
19
|
-
stretch
|
19
|
+
stretch: boolean;
|
20
20
|
render(): import("lit").TemplateResult<1>;
|
21
21
|
}
|
@@ -1,33 +1,44 @@
|
|
1
|
-
import { SkfElement as
|
2
|
-
import
|
3
|
-
import { html as
|
4
|
-
import { property as
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
import { SkfElement as l } from "../../internal/components/skf-element.js";
|
2
|
+
import c from "../../styles/component.styles.js";
|
3
|
+
import { html as m } from "lit";
|
4
|
+
import { property as o } from "lit/decorators.js";
|
5
|
+
import { classMap as f } from "lit/directives/class-map.js";
|
6
|
+
import { styles as h } from "./card.styles.js";
|
7
|
+
var u = Object.defineProperty, s = (i, p, a, y) => {
|
8
|
+
for (var t = void 0, e = i.length - 1, d; e >= 0; e--)
|
9
|
+
(d = i[e]) && (t = d(p, a, t) || t);
|
10
|
+
return t && u(p, a, t), t;
|
10
11
|
};
|
11
|
-
const n = class n extends
|
12
|
+
const n = class n extends l {
|
13
|
+
constructor() {
|
14
|
+
super(...arguments), this.noBorder = !1, this.noPadding = !1, this.stretch = !1;
|
15
|
+
}
|
12
16
|
render() {
|
13
|
-
return
|
14
|
-
<div
|
17
|
+
return m`
|
18
|
+
<div
|
19
|
+
class=${f({
|
20
|
+
card: !0,
|
21
|
+
"card--no-border": this.noBorder,
|
22
|
+
"card--no-padding": this.noPadding,
|
23
|
+
"card--stretch": this.stretch
|
24
|
+
})}
|
25
|
+
>
|
15
26
|
<slot></slot>
|
16
27
|
</div>
|
17
28
|
`;
|
18
29
|
}
|
19
30
|
};
|
20
|
-
n.styles = [
|
21
|
-
let
|
22
|
-
|
23
|
-
|
24
|
-
],
|
25
|
-
|
26
|
-
|
27
|
-
],
|
28
|
-
|
29
|
-
|
30
|
-
],
|
31
|
+
n.styles = [c, h];
|
32
|
+
let r = n;
|
33
|
+
s([
|
34
|
+
o({ type: Boolean, attribute: "no-border" })
|
35
|
+
], r.prototype, "noBorder");
|
36
|
+
s([
|
37
|
+
o({ type: Boolean, attribute: "no-padding" })
|
38
|
+
], r.prototype, "noPadding");
|
39
|
+
s([
|
40
|
+
o({ type: Boolean, reflect: !0 })
|
41
|
+
], r.prototype, "stretch");
|
31
42
|
export {
|
32
|
-
|
43
|
+
r as SkfCard
|
33
44
|
};
|
@@ -1,2 +1 @@
|
|
1
|
-
declare const
|
2
|
-
export default _default;
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
2
|
+
const a = r`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
4
|
+
|
3
5
|
:host {
|
4
6
|
contain: layout;
|
5
7
|
}
|
@@ -8,27 +10,27 @@ const s = r`
|
|
8
10
|
block-size: 100%;
|
9
11
|
}
|
10
12
|
|
11
|
-
|
13
|
+
.card {
|
12
14
|
background-color: var(--skf-bg-color-neutral-1);
|
13
15
|
border: var(--skf-border-width-sm) solid
|
14
16
|
var(--_skf-card-border-color, var(--skf-border-color-tertiary));
|
15
17
|
border-radius: var(--skf-border-radius-sm);
|
16
18
|
box-shadow: var(--skf-shadow-md);
|
17
19
|
padding: var(--_skf-card-padding, var(--skf-spacing-100));
|
20
|
+
}
|
18
21
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
+
.card--no-border {
|
23
|
+
--_skf-card-border-color: transparent;
|
24
|
+
}
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
+
.card--no-padding {
|
27
|
+
--_skf-card-padding: 0;
|
28
|
+
}
|
26
29
|
|
27
|
-
|
28
|
-
|
29
|
-
}
|
30
|
+
.card--stretch {
|
31
|
+
block-size: inherit;
|
30
32
|
}
|
31
33
|
`;
|
32
34
|
export {
|
33
|
-
|
35
|
+
a as styles
|
34
36
|
};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import '
|
2
|
-
import { FormBase } from '
|
3
|
-
import type { FormFieldBaseProps } from '
|
1
|
+
import '../icon/icon.js';
|
2
|
+
import { FormBase } from '../../internal/components/formBase.js';
|
3
|
+
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
4
4
|
import { type CSSResultGroup } from 'lit';
|
5
5
|
/**
|
6
6
|
* The `<skf-checkbox>` component is used to create a checkbox input
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import '
|
2
|
-
import { SkfElement } from '
|
3
|
-
import type { HeadingType } from '
|
1
|
+
import '../icon/icon.js';
|
2
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
3
|
+
import type { HeadingType } from '../../internal/constants/heading.js';
|
4
4
|
import type { CSSResultGroup } from 'lit';
|
5
5
|
/**
|
6
6
|
* The `<skf-collapse>` component is a general purpose container for content that can be collapsed / expanded.
|
@@ -16,20 +16,20 @@ import type { CSSResultGroup } from 'lit';
|
|
16
16
|
export declare class SkfCollapse extends SkfElement {
|
17
17
|
static styles: CSSResultGroup;
|
18
18
|
/** If true, will animate the expand/collapse state */
|
19
|
-
animated
|
19
|
+
animated: boolean;
|
20
20
|
/** If true, will set the collapse to be expanded by default */
|
21
|
-
expanded
|
21
|
+
expanded: boolean;
|
22
22
|
/** Heading for the collapse */
|
23
23
|
heading?: string;
|
24
24
|
/**
|
25
25
|
* Defines which heading element will be rendered
|
26
|
-
* @type { "
|
26
|
+
* @type { "h2" | "h3" | "h4" }
|
27
27
|
*/
|
28
28
|
headingAs: Exclude<HeadingType, 'h1'>;
|
29
29
|
/** If true, renders the small version */
|
30
|
-
small
|
30
|
+
small: boolean;
|
31
31
|
/** If true, will truncate the heading in collapsed state */
|
32
|
-
truncate
|
32
|
+
truncate: boolean;
|
33
33
|
/** Class method as alternative to manipulate attribute */
|
34
34
|
setClose(): void;
|
35
35
|
/** Class method as alternative to manipulate attribute */
|
@@ -1,18 +1,19 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
3
|
-
import
|
4
|
-
import { property as
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
import { SkfElement as c } from "../../internal/components/skf-element.js";
|
3
|
+
import h from "../../styles/component.styles.js";
|
4
|
+
import { property as s } from "lit/decorators.js";
|
5
|
+
import { classMap as m } from "lit/directives/class-map.js";
|
6
|
+
import { ifDefined as f } from "lit/directives/if-defined.js";
|
7
|
+
import { html as u, unsafeStatic as d } from "lit/static-html.js";
|
8
|
+
import _ from "./collapse.styles.js";
|
9
|
+
var y = Object.defineProperty, a = (i, n, r, g) => {
|
10
|
+
for (var t = void 0, l = i.length - 1, p; l >= 0; l--)
|
11
|
+
(p = i[l]) && (t = p(n, r, t) || t);
|
12
|
+
return t && y(n, r, t), t;
|
12
13
|
};
|
13
|
-
const
|
14
|
+
const o = class o extends c {
|
14
15
|
constructor() {
|
15
|
-
super(...arguments), this.headingAs = "h2", this._toggle = () => {
|
16
|
+
super(...arguments), this.animated = !1, this.expanded = !1, this.headingAs = "h2", this.small = !1, this.truncate = !1, this._toggle = () => {
|
16
17
|
this.dispatchEvent(
|
17
18
|
new CustomEvent("skf-collapse-toggle", {
|
18
19
|
bubbles: !0,
|
@@ -32,20 +33,27 @@ const n = class n extends h {
|
|
32
33
|
}
|
33
34
|
render() {
|
34
35
|
return u`
|
35
|
-
<div
|
36
|
-
|
36
|
+
<div class=${m({
|
37
|
+
collapse: !0,
|
38
|
+
"collapse--animated": this.animated,
|
39
|
+
"collapse--expanded": this.expanded,
|
40
|
+
"collapse--small": this.small,
|
41
|
+
"collapse--truncate": this.truncate
|
42
|
+
})}>
|
43
|
+
<${d(this.headingAs)} class="collapse__heading">
|
37
44
|
<button
|
38
45
|
@click=${this._toggle}
|
39
46
|
aria-controls="main"
|
40
|
-
aria-expanded=${
|
47
|
+
aria-expanded=${f(this.expanded ? "true" : "false")}
|
48
|
+
class="collapse__btn"
|
41
49
|
type="button"
|
42
50
|
>
|
43
|
-
<span
|
44
|
-
<skf-icon name=${this.expanded ? "caretUp" : "caretDown"}></skf-icon>
|
51
|
+
<span class="collapse__label">${this.heading}</span>
|
52
|
+
<skf-icon class="collapse__icon" name=${this.expanded ? "caretUp" : "caretDown"}></skf-icon>
|
45
53
|
</button>
|
46
|
-
</${
|
47
|
-
<div
|
48
|
-
<div
|
54
|
+
</${d(this.headingAs)}>
|
55
|
+
<div class="collapse__body">
|
56
|
+
<div class="collapse__main" data-testid="main" id="main">
|
49
57
|
<slot></slot>
|
50
58
|
</div>
|
51
59
|
</div>
|
@@ -53,25 +61,25 @@ const n = class n extends h {
|
|
53
61
|
`;
|
54
62
|
}
|
55
63
|
};
|
56
|
-
|
57
|
-
let e =
|
58
|
-
|
59
|
-
|
64
|
+
o.styles = [h, _];
|
65
|
+
let e = o;
|
66
|
+
a([
|
67
|
+
s({ type: Boolean, reflect: !0 })
|
60
68
|
], e.prototype, "animated");
|
61
|
-
|
62
|
-
|
69
|
+
a([
|
70
|
+
s({ type: Boolean, reflect: !0 })
|
63
71
|
], e.prototype, "expanded");
|
64
|
-
|
65
|
-
|
72
|
+
a([
|
73
|
+
s()
|
66
74
|
], e.prototype, "heading");
|
67
|
-
|
68
|
-
|
75
|
+
a([
|
76
|
+
s({ attribute: "heading-as" })
|
69
77
|
], e.prototype, "headingAs");
|
70
|
-
|
71
|
-
|
78
|
+
a([
|
79
|
+
s({ type: Boolean, reflect: !0 })
|
72
80
|
], e.prototype, "small");
|
73
|
-
|
74
|
-
|
81
|
+
a([
|
82
|
+
s({ type: Boolean, reflect: !0 })
|
75
83
|
], e.prototype, "truncate");
|
76
84
|
export {
|
77
85
|
e as SkfCollapse
|
@@ -1,22 +1,23 @@
|
|
1
|
-
import { css as
|
2
|
-
const s =
|
1
|
+
import { css as a } from "lit";
|
2
|
+
const s = a`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
3
4
|
@layer components {
|
4
|
-
|
5
|
+
.collapse {
|
5
6
|
background: var(--skf-bg-color-neutral-1);
|
6
7
|
border-bottom: var(--skf-border-width-sm) solid var(--skf-border-color-tertiary);
|
7
8
|
}
|
8
9
|
|
9
|
-
|
10
|
+
.collapse__heading {
|
10
11
|
font-size: var(--_skf-collapse-heading-size, var(--skf-font-size-100));
|
11
12
|
font-weight: var(--_skf-collapse-heading-weight, normal);
|
12
13
|
|
13
|
-
|
14
|
+
.collapse--small & {
|
14
15
|
--_skf-collapse-heading-size: var(--skf-font-size-75);
|
15
16
|
--_skf-collapse-heading-weight: var(--skf-font-weight-medium);
|
16
17
|
}
|
17
18
|
}
|
18
19
|
|
19
|
-
|
20
|
+
.collapse__btn {
|
20
21
|
align-items: center;
|
21
22
|
display: flex;
|
22
23
|
padding-block: var(--_skf-collapse-button-padding-block, var(--skf-spacing-50));
|
@@ -28,39 +29,39 @@ const s = o`
|
|
28
29
|
outline-offset: -2px;
|
29
30
|
}
|
30
31
|
|
31
|
-
|
32
|
+
.collapse--small & {
|
32
33
|
--_skf-collapse-button-padding-block: var(--skf-spacing-25);
|
33
34
|
}
|
34
35
|
}
|
35
36
|
|
36
|
-
|
37
|
-
|
37
|
+
.collapse__label {
|
38
|
+
.collapse--truncate:not(.collapse--expanded) & {
|
38
39
|
overflow: hidden;
|
39
40
|
text-overflow: ellipsis;
|
40
41
|
white-space: nowrap;
|
41
42
|
}
|
42
43
|
}
|
43
44
|
|
44
|
-
|
45
|
+
.collapse__icon {
|
45
46
|
margin-inline-start: auto;
|
46
47
|
}
|
47
48
|
|
48
|
-
|
49
|
+
.collapse__body {
|
49
50
|
display: grid;
|
50
51
|
grid-template-rows: var(--_skf-collapse-body-height, 0fr);
|
51
52
|
padding-inline: var(--skf-spacing-75);
|
52
53
|
|
53
|
-
|
54
|
+
.collapse--animated & {
|
54
55
|
transition: grid-template-rows calc(var(--skf-motion-duration-normal) * 1ms)
|
55
56
|
var(--skf-motion-easing-ease-in);
|
56
57
|
}
|
57
58
|
|
58
|
-
|
59
|
+
.collapse--expanded & {
|
59
60
|
--_skf-collapse-body-height: 1fr;
|
60
61
|
}
|
61
62
|
}
|
62
63
|
|
63
|
-
|
64
|
+
.collapse__main {
|
64
65
|
overflow: hidden;
|
65
66
|
|
66
67
|
&::after {
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import '../button/button.js';
|
2
|
+
import '../heading/heading.js';
|
3
|
+
import '../icon/icon.js';
|
4
|
+
import { SkfElement } from '../../internal/components/skf-element';
|
5
|
+
import { type CSSResultGroup } from 'lit';
|
6
|
+
/**
|
7
|
+
* TODO: Is modal the right name? Should it be "blocking" or "blocking-dialog"?
|
8
|
+
*
|
9
|
+
* TBD: Should we inert the page behind the dialog? Maybe only if it is modal-dialog?
|
10
|
+
*
|
11
|
+
* TBD: Should we disable scrolling on the page behind the dialog? Maybe only if it is modal?
|
12
|
+
*/
|
13
|
+
/**
|
14
|
+
* The `<skf-dialog>` is a component that open up a dialog with the content provided
|
15
|
+
*
|
16
|
+
* @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
|
17
|
+
*
|
18
|
+
* @slot - The dialog component's content
|
19
|
+
* @slot heading - The dialog component's heading
|
20
|
+
* @slot footer - The dialog component's buttons goes here
|
21
|
+
*
|
22
|
+
* @event skf-dialog-open - Fires when the dialog is opened (after transitioned in)
|
23
|
+
* @event skf-dialog-close - Fires when the dialog is closed (before transitioned out)
|
24
|
+
* @event close - Fires when the dialog is closed (after transitioned out)
|
25
|
+
*
|
26
|
+
* @cssproperty --skf-dialog-height - A custom height for the Dialog. Pass valid CSS **block-size** values
|
27
|
+
* @cssproperty --skf-dialog-width - A custom width for the Dialog Pass valid CSS **inline-size** values
|
28
|
+
*
|
29
|
+
* @tagname skf-dialog
|
30
|
+
*/
|
31
|
+
export declare class SkfDialog extends SkfElement {
|
32
|
+
#private;
|
33
|
+
static styles: CSSResultGroup;
|
34
|
+
/** If defined, sets the aria-label for the close button */
|
35
|
+
closeButtonAriaLabel?: string;
|
36
|
+
/** Title for the modal/dialog */
|
37
|
+
heading?: string;
|
38
|
+
/** If true, makes the dialog stretch edge to edge on screen */
|
39
|
+
fullscreen: boolean;
|
40
|
+
/** If true, removes the close button */
|
41
|
+
noCloseButton?: boolean | undefined;
|
42
|
+
/** If defined, removes the inner padding */
|
43
|
+
noPadding: boolean;
|
44
|
+
open?: boolean | null;
|
45
|
+
/** If provided, will run function on dialog close */
|
46
|
+
onClose?: ((event: Event) => void) | null;
|
47
|
+
/** @internal */
|
48
|
+
$dialog: HTMLDialogElement;
|
49
|
+
/** @internal */
|
50
|
+
footerEls?: HTMLElement[];
|
51
|
+
/** @internal */
|
52
|
+
modal: boolean;
|
53
|
+
/** @internal */
|
54
|
+
renderFoot: boolean;
|
55
|
+
protected firstUpdated(): void;
|
56
|
+
handleOpenChange(): void;
|
57
|
+
/** @internal */
|
58
|
+
show: () => Promise<boolean>;
|
59
|
+
/** @internal */
|
60
|
+
_transition(): {
|
61
|
+
entry: () => Promise<unknown>;
|
62
|
+
exit: () => Promise<unknown>;
|
63
|
+
};
|
64
|
+
/** @internal */
|
65
|
+
_handleBackdropClick: (event: MouseEvent) => void;
|
66
|
+
/** @internal */
|
67
|
+
_handleClose: (event: Event) => void;
|
68
|
+
/** @internal */
|
69
|
+
get _isModal(): boolean;
|
70
|
+
/** Method that opens the dialog in modal state */
|
71
|
+
showModal: () => Promise<boolean>;
|
72
|
+
/** Method that closes the dialog */
|
73
|
+
close: () => Promise<boolean | undefined>;
|
74
|
+
render(): import("lit").TemplateResult<1>;
|
75
|
+
}
|