Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIKE] Service Header component #4950

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
db4fac2
Bootstrap Service Header component
querkmachine Apr 22, 2024
150ed4e
Refactor styles
querkmachine Apr 23, 2024
a63ec9c
Disable Level AAA contrast check
querkmachine Apr 23, 2024
a8bffe2
Update full-page examples, update header/phase banner styles
querkmachine Apr 25, 2024
c9b24e9
Move header tag outside of header component
querkmachine Apr 25, 2024
fdebb56
Fix failing accessibility test
querkmachine Apr 26, 2024
e1112db
Add template tests
querkmachine Apr 26, 2024
949ea39
Add example readme file
querkmachine Apr 29, 2024
426bf36
Change how phase banner styles are applied
querkmachine Apr 29, 2024
0696d85
Add example of page with multiple navigation tiers
querkmachine Apr 29, 2024
09a6a18
Add slots to header and service header components
querkmachine Apr 30, 2024
eb6d39b
Add JavaScript functionality tests
querkmachine May 3, 2024
1a8d302
Deprecate various header parameters
querkmachine May 7, 2024
3188d47
Rework navigation so that list is hidden rather than nav
querkmachine May 7, 2024
13ad079
Fix all navigation links appearing selected in High Contrast Mode
querkmachine May 8, 2024
10c6240
Update for new component initialisation method
querkmachine May 20, 2024
abcadd2
WIP: Integate one login back into examples
patrickpatrickpatrick Jun 5, 2024
37bd556
Update review app examples
querkmachine Jun 7, 2024
c54917e
Fix incorrect header menu button selector
querkmachine Jun 13, 2024
2c67ecc
Move service name and navigation into section
domoscargin Jun 19, 2024
8e67b18
Update examples
domoscargin Jun 19, 2024
213f9cc
Partially revert phase banner changes
querkmachine Jun 21, 2024
2817f65
Revert "Update examples"
querkmachine Jun 21, 2024
736cab7
Make navigation item list into flexbox
querkmachine Jun 24, 2024
03cd648
Update slot tests to account for slots moving container
querkmachine Jun 24, 2024
8b08e6f
Update complex navigation example
querkmachine Jun 24, 2024
4629276
Fix service name and navigation colliding in some situations
querkmachine Jun 25, 2024
bb1a32c
Fix navigation extending off-screen in IE11
querkmachine Jun 25, 2024
91a9732
Add organisation switcher to complex nav example
querkmachine Jun 27, 2024
ca00b57
Revert "Move header tag outside of header component"
querkmachine Jul 2, 2024
eff46f1
Left-align service header navigation by default
querkmachine Jul 2, 2024
23bd8d9
Allow non-link nav items to have aria-current attributes
querkmachine Jul 2, 2024
f288d8f
Shorten service header aria-label
domoscargin Jul 3, 2024
fbc582d
Make section aria-label customisable
querkmachine Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
{% from "govuk/components/header/macro.njk" import govukHeader %}
{% from "govuk/components/service-header/macro.njk" import govukServiceHeader %}

{% extends "layouts/full-width-landmarks.njk" %}

{% block pageTitle %}{{ exampleName | unslugify }} - GOV.UK Frontend{% endblock %}

{% block head %}
{{ super() }}
<style>
.app-example { margin-bottom: 40px; }
</style>
{% endblock %}

{% block beforeContent %}
{{ govukBackLink({
href: "/"
}) }}
{% endblock %}

{% block content %}

<h1 class="govuk-width-container govuk-heading-l">Navigation examples</h1>

<h2 class="govuk-width-container govuk-heading-m">Header component examples</h2>

<h3 class="govuk-width-container govuk-heading-s">Header (default)</h3>
<div class="app-example">
{{ govukHeader() }}
</div>

<h3 class="govuk-width-container govuk-heading-s">Header with One Login links</h3>
<div class="app-example">
{{ govukHeader({ oneLogin: true }) }}
</div>

<h2 class="govuk-width-container govuk-heading-m">Service Header component examples</h2>

