grommet-icon-loader
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -42,3 +42,3 @@ 'use strict'; | ||
// convert hyphens to camelcase | ||
if (key.indexOf('-') > -1) return (0, _parsers.hyphenToCamel)(key); | ||
if (key.indexOf('-') > -1) return (0, _camelCase2.default)(key); | ||
return true; | ||
@@ -92,4 +92,6 @@ } | ||
var _parsers = require('./parsers'); | ||
var _camelCase = require('camel-case'); | ||
var _camelCase2 = _interopRequireDefault(_camelCase); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -96,0 +98,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -8,5 +8,13 @@ Object.defineProperty(exports, "__esModule", { | ||
exports.default = function (resolve) { | ||
return resolve.copyright + "\n\nimport React, { PropTypes } from 'react';\nimport classnames from 'classnames';\nimport FormattedMessage from '" + resolve.context + "components/FormattedMessage';\n\nconst CLASS_ROOT = 'control-icon';\n\nconst Icon = props => {\n let { a11yTitle, a11yTitleId, className, colorIndex, large, size } = props;\n\n if (!size && large) {\n size = 'large';\n }\n\n let classes = classnames(\n CLASS_ROOT,\n `${CLASS_ROOT}-" + resolve.fileName + "`,\n className,\n {\n [`${CLASS_ROOT}--${size}`]: size,\n [`color-index-${colorIndex}`]: colorIndex\n }\n );\n\n let titleLabel = a11yTitle || '" + resolve.fileName + "';\n a11yTitle = <FormattedMessage id={titleLabel} defaultMessage={titleLabel} />;\n\n return " + resolve.svg + ";\n};\n\nIcon.propTypes = {\n a11yTitle: PropTypes.string,\n a11yTitleId: PropTypes.string,\n colorIndex: PropTypes.string,\n large: PropTypes.bool,\n size: PropTypes.oneOf(['small', 'medium', 'large'])\n};\n\nIcon.defaultProps = {\n a11yTitleId: '" + resolve.fileName + "-title'\n};\n\nIcon.icon = true;\n\nexport default Icon;\n"; | ||
return resolve.copyright + '\n\nimport React, { PropTypes } from \'react\';\nimport classnames from \'classnames\';\nimport FormattedMessage from \'' + resolve.context + 'components/FormattedMessage\';\n\nconst CLASS_ROOT = \'control-icon\';\n\nconst Icon = props => {\n let { a11yTitle, a11yTitleId, className, colorIndex, large, size } = props;\n\n if (!size && large) {\n size = \'large\';\n }\n\n let classes = classnames(\n CLASS_ROOT,\n `${CLASS_ROOT}-' + resolve.fileName + '`,\n className,\n {\n [`${CLASS_ROOT}--${size}`]: size,\n [`color-index-${colorIndex}`]: colorIndex\n }\n );\n\n let titleLabel = a11yTitle || \'' + resolve.fileName + '\';\n a11yTitle = <FormattedMessage id={titleLabel} defaultMessage={titleLabel} />;\n\n return ' + resolve.svg + ';\n};\n\nIcon.propTypes = {\n a11yTitle: PropTypes.string,\n a11yTitleId: PropTypes.string,\n colorIndex: PropTypes.string,\n large: PropTypes.bool,\n size: PropTypes.oneOf([\'small\', \'medium\', \'large\', \'huge\'])\n};\n\nIcon.defaultProps = {\n a11yTitleId: \'' + resolve.fileName + '-title\'\n};\n\nIcon.icon = true;\n\nIcon.displayName = \'' + (0, _pascalCase2.default)(resolve.fileName) + '\';\n\nexport default Icon;\n'; | ||
}; | ||
; // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP | ||
var _pascalCase = require('pascal-case'); | ||
var _pascalCase2 = _interopRequireDefault(_pascalCase); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP | ||
; |
{ | ||
"name": "grommet-icon-loader", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"description": "Loads svg icons as a react component in Grommet", | ||
@@ -28,6 +28,8 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"camel-case": "^1.2.2", | ||
"loader-utils": "^0.2.11", | ||
"pascal-case": "^1.1.2", | ||
"xml2js": "~0.4.9", | ||
"xmlbuilder": "~2.6.4", | ||
"yargs": "~3.18.0", | ||
"loader-utils": "^0.2.11" | ||
"yargs": "~3.18.0" | ||
}, | ||
@@ -34,0 +36,0 @@ "devDependencies": { |
@@ -10,3 +10,3 @@ // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP | ||
import makeComponent from './make-component'; | ||
import {hyphenToCamel} from './parsers'; | ||
import camelCase from 'camel-case'; | ||
@@ -47,3 +47,3 @@ export default function(content) { | ||
// convert hyphens to camelcase | ||
if (key.indexOf('-') > -1) return hyphenToCamel(key); | ||
if (key.indexOf('-') > -1) return camelCase(key); | ||
return true; | ||
@@ -50,0 +50,0 @@ } |
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP | ||
import pascalCase from 'pascal-case'; | ||
export default function(resolve) { | ||
@@ -40,3 +42,3 @@ return `${resolve.copyright} | ||
large: PropTypes.bool, | ||
size: PropTypes.oneOf(['small', 'medium', 'large']) | ||
size: PropTypes.oneOf(['small', 'medium', 'large', 'huge']) | ||
}; | ||
@@ -50,2 +52,4 @@ | ||
Icon.displayName = '${pascalCase(resolve.fileName)}'; | ||
export default Icon; | ||
@@ -52,0 +56,0 @@ `; |
@@ -61,3 +61,3 @@ // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP | ||
large: PropTypes.bool, | ||
size: PropTypes.oneOf(['small', 'medium', 'large']) | ||
size: PropTypes.oneOf(['small', 'medium', 'large', 'huge']) | ||
}; | ||
@@ -71,2 +71,4 @@ | ||
Icon.displayName = 'Add'; | ||
export default Icon; | ||
@@ -73,0 +75,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
23427
512
6
18
+ Addedcamel-case@^1.2.2
+ Addedpascal-case@^1.1.2
+ Addedcamel-case@1.2.2(transitive)
+ Addedlower-case@1.1.4(transitive)
+ Addedpascal-case@1.1.2(transitive)
+ Addedsentence-case@1.1.3(transitive)
+ Addedupper-case@1.1.3(transitive)
+ Addedupper-case-first@1.1.2(transitive)