nav-frontend-alertstriper
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -155,9 +155,11 @@ 'use strict'; | ||
var ariaAttrs = type === 'advarsel' ? { 'aria-live': 'assertive' } : {}; | ||
return _react2.default.createElement( | ||
'div', | ||
_extends({ className: cls(type, solid, className) }, props), | ||
_extends({ className: cls(type, solid, className) }, props, ariaAttrs), | ||
_react2.default.createElement( | ||
'span', | ||
{ className: 'alertstripe__ikon', 'aria-label': ikonKind(type, solid) }, | ||
_react2.default.createElement(_navFrontendIkonerAssets2.default, { kind: ikonKind(type, solid), size: size }) | ||
{ className: 'alertstripe__ikon', 'aria-label': type }, | ||
_react2.default.createElement(_navFrontendIkonerAssets2.default, { kind: ikonKind(type, solid), height: size, width: size }) | ||
), | ||
@@ -180,3 +182,3 @@ _react2.default.createElement( | ||
solid: _propTypes2.default.bool, | ||
size: _propTypes2.default.string, | ||
size: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), | ||
className: _propTypes2.default.string | ||
@@ -183,0 +185,0 @@ }; |
{ | ||
"name": "nav-frontend-alertstriper", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"main": "lib/alertstripe.js", | ||
@@ -18,4 +18,4 @@ "jsnext:main": "src/alertstripe.js", | ||
"classnames": "^2.2.5", | ||
"nav-frontend-alertstriper-style": "^0.2.14", | ||
"nav-frontend-ikoner-assets": "^0.2.12", | ||
"nav-frontend-alertstriper-style": "^0.2.15", | ||
"nav-frontend-ikoner-assets": "^0.2.13", | ||
"nav-frontend-typografi": "^1.0.9", | ||
@@ -27,4 +27,4 @@ "prop-types": "^15.5.10", | ||
"@storybook/react": "3.2.0", | ||
"nav-frontend-alertstriper-style": "^0.2.14", | ||
"nav-frontend-ikoner-assets": "^0.2.12", | ||
"nav-frontend-alertstriper-style": "^0.2.15", | ||
"nav-frontend-ikoner-assets": "^0.2.13", | ||
"nav-frontend-typografi": "^1.0.9", | ||
@@ -31,0 +31,0 @@ "react": "^15.4.2 || ^16.0.0" |
@@ -33,7 +33,8 @@ import PT from 'prop-types'; | ||
const { type, solid, size, className, children, ...props } = this.props; | ||
const ariaAttrs = type === 'advarsel' ? { 'aria-live': 'assertive' } : {}; | ||
return ( | ||
<div className={cls(type, solid, className)} {...props}> | ||
<span className="alertstripe__ikon" aria-label={ikonKind(type, solid)}> | ||
<Ikon kind={ikonKind(type, solid)} size={size} /> | ||
<div className={cls(type, solid, className)} {...props} {...ariaAttrs}> | ||
<span className="alertstripe__ikon" aria-label={type}> | ||
<Ikon kind={ikonKind(type, solid)} height={size} width={size} /> | ||
</span> | ||
@@ -50,3 +51,3 @@ <Normaltekst className="alertstripe__tekst" tag="span">{children}</Normaltekst> | ||
solid: PT.bool, | ||
size: PT.string, | ||
size: PT.oneOfType([PT.string, PT.number]), | ||
className: PT.string | ||
@@ -53,0 +54,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21058
354