<h3 class="govuk-width-container govuk-heading-s">Header with Service Header</h3>
<div class="app-example">
{{ govukHeader() }}
{{ govukServiceHeader({
serviceName: "Service name"
}) }}
</div>

<h3 class="govuk-width-container govuk-heading-s">Service Header with navigation</h3>
<div class="app-example">
{{ govukHeader() }}
{{ govukServiceHeader({
navigationId: "service-header-with-navigation",
navigation: [
{ href: '#/1', text: "Navigation item 1" },
{ href: '#/2', text: "Navigation item 2", active: true },
{ href: '#/3', text: "Navigation item 3" },
{ href: '#/4', text: "Navigation item 4" }
]
}) }}
</div>

<h3 class="govuk-width-container govuk-heading-s">Service Header with service name and navigation</h3>
<div class="app-example">
{{ govukHeader() }}
{{ govukServiceHeader({
serviceName: "Service name",
serviceUrl: "#/",
navigationId: "service-header-with-name-and-navigation",
navigation: [
{ href: '#/1', text: "Navigation item 1" },
{ href: '#/2', text: "Navigation item 2", active: true },
{ href: '#/3', text: "Navigation item 3" },
{ href: '#/4', text: "Navigation item 4" }
]
}) }}
</div>


{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{% from "govuk/components/header/macro.njk" import govukHeader %}
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}
{% from "govuk/components/footer/macro.njk" import govukFooter %}
{% from "govuk/components/service-header/macro.njk" import govukServiceHeader %}

{% extends "govuk/template.njk" %}

Expand All @@ -13,6 +14,7 @@
{% set assetPath = '' %}
{% set themeColor = 'blue' %}
{% set bodyClasses = 'app-body-class' %}
{% set headerClasses = 'app-header-class' %}
{% set containerClasses = "app-width-container--wide" %}

{% block pageTitle %}GOV.UK - Le meilleur endroit pour trouver des services gouvernementaux et de l'information{% endblock %}
Expand Down Expand Up @@ -46,8 +48,18 @@
{% block header %}
<!-- block:header -->
{{ govukHeader({
containerClasses: "app-width-container--wide"
}) }}

{{ govukPhaseBanner({
tag: {
text: "Alpha"
},
html: 'C\'est un nouveau service - vos <a class="govuk-link" href="#">commentaires</a> nous aideront à l\'améliorer.'
}) }}

{{ govukServiceHeader({
serviceName: "Nom du service",
containerClasses: "app-width-container--wide",
navigation: [
{
href: '#1',
Expand Down Expand Up @@ -77,12 +89,6 @@

{% block beforeContent %}
<!-- block:beforeContent -->
{{ govukPhaseBanner({
tag: {
text: "Alpha"
},
html: 'C\'est un nouveau service - vos <a class="govuk-link" href="#">commentaires</a> nous aideront à l\'améliorer.'
}) }}
{{ govukBackLink({
href: "/"
}) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ notes: Based on https://www.gov.uk/government/news/strictly-vampires-and-sausage

{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}
{% from "govuk/components/service-header/macro.njk" import govukServiceHeader %}

{% set pageTitle = example.title %}
{% block pageTitle %}{{ pageTitle }} - GOV.UK{% endblock %}

{% block header %}
{{ govukHeader({
{{ govukHeader() }}
{{ govukServiceHeader({
navigation: [
{
href: "#1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ notes: The links to change your answers are not functional.
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/service-header/macro.njk" import govukServiceHeader %}

{% set pageTitle = example.title %}
{% block pageTitle %}{{ pageTitle }} - GOV.UK{% endblock %}

{% block header %}
{{ govukHeader({
{{ govukHeader() }}
{{ govukServiceHeader({
serviceName: "Temporary events notice"
}) }}
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ scenario: |
}) }}
{% endblock %}

{% block beforeContent %}
{% block header %}
{{ super() }}
{{ govukPhaseBanner({
tag: {
text: "Beta"
},
html: 'This is a new service – your <a class="govuk-link" href="#">feedback</a> will help us to improve it.'
}) }}
{% endblock %}

{% block beforeContent %}
{{ govukBreadcrumbs({
classes: "",
collapseOnMobile: true,
Expand Down
Loading