@momentum-design/components 0.98.0 → 0.99.0
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/browser/index.js +436 -276
- package/dist/browser/index.js.map +4 -4
- package/dist/components/card/card.component.d.ts +14 -6
- package/dist/components/card/card.component.js +20 -19
- package/dist/components/card/card.styles.js +23 -4
- package/dist/components/cardbutton/cardbutton.component.d.ts +18 -4
- package/dist/components/cardbutton/cardbutton.component.js +18 -4
- package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +18 -0
- package/dist/components/cardcheckbox/cardcheckbox.component.js +18 -0
- package/dist/components/cardradio/cardradio.component.d.ts +18 -0
- package/dist/components/cardradio/cardradio.component.js +18 -0
- package/dist/components/toast/index.d.ts +11 -0
- package/dist/components/toast/index.js +8 -0
- package/dist/components/toast/toast.component.d.ts +101 -0
- package/dist/components/toast/toast.component.js +242 -0
- package/dist/components/toast/toast.constants.d.ts +26 -0
- package/dist/components/toast/toast.constants.js +28 -0
- package/dist/components/toast/toast.styles.d.ts +2 -0
- package/dist/components/toast/toast.styles.js +88 -0
- package/dist/components/toast/toast.types.d.ts +7 -0
- package/dist/components/toast/toast.types.js +1 -0
- package/dist/components/toast/toast.utils.d.ts +3 -0
- package/dist/components/toast/toast.utils.js +14 -0
- package/dist/custom-elements.json +702 -16
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/react/card/index.d.ts +14 -6
- package/dist/react/card/index.js +14 -6
- package/dist/react/cardbutton/index.d.ts +18 -4
- package/dist/react/cardbutton/index.js +18 -4
- package/dist/react/cardcheckbox/index.d.ts +18 -0
- package/dist/react/cardcheckbox/index.js +18 -0
- package/dist/react/cardradio/index.d.ts +18 -0
- package/dist/react/cardradio/index.js +18 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/dist/react/toast/index.d.ts +45 -0
- package/dist/react/toast/index.js +53 -0
- package/package.json +1 -1
@@ -12,15 +12,14 @@ declare const Card_base: import("../../utils/mixins/index.types").Constructor<im
|
|
12
12
|
* - Subtitle
|
13
13
|
* - Body
|
14
14
|
*
|
15
|
-
* The card can either be vertically or horizontally oriented.
|
15
|
+
* The card can either be vertically or horizontally oriented. The vertical card has a min-width of 20rem and the horizontal card has a min-width of 40rem.
|
16
16
|
*
|
17
17
|
* There are 2 variants for the card that represent the border styling - 'border' and 'ghost'.
|
18
18
|
*
|
19
19
|
* To make this card interactive, use the following slots:
|
20
20
|
* - `icon-button`: This slot supports action icon buttons in the header section (maximum of 3 buttons).
|
21
21
|
* - `footer-link`: This slot is for passing `mdc-link` component within the footer section.
|
22
|
-
* - `footer-button-primary`: This slot is for passing primary variant of
|
23
|
-
* `mdc-button` component within the footer section.
|
22
|
+
* - `footer-button-primary`: This slot is for passing primary variant of `mdc-button` component within the footer section.
|
24
23
|
* - `footer-button-secondary`: This slot is for passing secondary variant of `mdc-button` component
|
25
24
|
* within the footer section.
|
26
25
|
*
|
@@ -37,14 +36,23 @@ declare const Card_base: import("../../utils/mixins/index.types").Constructor<im
|
|
37
36
|
* @slot footer - This slot is for passing custom footer content. Only use this if really needed,
|
38
37
|
* using the footer-link and footer-button slots is preferred.
|
39
38
|
*
|
39
|
+
* @csspart header - The header part of the card
|
40
|
+
* @csspart icon - The icon part of the card header
|
41
|
+
* @csspart body - The body part of the card
|
42
|
+
* @csspart image - The image part of the card
|
43
|
+
* @csspart footer - The footer part of the card
|
44
|
+
* @csspart footer-link - The link part of the card footer
|
45
|
+
* @csspart footer-button-primary - The primary button part of the card footer
|
46
|
+
* @csspart footer-button-secondary - The secondary button part of the card footer
|
47
|
+
* @csspart icon-button - The icon button part of the card header
|
48
|
+
* @csspart text - The text part of the card
|
49
|
+
*
|
40
50
|
* @tagname mdc-card
|
41
51
|
*
|
42
52
|
* @dependency mdc-icon
|
43
53
|
* @dependency mdc-text
|
44
54
|
*
|
45
|
-
* @
|
46
|
-
* @slot body - This slot is for passing the text content for the card
|
47
|
-
* @slot after-body - This slot is for passing the content after the body
|
55
|
+
* @cssproperty --mdc-card-width - The width of the card
|
48
56
|
*
|
49
57
|
*/
|
50
58
|
declare class Card extends Card_base {
|
@@ -26,15 +26,14 @@ import styles from './card.styles';
|
|
26
26
|
* - Subtitle
|
27
27
|
* - Body
|
28
28
|
*
|
29
|
-
* The card can either be vertically or horizontally oriented.
|
29
|
+
* The card can either be vertically or horizontally oriented. The vertical card has a min-width of 20rem and the horizontal card has a min-width of 40rem.
|
30
30
|
*
|
31
31
|
* There are 2 variants for the card that represent the border styling - 'border' and 'ghost'.
|
32
32
|
*
|
33
33
|
* To make this card interactive, use the following slots:
|
34
34
|
* - `icon-button`: This slot supports action icon buttons in the header section (maximum of 3 buttons).
|
35
35
|
* - `footer-link`: This slot is for passing `mdc-link` component within the footer section.
|
36
|
-
* - `footer-button-primary`: This slot is for passing primary variant of
|
37
|
-
* `mdc-button` component within the footer section.
|
36
|
+
* - `footer-button-primary`: This slot is for passing primary variant of `mdc-button` component within the footer section.
|
38
37
|
* - `footer-button-secondary`: This slot is for passing secondary variant of `mdc-button` component
|
39
38
|
* within the footer section.
|
40
39
|
*
|
@@ -51,14 +50,23 @@ import styles from './card.styles';
|
|
51
50
|
* @slot footer - This slot is for passing custom footer content. Only use this if really needed,
|
52
51
|
* using the footer-link and footer-button slots is preferred.
|
53
52
|
*
|
53
|
+
* @csspart header - The header part of the card
|
54
|
+
* @csspart icon - The icon part of the card header
|
55
|
+
* @csspart body - The body part of the card
|
56
|
+
* @csspart image - The image part of the card
|
57
|
+
* @csspart footer - The footer part of the card
|
58
|
+
* @csspart footer-link - The link part of the card footer
|
59
|
+
* @csspart footer-button-primary - The primary button part of the card footer
|
60
|
+
* @csspart footer-button-secondary - The secondary button part of the card footer
|
61
|
+
* @csspart icon-button - The icon button part of the card header
|
62
|
+
* @csspart text - The text part of the card
|
63
|
+
*
|
54
64
|
* @tagname mdc-card
|
55
65
|
*
|
56
66
|
* @dependency mdc-icon
|
57
67
|
* @dependency mdc-text
|
58
68
|
*
|
59
|
-
* @
|
60
|
-
* @slot body - This slot is for passing the text content for the card
|
61
|
-
* @slot after-body - This slot is for passing the content after the body
|
69
|
+
* @cssproperty --mdc-card-width - The width of the card
|
62
70
|
*
|
63
71
|
*/
|
64
72
|
class Card extends CardComponentMixin(FooterMixin(Component)) {
|
@@ -72,20 +80,11 @@ class Card extends CardComponentMixin(FooterMixin(Component)) {
|
|
72
80
|
this.handleIconButtons = () => {
|
73
81
|
var _a;
|
74
82
|
(_a = this.iconButtons) === null || _a === void 0 ? void 0 : _a.forEach(element => {
|
75
|
-
if (
|
76
|
-
element.remove();
|
77
|
-
}
|
78
|
-
else {
|
83
|
+
if (element.matches(DEFAULTS.BUTTON)) {
|
79
84
|
element.setAttribute('variant', BUTTON_VARIANTS.TERTIARY);
|
80
85
|
element.setAttribute('size', '32');
|
81
86
|
}
|
82
87
|
});
|
83
|
-
// limit to show only first 3 buttons defined in the slot
|
84
|
-
if (this.iconButtons && this.iconButtons.length > 3) {
|
85
|
-
for (let i = 3; i < this.iconButtons.length; i += 1) {
|
86
|
-
this.iconButtons[i].remove();
|
87
|
-
}
|
88
|
-
}
|
89
88
|
};
|
90
89
|
}
|
91
90
|
update(changedProperties) {
|
@@ -112,9 +111,11 @@ class Card extends CardComponentMixin(FooterMixin(Component)) {
|
|
112
111
|
${this.renderImage()}
|
113
112
|
<div part="body">
|
114
113
|
${this.renderHeader()}
|
115
|
-
<
|
116
|
-
|
117
|
-
|
114
|
+
<div part="text-content">
|
115
|
+
<slot name="before-body"></slot>
|
116
|
+
<slot name="body"></slot>
|
117
|
+
<slot name="after-body"></slot>
|
118
|
+
</div>
|
118
119
|
${this.renderFooter()}
|
119
120
|
</div>
|
120
121
|
`;
|
@@ -2,25 +2,31 @@ import { css } from 'lit';
|
|
2
2
|
import { hostFitContentStyles } from '../../utils/styles';
|
3
3
|
const styles = css `
|
4
4
|
:host {
|
5
|
+
--mdc-card-width: 20rem;
|
5
6
|
align-items: flex-start;
|
6
7
|
border-radius: 0.5rem;
|
7
8
|
border: 1px solid var(--mds-color-theme-outline-primary-normal);
|
8
9
|
box-shadow: none;
|
9
10
|
transition: box-shadow 0.2s;
|
11
|
+
width: var(--mdc-card-width);
|
10
12
|
}
|
13
|
+
|
11
14
|
:host([variant='ghost']) {
|
12
15
|
border-color: transparent;
|
13
16
|
}
|
17
|
+
|
14
18
|
:host([orientation='horizontal']) {
|
15
|
-
|
19
|
+
min-width: 40rem;
|
20
|
+
--mdc-card-width: 40rem;
|
16
21
|
}
|
17
22
|
|
18
23
|
:host([orientation='vertical']) {
|
19
|
-
|
24
|
+
min-width: 20rem;
|
20
25
|
flex-direction: column;
|
21
26
|
}
|
22
27
|
|
23
28
|
:host([orientation='vertical'])::part(image) {
|
29
|
+
object-fit: cover;
|
24
30
|
height: 12.5rem;
|
25
31
|
width: 100%;
|
26
32
|
border-top-left-radius: 0.5rem;
|
@@ -28,12 +34,19 @@ const styles = css `
|
|
28
34
|
}
|
29
35
|
|
30
36
|
:host([orientation='horizontal'])::part(image) {
|
37
|
+
object-fit: cover;
|
31
38
|
width: 10rem;
|
32
39
|
height: 100%;
|
33
40
|
border-top-left-radius: 0.5rem;
|
34
41
|
border-bottom-left-radius: 0.5rem;
|
35
42
|
}
|
36
43
|
|
44
|
+
:host::part(text-content) {
|
45
|
+
display: flex;
|
46
|
+
flex-direction: column;
|
47
|
+
flex-grow: 1;
|
48
|
+
}
|
49
|
+
|
37
50
|
:host::part(header) {
|
38
51
|
display: flex;
|
39
52
|
gap: 0.5rem;
|
@@ -45,6 +58,7 @@ const styles = css `
|
|
45
58
|
|
46
59
|
:host::part(body) {
|
47
60
|
width: 100%;
|
61
|
+
height: inherit;
|
48
62
|
padding: 1.5rem;
|
49
63
|
display: flex;
|
50
64
|
flex-direction: column;
|
@@ -81,14 +95,19 @@ const styles = css `
|
|
81
95
|
gap: 1rem;
|
82
96
|
}
|
83
97
|
|
98
|
+
::slotted([slot='before-body']),
|
99
|
+
::slotted([slot='after-body']) {
|
100
|
+
margin-top: 1rem;
|
101
|
+
}
|
102
|
+
|
84
103
|
::slotted([slot='footer-link']),
|
85
104
|
::slotted([slot='footer-button-primary']),
|
86
105
|
::slotted([slot='footer-button-secondary']) {
|
87
106
|
margin-bottom: 0.5rem;
|
88
107
|
}
|
89
108
|
|
90
|
-
|
91
|
-
margin:
|
109
|
+
mdc-text::part(text) {
|
110
|
+
margin: 0;
|
92
111
|
}
|
93
112
|
`;
|
94
113
|
export default [hostFitContentStyles, styles];
|
@@ -12,10 +12,6 @@ declare const CardButton_base: import("../../utils/mixins/index.types").Construc
|
|
12
12
|
* @dependency mdc-icon
|
13
13
|
* @dependency mdc-text
|
14
14
|
*
|
15
|
-
* @slot before-body - This slot is for passing the content before the body
|
16
|
-
* @slot body - This slot is for passing the text content for the card
|
17
|
-
* @slot after-body - This slot is for passing the content after the body
|
18
|
-
*
|
19
15
|
* @event click - (React: onClick) Event that gets dispatched when the card is clicked.
|
20
16
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
21
17
|
* It fires the click event when enter key is used.
|
@@ -23,6 +19,24 @@ declare const CardButton_base: import("../../utils/mixins/index.types").Construc
|
|
23
19
|
* It fires the click event when space key is used.
|
24
20
|
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
25
21
|
*
|
22
|
+
* @slot before-body - This slot is for passing the content before the body
|
23
|
+
* @slot body - This slot is for passing the text content for the card
|
24
|
+
* @slot after-body - This slot is for passing the content after the body
|
25
|
+
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
26
|
+
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
27
|
+
*
|
28
|
+
* @csspart header - The header part of the card
|
29
|
+
* @csspart icon - The icon part of the card header
|
30
|
+
* @csspart body - The body part of the card
|
31
|
+
* @csspart image - The image part of the card
|
32
|
+
* @csspart footer - The footer part of the card
|
33
|
+
* @csspart footer-link - The link part of the card footer
|
34
|
+
* @csspart footer-button-primary - The primary button part of the card footer
|
35
|
+
* @csspart footer-button-secondary - The secondary button part of the card footer
|
36
|
+
* @csspart icon-button - The icon button part of the card header
|
37
|
+
* @csspart text - The text part of the card
|
38
|
+
*
|
39
|
+
* @cssproperty --mdc-card-width - The width of the card
|
26
40
|
*/
|
27
41
|
declare class CardButton extends CardButton_base {
|
28
42
|
connectedCallback(): void;
|
@@ -14,10 +14,6 @@ import styles from './cardbutton.styles';
|
|
14
14
|
* @dependency mdc-icon
|
15
15
|
* @dependency mdc-text
|
16
16
|
*
|
17
|
-
* @slot before-body - This slot is for passing the content before the body
|
18
|
-
* @slot body - This slot is for passing the text content for the card
|
19
|
-
* @slot after-body - This slot is for passing the content after the body
|
20
|
-
*
|
21
17
|
* @event click - (React: onClick) Event that gets dispatched when the card is clicked.
|
22
18
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
23
19
|
* It fires the click event when enter key is used.
|
@@ -25,6 +21,24 @@ import styles from './cardbutton.styles';
|
|
25
21
|
* It fires the click event when space key is used.
|
26
22
|
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
27
23
|
*
|
24
|
+
* @slot before-body - This slot is for passing the content before the body
|
25
|
+
* @slot body - This slot is for passing the text content for the card
|
26
|
+
* @slot after-body - This slot is for passing the content after the body
|
27
|
+
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
28
|
+
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
29
|
+
*
|
30
|
+
* @csspart header - The header part of the card
|
31
|
+
* @csspart icon - The icon part of the card header
|
32
|
+
* @csspart body - The body part of the card
|
33
|
+
* @csspart image - The image part of the card
|
34
|
+
* @csspart footer - The footer part of the card
|
35
|
+
* @csspart footer-link - The link part of the card footer
|
36
|
+
* @csspart footer-button-primary - The primary button part of the card footer
|
37
|
+
* @csspart footer-button-secondary - The secondary button part of the card footer
|
38
|
+
* @csspart icon-button - The icon button part of the card header
|
39
|
+
* @csspart text - The text part of the card
|
40
|
+
*
|
41
|
+
* @cssproperty --mdc-card-width - The width of the card
|
28
42
|
*/
|
29
43
|
class CardButton extends CardComponentMixin(Buttonsimple) {
|
30
44
|
connectedCallback() {
|
@@ -22,6 +22,24 @@ declare const CardCheckbox_base: import("../../utils/mixins/index.types").Constr
|
|
22
22
|
* @slot before-body - This slot is for passing the content before the body
|
23
23
|
* @slot body - This slot is for passing the text content for the card
|
24
24
|
* @slot after-body - This slot is for passing the content after the body
|
25
|
+
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
26
|
+
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
27
|
+
*
|
28
|
+
* @csspart header - The header part of the card
|
29
|
+
* @csspart icon - The icon part of the card header
|
30
|
+
* @csspart body - The body part of the card
|
31
|
+
* @csspart image - The image part of the card
|
32
|
+
* @csspart footer - The footer part of the card
|
33
|
+
* @csspart footer-link - The link part of the card footer
|
34
|
+
* @csspart footer-button-primary - The primary button part of the card footer
|
35
|
+
* @csspart footer-button-secondary - The secondary button part of the card footer
|
36
|
+
* @csspart icon-button - The icon button part of the card header
|
37
|
+
* @csspart text - The text part of the card
|
38
|
+
* @csspart check - The check part of the card
|
39
|
+
* @csspart check-icon - The check icon part of the card
|
40
|
+
* @csspart check-icon-button - The check icon button part of the card
|
41
|
+
*
|
42
|
+
* @cssproperty --mdc-card-width - The width of the card
|
25
43
|
*
|
26
44
|
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
27
45
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
@@ -36,6 +36,24 @@ import styles from './cardcheckbox.styles';
|
|
36
36
|
* @slot before-body - This slot is for passing the content before the body
|
37
37
|
* @slot body - This slot is for passing the text content for the card
|
38
38
|
* @slot after-body - This slot is for passing the content after the body
|
39
|
+
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
40
|
+
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
41
|
+
*
|
42
|
+
* @csspart header - The header part of the card
|
43
|
+
* @csspart icon - The icon part of the card header
|
44
|
+
* @csspart body - The body part of the card
|
45
|
+
* @csspart image - The image part of the card
|
46
|
+
* @csspart footer - The footer part of the card
|
47
|
+
* @csspart footer-link - The link part of the card footer
|
48
|
+
* @csspart footer-button-primary - The primary button part of the card footer
|
49
|
+
* @csspart footer-button-secondary - The secondary button part of the card footer
|
50
|
+
* @csspart icon-button - The icon button part of the card header
|
51
|
+
* @csspart text - The text part of the card
|
52
|
+
* @csspart check - The check part of the card
|
53
|
+
* @csspart check-icon - The check icon part of the card
|
54
|
+
* @csspart check-icon-button - The check icon button part of the card
|
55
|
+
*
|
56
|
+
* @cssproperty --mdc-card-width - The width of the card
|
39
57
|
*
|
40
58
|
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
41
59
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
@@ -21,6 +21,24 @@ declare const CardRadio_base: import("../../utils/mixins/index.types").Construct
|
|
21
21
|
* @slot before-body - This slot is for passing the content before the body
|
22
22
|
* @slot body - This slot is for passing the text content for the card
|
23
23
|
* @slot after-body - This slot is for passing the content after the body
|
24
|
+
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
25
|
+
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
26
|
+
*
|
27
|
+
* @csspart header - The header part of the card
|
28
|
+
* @csspart icon - The icon part of the card header
|
29
|
+
* @csspart body - The body part of the card
|
30
|
+
* @csspart image - The image part of the card
|
31
|
+
* @csspart footer - The footer part of the card
|
32
|
+
* @csspart footer-link - The link part of the card footer
|
33
|
+
* @csspart footer-button-primary - The primary button part of the card footer
|
34
|
+
* @csspart footer-button-secondary - The secondary button part of the card footer
|
35
|
+
* @csspart icon-button - The icon button part of the card header
|
36
|
+
* @csspart text - The text part of the card
|
37
|
+
* @csspart check - The check part of the card
|
38
|
+
* @csspart check-icon - The check icon part of the card
|
39
|
+
* @csspart check-icon-button - The check icon button part of the card
|
40
|
+
*
|
41
|
+
* @cssproperty --mdc-card-width - The width of the card
|
24
42
|
*
|
25
43
|
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
26
44
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
@@ -36,6 +36,24 @@ import styles from './cardradio.styles';
|
|
36
36
|
* @slot before-body - This slot is for passing the content before the body
|
37
37
|
* @slot body - This slot is for passing the text content for the card
|
38
38
|
* @slot after-body - This slot is for passing the content after the body
|
39
|
+
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
40
|
+
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
41
|
+
*
|
42
|
+
* @csspart header - The header part of the card
|
43
|
+
* @csspart icon - The icon part of the card header
|
44
|
+
* @csspart body - The body part of the card
|
45
|
+
* @csspart image - The image part of the card
|
46
|
+
* @csspart footer - The footer part of the card
|
47
|
+
* @csspart footer-link - The link part of the card footer
|
48
|
+
* @csspart footer-button-primary - The primary button part of the card footer
|
49
|
+
* @csspart footer-button-secondary - The secondary button part of the card footer
|
50
|
+
* @csspart icon-button - The icon button part of the card header
|
51
|
+
* @csspart text - The text part of the card
|
52
|
+
* @csspart check - The check part of the card
|
53
|
+
* @csspart check-icon - The check icon part of the card
|
54
|
+
* @csspart check-icon-button - The check icon button part of the card
|
55
|
+
*
|
56
|
+
* @cssproperty --mdc-card-width - The width of the card
|
39
57
|
*
|
40
58
|
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
41
59
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import type { CSSResult, PropertyValues } from 'lit';
|
2
|
+
import { nothing } from 'lit';
|
3
|
+
import { Component } from '../../models';
|
4
|
+
import type { TagName } from '../text/text.types';
|
5
|
+
import type { ToastVariant } from './toast.types';
|
6
|
+
declare const Toast_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/FooterMixin").FooterMixinInterface> & typeof Component;
|
7
|
+
/**
|
8
|
+
* `mdc-toast` is a lightweight, non-blocking alert used to inform users about application processes.
|
9
|
+
* It supports success, warning, error, and custom messages, and is designed to be controlled externally.
|
10
|
+
*
|
11
|
+
* **Note**: When using `slot="toast-body-normal"` and `slot="toast-body-detailed"`, it's strongly recommended to wrap the content with `<mdc-text tagname="span">`.
|
12
|
+
* If not used, ensure your custom content is styled appropriately to match the design and alignment expectations of the toast component.
|
13
|
+
*
|
14
|
+
* @dependency mdc-icon
|
15
|
+
* @dependency mdc-text
|
16
|
+
* @dependency mdc-button
|
17
|
+
* @dependency mdc-linkbutton
|
18
|
+
*
|
19
|
+
* @slot content-prefix - Slot for custom content before the icon (only for custom variant).
|
20
|
+
* @slot toast-body-normal - Slot for the main body content of the toast.
|
21
|
+
* @slot toast-body-detailed - Slot for additional detailed content, shown when expanded.
|
22
|
+
* @slot footer - Slot for custom footer content. Prefer using footer-button-primary and footer-button-secondary slots.
|
23
|
+
* @slot footer-button-primary - Slot for passing the primary variant of `mdc-button` in the footer.
|
24
|
+
* @slot footer-button-secondary - Slot for passing the secondary variant of `mdc-button` in the footer.
|
25
|
+
*
|
26
|
+
* @tagname mdc-toast
|
27
|
+
*
|
28
|
+
* @event close - (React: onClose) Dispatched when the Close Button is clicked using mouse or keyboard.
|
29
|
+
*
|
30
|
+
* @csspart content-container - The container for the toast's main content, including icon, text, and close button.
|
31
|
+
* @csspart toast-prefix-icon - The icon shown at the start of the toast, styled by variant.
|
32
|
+
* @csspart toast-content - The container for the header and body content of the toast.
|
33
|
+
* @csspart toast-header - The header text of the toast.
|
34
|
+
* @csspart footer - The container for the toast's footer, including toggle and action buttons.
|
35
|
+
* @csspart footer-button-toggle - The toggle button for showing/hiding detailed content.
|
36
|
+
* @csspart toast-close-btn - The close button for the toast.
|
37
|
+
*
|
38
|
+
* @cssproperty --mdc-toast-background-color - Background color of the toast.
|
39
|
+
* @cssproperty --mdc-toast-border-color - Border color of the toast.
|
40
|
+
* @cssproperty --mdc-toast-header-text-color - Color of the header text in the toast.
|
41
|
+
* @cssproperty --mdc-toast-icon-color - Color of the icon in the toast.
|
42
|
+
* @cssproperty --mdc-toast-elevation-3 - Elevation effect applied to the toast.
|
43
|
+
* @cssproperty --mdc-toast-width - Width of the toast.
|
44
|
+
* @cssproperty --mdc-toast-padding - Padding inside the toast.
|
45
|
+
*/
|
46
|
+
declare class Toast extends Toast_base {
|
47
|
+
/**
|
48
|
+
* Type of toast
|
49
|
+
* - Can be `custom`, `success`, `warning` or `error`.
|
50
|
+
* @default 'custom'
|
51
|
+
*/
|
52
|
+
variant: ToastVariant;
|
53
|
+
/**
|
54
|
+
* Defines aria-label attribute for close button accessibility
|
55
|
+
*/
|
56
|
+
closeButtonAriaLabel?: string;
|
57
|
+
/**
|
58
|
+
* Defines a string value to display as the title of the toast
|
59
|
+
*/
|
60
|
+
headerText?: string;
|
61
|
+
/**
|
62
|
+
* The html tag to be used for the header text
|
63
|
+
* @default 'h2'
|
64
|
+
*/
|
65
|
+
headerTagName: TagName;
|
66
|
+
/**
|
67
|
+
* Defines aria-label attribute when header is not used
|
68
|
+
*/
|
69
|
+
ariaLabel: string | null;
|
70
|
+
/**
|
71
|
+
* Defines the text shown on the linkbutton when detailed content is hidden.
|
72
|
+
*/
|
73
|
+
showMoreText?: string;
|
74
|
+
/**
|
75
|
+
* Defines the text shown on the linkbutton when detailed content is visible.
|
76
|
+
*/
|
77
|
+
showLessText?: string;
|
78
|
+
private isDetailVisible;
|
79
|
+
private hasDetailedSlot;
|
80
|
+
private detailedElements;
|
81
|
+
private hasFooterButtons;
|
82
|
+
/**
|
83
|
+
* Fired when Close Button is clicked using mouse or keyboard.
|
84
|
+
* This method dispatches the close event.
|
85
|
+
* It is used to notify that the toast should be closed.
|
86
|
+
*/
|
87
|
+
private closeToast;
|
88
|
+
private toggleDetailVisibility;
|
89
|
+
private updateDetailedSlotPresence;
|
90
|
+
private updateFooterButtonsPresence;
|
91
|
+
protected firstUpdated(changedProperties: PropertyValues): void;
|
92
|
+
protected renderIcon(iconName: string): import("lit-html").TemplateResult<1> | typeof nothing;
|
93
|
+
private shouldRenderToggleButton;
|
94
|
+
private renderToggleDetailButton;
|
95
|
+
protected renderHeader(): import("lit-html").TemplateResult<1> | typeof nothing;
|
96
|
+
protected handleFooterSlot(tagname: string, variant?: string | undefined): void;
|
97
|
+
protected renderFooter(): import("lit-html").TemplateResult<1>;
|
98
|
+
render(): import("lit-html").TemplateResult<1>;
|
99
|
+
static styles: Array<CSSResult>;
|
100
|
+
}
|
101
|
+
export default Toast;
|