Commit 2fbd3e2 1 parent f27aea3 commit 2fbd3e2 Copy full SHA for 2fbd3e2
File tree 4 files changed +10
-3
lines changed
packages/core-components/src/components/snackbar
4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 16
16
| ` opened ` | ` opened ` | Whether the snackbar is currently visible. Set to true to display the snackbar. | ` boolean ` | ` false ` |
17
17
| ` timed ` | ` timed ` | Whether snackbar is show for limited time. Default is true. Error snackbars cannot be timed. | ` boolean ` | ` true ` |
18
18
| ` type ` | ` type ` | The type of snackbar. Default is info. | ` "error" \| "info" \| "success" \| "warning" ` | ` 'info' ` |
19
+ | ` width ` | ` width ` | Width of the snackbar in px, Default value is 270px* | ` string ` | ` '270px' ` |
19
20
20
21
21
22
## Events
Original file line number Diff line number Diff line change 7
7
line-height : var (--b2b-size-copy-line-height-100 );
8
8
color : var (--b2b-color-copy-default );
9
9
max-width : 1000px ;
10
- min-width : 270px ;
11
10
max-height : 56px ;
12
11
min-height : 48px ;
13
12
box-shadow : 0 var (--b2b-size-1 ) var (--b2b-size-10 ) 0 #00000040 ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const meta: Meta = {
18
18
duration : 5000 ,
19
19
hasAction : true ,
20
20
actionLabel : 'Call to Action' ,
21
+ width : '270px' ,
21
22
} ,
22
23
argTypes : getArgTypes ( 'b2b-snackbar' ) ,
23
24
render : ( { ...args } ) => {
@@ -42,7 +43,8 @@ const meta: Meta = {
42
43
timed ="${ args . timed } "
43
44
duration ="${ args . duration } "
44
45
has-action ="${ args . hasAction } "
45
- action-label ="${ args . actionLabel } "> </ b2b-snackbar > ` ;
46
+ action-label ="${ args . actionLabel } "
47
+ width ="${ args . width } "> </ b2b-snackbar > ` ;
46
48
} ,
47
49
} ;
48
50
@@ -104,6 +106,7 @@ export const TimedSnackbar: Story = {
104
106
timed : true ,
105
107
duration : 3000 ,
106
108
description : 'This is timed snackbar' ,
109
+ width : '270px' ,
107
110
} ,
108
111
play : async ( ) => {
109
112
await showSnackBar ( ) ;
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ export class SnackbarComponent {
35
35
/** Text for the Call-to-Action link. */
36
36
@Prop ( ) actionLabel : string ;
37
37
38
+ /** Width of the snackbar in px, Default value is 270px. */
39
+ @Prop ( ) width : string = '270px' ;
40
+
38
41
/** Emits whenever the snackbar is closed. */
39
42
@Event ( { eventName : 'b2b-close' } )
40
43
b2bClose : EventEmitter < void > ;
@@ -137,7 +140,8 @@ export class SnackbarComponent {
137
140
'b2b-snackbar' : true ,
138
141
[ `b2b-snackbar--${ this . type } ` ] : true ,
139
142
'b2b-snackbar--opened' : this . opened ,
140
- } } >
143
+ } }
144
+ style = { { minWidth : this . width } } >
141
145
< div class = "b2b-snackbar__content" >
142
146
< span class = { { [ `b2b-snackbar--${ this . type } __icon` ] : true } } >
143
147
{ this . chooseIcon ( ) }
You can’t perform that action at this time.
0 commit comments