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

govuk_frontend_toolkit

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

govuk_frontend_toolkit - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

govuk_frontend_toolkit/javascripts/govuk/selection-buttons.js

4

govuk_frontend_toolkit/Gruntfile.js

@@ -10,4 +10,4 @@ module.exports = function(grunt) {

options: {
specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js'
specs: 'spec/unit/*Spec.js',
helpers: 'spec/unit/*Helper.js'
}

@@ -14,0 +14,0 @@ }

@@ -51,2 +51,8 @@ # GOV.UK Frontend Toolkit

### Using the local test runner
The test suite can be run by opening the `./spec/support/LocalTestRunner.html` file in a browser for a more detailed trace of errors.
The files for unit tests and any supporting JavaScript should be added to `./spec/manifest.js` file.
## Usage

@@ -826,5 +832,23 @@

## Selection buttons
Script to support a specific design of radio buttons and checkboxes wrapped in `<label>` tags:
<label>
<input type="radio" name="size" value="medium" />
</label>
When the input is focused or its `checked` attribute is set, classes are added to their parent labels so their styling can show this.
To apply this behaviour to elements with the above HTML pattern, call the `GOVUK.selectionButtons` function with their inputs:
```
var $buttons = $("label input[type='radio'], label input[type='checkbox']");
GOVUK.selectionButtons($buttons);
```
Note that `GOVUK.selectionButtons` and the constructors it wraps, `GOVUK.RadioButtons` and `GOVUK.CheckboxButtons` use the `bind.js` polyfill.
## Licence
Released under the MIT Licence, a copy of which can be found in the file `LICENCE`.
{
"name": "govuk_frontend_toolkit",
"version": "1.4.0",
"version": "1.5.0",
"description": "npm for govuk_frontend_toolkit",

@@ -5,0 +5,0 @@ "main": "index.js",

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