@grafana/components 0.0.59 → 0.0.60
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.
|
@@ -15,7 +15,7 @@ const Icon = forwardRef(
|
|
|
15
15
|
const styles = getStyles({ strokeWidth, hasSolidFill });
|
|
16
16
|
const svgProps = {
|
|
17
17
|
"aria-hidden": isAriaHidden,
|
|
18
|
-
title: isAriaHidden ?
|
|
18
|
+
title: isAriaHidden ? null : title,
|
|
19
19
|
height: ICON_SIZES[size],
|
|
20
20
|
width: ICON_SIZES[size]
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { IconSize, ICON_SIZES, ICON_STROKE_WIDTHS, SVGComponent, SVGComponentProps } from './types';\nimport { getStyles } from './Icon.styles';\n\nexport interface IconProps {\n /**\n * How big to render the icon\n */\n size?: IconSize;\n\n /**\n * Optional stroke width for the icon elements.\n */\n strokeWidth?: number;\n\n /**\n * Icon component to render\n */\n component: SVGComponent;\n\n /**\n * Should the icon be explicitly hidden from the accessibility tree? This\n * should be used if the icon is placed inside of another interactive element\n * (e.g. a button) which should instead dictate the description (e.g. ‘delete\n * button’ rather than ‘delete button, trash icon’)\n */\n isAriaHidden?: boolean;\n\n /**\n * String to override the default icon title element with; this will be\n * ignored if isAriaHidden is true\n */\n title?: string;\n}\n\n/**\n * A component to render an SVG icon.\n */\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(\n (\n {\n size = 'md',\n strokeWidth = ICON_STROKE_WIDTHS[size],\n component: Component,\n isAriaHidden,\n title,\n },\n forwardedRef,\n ) => {\n const hasSolidFill = Object.hasOwn(Component, 'fill') ? Component.fill === 'solid' : false;\n const styles = getStyles({ strokeWidth, hasSolidFill });\n\n const svgProps: SVGComponentProps = {\n 'aria-hidden': isAriaHidden,\n title: isAriaHidden ?
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { IconSize, ICON_SIZES, ICON_STROKE_WIDTHS, SVGComponent, SVGComponentProps } from './types';\nimport { getStyles } from './Icon.styles';\n\nexport interface IconProps {\n /**\n * How big to render the icon\n */\n size?: IconSize;\n\n /**\n * Optional stroke width for the icon elements.\n */\n strokeWidth?: number;\n\n /**\n * Icon component to render\n */\n component: SVGComponent;\n\n /**\n * Should the icon be explicitly hidden from the accessibility tree? This\n * should be used if the icon is placed inside of another interactive element\n * (e.g. a button) which should instead dictate the description (e.g. ‘delete\n * button’ rather than ‘delete button, trash icon’)\n */\n isAriaHidden?: boolean;\n\n /**\n * String to override the default icon title element with; this will be\n * ignored if isAriaHidden is true\n */\n title?: string;\n}\n\n/**\n * A component to render an SVG icon.\n */\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(\n (\n {\n size = 'md',\n strokeWidth = ICON_STROKE_WIDTHS[size],\n component: Component,\n isAriaHidden,\n title,\n },\n forwardedRef,\n ) => {\n const hasSolidFill = Object.hasOwn(Component, 'fill') ? Component.fill === 'solid' : false;\n const styles = getStyles({ strokeWidth, hasSolidFill });\n\n const svgProps: SVGComponentProps = {\n 'aria-hidden': isAriaHidden,\n title: isAriaHidden ? null : title,\n height: ICON_SIZES[size],\n width: ICON_SIZES[size],\n };\n\n return <Component ref={forwardedRef} className={styles} {...svgProps} />;\n },\n);\n\nIcon.displayName = 'Icon';\n"],"names":[],"mappings":";;;;;AAsCO,MAAM,IAAA,GAAO,UAAA;AAAA,EAClB,CACE;AAAA,IACE,IAAA,GAAO,IAAA;AAAA,IACP,WAAA,GAAc,mBAAmB,IAAI,CAAA;AAAA,IACrC,SAAA,EAAW,SAAA;AAAA,IACX,YAAA;AAAA,IACA;AAAA,KAEF,YAAA,KACG;AACH,IAAA,MAAM,YAAA,GAAe,OAAO,MAAA,CAAO,SAAA,EAAW,MAAM,CAAA,GAAI,SAAA,CAAU,SAAS,OAAA,GAAU,KAAA;AACrF,IAAA,MAAM,MAAA,GAAS,SAAA,CAAU,EAAE,WAAA,EAAa,cAAc,CAAA;AAEtD,IAAA,MAAM,QAAA,GAA8B;AAAA,MAClC,aAAA,EAAe,YAAA;AAAA,MACf,KAAA,EAAO,eAAe,IAAA,GAAO,KAAA;AAAA,MAC7B,MAAA,EAAQ,WAAW,IAAI,CAAA;AAAA,MACvB,KAAA,EAAO,WAAW,IAAI;AAAA,KACxB;AAEA,IAAA,2BAAQ,SAAA,EAAA,EAAU,GAAA,EAAK,cAAc,SAAA,EAAW,MAAA,EAAS,GAAG,QAAA,EAAU,CAAA;AAAA,EACxE;AACF;AAEA,IAAA,CAAK,WAAA,GAAc,MAAA;;;;"}
|