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