Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@govuk-react/error-text

Package Overview
Dependencies
Maintainers
5
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@govuk-react/error-text - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

12

es/index.js

@@ -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 @@

13

es/stories.js
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc