@govuk-react/error-text
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -26,8 +26,16 @@ import styled from 'styled-components'; | ||
* Simple | ||
* | ||
* ```jsx | ||
* <ErrorText>Example</ErrorText> | ||
* 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/blob/master/src/components/error-message/_error-message.scss | ||
* - https://github.com/alphagov/govuk-frontend/blob/main/src/govuk/components/error-message/_error-message.scss | ||
*/ | ||
@@ -34,0 +42,0 @@ |
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { withDocsCustom } from '@govuk-react/storybook-components'; | ||
import ErrorText from '.'; | ||
import ReadMe from '../README.md'; | ||
var stories = storiesOf('Typography/Error text', module); | ||
stories.addDecorator(withDocsCustom(ReadMe)); | ||
stories.add('Component default', function () { | ||
export default { | ||
title: 'Form/Error message', | ||
component: ErrorText | ||
}; | ||
export var Default = function Default() { | ||
return /*#__PURE__*/React.createElement(ErrorText, { | ||
errorText: "example" | ||
}, "Example"); | ||
}); | ||
}; | ||
//# sourceMappingURL=stories.js.map |
@@ -39,8 +39,16 @@ "use strict"; | ||
* Simple | ||
* | ||
* ```jsx | ||
* <ErrorText>Example</ErrorText> | ||
* 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/blob/master/src/components/error-message/_error-message.scss | ||
* - https://github.com/alphagov/govuk-frontend/blob/main/src/govuk/components/error-message/_error-message.scss | ||
*/ | ||
@@ -47,0 +55,0 @@ |
"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)('Typography/Error text', module); | ||
stories.addDecorator((0, _storybookComponents.withDocsCustom)(_README["default"])); | ||
stories.add('Component default', function () { | ||
var _default = { | ||
title: 'Form/Error message', | ||
component: _["default"] | ||
}; | ||
exports["default"] = _default; | ||
var Default = function Default() { | ||
return /*#__PURE__*/_react["default"].createElement(_["default"], { | ||
errorText: "example" | ||
}, "Example"); | ||
}); | ||
}; | ||
exports.Default = Default; | ||
//# sourceMappingURL=stories.js.map |
{ | ||
"name": "@govuk-react/error-text", | ||
"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/error-text", | ||
"homepage": "https://github.com/govuk-react/govuk-react/tree/main/components/error-text", | ||
"description": "Renders a styled span element containing children provided.", | ||
@@ -26,0 +26,0 @@ "private": false, |
@@ -14,8 +14,16 @@ ErrorText | ||
Simple | ||
```jsx | ||
<ErrorText>Example</ErrorText> | ||
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/blob/master/src/components/error-message/_error-message.scss | ||
- https://github.com/alphagov/govuk-frontend/blob/main/src/govuk/components/error-message/_error-message.scss | ||
@@ -22,0 +30,0 @@ ### Properties |
@@ -26,10 +26,18 @@ import styled from 'styled-components'; | ||
* Simple | ||
* | ||
* ```jsx | ||
* <ErrorText>Example</ErrorText> | ||
* 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/blob/master/src/components/error-message/_error-message.scss | ||
* - https://github.com/alphagov/govuk-frontend/blob/main/src/govuk/components/error-message/_error-message.scss | ||
*/ | ||
const ErrorText = props => <StyledError {...props} />; | ||
const ErrorText = (props) => <StyledError {...props} />; | ||
@@ -36,0 +44,0 @@ ErrorText.propTypes = { |
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { withDocsCustom } from '@govuk-react/storybook-components'; | ||
import ErrorText from '.'; | ||
import ReadMe from '../README.md'; | ||
const stories = storiesOf('Typography/Error text', module); | ||
export default { | ||
title: 'Form/Error message', | ||
component: ErrorText, | ||
}; | ||
stories.addDecorator(withDocsCustom(ReadMe)); | ||
stories.add('Component default', () => <ErrorText errorText="example">Example</ErrorText>); | ||
export const Default = () => <ErrorText errorText="example">Example</ErrorText>; |
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
17208
220
35
+ 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