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

nhsuk-frontend

Package Overview
Dependencies
Maintainers
4
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nhsuk-frontend - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

dist/nhsuk-0.1.5.min.css

39

dist/nhsuk.js

@@ -281,1 +281,40 @@ /*!

}
// When using VoiceOver on iOS, focus remains on the skip link anchor when
// selected so the next focusable element is not at the jumped to area.
// This Javascript hack focuses on the first H1 header (if one exists, which it
// should) by adding tabindex = -1 to it and then removes it when focus is
// off it.
document.addEventListener('DOMContentLoaded', function() {
var skip = {
link: document.querySelector('.nhsuk-skip-link'),
header: document.getElementsByTagName('H1')[0],
doFocus: function(e) {
this.header.setAttribute('tabIndex', '-1');
this.header.focus();
},
doLeave: function(e) {
this.header.removeAttribute('tabIndex');
}
}
if (skip.link && skip.header) {
skip.link.addEventListener('click', function(e) {
e.preventDefault();
skip.doFocus(e);
});
skip.header.addEventListener('blur', function(e) {
skip.doLeave(e);
});
}
})

5

package.json
{
"name": "nhsuk-frontend",
"version": "0.1.4",
"version": "0.1.5",
"description": "The NHS website frontend styles, for creating NHS websites and services.",

@@ -51,5 +51,2 @@ "sasslintConfig": "config/sass-lint.yml",

],
"engines": {
"node": "8.11.1"
},
"repository": {

@@ -56,0 +53,0 @@ "type": "git",

20

packages/components/care-card/README.md

@@ -9,5 +9,5 @@ # Care cards

### Primary Care card
### Care card non-urgent (blue)
[Preview the primary care card component](https://nhsuk.github.io/nhsuk-frontend/components/care-card-primary.html)
[Preview the care card non-urgent (blue) component](https://nhsuk.github.io/nhsuk-frontend/components/care-card-non-urgent.html)

@@ -67,5 +67,5 @@ ### HTML markup

### Emergency Care card
### Care card urgent (red)
[Preview emergency care card component](https://nhsuk.github.io/nhsuk-frontend/components/care-card-emergency.html)
[Preview care card urgent (red) component](https://nhsuk.github.io/nhsuk-frontend/components/care-card-urgent.html)

@@ -75,3 +75,3 @@ ### HTML markup

```html
<div class="nhsuk-care-card nhsuk-care-card--emergency">
<div class="nhsuk-care-card nhsuk-care-card--urgent">
<div class="nhsuk-care-card__heading-container">

@@ -100,3 +100,3 @@ <h3 class="nhsuk-care-card__heading"><span class="nhsuk-u-visually-hidden">Urgent care low: </span>Ask for an urgent GP appointment if:</h3>

{{ careCard({
"type": "emergency",
"type": "urgent",
"heading": "Ask for an urgent GP appointment if:",

@@ -126,5 +126,5 @@ "HTML": "

### Urgent Care card
### Care card emergency (red and black)
[Preview urgent care card component](https://nhsuk.github.io/nhsuk-frontend/components/care-card-urgent.html)
[Preview care card emergency (red and black) component](https://nhsuk.github.io/nhsuk-frontend/components/care-card-urgent.html)

@@ -134,3 +134,3 @@ ### HTML markup

```html
<div class="nhsuk-care-card nhsuk-care-card--urgent">
<div class="nhsuk-care-card nhsuk-care-card--emergency">
<div class="nhsuk-care-card__heading-container">

@@ -158,3 +158,3 @@ <h3 class="nhsuk-care-card__heading"><span class="nhsuk-u-visually-hidden">Urgent care high: </span>Call 999 if you have sudden chest pain that:</h3>

{{ careCard({
"type": "urgent",
"type": "emergency",
"heading": "Call 999 if you have sudden chest pain that:",

@@ -161,0 +161,0 @@ "HTML": "

@@ -45,27 +45,27 @@ # Do and don't list

<svg class="nhsuk-icon nhsuk-icon__cross" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path class="st0" d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path>
<path class="st0" d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path>
<path d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path>
<path d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path>
</svg>
don't burst a blister yourself
do not burst a blister yourself
</li>
<li>
<svg class="nhsuk-icon nhsuk-icon__cross" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path class="st0" d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path>
<path class="st0" d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path>
<path d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path>
<path d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path>
</svg>
don't peel the skin off a burst blister
do not peel the skin off a burst blister
</li>
<li>
<svg class="nhsuk-icon nhsuk-icon__cross" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path class="st0" d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path>
<path class="st0" d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path>
<path d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path>
<path d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path>
</svg>
don't pick at the edges of the remaining skin
do not pick at the edges of the remaining skin
</li>
<li>
<svg class="nhsuk-icon nhsuk-icon__cross" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path class="st0" d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path>
<path class="st0" d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path>
<path d="M17 18.5c-.4 0-.8-.1-1.1-.4l-10-10c-.6-.6-.6-1.6 0-2.1.6-.6 1.5-.6 2.1 0l10 10c.6.6.6 1.5 0 2.1-.3.3-.6.4-1 .4z"></path>
<path d="M7 18.5c-.4 0-.8-.1-1.1-.4-.6-.6-.6-1.5 0-2.1l10-10c.6-.6 1.5-.6 2.1 0 .6.6.6 1.5 0 2.1l-10 10c-.3.3-.6.4-1 .4z"></path>
</svg>
don't wear the shoes or use the equipment that caused your blister until it heals
do not wear the shoes or use the equipment that caused your blister until it heals
</li>

@@ -72,0 +72,0 @@ </ul>

@@ -16,18 +16,18 @@ # List panel

```html
<div class="nhsuk-list-panel nhsuk-list-panel--mobile">
<h2 id="A" class="nhsuk-list-panel__label">A</h2>
<div class="nhsuk-list-panel">
<h2 class="nhsuk-list-panel__label" id="A" >A</h2>
<ul class="nhsuk-list-panel__list nhsuk-list-panel__list--with-label ">
<li class="nhsuk-list-panel__list-item">
<a href="/index" class="nhsuk-list-panel__list-item-link">AAA</a>
<a class="nhsuk-list-panel__list-item-link" href="/conditions/abdominal-aortic-aneurysm/">AAA</a>
</li>
<li class="nhsuk-list-panel__list-item">
<a href="/index" class="nhsuk-list-panel__list-item-link">Abdominal aortic aneurysm</a>
<a class="nhsuk-list-panel__list-item-link" href="/conditions/abdominal-aortic-aneurysm/">Abdominal aortic aneurysm</a>
</li>
<li class="nhsuk-list-panel__list-item">
<a href="/index" class="nhsuk-list-panel__list-item-link">Abscess</a>
<a class="nhsuk-list-panel__list-item-link" href="/conditions/abscess/">Abscess</a>
</li>
</ul>
<div class="nhsuk-back-to-top">
<a class="nhsuk-back-to-top__link" href="#nhsuk-a-z-nav">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<a class="nhsuk-back-to-top__link" href="#nhsuk-nav-a-z">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>

@@ -40,10 +40,10 @@ </svg>

<div class="nhsuk-list-panel nhsuk-list-panel--mobile">
<h2 id="B" class="nhsuk-list-panel__label">B</h2>
<div class="nhsuk-list-panel">
<h2 class="nhsuk-list-panel__label" id="B">B</h2>
<div class="nhsuk-list-panel__box nhsuk-list-panel__box--with-label ">
<p class="nhsuk-list-panel--results-items__no-results">There are currently no medicines listed</p>
<p class="nhsuk-list-panel--results-items__no-results">There are currently no conditions listed</p>
</div>
<div class="nhsuk-back-to-top">
<a class="nhsuk-back-to-top__link" href="#nhsuk-a-z-nav">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<a class="nhsuk-back-to-top__link" href="#nhsuk-nav-a-z">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>

@@ -57,15 +57,15 @@ </svg>

<div class="nhsuk-list-panel nhsuk-list-panel--mobile">
<h2 id="C" class="nhsuk-list-panel__label">C</h2>
<div class="nhsuk-list-panel">
<h2 class="nhsuk-list-panel__label" id="C">C</h2>
<ul class="nhsuk-list-panel__list nhsuk-list-panel__list--with-label ">
<li class="nhsuk-list-panel__list-item">
<a href="/index" class="nhsuk-list-panel__list-item-link">Chest pain</a>
<a class="nhsuk-list-panel__list-item-link" href="/conditions/chest-pain/">Chest pain</a>
</li>
<li class="nhsuk-list-panel__list-item">
<a href="/index" class="nhsuk-list-panel__list-item-link">Cold sore</a>
<a class="nhsuk-list-panel__list-item-link" href="/conditions/cold-sores/">Cold sore</a>
</li>
</ul>
<div class="nhsuk-back-to-top">
<a class="nhsuk-back-to-top__link" href="#nhsuk-a-z-nav">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<a class="nhsuk-back-to-top__link" href="#nhsuk-nav-a-z">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>

@@ -78,18 +78,18 @@ </svg>

<div class="nhsuk-list-panel nhsuk-list-panel--mobile">
<h2 id="D" class="nhsuk-list-panel__label">D</h2>
<div class="nhsuk-list-panel">
<h2 class="nhsuk-list-panel__label" id="D">D</h2>
<ul class="nhsuk-list-panel__list nhsuk-list-panel__list--with-label ">
<li class="nhsuk-list-panel__list-item">
<a href="/index" class="nhsuk-list-panel__list-item-link">Dandruff</a>
<a class="nhsuk-list-panel__list-item-link" href="/conditions/dandruff/">Dandruff</a>
</li>
<li class="nhsuk-list-panel__list-item">
<a href="/index" class="nhsuk-list-panel__list-item-link">Dementia</a>
<a class="nhsuk-list-panel__list-item-link" href="/conditions/dementia/">Dementia</a>
</li>
<li class="nhsuk-list-panel__list-item">
<a href="/index" class="nhsuk-list-panel__list-item-link">Dental pain</a>
<a class="nhsuk-list-panel__list-item-link" href="/conditions/toothache/">Dental pain</a>
</li>
</ul>
<div class="nhsuk-back-to-top">
<a class="nhsuk-back-to-top__link" href="#nhsuk-a-z-nav">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<a class="nhsuk-back-to-top__link" href="#nhsuk-nav-a-z">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>

@@ -113,13 +113,15 @@ </svg>

id: "A",
backToTop: "true",
backToTopLink: "#nhsuk-nav-a-z",
items: [
{
URL: "/index",
URL: "/conditions/abdominal-aortic-aneurysm/",
link: "AAA"
},
{
URL: "/index",
URL: "/conditions/abdominal-aortic-aneurysm/",
link: "Abdominal aortic aneurysm"
},
{
URL: "/index",
URL: "/conditions/abscess/",
link: "Abscess"

@@ -134,3 +136,5 @@ }

disable: "true",
message: "There are currently no medicines listed"
backToTop: "true",
backToTopLink: "#nhsuk-nav-a-z",
message: "There are currently no conditions listed"
}) }}

@@ -141,9 +145,11 @@

id: "C",
backToTop: "true",
backToTopLink: "#nhsuk-nav-a-z",
items: [
{
URL: "/index",
URL: "/conditions/chest-pain/",
link: "Chest pain"
},
{
URL: "/index",
URL: "/conditions/cold-sores/",
link: "Cold sore"

@@ -157,13 +163,15 @@ }

id: "D",
backToTop: "true",
backToTopLink: "#nhsuk-nav-a-z",
items: [
{
URL: "/index",
URL: "/conditions/dandruff/",
link: "Dandruff"
},
{
URL: "/index",
URL: "/conditions/dementia/",
link: "Dementia"
},
{
URL: "/index",
URL: "/conditions/toothache/",
link: "Dental pain"

@@ -174,1 +182,20 @@ }

```
#### Nunjucks arguments
The list panel Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **label** | string | No | The text label of the list panel. |
| **id** | string | No | The ID of the label heading. |
| **headingLevel** | integer | No | Optional heading level for the label heading. Default: 2 |
| **backToTop** | boolean | No | If set to true, a back to top link will be displayed. |
| **backToTopLink** | string | No | The href value of the back to top link. |
| **disable** | boolean | No | If set to true, this indicates there are no items in the list panel. |
| **message** | string | No | The text value to display if there are no items in the list panel (and disable has been set to true). |
| **items** | array | No | Array of list panel items. |
| **items[].URL** | string | No | The href value of an item in the list panel. |
| **items[].link** | string | No | The text value of an item in the list panel. |
| **classes** | string | No | Optional additional classes to add to the list panel. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the list panel. |

@@ -16,6 +16,6 @@ # Nav A-Z

```html
<nav id="nhsuk-nav-a-z" class="nhsuk-nav-a-z " role="navigation" aria-label="A-Z Navigation">
<ul class="nhsuk-nav-a-z__list">
<nav class="nhsuk-nav-a-z" id="nhsuk-nav-a-z" role="navigation" aria-label="A to Z Navigation">
<ol class="nhsuk-nav-a-z__list" role="list">
<li class="nhsuk-nav-a-z__item">
<a href="#A" class="nhsuk-nav-a-z__link">A</a>
<a class="nhsuk-nav-a-z__link" href="#A">A</a>
</li>

@@ -26,74 +26,74 @@ <li class="nhsuk-nav-a-z__item">

<li class="nhsuk-nav-a-z__item">
<a href="#C" class="nhsuk-nav-a-z__link">C</a>
<a class="nhsuk-nav-a-z__link" href="#C">C</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#D" class="nhsuk-nav-a-z__link">D</a>
<a class="nhsuk-nav-a-z__link" href="#D">D</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#E" class="nhsuk-nav-a-z__link">E</a>
<a class="nhsuk-nav-a-z__link" href="#E">E</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#F" class="nhsuk-nav-a-z__link">F</a>
<a class="nhsuk-nav-a-z__link" href="#F">F</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#G" class="nhsuk-nav-a-z__link">G</a>
<a class="nhsuk-nav-a-z__link" href="#G">G</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#H" class="nhsuk-nav-a-z__link">H</a>
<a class="nhsuk-nav-a-z__link" href="#H">H</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#I" class="nhsuk-nav-a-z__link">I</a>
<a class="nhsuk-nav-a-z__link" href="#I">I</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#J" class="nhsuk-nav-a-z__link">J</a>
<a class="nhsuk-nav-a-z__link" href="#J">J</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#K" class="nhsuk-nav-a-z__link">K</a>
<a class="nhsuk-nav-a-z__link" href="#K">K</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#L" class="nhsuk-nav-a-z__link">L</a>
<a class="nhsuk-nav-a-z__link" href="#L">L</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#M" class="nhsuk-nav-a-z__link">M</a>
<a class="nhsuk-nav-a-z__link" href="#M">M</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#N" class="nhsuk-nav-a-z__link">N</a>
<a class="nhsuk-nav-a-z__link" href="#N">N</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#O" class="nhsuk-nav-a-z__link">O</a>
<a class="nhsuk-nav-a-z__link" href="#O">O</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#P" class="nhsuk-nav-a-z__link">P</a>
<a class="nhsuk-nav-a-z__link" href="#P">P</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#Q" class="nhsuk-nav-a-z__link">Q</a>
<a class="nhsuk-nav-a-z__link" href="#Q">Q</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#R" class="nhsuk-nav-a-z__link">R</a>
<a class="nhsuk-nav-a-z__link" href="#R">R</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#S" class="nhsuk-nav-a-z__link">S</a>
<a class="nhsuk-nav-a-z__link" href="#S">S</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#T" class="nhsuk-nav-a-z__link">T</a>
<a class="nhsuk-nav-a-z__link" href="#T">T</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#U" class="nhsuk-nav-a-z__link">U</a>
<a class="nhsuk-nav-a-z__link" href="#U">U</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#V" class="nhsuk-nav-a-z__link">V</a>
<a class="nhsuk-nav-a-z__link" href="#V">V</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#W" class="nhsuk-nav-a-z__link">W</a>
<a class="nhsuk-nav-a-z__link" href="#W">W</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#X" class="nhsuk-nav-a-z__link">X</a>
<a class="nhsuk-nav-a-z__link" href="#X">X</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#Y" class="nhsuk-nav-a-z__link">Y</a>
<a class="nhsuk-nav-a-z__link" href="#Y">Y</a>
</li>
<li class="nhsuk-nav-a-z__item">
<a href="#Z" class="nhsuk-nav-a-z__link">Z</a>
<a class="nhsuk-nav-a-z__link" href="#Z">Z</a>
</li>
</ul>
</ol>
</nav>

@@ -115,2 +115,3 @@ ```

{
disable: "true",
label: "B"

@@ -193,1 +194,13 @@ },

```
#### Nunjucks arguments
The nav a-z Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| ----------------------|----------|-----------|--------------|
| **items** | array | Yes | Array of navigation items. |
| **items.[].label** | string | Yes | The label of the item in the navigation. |
| **items.[].disable** | boolean | No | If set to true, then the navigation item will not be within an anchor element. |
| **classes** | string | No | Optional additional classes to add to the nav a-z. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the nav a-z. |

@@ -17,3 +17,3 @@ # Pagination

<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
<a href="/section/treatments" class="nhsuk-pagination-prev">
<a class="nhsuk-pagination-prev" href="/section/treatments">
<span class="nhsuk-pagination-link">Previous</span>

@@ -25,6 +25,6 @@ <span class="nhsuk-pagination-title">Treatments</span>

</a>
<a href="/section/symptoms" class="nhsuk-pagination-next">
<a class="nhsuk-pagination-next" href="/section/symptoms">
<span class="nhsuk-pagination-link">Next</span>
<span class="nhsuk-pagination-title">Symptoms</span>
<svg class="nhsuk-icon nhsuk-icon__arrow-right" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>

@@ -51,4 +51,18 @@ </svg>

### Next navigation
#### Nunjucks arguments
The pagination Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **previousUrl** | string | Yes | The value of the previous link href attribute. |
| **previousPage** | string | Yes | The text of the previous link. |
| **nextUrl** | string | Yes | The value of the next link href attribute. |
| **nextPage** | string | Yes | The text of the next link. |
| **classes** | string | No | Optional additional classes to add to the pagination. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the pagination. |
### Next pagination
### HTML markup

@@ -58,6 +72,6 @@

<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
<a href="/section/symptoms" class="nhsuk-pagination-next">
<a class="nhsuk-pagination-next" href="/section/symptoms">
<span class="nhsuk-pagination-link">Next</span>
<span class="nhsuk-pagination-title">Symptoms</span>
<svg class="nhsuk-icon nhsuk-icon__arrow-right" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<svg class="nhsuk-icon nhsuk-icon__arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
<path d="M19.6 11.66l-2.73-3A.51.51 0 0 0 16 9v2H5a1 1 0 0 0 0 2h11v2a.5.5 0 0 0 .32.46.39.39 0 0 0 .18 0 .52.52 0 0 0 .37-.16l2.73-3a.5.5 0 0 0 0-.64z"></path>

@@ -82,4 +96,16 @@ </svg>

### Previous navigation
#### Nunjucks arguments
The next pagination Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **nextUrl** | string | Yes | The value of the next link href attribute. |
| **nextPage** | string | Yes | The text of the next link. |
| **classes** | string | No | Optional additional classes to add to the pagination. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the pagination. |
### Previous pagination
### HTML markup

@@ -89,3 +115,3 @@

<nav class="nhsuk-pagination" role="navigation" aria-label="Pagination">
<a href="/section/treatments" class="nhsuk-pagination-prev">
<a class="nhsuk-pagination-prev" href="/section/treatments">
<span class="nhsuk-pagination-link">Previous</span>

@@ -112,1 +138,12 @@ <span class="nhsuk-pagination-title">Treatments</span>

```
#### Nunjucks arguments
The previous pagination Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **previousUrl** | string | Yes | The value of the previous link href attribute. |
| **previousPage** | string | Yes | The text of the previous link. |
| **classes** | string | No | Optional additional classes to add to the pagination. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the pagination. |

@@ -36,2 +36,14 @@ # Panel

#### Nunjucks arguments
The panel Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **HTML** | string | Yes | HTML content to be used within the panel component. |
| **classes** | string | No | Optional additional classes to add to the panel. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the panel. |
### Panel with a label

@@ -62,3 +74,16 @@

```
#### Nunjucks arguments
The panel with a label Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **HTML** | string | Yes | HTML content to be used within the panel component. |
| **label** | string | No | The label of the panel component. |
| **headingLevel** | integer | No | Optional heading level for the label heading. Default: 3 |
| **classes** | string | No | Optional additional classes to add to the panel. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the panel. |
### Grey panel

@@ -92,2 +117,14 @@

#### Nunjucks arguments
The grey panel Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **HTML** | string | Yes | HTML content to be used within the panel component. |
| **colour** | string | No | The colour of the panel. Must be "grey". |
| **classes** | string | No | Optional additional classes to add to the panel. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the panel. |
### Panel group

@@ -136,1 +173,11 @@

```
#### Nunjucks arguments
The panel group Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **HTML** | string | Yes | HTML content to be used within the panel component. |
| **classes** | string | No | Optional additional classes to add to the panel. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the panel. |

@@ -40,2 +40,15 @@ # Promo

#### Nunjucks arguments
The promo Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **href** | string | Yes | The value of the promo href attribute |
| **heading** | string | Yes | The text heading of the promo |
| **description** | string | No | The text description of the promo |
| **classes** | string | No | Optional additional classes to add to the promo. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the promo. |
### Promo with image

@@ -73,3 +86,16 @@

```
#### Nunjucks arguments
The promo with image Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **href** | string | Yes | The value of the promo href attribute |
| **heading** | string | Yes | The text heading of the promo |
| **imgURL** | string | No | The URL of the image in the promo |
| **description** | string | No | The text description of the promo |
| **classes** | string | No | Optional additional classes to add to the promo. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the promo. |
### Promo with no description

@@ -104,2 +130,14 @@

#### Nunjucks arguments
The promo with no description Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **href** | string | Yes | The value of the promo href attribute |
| **heading** | string | Yes | The text heading of the promo |
| **classes** | string | No | Optional additional classes to add to the promo. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the promo. |
### Small promo

@@ -137,2 +175,15 @@

#### Nunjucks arguments
The small promo Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **href** | string | Yes | The value of the promo href attribute |
| **heading** | string | Yes | The text heading of the promo |
| **classes** | string | Yes | Additional classes to add to the promo. Separate each class with a space. Must have `nhsuk-promo--small` |
| **imgURL** | string | No | The URL of the image in the promo |
| **description** | string | No | The text description of the promo |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the promo. |
### Promo group

@@ -214,1 +265,14 @@

```
#### Nunjucks arguments
The promo group Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **href** | string | Yes | The value of the promo href attribute |
| **heading** | string | Yes | The text heading of the promo |
| **imgURL** | string | No | The URL of the image in the promo |
| **description** | string | No | The text description of the promo |
| **classes** | string | No | Optional additional classes to add to the promo. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the promo. |

@@ -37,1 +37,12 @@ # Review date

```
#### Nunjucks arguments
The review date Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **lastReview** | string | No | The value of the last review date |
| **nextReview** | string | No | The value of the next review date |
| **classes** | string | No | Optional additional classes to add to the review date. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the review date. |

@@ -9,5 +9,11 @@ # Skip link

For this component to work, you need to make sure you include the required JavaScript. You can either include the
compiled JavaScript for all components `nhsuk.min.js` or the individual component JavaScript `skip-link.js`.
There is an [in-page link bug in VoiceOver on iOS](https://bugs.webkit.org/show_bug.cgi?id=179011) whereby focus remains on the skip link anchor rather than
the next focusable element of the jumped to content.
This can be fixed by either including the compiled JavaScript for all components `nhsuk.min.js` or the individual component JavaScript `skip-link.js`.
The fix focuses on the first `H1` on the page if one exists. If one does not exist, then the default action for in-page links will take place.
Ensure the correct `id` value has been added to your main content for the skip link to work.
## Quick start examples

@@ -33,5 +39,16 @@

{{ skipLink({
"URL": "#maincontent",
"heading": "Skip to main content"
"href": "#maincontent",
"text": "Skip to main content"
}) }}
```
#### Nunjucks arguments
The skip link Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **href** | string | No | The value of the skip link href attribute. Default: "#maincontent". |
| **text** | string | No | The text of the skip link. Default: "Skip to main content". |
| **classes** | string | No | Optional additional classes to add to the skip link. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the skip link. |

@@ -25,3 +25,3 @@ // When using VoiceOver on iOS, focus remains on the skip link anchor when

if (skip.link) {
if (skip.link && skip.header) {

@@ -33,6 +33,2 @@ skip.link.addEventListener('click', function(e) {

}
if (skip.header) {
skip.header.addEventListener('blur', function(e) {

@@ -39,0 +35,0 @@ skip.doLeave(e);

@@ -176,1 +176,27 @@ # Table

```
#### Nunjucks arguments
The table Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| -----------------------|------------|-----------|--------------|
| **rows** | array | Yes | Array of table rows and cells. |
| **rows.[].text (or) rows.[].html** | string | Yes | Text or HTML for cells in table rows. If `html` is specified, the `text` argument will be ignored. |
| **rows.[].format** | string | No | Specify format of a cell. Currently we only use "numeric". |
| **rows.[].colspan** | number | No | Specify how many columns a cell extends. |
| **rows.[].rowspan** | number | No | Specify how many rows a cell extends. |
| **panel** | boolean | No | If set to true, the table is rendered inside a [panel with a label](https://nhsuk.github.io/nhsuk-frontend/components/panel-with-label.html). |
| **panelClasses** | string | No | Optional additional classes to add to the panel containing the table. Separate each class with a space. |
| **heading** | string | No | Heading/label of the panel if the panel argument is set to true. |
| **headingLevel** | integer | No | Optional heading level for the heading. Default: 3. |
| **tableClasses** | string | No | Optional additional classes to add to the table. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the table. |
| **caption** | string | No | Optional caption for the table. |
| **captionClasses** | string | No | Optional additional classes to add to the table caption. Separate each class with a space. |
| **head** | array | No | Optional array of table head cells. |
| **head.[].text or head.[].html** | array | No | Optional array of table head cells. If `html` is specified, the `text` argument will be ignored. |
| **head.[].colspan** | number | No | Specify how many columns a cell extends. |
| **head.[].rowspan** | number | No | Specify how many rows a cell extends. |
| **head.[].format** | string | No | Specify format of a cell. Currently we only use "numeric". |
| **firstCellIsHeader** | boolean | No | If set to true, first cell in table row will be a TH instead of a TD. |

@@ -34,1 +34,13 @@ # Warning callout

```
#### Nunjucks arguments
The warning callout Nunjucks macro takes the following arguments:
| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
| **heading** | string | Yes | Heading to be used within the warning callout component. |
| **HTML** | string | Yes | Content to be used within the warning callout component. |
| **headingLevel** | integer | No | Optional heading level for the heading. Default: 3 |
| **classes** | string | No | Optional additional classes to add to the warning callout. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the warning callout. |

@@ -22,3 +22,3 @@ # Core

<div class="nhsuk-width-container">
<main class="nhsuk-main-wrapper">
<main class="nhsuk-main-wrapper" id="maincontent">
<!-- Grid items -->

@@ -138,3 +138,3 @@ </main>

### Clearfix
### Clearfix

@@ -171,3 +171,3 @@ ```html

### Prevent text wrapping
### Prevent text wrapping

@@ -174,0 +174,0 @@ ```html

@@ -16,4 +16,4 @@ # NHS.UK Frontend

+ [Installing using npm](/docs/installation/installing-with-npm.md)
+ [Installing using yarn](/docs/installation/installing-with-yarn.md)
+ [Installing using PyPi](/docs/installation/installing-with-pypi.md)
+ Installing using yarn (available soon)
+ Installing using PyPi (available soon)

@@ -33,2 +33,8 @@ ### 2. Install by using compiled files

**Special thanks to the following for their contributions:**
- [Government Digital Service (GDS)](https://github.com/alphagov/)
- [Harry Roberts (csswizardry)](https://github.com/csswizardry)
- [Phil Sherry](https://github.com/philsherry)
## Get in touch

@@ -35,0 +41,0 @@

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

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

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

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

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

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

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

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

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

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

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