@govuk-react/input
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -47,9 +47,18 @@ 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); } | ||
* Simple | ||
* | ||
* ```jsx | ||
* <Input /> | ||
* import { Label, LabelText, HintText, ErrorText, Input } from 'govuk-react' | ||
* | ||
* <Label> | ||
* <LabelText>Example label</LabelText> | ||
* <HintText>Example hint</HintText> | ||
* <ErrorText>Example error</ErrorText> | ||
* <Input value={value} onClick={onClick} /> | ||
* </Label> | ||
* ``` | ||
* | ||
* ### References: | ||
* - https://github.com/alphagov/govuk-frontend/tree/master/src/components/ | ||
* | ||
* - https://github.com/alphagov/govuk-frontend/tree/main/src/govuk/components/ | ||
* | ||
* ### TODO: | ||
@@ -69,5 +78,7 @@ * - Remove `errorColor` and provide examples on how to extend the component | ||
Input.defaultProps = { | ||
type: 'text' | ||
type: 'text', | ||
error: false, | ||
errorColor: undefined | ||
}; | ||
export default Input; | ||
//# sourceMappingURL=index.js.map |
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { withDocsCustom } from '@govuk-react/storybook-components'; | ||
import Input from '.'; | ||
import ReadMe from '../README.md'; | ||
var stories = storiesOf('Form/Input', module); | ||
stories.addDecorator(withDocsCustom(ReadMe)); | ||
stories.add('Component default', function () { | ||
export default { | ||
title: 'Form/Input', | ||
component: Input | ||
}; | ||
export var Default = function Default() { | ||
return /*#__PURE__*/React.createElement(Input, { | ||
type: "text" | ||
}); | ||
}); | ||
}; | ||
//# sourceMappingURL=stories.js.map |
@@ -60,9 +60,18 @@ "use strict"; | ||
* Simple | ||
* | ||
* ```jsx | ||
* <Input /> | ||
* import { Label, LabelText, HintText, ErrorText, Input } from 'govuk-react' | ||
* | ||
* <Label> | ||
* <LabelText>Example label</LabelText> | ||
* <HintText>Example hint</HintText> | ||
* <ErrorText>Example error</ErrorText> | ||
* <Input value={value} onClick={onClick} /> | ||
* </Label> | ||
* ``` | ||
* | ||
* ### References: | ||
* - https://github.com/alphagov/govuk-frontend/tree/master/src/components/ | ||
* | ||
* - https://github.com/alphagov/govuk-frontend/tree/main/src/govuk/components/ | ||
* | ||
* ### TODO: | ||
@@ -84,3 +93,5 @@ * - Remove `errorColor` and provide examples on how to extend the component | ||
Input.defaultProps = { | ||
type: 'text' | ||
type: 'text', | ||
error: false, | ||
errorColor: undefined | ||
}; | ||
@@ -87,0 +98,0 @@ var _default = Input; |
"use strict"; | ||
exports.__esModule = true; | ||
exports.Default = exports["default"] = void 0; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = require("@storybook/react"); | ||
var _storybookComponents = require("@govuk-react/storybook-components"); | ||
var _ = _interopRequireDefault(require(".")); | ||
var _README = _interopRequireDefault(require("../README.md")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var stories = (0, _react2.storiesOf)('Form/Input', module); | ||
stories.addDecorator((0, _storybookComponents.withDocsCustom)(_README["default"])); | ||
stories.add('Component default', function () { | ||
var _default = { | ||
title: 'Form/Input', | ||
component: _["default"] | ||
}; | ||
exports["default"] = _default; | ||
var Default = function Default() { | ||
return /*#__PURE__*/_react["default"].createElement(_["default"], { | ||
type: "text" | ||
}); | ||
}); | ||
}; | ||
exports.Default = Default; | ||
//# sourceMappingURL=stories.js.map |
{ | ||
"name": "@govuk-react/input", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"dependencies": { | ||
"@govuk-react/constants": "^0.8.0", | ||
"@govuk-react/lib": "^0.8.0", | ||
"@govuk-react/constants": "^0.9.0", | ||
"@govuk-react/lib": "^0.9.0", | ||
"govuk-colours": "^1.1.0" | ||
@@ -23,3 +23,3 @@ }, | ||
"license": "MIT", | ||
"homepage": "https://github.com/govuk-react/govuk-react/tree/master/components/input", | ||
"homepage": "https://github.com/govuk-react/govuk-react/tree/main/components/input", | ||
"description": "Styled input component with optional type prop, defaulting to 'text'.", | ||
@@ -26,0 +26,0 @@ "private": false, |
@@ -13,9 +13,18 @@ Input | ||
Simple | ||
```jsx | ||
<Input /> | ||
import { Label, LabelText, HintText, ErrorText, Input } from 'govuk-react' | ||
<Label> | ||
<LabelText>Example label</LabelText> | ||
<HintText>Example hint</HintText> | ||
<ErrorText>Example error</ErrorText> | ||
<Input value={value} onClick={onClick} /> | ||
</Label> | ||
``` | ||
### References: | ||
- https://github.com/alphagov/govuk-frontend/tree/master/src/components/ | ||
- https://github.com/alphagov/govuk-frontend/tree/main/src/govuk/components/ | ||
### TODO: | ||
@@ -27,4 +36,6 @@ - Remove `errorColor` and provide examples on how to extend the component | ||
:--- | :------- | :------ | :--- | :---------- | ||
`error` | | ```false``` | bool | | ||
`errorColor` | | ```undefined``` | string | | ||
`type` | | ```'text'``` | string | HTML `<Input />` type | ||
@@ -50,9 +50,18 @@ import React from 'react'; | ||
* Simple | ||
* | ||
* ```jsx | ||
* <Input /> | ||
* import { Label, LabelText, HintText, ErrorText, Input } from 'govuk-react' | ||
* | ||
* <Label> | ||
* <LabelText>Example label</LabelText> | ||
* <HintText>Example hint</HintText> | ||
* <ErrorText>Example error</ErrorText> | ||
* <Input value={value} onClick={onClick} /> | ||
* </Label> | ||
* ``` | ||
* | ||
* ### References: | ||
* - https://github.com/alphagov/govuk-frontend/tree/master/src/components/ | ||
* | ||
* - https://github.com/alphagov/govuk-frontend/tree/main/src/govuk/components/ | ||
* | ||
* ### TODO: | ||
@@ -65,2 +74,4 @@ * - Remove `errorColor` and provide examples on how to extend the component | ||
type: 'text', | ||
error: false, | ||
errorColor: undefined, | ||
}; | ||
@@ -73,4 +84,6 @@ | ||
type: PropTypes.string, | ||
error: PropTypes.bool, | ||
errorColor: PropTypes.string, | ||
}; | ||
export default Input; |
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { withDocsCustom } from '@govuk-react/storybook-components'; | ||
import Input from '.'; | ||
import ReadMe from '../README.md'; | ||
const stories = storiesOf('Form/Input', module); | ||
export default { | ||
title: 'Form/Input', | ||
component: Input, | ||
}; | ||
stories.addDecorator(withDocsCustom(ReadMe)); | ||
stories.add('Component default', () => <Input type="text" />); | ||
export const Default = () => <Input type="text" />; |
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
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
29551
347
40
+ Added@govuk-react/constants@0.9.1(transitive)
+ Added@govuk-react/lib@0.9.1(transitive)
- Removed@govuk-react/constants@0.8.0(transitive)
- Removed@govuk-react/lib@0.8.0(transitive)
Updated@govuk-react/lib@^0.9.0