From 4f91d117a10c31ad66e024e52331be51b8136591 Mon Sep 17 00:00:00 2001 From: Andy Mantell <134642+andymantell@users.noreply.github.com> Date: Fri, 23 Jul 2021 13:34:06 +0100 Subject: [PATCH] Add "None of these" JavaScript behaviour to checkboxes See original at https://github.com/alphagov/govuk-frontend/pull/2151 --- .../checkboxes/none-of-the-above.njk | 98 +++++++++++ app/pages/examples.njk | 1 + packages/common.js | 9 +- packages/components/checkboxes/README.md | 161 ++++++++++++++++++ packages/components/checkboxes/checkboxes.js | 57 +++++++ packages/components/checkboxes/template.njk | 1 + 6 files changed, 325 insertions(+), 2 deletions(-) create mode 100644 app/components/checkboxes/none-of-the-above.njk diff --git a/app/components/checkboxes/none-of-the-above.njk b/app/components/checkboxes/none-of-the-above.njk new file mode 100644 index 000000000..c9ca22bc6 --- /dev/null +++ b/app/components/checkboxes/none-of-the-above.njk @@ -0,0 +1,98 @@ +{% set html_style = 'background-color: #f0f4f5;' %} +{% set title = 'Checkboxes with conditional content' %} +{% from 'components/checkboxes/macro.njk' import checkboxes %} +{% from 'components/input/macro.njk' import input %} +{% extends 'layout.njk' %} + +{% set emailHtml %} + {{ input({ + id: "email", + name: "email", + classes: "nhsuk-u-width-two-thirds", + label: { + text: "Email address" + } + }) }} +{% endset -%} + +{% set phoneHtml %} + {{ input({ + id: "phone", + name: "phone", + classes: "nhsuk-u-width-two-thirds", + label: { + text: "Phone number" + } + }) }} +{% endset -%} + +{% set mobileHtml %} + {{ input({ + id: "mobile", + name: "mobile", + classes: "nhsuk-u-width-two-thirds", + label: { + text: "Mobile phone number" + } + }) }} +{% endset -%} + +{% block body %} + +