@@ -11,21 +11,24 @@ export default {
11
11
open : true ,
12
12
look : '' ,
13
13
headline : 'Toast notification layout headline' ,
14
- message : 'Message to be displayed, shown by toast notification layout.' ,
14
+ slot : 'Message to be displayed, shown by toast notification layout.' ,
15
15
} ,
16
16
argTypes : {
17
17
look : {
18
18
options : [ '' , 'primary' , 'positive' , 'warning' , 'danger' ] ,
19
19
control : { type : 'select' } ,
20
20
} ,
21
+ slot : {
22
+ control : { type : 'text' } ,
23
+ } ,
21
24
} ,
22
25
} ;
23
26
24
27
const Template : Story = props => html `< uui-toast-notification
25
28
.open =${ props . open }
26
29
.look =${ props . look } >
27
30
< uui-toast-notification-layout .headline =${ props . headline } >
28
- ${ props . message }
31
+ ${ props . slot }
29
32
</ uui-toast-notification-layout >
30
33
</ uui-toast-notification > `;
31
34
@@ -43,14 +46,13 @@ export const ErrorStyle: Story = props => html`<uui-toast-notification
43
46
.open =${ props . open }
44
47
.look =${ props . look } >
45
48
< uui-toast-notification-layout .headline =${ props . headline } >
46
- ${ props . message }
49
+ ${ props . slot }
47
50
< uui-button slot ="actions " look ="danger "> Retry</ uui-button >
48
51
</ uui-toast-notification-layout >
49
52
</ uui-toast-notification > `;
50
53
ErrorStyle . args = {
51
54
headline : 'Document could not be published!' ,
52
- message :
53
- 'An error occurred while attempting to contact the server. Please check your internet connection.' ,
55
+ slot : 'An error occurred while attempting to contact the server. Please check your internet connection.' ,
54
56
look : 'danger' ,
55
57
} ;
56
58
ErrorStyle . parameters = {
@@ -71,13 +73,13 @@ export const PositiveStyle: Story = props => html`<uui-toast-notification
71
73
.open =${ props . open }
72
74
.look =${ props . look } >
73
75
< uui-toast-notification-layout .headline =${ props . headline } >
74
- ${ props . message }
76
+ ${ props . slot }
75
77
< uui-button slot ="actions " .look =${ props . look } > View in browser</ uui-button >
76
78
</ uui-toast-notification-layout >
77
79
</ uui-toast-notification > `;
78
80
PositiveStyle . args = {
79
81
headline : 'Document was published' ,
80
- message : 'This document is now saved and published.' ,
82
+ slot : 'This document is now saved and published.' ,
81
83
look : 'positive' ,
82
84
} ;
83
85
PositiveStyle . parameters = {
@@ -96,16 +98,19 @@ PositiveStyle.parameters = {
96
98
export const CustomLayout : Story = props => html `< uui-toast-notification
97
99
.open =${ props . open }
98
100
look ="danger">
99
- Its recommended to use the 'uui-toast-notification-layout' component as the
100
- layout for your toasts. This will ensure consistency in toast appearances,
101
- help achieving the best user experience. If 'uui-toast-notification-layout'
102
- does not provide the options to solve your needs, it is possible append
103
- anything within the toast-notification component. But please consider this
104
- very carefully.
101
+ ${ props . slot
102
+ ? props . slot
103
+ : html ` Its recommended to use the 'uui-toast-notification-layout' component
104
+ as the layout for your toasts. This will ensure consistency in toast
105
+ appearances, help achieving the best user experience. If
106
+ 'uui-toast-notification-layout' does not provide the options to solve your
107
+ needs, it is possible append anything within the toast-notification
108
+ component. But please consider this very carefully.` }
105
109
</ uui-toast-notification > `;
106
110
CustomLayout . args = {
107
111
headline : '' ,
108
112
look : 'danger' ,
113
+ slot : undefined ,
109
114
} ;
110
115
CustomLayout . parameters = {
111
116
docs : {
0 commit comments