grommet-icon-loader
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -27,3 +27,3 @@ 'use strict'; | ||
return { | ||
svg: root.end().replace(/"{/g, '{').replace(/}"/g, '}'), | ||
svg: root.end().replace(/"{/g, '{').replace(/}"/g, '}').replace('version="1.1"', '{...restProps} version="1.1"'), | ||
fileName: fileName, | ||
@@ -30,0 +30,0 @@ copyright: copyright ? '// ' + copyright : '', |
@@ -8,3 +8,3 @@ 'use strict'; | ||
exports.default = function (resolve) { | ||
return resolve.copyright + '\n\nimport React, { Component, PropTypes } from \'react\';\nimport classnames from \'classnames\';\nimport CSSClassnames from \'' + resolve.context + 'utils/CSSClassnames\';\nimport Intl from \'' + resolve.context + 'utils/Intl\';\n\nconst CLASS_ROOT = CSSClassnames.CONTROL_ICON;\nconst COLOR_INDEX = CSSClassnames.COLOR_INDEX;\n\nexport default class Icon extends Component {\n render () {\n const { className, colorIndex } = this.props;\n let { a11yTitle, size, responsive } = this.props;\n let { intl } = this.context;\n\n const classes = classnames(\n CLASS_ROOT,\n `${CLASS_ROOT}-' + resolve.fileName + '`,\n className,\n {\n [`${CLASS_ROOT}--${size}`]: size,\n [`${CLASS_ROOT}--responsive`]: responsive,\n [`${COLOR_INDEX}-${colorIndex}`]: colorIndex\n }\n );\n\n a11yTitle = a11yTitle || Intl.getMessage(intl, \'' + resolve.fileName + '\');\n\n return ' + resolve.svg + ';\n }\n};\n\nIcon.contextTypes = {\n intl: PropTypes.object\n};\n\nIcon.defaultProps = {\n responsive: true\n};\n\nIcon.displayName = \'' + (0, _pascalCase2.default)(resolve.fileName) + '\';\n\nIcon.icon = true;\n\nIcon.propTypes = {\n a11yTitle: PropTypes.string,\n colorIndex: PropTypes.string,\n size: PropTypes.oneOf([\'small\', \'medium\', \'large\', \'xlarge\', \'huge\']),\n responsive: PropTypes.bool\n};\n\n'; | ||
return resolve.copyright + '\n\nimport React, { Component, PropTypes } from \'react\';\nimport classnames from \'classnames\';\nimport CSSClassnames from \'' + resolve.context + 'utils/CSSClassnames\';\nimport Intl from \'' + resolve.context + 'utils/Intl\';\nimport Props from \'' + resolve.context + 'utils/Props\';\n\nconst CLASS_ROOT = CSSClassnames.CONTROL_ICON;\nconst COLOR_INDEX = CSSClassnames.COLOR_INDEX;\n\nexport default class Icon extends Component {\n render () {\n const { className, colorIndex } = this.props;\n let { a11yTitle, size, responsive } = this.props;\n let { intl } = this.context;\n\n const classes = classnames(\n CLASS_ROOT,\n `${CLASS_ROOT}-' + resolve.fileName + '`,\n className,\n {\n [`${CLASS_ROOT}--${size}`]: size,\n [`${CLASS_ROOT}--responsive`]: responsive,\n [`${COLOR_INDEX}-${colorIndex}`]: colorIndex\n }\n );\n\n a11yTitle = a11yTitle || Intl.getMessage(intl, \'' + resolve.fileName + '\');\n\n const restProps = Props.omit(this.props, Object.keys(Icon.propTypes));\n return ' + resolve.svg + ';\n }\n};\n\nIcon.contextTypes = {\n intl: PropTypes.object\n};\n\nIcon.defaultProps = {\n responsive: true\n};\n\nIcon.displayName = \'' + (0, _pascalCase2.default)(resolve.fileName) + '\';\n\nIcon.icon = true;\n\nIcon.propTypes = {\n a11yTitle: PropTypes.string,\n colorIndex: PropTypes.string,\n size: PropTypes.oneOf([\'small\', \'medium\', \'large\', \'xlarge\', \'huge\']),\n responsive: PropTypes.bool\n};\n\n'; | ||
}; | ||
@@ -11,0 +11,0 @@ |
{ | ||
"name": "grommet-icon-loader", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "Loads svg icons as a react component in Grommet", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -53,3 +53,4 @@ // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP | ||
return { | ||
svg: root.end().replace(/"{/g, '{').replace(/}"/g, '}'), | ||
svg: root.end().replace(/"{/g, '{').replace(/}"/g, '}') | ||
.replace('version="1.1"', '{...restProps} version="1.1"'), | ||
fileName: fileName, | ||
@@ -56,0 +57,0 @@ copyright: copyright ? '// ' + copyright : '', |
@@ -12,2 +12,3 @@ // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP | ||
import Intl from '${resolve.context}utils/Intl'; | ||
import Props from '${resolve.context}utils/Props'; | ||
@@ -36,2 +37,3 @@ const CLASS_ROOT = CSSClassnames.CONTROL_ICON; | ||
const restProps = Props.omit(this.props, Object.keys(Icon.propTypes)); | ||
return ${resolve.svg}; | ||
@@ -38,0 +40,0 @@ } |
@@ -31,2 +31,3 @@ // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP | ||
import Intl from 'grommet/utils/Intl'; | ||
import Props from 'grommet/utils/Props'; | ||
@@ -54,4 +55,5 @@ const CLASS_ROOT = CSSClassnames.CONTROL_ICON; | ||
a11yTitle = a11yTitle || Intl.getMessage(intl, 'add'); | ||
const restProps = Props.omit(this.props, Object.keys(Icon.propTypes)); | ||
return <svg version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><g id="add"><rect id="_x2E_svg_1_" x="0" fill="none" width="24" height="24"/><path fill="#000000" d="M0,12h24 M12,24V0" stroke="none" /></g></svg>; | ||
return <svg {...restProps} version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><g id="add"><rect id="_x2E_svg_1_" x="0" fill="none" width="24" height="24"/><path fill="#000000" d="M0,12h24 M12,24V0" stroke="none" /></g></svg>; | ||
} | ||
@@ -58,0 +60,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
24455
534