@@ -254,6 +254,7 @@ return /******/ (function(modules) { // webpackBootstrap
254
254
ariaHideApp : _propTypes2 . default . bool ,
255
255
shouldCloseOnOverlayClick : _propTypes2 . default . bool ,
256
256
parentSelector : _propTypes2 . default . func ,
257
+ aria : _propTypes2 . default . object ,
257
258
role : _propTypes2 . default . string ,
258
259
contentLabel : _propTypes2 . default . string . isRequired
259
260
} ;
@@ -1384,6 +1385,13 @@ return /******/ (function(modules) { // webpackBootstrap
1384
1385
return typeof additional === 'string' && additional ? className + ' ' + additional : className ;
1385
1386
} ;
1386
1387
1388
+ _this . ariaAttributes = function ( items ) {
1389
+ return Object . keys ( items ) . reduce ( function ( acc , name ) {
1390
+ acc [ 'aria-' + name ] = items [ name ] ;
1391
+ return acc ;
1392
+ } , { } ) ;
1393
+ } ;
1394
+
1387
1395
_this . state = {
1388
1396
afterOpen : false ,
1389
1397
beforeClose : false
@@ -1490,15 +1498,16 @@ return /******/ (function(modules) { // webpackBootstrap
1490
1498
onClick : this . handleOverlayOnClick } ,
1491
1499
_react2 . default . createElement (
1492
1500
'div' ,
1493
- {
1501
+ _extends ( {
1494
1502
ref : this . setContentRef ,
1495
1503
style : _extends ( { } , contentStyles , this . props . style . content ) ,
1496
1504
className : this . buildClassName ( 'content' , className ) ,
1497
1505
tabIndex : '-1' ,
1498
1506
onKeyDown : this . handleKeyDown ,
1499
1507
onClick : this . handleContentOnClick ,
1500
1508
role : this . props . role ,
1501
- 'aria-label' : this . props . contentLabel } ,
1509
+ 'aria-label' : this . props . contentLabel
1510
+ } , this . ariaAttributes ( this . props . aria || { } ) ) ,
1502
1511
this . props . children
1503
1512
)
1504
1513
) ;
@@ -1535,6 +1544,7 @@ return /******/ (function(modules) { // webpackBootstrap
1535
1544
shouldCloseOnOverlayClick : _propTypes . PropTypes . bool ,
1536
1545
role : _propTypes . PropTypes . string ,
1537
1546
contentLabel : _propTypes . PropTypes . string ,
1547
+ aria : _propTypes . PropTypes . object ,
1538
1548
children : _propTypes . PropTypes . node
1539
1549
} ;
1540
1550
exports . default = ModalPortal ;
0 commit comments