File tree Expand file tree Collapse file tree 16 files changed +63
-21
lines changed
skeleton-react/src/components/Toast
skeleton-svelte/src/components/Toast
skeleton-react/src/app/components/app-bar
skeleton-svelte/src/routes/components
themes.skeleton.dev/src/lib/components Expand file tree Collapse file tree 16 files changed +63
-21
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @skeletonlabs/skeleton-svelte " : minor
3
+ " @skeletonlabs/skeleton-react " : minor
4
+ ---
5
+
6
+ feature: Added ` aria-label ` and ` title ` props for icon buttons implemented within the Svelte and React Toast components.
Original file line number Diff line number Diff line change @@ -46,7 +46,13 @@ export function Toast(props: ToastProps) {
46
46
</ div >
47
47
{ api . closable && (
48
48
// Dismiss Button
49
- < button className = { `${ props . btnDismissBase } ${ props . btnDismissClasses } ` } onClick = { api . dismiss } data-testid = "toast-dismiss" >
49
+ < button
50
+ className = { `${ props . btnDismissBase } ${ props . btnDismissClasses } ` }
51
+ title = { props . btnDismissTitle }
52
+ aria-label = { props . btnDismissAriaLabel }
53
+ onClick = { api . dismiss }
54
+ data-testid = "toast-dismiss"
55
+ >
50
56
×
51
57
</ button >
52
58
) }
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ export function Toaster({
27
27
// Dismiss Button
28
28
btnDismissBase = 'btn-icon hover:preset-tonal' ,
29
29
btnDismissClasses = '' ,
30
+ btnDismissTitle = 'Dismiss' ,
31
+ btnDismissAriaLabel = 'Dismiss' ,
30
32
// State
31
33
stateInfo = 'preset-outlined-surface-200-800 preset-filled-surface-50-950' ,
32
34
stateSuccess = 'preset-filled-success-500' ,
@@ -57,6 +59,8 @@ export function Toaster({
57
59
descriptionClasses = { descriptionClasses }
58
60
btnDismissBase = { btnDismissBase }
59
61
btnDismissClasses = { btnDismissClasses }
62
+ btnDismissTitle = { btnDismissTitle }
63
+ btnDismissAriaLabel = { btnDismissAriaLabel }
60
64
stateInfo = { stateInfo }
61
65
stateError = { stateError }
62
66
stateWarning = { stateWarning }
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ export interface ToasterProps {
38
38
btnDismissBase ?: string ;
39
39
/** Provide arbitrary classes for the dismiss button. */
40
40
btnDismissClasses ?: string ;
41
+ /** Provide the title attribute for the dismiss button. */
42
+ btnDismissTitle ?: string ;
43
+ /** Provide the aria-label attribute for the dismiss button. */
44
+ btnDismissAriaLabel ?: string ;
41
45
42
46
// State ---
43
47
/** Provide base classes for info toasts. */
Original file line number Diff line number Diff line change 40
40
</div >
41
41
{#if api .closable }
42
42
<!-- Dismiss Button -->
43
- <button class =" {props .btnDismissBase } {props .btnDismissClasses }" {...api .getCloseTriggerProps ()} data-testid =" toast-dismiss"
44
- >×</button
43
+ <button
44
+ class =" {props .btnDismissBase } {props .btnDismissClasses }"
45
+ title ={props .btnDismissTitle }
46
+ aria-label ={props .btnDismissAriaLabel }
47
+ {...api .getCloseTriggerProps ()}
48
+ data-testid =" toast-dismiss" >×</button
45
49
>
46
50
{/if }
47
51
</div >
Original file line number Diff line number Diff line change 25
25
// Dismiss Button
26
26
btnDismissBase = ' btn-icon hover:preset-tonal' ,
27
27
btnDismissClasses = ' ' ,
28
+ btnDismissTitle = ' Dismiss' ,
29
+ btnDismissAriaLabel = ' Dismiss' ,
28
30
// State
29
31
stateInfo = ' preset-outlined-surface-200-800 preset-filled-surface-50-950' ,
30
32
stateSuccess = ' preset-filled-success-500' ,
56
58
{descriptionClasses }
57
59
{btnDismissBase }
58
60
{btnDismissClasses }
61
+ {btnDismissTitle }
62
+ {btnDismissAriaLabel }
59
63
{stateInfo }
60
64
{stateError }
61
65
{stateWarning }
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ export interface ToasterProps extends toast.StoreProps {
39
39
btnDismissBase ?: string ;
40
40
/** Provide arbitrary classes for the dismiss button. */
41
41
btnDismissClasses ?: string ;
42
+ /** Provide the title attribute for the dismiss button. */
43
+ btnDismissTitle ?: string ;
44
+ /** Provide the aria-label attribute for the dismiss button. */
45
+ btnDismissAriaLabel ?: string ;
42
46
43
47
// State ---
44
48
/** Provide base classes for info toasts. */
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ export default function Page() {
137
137
< AppBar >
138
138
< AppBar . Toolbar >
139
139
< AppBar . ToolbarLead >
140
- < button type = "button" className = "btn-icon preset-filled-primary-500" >
140
+ < button type = "button" className = "btn-icon preset-filled-primary-500" title = "Menu" aria-label = "Menu" >
141
141
< Skull size = { 22 } />
142
142
</ button >
143
143
< button type = "button" className = "btn preset-filled" >
@@ -149,7 +149,7 @@ export default function Page() {
149
149
< button type = "button" className = "btn preset-filled" >
150
150
Skeleton
151
151
</ button >
152
- < button type = "button" className = "btn-icon preset-filled-primary-500" >
152
+ < button type = "button" className = "btn-icon preset-filled-primary-500" title = "Menu" aria-label = "Menu" >
153
153
< Skull size = { 22 } />
154
154
</ button >
155
155
</ AppBar . ToolbarTrail >
Original file line number Diff line number Diff line change 120
120
<button type =" button" class =" btn preset-filled" >Button before the AppBar</button >
121
121
<AppBar >
122
122
{#snippet lead ()}
123
- <button type ="button" class ="btn-icon preset-filled-primary-500" ><Skull size ={22 } /></button >
123
+ <button type ="button" class ="btn-icon preset-filled-primary-500" title = "Menu" aria-label = "Menu" ><Skull size ={22 } /></button >
124
124
<button type =" button" class =" btn preset-filled" >Skeleton</button >
125
125
{/ snippet }
126
126
Skeleton
127
127
{#snippet trail ()}
128
128
<button type =" button" class =" btn preset-filled" >Skeleton</button >
129
- <button type ="button" class ="btn-icon preset-filled-primary-500" ><Skull size ={22 } /></button >
129
+ <button type ="button" class ="btn-icon preset-filled-primary-500" title = "Menu" aria-label = "Menu" ><Skull size ={22 } /></button >
130
130
{/ snippet }
131
131
</AppBar >
132
132
<button type =" button" class =" btn preset-filled" >Button after the AppBar</button >
135
135
<div dir =" rtl" >
136
136
<AppBar >
137
137
{#snippet lead ()}
138
- <button type ="button" class ="btn-icon preset-filled-primary-500" ><Skull size ={22 } /></button >
138
+ <button type ="button" class ="btn-icon preset-filled-primary-500" title = "Menu" aria-label = "Menu" ><Skull size ={22 } /></button >
139
139
<button type =" button" class =" btn preset-filled" >lead</button >
140
140
{/ snippet }
141
141
skeleton
142
142
{#snippet trail ()}
143
143
<button type =" button" class =" btn preset-filled" >trail</button >
144
- <button type ="button" class ="btn-icon preset-filled-primary-500" ><Skull size ={22 } /></button >
144
+ <button type ="button" class ="btn-icon preset-filled-primary-500" title = "Menu" aria-label = "Menu" ><Skull size ={22 } /></button >
145
145
{/ snippet }
146
146
{#snippet headline ()}
147
147
<h1 class =" h1" >مرحبا بك</h1 >
Original file line number Diff line number Diff line change 44
44
{#snippet content ()}
45
45
<header class =" flex justify-between" >
46
46
<p class =" font-bold text-xl" >Popover</p >
47
- <button class ="btn-icon" onclick ={popoverClose }>
47
+ <button class ="btn-icon" onclick ={popoverClose } title = " Close " aria-label = " Close " >
48
48
<IconX />
49
49
</button >
50
50
</header >
You can’t perform that action at this time.
0 commit comments