@popmenu/common-ui 0.87.0 → 0.87.1
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.
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface IconProps {
|
|
3
|
-
/** Adds aria-
|
|
4
|
-
'aria-
|
|
3
|
+
/** Adds aria-describedby attribute to the html element */
|
|
4
|
+
'aria-describedby'?: string;
|
|
5
5
|
/** Overrides aria-hidden attribute on the html element */
|
|
6
6
|
'aria-hidden'?: boolean;
|
|
7
|
+
/** Adds aria-label attribute to the html element */
|
|
8
|
+
'aria-label'?: string;
|
|
7
9
|
/** Adds to the class attribute on the html element */
|
|
8
10
|
className?: string;
|
|
9
11
|
/** The icon from @popmenu/web-icons to be rendered */
|
package/build/index.es.js
CHANGED
|
@@ -371,7 +371,8 @@ var classNames = classnames.exports;
|
|
|
371
371
|
var iconStaticClassName = 'pop-icon';
|
|
372
372
|
var Icon = function (props) {
|
|
373
373
|
var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
|
|
374
|
-
|
|
374
|
+
var hasAccessibleAttr = Boolean(restProps['aria-describedby'] || restProps['aria-label']);
|
|
375
|
+
if (!hasAccessibleAttr && restProps['aria-hidden'] === undefined) {
|
|
375
376
|
restProps['aria-hidden'] = true;
|
|
376
377
|
}
|
|
377
378
|
var classes = useIconStyles(props);
|