@govuk-react/input
Advanced tools
Comparing version
@@ -13,3 +13,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
displayName: "src__StyledInput", | ||
componentId: "u8exb4-0" | ||
componentId: "sc-1ch9crp-0" | ||
})(typography.font({ | ||
@@ -68,3 +68,3 @@ size: 19 | ||
var Input = function Input(_ref2) { | ||
var Input = /*#__PURE__*/React.forwardRef(function (_ref2, ref) { | ||
var type = _ref2.type, | ||
@@ -74,6 +74,6 @@ props = _objectWithoutPropertiesLoose(_ref2, ["type"]); | ||
return /*#__PURE__*/React.createElement(StyledInput, _extends({ | ||
type: type | ||
type: type, | ||
ref: ref | ||
}, props)); | ||
}; | ||
}); | ||
Input.defaultProps = { | ||
@@ -84,3 +84,11 @@ type: 'text', | ||
}; | ||
Input.propTypes = { | ||
/** | ||
* HTML `<Input />` type | ||
*/ | ||
type: PropTypes.string, | ||
error: PropTypes.bool, | ||
errorColor: PropTypes.string | ||
}; | ||
export default Input; | ||
//# sourceMappingURL=index.js.map |
@@ -11,3 +11,3 @@ import React from 'react'; | ||
type: "text", | ||
error: "example" | ||
error: true | ||
}); | ||
@@ -17,3 +17,3 @@ var withColouredError = /*#__PURE__*/React.createElement(Input, { | ||
errorColor: ORANGE, | ||
error: "example" | ||
error: true | ||
}); | ||
@@ -20,0 +20,0 @@ it('matches wrapper snapshot', function () { |
@@ -26,3 +26,3 @@ "use strict"; | ||
displayName: "src__StyledInput", | ||
componentId: "u8exb4-0" | ||
componentId: "sc-1ch9crp-0" | ||
})(_lib.typography.font({ | ||
@@ -83,3 +83,3 @@ size: 19 | ||
var Input = function Input(_ref2) { | ||
var Input = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) { | ||
var type = _ref2.type, | ||
@@ -89,5 +89,6 @@ props = _objectWithoutPropertiesLoose(_ref2, ["type"]); | ||
return /*#__PURE__*/_react["default"].createElement(StyledInput, _extends({ | ||
type: type | ||
type: type, | ||
ref: ref | ||
}, props)); | ||
}; | ||
}); | ||
@@ -99,4 +100,12 @@ Input.defaultProps = { | ||
}; | ||
Input.propTypes = { | ||
/** | ||
* HTML `<Input />` type | ||
*/ | ||
type: _propTypes["default"].string, | ||
error: _propTypes["default"].bool, | ||
errorColor: _propTypes["default"].string | ||
}; | ||
var _default = Input; | ||
exports["default"] = _default; | ||
//# sourceMappingURL=index.js.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
type: "text", | ||
error: "example" | ||
error: true | ||
}); | ||
@@ -27,3 +27,3 @@ | ||
errorColor: _govukColours.ORANGE, | ||
error: "example" | ||
error: true | ||
}); | ||
@@ -30,0 +30,0 @@ |
{ | ||
"name": "@govuk-react/input", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"dependencies": { | ||
"@govuk-react/constants": "^0.9.0", | ||
"@govuk-react/lib": "^0.9.0", | ||
"@govuk-react/constants": "^0.9.1", | ||
"@govuk-react/lib": "^0.9.1", | ||
"govuk-colours": "^1.1.0" | ||
@@ -15,4 +15,4 @@ }, | ||
"build": "yarn build:lib && yarn build:es", | ||
"build:lib": "rimraf lib && babel src -d lib --source-maps --config-file ../../babel.config.js", | ||
"build:es": "rimraf es && cross-env BABEL_ENV=es babel src -d es --source-maps --config-file ../../babel.config.js", | ||
"build:lib": "rimraf lib && babel src -x .js,jsx,.ts,.tsx -d lib --source-maps --config-file ../../babel.config.js", | ||
"build:es": "rimraf es && cross-env BABEL_ENV=es babel src -x .js,jsx,.ts,.tsx -d es --source-maps --config-file ../../babel.config.js", | ||
"docs": "doc-component ./lib/index.js ./README.md" | ||
@@ -19,0 +19,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30607
3.57%365
5.19%Updated