diff --git a/app/components/header/header-account-custom-html.njk b/app/components/header/header-account-custom-html.njk new file mode 100644 index 000000000..62ac659d6 --- /dev/null +++ b/app/components/header/header-account-custom-html.njk @@ -0,0 +1,44 @@ +{% set html_style = "background-color: #f0f4f5;" %} +{% set title = "Header with account (logged in, custom html)" %} +{% from "components/header/macro.njk" import header %} +{% extends "layout.njk" %} + +{% block body %} + + + {{ header({ + account: { + items: [ + { + href: "#", + text: "Check your profile" + }, + { + html: 'Notifications 8' + }, + { + href: "#", + text: "Sign out" + } + ] + }, + service: { + name: "Profile manager" + } + }) }} +{% endblock %} diff --git a/app/components/header/header-account-logged-in.njk b/app/components/header/header-account-logged-in.njk new file mode 100644 index 000000000..03316549d --- /dev/null +++ b/app/components/header/header-account-logged-in.njk @@ -0,0 +1,43 @@ +{% set html_style = "background-color: #f0f4f5;" %} +{% set title = "Header with account (logged in)" %} +{% from "components/header/macro.njk" import header %} +{% extends "layout.njk" %} + +{% block body %} + {{ header({ + account: { + items: [ + { + href: "#", + text: "florence.nightingale@nhs.net", + icon: true + }, + { + href: "#", + text: "Log out" + } + ] + }, + primaryLinks: [ + { + url: "#", + label: "Home" + }, + { + url: "#", + label: "Services" + }, + { + url: "#", + label: "Your health" + }, + { + url: "#", + label: "Messages" + }, { + url: "#", + label: "Help and support" + } + ] + }) }} +{% endblock %} diff --git a/app/components/header/header-account-logged-out.njk b/app/components/header/header-account-logged-out.njk new file mode 100644 index 000000000..a95356c81 --- /dev/null +++ b/app/components/header/header-account-logged-out.njk @@ -0,0 +1,17 @@ +{% set html_style = "background-color: #f0f4f5;" %} +{% set title = "Header with account (logged out)" %} +{% from "components/header/macro.njk" import header %} +{% extends "layout.njk" %} + +{% block body %} + {{ header({ + account: { + items: [ + { + href: "#", + text: "Log in" + } + ] + } + }) }} +{% endblock %} diff --git a/app/components/header/header-account-rbac.njk b/app/components/header/header-account-rbac.njk new file mode 100644 index 000000000..95dc74752 --- /dev/null +++ b/app/components/header/header-account-rbac.njk @@ -0,0 +1,50 @@ +{% set html_style = "background-color: #f0f4f5;" %} +{% set title = "Header with account (logged in, RBAC)" %} +{% from "components/header/macro.njk" import header %} +{% extends "layout.njk" %} + +{% block body %} + {{ header({ + account: { + items: [ + { + href: "#", + text: "Florence Nightingale", + icon: true + }, + { + text: "RA Manager, Hull and East Yorkshire Hospitals NHS Trust (RWA)" + }, + { + href: "#", + text: "Change role" + }, + { + href: "#", + text: "Log out" + } + ] + }, + search: { + placeholder: "User name, UUID or NI number", + visuallyHiddenLabel: "Search for a user" + }, + service: { + name: "CIS2 - Care Identity Management" + }, + primaryLinks: [ + { + url: "#", + label: "Home" + }, + { + url: "#", + label: "Create user" + }, + { + url: "#", + label: "Find user" + } + ] + }) }} +{% endblock %} diff --git a/app/components/header/header-org-white-account.njk b/app/components/header/header-org-white-account.njk new file mode 100644 index 000000000..90c820993 --- /dev/null +++ b/app/components/header/header-org-white-account.njk @@ -0,0 +1,55 @@ +{% set html_style = "background-color: #f0f4f5;" %} +{% set title = "Header organisational with account (logged in)" %} +{% from "components/header/macro.njk" import header %} +{% extends "layout.njk" %} + +{% block body %} + +{{ header({ + classes: "nhsuk-header--white nhsuk-header--white-nav", + account: { + items: [ + { + text: "Florence Nightingale", + icon: true + }, + { + href: "#", + text: "Log out" + } + ] + }, + organisation: { + name: "Anytown Anyplace", + split: "Anywhere", + descriptor: "NHS Foundation Trust" + }, + primaryLinks: [ + { + url: "#", + label: "Your hospital visit" + }, + { + url: "#", + label: "Wards and departments" + }, + { + url: "#", + label: "Conditions and treatments" + }, + { + url: "#", + label: "Our people" + }, + { + url: "#", + label: "Our research" + } + ], + search: { + visuallyHiddenLabel: "Search the Anytown Anyplace Anywhere website" + } + }) +}} + +{% endblock %} diff --git a/app/components/header/header-service-name-with-account-search-nav.njk b/app/components/header/header-service-name-with-account-search-nav.njk new file mode 100644 index 000000000..57f19ec8c --- /dev/null +++ b/app/components/header/header-service-name-with-account-search-nav.njk @@ -0,0 +1,51 @@ +{% set html_style = "background-color: #f0f4f5;" %} +{% set title = "Header with account, navigation and search" %} +{% from "components/header/macro.njk" import header %} +{% extends "layout.njk" %} + +{% block body %} + {{ header({ + account: { + items: [ + { + text: "Florence Nightingale", + icon: true + }, + { + href: "#", + text: "Log out" + } + ] + }, + service: { + name: "Digital service manual" + }, + search: true, + primaryLinks: [ + { + url: "#", + label: "NHS service standard" + }, + { + url: "#", + label: "Design system" + }, + { + url: "#", + label: "Design principles" + }, + { + url: "#", + label: "Content guide" + }, + { + url: "#", + label: "Accessibility" + }, + { + url: "#", + label: "Community and contribution" + } + ] + }) }} +{% endblock %} diff --git a/app/pages/examples.njk b/app/pages/examples.njk index 61f434c56..d0c535425 100644 --- a/app/pages/examples.njk +++ b/app/pages/examples.njk @@ -79,12 +79,18 @@
  • Header (default)
  • Header with navigation
  • Header with search
  • +
  • Header with account (logged in)
  • +
  • Header with account (logged out)
  • +
  • Header with account (logged in, custom HTML)
  • +
  • Header with account (logged in, RBAC)
  • Header with logo only
  • Header with a service name
  • Header with a service name, search and navigation
  • +
  • Header with a service name, account, search and navigation
  • Header transactional with service name
  • Header organisational
  • Header organisational with white header
  • +
  • Header organisational with white header and account (logged in)
  • Header organisational with white header and navigation
  • Hero
  • Hero with image
  • @@ -133,7 +139,7 @@
  • Warning callout
  • Warning callout with custom heading
  • - + {% endblock %} {% block footer %} diff --git a/packages/components/header/README.md b/packages/components/header/README.md index 86b633ded..033c122c7 100644 --- a/packages/components/header/README.md +++ b/packages/components/header/README.md @@ -25,9 +25,9 @@ compiled JavaScript for all components `nhsuk.min.js` or the individual componen -
    +