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

@govuk-react/label

Package Overview
Dependencies
Maintainers
5
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@govuk-react/label - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

17

es/index.js

@@ -1,2 +0,2 @@

// https://github.com/alphagov/govuk-frontend/tree/master/src/components/
// https://github.com/alphagov/govuk-frontend/tree/main/src/govuk/components/
import styled from 'styled-components';

@@ -35,12 +35,23 @@ import React from 'react';

*
* Label element to wraps label-text and a form input
*
* ### Usage
*
* Simple
*
* ```jsx
* <Label>Example</Label>
* 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/
*
*/

@@ -47,0 +58,0 @@

13

es/stories.js
import React from 'react';
import { storiesOf } from '@storybook/react';
import { withDocsCustom } from '@govuk-react/storybook-components';
import Label from '.';
import ReadMe from '../README.md';
var stories = storiesOf('Form/Label', module);
stories.addDecorator(withDocsCustom(ReadMe));
stories.add('Component default', function () {
export default {
title: 'Form/Label',
component: Label
};
export var Default = function Default() {
return /*#__PURE__*/React.createElement(Label, null, "Example");
});
};
//# sourceMappingURL=stories.js.map

@@ -20,3 +20,3 @@ "use strict";

// https://github.com/alphagov/govuk-frontend/tree/master/src/components/
// https://github.com/alphagov/govuk-frontend/tree/main/src/govuk/components/
// TODO consider removing this, as it's not as per govuk-frontend

@@ -49,12 +49,23 @@ // NB our approach to labels/fields differs at present, which is why we have this

*
* Label element to wraps label-text and a form input
*
* ### Usage
*
* Simple
*
* ```jsx
* <Label>Example</Label>
* 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/
*
*/

@@ -61,0 +72,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)('Form/Label', module);
stories.addDecorator((0, _storybookComponents.withDocsCustom)(_README["default"]));
stories.add('Component default', function () {
var _default = {
title: 'Form/Label',
component: _["default"]
};
exports["default"] = _default;
var Default = function Default() {
return /*#__PURE__*/_react["default"].createElement(_["default"], null, "Example");
});
};
exports.Default = Default;
//# sourceMappingURL=stories.js.map
{
"name": "@govuk-react/label",
"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/label",
"homepage": "https://github.com/govuk-react/govuk-react/tree/main/components/label",
"description": "Styled label with children displayed as text.",

@@ -26,0 +26,0 @@ "private": false,

@@ -10,12 +10,23 @@ Label

Label element to wraps label-text and a form input
### Usage
Simple
```jsx
<Label>Example</Label>
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/
### Properties

@@ -22,0 +33,0 @@ Prop | Required | Default | Type | Description

@@ -1,2 +0,2 @@

// https://github.com/alphagov/govuk-frontend/tree/master/src/components/
// https://github.com/alphagov/govuk-frontend/tree/main/src/govuk/components/

@@ -35,14 +35,25 @@ import styled from 'styled-components';

*
* Label element to wraps label-text and a form input
*
* ### Usage
*
* Simple
*
* ```jsx
* <Label>Example</Label>
* 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/
*
*/
const Label = props => <StyledLabel {...props} />;
const Label = (props) => <StyledLabel {...props} />;

@@ -49,0 +60,0 @@ Label.propTypes = {

import React from 'react';
import { storiesOf } from '@storybook/react';
import { withDocsCustom } from '@govuk-react/storybook-components';
import Label from '.';
import ReadMe from '../README.md';
const stories = storiesOf('Form/Label', module);
stories.addDecorator(withDocsCustom(ReadMe));
export default {
title: 'Form/Label',
component: Label,
};
stories.add('Component default', () => <Label>Example</Label>);
export const Default = () => <Label>Example</Label>;

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