diff --git a/src/www/pages/components/index.njk b/src/www/pages/components/index.njk index c6263a20..2a9fe269 100755 --- a/src/www/pages/components/index.njk +++ b/src/www/pages/components/index.njk @@ -1,12 +1,13 @@ -{% extends "www/_layouts/layout-left-pane.njk" %} -{% set pageTitle = "Components" %} - -{% block content %} -

Components are reusable parts of the user interface that have been made to support a variety of - applications.

- -

Individual components can be used in multiple different patterns and contexts. For example, the - text input component can be used to ask for an email address, a National Insurance number or someone’s name.

-

If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the - coded examples provided will render exactly as they do inside the Design System.

+{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Components" %} +{% set ds = 'wmca' %} + +{% block content %} +

Components are reusable parts of the user interface that have been made to support a variety of + applications.

+ +

Individual components can be used in multiple different patterns and contexts. For example, the + text input component can be used to ask for an email address, a National Insurance number or someone’s name.

+

If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples provided will render exactly as they do inside the Design System.

{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/index.njk b/src/www/pages/mc/components/index.njk index c6263a20..d055b8ef 100755 --- a/src/www/pages/mc/components/index.njk +++ b/src/www/pages/mc/components/index.njk @@ -1,5 +1,6 @@ {% extends "www/_layouts/layout-left-pane.njk" %} {% set pageTitle = "Components" %} +{% set ds = 'mc' %} {% block content %}

Components are reusable parts of the user interface that have been made to support a variety of diff --git a/src/www/pages/mc/components/patterns/autocomplete/index.njk b/src/www/pages/mc/components/patterns/autocomplete/index.njk new file mode 100644 index 00000000..0f829eb8 --- /dev/null +++ b/src/www/pages/mc/components/patterns/autocomplete/index.njk @@ -0,0 +1,135 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Autocomplete" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/autocomplete/_autocomplete.njk" import wmcadsAutocomplete %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+

+ The autocomplete component is an input field that offers the user text suggestions as they type.
+ This is often done by hitting an API endpoint with the users query when the user has finished typing. +

+

+ The autocomplete pattern is a combination of the input and loader components. +

+{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ + +


+{# Default #} +

Default state

+

In its default state, the autcomplete component is made up of a text input with a search icon.

+

For best practice, ensure that the placeholder and aria-label describes what the autocompletes intended purpose is.

+

Notice that there is also a ds-loader component nested within the autocomplete, more on that in the next section.

+{{ + compExample([ + wmcadsAutocomplete({ + id: "autoComplete", + query: '' + }) + ]) | trim +}} + + +

+{# Loading #} +

Loading

+

+ When a user types in a query, you may want to have some code that hits an API or gets the data/suggestions for the autocomplete from somewhere. To help users understand that they need to wait for something we can change the autocomplete to a loading state. + We do this by adding the class ds--is-loading to the top level of the autocomplete (this is the only difference between the loading state and default state code snippets). +

+

As mentioned in the previous section, there is a ds-loader component nested in the autocomplete.
When adding the ds--is-loading class, it will hide the search icon and show the loading spinner in it's place.

+

Below is an example of how the autocomplete looks when a user has typed in 'My query' and is waiting for autocomplete suggestions to load.

+ +

It is good practice to:

+ +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteQuery", + query: 'My query', + loading: true + }) + ]) | trim +}} + + +

+{# Results #} +

Suggestions

+

The final state of the autocomplete is showing the suggestions.

+

You'll notice there is a new section in the code snippet called ds-autocomplete-suggestions, this should be shown/visible when your API/data has loaded the suggestions.

+

It's good practice to:

+ + +

Default (text)

+

The most commonly used suggestions will be displayed as text only.

+

+ It is good practice to: +

+ + +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteSuggestions", + showSuggestions: true, + textSuggestions: true, + query: 'My query' + }) + ]) | trim +}} + +{# With disruption indicator #} +

With disruption indicator

+

+ This autocomplete is combined with the medium / normal - disruption indicator component. +

+

You will notice that the suggestions are much bigger than text only results, and have an overflow scrollbar. This scrollbar will appear if the height of the suggestion container goes over a certain height.

+

+ As you can see from the code snippet, the main ds-autocomplete-suggestions and ds-autocomplete-suggestions__li classes are prevelant on the ul and li elements. Within the li element we have nested the disruption indicator component whilst also using the wmcads grid. This gives enough flexibility to style the suggestions to how we want, find out more in the next section. +

+{{ + compExample([ + wmcadsAutocomplete({ + showSuggestions: true, + query: 'x15' + }) + ]) | trim +}} + +

Customising suggestions

+

There are many ways in which you can show the suggestions, as the autocomplete component has been built in a way that the suggestion results can be custom styled to how you like.

+

+ As long as you have the ul element with the class ds-autocomplete-suggestions which contains a direct child li element that has the class ds-autocomplete-suggestions__li then you can fully customise how you want the suggestions to look. +

+ +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/patterns/banner/index.njk b/src/www/pages/mc/components/patterns/banner/index.njk new file mode 100644 index 00000000..f7eee3ec --- /dev/null +++ b/src/www/pages/mc/components/patterns/banner/index.njk @@ -0,0 +1,273 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Banner" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/banner/_banner.njk" import wmcadsBanner %} + +{% block content %} + +{% markdown %} + +## Normal + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentHTML: "This is a new service - your feedback will help us to improve it." + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Banner with phase indicator #} + +## With phase indicator + +{# What #} + +### What does it do? + +- Helps users to identify when a service is new +- Offers users the opportunity to give feedback about a new service + {# When to #} + +### When to use it? + +- When a service is new + +{# When not to #} + +### When not to use it? + +- On a service that has matured and has a steadily positive rate of satisfaction + +{# How #} + +### How it works + +- A service can be in Alpha (prototype stage) or Beta (when it is on a publicly-accessible website) +- The survey link must point to a Hotjar or service feedback survey, with the service name within the URL. For example, /?serviceName=descriptiveName. + A service can either be in Alpha (prototype stage) or Beta (when it is on a publicly accessible website). + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + phase: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Emergency banner #} + +## Emergency banner + +{# What #} + +

What does it do

+ +- It communicates emergency information and provides advice on what to do. +- When an emergency is no longer relevant, the content will be archived or removed. + +{# When to #} + +

When to use it?

+ +- When you need to communicate information that is urgent or critical, which will potentially affect a large group of our users. For example, if there is an emergency situation announced in Birmingham, the banner would advise all users on travel updates and guidance. +- The emergency banner should be placed directly below the main navigation. +- Only show one emergency banner notification at a time. + +{# When not to #} + +

When not to use it?

+ +- When a warning or emergency is directly related to a task the user is completing. In this case, use the appropriate Message component to notify users of any issues. +- If the issue is related to a service we are providing such as our customer service, you should place the Warning text and Inset text components next to the affected service, detailing the issue. +- Any disruptions to travel will be highlighted on the home page through the Disruption indicator components. + +{# How #} + +

How it works

+ +- The user can dismiss the Emergency banner through the 'Close' link. This will remove the current emergency banner from all pages they visit on the website. +- The On-page variant is only shown when a user is on the Emergency advice page, which can be accessed through the 'Read our latest advice' link. + +{# Sitewide #} + +### Sitewide + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} +{# On-page #} + +### On-page variant + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true, + onPage: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} +{% markdown %} + +{# Hub page banner #} + +## Hub page banner + +{# What #} + +

What does it do?

+ +- Helps users to identify they have eventered a Hub section of the website +- Provides users with a short description of the chosen hub of the WMCA + +{# When #} + +

When to use it?

+ +- Only on Hub Landing Pages + +

When not to use it?

+ +- On pages where the content is not related to a hub overview + +

How it works

+ +- The image container width will expand if users are viewing the page with a browser width higher than 1280px. +- The image within the container will zoom to fill the size of the image container. +- The image will be hidden on mobile devices. Our previous research found mobile users do not see the value of images on mobile pages. +- The image, optional logo or icon will change for each hub landing page. + +{% endmarkdown %} + +{% from "wmcads/patterns/hub-page-banner/_hub-page-banner.njk" import wmcadsHubPageBanner %} + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using a short description" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using an example brand logo with a longer text description", + logo: true + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{{ + compExample([ + wmcadsHubPageBanner({ + title: "Hub Header with a longer example title" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} + +{# Homepage banner #} + +## Homepage + +{# What #} + +

What does it do?

+ +- Provides a complementary image associated with the West Midlands +- Highlights a welcome message for visitors of the West Midlands Combined Authority site + +{# When #} + +

When to use it?

+ +- On the homepage + +

When not to use it?

+ +- Regular content pages + +{% endmarkdown %} + +{% from "wmcads/patterns/banner/homepage-banner/_homepage-banner.njk" import wmcadsHomepageBanner %} + +{{ + compExample([ + wmcadsHomepageBanner() + ], { + componentPath: "wmcads/patterns/banner/homepage-banner/", + njk: true, + njkProps: wmcadsHomepageBannerProps + }) +}} + +{% endblock %} diff --git a/src/www/pages/mc/components/patterns/board-members/index.njk b/src/www/pages/mc/components/patterns/board-members/index.njk new file mode 100644 index 00000000..2072efcb --- /dev/null +++ b/src/www/pages/mc/components/patterns/board-members/index.njk @@ -0,0 +1,22 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Board Members" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/board-members/_board-members.njk" import wmcadsBoardMembers %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# Board members #} +

Board Members

+ +{{ + compExample([ + wmcadsBoardMembers({ + + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/patterns/contact-details/index.njk b/src/www/pages/mc/components/patterns/contact-details/index.njk new file mode 100644 index 00000000..3299dd2b --- /dev/null +++ b/src/www/pages/mc/components/patterns/contact-details/index.njk @@ -0,0 +1,111 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Contact details" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/contact-details/_contact-details.njk" import wmcadsContactDetails %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

About

+ {# What #} +

What does it do?

+ + {# When #} +

When to use it?

+ + {# When not #} +

When not to use it?

+ + {# How it works #} +

How it works?

+ +

+ GOV.UK has detailed information about how to display contact details. +

+ + +

Contact Details - Address

+ + {{ + compExample([ + wmcadsInsetText( + { + thinner : true, + html: "Customer Services
Transport for West Midlands
16 Summer Lane
Birmingham
B19 3SD" + } + ) + ]) + }} + + +

Contact Details - Template

+ + {{ + compExample([ + wmcadsInsetText({html: + wmcadsContactDetails({ + warningText: "We are currently experiencing problems with our
telephone systems and cannot answer calls", + warningIcon: "general-warning-triangle", + content: " + customerservice@tfwm.org.uk
+ Telephone: 0345 303 6760
+ Monday to Tuesday and Thursday to Friday, 9am - 5pm,
+ Wednesday, 9.30am - 5pm" + }) | indent(6) | trim + }) + ]) + }} + + + +

Contact Details - Template TfWM

+ + {{ + compExample([ + wmcadsInsetText({ + html: " +

Transport for West Midlands

+

+ Twitter
+ Facebook
+

+

+ Submit an enquiry
+ Telephone: 0345 303 6760
+

+ Monday to Tuesday and Thursday to Friday, 9am - 5pm,
+ Wednesday, 9.30am - 5pm
+ Saturday and Sunday, closed + " + }) + ]) + }} + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/patterns/content-cards/index.njk b/src/www/pages/mc/components/patterns/content-cards/index.njk new file mode 100644 index 00000000..26a61062 --- /dev/null +++ b/src/www/pages/mc/components/patterns/content-cards/index.njk @@ -0,0 +1,236 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Content cards" %} +{% set section="Patterns" %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

About

+

These are common applications of the content card component.

+
+ +

+{# Map card #} +

Map card

+{# What #} +

What is it?

+ + +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +{# Map example #} +{% from "wmcads/patterns/content-cards/map/_map.njk" import wmcadsContentCardMap %} + +{{ + compExample([ + wmcadsContentCardMap() + ]) +}} + +

+{# Travel update card #} +

Travel update card

+{# What #} +

What is it?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +{# Set up travel updates #} +{% from "wmcads/patterns/content-cards/travel-updates/_travel-updates.njk" import wmcadsContentCardTravelUpdates %} + +{{ + compExample([ + wmcadsContentCardTravelUpdates() + ]) +}} + +

+{# Button card #} +

Button card

+{# What #} +

What is it?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +{# Set up buttons #} +{% from "wmcads/patterns/content-cards/buttons/_buttons.njk" import wmcadsContentCardButtons %} + +{{ + compExample([ + wmcadsContentCardButtons() + ]) +}} + +

+{# Image card #} +

Image card

+{# What #} +

What is it?

+ +{# When to #} +

When to use it?

+ +{# When to to #} +

When not to use it?

+ + +{# Set up image #} +{% from "wmcads/patterns/content-cards/image/_image.njk" import wmcadsContentCardImage %} + +{{ + compExample([ + wmcadsContentCardImage() + ]) +}} + +

+{# In-line navigation card #} +

In-line navigation card

+{# What #} +

What is it?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# How to #} +

How to use it

+ + +{# Set up inline navigation #} +{% from "wmcads/patterns/content-cards/inline-navigation/_inline-navigation.njk" import wmcadsContentCardInlineNavigation %} + +{{ + compExample([ + wmcadsContentCardInlineNavigation() + ]) +}} + +{# With current page #} +

In-line navigation with current page

+ +{{ + compExample([ + wmcadsContentCardInlineNavigation({ + withCurrentPage: true + }) + ]) +}} + +

+{# Email sign up card #} +

Email sign up card

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +

When adding a sign up form from Campaign Monitor, you are provided with HTML markup, but make sure not to change any of the generated attributes except for classes.

+

They have been changed in the following examples to avoid accessibility errors.

+
+ +{# Set up email sign up #} +{% from "wmcads/patterns/content-cards/email-sign-up/_email-sign-up.njk" import wmcadsContentCardEmailSignUp %} + +{# Collapsed #} +

Collapsed

+

This is the default state for the email sign up card.

+ +{{ + compExample([ + wmcadsContentCardEmailSignUp({ exampleSuffix: "example-1"}) + ]) +}} + +{# Expanded #} +

Expanded

+

The collapsed card will expand when the 'continue' button is pressed/tapped.

+ +{{ + compExample([ + wmcadsContentCardEmailSignUp({ expanded: true, exampleSuffix: "example-2" }) + ]) +}} + +{# External link #} +

External link

+

Use this content card when you want to send users to an external Campaign Monitor form if you want to capture more user data such as demographics, travel habits etc.

+ +{{ + compExample([ + wmcadsContentCardEmailSignUp({ externalLink: true, exampleSuffix: "example-3" }) + ]) +}} +{% endblock %} diff --git a/src/www/pages/mc/components/patterns/cookies/index.njk b/src/www/pages/mc/components/patterns/cookies/index.njk new file mode 100644 index 00000000..68ce0201 --- /dev/null +++ b/src/www/pages/mc/components/patterns/cookies/index.njk @@ -0,0 +1,87 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} {% set pageTitle = "Cookies" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/cookies/cookies-banner/_cookies-banner.njk" import wmcadsCookiesBanner %} +{% from "wmcads/patterns/cookies/cookies-manager/_cookies-manager.njk" import wmcadsCookiesManager %} + +{% block content %} + +

About

+{# What #} +

What does it do?

+ +
+

+

Cookie banner

+{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# How #} +

How it works

+ +

The Cookies banner should be placed above the main header and be on every page

+ +{{ + compExample([ + wmcadsCookiesBanner() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: false + }) | trim }} + +

+

Manage Cookies

+{# When to #} +

When to use it?

+ + +{{ + compExample([ + wmcadsCookiesManager() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: true + }) | trim }} + +{% endblock %} diff --git a/src/www/pages/mc/components/patterns/feedback-loop/index.njk b/src/www/pages/mc/components/patterns/feedback-loop/index.njk new file mode 100644 index 00000000..7766f45c --- /dev/null +++ b/src/www/pages/mc/components/patterns/feedback-loop/index.njk @@ -0,0 +1,47 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Feedback loop" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/feedback-loop/_feedback-loop.njk" import wmcadsFeedbackLoop %} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +
+

+ +{{ + compExample([ + wmcadsFeedbackLoop({ + id: 'fb' + }) + ]) +}} + +

+

Open

+{{ + compExample([ + wmcadsFeedbackLoop({ + isOpen: true, + id: 'fb-open' + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/patterns/footer/index.njk b/src/www/pages/mc/components/patterns/footer/index.njk new file mode 100644 index 00000000..136237b8 --- /dev/null +++ b/src/www/pages/mc/components/patterns/footer/index.njk @@ -0,0 +1,156 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Footer" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ + +

+{# Full footer #} +

Full variant of footer

+

The full variant of the footer may include menus which become collapsible on smaller devices.

+

To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

+{{ + compExample([ + wmcadsFooter({ + columns: 3, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +

+

2 Column Variant

+ +{{ + compExample([ + wmcadsFooter({ + columns: 2, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + })], + { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
+ + +{# Mobile app variant #} + +

When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the Transport for West Midlands footer.

+ +

The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

+ +

To use the mobile app variant:

+ + +

+ You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

+ +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/patterns/header-and-footer/index.njk b/src/www/pages/mc/components/patterns/header-and-footer/index.njk new file mode 100644 index 00000000..8e42881b --- /dev/null +++ b/src/www/pages/mc/components/patterns/header-and-footer/index.njk @@ -0,0 +1,212 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header and footer" %} +{% set section="Patterns" %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +
+

+ + + +{# Header #} +

Header

+{# Skip Link #} +

Skip link

+

There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

+

Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

+{# Logo #} +

Logo

+

This must always be the West Midlands Combined Authority logo.

+{# Phase indicator #} +

Phase indicator

+

This component must be used if the service is not live, using the phase indicator guidance.

+{# Navigation #} +

Navigation

+

The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

+

The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

+

We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

+{# Mobile apps #} +

Mobile apps

+

When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

+{# Search #} +

Search

+

This functionality only shows for desktop and tablet users. When clicked, search expands and takes over the whole page.

+ +{{ + compExample([ + wmcadsHeader ({ + id: "mega-menu", + navItems: navItems, + banner: true, + linkTopLevel: true, + search: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + } + }) + ]) +}} + +{# With title variant #} +

With a title variant of header

+

When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

+ +

To use the title variant:

+ + + +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + withTitle: true, + id: "basic" + }) + ]) +}} + + +{# Mobile app variant #} +

Mobile app variant of header

+

When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority header.

+ +

To use the mobile app variant:

+ + +

+ You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'footer pattern', + link: '#mobile-app-footer' + }) + }} . +

+ +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + app: true, + exampleAria: "Mobile app header" + }) + ]) +}} + +

+ + +{# Full footer #} +

Full variant of footer

+

The full variant of the footer may include menus which become collapsible on smaller devices.

+

To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

+{{ + compExample([ + wmcadsFooter({ + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About West Midlands Combined Authority" + }, { + name: "WMCA Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
+ + +{# Mobile app variant #} + +

When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority footer.

+ +

The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

+ +

To use the mobile app variant:

+ + +

+ You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

+ +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/patterns/header-demo/index.njk b/src/www/pages/mc/components/patterns/header-demo/index.njk new file mode 100644 index 00000000..c32de977 --- /dev/null +++ b/src/www/pages/mc/components/patterns/header-demo/index.njk @@ -0,0 +1,220 @@ + + + + {% include "www/_partials/_head.njk" %} + + + + + + {# header #} + {% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} + {{ + wmcadsHeader({ + id: "mega-menu-example", + search: true, + searchSuggestions: ["See live departures", "Find a timetable", "Check for disruptions", "Manage my Swift card", "Find ticket prices", "Get a refund", "Update Direct Debit", "Apply for a 16-18 photocard"], + navItems: [{ + name: "Plan a journey", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Swift and tickets", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "Get help", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + }], + megaMenu: true + }) + }} + {# header #} + + + {# main #} +
+ Close window +
+ {# main #} + + + {% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} + {{ + wmcadsFooter({ + bottomMenu: [{ + name: "Privacy & Cookies Policy", + link: "https://www.wmca.org.uk/privacy-cookies-policy/" + }] + }) + }} + + + + {% include "www/_partials/_scripts.njk" %} + + + + diff --git a/src/www/pages/mc/components/patterns/header/index.njk b/src/www/pages/mc/components/patterns/header/index.njk new file mode 100644 index 00000000..423c907b --- /dev/null +++ b/src/www/pages/mc/components/patterns/header/index.njk @@ -0,0 +1,305 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/header-v2/_header-v2.njk" import wmcadsHeaderV2 %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/warning-text/_warning-text.njk" import wmcadsWarningText %} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ + + +{# Header #} +

Header

+{# Skip Link #} +

Skip link

+

There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

+

Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

+{# Logo #} +

Logo

+

This must always be the Transport for West Midlands logo.

+{# Phase indicator #} +

Phase indicator

+

This component must be used if the service is not live, using the phase indicator guidance.

+{# Navigation #} +

Navigation

+

The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

+

The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

+

We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

+{# Mobile apps #} +

Mobile apps

+

When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

+{# Search #} +

Search

+

This function expands the mega menu and reveals the search bar along with the ‘I want to…’ feature.

+

The ‘I want to...’ feature shows a list of the top page links which users access through search. This is to help users find the information they are searching for faster. These links are regularly updated using search data to maintain their relevance.

+

On mobile, the mega menu search function uses a primary purple background instead of the standard white background. Our user testing found users preferred the white link text on the primary purple background as it is clearer to read.

+ +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example-full", + navItems: [{ + name: "Styles" + },{ + name: "Components" + },{ + name: "Patterns" + },{ + name: "User research" + }], + banner: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + }, + exampleAria: "Full header", + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With mega menu #} +

Mega menu with search example

+ +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example", + search: true, + placeholder: "fg", + brand: "wmca", + navItems: [{ + name: "The Mayor", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Who we are", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "What we do", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + },{ + name: "In my area" + },{ + name: "Contact us" + }], + megaMenu: true, + megaMenuDemo: true + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With title variant #} +

With a title variant of header

+

When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

+ +

To use the title variant:

+ + + +{{ + compExample([ + wmcadsHeaderV2({ + withTitle: true, + legacyMenu: true, + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +

+ +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/patterns/index.njk b/src/www/pages/mc/components/patterns/index.njk new file mode 100644 index 00000000..55ff4044 --- /dev/null +++ b/src/www/pages/mc/components/patterns/index.njk @@ -0,0 +1,16 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Patterns" %} +{% set section = "Patterns" %} +{% set ds = 'mc' %} + +{% block content %} +

Patterns are reusable parts of the user interface that have been made to support a variety of + applications.

+ +

Individual patterns can be used in multiple different patterns and contexts. For example, the + text input component + can be used to ask for an email address, a National Insurance number or someone’s name.

+

If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples provided + will render exactly as they do inside the Design System.

+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/patterns/question-form/index.njk b/src/www/pages/mc/components/patterns/question-form/index.njk new file mode 100644 index 00000000..495871f1 --- /dev/null +++ b/src/www/pages/mc/components/patterns/question-form/index.njk @@ -0,0 +1,127 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Question form" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ +

How it works?

+ + + +

+ {# Form Element #} +

Form Element

+

This pattern can be populated with any form element, such as text, radio buttons, checkboxes, dropdown or file upload.

+ {% from "wmcads/patterns/question/form-element/_form-element.njk" import wmcadsFormElement %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsFormElement({ + text: "Question title", + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Form Element #} + + +

+ {# Reference #} +

Reference

+

This pattern shows a question that shows defined steps and uses the backlink and progress indicator component.

+ {% from "wmcads/patterns/question/reference/_reference.njk" import wmcadsReference %} + {% from "wmcads/components/form-elements/input/_input.njk" import wmcadsInput %} + {{ + compExample([ + wmcadsReference({ + question: "What is your Direct Debit Reference?", + text: "

This can be found in the email we sent you asking you to reinstate your Direct Debit and begins with a 6.

If you didn’t receive this email, it is shown next to every payment to WMCA for your Direct Debit on your bank statement.

", + actualSection: "1", + totalSections: "3", + sectionName: "About your ticket", + fields: + wmcadsInput({ + label: "Direct Debit Reference", + classNames: "ds-col-1-2" + }) , + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Reference #} + + +

+ {# Summary #} +

Summary

+

This shows the user all of the data they have entered before they submit the form. This stage allows the user to change any details before submitting the form.

+ {% from "wmcads/patterns/question/summary/_summary.njk" import wmcadsSummary %} + {% from "wmcads/components/table/_table.njk" import wmcadsTable %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsSummary({ + question: "Check your answers before reinstating your Direct Debit", + html: +"

Now send your request

+

By submitting this request you are confirming that, to the best of your knowledge, the details you are providing are correct.
+
You consent to West Midlands Combined Authority possibly changing your Direct Debit date if it usually would occur in the next 10 days.
+
You also consent to West Midlands Combined Authority reinstating your Direct Debit instruction.

", + button: + wmcadsButton({ + classNames: "ds-btn--start", + text: "Accept & Send ", + iconRight: "general-chevron-right" + }) + }) + + ]) + }} + {# End Summary #} + + +

+ {# Confirmation Message #} +

Confirmation Message

+

This is a confirmation message to show that the user has successfully submitted the data in the form, along with a reference or any information which the user needs to be made aware of.

+ {% from "wmcads/patterns/question/confirmation-message/_confirmation-message.njk" import wmcadsConfirmationMessage %} + {{ + compExample([ + wmcadsConfirmationMessage() | indent(4) | trim + ]) + }} + {# End Confirmation Message #} + +{% endblock %} diff --git a/src/www/pages/mc/components/patterns/search/index.njk b/src/www/pages/mc/components/patterns/search/index.njk new file mode 100644 index 00000000..01d64df5 --- /dev/null +++ b/src/www/pages/mc/components/patterns/search/index.njk @@ -0,0 +1,147 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Search" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

What does it do?

+ +

When to use it?

+ +

How it works

+ + +

+ {# Search bar #} +

Search bar

+ {% from "wmcads/patterns/search/search-bar/_search-bar.njk" import wmcadsSearchbar %} + {{ + compExample([ + wmcadsSearchbar() + ]) + }} + {# End Search bar #} + + +

+ {# Sort #} +

Sort

+

What does it do?

+ + {% from "wmcads/patterns/search/sort/_sort.njk" import wmcadsSearchSort %} + {{ + compExample([ + wmcadsSearchSort() + ]) + }} + {# End sort #} + +

+ {# Search filter #} +

Filter

+

What does it do?

+ +

When to use it?

+ + {% from "wmcads/patterns/search/search-filter/_search-filter.njk" import wmcadsSearchFilter %} + {{ + compExample([ + wmcadsSearchFilter( + { + accordion: [{ + summaryTitle: "Topic", + options: [ + "Tickets", "Travel advice", "Planning a journey" + ] + }, + { + summaryTitle: "Page type", + options: [ + "Services", "News", "Bus routes", "Timetables", "Offers and promotions" + ] + } + ]} + ) + ], { + componentPath: "wmcads/patterns/search/search-filter/", + njk: false, + js: true, + iframe: false + }) + }} + + {# End search filter #} +

+ {# Search result #} +

Search result

+

What does it do?

+ +

How it works

+ + {% from "wmcads/patterns/search/search-result/_search-result.njk" import wmcadsSearchResult %} + {{ + compExample([ + wmcadsSearchResult( + { + pageTitle: "Swift: The smarter way to travel", + breadcrumbs: ['Home', 'Swift'], + excerpt: "Swift is the easy and flexible way to travel around the West Midlands. find the swift card for you. How do you travel? bus…" + } + ) + ]) + }} + {# End search result #} +

+ {# Pagination #} +

Pagination links

+

What does it do?

+ + {% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} + {{ + compExample([ + wmcadsPagination({ + pageCount: 8, + activePage: 1 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 5 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 8 + }) + ]) + }} + {# End pagination #} +

+ +{% endblock %} diff --git a/src/www/pages/mc/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js b/src/www/pages/mc/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js new file mode 100644 index 00000000..8371607f --- /dev/null +++ b/src/www/pages/mc/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js @@ -0,0 +1,71 @@ +function aToZContentStyleGuide() { + // FUNCTIONS + // Change accordion state + const changeAccordionState = (accordionElem, changeStateToOpen = true) => { + const accordionBtn = accordionElem.querySelector('.ds-accordion__summary-wrapper'); + if (changeStateToOpen) { + accordionElem.classList.add('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', true); + } else { + accordionElem.classList.remove('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', false); + } + }; + + // Change all accordion states at once + const changeAllAccordionStates = changeStateToOpen => { + const accordions = document.querySelectorAll('main .ds-accordion'); + accordions.forEach(accordion => changeAccordionState(accordion, changeStateToOpen)); + }; + + // Scroll to an anchor within an accordion + const scrollToAnchor = idWithHash => { + // Check if element is on the page + const elem = document.querySelector(idWithHash); + if (!elem || elem.classList.contains('ds-accordion__summary-wrapper')) { + return; + } + // Open accordion and scroll to element + changeAccordionState(elem.parentElement.parentElement); + elem.scrollIntoView(); + }; + + // Check for anchor to scroll to onload + const scrollToAnchorOnLoad = () => { + if (document.location.hash) { + scrollToAnchor(document.location.hash); + } + }; + + // Add event listener to all section links on the page + const setupScrollToAnchor = () => { + const anchors = document.querySelectorAll('main a[href^="#"]:not([href="#"])'); + // Loop through an add event listener + anchors.forEach(anchor => { + anchor.addEventListener('click', e => { + e.preventDefault(); + scrollToAnchor(anchor.hash); + }); + }); + }; + + // Set up controls + const setupAccordionControls = () => { + const controls = document.querySelectorAll('main .js-accordion-controls button'); + + controls.forEach(control => { + control.addEventListener('click', () => { + changeAllAccordionStates(control.classList.contains('js-accordion-controls-open')); + }); + }); + }; + + // CALL FUNCTIONS + if (document.querySelector('#atozofstyle')) { + scrollToAnchorOnLoad(); + setupScrollToAnchor(); + setupAccordionControls(); + } +} + +export default aToZContentStyleGuide; diff --git a/src/www/pages/mc/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json b/src/www/pages/mc/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json new file mode 100644 index 00000000..143a4f85 --- /dev/null +++ b/src/www/pages/mc/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json @@ -0,0 +1,538 @@ +{ + "aToZOfStyles": [ + { + "letter": "A", + "styles": [ + { + "title": "Abbreviations and acronyms", + "content": "

The first time you use an abbreviation or acronym explain it in full on each page unless it's well known, like UK or BBC. Then refer to it by initials.

Do not use full stops in abbreviations: BBC, not B.B.C.

If you only use a term once, you don't need to include the abbreviation afterwards.

Use 'm' (for millions) and 'bn' (for billions) for sums of money and measurable quantities: £10bn; 1bn litres of water. However, spell out for people and countable nouns: 3 billion commuters; 10 billion tickets.

Use lower case for standard measurements: kg; km; lb; mph but use upper case for KB; GB; MB.

Exception: Spell out metres to prevent confusion with abbreviation for million.

Note:

  1. Do not include a space between the number and the unit: 20km; 50kph; 100KB
  2. Never add an 's' to measurements: 20km, not 20kms

Use lower case for ie and eg, but avoid using these terms altogether where possible. Use 'that is' or 'for example' instead.

" + }, + { + "title": "Active voice", + "content": "

Use the active voice, not the passive voice - it’s easier to read. For example:

We’re going to get the train tomorrow (active voice)

A train is going to be caught by us tomorrow (passive voice)

" + }, + { + "title": "Addresses", + "content": "

Use the contact details design pattern. This shows you how to format addresses.

" + }, + { + "title": "Addressing the user", + "content": "

Address the user as 'you' wherever possible.

" + }, + { + "title": "Adult rate", + "content": "

Do not hyphenate.

" + }, + { + "title": "Ages", + "content": "

Do not use hyphens in ages unless to avoid confusion, although it's always best to write in a way that avoids ambiguity. For example, 'a class of 15 16-year-old students took the A level course' can be written as '15 students aged 16 took the A level course'.

Write ages like this: XX years old (for example, 66 years old).

Exception - use hyphens when talking about age groups:

" + }, + { + "title": "American and UK English", + "content": "

Use UK English spelling and grammar. For example, use 'organise' not 'organize', 'modelling' not 'modeling', and 'fill in a form', not 'fill out a form'.

American proper nouns, like 4th Mechanized Brigade or World Health Organization, take American English spelling.

" + }, + { + "title": "Ampersand", + "content": "

Use and rather than &, unless it's a department's logo image or a company's name as it appears on the Companies House register.

" + }, + { + "title": "Antisocial", + "content": "

Hyphenated.

" + }, + { + "title": "A-road", + "content": "

Hyphenated.

" + } + ] + }, + { + "letter": "B", + "styles": [ + { + "title": "Bacs (Bankers Automated Clearing System)", + "content": "

Use the acronym as it's more widely known than the full name. No need to include the full name in brackets.

" + }, + { + "title": "bold", + "content": "

Only use bold for instructions when you’re talking about an interactive service.

You can use bold to explain what field a user needs to fill in on a form, or what button they need to select. For example: \"Select Continue.\"

Use bold sparingly - using too much will make it difficult for users to know which parts of your content they need to pay the most attention to.

Do not use bold in other situations, for example to emphasise text.

To emphasise words or phrases, you can:

" + }, + { + "title": "bus station", + "content": "

Only use upper case if you're talking about a specific bus station: Dudley Bus Station, Coventry Pool Bus Station.

Use lower case if you're talking about bus stations in general: You can find bike racks at our bus stations.

" + }, + { + "title": "borough council", + "content": "

Lower case except in a name: Dudley Metropolitan Borough Council.

" + }, + { + "title": "Bullet points and numbered steps", + "content": "

You can use bullet points to make text easier to read. Make sure that:

Bullets should normally form a complete sentence following from the lead text. But it's sometimes necessary to add a short phrase to clarify whether all or some of the points apply. For example, 'You can only register a pension scheme that is (one of the following):'

The number and type of examples in a list may lead the user to believe the list is exhaustive. This can be dealt with by

Numbered steps

Use numbered steps instead of bullet points to guide a user through a process. List the things the user needs to do in order. You do not need a lead-in line. Steps end in a full stop because each should be a complete sentence.

" + } + ] + }, + { + "letter": "C", + "styles": [ + { + "title": "campaign/scheme names and brands", + "content": "

If you have a scheme or campaign brand, explain the brand. Don't expect users to understand what you mean. If you say ‘be aware and share’ or ‘get your roll and stroll on’ out of context, it’s not clear what that means.

Don’t capitalise slogans like ‘be aware and share’. If you’re talking about a specific brand or campaign, use capitals. For example, Workwise, PassProtect. Don’t tell people to ‘Be Aware and Share’, but do say ‘the Be Aware and Share’ campaign.

For example:

" + }, + { + "title": "cash fare", + "content": "Do not use - it's confusing. Say 'ticket bought on the bus, train or tram on the day' instead." + }, + { + "title": "Capitalisation", + "content": "

DO NOT USE BLOCK CAPITALS FOR LARGE AMOUNTS OF TEXT AS IT'S QUITE HARD TO READ.

Always use lower case, even in page titles. The exceptions to this are proper nouns.

" + }, + { + "title": "checkbox", + "content": "

Not \"check box\"

" + }, + { + "title": "child rate", + "content": "

Do not hyphenate.

" + }, + { + "title": "click", + "content": "

Don't use \"click\" when talking about user interfaces because not all users click. Use \"select\".

You can use \"right-click\" if the user needs to right-click to open up a list of options to progress through the user journey.

" + }, + { + "title": "collective nouns", + "content": "

Treat as singular, except staff and police: the committee has but the staff are; the police want.

A pair and a couple are both plural.

" + }, + { + "title": "concessionary", + "content": "

Try to avoid. Use these instead:

It’s okay to use concessionary if you’re talking about the English National Concessionary Travel Scheme.

" + }, + { + "title": "contact details", + "content": "

Use the contact details design pattern.

" + }, + { + "title": "contactless", + "content": "

Not Contactless.

" + }, + { + "title": "contractions", + "content": "

You can use contractions to help make your text less formal.

Avoid negative contractions like can't and don't. Many users find them harder to read, or misread them as the opposite of what they say. Use cannot instead of can't; do not instead of don’t.

Avoid should've, could've, would've, they've too. These can also be hard to read.

" + }, + { + "title": "co-operation", + "content": "

Hyphenated.

" + }, + { + "title": "coronavirus (COVID-19)", + "content": "

Coronavirus is the virus which causes the illness COVID-19. Coronavirus is lower case.

" + }, + { + "title": "council", + "content": "

Use lower case when writing about local councils in general. Use capitals for the official name of a local council, for example: Birmingham City Council.

" + }, + { + "title": "Council Tax", + "content": "

Upper case.

" + }, + { + "title": "customers", + "content": "

Refer to 'customers' rather than 'passengers'.

" + } + ] + }, + { + "letter": "D", + "styles": [ + { + "title": "Dates", + "content": "

Use 'to' instead of a dash or slash in date ranges. 'To' is quicker to read than a dash, and it's easier for screen readers.

Always explain what your date range represents, for example 'tax year 2013 to 2014' or 'September 2013 to July 2014'. Date ranges can be the academic year, calendar year or tax year. This is why date ranges must be very, very clear.

" + }, + { + "title": "daytime", + "content": "

But night-time.

" + }, + { + "title": "Direct Debit", + "content": "

Upper case.

" + }, + { + "title": "Direct Debit Instruction", + "content": "

Upper case.

" + }, + { + "title": "disabled access", + "content": "

Use this term when referring to disabled accessibility, as 'accessibility' has a wider meaning.

" + }, + { + "title": "disabled people", + "content": "

Not 'the disabled' or 'people with disabilities'.

Read GOV.UK advice on words to use and avoid when talking about disability.

" + }, + { + "title": "district council", + "content": "

Lower case even in a name, like Warwick district council.

" + } + ] + }, + { + "letter": "E", + "styles": [ + { + "title": "eg, etc and ie", + "content": "

eg can sometimes be read aloud as 'egg' by screen reading software. Instead use 'for example' or 'such as' or 'like' or 'including' - whichever works best in the specific context.

etc can usually be avoided. Try using 'for example' or 'such as' or 'like' or 'including'. Never use etc at the end of a list starting with these words.

ie - used to clarify a sentence - is not always well understood. Try (re)writing sentences to avoid the need to use it. If that is not possible, use an alternative such as 'meaning' or 'that is'.

" + }, + { + "title": "email", + "content": "

Not e-mail.

Always give the full email address when providing a hyperlink. For example, 'email ticketing@twfm.org.uk' not 'email the ticketing team'

" + } + ] + }, + { + "letter": "F", + "styles": [ + { + "title": "FAQs (frequently asked questions)", + "content": "

Do not use FAQs.

If you write content by starting with user needs, you will not need to use FAQs.

FAQs are discouraged because they:

" + }, + { + "title": "fine", + "content": "

Use 'fine' instead of 'financial penalty'.

For example, \"You'll pay a £50 fine.\"" + }, + { + "title": "first person", + "content": "

Use \"we'\" and \"us\" when addressing the user where possible. For example, instead of \"West Midlands Combined Authority has…\" say \"We have\" - it’s more personal.

" + }, + { + "title": "fire and rescue service", + "content": "

Lower case.

" + }, + { + "title": "focus", + "content": "

Focuses/focused/focusing. Not focusses/focussed/focussing.

" + } + ] + }, + { + "letter": "G", + "styles": [ + { + "title": "government", + "content": "

Lower case unless it's a full title. For example: 'UK government', but 'Her Majesty's Government of the United Kingdom of Great Britain and Northern Ireland'.

" + } + ] + }, + { + "letter": "H", + "styles": [ + { + "title": "Hyphenation", + "content": "

Hyphenate:

Do not hyphenate:

Do not use a hyphen unless it's confusing without it, for example, a little used-car is different from a little-used car. You can also refer to The Guardian style guide for advice on hyphenation.

Use 'to' for time and date ranges, not hyphens.

" + } + ] + }, + { + "letter": "I", + "styles": [ + { + "title": "ie", + "content": "

see eg, etc and ie

" + }, + { + "title": "Italics", + "content": "

Do not use italics. They can be hard to read online.

" + } + ] + }, + { + "letter": "J", + "styles": [ + { + "title": "job titles", + "content": "

Use upper case when referring to a specific role: Lord Mayor of Birmingham.

Use lower case if writing generally: service assistants, station managers.

" + }, + { + "title": "Journey Planner", + "content": "

Our travel tool that helps with live route-planning across our network

A stand-alone link to it should be action-led and first-person: 'Plan my journey'.

If giving instruction, it can be second-person (to avoid mixing perspectives): 'Plan your journey'.

If listing tools, we can use the product name: 'Journey Planner'.

" + } + ] + }, + { + "letter": "L", + "styles": [ + { + "title": "Links", + "content": "

Front-load your link text with the relevant terms and make them active and specific. Do not use ‘click here’. Use text that describes the link instead.

" + }, + { + "title": "Lists", + "content": "

Lists should be bulleted to make them easier to read. See bullets and steps.

Very long lists can be written as a paragraph with a lead-in sentence if it looks better: 'The following countries are in the EU: Spain, France, Italy...'

" + }, + { + "title": "log in", + "content": "

See sign in or log in.

" + } + ] + }, + { + "letter": "M", + "styles": [ + { + "title": "measurements", + "content": "

Use lower case for standard measurements: kg; km; mph; kph but use upper case for KB; GB; MB.

Spell out metres to prevent confusion with abbreviation for million.

Do not include a space between the number and the unit: 20km; 50mph; 100KB.

Never add an 's' to measurements: 20km, not 20kms.

" + }, + { + "title": "Metro", + "content": "

Only use when talking about the company that runs the tram - West Midlands Metro. To talk about the tram as a mode of transport, use tram, not Metro.

" + }, + { + "title": "money", + "content": "

Use the £ symbol: £75.

Do not use decimals unless pence are included: £75.50 but not £75.00.

Do not use '£0.xx million' for amounts less than £1 million.

Write out pence in full: calls will cost 4 pence per minute from a landline.

Currencies are lower case.

" + } + ] + }, + { + "letter": "N", + "styles": [ + { + "title": "nBus", + "content": "

Use when talking about network bus tickets - always use a lower case ‘n’, upper case ‘B’.

" + }, + { + "title": "nNetwork", + "content": "

Use when talking about network tickets for the bus, train and tram - always use a lower case ‘n’, followed by an upper case ‘N’.

" + }, + { + "title": "nTrain", + "content": "

Use when talking about network train tickets - always use a lower case ‘n’, upper case ‘T’.

" + }, + { + "title": "Numbers", + "content": "

Use 'one' unless you're talking about a step, a point in a list or another situation where using the numeral makes more sense: 'in point 1 of the design instructions', for example. Or this:

You'll be shown 14 clips that feature everyday road scenes.

There will be:

  1. developing hazard in 13 clips
  2. developing hazards in the other clip

Write all other numbers in numerals (including 2 to 9) except where it's part of a common expression like 'one or two of them' where numerals would look strange.

If a number starts a sentence, write it out in full (Thirty-four, for example) except where it starts a title or subheading.

For numerals over 999 - insert a comma for clarity: 9,000

Spell out common fractions like two-thirds.

Use a % sign for percentages: 50%.

Use a 0 where there's no digit before the decimal point.

Use '500 to 900' and not '500-900' (except in tables and for the 16-18 photocard).

Use MB for anything over 1MB: 4MB not 4096KB.

Use KB for anything under 1MB: 569KB not 0.55MB.

Keep it as accurate as possible and up to 2 decimal places: 4.03MB.

Addresses: use 'to' in address ranges: 49 to 53 Cherry Street.

Ordinal numbers

Spell out first to ninth. After that use 10th, 11th and so on.

In tables, use numerals throughout.

" + }, + { + "title": "NXWM", + "content": "

see operator names.

" + } + ] + }, + { + "letter": "O", + "styles": [ + { + "title": "off-peak", + "content": "

Use lower case and include a hyphen.

" + }, + { + "title": "older people", + "content": "

Refer to older people rather than elderly people.

" + }, + { + "title": "online", + "content": "

One word. Do not use 'on-line' or 'on line'.

" + }, + { + "title": "operator names", + "content": "

Do not abbreviate the name. For example, do not use ‘WM Metro’, ‘NX West Midlands’ or ‘West Mids Railway’.

You can use an acronym for timetables and passenger information. For example, ‘West Midlands Metro (WMM)’, ‘National Express West Midlands (NXWM)’ or ‘West Midlands Railway (WMR)’.

Do not use the NXWM acronym without explaining it first. It is not a well known acronym.

" + }, + { + "title": "or", + "content": "

Do not use slashes instead of \"or\". For example, do not say \"Do this 3/4 times\".

" + }, + { + "title": "opt in/out", + "content": "

Verb: I would like to opt in

" + }, + { + "title": "opt-in/out", + "content": "

Adjective: an opt-in clause

" + } + ] + }, + { + "letter": "P", + "styles": [ + { + "title": "paper ticket", + "content": "

A ticket that’s printed on paper, not on a Swift card.

" + }, + { + "title": "passengers", + "content": "

Refer to 'customers' rather than 'passengers'.

" + }, + { + "title": "pay as you go", + "content": "

Do not hyphenate and always use lower case.

" + }, + { + "title": "pay as you go credit", + "content": "

Use to describe Swift cards with a stored cash value

Note: Do not use 'pay as you go travel value (cash)' or 'pay as you go cash value'.

" + }, + { + "title": "PDF", + "content": "Upper case. No need to explain the acronym." + }, + { + "title": "plain English", + "content": "

Lower case plain and upper case English unless in a title: the Plain English Campaign.

All content should be written in plain English. You should also make sure you use language your audience will understand. Use the Plain English Campaign’s A to Z of alternative words to avoid complex language.

" + }, + { + "title": "phone numbers", + "content": "

Phone numbers should be split into at least three groups of digits for readability, ideally with no more than four digits in any single group. For example: 020 7378 1705; 0343 222 6666; 0762 480 4299. See also the design pattern for contact details.

" + } + ] + }, + { + "letter": "Q", + "styles": [ + { + "title": "quotation marks", + "content": "

Use single quotation marks in all cases.

Use double quotation marks if using a quote within a quote.

If a quote runs on longer than one paragraph, include quotation marks at the beginning of each subsequent paragraph but only at the end of the final paragraph.

Place full stops and commas inside quotes when they are complete sentences, otherwise place them outside: 'I want to buy a ticket,' said Mr Smith; When he said 'I promise', he didn't really mean it.

" + } + ] + }, + { + "letter": "R", + "styles": [ + { + "title": "real time/realtime", + "content": "

Where possible, use 'live' instead of 'realtime' or 'real time'

real time (noun): this information is being updated in real time.
realtime (adjective): realtime service information.
Not real-time.

" + }, + { + "title": "re-open", + "content": "

Not reopen.

" + } + ] + }, + { + "letter": "S", + "styles": [ + { + "title": "seasons", + "content": "

Use lower case for spring, summer, autumn and winter.

" + }, + { + "title": "Sentence length", + "content": "

Do not use long sentences. Check sentences with more than 25 words to see if you can split them to make them clearer.

" + }, + { + "title": "sign in or log in", + "content": "

Use sign in rather than log in (verb) for calls-to-action where users enter their details to access a service.

Do not use login as a noun - say what the user actually needs to enter (like username, password, National Insurance number).

" + }, + { + "title": "State Pension", + "content": "

Upper case.

" + }, + { + "title": "Station", + "content": "

Lower case. For example, Birmingham New Street station. Do not say tram station, say tram stop.

" + }, + { + "title": "Stop", + "content": "

Lower case. For example, Summer Lane bus stop.

" + }, + { + "title": "Swift card", + "content": "

Do not capitalise 'Card'.

" + }, + { + "title": "step-free", + "content": "

A route between street and platform that doesn't require the use of stairs or escalators.

" + } + ] + }, + { + "letter": "T", + "styles": [ + { + "title": "terms and conditions", + "content": "

Not Terms and Conditions or terms & conditions.

" + }, + { + "title": "text message alerts", + "content": "

Not SMS alerts.

" + }, + { + "title": "TfWM", + "content": "

See entry on Transport for West Midlands.

" + }, + { + "title": "Times", + "content": "

use 'to' in time ranges, not hyphens, en rules or em dashes: 10am to 11am (not 10-11am)
5:30pm (not 1730hrs)
midnight (not 00:00)
midday (not 12 noon, noon or 12pm)
6 hours 30 minutes
Midnight is the first minute of the day, not the last. You should consider using \"11:59pm\" to avoid confusion about a single, specific time.

For example, \"You must register by 11:59pm on Tuesday 14 June.\" can only be read one way, but \"You must register by midnight on Tuesday 14 June\" can be read in two ways (the end of Monday 13, or end of Tuesday 14).

Timetables and printed passenger information use the 24-hour clock in HHMM format.

" + }, + { + "title": "tram", + "content": "

Not Metro.

" + }, + { + "title": "tram stop", + "content": "

Not station.

" + }, + { + "title": "Transport for West Midlands", + "content": "

Avoid referring to Transport for West Midlands (TfWM). Users don't need to know about it while getting travel advice.

Explaining the relationship between West Midlands Combined Authority, TfWM and West Midlands Combined Authority (WMCA) is complicated. Use \"we\" instead. For example, \"we manage the Key Route Network (KRN)\" with a link to the TfWM policy page.

" + } + ] + }, + { + "letter": "U", + "styles": [ + { + "title": "under-16s", + "content": "

Requires a hyphen in all cases. This is true whenever referring to age groups: under-16s; under-18s; over-60s.

Avoid the common error of adding an apostrophe when making a word or abbreviation plural as this makes it possessive: under-16s not under-16's.

" + }, + { + "title": "URL", + "content": "

Upper case. No need to explain the acronym.

" + }, + { + "title": "username", + "content": "

Not \"user name\".

" + } + ] + }, + { + "letter": "W", + "styles": [ + { + "title": "web", + "content": "

Lower case.

" + }, + { + "title": "webpage", + "content": "

One word.

" + }, + { + "title": "website", + "content": "

Not web-site or web site.

" + }, + { + "title": "West Midlands Combined Authority", + "content": "

Avoid referring to West Midlands Combined Authority (WMCA). Users don't need to know about it while getting travel advice.

The exception is if you referring to a statutory responsibility or a contract. For example, concessionary passes or terms and conditions.

" + }, + { + "title": "wifi", + "content": "

Lower case, no hyphen.

" + }, + { + "title": "WMCA", + "content": "

See entry on West Midlands Combined Authority.

" + }, + { + "title": "wmca.org.uk", + "content": "

If you are linking to another page, you should use an in-text link rather than the full URL. See the entry on links for more information.

Sometimes it is better to show the full URL. For example, when telling users to click a link to verify something in an email.

It is important to use the right URL. Only use wmca.org.uk.

Do not prefix the URL with ‘www.’ as this makes our URL hard to read. The domain extension ‘.co.uk’ makes it obvious to users that it is a URL.

" + }, + { + "title": "www.", + "content": "

See entry on wmca.org.uk.

" + } + ] + }, + { + "letter": "Z", + "styles": [ + { + "title": "zero-hours contract", + "content": "

Not \"zero-hour contract\" or \"zero hours contract\"

" + } + ] + } + ] +} diff --git a/src/www/pages/mc/components/styles/a-to-z-content-style-guide/index.njk b/src/www/pages/mc/components/styles/a-to-z-content-style-guide/index.njk new file mode 100644 index 00000000..d1434b5c --- /dev/null +++ b/src/www/pages/mc/components/styles/a-to-z-content-style-guide/index.njk @@ -0,0 +1,131 @@ +{% extends "www/_layouts/layout-fullwidth.njk" %} +{% set pageTitle="A to Z content style guide" %} {% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +
+
+

Writing content for West Midlands Combined Authority

+

+ You should create all content with user-focused content design principles. This means content has an identified + user need and is written in plain English. +

+

+ Do not use marketing speak - users will be visiting your website to perform a task (for example, buy a train ticket or find out about Swift cards). Your content shouldn’t try to sell them anything - instead, tell them the information they need to know in the simplest way possible. +

+

+ Research has shown that both high literacy and low literacy users prefer plain English because it takes less time to read. Users won’t be on your website for fun - so make the experience quick and easy. +

+

+ To find out more about why plain language is important, read: +

+

+

+ Read the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/content-design/what-is-content-design', + linkTitle: 'GOV.UK introduction to content design', + contentText: 'GOV.UK introduction to content design' + }) + }} + to find out more about content design principles. +

+

Design Team can help you to test your content with user research.

+
+

About the A-Z of style guide

+

This style guide will help you to use consistent words across West Midlands Combined Authority services.

+

+ If something is not covered by this style guide, check the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style', + linkTitle: 'GOV.UK Style Guide', + contentText: 'GOV.UK style guide' + }) + }} + . You can also email Samresha Purewal if you think something is missing from this guidance.

+
+

Introducing West Midlands Combined Authority

+

If you’re talking about day-to-day services (bus, train or tram), you + may need to make it clear that West Midlands Combined Authority does not run these.

For example, you could say: "We don’t run the buses, trains or trams. We can point you in the right direction if you need help." +

+
+
+ {# A to Z accordions #} +
+
+

A to Z of style

+
+
+ + +
+
+
+ {% for section in aToZOfStyles %} +
+ +
+ {% for style in section.styles %} +
+ {{style.title}} +
+ {{style.content | safe}} + {% endfor %} +
+
+ {% endfor %} +
+
+
+
+{% endblock %} diff --git a/src/www/pages/mc/components/styles/colour-palettes/_color-palettes.js b/src/www/pages/mc/components/styles/colour-palettes/_color-palettes.js new file mode 100644 index 00000000..f7e01e7d --- /dev/null +++ b/src/www/pages/mc/components/styles/colour-palettes/_color-palettes.js @@ -0,0 +1,22 @@ +function colorPalettes() { + const colors = document.querySelectorAll('.ds-website-color-swatch__inner'); + + // Function to convert rgb to hex + function rgb2hex(rgb) { + const newRGB = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); + function hex(x) { + return `0${parseInt(x, 10).toString(16)}`.slice(-2); + } + return `#${hex(newRGB[1])}${hex(newRGB[2])}${hex(newRGB[3])}`; + } + + colors.forEach(swatch => { + const ele = swatch; + const rgbColor = getComputedStyle(swatch).backgroundColor; + const hexColor = rgb2hex(rgbColor); + + ele.nextElementSibling.querySelector('pre code .color-hex').innerText = `color: '${hexColor}'`; + }); +} + +export default colorPalettes; diff --git a/src/www/pages/mc/components/styles/colour-palettes/_colorPalette.scss b/src/www/pages/mc/components/styles/colour-palettes/_colorPalette.scss new file mode 100644 index 00000000..1b04dd76 --- /dev/null +++ b/src/www/pages/mc/components/styles/colour-palettes/_colorPalette.scss @@ -0,0 +1,18 @@ +$cp-swatch-height: 50px; + +.ds-website-color-swatch { + padding: $size-sm; + + &__inner { + display: inline-block; + width: 100%; + height: $cp-swatch-height; + margin-bottom: $size-sm; + } +} + +@each $color, $hex in $palettes { + .ds-website-bg-color-#{$color} { + background-color: $hex; + } +} diff --git a/src/www/pages/mc/components/styles/colour-palettes/index.njk b/src/www/pages/mc/components/styles/colour-palettes/index.njk new file mode 100644 index 00000000..bce499ac --- /dev/null +++ b/src/www/pages/mc/components/styles/colour-palettes/index.njk @@ -0,0 +1,78 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Colour Palettes" %} +{% set section="Styles" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/_color-palette-macro.njk" import colorPalette %} + +{% block content %} +{# About #} +

About

+

Below are the list of West Midlands Combined Authority colour palettes.

+

+ We have tested our colours against the three most prevalent colour blind anomalies: protanopia, deuteranopia and tritanopia. While in some circumstances, particularly protanopia, colours can appear to be relatively similar. +

+

+ These issues can be circumvented by not referring to specific colours. For instance, when referring to a green button with the word 'start' in, the phrase 'click the green button to start' would not be helpful. Instead, use 'click the start button', without a colour reference. +

+

+ W3C AA Accessibility criteria requires the contrast of test to be enhanced, with a contrast ratio upwards of 3:1. +

+

+ All brand/web colours meet this criteria, though the modal colour 'WM Railway' must only be used for iconography and graphical devices. +

+

The background only colours can only be used as a background colour and they are not intended for any other use.

+
+ +{# Using in development #} +

Using in development

+

wmcads SCSS

+

If you are using WMCA Design System's SCSS in development, you shouldn't use the HEX values! Instead you should always use the scss variables instead, for example use get-color(primary) instead of #3c1053. This ensures you are always using the most up-to-date colour. To find out more on how to use the get-color() function in SCSS, please refer to the notes for @function get-color() in _mixins.scss.

+ +

Without wmcads SCSS

+

If you are not using WMCA Design System's SCSS then it is recommended to use the hex values below. It is highly adviseable to set these up as variables in your development enviornment, this ensures that you can easily change them to keep up-to-date with our colour palettes.

+

If you'd like to see how we have set the variables up, you can check out $palettes in _vars.scss and @function get-color() in _mixins.scss.

+ +{# Brand colours #} +
+

Brand colours

+
+ {% for color in colors.brand %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
+ +{# Web colours #} +
+

Web colours

+
+ {% for color in colors.web %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
+ +{# Background Only colours #} +
+

Background only colours

+
+ {% for color in colors.backgroundOnly %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
+ +{% endblock %} diff --git a/src/www/pages/mc/components/styles/examples/grid-column-spacing.njk b/src/www/pages/mc/components/styles/examples/grid-column-spacing.njk new file mode 100644 index 00000000..9edbe46e --- /dev/null +++ b/src/www/pages/mc/components/styles/examples/grid-column-spacing.njk @@ -0,0 +1,210 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid column spacing" %} +{% set section = "Styles" %} + +{% block content %} +

Introduction to wmcads Grid column spacing

+

+ Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

+

+ The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

+

+ Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

+

+ Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

+

+ Where {breakpoint} is one of breakpoint sizes described in the grid section. +

+ +

When to use Grid column spacing

+ + +

Examples

+ +

Example 1

+

This example shows the use of the ds-content-card component displayed in a grid of thirds with spacing of 1rem.

+ +
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+
+ content image +
+

Contact us

+

Get in touch if you want to know more about the budget.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+
+ content image +
+

Contact us

+

Get in touch if you want to know more about the budget.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

Example 2

+

This example shows the use of the ds-content-card component displayed in a half grid with spacing of 2rem.

+ +
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

Example 3

+

This example shows the use of the ds-content-card component displayed in a half grid with spacing controlled by breakpoints.

+ +
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +

The default spacing is 0.75rem (ds-grid--spacing-2-sm). Once the page width goes over 768px the spacing changes to 1rem (ds-grid--spacing-md-2-md).

+ + + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/styles/examples/grid-examples.njk b/src/www/pages/mc/components/styles/examples/grid-examples.njk new file mode 100644 index 00000000..52ec7236 --- /dev/null +++ b/src/www/pages/mc/components/styles/examples/grid-examples.njk @@ -0,0 +1,335 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid Examples" %} +{% set section = "Styles" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

Introduction to wmcads Grids

+

Grid classes vs. unit classes

+

wmcads Grids consist of two types of classes: the grid class (ds-grid) and unit classes (ds-col-*)

+

The widths of the units are fractions

+

Units have various class names that represent their widths. For example, ds-u-1-2 has a width of 50%, whereas ds-u-1-5 would have a width of 20%.

+

All child elements of a grid must be units

+

Child elements contained within an element with a ds-grid classname must be a grid unit with a ds-col-* classname.

+

Content goes inside grid units

+

All content which is visible to people needs to be contained inside a grid unit. This ensures that the content will be rendered properly.

+ +

Examples

+

Let's start with a simple example. Here's a grid with three columns:

+ +
+

Thirds

+

Thirds

+

Thirds

+
+ +
+  
+  {%- filter forceescape %}
+  
+

Thirds

+

Thirds

+

Thirds

+
+ {%- endfilter %} +
+
+ +

The above example will keep the columns the same width no matter the page width.

+ +

Adding responsive classes

+

We can control the width by adding responsive classes.

+ +

When using Responsive Grids, you can control how the grid behaves at specific breakpoints by adding class names. wmcads default responsive grids comes with the following class names and media query breakpoints.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Media Queries
KeyCSS Media QueryAppliesClassname
NoneNoneAlways.ds-col-*
sm@media screen and (min-width: 35.5em)≥ 568px.ds-col-sm-*
md@media screen and (min-width: 48em)≥ 768px.ds-col-md-*
lg@media screen and (min-width: 64em)≥ 1024px.ds-col-lg-*
xl@media screen and (min-width: 80em)≥ 1280px.ds-col-xl-*
+ +

Let's modify the example so the columns become full width on mobile:

+ +
+

Thirds

+

Thirds

+

Thirds

+
+ +
+  
+  {%- filter forceescape %}
+  
+

Thirds

+

Thirds

+

Thirds

+
+ {%- endfilter %} +
+
+ +

The above example has a default width of 1 (ds-col-1) so when the page is viewed below 586px the columns will display full width. When the page is viewed over 586px the columns will appear in 3 coloumns (ds-col-sm-1-3). + + +

Justify Content

+ +

You can justify the grid content bby adding these classes:

+ +

ds-grid--justify-between

+

Items will have space between them

+ +
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

ds-grid--justify-around

+

Items will have space before, between, and after them

+
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

ds-grid--justify-end

+

Items are positioned at the end of the container

+
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

ds-grid--justify-center

+

Items are positioned in the center of the container

+
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

ds-grid--justify-even

+

Items will have equal space around them

+
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/styles/icons/_icons.scss b/src/www/pages/mc/components/styles/icons/_icons.scss new file mode 100644 index 00000000..d03435ca --- /dev/null +++ b/src/www/pages/mc/components/styles/icons/_icons.scss @@ -0,0 +1,12 @@ +.website-icons { + svg { + width: 60px; + height: 60px; + padding: $size-sm; + fill: get-color(primary); + } + + .text-center { + text-align: center; + } +} diff --git a/src/www/pages/mc/components/styles/icons/index.njk b/src/www/pages/mc/components/styles/icons/index.njk new file mode 100644 index 00000000..76c42c7f --- /dev/null +++ b/src/www/pages/mc/components/styles/icons/index.njk @@ -0,0 +1,188 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Icons" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# The icon vars are an array that match the folders they come from in src/assets/icon/{foldername} #} +{% set iconGeneral = [ + "arrow", + "caret-down", + "caret-up", + "checkmark", + "chevron-right", + "circle-hollow", + "circle-solid", + "cross", + "expand", + "favourite", + "file", + "filter", + "id-card", + "info", + "location-arrow", + "minimise", + "paperclip", + "pdf", + "html", + "search", + "success", + "swap", + "trash", + "warning-circle", + "warning-triangle" +] %} + +{% set iconSocial = [ + "facebook", + "facebook-hex", + "twitter", + "twitter-hex", + "instagram", + "instagram-hex", + "linkedin", + "linkedin-hex", + "youtube", + "youtube-hex", + "email" +] %} + +{% set iconPortfolio = [ + "culture-and-digital", + "economy", + "environment", + "housing-and-land", + "inclusive-communities", + "skills", + "transport", + "wellbeing" +] %} + + +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} + +{% block content %} +{# How to use #} +

About

+ +

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ +
+ +{# Using Icons #} +

Using icons

+

WMCA Design System icons are available as an SVG sprite to include in your HTML page.

+

How to use

+

Recommended

+

The Recommended method of using the icon sprite sheet is to refer directly to the one used in the design system. This ensures that your icons will always be up to date.

+

To get started, include the below snippet of javascript somewhere in your codebase. This will:

+ +
+  
+  {%- filter forceescape -%}
+  
+  
+  {%- endfilter %}
+  
+
+ +

Displaying an icon

+

To display an icon or glyph, use an icon tag (from the icon section at the bottom of the page) with a href attribute and xlink:href (as a fallback). Make sure that the xlink and href tags are pointing to the location of your downloaded icon sprite sheet.

+

The ICON-TAG-NAME should be replaced with the icon tag name of the icon you want to show from the Icons section below, for example #ds-general-arrow should be in the xlink:href and href attributes of the svg's <use> element.

+
+  
+    {{-
+      wmcadsIcon({
+        icon: 'ICON-TAG-NAME'
+      }) | forceescape | trim
+    -}}
+  
+
+ + +

Can't include via recommended method? Try hosting the sprites locally

+ + +
+ +{# Icons #} +

Icons

+

Find below a list of all our icons and their tags below. To use, don't forget to prefix the tag with 'ds-'

+

General

+
+ {% for icon in iconGeneral %} +
+ {{ + wmcadsIcon({ + icon: 'general-' + icon + }) + }} +

{{ 'general-' + icon }}

+
+ {% endfor %} +
+ +{# Portfolios #} +

Portfolios

+
+ {% for icon in iconPortfolio %} +
+ {{ + wmcadsIcon({ + icon: 'portfolio-' + icon + }) + }} +

{{ 'portfolio-' + icon }}

+
+ {% endfor %} +
+ +{# Social #} +

Social

+
+ {% for icon in iconSocial %} +
+ {{ + wmcadsIcon({ + icon: 'social-' + icon + }) + }} +

{{ 'social-' + icon }}

+
+ {% endfor %} +
+ +{% endblock %} diff --git a/src/www/pages/mc/components/styles/images/index.njk b/src/www/pages/mc/components/styles/images/index.njk new file mode 100644 index 00000000..e9dea0aa --- /dev/null +++ b/src/www/pages/mc/components/styles/images/index.njk @@ -0,0 +1,29 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Images" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +

For more guidance on how to use images, please check WMCA brand guidelines.

+ +{% endblock %} diff --git a/src/www/pages/mc/components/styles/index.njk b/src/www/pages/mc/components/styles/index.njk new file mode 100644 index 00000000..9b5b722d --- /dev/null +++ b/src/www/pages/mc/components/styles/index.njk @@ -0,0 +1,15 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Styles" %} +{% set section = "Styles" %} +{% set ds = 'mc' %} + +{% block content %} +

Make your service look and feel like WMCA Design System.

+

If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples in the + Design System will not need any additional styling.

+

If you need to apply styles manually, you should still follow existing WMCA Design System conventions. For + example, do not assign + new meanings to colours, do not change the style of buttons or adjust the thickness of borders on + form inputs.

+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/styles/layout/index.njk b/src/www/pages/mc/components/styles/layout/index.njk new file mode 100644 index 00000000..219dae2d --- /dev/null +++ b/src/www/pages/mc/components/styles/layout/index.njk @@ -0,0 +1,84 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Layout" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# Standard content template #} +

Standard content template

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# Guidance #} +

Guidance for content editors

+ +

Warning text with exclamation mark icon component: Please read the Creating effective content section below before writing content or placing content into your page.

+ + +
+{# Publicity campaign template #} +

Publicity campaign template

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# Guidance #} +

Guidance for content editors

+ + + +
+{# Creating effective content #} +

Creating effective content

+

There is no minimum or maximum page length, however:

+ +

Use clear and concise content because the longer text, the lower rate of readability and comprehension drops significantly.

+

Always place content with higher importance at the top of the page, with less important content following after.

+

If you have to use long content, break it down into smaller sections to make it easier for user to understand information. You can:

+ + +{% endblock %} diff --git a/src/www/pages/mc/components/styles/maps/index.njk b/src/www/pages/mc/components/styles/maps/index.njk new file mode 100644 index 00000000..cc521ac9 --- /dev/null +++ b/src/www/pages/mc/components/styles/maps/index.njk @@ -0,0 +1,177 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Maps" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# Imports #} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# ESRI ArcGIS #} +

ESRI ArcGIS

+ +{# About #} +

About

+

+ When it comes to mapping, West Midlands Combined Authority uses + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/labs/what-is-arcgis/", + linkTitle: "ESRI ArcGIS products", + linkTarget: "_blank", + contentText: "ESRI ArcGIS products" + }) + }} + to create, manage and share data on maps. Therefore, when developing maps use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. +

+ +{# Basemap #} +

Basemap

+ + A screenshot showing an example of a map + +

+ When creating a map use the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as your basemap layer. This is to ensure maps are consistent across West Midlands Combined Authority services. +

+

The WMCA Basemap is a portal item, you can use the +{{ + wmcadsLink({ + link: "https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html", + linkTitle: "ArcGIS Basemap documentation", + linkTarget: "_blank", + contentText: "ArcGIS Basemap documentation" + }) + }} with the WMCA Basemap ID to include the basemap in your application. +

+ +{# Example of code #} +

Example of the ESRI ArcGIS JavaScript API

+
+  
+    // ESRI ArcGIS JS code...
+    const basemap = new Basemap({
+      baseLayers: [
+        new VectorTileLayer({
+          portalItem: {
+            // set the baselayer to WMCA Basemap:
+            // https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e
+            id: '53f165a8863c4d40ba017042e248355e',
+          },
+        }),
+      ],
+    });
+
+    // Create a new map with the basemap set above
+    const map = new Map({
+      basemap,
+    });
+  
+
+ +{# Can't use Esri ArcGIS #} +

Can't use ESRI ArcGIS?

+

+ We understand that you may not always be able to use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. + In these situations, style your map as closely to the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as possible. +

+


+ + +{# User interface #} +

User interface

+

+ User interface elements on a map such as zoom, pan and location buttons follow particular pattern rules when being used. +

+

These pattern rules are:

+ + + + +{% endblock %} diff --git a/src/www/pages/mc/components/styles/typography/index.njk b/src/www/pages/mc/components/styles/typography/index.njk new file mode 100644 index 00000000..ca9dff7e --- /dev/null +++ b/src/www/pages/mc/components/styles/typography/index.njk @@ -0,0 +1,75 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Typography" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# About #} +

About

+

+ We have tested our typography with users, including those with dyslexia and those with low vision. The questionnaire presented respondents with two body fonts, set out in different sizes, line spacing and kerning. The options were shown randomly for each participant.

+

+ Our findings were as such: +

+

+

+ As a public sector organisation, in addition to testing the above we are required to meet WCAG 2.1 guidelines at AA standard. + Therefore, features will be useable when text size is increased up to 200% and content reflowed for 400%. +

+
+{# Fonts #} +

Fonts

+

+ We utilise Google Fonts in our typography and all fonts used are pre-bundled in our design system CSS, so you won't need to include them seperately. +

+

+ Find below, various examples of our typography in use. +

+ +{# DM Sans / Headings #} +

DM Sans / headings

+

+ The font DM Sans is used with font weight of 700 (bold) for heading elements only.
+ DM Sans font reference +

+

Things to note:

+ +
+

46px - Heading 1

+

32px - Heading 2

+

23px - Heading 3

+

18px - Heading 4

+
+ +{# Noto sans / body copy #} +

Noto Sans / body copy

+

+ The font Noto Sans is used with the font weight of 400 (regular) and 700 (bold) for all elements other than headings. The default font size used is 16px.
+ Noto Sans font reference +

+
+

Characters

+ Font size: 16px / 1rem

+ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+ a b c d e f g h i j k l m n o p q r s t u v w x y z
+ 1 2 3 4 5 6 7 8 9 0
+ {% filter escape %} + ‘ ? ’ “ ! ” (%) [#] {@} / & \ < - + ÷ × = > ® © $ € £ ¥ ¢ : ; , . * + {% endfilter %} +
+

Styles

+ 400 - Regular
+ 400 - Regular italic
+ 700 - Bold
+ 700 - Bold italic +
+ +{% endblock %} diff --git a/src/www/pages/mc/components/styles/utility-classes/index.njk b/src/www/pages/mc/components/styles/utility-classes/index.njk new file mode 100644 index 00000000..ffe19480 --- /dev/null +++ b/src/www/pages/mc/components/styles/utility-classes/index.njk @@ -0,0 +1,276 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Utility classes" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} + +{% block content %} +{# About #} +

About

+

+ There are a variety of utility classes that can be used with the existing components and styles on. +

+ + +
+{# Containers #} +

Containers

+

+ Containers are used to wrap content in a 'container'. The container will have a fixed max size and be centered on the page, it will adjust to 100% width when the page width is less than the container size. +

+ +
+  
+    .ds-container /* Container with max-width of 1280px */
+
+    /* This should be used on your main content section and will
+    add a margin top to seperate from header/breadcrumb section */
+    .ds-container.ds-container--main
+  
+
+ + +
+{# Grid #} +

Grid

+

+ The WMCA Design System uses its own custom syntax grid system adopted from Pure CSS Grid. The grid system is already included in the bundled ds-components.min.css file so you don't need to include it seperately. +

+ +

+ You can Refer to the Pure CSS Grid documentation for reference on how to use our grid system, but bear in mind that: +

+ + + +

You can also use modifier classes on the same element where the class .ds-grid is being used.

+
+  
+    .ds-grid--justify-between
+    .ds-grid--justify-around
+    .ds-grid--justify-end
+    .ds-grid--justify-center
+  
+
+ +{{ + wmcadsLink( { + link: "/styles/examples/grid-examples.html", + contentText: "Grid examples" + } + ) +}} + +

Information for designers

+

+ The grid is part of the Design System Sketch library or as a standalone template file. +

+

Screen sizes

+

+

+

+

Sketch grid sizes

+

+

+

+ +
+{# Floats #} +

Floats

+

+ Floats an element in the intended direction. +

+ +
+  
+    .ds-float-left
+    .ds-float-right
+  
+
+ + +
+{# Text Align #} +

Text Align

+

+ Aligns text in the intended direction. +

+ +
+  
+    .ds-text-align-left
+    .ds-text-align-center
+    .ds-text-align-right
+  
+
+ + +
+{# Show or hide on devices #} +

Show or hide on devices

+

+ When you want to hide an element based on if the device width is a desktop or mobile device. +

+ +
+  
+    .ds-hide-mobile /* Hide only on mobile devices or smaller (less than 48em)  */
+    .ds-hide-desktop /* Hide only on desktop devices or larger (greater than 48em) */
+    .ds-hide /* Hide on all devices */
+  
+
+ +
+

Spacing

+

+ The spacing utility classes are used to adjust whitespace for an element via padding and margins. +

+

Before using the spacing utility classes, please consider:

+ + +

+ The classes are named using the format .ds-{type}-{side}-{size}. +

+{# type #} +

+ Where {type} is one of: +

+ +{# side #} +

+ Where {side} is one of: +

+ +{# size #} +

+Where {size} is one of: +

+ + +

Some examples of using these utility classes...

+
+  
+    .ds-m-xs // applies a margin of 0.25rem to all sides
+    .ds-p-b-lg // applies a padding-bottom of 2rem
+    .ds-m-l-none // sets left margin to 0
+  
+
+ +{# Grid columns spacing #} +

Grid column spacing

+ +

+ Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

+

+ The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

+

+ Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

+

+ Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

+

+ Where {breakpoint} is one of breakpoint sizes described in the grid section. +

+ +

Some examples of using these utility classes...

+
+  
+    .ds-grid--spacing-2-md // applies a 1rem spacing between 2 columns
+    .ds-grid--spacing-lg-4-lg // applies a 2rem spacing between 4 columns above a screen width of 1024px
+  
+
+ +{{ + wmcadsLink( { + link: "/styles/examples/grid-column-spacing.html", + contentText: "Grid column spacing examples" + } + ) +}} +

+ +
+{# Background #} +

Background Colour

+

+ Changes background to the intended colour. +

+ +
+  
+    .bg-default
+    .bg-white
+    .bg-disabled-elements
+    .bg-transparent
+  
+
+ +{% endblock %} diff --git a/src/www/pages/mc/components/templates/_general.scss b/src/www/pages/mc/components/templates/_general.scss new file mode 100644 index 00000000..5c212665 --- /dev/null +++ b/src/www/pages/mc/components/templates/_general.scss @@ -0,0 +1,7 @@ +.ds-html { + .ds-page-contents { + @media screen and (max-width: $breakpoint-md) { + margin: 0 !important; + } + } +} diff --git a/src/www/pages/mc/components/templates/campaign-one-column/campaign-template.scss b/src/www/pages/mc/components/templates/campaign-one-column/campaign-template.scss new file mode 100644 index 00000000..ff53a866 --- /dev/null +++ b/src/www/pages/mc/components/templates/campaign-one-column/campaign-template.scss @@ -0,0 +1,11 @@ +.template-campaign { + .partner { + display: flex !important; + align-items: center; + justify-content: center; + + @media screen and (max-width: $breakpoint-sm) { + padding: 0 !important; + } + } +} diff --git a/src/www/pages/mc/components/templates/campaign-one-column/index.njk b/src/www/pages/mc/components/templates/campaign-one-column/index.njk new file mode 100644 index 00000000..7046dac7 --- /dev/null +++ b/src/www/pages/mc/components/templates/campaign-one-column/index.njk @@ -0,0 +1,206 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Campaign Template - One Column" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{% from "wmcads/components/page-header/_page-header.njk" import wmcadsPageHeader %} +{%- from "wmcads/components/button/_button.njk" import wmcadsButton as start -%} +{# Set array of tiles #} +{% block content %} + +
+ +
+

Roll & Stroll

+
+ +{{ + wmcadsPageHeader({ + title: false, + large: true + }) +}} +
+
+
+

Roll & Stroll

+

Have your say on cycling & walking changes in your local area.

+

Lockdown has been quite a journey but cycling and walking is more popular than ever.

+

After marking this year the Big Summer of Cycling & Walking, let’s not stop now. We're continuing to invest in creating a region that supports healthy, greener and safer travelling. We want to help you get started or keep going.

+

Whatever your travel plans - whether it's a cycle around your local streets or a winter walkie - we're here to help you start the adventure before you get there. There’s never been a better time to stay fit and healthy than right now - so, get your roll & stroll on!

+ {{ + start({ + classNames: "ds-btn--start", + text: "Have your say", + iconRight: "general-chevron-right" + }) + }} + + +

Cycling & walking in your area

+
+
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Get Going Continue Rolling', + isDefault: true, + copy: 'Whether youre rolling to work or school, or catching some fresh air, theres always safe and new ways to get there.' + }) + }} +
+
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'All things strolling', + isDefault: true, + copy: 'Wherever youre heading, theres always new and safe ways to get there on foot. ' + }) + }} +
+
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Changes in your area', + isDefault: true, + copy: 'Understand what changes are being made in your area to help you travel safely' + }) + }} +
+
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Get active and travel safely', + isDefault: true, + copy: 'Enjoy being physically active and travelling outdoors responsibly and safely. ' + }) + }} +
+
+ + +

Get the best from your bike

+
+ + + +
+

+ Some random subtitle +

+

+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt consectetur, eius repellat dolor vel corporis eos fugiat. Ut totam, incidunt sequi iusto nesciunt illum natus, dolores velit cumque, excepturi labore! +

+
+
+ +
+ + + +
+

+ Some random subtitle +

+

+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt consectetur, eius repellat dolor vel corporis eos fugiat. Ut totam, incidunt sequi iusto nesciunt illum natus, dolores velit cumque, excepturi labore! +

+
+
+ + + +

Additional Information

+
+
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Support for businesses', + isDefault: true, + copy: 'We have a wide range of options to support your business and employees at work and at home' + }) + }} +
+
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Be Aware and Share', + isDefault: true, + copy: 'If you drive in the West Midlands be prepared to share the road space with more Rollers and Strollers.' + }) + }} +
+
+ + + +

Campaign Funding Partners

+ +
+
+ + Active Travel fund + +
+
+ + Active Travel fund + +
+
+
+
+
+ +
+ campaign bottom image +
+ +
+{% endblock %} diff --git a/src/www/pages/mc/components/templates/campaign-two-columns/campaign-template.js b/src/www/pages/mc/components/templates/campaign-two-columns/campaign-template.js new file mode 100644 index 00000000..774633d9 --- /dev/null +++ b/src/www/pages/mc/components/templates/campaign-two-columns/campaign-template.js @@ -0,0 +1,37 @@ +const pageContents = () => { + const contents = document.querySelector('.ds-dynamic-page-contents'); + + if (contents != null) { + const headings = document.querySelectorAll('main h2'); + + headings.forEach(heading => { + const str = heading.innerHTML; + const linkStr = str.toLowerCase().replaceAll(' ', '-'); + const link = `#${linkStr}`; + + // add id to all the h2 + heading.setAttribute('id', linkStr); + + // function to decode htmlentities + function decodeHtml(html) { + const txt = document.createElement('textarea'); + txt.innerHTML = html; + return txt.value; + } + // function to add a link to the page contents + function createMenuItem() { + const li = document.createElement('a'); + li.textContent = decodeHtml(str); + li.setAttribute('href', link); + return li; + } + + // get the page contents + const menu = document.querySelector('.ds-page-contents'); + // add page contents link + menu.appendChild(createMenuItem()); + }); + } +}; + +export default pageContents; diff --git a/src/www/pages/mc/components/templates/campaign-two-columns/index.njk b/src/www/pages/mc/components/templates/campaign-two-columns/index.njk new file mode 100644 index 00000000..22d243c7 --- /dev/null +++ b/src/www/pages/mc/components/templates/campaign-two-columns/index.njk @@ -0,0 +1,196 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Campaign Template - Two Columns" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{% from "wmcads/components/page-header/_page-header.njk" import wmcadsPageHeader %} +{%- from "wmcads/components/button/_button.njk" import wmcadsButton as start -%} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{# Set array of tiles #} +{% block content %} + +
+ +
+

Roll & Stroll

+
+ +{{ + wmcadsPageHeader({ + title: false, + large: true + }) +}} +
+
+ + +
+

Roll & Stroll

+

Have your say on cycling & walking changes in your local area.

+

Lockdown has been quite a journey but cycling and walking is more popular than ever.

+

After marking this year the Big Summer of Cycling & Walking, let’s not stop now. We're continuing to invest in creating a region that supports healthy, greener and safer travelling. We want to help you get started or keep going.

+

Whatever your travel plans - whether it's a cycle around your local streets or a winter walkie - we're here to help you start the adventure before you get there. There’s never been a better time to stay fit and healthy than right now - so, get your roll & stroll on!

+ {{ + start({ + classNames: "ds-btn--start", + text: "Have your say", + iconRight: "general-chevron-right" + }) + }} + + +

Cycling & walking in your area

+
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Get Going Continue Rolling', + copy: 'Whether youre rolling to work or school, or catching some fresh air, theres always safe and new ways to get there.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'All things strolling', + copy: 'Wherever youre heading, theres always new and safe ways to get there on foot. ' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Changes in your area', + copy: 'Understand what changes are being made in your area to help you travel safely' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Get active and travel safely', + copy: 'Enjoy being physically active and travelling outdoors responsibly and safely. ' + }) + }} +
+ + +

Get the best from your bike

+
+ + + +
+

+ Some random subtitle +

+

+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt consectetur, eius repellat dolor vel corporis eos fugiat. Ut totam, incidunt sequi iusto nesciunt illum natus, dolores velit cumque, excepturi labore! +

+
+
+ +
+ + + +
+

+ Some random subtitle +

+

+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt consectetur, eius repellat dolor vel corporis eos fugiat. Ut totam, incidunt sequi iusto nesciunt illum natus, dolores velit cumque, excepturi labore! +

+
+
+ + + +

Additional Information

+
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Support for businesses', + copy: 'We have a wide range of options to support your business and employees at work and at home' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Be Aware and Share', + copy: 'If you drive in the West Midlands be prepared to share the road space with more Rollers and Strollers.' + }) + }} +
+ + + +

Campaign Funding Partners

+ +
+
+ + Active Travel fund + +
+
+
+
+
+ +
+ campaign bottom image +
+ +
+ +{% endblock %} diff --git a/src/www/pages/mc/components/templates/content-one-column/content-template.scss b/src/www/pages/mc/components/templates/content-one-column/content-template.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/www/pages/mc/components/templates/content-one-column/index.njk b/src/www/pages/mc/components/templates/content-one-column/index.njk new file mode 100644 index 00000000..eb79ee22 --- /dev/null +++ b/src/www/pages/mc/components/templates/content-one-column/index.njk @@ -0,0 +1,95 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Content One Column" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +
+ header image +
+
+
+
+

Adult Education Budget

+

From 2018, we’re responsible for the region's Adult Education Budget (AEB).

+

We target priority growth sectors from the Local Industrial Strategy. This improves skills and secure jobs in communities. It also helps to improve productivity in the region.

+

What the budget is

+

The budget helps residents and employers get the skills needed in the region. This helps people to get the jobs they need and increases the skills of current employees. It unlocks specialist training as well.

+

It also allows for more flexible and tailored learning programmes in the region. This helps people to take part in learning, build confidence and their wellbeing. It unlocks opportunities for more people.

+

Our challenges

+

We set out the challenges for the labour market in our Regional Skills Plan:

+

High levels of unemployment in some parts of the region + Poverty is growing for people who are working because of low wages + Low skill levels with less people qualified to skill level 4, or no qualifications at all + Employers struggle to find people with the skills they need

+

We use the budget to help improve confidence and opportunities for residents. It helps business find staff with the skills they need too.

+

Priorities for the budget

+

We will fund adult education through a range of delivery partners. Through commissioning, the budget will focus on:

+

Innovation

+

Looking at new ways of delivering learning. These will align with our priorities in the construction and digital sectors.

+

Talent & Progression

+

We'll develop new job schemes, and help build the skills of people in employment.

+

Collaboration

+

Working with our provider partners, we'll create an agile skills system. It will align to the needs of businesses and residents.

+

Sustainability

+

We're developing agreements with providers. These will check delivery against our key priorities. It will also track the impact of this approach.

+
+
+ +
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault : true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isDoubleCard: true, + title: 'Pharetra Sollicitudin Bibendum', + copy: 'Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo.' + }) + }} +
+ +
+ +{% endblock %} diff --git a/src/www/pages/mc/components/templates/content-template/content-template.scss b/src/www/pages/mc/components/templates/content-template/content-template.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/www/pages/mc/components/templates/content-template/index.njk b/src/www/pages/mc/components/templates/content-template/index.njk new file mode 100644 index 00000000..6c9b3333 --- /dev/null +++ b/src/www/pages/mc/components/templates/content-template/index.njk @@ -0,0 +1,98 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Content Page Template" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +
+ header image +
+
+
+
+

{{ pageTitle | safe}}

+

From 2018, we’re responsible for the region's Adult Education Budget (AEB).

+

We target priority growth sectors from the Local Industrial Strategy. This improves skills and secure jobs in communities. It also helps to improve productivity in the region.

+

What the budget is

+

The budget helps residents and employers get the skills needed in the region. This helps people to get the jobs they need and increases the skills of current employees. It unlocks specialist training as well.

+

It also allows for more flexible and tailored learning programmes in the region. This helps people to take part in learning, build confidence and their wellbeing. It unlocks opportunities for more people.

+

Our challenges

+

We set out the challenges for the labour market in our Regional Skills Plan:

+

High levels of unemployment in some parts of the region + Poverty is growing for people who are working because of low wages + Low skill levels with less people qualified to skill level 4, or no qualifications at all + Employers struggle to find people with the skills they need

+

We use the budget to help improve confidence and opportunities for residents. It helps business find staff with the skills they need too.

+

Priorities for the budget

+

We will fund adult education through a range of delivery partners. Through commissioning, the budget will focus on:

+

Innovation

+

Looking at new ways of delivering learning. These will align with our priorities in the construction and digital sectors.

+

Talent & Progression

+

We'll develop new job schemes, and help build the skills of people in employment.

+

Collaboration

+

Working with our provider partners, we'll create an agile skills system. It will align to the needs of businesses and residents.

+

Sustainability

+

We're developing agreements with providers. These will check delivery against our key priorities. It will also track the impact of this approach.

+
+
+
+
+ {{ + wmcadsContentCard({ + src: true, + isThirdCard: true, + title: 'Who weve funded', + copy: 'See which councils and providers weve funded, and what for.' + }) + }} +
+
+ {{ + wmcadsContentCard({ + src: true, + isThirdCard: true, + title: 'Find training schemes', + copy: 'You can find training and education providers weve funded online.' + }) + }} +
+
+ {{ + wmcadsContentCard({ + src: true, + isThirdCard: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} +
+
+ {{ + wmcadsContentCard({ + src: true, + isThirdCard: true, + title: 'Pharetra Sollicitudin', + copy: 'Donec sed odio dui. Nullam quis risus eget urna mollis ornareleo.' + }) + }} +
+
+ {{ + wmcadsContentCard({ + src: true, + isDoubleCard: true, + title: 'Pharetra Sollicitudin Bibendum', + copy: 'Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo.' + }) + }} +
+
+
+
+{% endblock %} diff --git a/src/www/pages/mc/components/templates/content-two-columns/content-template.scss b/src/www/pages/mc/components/templates/content-two-columns/content-template.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/www/pages/mc/components/templates/content-two-columns/index.njk b/src/www/pages/mc/components/templates/content-two-columns/index.njk new file mode 100644 index 00000000..788810ec --- /dev/null +++ b/src/www/pages/mc/components/templates/content-two-columns/index.njk @@ -0,0 +1,110 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Content Two Columns" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{# Set array of tiles #} +{% block content %} + +
+ +
+

Roll & Stroll

+
+ +
+ header image +
+
+
+ + +
+

Adult Education Budget

+

From 2018, we’re responsible for the region's Adult Education Budget (AEB).

+

We target priority growth sectors from the Local Industrial Strategy. This improves skills and secure jobs in communities. It also helps to improve productivity in the region.

+

What the budget is

+

The budget helps residents and employers get the skills needed in the region. This helps people to get the jobs they need and increases the skills of current employees. It unlocks specialist training as well.

+

It also allows for more flexible and tailored learning programmes in the region. This helps people to take part in learning, build confidence and their wellbeing. It unlocks opportunities for more people.

+

Our challenges

+

We set out the challenges for the labour market in our Regional Skills Plan:

+

High levels of unemployment in some parts of the region + Poverty is growing for people who are working because of low wages + Low skill levels with less people qualified to skill level 4, or no qualifications at all + Employers struggle to find people with the skills they need

+

We use the budget to help improve confidence and opportunities for residents. It helps business find staff with the skills they need too.

+

Priorities for the budget

+

We will fund adult education through a range of delivery partners. Through commissioning, the budget will focus on:

+

Innovation

+

Looking at new ways of delivering learning. These will align with our priorities in the construction and digital sectors.

+

Talent & Progression

+

We'll develop new job schemes, and help build the skills of people in employment.

+

Collaboration

+

Working with our provider partners, we'll create an agile skills system. It will align to the needs of businesses and residents.

+

Sustainability

+

We're developing agreements with providers. These will check delivery against our key priorities. It will also track the impact of this approach.

+
+ {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isDoubleCard: true, + title: 'Pharetra Sollicitudin Bibendum', + copy: 'Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo.' + }) + }} +
+ +
+
+
+
+{% endblock %} diff --git a/src/www/pages/mc/components/templates/document-foreword/index.njk b/src/www/pages/mc/components/templates/document-foreword/index.njk new file mode 100644 index 00000000..7c4d0015 --- /dev/null +++ b/src/www/pages/mc/components/templates/document-foreword/index.njk @@ -0,0 +1,137 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Local Transport Plan Green Paper" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/components/file-download/_file-download.njk" import wmcadsFileDownload %} +{% from "wmcads/components/video-embed/_video-embed.njk" import wmcadsVideoEmbed %} +{% from "wmcads/components/hub-header/_hub-header.njk" import wmcadsHubHeader %} +{% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} +{# Set array of tiles #} +{% block content %} + +
+{{ +wmcadsHubHeader({ + image: false, + title: "Local Transport Plan Green Paper" + }) +}} +
+
+ +
+

Foreword

+

As well as being at the heart of the UK’s +transport network, the West Midlands is at +another kind of crossroads; one at which there +is an opportunity to build back better from the +COVID-19 pandemic, to ensure we can carry +forward the reputation for economic success +the region has built in the new millennium +while improving the impacts of transport on +our towns, cities and local communities.

+ +

This green paper sets out the challenges and +opportunities facing our transport system to +inspire deliberation with the public over the +kind of transport system we want to see in the +future. The decisions we make now about how +we plan, invest in and manage our transport +system will affect us all, as well as deciding +what legacy we leave for future generations.

+ +

Over the past few years, the West Midlands has +seen substantial improvements to its transport +network. The West Midlands Metro has been +extended through Birmingham city centre +and a new line is under construction in the +Black Country, connecting Wednesbury with +Brierley Hill. We are improving our railways, +with improved and new stations planned at +Perry Barr, Darlaston, Willenhall, Aldridge and +the revival of the old Camp Hill line. Fleets +of electric buses are taking to the streets in +increasing numbers. And our active travel +revolution is well underway, with new cycling +and walking routes springing up across the +region. After decades of underinvestment, our +region is beginning to turn things around.

+ +

But significant challenges remain in tackling +the defining issues of our time, such as climate +change, air quality, our health, and now our +economic recovery from the pandemic. This +paper poses some difficult questions about +how we address these challenges. But it also +offers real hope that, with a collective effort, +we can create a West Midlands that leads the +way in tackling these issues. We have a strong +entrepreneurial and innovative heritage to build +on. By thinking and acting differently we can +create a place where transport improves the +opportunities available to all our residents.

+ +

A key aim of this paper is to understand what +our residents and communities want from their +transport network. Your views will inform our +new Local Transport Plan, due to be published +later in the year. +This green paper sets out five reasons why we +should consider changing the way we travel. +We call these our five Motives for Change. +These are focussed on creating a fairer, greener, +healthier, happier and more prosperous West +Midlands. In particular, we want to know how +the successive lockdowns have impacted our +relationship with the transport network and how +this should inform where we take the network in +the coming years. +This is the start of a conversation with +residents, organisations and businesses on +the kinds of changes we want to see in our +transport system and the trade-offs required. +So please engage with the prompts and issues +raised in this paper and let us know what you +think, so that together we can build a transport +network that will

+ +
+
+
+ +
+

Andy Street

+

Mayor of the West Midlands

+
+
+
+ +
+

Councillor Ian Ward

+

Leader of Birmingham City Council

+
+
+ + +{{ + wmcadsPagination({ + pageCount: 8, + activePage: 1 + }) +}} +
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/templates/document-hub/index.njk b/src/www/pages/mc/components/templates/document-hub/index.njk new file mode 100644 index 00000000..6e488d31 --- /dev/null +++ b/src/www/pages/mc/components/templates/document-hub/index.njk @@ -0,0 +1,62 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Document Hub" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/components/file-download/_file-download.njk" import wmcadsFileDownload %} +{# Set array of tiles #} +{% block content %} + +
+
+
+

Local Transport Plan Green Paper

+

Documents

+ {{ + wmcadsFileDownload({ + html: false, + htmlInfo: true, + default: true, + htmlDoc: false, + pdfDoc: false, + dlName: 'Local Transport Plan Green Paper' + ]) + }} + +

Details

+

Getting transport right in our region requires us to have a plan for the future that balances the needs to provide access for everyone with the harmful impacts that transport can have on people and places.

+

This document sets out some of the big challenges that we need to address if we want transport to drive Inclusive Growth; sustainable and equitable growth where all citizens can shape, contribute and benefit from the advancement of the region.

+

These challenges are frames within the document as 5 Motives for Change.

+
    +
  • Creating a fairer society
  • +
  • Supporting local communities and places
  • +
  • Becoming more active
  • +
  • Tackling the climate emergency
  • +
  • Sustaining economic success
  • +
+
+

Alternative formats

+ {{ + wmcadsFileDownload({ + html: false, + htmlInfo: true, + default: false, + htmlDoc: false, + pdfDoc: true, + dlName: 'Download Local Transport Plan Green Paper (pdf, 7.88MB)' + }) + }} +
+ +
+
+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/templates/document-paper/index.njk b/src/www/pages/mc/components/templates/document-paper/index.njk new file mode 100644 index 00000000..6e18a07f --- /dev/null +++ b/src/www/pages/mc/components/templates/document-paper/index.njk @@ -0,0 +1,104 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Reimagining transport in the West Midlands - WMLTP5 Green Paper" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/components/file-download/_file-download.njk" import wmcadsFileDownload %} +{% from "wmcads/components/video-embed/_video-embed.njk" import wmcadsVideoEmbed %} +{# Set array of tiles #} +{% block content %} + +
+
+
+
+

Reimagining transport in the West Midlands - WMLTP5 Green Paper

+
+
+
+
+ {{ + wmcadsVideoEmbed({ + }) + }} + +

TfWM is in the process of supporting the WMCA to update its current Local Transport Plan (LTP). This is a document that sets out the policies to promote safe, integrated, efficient and economic transport to, from and within our area as well as plans to implement those policies.

+

Publishing and reviewing the LTP is one of WMCA’s core statutory duties as the Local Transport Authority for the area covered by the West Midlands seven metropolitan districts/boroughs.

+ +

Why do we need a Green Paper?

+

Getting transport right in our region requires us to have a plan for the future that balances the needs to provide access for everyone with the harmful impacts that transport can have on people and places. We’ve published a Green Paper to start a conversation about what a new Local Transport Plan should look like.

+

We will use the Green Paper to drive engagement with people, businesses and other key stakeholders across the region. We want you to get involved and work with us together, so we can get it right for where you live and work.

+

The COVID-19 pandemic has hit our region hard but it has also shown us how adaptable we can be and that change can bring new opportunities and benefits. We want to build back better from the pandemic. Doing so will need us to think about how transport can better support a prosperous and well-connected West Midlands which is fairer, greener and healthier.

+ +

Our Motives for Change

+

We think there are some big challenges that we need to address if we want transport to drive Inclusive Growth; sustainable and equitable growth where all citizens can shape, contribute and benefit from the advancement of the region. We’ve framed these challenges in our 5 Motives for Change.

+
    +
  • Creating a fairer society
  • +
  • Supporting local communities and places
  • +
  • Becoming more active
  • +
  • Tackling the climate emergency
  • +
  • Sustaining economic success
  • +
+

The Motives for Change are all important, but the need to tackle the climate emergency has a particular urgency that the other Motives for Change lack. Current predictions suggest that if we don’t rapidly reduce our carbon emissions, by 2030 we could face a global scenario in which we lose the ability to prevent escalating climate change and the harm it will cause around the world and in the West Midlands. That is why WMCA has declared a climate emergency and set a zero-carbon target for the West Midlands by 2041, with the first of four 5-year plans already published.

+

This suggests a new LTP could have a much stronger focus on achieving transformational change within the next 10 years, rather than focussing on a longer-term vision and more gradual change. This presents us with the opportunity to rapidly reimagine transport to deliver transformative improvement in the lives of millions of people across our region, and for the West Midlands to demonstrate leadership in tackling global and local problems.

+
+ {{ + wmcadsFileDownload({ + html: true, + default: true, + htmlName: 'Long Term Plan Summary' + }) + }} +
+
+ {{ + wmcadsFileDownload({ + html: true, + default: true, + htmlName: 'Local Transport Plan Green Paper' + }) + }} +
+
+ +
+
+
+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/templates/document-section/index.njk b/src/www/pages/mc/components/templates/document-section/index.njk new file mode 100644 index 00000000..b8869507 --- /dev/null +++ b/src/www/pages/mc/components/templates/document-section/index.njk @@ -0,0 +1,60 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Local Transport Plan Green Paper" %} {% set section = "Templates" %} +{# Imports #} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/components/hub-header/_hub-header.njk" import wmcadsHubHeader %} +{% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} +{% from "wmcads/components/images/_image-with-summary.njk" import wmcadsImageWithSummary %} +{# Set array of tiles #} +{% block content %} + +
+{{ +wmcadsHubHeader({ + image: false, + title: "Local Transport Plan Green Paper" + }) +}} +
+
+ +
+

Section 3: Our Motives for Change

+

Inclusive Growth in the West Midlands means that all citizens can shape, contribute and benefit from the advancement of the region.

+

It is a deliberate and socially purposeful model of economic growth – measured not only by how fast or aggressive it is; but also by how well it is shared across the whole population and place, and the capacity of our environment to sustain it.

+

WMCA’s goal for Inclusive Growth is to occupy a space where social need, economic ambition and our responsibilities to the environment are in balance.

+ + {{ + wmcadsImageWithSummary({ + img: "/img/examples/diagram.png", + title: "Inclusive Growth Framework", + summary: "The space for a balanced, inclusive economy is where social challenges can be met without degrading the environment" + }) + }} + +

Transport’s relationship with Inclusive Growth is complex:

+
    +
  • Meeting many of our needs and ambitions relies on transport connections
  • +
  • But those same transport connections have impacts that the environment can’t sustain and which are detrimental to other social and economic outcomes; and
  • +
  • Improving connections for a particular group of people, by a particular mode, to particular places can limit and even worsen connectivity elsewhere for others.
  • +
+ {{ + wmcadsPagination({ + pageCount: 8, + activePage: 5 + }) + }} +
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/templates/homepage/homepage.scss b/src/www/pages/mc/components/templates/homepage/homepage.scss new file mode 100644 index 00000000..a01fa204 --- /dev/null +++ b/src/www/pages/mc/components/templates/homepage/homepage.scss @@ -0,0 +1,23 @@ +.homepage { + .what-we-do { + svg { + display: block; + width: 50px; + height: 50px; + fill: get-color(primary); + } + + i { + color: get-color(primary) !important; + } + + a { + display: block; + width: 90%; + } + + div { + margin: 0 0 20px 0; + } + } +} diff --git a/src/www/pages/mc/components/templates/homepage/index.njk b/src/www/pages/mc/components/templates/homepage/index.njk new file mode 100644 index 00000000..fba3dff1 --- /dev/null +++ b/src/www/pages/mc/components/templates/homepage/index.njk @@ -0,0 +1,202 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Homepage Template" %} {% set section = "Templates" %} +{% set section="Templates" %} +{# Imports #} +{% from "wmcads/components/page-header/_page-header.njk" import wmcadsPageHeader %} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +{{ + wmcadsPageHeader({ + title: true, + text: "Building a healthier, happier, better connected and more prosperous West Midlands", + home: true, + topm: true + }) +}} +
+
+
+

What is the Combined Authority?

+

Combined Authorites are set up to improve their region’s economies. We invest in the region through collaboration with our partners, but we don’t replace local councils.

+
+
+

The Mayor

+

We’re led by the Mayor of the West Midlands. The current mayor is Andy Street, who is in office until May 2021.

+

The Mayor chairs the WMCA Board and acts as a voice for the region, nationally and globally.

+
+
+

What we do

+
+ + +
+ + + + Environment +
+
+ + + + Housing and Land +
+ + +
+ + + + Transport +
+
+ + + + Wellbeing +
+
+ +

Latest News

+
+ {{ + wmcadsContentCard({ + src: true, + title: 'WMCA donates computers to school children to tackle digital divide', + copy: '150 old staff laptops will be donated to Wowdot', + isNews: true, + isNewsSub: true + }) + }} + {{ + wmcadsContentCard({ + src: true, + title: 'WMCA donates computers to school children to tackle digital divide', + copy: '150 old staff laptops will be donated to Wowdot', + isNews: true, + isNewsSub: true + }) + }} + {{ + wmcadsContentCard({ + src: true, + title: 'Historic devolution agreement reached', + copy: 'The Government will contribute 40 million over the next 30 years', + isNews: true, + isNewsSub: true + }) + }} + {{ + wmcadsContentCard({ + src: true, + title: 'Historic devolution agreement reached', + copy: 'The Government will contribute 40 million over the next 30 years', + isNews: true, + isNewsSub: true + }) + }} +
+See all news stories + +
+ {{ + wmcadsContentCard({ + src: true, + isSrcDefault: true, + title: 'Coronavirus support', + copy: 'Get advice and support during the pandemic such as finding a new job and applying for business grants.', + clickable: true + }) + }} + {{ + wmcadsContentCard({ + src: true, + isSrcDefault: true, + title: '2021 Mayoral election', + copy: 'Find out what the Mayor is reponsible for and how to vote.', + clickable: true + }) + }} +
+
+ {{ + wmcadsContentCard({ + title: 'Upskill yourself in lockdown', + copy: 'Find out what the Mayor is reponsible for and how to vote.', + clickable: true + }) + }} + {{ + wmcadsContentCard({ + title: 'Thrive at Work', + copy: 'Join our free workplace wellbeing scheme to keep staff healthy, motivated and productive.', + clickable: true + }) + }} + {{ + wmcadsContentCard({ + title: 'Annual Plan 2021 - 2022', + copy: 'We’ve set our ambitions for each of our priorities over the next year.', + clickable: true + }) + }} +
+ +

Upcoming events

+
+ {{ + wmcadsContentCard({ + eventTitle: 'Mayors Mentors', + eventCopy: 'Find out about the Mayor’s Mentors scheme and how it can help you grow.', + clickable: true, + isEvent: true + }) + }} + {{ + wmcadsContentCard({ + eventTitle: 'Greater Birmingham LEP Skills Day', + eventCopy: 'Hear from employers and training providers on upskilling opportunities available.', + clickable: true, + isEvent: true + }) + }} + {{ + wmcadsContentCard({ + eventTitle: 'Sprint exhibition - Walsall', + eventCopy: 'Learn and ask questions about the upcoming Sprint works in the region.', + clickable: true, + isEvent: true + }) + }} +
+See all WMCA events + +
+ +{% endblock %} diff --git a/src/www/pages/mc/components/templates/index.njk b/src/www/pages/mc/components/templates/index.njk new file mode 100644 index 00000000..aaa455dc --- /dev/null +++ b/src/www/pages/mc/components/templates/index.njk @@ -0,0 +1,9 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Templates" %} +{% set section = "Templates" %} +{% set ds = 'mc' %} + + +{% block content %} +

Example templates that make up the main West Midlands Combined Authority Website

+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/components/templates/news-article/index.njk b/src/www/pages/mc/components/templates/news-article/index.njk new file mode 100644 index 00000000..afa8b6f6 --- /dev/null +++ b/src/www/pages/mc/components/templates/news-article/index.njk @@ -0,0 +1,68 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="News Article" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{# Set array of tiles #} +{% block content %} + +
+ +
+
+
+

Mayor highlights HS2 jobs boost as new contractor for Curzon Street station development is unveiled

+

Published: Monday 10 May 2021

+

HS2 Ltd today confirmed that a team made up of Mace and Dragados will build Birmingham’s new city centre high speed railway station, in a deal that is set to further boost the West Midlands economy.

+

The deal, which is worth up to £570m, will see Mace Dragados work with HS2 Ltd in two stages to finalise the detailed design and then build the landmark station.

+

The station itself will be net zero carbon in operation and adopt the latest eco-friendly design and sustainable technologies, including capturing rainwater and utilising sustainable power generation, with over 2,800m2 of solar panels located on platform canopies.

+ Curzon Street station development +

Mayor of the West Midlands Andy Street welcomed the announcement and the major role HS2 will play in the regional recovery after the pandemic. He said:

+

“HS2 is at the heart of my plans to create 100,000 jobs in just two years to help the West Midlands recover from the coronavirus pandemic, and so I am absolutely thrilled by today’s news.

+

“Not only is this a major shot in the arm for our region’s construction sector that was performing so well pre-Covid, but the building of Curzon Street is also set to create hundreds of jobs.

+

“That’s local jobs for local people at such a difficult time, and I will ensure we continue to run construction training courses so residents can get the skills they need to take on these new roles.

+

“I’m also excited to see the commitment from HS2 ltd that the station will be net-zero, helping the West Midlands in its battle against the climate emergency and in our aim to become carbon neutral by 2041.

+

It is designed to meet a ‘BREEAM excellent’ standard, which is an industry recognised standard for buildings that reduce energy usage and materials waste and minimise their impact on the natural environment.

+

Mace and Dragados have a strong track record delivering some of the world’s most complex and exciting infrastructure projects, including the refurbishment of Birmingham New Street, Battersea Power Station (phase 2) and work on delivering the Spanish high speed rail network, including the major new Madrid Atocha and Barcelona Sants stations. They are also working together in a separate joint venture delivering HS2’s London terminus at Euston.

+

HS2 Ltd’s chief executive, Mark Thurston said:

+

“Birmingham Curzon Street is right at the heart of the HS2 project, providing a fantastic terminus for trains running right into the heart of the city centre. The station will play a vital role in the long-term economic future of the West Midlands, creating hundreds of jobs during construction and boosting the region after the pandemic.

+

“Mace and Dragados have some incredible experience delivering some of the world’s most challenging and exciting infrastructure projects, and I look forward to welcoming them to the team.

+

HS2 Minister Andrew Stephenson said:

+

“This is a huge moment for Birmingham and for HS2. The brand new, world class HS2 station at Birmingham Curzon Street will place the city at the beating heart of the new HS2 network.

+

“It marks a major investment in Birmingham’s future as we build back better from Covid-19 - breathing new life into the city centre, supporting hundreds of new skilled jobs and helping forge better connections across the whole country.

+

HS2 worked with WSP and Grimshaw Architects LLP on the design for Curzon Street, which is inspired by the great arched roofs built by the Victorian railway pioneers. The design takes that inspiration into the 21st Century, ensuring accessibility and a focus on the open space and landscaping around it.

+

Passengers will also be to access up to nine high speed trains an hour travelling north and south, and the Midland Metro - which runs alongside and underneath the station. Accessible pedestrian routes will connect to local bus services, Sprint rapid transit bus services and local rail services from the neighbouring Moor Street station. Cycle parking has also been incorporated, providing space for more than 550 bicycles.

+

Significant progress has already been made on site at Curzon Street. Site clearance is now complete and a massive archaeological programme, involving 70 archaeologists, has unearthed the world’s oldest railway roundhouse.

+

Contact the Media Team

+
+ WMCA Media Team

+ media@wmca.org.uk
+ Available 7 days a week +
+
+ +
+
+
+ +{% endblock %} diff --git a/src/www/pages/mc/components/templates/newsroom/index.njk b/src/www/pages/mc/components/templates/newsroom/index.njk new file mode 100644 index 00000000..6540a5ae --- /dev/null +++ b/src/www/pages/mc/components/templates/newsroom/index.njk @@ -0,0 +1,100 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="News" %} {% set section = "Templates" %} +{# Imports #} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/patterns/search/search-bar/_search-bar.njk" import wmcadsSearchbar %} +{% from "wmcads/patterns/search/search-filter/_search-filter.njk" import wmcadsSearchFilter %} +{% from "wmcads/patterns/search/sort/_sort.njk" import wmcadsSearchSort %} +{% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} +{% from "wmcads/components/breadcrumb/_breadcrumb.njk" import wmcadsBreadcrumb %} +{% from "wmcads/patterns/search/search-result/_search-result.njk" import wmcadsSearchResult %} + +{# Set array of tiles #} +{% block content %} + +
+
+

News

+
+ {{wmcadsSearchbar({ + placeHolder: "News search..." + })}} +
+
+
+
+
+

Found 20 matching results

+ {{wmcadsSearchResult( + { + pageTitle: "New transport system will be sprinting for success at Commonwealth Games", + date: "Thursday 23 August 2018", + excerpt: "Top athletes are not the only ones aiming to be in peak condition for the 2022 Commonwealth Games in Birmingham – the region’s transport system is also..." + } + )}} + {{wmcadsSearchResult( + { + pageTitle: "Mayor tells business leaders why the West Midlands should be seen as a leading net zero region", + date: "Thursday 23 August 2018", + excerpt: "Mayor of the West Midlands Andy Street has told a cross-sector audience of local decision makers why the West Midlands should be seen as one of the UK’s leading regions in supporting the race to net zero." + } + )}} + {{wmcadsSearchResult( + { + pageTitle: "First of the new generation of bus shelters unveiled as work continues on the Sprint rapid bus route", + date: "Thursday 23 August 2018", + excerpt: "The first of a new generation of bus shelters has been unveiled in Perry Barr, Birmingham ready for the introduction of the Sprint rapid bus route next year." + } + )}} + {{wmcadsSearchResult( + { + pageTitle: "First of the new generation of bus shelters unveiled as work continues on the Sprint rapid bus route", + date: "Thursday 23 August 2018", + excerpt: "The first of a new generation of bus shelters has been unveiled in Perry Barr, Birmingham ready for the introduction of the Sprint rapid bus route next year." + } + )}} + {{wmcadsSearchResult( + { + pageTitle: "First of the new generation of bus shelters unveiled as work continues on the Sprint rapid bus route", + date: "Thursday 23 August 2018", + excerpt: "The first of a new generation of bus shelters has been unveiled in Perry Barr, Birmingham ready for the introduction of the Sprint rapid bus route next year." + } + )}} + + {{wmcadsPagination({ + pageCount: 6, + activePage: 1 + })}} +
+ +
+
+
+{% endblock %} diff --git a/src/www/pages/mc/components/templates/newsroom/newsroom.scss b/src/www/pages/mc/components/templates/newsroom/newsroom.scss new file mode 100644 index 00000000..5bf93908 --- /dev/null +++ b/src/www/pages/mc/components/templates/newsroom/newsroom.scss @@ -0,0 +1,40 @@ +.template-newsroom { + .ds-grid { + @media screen and (max-width: $breakpoint-md) { + flex-direction: column-reverse; + } + } + + .ds-p-r-xl { + @media screen and (max-width: $breakpoint-md) { + padding: 0; + } + } + + .ds-hide-mobile { + @media screen and (max-width: $breakpoint-sm) { + display: none; + } + } + + .ds-search-sort { + @media screen and (max-width: $breakpoint-sm) { + margin-top: $size-md; + } + } + + aside { + @media screen and (max-width: $breakpoint-md) { + display: flex !important; + flex-direction: column-reverse; + } + + .ds-search-sort { + @media screen and (max-width: $breakpoint-md) { + margin-top: $size-lg; + padding-top: $size-lg; + border-top: 1px solid get-color(brandCoolGrey); + } + } + } +} diff --git a/src/www/pages/mc/components/templates/newsroom/search-template.js b/src/www/pages/mc/components/templates/newsroom/search-template.js new file mode 100644 index 00000000..620deaa9 --- /dev/null +++ b/src/www/pages/mc/components/templates/newsroom/search-template.js @@ -0,0 +1,58 @@ +const searchFilterJs = () => { + const showBtn = document.getElementById('show_filter_btn'); + const hideBtn = document.getElementById('hide_filter_btn'); + const showResults = document.getElementById('show_results_btn'); + const searchFilter = document.getElementById('search_filter'); + + if (searchFilter) { + const filterOptions = searchFilter.querySelectorAll('.ds-fe-checkboxes__input'); + + filterOptions.forEach(option => { + option.addEventListener('change', () => { + if ([...filterOptions].some(input => input.checked)) { + searchFilter.classList.add('ds-search-filter--has-inputs-checked'); + } else { + searchFilter.classList.remove('ds-search-filter--has-inputs-checked'); + } + }); + }); + + const showFilter = (show = true) => { + if (show) { + searchFilter.classList.add('ds-search-filter--is-open'); + searchFilter.setAttribute('aria-expanded', 'true'); + } else { + searchFilter.classList.remove('ds-search-filter--is-open'); + searchFilter.setAttribute('aria-expanded', 'false'); + } + }; + + const clearFilters = () => { + filterOptions.forEach(option => { + option.checked = false; // eslint-disable-line no-param-reassign + }); + searchFilter.classList.remove('ds-search-filter--has-inputs-checked'); + }; + + showBtn.addEventListener('click', e => { + e.preventDefault(); + showFilter(); + }); + + hideBtn.addEventListener('click', e => { + e.preventDefault(); + showFilter(false); + }); + + document.querySelectorAll('.ds-search-filter__clear-all').forEach(clearBtn => { + clearBtn.addEventListener('click', e => { + e.preventDefault(); + clearFilters(); + }); + }); + + showResults.addEventListener('click', () => showFilter(false)); + } +}; + +export default searchFilterJs; diff --git a/src/www/pages/mc/components/templates/search/index.njk b/src/www/pages/mc/components/templates/search/index.njk new file mode 100644 index 00000000..33a2f22f --- /dev/null +++ b/src/www/pages/mc/components/templates/search/index.njk @@ -0,0 +1,103 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Search" %} {% set section = "Templates" %} +{# Imports #} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/patterns/search/search-bar/_search-bar.njk" import wmcadsSearchbar %} +{% from "wmcads/patterns/search/search-filter/_search-filter.njk" import wmcadsSearchFilter %} +{% from "wmcads/patterns/search/sort/_sort.njk" import wmcadsSearchSort %} +{% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} +{% from "wmcads/components/breadcrumb/_breadcrumb.njk" import wmcadsBreadcrumb %} +{% from "wmcads/patterns/search/search-result/_search-result.njk" import wmcadsSearchResult %} + +{# Set array of tiles #} +{% block content %} + + +{% endblock %} diff --git a/src/www/pages/mc/components/templates/search/search-template.js b/src/www/pages/mc/components/templates/search/search-template.js new file mode 100644 index 00000000..620deaa9 --- /dev/null +++ b/src/www/pages/mc/components/templates/search/search-template.js @@ -0,0 +1,58 @@ +const searchFilterJs = () => { + const showBtn = document.getElementById('show_filter_btn'); + const hideBtn = document.getElementById('hide_filter_btn'); + const showResults = document.getElementById('show_results_btn'); + const searchFilter = document.getElementById('search_filter'); + + if (searchFilter) { + const filterOptions = searchFilter.querySelectorAll('.ds-fe-checkboxes__input'); + + filterOptions.forEach(option => { + option.addEventListener('change', () => { + if ([...filterOptions].some(input => input.checked)) { + searchFilter.classList.add('ds-search-filter--has-inputs-checked'); + } else { + searchFilter.classList.remove('ds-search-filter--has-inputs-checked'); + } + }); + }); + + const showFilter = (show = true) => { + if (show) { + searchFilter.classList.add('ds-search-filter--is-open'); + searchFilter.setAttribute('aria-expanded', 'true'); + } else { + searchFilter.classList.remove('ds-search-filter--is-open'); + searchFilter.setAttribute('aria-expanded', 'false'); + } + }; + + const clearFilters = () => { + filterOptions.forEach(option => { + option.checked = false; // eslint-disable-line no-param-reassign + }); + searchFilter.classList.remove('ds-search-filter--has-inputs-checked'); + }; + + showBtn.addEventListener('click', e => { + e.preventDefault(); + showFilter(); + }); + + hideBtn.addEventListener('click', e => { + e.preventDefault(); + showFilter(false); + }); + + document.querySelectorAll('.ds-search-filter__clear-all').forEach(clearBtn => { + clearBtn.addEventListener('click', e => { + e.preventDefault(); + clearFilters(); + }); + }); + + showResults.addEventListener('click', () => showFilter(false)); + } +}; + +export default searchFilterJs; diff --git a/src/www/pages/mc/components/templates/search/search.scss b/src/www/pages/mc/components/templates/search/search.scss new file mode 100644 index 00000000..a400b0f4 --- /dev/null +++ b/src/www/pages/mc/components/templates/search/search.scss @@ -0,0 +1,40 @@ +.template-search { + .ds-grid { + @media screen and (max-width: $breakpoint-md) { + flex-direction: column-reverse; + } + } + + .ds-p-r-xl { + @media screen and (max-width: $breakpoint-md) { + padding: 0; + } + } + + .ds-hide-mobile { + @media screen and (max-width: $breakpoint-sm) { + display: none; + } + } + + .ds-search-sort { + @media screen and (max-width: $breakpoint-sm) { + margin-top: $size-md; + } + } + + aside { + @media screen and (max-width: $breakpoint-md) { + display: flex !important; + flex-direction: column-reverse; + } + + .ds-search-sort { + @media screen and (max-width: $breakpoint-md) { + margin-top: $size-lg; + padding-top: $size-lg; + border-top: 1px solid get-color(brandCoolGrey); + } + } + } +} diff --git a/src/www/pages/mc/components/templates/templates.scss b/src/www/pages/mc/components/templates/templates.scss new file mode 100644 index 00000000..8d50b22b --- /dev/null +++ b/src/www/pages/mc/components/templates/templates.scss @@ -0,0 +1,16 @@ +// Vars +@import "../../../wmcads/assets/sass/vars"; + +// Mixins +@import "../../../wmcads/assets/sass/mixins"; + +// General styles +@import "general"; + +// Template specific styles +@import "homepage/homepage"; // Homepage +@import "campaign-one-column/campaign-template"; // Campaign page +@import "content-one-column/content-template"; // Content page +@import "content-two-columns/content-template"; // Content page +@import "search/search"; // Search page +@import "newsroom/newsroom"; // Newsroom Search page diff --git a/src/www/pages/mc/index.njk b/src/www/pages/mc/index.njk index 3582c2ca..ff17855c 100755 --- a/src/www/pages/mc/index.njk +++ b/src/www/pages/mc/index.njk @@ -64,7 +64,7 @@ copy: "

Make your service look and feel like WMCA: colours, icons, typography and utility classes

", smallTitle: true, readMore: true, - link: '/styles/', + link: '/mc/styles/', linkText: 'Read more about styles', linkTitle: 'Styles' }) @@ -79,7 +79,7 @@ copy: "

Reusable parts of the user interface: content, map and form elements; buttons and messages

", smallTitle: true, readMore: true, - link: '/components/', + link: '/mc/components/', linkText: 'Read more about components', linkTitle: 'Components' }) @@ -94,7 +94,7 @@ copy: "

Commonly used sets of components

", smallTitle: true, readMore: true, - link: '/patterns/', + link: '/mc/patterns/', linkText: 'Read more about patterns', linkTitle: 'Patterns' }) @@ -109,7 +109,7 @@ copy: "

Example template layouts

", smallTitle: true, readMore: true, - link: '/templates/', + link: '/mc/templates/', linkText: 'Read more about templates', linkTitle: 'Templates' }) diff --git a/src/www/pages/mc/patterns/autocomplete/index.njk b/src/www/pages/mc/patterns/autocomplete/index.njk new file mode 100644 index 00000000..0f829eb8 --- /dev/null +++ b/src/www/pages/mc/patterns/autocomplete/index.njk @@ -0,0 +1,135 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Autocomplete" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/autocomplete/_autocomplete.njk" import wmcadsAutocomplete %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+

+ The autocomplete component is an input field that offers the user text suggestions as they type.
+ This is often done by hitting an API endpoint with the users query when the user has finished typing. +

+

+ The autocomplete pattern is a combination of the input and loader components. +

+{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ + +


+{# Default #} +

Default state

+

In its default state, the autcomplete component is made up of a text input with a search icon.

+

For best practice, ensure that the placeholder and aria-label describes what the autocompletes intended purpose is.

+

Notice that there is also a ds-loader component nested within the autocomplete, more on that in the next section.

+{{ + compExample([ + wmcadsAutocomplete({ + id: "autoComplete", + query: '' + }) + ]) | trim +}} + + +

+{# Loading #} +

Loading

+

+ When a user types in a query, you may want to have some code that hits an API or gets the data/suggestions for the autocomplete from somewhere. To help users understand that they need to wait for something we can change the autocomplete to a loading state. + We do this by adding the class ds--is-loading to the top level of the autocomplete (this is the only difference between the loading state and default state code snippets). +

+

As mentioned in the previous section, there is a ds-loader component nested in the autocomplete.
When adding the ds--is-loading class, it will hide the search icon and show the loading spinner in it's place.

+

Below is an example of how the autocomplete looks when a user has typed in 'My query' and is waiting for autocomplete suggestions to load.

+ +

It is good practice to:

+ +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteQuery", + query: 'My query', + loading: true + }) + ]) | trim +}} + + +

+{# Results #} +

Suggestions

+

The final state of the autocomplete is showing the suggestions.

+

You'll notice there is a new section in the code snippet called ds-autocomplete-suggestions, this should be shown/visible when your API/data has loaded the suggestions.

+

It's good practice to:

+ + +

Default (text)

+

The most commonly used suggestions will be displayed as text only.

+

+ It is good practice to: +

+ + +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteSuggestions", + showSuggestions: true, + textSuggestions: true, + query: 'My query' + }) + ]) | trim +}} + +{# With disruption indicator #} +

With disruption indicator

+

+ This autocomplete is combined with the medium / normal - disruption indicator component. +

+

You will notice that the suggestions are much bigger than text only results, and have an overflow scrollbar. This scrollbar will appear if the height of the suggestion container goes over a certain height.

+

+ As you can see from the code snippet, the main ds-autocomplete-suggestions and ds-autocomplete-suggestions__li classes are prevelant on the ul and li elements. Within the li element we have nested the disruption indicator component whilst also using the wmcads grid. This gives enough flexibility to style the suggestions to how we want, find out more in the next section. +

+{{ + compExample([ + wmcadsAutocomplete({ + showSuggestions: true, + query: 'x15' + }) + ]) | trim +}} + +

Customising suggestions

+

There are many ways in which you can show the suggestions, as the autocomplete component has been built in a way that the suggestion results can be custom styled to how you like.

+

+ As long as you have the ul element with the class ds-autocomplete-suggestions which contains a direct child li element that has the class ds-autocomplete-suggestions__li then you can fully customise how you want the suggestions to look. +

+ +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/patterns/banner/index.njk b/src/www/pages/mc/patterns/banner/index.njk new file mode 100644 index 00000000..f7eee3ec --- /dev/null +++ b/src/www/pages/mc/patterns/banner/index.njk @@ -0,0 +1,273 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Banner" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/banner/_banner.njk" import wmcadsBanner %} + +{% block content %} + +{% markdown %} + +## Normal + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentHTML: "This is a new service - your feedback will help us to improve it." + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Banner with phase indicator #} + +## With phase indicator + +{# What #} + +### What does it do? + +- Helps users to identify when a service is new +- Offers users the opportunity to give feedback about a new service + {# When to #} + +### When to use it? + +- When a service is new + +{# When not to #} + +### When not to use it? + +- On a service that has matured and has a steadily positive rate of satisfaction + +{# How #} + +### How it works + +- A service can be in Alpha (prototype stage) or Beta (when it is on a publicly-accessible website) +- The survey link must point to a Hotjar or service feedback survey, with the service name within the URL. For example, /?serviceName=descriptiveName. + A service can either be in Alpha (prototype stage) or Beta (when it is on a publicly accessible website). + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + phase: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Emergency banner #} + +## Emergency banner + +{# What #} + +

What does it do

+ +- It communicates emergency information and provides advice on what to do. +- When an emergency is no longer relevant, the content will be archived or removed. + +{# When to #} + +

When to use it?

+ +- When you need to communicate information that is urgent or critical, which will potentially affect a large group of our users. For example, if there is an emergency situation announced in Birmingham, the banner would advise all users on travel updates and guidance. +- The emergency banner should be placed directly below the main navigation. +- Only show one emergency banner notification at a time. + +{# When not to #} + +

When not to use it?

+ +- When a warning or emergency is directly related to a task the user is completing. In this case, use the appropriate Message component to notify users of any issues. +- If the issue is related to a service we are providing such as our customer service, you should place the Warning text and Inset text components next to the affected service, detailing the issue. +- Any disruptions to travel will be highlighted on the home page through the Disruption indicator components. + +{# How #} + +

How it works

+ +- The user can dismiss the Emergency banner through the 'Close' link. This will remove the current emergency banner from all pages they visit on the website. +- The On-page variant is only shown when a user is on the Emergency advice page, which can be accessed through the 'Read our latest advice' link. + +{# Sitewide #} + +### Sitewide + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} +{# On-page #} + +### On-page variant + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true, + onPage: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} +{% markdown %} + +{# Hub page banner #} + +## Hub page banner + +{# What #} + +

What does it do?

+ +- Helps users to identify they have eventered a Hub section of the website +- Provides users with a short description of the chosen hub of the WMCA + +{# When #} + +

When to use it?

+ +- Only on Hub Landing Pages + +

When not to use it?

+ +- On pages where the content is not related to a hub overview + +

How it works

+ +- The image container width will expand if users are viewing the page with a browser width higher than 1280px. +- The image within the container will zoom to fill the size of the image container. +- The image will be hidden on mobile devices. Our previous research found mobile users do not see the value of images on mobile pages. +- The image, optional logo or icon will change for each hub landing page. + +{% endmarkdown %} + +{% from "wmcads/patterns/hub-page-banner/_hub-page-banner.njk" import wmcadsHubPageBanner %} + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using a short description" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using an example brand logo with a longer text description", + logo: true + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{{ + compExample([ + wmcadsHubPageBanner({ + title: "Hub Header with a longer example title" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} + +{# Homepage banner #} + +## Homepage + +{# What #} + +

What does it do?

+ +- Provides a complementary image associated with the West Midlands +- Highlights a welcome message for visitors of the West Midlands Combined Authority site + +{# When #} + +

When to use it?

+ +- On the homepage + +

When not to use it?

+ +- Regular content pages + +{% endmarkdown %} + +{% from "wmcads/patterns/banner/homepage-banner/_homepage-banner.njk" import wmcadsHomepageBanner %} + +{{ + compExample([ + wmcadsHomepageBanner() + ], { + componentPath: "wmcads/patterns/banner/homepage-banner/", + njk: true, + njkProps: wmcadsHomepageBannerProps + }) +}} + +{% endblock %} diff --git a/src/www/pages/mc/patterns/board-members/index.njk b/src/www/pages/mc/patterns/board-members/index.njk new file mode 100644 index 00000000..2072efcb --- /dev/null +++ b/src/www/pages/mc/patterns/board-members/index.njk @@ -0,0 +1,22 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Board Members" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/board-members/_board-members.njk" import wmcadsBoardMembers %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# Board members #} +

Board Members

+ +{{ + compExample([ + wmcadsBoardMembers({ + + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/patterns/contact-details/index.njk b/src/www/pages/mc/patterns/contact-details/index.njk new file mode 100644 index 00000000..3299dd2b --- /dev/null +++ b/src/www/pages/mc/patterns/contact-details/index.njk @@ -0,0 +1,111 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Contact details" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/contact-details/_contact-details.njk" import wmcadsContactDetails %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

About

+ {# What #} +

What does it do?

+ + {# When #} +

When to use it?

+ + {# When not #} +

When not to use it?

+ + {# How it works #} +

How it works?

+ +

+ GOV.UK has detailed information about how to display contact details. +

+ + +

Contact Details - Address

+ + {{ + compExample([ + wmcadsInsetText( + { + thinner : true, + html: "Customer Services
Transport for West Midlands
16 Summer Lane
Birmingham
B19 3SD" + } + ) + ]) + }} + + +

Contact Details - Template

+ + {{ + compExample([ + wmcadsInsetText({html: + wmcadsContactDetails({ + warningText: "We are currently experiencing problems with our
telephone systems and cannot answer calls", + warningIcon: "general-warning-triangle", + content: " + customerservice@tfwm.org.uk
+ Telephone: 0345 303 6760
+ Monday to Tuesday and Thursday to Friday, 9am - 5pm,
+ Wednesday, 9.30am - 5pm" + }) | indent(6) | trim + }) + ]) + }} + + + +

Contact Details - Template TfWM

+ + {{ + compExample([ + wmcadsInsetText({ + html: " +

Transport for West Midlands

+

+ Twitter
+ Facebook
+

+

+ Submit an enquiry
+ Telephone: 0345 303 6760
+

+ Monday to Tuesday and Thursday to Friday, 9am - 5pm,
+ Wednesday, 9.30am - 5pm
+ Saturday and Sunday, closed + " + }) + ]) + }} + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/patterns/content-cards/index.njk b/src/www/pages/mc/patterns/content-cards/index.njk new file mode 100644 index 00000000..26a61062 --- /dev/null +++ b/src/www/pages/mc/patterns/content-cards/index.njk @@ -0,0 +1,236 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Content cards" %} +{% set section="Patterns" %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

About

+

These are common applications of the content card component.

+
+ +

+{# Map card #} +

Map card

+{# What #} +

What is it?

+ + +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +{# Map example #} +{% from "wmcads/patterns/content-cards/map/_map.njk" import wmcadsContentCardMap %} + +{{ + compExample([ + wmcadsContentCardMap() + ]) +}} + +

+{# Travel update card #} +

Travel update card

+{# What #} +

What is it?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +{# Set up travel updates #} +{% from "wmcads/patterns/content-cards/travel-updates/_travel-updates.njk" import wmcadsContentCardTravelUpdates %} + +{{ + compExample([ + wmcadsContentCardTravelUpdates() + ]) +}} + +

+{# Button card #} +

Button card

+{# What #} +

What is it?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +{# Set up buttons #} +{% from "wmcads/patterns/content-cards/buttons/_buttons.njk" import wmcadsContentCardButtons %} + +{{ + compExample([ + wmcadsContentCardButtons() + ]) +}} + +

+{# Image card #} +

Image card

+{# What #} +

What is it?

+ +{# When to #} +

When to use it?

+ +{# When to to #} +

When not to use it?

+ + +{# Set up image #} +{% from "wmcads/patterns/content-cards/image/_image.njk" import wmcadsContentCardImage %} + +{{ + compExample([ + wmcadsContentCardImage() + ]) +}} + +

+{# In-line navigation card #} +

In-line navigation card

+{# What #} +

What is it?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# How to #} +

How to use it

+ + +{# Set up inline navigation #} +{% from "wmcads/patterns/content-cards/inline-navigation/_inline-navigation.njk" import wmcadsContentCardInlineNavigation %} + +{{ + compExample([ + wmcadsContentCardInlineNavigation() + ]) +}} + +{# With current page #} +

In-line navigation with current page

+ +{{ + compExample([ + wmcadsContentCardInlineNavigation({ + withCurrentPage: true + }) + ]) +}} + +

+{# Email sign up card #} +

Email sign up card

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +

When adding a sign up form from Campaign Monitor, you are provided with HTML markup, but make sure not to change any of the generated attributes except for classes.

+

They have been changed in the following examples to avoid accessibility errors.

+
+ +{# Set up email sign up #} +{% from "wmcads/patterns/content-cards/email-sign-up/_email-sign-up.njk" import wmcadsContentCardEmailSignUp %} + +{# Collapsed #} +

Collapsed

+

This is the default state for the email sign up card.

+ +{{ + compExample([ + wmcadsContentCardEmailSignUp({ exampleSuffix: "example-1"}) + ]) +}} + +{# Expanded #} +

Expanded

+

The collapsed card will expand when the 'continue' button is pressed/tapped.

+ +{{ + compExample([ + wmcadsContentCardEmailSignUp({ expanded: true, exampleSuffix: "example-2" }) + ]) +}} + +{# External link #} +

External link

+

Use this content card when you want to send users to an external Campaign Monitor form if you want to capture more user data such as demographics, travel habits etc.

+ +{{ + compExample([ + wmcadsContentCardEmailSignUp({ externalLink: true, exampleSuffix: "example-3" }) + ]) +}} +{% endblock %} diff --git a/src/www/pages/mc/patterns/cookies/index.njk b/src/www/pages/mc/patterns/cookies/index.njk new file mode 100644 index 00000000..68ce0201 --- /dev/null +++ b/src/www/pages/mc/patterns/cookies/index.njk @@ -0,0 +1,87 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} {% set pageTitle = "Cookies" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/cookies/cookies-banner/_cookies-banner.njk" import wmcadsCookiesBanner %} +{% from "wmcads/patterns/cookies/cookies-manager/_cookies-manager.njk" import wmcadsCookiesManager %} + +{% block content %} + +

About

+{# What #} +

What does it do?

+ +
+

+

Cookie banner

+{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# How #} +

How it works

+ +

The Cookies banner should be placed above the main header and be on every page

+ +{{ + compExample([ + wmcadsCookiesBanner() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: false + }) | trim }} + +

+

Manage Cookies

+{# When to #} +

When to use it?

+ + +{{ + compExample([ + wmcadsCookiesManager() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: true + }) | trim }} + +{% endblock %} diff --git a/src/www/pages/mc/patterns/feedback-loop/index.njk b/src/www/pages/mc/patterns/feedback-loop/index.njk new file mode 100644 index 00000000..7766f45c --- /dev/null +++ b/src/www/pages/mc/patterns/feedback-loop/index.njk @@ -0,0 +1,47 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Feedback loop" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/feedback-loop/_feedback-loop.njk" import wmcadsFeedbackLoop %} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +
+

+ +{{ + compExample([ + wmcadsFeedbackLoop({ + id: 'fb' + }) + ]) +}} + +

+

Open

+{{ + compExample([ + wmcadsFeedbackLoop({ + isOpen: true, + id: 'fb-open' + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/patterns/footer/index.njk b/src/www/pages/mc/patterns/footer/index.njk new file mode 100644 index 00000000..136237b8 --- /dev/null +++ b/src/www/pages/mc/patterns/footer/index.njk @@ -0,0 +1,156 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Footer" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ + +

+{# Full footer #} +

Full variant of footer

+

The full variant of the footer may include menus which become collapsible on smaller devices.

+

To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

+{{ + compExample([ + wmcadsFooter({ + columns: 3, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +

+

2 Column Variant

+ +{{ + compExample([ + wmcadsFooter({ + columns: 2, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + })], + { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
+ + +{# Mobile app variant #} + +

When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the Transport for West Midlands footer.

+ +

The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

+ +

To use the mobile app variant:

+ + +

+ You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

+ +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/patterns/header-and-footer/index.njk b/src/www/pages/mc/patterns/header-and-footer/index.njk new file mode 100644 index 00000000..8e42881b --- /dev/null +++ b/src/www/pages/mc/patterns/header-and-footer/index.njk @@ -0,0 +1,212 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header and footer" %} +{% set section="Patterns" %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +
+

+ + + +{# Header #} +

Header

+{# Skip Link #} +

Skip link

+

There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

+

Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

+{# Logo #} +

Logo

+

This must always be the West Midlands Combined Authority logo.

+{# Phase indicator #} +

Phase indicator

+

This component must be used if the service is not live, using the phase indicator guidance.

+{# Navigation #} +

Navigation

+

The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

+

The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

+

We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

+{# Mobile apps #} +

Mobile apps

+

When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

+{# Search #} +

Search

+

This functionality only shows for desktop and tablet users. When clicked, search expands and takes over the whole page.

+ +{{ + compExample([ + wmcadsHeader ({ + id: "mega-menu", + navItems: navItems, + banner: true, + linkTopLevel: true, + search: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + } + }) + ]) +}} + +{# With title variant #} +

With a title variant of header

+

When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

+ +

To use the title variant:

+ + + +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + withTitle: true, + id: "basic" + }) + ]) +}} + + +{# Mobile app variant #} +

Mobile app variant of header

+

When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority header.

+ +

To use the mobile app variant:

+ + +

+ You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'footer pattern', + link: '#mobile-app-footer' + }) + }} . +

+ +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + app: true, + exampleAria: "Mobile app header" + }) + ]) +}} + +

+ + +{# Full footer #} +

Full variant of footer

+

The full variant of the footer may include menus which become collapsible on smaller devices.

+

To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

+{{ + compExample([ + wmcadsFooter({ + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About West Midlands Combined Authority" + }, { + name: "WMCA Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
+ + +{# Mobile app variant #} + +

When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority footer.

+ +

The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

+ +

To use the mobile app variant:

+ + +

+ You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

+ +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/patterns/header-demo/index.njk b/src/www/pages/mc/patterns/header-demo/index.njk new file mode 100644 index 00000000..c32de977 --- /dev/null +++ b/src/www/pages/mc/patterns/header-demo/index.njk @@ -0,0 +1,220 @@ + + + + {% include "www/_partials/_head.njk" %} + + + + + + {# header #} + {% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} + {{ + wmcadsHeader({ + id: "mega-menu-example", + search: true, + searchSuggestions: ["See live departures", "Find a timetable", "Check for disruptions", "Manage my Swift card", "Find ticket prices", "Get a refund", "Update Direct Debit", "Apply for a 16-18 photocard"], + navItems: [{ + name: "Plan a journey", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Swift and tickets", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "Get help", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + }], + megaMenu: true + }) + }} + {# header #} + + + {# main #} +
+ Close window +
+ {# main #} + + + {% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} + {{ + wmcadsFooter({ + bottomMenu: [{ + name: "Privacy & Cookies Policy", + link: "https://www.wmca.org.uk/privacy-cookies-policy/" + }] + }) + }} + + + + {% include "www/_partials/_scripts.njk" %} + + + + diff --git a/src/www/pages/mc/patterns/header/index.njk b/src/www/pages/mc/patterns/header/index.njk new file mode 100644 index 00000000..423c907b --- /dev/null +++ b/src/www/pages/mc/patterns/header/index.njk @@ -0,0 +1,305 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/header-v2/_header-v2.njk" import wmcadsHeaderV2 %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/warning-text/_warning-text.njk" import wmcadsWarningText %} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ + + +{# Header #} +

Header

+{# Skip Link #} +

Skip link

+

There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

+

Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

+{# Logo #} +

Logo

+

This must always be the Transport for West Midlands logo.

+{# Phase indicator #} +

Phase indicator

+

This component must be used if the service is not live, using the phase indicator guidance.

+{# Navigation #} +

Navigation

+

The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

+

The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

+

We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

+{# Mobile apps #} +

Mobile apps

+

When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

+{# Search #} +

Search

+

This function expands the mega menu and reveals the search bar along with the ‘I want to…’ feature.

+

The ‘I want to...’ feature shows a list of the top page links which users access through search. This is to help users find the information they are searching for faster. These links are regularly updated using search data to maintain their relevance.

+

On mobile, the mega menu search function uses a primary purple background instead of the standard white background. Our user testing found users preferred the white link text on the primary purple background as it is clearer to read.

+ +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example-full", + navItems: [{ + name: "Styles" + },{ + name: "Components" + },{ + name: "Patterns" + },{ + name: "User research" + }], + banner: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + }, + exampleAria: "Full header", + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With mega menu #} +

Mega menu with search example

+ +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example", + search: true, + placeholder: "fg", + brand: "wmca", + navItems: [{ + name: "The Mayor", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Who we are", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "What we do", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + },{ + name: "In my area" + },{ + name: "Contact us" + }], + megaMenu: true, + megaMenuDemo: true + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With title variant #} +

With a title variant of header

+

When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

+ +

To use the title variant:

+ + + +{{ + compExample([ + wmcadsHeaderV2({ + withTitle: true, + legacyMenu: true, + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +

+ +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/patterns/index.njk b/src/www/pages/mc/patterns/index.njk new file mode 100644 index 00000000..55ff4044 --- /dev/null +++ b/src/www/pages/mc/patterns/index.njk @@ -0,0 +1,16 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Patterns" %} +{% set section = "Patterns" %} +{% set ds = 'mc' %} + +{% block content %} +

Patterns are reusable parts of the user interface that have been made to support a variety of + applications.

+ +

Individual patterns can be used in multiple different patterns and contexts. For example, the + text input component + can be used to ask for an email address, a National Insurance number or someone’s name.

+

If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples provided + will render exactly as they do inside the Design System.

+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/patterns/question-form/index.njk b/src/www/pages/mc/patterns/question-form/index.njk new file mode 100644 index 00000000..495871f1 --- /dev/null +++ b/src/www/pages/mc/patterns/question-form/index.njk @@ -0,0 +1,127 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Question form" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ +

How it works?

+ + + +

+ {# Form Element #} +

Form Element

+

This pattern can be populated with any form element, such as text, radio buttons, checkboxes, dropdown or file upload.

+ {% from "wmcads/patterns/question/form-element/_form-element.njk" import wmcadsFormElement %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsFormElement({ + text: "Question title", + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Form Element #} + + +

+ {# Reference #} +

Reference

+

This pattern shows a question that shows defined steps and uses the backlink and progress indicator component.

+ {% from "wmcads/patterns/question/reference/_reference.njk" import wmcadsReference %} + {% from "wmcads/components/form-elements/input/_input.njk" import wmcadsInput %} + {{ + compExample([ + wmcadsReference({ + question: "What is your Direct Debit Reference?", + text: "

This can be found in the email we sent you asking you to reinstate your Direct Debit and begins with a 6.

If you didn’t receive this email, it is shown next to every payment to WMCA for your Direct Debit on your bank statement.

", + actualSection: "1", + totalSections: "3", + sectionName: "About your ticket", + fields: + wmcadsInput({ + label: "Direct Debit Reference", + classNames: "ds-col-1-2" + }) , + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Reference #} + + +

+ {# Summary #} +

Summary

+

This shows the user all of the data they have entered before they submit the form. This stage allows the user to change any details before submitting the form.

+ {% from "wmcads/patterns/question/summary/_summary.njk" import wmcadsSummary %} + {% from "wmcads/components/table/_table.njk" import wmcadsTable %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsSummary({ + question: "Check your answers before reinstating your Direct Debit", + html: +"

Now send your request

+

By submitting this request you are confirming that, to the best of your knowledge, the details you are providing are correct.
+
You consent to West Midlands Combined Authority possibly changing your Direct Debit date if it usually would occur in the next 10 days.
+
You also consent to West Midlands Combined Authority reinstating your Direct Debit instruction.

", + button: + wmcadsButton({ + classNames: "ds-btn--start", + text: "Accept & Send ", + iconRight: "general-chevron-right" + }) + }) + + ]) + }} + {# End Summary #} + + +

+ {# Confirmation Message #} +

Confirmation Message

+

This is a confirmation message to show that the user has successfully submitted the data in the form, along with a reference or any information which the user needs to be made aware of.

+ {% from "wmcads/patterns/question/confirmation-message/_confirmation-message.njk" import wmcadsConfirmationMessage %} + {{ + compExample([ + wmcadsConfirmationMessage() | indent(4) | trim + ]) + }} + {# End Confirmation Message #} + +{% endblock %} diff --git a/src/www/pages/mc/patterns/search/index.njk b/src/www/pages/mc/patterns/search/index.njk new file mode 100644 index 00000000..01d64df5 --- /dev/null +++ b/src/www/pages/mc/patterns/search/index.njk @@ -0,0 +1,147 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Search" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

What does it do?

+ +

When to use it?

+ +

How it works

+ + +

+ {# Search bar #} +

Search bar

+ {% from "wmcads/patterns/search/search-bar/_search-bar.njk" import wmcadsSearchbar %} + {{ + compExample([ + wmcadsSearchbar() + ]) + }} + {# End Search bar #} + + +

+ {# Sort #} +

Sort

+

What does it do?

+ + {% from "wmcads/patterns/search/sort/_sort.njk" import wmcadsSearchSort %} + {{ + compExample([ + wmcadsSearchSort() + ]) + }} + {# End sort #} + +

+ {# Search filter #} +

Filter

+

What does it do?

+ +

When to use it?

+ + {% from "wmcads/patterns/search/search-filter/_search-filter.njk" import wmcadsSearchFilter %} + {{ + compExample([ + wmcadsSearchFilter( + { + accordion: [{ + summaryTitle: "Topic", + options: [ + "Tickets", "Travel advice", "Planning a journey" + ] + }, + { + summaryTitle: "Page type", + options: [ + "Services", "News", "Bus routes", "Timetables", "Offers and promotions" + ] + } + ]} + ) + ], { + componentPath: "wmcads/patterns/search/search-filter/", + njk: false, + js: true, + iframe: false + }) + }} + + {# End search filter #} +

+ {# Search result #} +

Search result

+

What does it do?

+ +

How it works

+ + {% from "wmcads/patterns/search/search-result/_search-result.njk" import wmcadsSearchResult %} + {{ + compExample([ + wmcadsSearchResult( + { + pageTitle: "Swift: The smarter way to travel", + breadcrumbs: ['Home', 'Swift'], + excerpt: "Swift is the easy and flexible way to travel around the West Midlands. find the swift card for you. How do you travel? bus…" + } + ) + ]) + }} + {# End search result #} +

+ {# Pagination #} +

Pagination links

+

What does it do?

+ + {% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} + {{ + compExample([ + wmcadsPagination({ + pageCount: 8, + activePage: 1 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 5 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 8 + }) + ]) + }} + {# End pagination #} +

+ +{% endblock %} diff --git a/src/www/pages/mc/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js b/src/www/pages/mc/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js new file mode 100644 index 00000000..8371607f --- /dev/null +++ b/src/www/pages/mc/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js @@ -0,0 +1,71 @@ +function aToZContentStyleGuide() { + // FUNCTIONS + // Change accordion state + const changeAccordionState = (accordionElem, changeStateToOpen = true) => { + const accordionBtn = accordionElem.querySelector('.ds-accordion__summary-wrapper'); + if (changeStateToOpen) { + accordionElem.classList.add('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', true); + } else { + accordionElem.classList.remove('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', false); + } + }; + + // Change all accordion states at once + const changeAllAccordionStates = changeStateToOpen => { + const accordions = document.querySelectorAll('main .ds-accordion'); + accordions.forEach(accordion => changeAccordionState(accordion, changeStateToOpen)); + }; + + // Scroll to an anchor within an accordion + const scrollToAnchor = idWithHash => { + // Check if element is on the page + const elem = document.querySelector(idWithHash); + if (!elem || elem.classList.contains('ds-accordion__summary-wrapper')) { + return; + } + // Open accordion and scroll to element + changeAccordionState(elem.parentElement.parentElement); + elem.scrollIntoView(); + }; + + // Check for anchor to scroll to onload + const scrollToAnchorOnLoad = () => { + if (document.location.hash) { + scrollToAnchor(document.location.hash); + } + }; + + // Add event listener to all section links on the page + const setupScrollToAnchor = () => { + const anchors = document.querySelectorAll('main a[href^="#"]:not([href="#"])'); + // Loop through an add event listener + anchors.forEach(anchor => { + anchor.addEventListener('click', e => { + e.preventDefault(); + scrollToAnchor(anchor.hash); + }); + }); + }; + + // Set up controls + const setupAccordionControls = () => { + const controls = document.querySelectorAll('main .js-accordion-controls button'); + + controls.forEach(control => { + control.addEventListener('click', () => { + changeAllAccordionStates(control.classList.contains('js-accordion-controls-open')); + }); + }); + }; + + // CALL FUNCTIONS + if (document.querySelector('#atozofstyle')) { + scrollToAnchorOnLoad(); + setupScrollToAnchor(); + setupAccordionControls(); + } +} + +export default aToZContentStyleGuide; diff --git a/src/www/pages/mc/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json b/src/www/pages/mc/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json new file mode 100644 index 00000000..143a4f85 --- /dev/null +++ b/src/www/pages/mc/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json @@ -0,0 +1,538 @@ +{ + "aToZOfStyles": [ + { + "letter": "A", + "styles": [ + { + "title": "Abbreviations and acronyms", + "content": "

The first time you use an abbreviation or acronym explain it in full on each page unless it's well known, like UK or BBC. Then refer to it by initials.

Do not use full stops in abbreviations: BBC, not B.B.C.

If you only use a term once, you don't need to include the abbreviation afterwards.

Use 'm' (for millions) and 'bn' (for billions) for sums of money and measurable quantities: £10bn; 1bn litres of water. However, spell out for people and countable nouns: 3 billion commuters; 10 billion tickets.

Use lower case for standard measurements: kg; km; lb; mph but use upper case for KB; GB; MB.

Exception: Spell out metres to prevent confusion with abbreviation for million.

Note:

  1. Do not include a space between the number and the unit: 20km; 50kph; 100KB
  2. Never add an 's' to measurements: 20km, not 20kms

Use lower case for ie and eg, but avoid using these terms altogether where possible. Use 'that is' or 'for example' instead.

" + }, + { + "title": "Active voice", + "content": "

Use the active voice, not the passive voice - it’s easier to read. For example:

We’re going to get the train tomorrow (active voice)

A train is going to be caught by us tomorrow (passive voice)

" + }, + { + "title": "Addresses", + "content": "

Use the contact details design pattern. This shows you how to format addresses.

" + }, + { + "title": "Addressing the user", + "content": "

Address the user as 'you' wherever possible.

" + }, + { + "title": "Adult rate", + "content": "

Do not hyphenate.

" + }, + { + "title": "Ages", + "content": "

Do not use hyphens in ages unless to avoid confusion, although it's always best to write in a way that avoids ambiguity. For example, 'a class of 15 16-year-old students took the A level course' can be written as '15 students aged 16 took the A level course'.

Write ages like this: XX years old (for example, 66 years old).

Exception - use hyphens when talking about age groups:

" + }, + { + "title": "American and UK English", + "content": "

Use UK English spelling and grammar. For example, use 'organise' not 'organize', 'modelling' not 'modeling', and 'fill in a form', not 'fill out a form'.

American proper nouns, like 4th Mechanized Brigade or World Health Organization, take American English spelling.

" + }, + { + "title": "Ampersand", + "content": "

Use and rather than &, unless it's a department's logo image or a company's name as it appears on the Companies House register.

" + }, + { + "title": "Antisocial", + "content": "

Hyphenated.

" + }, + { + "title": "A-road", + "content": "

Hyphenated.

" + } + ] + }, + { + "letter": "B", + "styles": [ + { + "title": "Bacs (Bankers Automated Clearing System)", + "content": "

Use the acronym as it's more widely known than the full name. No need to include the full name in brackets.

" + }, + { + "title": "bold", + "content": "

Only use bold for instructions when you’re talking about an interactive service.

You can use bold to explain what field a user needs to fill in on a form, or what button they need to select. For example: \"Select Continue.\"

Use bold sparingly - using too much will make it difficult for users to know which parts of your content they need to pay the most attention to.

Do not use bold in other situations, for example to emphasise text.

To emphasise words or phrases, you can:

" + }, + { + "title": "bus station", + "content": "

Only use upper case if you're talking about a specific bus station: Dudley Bus Station, Coventry Pool Bus Station.

Use lower case if you're talking about bus stations in general: You can find bike racks at our bus stations.

" + }, + { + "title": "borough council", + "content": "

Lower case except in a name: Dudley Metropolitan Borough Council.

" + }, + { + "title": "Bullet points and numbered steps", + "content": "

You can use bullet points to make text easier to read. Make sure that:

Bullets should normally form a complete sentence following from the lead text. But it's sometimes necessary to add a short phrase to clarify whether all or some of the points apply. For example, 'You can only register a pension scheme that is (one of the following):'

The number and type of examples in a list may lead the user to believe the list is exhaustive. This can be dealt with by

Numbered steps

Use numbered steps instead of bullet points to guide a user through a process. List the things the user needs to do in order. You do not need a lead-in line. Steps end in a full stop because each should be a complete sentence.

" + } + ] + }, + { + "letter": "C", + "styles": [ + { + "title": "campaign/scheme names and brands", + "content": "

If you have a scheme or campaign brand, explain the brand. Don't expect users to understand what you mean. If you say ‘be aware and share’ or ‘get your roll and stroll on’ out of context, it’s not clear what that means.

Don’t capitalise slogans like ‘be aware and share’. If you’re talking about a specific brand or campaign, use capitals. For example, Workwise, PassProtect. Don’t tell people to ‘Be Aware and Share’, but do say ‘the Be Aware and Share’ campaign.

For example:

" + }, + { + "title": "cash fare", + "content": "Do not use - it's confusing. Say 'ticket bought on the bus, train or tram on the day' instead." + }, + { + "title": "Capitalisation", + "content": "

DO NOT USE BLOCK CAPITALS FOR LARGE AMOUNTS OF TEXT AS IT'S QUITE HARD TO READ.

Always use lower case, even in page titles. The exceptions to this are proper nouns.

" + }, + { + "title": "checkbox", + "content": "

Not \"check box\"

" + }, + { + "title": "child rate", + "content": "

Do not hyphenate.

" + }, + { + "title": "click", + "content": "

Don't use \"click\" when talking about user interfaces because not all users click. Use \"select\".

You can use \"right-click\" if the user needs to right-click to open up a list of options to progress through the user journey.

" + }, + { + "title": "collective nouns", + "content": "

Treat as singular, except staff and police: the committee has but the staff are; the police want.

A pair and a couple are both plural.

" + }, + { + "title": "concessionary", + "content": "

Try to avoid. Use these instead:

It’s okay to use concessionary if you’re talking about the English National Concessionary Travel Scheme.

" + }, + { + "title": "contact details", + "content": "

Use the contact details design pattern.

" + }, + { + "title": "contactless", + "content": "

Not Contactless.

" + }, + { + "title": "contractions", + "content": "

You can use contractions to help make your text less formal.

Avoid negative contractions like can't and don't. Many users find them harder to read, or misread them as the opposite of what they say. Use cannot instead of can't; do not instead of don’t.

Avoid should've, could've, would've, they've too. These can also be hard to read.

" + }, + { + "title": "co-operation", + "content": "

Hyphenated.

" + }, + { + "title": "coronavirus (COVID-19)", + "content": "

Coronavirus is the virus which causes the illness COVID-19. Coronavirus is lower case.

" + }, + { + "title": "council", + "content": "

Use lower case when writing about local councils in general. Use capitals for the official name of a local council, for example: Birmingham City Council.

" + }, + { + "title": "Council Tax", + "content": "

Upper case.

" + }, + { + "title": "customers", + "content": "

Refer to 'customers' rather than 'passengers'.

" + } + ] + }, + { + "letter": "D", + "styles": [ + { + "title": "Dates", + "content": "

Use 'to' instead of a dash or slash in date ranges. 'To' is quicker to read than a dash, and it's easier for screen readers.

Always explain what your date range represents, for example 'tax year 2013 to 2014' or 'September 2013 to July 2014'. Date ranges can be the academic year, calendar year or tax year. This is why date ranges must be very, very clear.

" + }, + { + "title": "daytime", + "content": "

But night-time.

" + }, + { + "title": "Direct Debit", + "content": "

Upper case.

" + }, + { + "title": "Direct Debit Instruction", + "content": "

Upper case.

" + }, + { + "title": "disabled access", + "content": "

Use this term when referring to disabled accessibility, as 'accessibility' has a wider meaning.

" + }, + { + "title": "disabled people", + "content": "

Not 'the disabled' or 'people with disabilities'.

Read GOV.UK advice on words to use and avoid when talking about disability.

" + }, + { + "title": "district council", + "content": "

Lower case even in a name, like Warwick district council.

" + } + ] + }, + { + "letter": "E", + "styles": [ + { + "title": "eg, etc and ie", + "content": "

eg can sometimes be read aloud as 'egg' by screen reading software. Instead use 'for example' or 'such as' or 'like' or 'including' - whichever works best in the specific context.

etc can usually be avoided. Try using 'for example' or 'such as' or 'like' or 'including'. Never use etc at the end of a list starting with these words.

ie - used to clarify a sentence - is not always well understood. Try (re)writing sentences to avoid the need to use it. If that is not possible, use an alternative such as 'meaning' or 'that is'.

" + }, + { + "title": "email", + "content": "

Not e-mail.

Always give the full email address when providing a hyperlink. For example, 'email ticketing@twfm.org.uk' not 'email the ticketing team'

" + } + ] + }, + { + "letter": "F", + "styles": [ + { + "title": "FAQs (frequently asked questions)", + "content": "

Do not use FAQs.

If you write content by starting with user needs, you will not need to use FAQs.

FAQs are discouraged because they:

" + }, + { + "title": "fine", + "content": "

Use 'fine' instead of 'financial penalty'.

For example, \"You'll pay a £50 fine.\"" + }, + { + "title": "first person", + "content": "

Use \"we'\" and \"us\" when addressing the user where possible. For example, instead of \"West Midlands Combined Authority has…\" say \"We have\" - it’s more personal.

" + }, + { + "title": "fire and rescue service", + "content": "

Lower case.

" + }, + { + "title": "focus", + "content": "

Focuses/focused/focusing. Not focusses/focussed/focussing.

" + } + ] + }, + { + "letter": "G", + "styles": [ + { + "title": "government", + "content": "

Lower case unless it's a full title. For example: 'UK government', but 'Her Majesty's Government of the United Kingdom of Great Britain and Northern Ireland'.

" + } + ] + }, + { + "letter": "H", + "styles": [ + { + "title": "Hyphenation", + "content": "

Hyphenate:

Do not hyphenate:

Do not use a hyphen unless it's confusing without it, for example, a little used-car is different from a little-used car. You can also refer to The Guardian style guide for advice on hyphenation.

Use 'to' for time and date ranges, not hyphens.

" + } + ] + }, + { + "letter": "I", + "styles": [ + { + "title": "ie", + "content": "

see eg, etc and ie

" + }, + { + "title": "Italics", + "content": "

Do not use italics. They can be hard to read online.

" + } + ] + }, + { + "letter": "J", + "styles": [ + { + "title": "job titles", + "content": "

Use upper case when referring to a specific role: Lord Mayor of Birmingham.

Use lower case if writing generally: service assistants, station managers.

" + }, + { + "title": "Journey Planner", + "content": "

Our travel tool that helps with live route-planning across our network

A stand-alone link to it should be action-led and first-person: 'Plan my journey'.

If giving instruction, it can be second-person (to avoid mixing perspectives): 'Plan your journey'.

If listing tools, we can use the product name: 'Journey Planner'.

" + } + ] + }, + { + "letter": "L", + "styles": [ + { + "title": "Links", + "content": "

Front-load your link text with the relevant terms and make them active and specific. Do not use ‘click here’. Use text that describes the link instead.

" + }, + { + "title": "Lists", + "content": "

Lists should be bulleted to make them easier to read. See bullets and steps.

Very long lists can be written as a paragraph with a lead-in sentence if it looks better: 'The following countries are in the EU: Spain, France, Italy...'

" + }, + { + "title": "log in", + "content": "

See sign in or log in.

" + } + ] + }, + { + "letter": "M", + "styles": [ + { + "title": "measurements", + "content": "

Use lower case for standard measurements: kg; km; mph; kph but use upper case for KB; GB; MB.

Spell out metres to prevent confusion with abbreviation for million.

Do not include a space between the number and the unit: 20km; 50mph; 100KB.

Never add an 's' to measurements: 20km, not 20kms.

" + }, + { + "title": "Metro", + "content": "

Only use when talking about the company that runs the tram - West Midlands Metro. To talk about the tram as a mode of transport, use tram, not Metro.

" + }, + { + "title": "money", + "content": "

Use the £ symbol: £75.

Do not use decimals unless pence are included: £75.50 but not £75.00.

Do not use '£0.xx million' for amounts less than £1 million.

Write out pence in full: calls will cost 4 pence per minute from a landline.

Currencies are lower case.

" + } + ] + }, + { + "letter": "N", + "styles": [ + { + "title": "nBus", + "content": "

Use when talking about network bus tickets - always use a lower case ‘n’, upper case ‘B’.

" + }, + { + "title": "nNetwork", + "content": "

Use when talking about network tickets for the bus, train and tram - always use a lower case ‘n’, followed by an upper case ‘N’.

" + }, + { + "title": "nTrain", + "content": "

Use when talking about network train tickets - always use a lower case ‘n’, upper case ‘T’.

" + }, + { + "title": "Numbers", + "content": "

Use 'one' unless you're talking about a step, a point in a list or another situation where using the numeral makes more sense: 'in point 1 of the design instructions', for example. Or this:

You'll be shown 14 clips that feature everyday road scenes.

There will be:

  1. developing hazard in 13 clips
  2. developing hazards in the other clip

Write all other numbers in numerals (including 2 to 9) except where it's part of a common expression like 'one or two of them' where numerals would look strange.

If a number starts a sentence, write it out in full (Thirty-four, for example) except where it starts a title or subheading.

For numerals over 999 - insert a comma for clarity: 9,000

Spell out common fractions like two-thirds.

Use a % sign for percentages: 50%.

Use a 0 where there's no digit before the decimal point.

Use '500 to 900' and not '500-900' (except in tables and for the 16-18 photocard).

Use MB for anything over 1MB: 4MB not 4096KB.

Use KB for anything under 1MB: 569KB not 0.55MB.

Keep it as accurate as possible and up to 2 decimal places: 4.03MB.

Addresses: use 'to' in address ranges: 49 to 53 Cherry Street.

Ordinal numbers

Spell out first to ninth. After that use 10th, 11th and so on.

In tables, use numerals throughout.

" + }, + { + "title": "NXWM", + "content": "

see operator names.

" + } + ] + }, + { + "letter": "O", + "styles": [ + { + "title": "off-peak", + "content": "

Use lower case and include a hyphen.

" + }, + { + "title": "older people", + "content": "

Refer to older people rather than elderly people.

" + }, + { + "title": "online", + "content": "

One word. Do not use 'on-line' or 'on line'.

" + }, + { + "title": "operator names", + "content": "

Do not abbreviate the name. For example, do not use ‘WM Metro’, ‘NX West Midlands’ or ‘West Mids Railway’.

You can use an acronym for timetables and passenger information. For example, ‘West Midlands Metro (WMM)’, ‘National Express West Midlands (NXWM)’ or ‘West Midlands Railway (WMR)’.

Do not use the NXWM acronym without explaining it first. It is not a well known acronym.

" + }, + { + "title": "or", + "content": "

Do not use slashes instead of \"or\". For example, do not say \"Do this 3/4 times\".

" + }, + { + "title": "opt in/out", + "content": "

Verb: I would like to opt in

" + }, + { + "title": "opt-in/out", + "content": "

Adjective: an opt-in clause

" + } + ] + }, + { + "letter": "P", + "styles": [ + { + "title": "paper ticket", + "content": "

A ticket that’s printed on paper, not on a Swift card.

" + }, + { + "title": "passengers", + "content": "

Refer to 'customers' rather than 'passengers'.

" + }, + { + "title": "pay as you go", + "content": "

Do not hyphenate and always use lower case.

" + }, + { + "title": "pay as you go credit", + "content": "

Use to describe Swift cards with a stored cash value

Note: Do not use 'pay as you go travel value (cash)' or 'pay as you go cash value'.

" + }, + { + "title": "PDF", + "content": "Upper case. No need to explain the acronym." + }, + { + "title": "plain English", + "content": "

Lower case plain and upper case English unless in a title: the Plain English Campaign.

All content should be written in plain English. You should also make sure you use language your audience will understand. Use the Plain English Campaign’s A to Z of alternative words to avoid complex language.

" + }, + { + "title": "phone numbers", + "content": "

Phone numbers should be split into at least three groups of digits for readability, ideally with no more than four digits in any single group. For example: 020 7378 1705; 0343 222 6666; 0762 480 4299. See also the design pattern for contact details.

" + } + ] + }, + { + "letter": "Q", + "styles": [ + { + "title": "quotation marks", + "content": "

Use single quotation marks in all cases.

Use double quotation marks if using a quote within a quote.

If a quote runs on longer than one paragraph, include quotation marks at the beginning of each subsequent paragraph but only at the end of the final paragraph.

Place full stops and commas inside quotes when they are complete sentences, otherwise place them outside: 'I want to buy a ticket,' said Mr Smith; When he said 'I promise', he didn't really mean it.

" + } + ] + }, + { + "letter": "R", + "styles": [ + { + "title": "real time/realtime", + "content": "

Where possible, use 'live' instead of 'realtime' or 'real time'

real time (noun): this information is being updated in real time.
realtime (adjective): realtime service information.
Not real-time.

" + }, + { + "title": "re-open", + "content": "

Not reopen.

" + } + ] + }, + { + "letter": "S", + "styles": [ + { + "title": "seasons", + "content": "

Use lower case for spring, summer, autumn and winter.

" + }, + { + "title": "Sentence length", + "content": "

Do not use long sentences. Check sentences with more than 25 words to see if you can split them to make them clearer.

" + }, + { + "title": "sign in or log in", + "content": "

Use sign in rather than log in (verb) for calls-to-action where users enter their details to access a service.

Do not use login as a noun - say what the user actually needs to enter (like username, password, National Insurance number).

" + }, + { + "title": "State Pension", + "content": "

Upper case.

" + }, + { + "title": "Station", + "content": "

Lower case. For example, Birmingham New Street station. Do not say tram station, say tram stop.

" + }, + { + "title": "Stop", + "content": "

Lower case. For example, Summer Lane bus stop.

" + }, + { + "title": "Swift card", + "content": "

Do not capitalise 'Card'.

" + }, + { + "title": "step-free", + "content": "

A route between street and platform that doesn't require the use of stairs or escalators.

" + } + ] + }, + { + "letter": "T", + "styles": [ + { + "title": "terms and conditions", + "content": "

Not Terms and Conditions or terms & conditions.

" + }, + { + "title": "text message alerts", + "content": "

Not SMS alerts.

" + }, + { + "title": "TfWM", + "content": "

See entry on Transport for West Midlands.

" + }, + { + "title": "Times", + "content": "

use 'to' in time ranges, not hyphens, en rules or em dashes: 10am to 11am (not 10-11am)
5:30pm (not 1730hrs)
midnight (not 00:00)
midday (not 12 noon, noon or 12pm)
6 hours 30 minutes
Midnight is the first minute of the day, not the last. You should consider using \"11:59pm\" to avoid confusion about a single, specific time.

For example, \"You must register by 11:59pm on Tuesday 14 June.\" can only be read one way, but \"You must register by midnight on Tuesday 14 June\" can be read in two ways (the end of Monday 13, or end of Tuesday 14).

Timetables and printed passenger information use the 24-hour clock in HHMM format.

" + }, + { + "title": "tram", + "content": "

Not Metro.

" + }, + { + "title": "tram stop", + "content": "

Not station.

" + }, + { + "title": "Transport for West Midlands", + "content": "

Avoid referring to Transport for West Midlands (TfWM). Users don't need to know about it while getting travel advice.

Explaining the relationship between West Midlands Combined Authority, TfWM and West Midlands Combined Authority (WMCA) is complicated. Use \"we\" instead. For example, \"we manage the Key Route Network (KRN)\" with a link to the TfWM policy page.

" + } + ] + }, + { + "letter": "U", + "styles": [ + { + "title": "under-16s", + "content": "

Requires a hyphen in all cases. This is true whenever referring to age groups: under-16s; under-18s; over-60s.

Avoid the common error of adding an apostrophe when making a word or abbreviation plural as this makes it possessive: under-16s not under-16's.

" + }, + { + "title": "URL", + "content": "

Upper case. No need to explain the acronym.

" + }, + { + "title": "username", + "content": "

Not \"user name\".

" + } + ] + }, + { + "letter": "W", + "styles": [ + { + "title": "web", + "content": "

Lower case.

" + }, + { + "title": "webpage", + "content": "

One word.

" + }, + { + "title": "website", + "content": "

Not web-site or web site.

" + }, + { + "title": "West Midlands Combined Authority", + "content": "

Avoid referring to West Midlands Combined Authority (WMCA). Users don't need to know about it while getting travel advice.

The exception is if you referring to a statutory responsibility or a contract. For example, concessionary passes or terms and conditions.

" + }, + { + "title": "wifi", + "content": "

Lower case, no hyphen.

" + }, + { + "title": "WMCA", + "content": "

See entry on West Midlands Combined Authority.

" + }, + { + "title": "wmca.org.uk", + "content": "

If you are linking to another page, you should use an in-text link rather than the full URL. See the entry on links for more information.

Sometimes it is better to show the full URL. For example, when telling users to click a link to verify something in an email.

It is important to use the right URL. Only use wmca.org.uk.

Do not prefix the URL with ‘www.’ as this makes our URL hard to read. The domain extension ‘.co.uk’ makes it obvious to users that it is a URL.

" + }, + { + "title": "www.", + "content": "

See entry on wmca.org.uk.

" + } + ] + }, + { + "letter": "Z", + "styles": [ + { + "title": "zero-hours contract", + "content": "

Not \"zero-hour contract\" or \"zero hours contract\"

" + } + ] + } + ] +} diff --git a/src/www/pages/mc/styles/a-to-z-content-style-guide/index.njk b/src/www/pages/mc/styles/a-to-z-content-style-guide/index.njk new file mode 100644 index 00000000..d1434b5c --- /dev/null +++ b/src/www/pages/mc/styles/a-to-z-content-style-guide/index.njk @@ -0,0 +1,131 @@ +{% extends "www/_layouts/layout-fullwidth.njk" %} +{% set pageTitle="A to Z content style guide" %} {% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +
+
+

Writing content for West Midlands Combined Authority

+

+ You should create all content with user-focused content design principles. This means content has an identified + user need and is written in plain English. +

+

+ Do not use marketing speak - users will be visiting your website to perform a task (for example, buy a train ticket or find out about Swift cards). Your content shouldn’t try to sell them anything - instead, tell them the information they need to know in the simplest way possible. +

+

+ Research has shown that both high literacy and low literacy users prefer plain English because it takes less time to read. Users won’t be on your website for fun - so make the experience quick and easy. +

+

+ To find out more about why plain language is important, read: +

+

+

+ Read the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/content-design/what-is-content-design', + linkTitle: 'GOV.UK introduction to content design', + contentText: 'GOV.UK introduction to content design' + }) + }} + to find out more about content design principles. +

+

Design Team can help you to test your content with user research.

+
+

About the A-Z of style guide

+

This style guide will help you to use consistent words across West Midlands Combined Authority services.

+

+ If something is not covered by this style guide, check the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style', + linkTitle: 'GOV.UK Style Guide', + contentText: 'GOV.UK style guide' + }) + }} + . You can also email Samresha Purewal if you think something is missing from this guidance.

+
+

Introducing West Midlands Combined Authority

+

If you’re talking about day-to-day services (bus, train or tram), you + may need to make it clear that West Midlands Combined Authority does not run these.

For example, you could say: "We don’t run the buses, trains or trams. We can point you in the right direction if you need help." +

+
+
+ {# A to Z accordions #} +
+
+

A to Z of style

+
+
+ + +
+
+
+ {% for section in aToZOfStyles %} +
+ +
+ {% for style in section.styles %} +
+ {{style.title}} +
+ {{style.content | safe}} + {% endfor %} +
+
+ {% endfor %} +
+
+
+
+{% endblock %} diff --git a/src/www/pages/mc/styles/colour-palettes/_color-palettes.js b/src/www/pages/mc/styles/colour-palettes/_color-palettes.js new file mode 100644 index 00000000..f7e01e7d --- /dev/null +++ b/src/www/pages/mc/styles/colour-palettes/_color-palettes.js @@ -0,0 +1,22 @@ +function colorPalettes() { + const colors = document.querySelectorAll('.ds-website-color-swatch__inner'); + + // Function to convert rgb to hex + function rgb2hex(rgb) { + const newRGB = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); + function hex(x) { + return `0${parseInt(x, 10).toString(16)}`.slice(-2); + } + return `#${hex(newRGB[1])}${hex(newRGB[2])}${hex(newRGB[3])}`; + } + + colors.forEach(swatch => { + const ele = swatch; + const rgbColor = getComputedStyle(swatch).backgroundColor; + const hexColor = rgb2hex(rgbColor); + + ele.nextElementSibling.querySelector('pre code .color-hex').innerText = `color: '${hexColor}'`; + }); +} + +export default colorPalettes; diff --git a/src/www/pages/mc/styles/colour-palettes/_colorPalette.scss b/src/www/pages/mc/styles/colour-palettes/_colorPalette.scss new file mode 100644 index 00000000..1b04dd76 --- /dev/null +++ b/src/www/pages/mc/styles/colour-palettes/_colorPalette.scss @@ -0,0 +1,18 @@ +$cp-swatch-height: 50px; + +.ds-website-color-swatch { + padding: $size-sm; + + &__inner { + display: inline-block; + width: 100%; + height: $cp-swatch-height; + margin-bottom: $size-sm; + } +} + +@each $color, $hex in $palettes { + .ds-website-bg-color-#{$color} { + background-color: $hex; + } +} diff --git a/src/www/pages/mc/styles/colour-palettes/index.njk b/src/www/pages/mc/styles/colour-palettes/index.njk new file mode 100644 index 00000000..bce499ac --- /dev/null +++ b/src/www/pages/mc/styles/colour-palettes/index.njk @@ -0,0 +1,78 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Colour Palettes" %} +{% set section="Styles" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/_color-palette-macro.njk" import colorPalette %} + +{% block content %} +{# About #} +

About

+

Below are the list of West Midlands Combined Authority colour palettes.

+

+ We have tested our colours against the three most prevalent colour blind anomalies: protanopia, deuteranopia and tritanopia. While in some circumstances, particularly protanopia, colours can appear to be relatively similar. +

+

+ These issues can be circumvented by not referring to specific colours. For instance, when referring to a green button with the word 'start' in, the phrase 'click the green button to start' would not be helpful. Instead, use 'click the start button', without a colour reference. +

+

+ W3C AA Accessibility criteria requires the contrast of test to be enhanced, with a contrast ratio upwards of 3:1. +

+

+ All brand/web colours meet this criteria, though the modal colour 'WM Railway' must only be used for iconography and graphical devices. +

+

The background only colours can only be used as a background colour and they are not intended for any other use.

+
+ +{# Using in development #} +

Using in development

+

wmcads SCSS

+

If you are using WMCA Design System's SCSS in development, you shouldn't use the HEX values! Instead you should always use the scss variables instead, for example use get-color(primary) instead of #3c1053. This ensures you are always using the most up-to-date colour. To find out more on how to use the get-color() function in SCSS, please refer to the notes for @function get-color() in _mixins.scss.

+ +

Without wmcads SCSS

+

If you are not using WMCA Design System's SCSS then it is recommended to use the hex values below. It is highly adviseable to set these up as variables in your development enviornment, this ensures that you can easily change them to keep up-to-date with our colour palettes.

+

If you'd like to see how we have set the variables up, you can check out $palettes in _vars.scss and @function get-color() in _mixins.scss.

+ +{# Brand colours #} +
+

Brand colours

+
+ {% for color in colors.brand %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
+ +{# Web colours #} +
+

Web colours

+
+ {% for color in colors.web %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
+ +{# Background Only colours #} +
+

Background only colours

+
+ {% for color in colors.backgroundOnly %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
+ +{% endblock %} diff --git a/src/www/pages/mc/styles/examples/grid-column-spacing.njk b/src/www/pages/mc/styles/examples/grid-column-spacing.njk new file mode 100644 index 00000000..9edbe46e --- /dev/null +++ b/src/www/pages/mc/styles/examples/grid-column-spacing.njk @@ -0,0 +1,210 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid column spacing" %} +{% set section = "Styles" %} + +{% block content %} +

Introduction to wmcads Grid column spacing

+

+ Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

+

+ The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

+

+ Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

+

+ Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

+

+ Where {breakpoint} is one of breakpoint sizes described in the grid section. +

+ +

When to use Grid column spacing

+ + +

Examples

+ +

Example 1

+

This example shows the use of the ds-content-card component displayed in a grid of thirds with spacing of 1rem.

+ +
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+
+ content image +
+

Contact us

+

Get in touch if you want to know more about the budget.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+
+ content image +
+

Contact us

+

Get in touch if you want to know more about the budget.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

Example 2

+

This example shows the use of the ds-content-card component displayed in a half grid with spacing of 2rem.

+ +
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

Example 3

+

This example shows the use of the ds-content-card component displayed in a half grid with spacing controlled by breakpoints.

+ +
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +

The default spacing is 0.75rem (ds-grid--spacing-2-sm). Once the page width goes over 768px the spacing changes to 1rem (ds-grid--spacing-md-2-md).

+ + + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/styles/examples/grid-examples.njk b/src/www/pages/mc/styles/examples/grid-examples.njk new file mode 100644 index 00000000..52ec7236 --- /dev/null +++ b/src/www/pages/mc/styles/examples/grid-examples.njk @@ -0,0 +1,335 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid Examples" %} +{% set section = "Styles" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

Introduction to wmcads Grids

+

Grid classes vs. unit classes

+

wmcads Grids consist of two types of classes: the grid class (ds-grid) and unit classes (ds-col-*)

+

The widths of the units are fractions

+

Units have various class names that represent their widths. For example, ds-u-1-2 has a width of 50%, whereas ds-u-1-5 would have a width of 20%.

+

All child elements of a grid must be units

+

Child elements contained within an element with a ds-grid classname must be a grid unit with a ds-col-* classname.

+

Content goes inside grid units

+

All content which is visible to people needs to be contained inside a grid unit. This ensures that the content will be rendered properly.

+ +

Examples

+

Let's start with a simple example. Here's a grid with three columns:

+ +
+

Thirds

+

Thirds

+

Thirds

+
+ +
+  
+  {%- filter forceescape %}
+  
+

Thirds

+

Thirds

+

Thirds

+
+ {%- endfilter %} +
+
+ +

The above example will keep the columns the same width no matter the page width.

+ +

Adding responsive classes

+

We can control the width by adding responsive classes.

+ +

When using Responsive Grids, you can control how the grid behaves at specific breakpoints by adding class names. wmcads default responsive grids comes with the following class names and media query breakpoints.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Default Media Queries
KeyCSS Media QueryAppliesClassname
NoneNoneAlways.ds-col-*
sm@media screen and (min-width: 35.5em)≥ 568px.ds-col-sm-*
md@media screen and (min-width: 48em)≥ 768px.ds-col-md-*
lg@media screen and (min-width: 64em)≥ 1024px.ds-col-lg-*
xl@media screen and (min-width: 80em)≥ 1280px.ds-col-xl-*
+ +

Let's modify the example so the columns become full width on mobile:

+ +
+

Thirds

+

Thirds

+

Thirds

+
+ +
+  
+  {%- filter forceescape %}
+  
+

Thirds

+

Thirds

+

Thirds

+
+ {%- endfilter %} +
+
+ +

The above example has a default width of 1 (ds-col-1) so when the page is viewed below 586px the columns will display full width. When the page is viewed over 586px the columns will appear in 3 coloumns (ds-col-sm-1-3). + + +

Justify Content

+ +

You can justify the grid content bby adding these classes:

+ +

ds-grid--justify-between

+

Items will have space between them

+ +
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

ds-grid--justify-around

+

Items will have space before, between, and after them

+
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

ds-grid--justify-end

+

Items are positioned at the end of the container

+
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

ds-grid--justify-center

+

Items are positioned in the center of the container

+
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+ {%- endfilter %} +
+
+ +
+

ds-grid--justify-even

+

Items will have equal space around them

+
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ +
+  
+  {%- filter forceescape %}
+  
+
+
+ content image +
+

Who weve funded

+

See which councils and providers weve funded, and what for.

+
+
+
+
+
+ content image +
+

Find training schemes

+

You can find training and education providers weve funded online.

+
+
+
+
+ {%- endfilter %} +
+
+ +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/styles/icons/_icons.scss b/src/www/pages/mc/styles/icons/_icons.scss new file mode 100644 index 00000000..d03435ca --- /dev/null +++ b/src/www/pages/mc/styles/icons/_icons.scss @@ -0,0 +1,12 @@ +.website-icons { + svg { + width: 60px; + height: 60px; + padding: $size-sm; + fill: get-color(primary); + } + + .text-center { + text-align: center; + } +} diff --git a/src/www/pages/mc/styles/icons/index.njk b/src/www/pages/mc/styles/icons/index.njk new file mode 100644 index 00000000..76c42c7f --- /dev/null +++ b/src/www/pages/mc/styles/icons/index.njk @@ -0,0 +1,188 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Icons" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# The icon vars are an array that match the folders they come from in src/assets/icon/{foldername} #} +{% set iconGeneral = [ + "arrow", + "caret-down", + "caret-up", + "checkmark", + "chevron-right", + "circle-hollow", + "circle-solid", + "cross", + "expand", + "favourite", + "file", + "filter", + "id-card", + "info", + "location-arrow", + "minimise", + "paperclip", + "pdf", + "html", + "search", + "success", + "swap", + "trash", + "warning-circle", + "warning-triangle" +] %} + +{% set iconSocial = [ + "facebook", + "facebook-hex", + "twitter", + "twitter-hex", + "instagram", + "instagram-hex", + "linkedin", + "linkedin-hex", + "youtube", + "youtube-hex", + "email" +] %} + +{% set iconPortfolio = [ + "culture-and-digital", + "economy", + "environment", + "housing-and-land", + "inclusive-communities", + "skills", + "transport", + "wellbeing" +] %} + + +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} + +{% block content %} +{# How to use #} +

About

+ +

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ +
+ +{# Using Icons #} +

Using icons

+

WMCA Design System icons are available as an SVG sprite to include in your HTML page.

+

How to use

+

Recommended

+

The Recommended method of using the icon sprite sheet is to refer directly to the one used in the design system. This ensures that your icons will always be up to date.

+

To get started, include the below snippet of javascript somewhere in your codebase. This will:

+ +
+  
+  {%- filter forceescape -%}
+  
+  
+  {%- endfilter %}
+  
+
+ +

Displaying an icon

+

To display an icon or glyph, use an icon tag (from the icon section at the bottom of the page) with a href attribute and xlink:href (as a fallback). Make sure that the xlink and href tags are pointing to the location of your downloaded icon sprite sheet.

+

The ICON-TAG-NAME should be replaced with the icon tag name of the icon you want to show from the Icons section below, for example #ds-general-arrow should be in the xlink:href and href attributes of the svg's <use> element.

+
+  
+    {{-
+      wmcadsIcon({
+        icon: 'ICON-TAG-NAME'
+      }) | forceescape | trim
+    -}}
+  
+
+ + +

Can't include via recommended method? Try hosting the sprites locally

+ + +
+ +{# Icons #} +

Icons

+

Find below a list of all our icons and their tags below. To use, don't forget to prefix the tag with 'ds-'

+

General

+
+ {% for icon in iconGeneral %} +
+ {{ + wmcadsIcon({ + icon: 'general-' + icon + }) + }} +

{{ 'general-' + icon }}

+
+ {% endfor %} +
+ +{# Portfolios #} +

Portfolios

+
+ {% for icon in iconPortfolio %} +
+ {{ + wmcadsIcon({ + icon: 'portfolio-' + icon + }) + }} +

{{ 'portfolio-' + icon }}

+
+ {% endfor %} +
+ +{# Social #} +

Social

+
+ {% for icon in iconSocial %} +
+ {{ + wmcadsIcon({ + icon: 'social-' + icon + }) + }} +

{{ 'social-' + icon }}

+
+ {% endfor %} +
+ +{% endblock %} diff --git a/src/www/pages/mc/styles/images/index.njk b/src/www/pages/mc/styles/images/index.njk new file mode 100644 index 00000000..e9dea0aa --- /dev/null +++ b/src/www/pages/mc/styles/images/index.njk @@ -0,0 +1,29 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Images" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +

For more guidance on how to use images, please check WMCA brand guidelines.

+ +{% endblock %} diff --git a/src/www/pages/mc/styles/index.njk b/src/www/pages/mc/styles/index.njk new file mode 100644 index 00000000..9b5b722d --- /dev/null +++ b/src/www/pages/mc/styles/index.njk @@ -0,0 +1,15 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Styles" %} +{% set section = "Styles" %} +{% set ds = 'mc' %} + +{% block content %} +

Make your service look and feel like WMCA Design System.

+

If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples in the + Design System will not need any additional styling.

+

If you need to apply styles manually, you should still follow existing WMCA Design System conventions. For + example, do not assign + new meanings to colours, do not change the style of buttons or adjust the thickness of borders on + form inputs.

+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/mc/styles/layout/index.njk b/src/www/pages/mc/styles/layout/index.njk new file mode 100644 index 00000000..219dae2d --- /dev/null +++ b/src/www/pages/mc/styles/layout/index.njk @@ -0,0 +1,84 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Layout" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# Standard content template #} +

Standard content template

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# Guidance #} +

Guidance for content editors

+ +

Warning text with exclamation mark icon component: Please read the Creating effective content section below before writing content or placing content into your page.

+ + +
+{# Publicity campaign template #} +

Publicity campaign template

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# Guidance #} +

Guidance for content editors

+ + + +
+{# Creating effective content #} +

Creating effective content

+

There is no minimum or maximum page length, however:

+ +

Use clear and concise content because the longer text, the lower rate of readability and comprehension drops significantly.

+

Always place content with higher importance at the top of the page, with less important content following after.

+

If you have to use long content, break it down into smaller sections to make it easier for user to understand information. You can:

+ + +{% endblock %} diff --git a/src/www/pages/mc/styles/maps/index.njk b/src/www/pages/mc/styles/maps/index.njk new file mode 100644 index 00000000..cc521ac9 --- /dev/null +++ b/src/www/pages/mc/styles/maps/index.njk @@ -0,0 +1,177 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Maps" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# Imports #} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# ESRI ArcGIS #} +

ESRI ArcGIS

+ +{# About #} +

About

+

+ When it comes to mapping, West Midlands Combined Authority uses + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/labs/what-is-arcgis/", + linkTitle: "ESRI ArcGIS products", + linkTarget: "_blank", + contentText: "ESRI ArcGIS products" + }) + }} + to create, manage and share data on maps. Therefore, when developing maps use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. +

+ +{# Basemap #} +

Basemap

+ + A screenshot showing an example of a map + +

+ When creating a map use the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as your basemap layer. This is to ensure maps are consistent across West Midlands Combined Authority services. +

+

The WMCA Basemap is a portal item, you can use the +{{ + wmcadsLink({ + link: "https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html", + linkTitle: "ArcGIS Basemap documentation", + linkTarget: "_blank", + contentText: "ArcGIS Basemap documentation" + }) + }} with the WMCA Basemap ID to include the basemap in your application. +

+ +{# Example of code #} +

Example of the ESRI ArcGIS JavaScript API

+
+  
+    // ESRI ArcGIS JS code...
+    const basemap = new Basemap({
+      baseLayers: [
+        new VectorTileLayer({
+          portalItem: {
+            // set the baselayer to WMCA Basemap:
+            // https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e
+            id: '53f165a8863c4d40ba017042e248355e',
+          },
+        }),
+      ],
+    });
+
+    // Create a new map with the basemap set above
+    const map = new Map({
+      basemap,
+    });
+  
+
+ +{# Can't use Esri ArcGIS #} +

Can't use ESRI ArcGIS?

+

+ We understand that you may not always be able to use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. + In these situations, style your map as closely to the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as possible. +

+


+ + +{# User interface #} +

User interface

+

+ User interface elements on a map such as zoom, pan and location buttons follow particular pattern rules when being used. +

+

These pattern rules are:

+ + + + +{% endblock %} diff --git a/src/www/pages/mc/styles/typography/index.njk b/src/www/pages/mc/styles/typography/index.njk new file mode 100644 index 00000000..ca9dff7e --- /dev/null +++ b/src/www/pages/mc/styles/typography/index.njk @@ -0,0 +1,75 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Typography" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# About #} +

About

+

+ We have tested our typography with users, including those with dyslexia and those with low vision. The questionnaire presented respondents with two body fonts, set out in different sizes, line spacing and kerning. The options were shown randomly for each participant.

+

+ Our findings were as such: +

+

+

+ As a public sector organisation, in addition to testing the above we are required to meet WCAG 2.1 guidelines at AA standard. + Therefore, features will be useable when text size is increased up to 200% and content reflowed for 400%. +

+
+{# Fonts #} +

Fonts

+

+ We utilise Google Fonts in our typography and all fonts used are pre-bundled in our design system CSS, so you won't need to include them seperately. +

+

+ Find below, various examples of our typography in use. +

+ +{# DM Sans / Headings #} +

DM Sans / headings

+

+ The font DM Sans is used with font weight of 700 (bold) for heading elements only.
+ DM Sans font reference +

+

Things to note:

+ +
+

46px - Heading 1

+

32px - Heading 2

+

23px - Heading 3

+

18px - Heading 4

+
+ +{# Noto sans / body copy #} +

Noto Sans / body copy

+

+ The font Noto Sans is used with the font weight of 400 (regular) and 700 (bold) for all elements other than headings. The default font size used is 16px.
+ Noto Sans font reference +

+
+

Characters

+ Font size: 16px / 1rem

+ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+ a b c d e f g h i j k l m n o p q r s t u v w x y z
+ 1 2 3 4 5 6 7 8 9 0
+ {% filter escape %} + ‘ ? ’ “ ! ” (%) [#] {@} / & \ < - + ÷ × = > ® © $ € £ ¥ ¢ : ; , . * + {% endfilter %} +
+

Styles

+ 400 - Regular
+ 400 - Regular italic
+ 700 - Bold
+ 700 - Bold italic +
+ +{% endblock %} diff --git a/src/www/pages/mc/styles/utility-classes/index.njk b/src/www/pages/mc/styles/utility-classes/index.njk new file mode 100644 index 00000000..ffe19480 --- /dev/null +++ b/src/www/pages/mc/styles/utility-classes/index.njk @@ -0,0 +1,276 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Utility classes" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} + +{% block content %} +{# About #} +

About

+

+ There are a variety of utility classes that can be used with the existing components and styles on. +

+ + +
+{# Containers #} +

Containers

+

+ Containers are used to wrap content in a 'container'. The container will have a fixed max size and be centered on the page, it will adjust to 100% width when the page width is less than the container size. +

+ +
+  
+    .ds-container /* Container with max-width of 1280px */
+
+    /* This should be used on your main content section and will
+    add a margin top to seperate from header/breadcrumb section */
+    .ds-container.ds-container--main
+  
+
+ + +
+{# Grid #} +

Grid

+

+ The WMCA Design System uses its own custom syntax grid system adopted from Pure CSS Grid. The grid system is already included in the bundled ds-components.min.css file so you don't need to include it seperately. +

+ +

+ You can Refer to the Pure CSS Grid documentation for reference on how to use our grid system, but bear in mind that: +

+ + + +

You can also use modifier classes on the same element where the class .ds-grid is being used.

+
+  
+    .ds-grid--justify-between
+    .ds-grid--justify-around
+    .ds-grid--justify-end
+    .ds-grid--justify-center
+  
+
+ +{{ + wmcadsLink( { + link: "/styles/examples/grid-examples.html", + contentText: "Grid examples" + } + ) +}} + +

Information for designers

+

+ The grid is part of the Design System Sketch library or as a standalone template file. +

+

Screen sizes

+

+

+

+

Sketch grid sizes

+

+

+

+ +
+{# Floats #} +

Floats

+

+ Floats an element in the intended direction. +

+ +
+  
+    .ds-float-left
+    .ds-float-right
+  
+
+ + +
+{# Text Align #} +

Text Align

+

+ Aligns text in the intended direction. +

+ +
+  
+    .ds-text-align-left
+    .ds-text-align-center
+    .ds-text-align-right
+  
+
+ + +
+{# Show or hide on devices #} +

Show or hide on devices

+

+ When you want to hide an element based on if the device width is a desktop or mobile device. +

+ +
+  
+    .ds-hide-mobile /* Hide only on mobile devices or smaller (less than 48em)  */
+    .ds-hide-desktop /* Hide only on desktop devices or larger (greater than 48em) */
+    .ds-hide /* Hide on all devices */
+  
+
+ +
+

Spacing

+

+ The spacing utility classes are used to adjust whitespace for an element via padding and margins. +

+

Before using the spacing utility classes, please consider:

+ + +

+ The classes are named using the format .ds-{type}-{side}-{size}. +

+{# type #} +

+ Where {type} is one of: +

+ +{# side #} +

+ Where {side} is one of: +

+ +{# size #} +

+Where {size} is one of: +

+ + +

Some examples of using these utility classes...

+
+  
+    .ds-m-xs // applies a margin of 0.25rem to all sides
+    .ds-p-b-lg // applies a padding-bottom of 2rem
+    .ds-m-l-none // sets left margin to 0
+  
+
+ +{# Grid columns spacing #} +

Grid column spacing

+ +

+ Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

+

+ The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

+

+ Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

+

+ Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

+

+ Where {breakpoint} is one of breakpoint sizes described in the grid section. +

+ +

Some examples of using these utility classes...

+
+  
+    .ds-grid--spacing-2-md // applies a 1rem spacing between 2 columns
+    .ds-grid--spacing-lg-4-lg // applies a 2rem spacing between 4 columns above a screen width of 1024px
+  
+
+ +{{ + wmcadsLink( { + link: "/styles/examples/grid-column-spacing.html", + contentText: "Grid column spacing examples" + } + ) +}} +

+ +
+{# Background #} +

Background Colour

+

+ Changes background to the intended colour. +

+ +
+  
+    .bg-default
+    .bg-white
+    .bg-disabled-elements
+    .bg-transparent
+  
+
+ +{% endblock %} diff --git a/src/www/pages/patterns/index.njk b/src/www/pages/patterns/index.njk index 4c63f5d2..aacf9636 100755 --- a/src/www/pages/patterns/index.njk +++ b/src/www/pages/patterns/index.njk @@ -1,15 +1,16 @@ -{% extends "www/_layouts/layout-left-pane.njk" %} -{% set pageTitle = "Patterns" %} -{% set section = "Patterns" %} - -{% block content %} -

Patterns are reusable parts of the user interface that have been made to support a variety of - applications.

- -

Individual patterns can be used in multiple different patterns and contexts. For example, the - text input component - can be used to ask for an email address, a National Insurance number or someone’s name.

-

If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the - coded examples provided - will render exactly as they do inside the Design System.

+{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Patterns" %} +{% set section = "Patterns" %} +{% set ds = 'wmca' %} + +{% block content %} +

Patterns are reusable parts of the user interface that have been made to support a variety of + applications.

+ +

Individual patterns can be used in multiple different patterns and contexts. For example, the + text input component + can be used to ask for an email address, a National Insurance number or someone’s name.

+

If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples provided + will render exactly as they do inside the Design System.

{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/accordion/index.njk b/src/www/pages/st/components/accordion/index.njk new file mode 100644 index 00000000..891726e8 --- /dev/null +++ b/src/www/pages/st/components/accordion/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Accordion" %} +{% set ds = 'st' %} + +{% block content %} + +{% from "www/pages/shared/components/accordion/index.njk" import dsAccordionContent %} + +{{ + dsAccordionContent({}) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/breadcrumb/index.njk b/src/www/pages/st/components/breadcrumb/index.njk new file mode 100644 index 00000000..de32b727 --- /dev/null +++ b/src/www/pages/st/components/breadcrumb/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Breadcrumb" %} +{% set ds = 'st' %} + +{% block content %} + +{% from "www/pages/shared/components/breadcrumb/index.njk" import dsBreadcrumbContent %} + +{{ + dsBreadcrumbContent({}) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/buttons/index.njk b/src/www/pages/st/components/buttons/index.njk new file mode 100644 index 00000000..101c8372 --- /dev/null +++ b/src/www/pages/st/components/buttons/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Buttons" %} +{% set ds = 'st' %} + +{% block content %} + +{% from "www/pages/shared/components/buttons/index.njk" import dsButtonsContent %} + +{{ + dsButtonsContent({}) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/content-card/index.njk b/src/www/pages/st/components/content-card/index.njk new file mode 100644 index 00000000..7573cd65 --- /dev/null +++ b/src/www/pages/st/components/content-card/index.njk @@ -0,0 +1,137 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Content card" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{# Imports #} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

About

+

Content cards contain components and text. Against the page background, they help to draw the users attention to important information and help users to navigate content.

+

The cards have many common use cases and applications, all of which can be found on the content cards pattern page.

+
+ +

+{# Content card #} +

Content card

+{# What #} +

What is it?

+ +{# When not to #} +

When not to use it?

+ + +

Regular Card

+ +{{ + compExample([ + wmcadsContentCard({ + }) + + ]) +}} + +

With Image

+ +{{ + compExample([ + wmcadsContentCard({ + src: true, + isSrcDefault: true + }) + ]) +}} + +

Without Image

+ +{{ + compExample([ + wmcadsContentCard() + ]) +}} + + + +

+{# Navigation card #} +

Navigation card

+{# What #} +

What is it?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +

Navigation Card

+ +{{ + compExample([ + wmcadsContentCard({ + clickable: true + }) + ]) +}} + +

With Image

+ +{{ + compExample([ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true + }) + ]) +}} + +

Call To Action Card

+ +{{ + compExample([ + wmcadsContentCard({ + clickable: true, + isCta: true + }) + ]) +}} + +

Event Card

+ +{{ + compExample([ + wmcadsContentCard({ + clickable: true, + isEvent: true + }) + ]) +}} + +

News Card

+ +{{ + compExample([ + wmcadsContentCard({ + src: true, + clickable: false, + isNews: true + }) + ]) +}} + +{% endblock %} diff --git a/src/www/pages/st/components/content-tiles/index.njk b/src/www/pages/st/components/content-tiles/index.njk new file mode 100644 index 00000000..7f462757 --- /dev/null +++ b/src/www/pages/st/components/content-tiles/index.njk @@ -0,0 +1,130 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Content tiles (deprecated)" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{# Content tile small 1 #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} + +{# Content tile travel tips #} +{%- from "wmcads/components/content-tiles/travel-tips/travel-tips.njk" import wmcadsContentTileTravelTips -%} + +{# Content tile travel updates #} +{%- from "wmcads/components/content-tiles/travel-updates/travel-updates.njk" import wmcadsContentTileTravelUpdates -%} + +{# Content tile advice moving #} +{%- from "wmcads/components/content-tiles/advice-moving/advice-moving.njk" import wmcadsContentTileAdviceMoving -%} + + +

Normal

+

General

+{{ + compExample([ + wmcadsContentTilesNormal({ + copy: '

See all major roadworks and events. These could affect your journey, plan ahead.

' + }) + ]) +}} + +

General with one link

+{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--with-one-link', + copy: '

See all major roadworks and events. These could affect your journey, plan ahead.

', + readMore: true + }) + ]) +}} + +

Yellow modifier

+{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--yellow ds-content-tile--with-one-link', + copy: '

See all major roadworks and events. These could affect your journey, plan ahead.

', + readMore: true + }) + ]) +}} + +

Major Works

+{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--with-one-link', + copy: ' + + ', + readMore: true + }) + ]) +}} + +

Iframe (map)

+{{ + compExample([ + wmcadsContentTilesNormal({ + copy: ' +

Consider using City Road and Dudley Road, past City Hospital to head into Birmingham city centre or connect with the ring road.

+ + ' + }) + ]) +}} + +

Nav

+{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--nav', + title: 'Related content', + smallTitle: true + }) + ]) +}} + +

Nav with legend

+{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--nav', + title: 'Related content', + smallTitle: true, + legend: 'Overview' + }) + ]) +}} + +

Content tile travel tips

+

When to use it?

+ +{{ + compExample([ + wmcadsContentTileTravelTips() + ]) +}} + +

Content tile travel updates

+{{ + compExample([ + wmcadsContentTileTravelUpdates() + ]) +}} + +

Content tile advice to keep moving

+{{ + compExample([ + wmcadsContentTileAdviceMoving() + ]) +}} + +{% endblock %} diff --git a/src/www/pages/st/components/details/index.njk b/src/www/pages/st/components/details/index.njk new file mode 100644 index 00000000..2240fbe0 --- /dev/null +++ b/src/www/pages/st/components/details/index.njk @@ -0,0 +1,61 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Details" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{# Details component #} +{%- from "wmcads/components/details/_details.njk" import wmcadsDetails -%} + +

About

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# How #} +

How it works?

+ +
+

+ +

Reduced

+{{ + compExample([ + wmcadsDetails({ + summary: "Detail summary", + content: "Lorem ipsum dolor sit amet consectetur adipisicing elit." + }) + ]) +}} + +

Expanded

+{{ + compExample([ + wmcadsDetails({ + expanded: true, + summary: "Detail summary", + content: "Lorem ipsum dolor sit amet consectetur adipisicing elit." + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/disruption-indicators/index.njk b/src/www/pages/st/components/disruption-indicators/index.njk new file mode 100644 index 00000000..8b6edaf1 --- /dev/null +++ b/src/www/pages/st/components/disruption-indicators/index.njk @@ -0,0 +1,460 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Disruption indicators (deprecated)" %} +{# Get macros #} +{% from "wmcads/components/disruption-indicator/small/_small.njk" import wmcadsDisruptionIndicatorSmall %} +{% from "wmcads/components/disruption-indicator/medium/_medium.njk" import wmcadsDisruptionIndicatorMedium %} +{% from "wmcads/components/disruption-indicator/large/_large.njk" import wmcadsDisruptionIndicatorLarge %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% set modes = [ + "bus", + "coach", + "cycle", + "metro", + "plane", + "rail", + "roads", + "walk" +] %} + + + +{% block content %} +{# About #} +

About

+

Disruption indicators are used to show the current service status within interfaces and maps.

+

There are three types all giving different levels of detail.

+
+ +

+{# Map pin #} +

Small

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ + +{# Small:Minor disruptions #} +

Minor disruption

+{{ + compExample([ + wmcadsDisruptionIndicatorSmall({ + mode: 'bus' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'coach' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'cycle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'metro' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'plane' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'rail' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'roads' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'walk' + }) + ], + { + displayInline: true + }) +}} + +{# Small:Major disruptions #} +

Major disruption

+{{ + compExample([ + wmcadsDisruptionIndicatorSmall({ + mode: 'bus', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'coach', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'cycle', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'metro', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'plane', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'rail', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'roads', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'walk', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }) + ], + { + displayInline: true + }) +}} + +{# Small:Severe disruptions #} +

Severe disruption

+{{ + compExample([ + wmcadsDisruptionIndicatorSmall({ + mode: 'bus', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'coach', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'cycle', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'metro', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'plane', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'rail', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'roads', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'walk', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }) + ], + { + displayInline: true + }) +}} + +

+{# Medium:Normal #} +

Medium - Normal

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ + +{{ + compExample([ + wmcadsDisruptionIndicatorMedium(), + wmcadsDisruptionIndicatorMedium({ + classModifiers: 'ds-disruption-indicator-medium--success', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorMedium({ + classModifiers: 'ds-disruption-indicator-medium--warning', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorMedium({ + classModifiers: 'ds-disruption-indicator-medium--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorMedium({ + classModifiers: 'ds-disruption-indicator-medium--severe', + iconRight: 'general-warning-triangle' + }) + ]) +}} + +

+{# Medium - Narrow #} +{% from "wmcads/components/disruption-indicator/medium/_medium.njk" import wmcadsDisruptionIndicatorMedium as wmcadsDisruptionIndicatorNarrow %} +

Medium - Narrow

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not #} +

When not use it?

+ + +{{ + compExample([ + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--success ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--warning ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--error ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--severe ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--error ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-trash' + }) + ], + { + displayInline: true + }) +}} + +

+{# LARGE #} +

Large

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# Research #} +

Research

+ +

Train

+{{ + compExample( + [ + wmcadsDisruptionIndicatorLarge({ + comment: '', + mode: 'Train', + strongText: 'Good service', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'warning', + mode: 'Train', + strongText: 'Minor disruption', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Train', + strongText: 'Major disruption', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'severe', + mode: 'Train', + strongText: 'Severe disruption', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Train', + strongText: 'Major disruption', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-trash', + iconRightBtn: true + }) + ] + ) +}} + +{# Tram #} +

Tram

+{{ + compExample( + [ + wmcadsDisruptionIndicatorLarge({ + comment: '', + mode: 'Tram', + strongText: 'Good service', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'warning', + mode: 'Tram', + strongText: 'Minor disruption', + text: 'Between Jewellery Quarter and Wolverhampton', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Tram', + strongText: 'Major disruption', + text: 'Between Jewellery Quarter and Wolverhampton', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'severe', + mode: 'Tram', + strongText: 'Severe disruption', + text: 'Between Jewellery Quarter and Wolverhampton', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Tram', + strongText: 'Major disruption', + text: 'Between Jewellery Quarter and Wolverhampton', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-trash', + iconRightBtn: true + }) + ] + ) +}} + +{# Roads #} +

Roads

+{{ + compExample( + [ + wmcadsDisruptionIndicatorLarge({ + comment: '', + mode: 'Roads', + strongText: 'Usual traffic', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'warning', + mode: 'Roads', + strongText: 'Minor disruption', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Roads', + strongText: 'Major disruption', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'severe', + mode: 'Roads', + strongText: 'Severe disruption', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Roads', + strongText: 'Major disruption', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-trash', + iconRightBtn: true + }) + ] + ) +}} + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/divider/index.njk b/src/www/pages/st/components/divider/index.njk new file mode 100644 index 00000000..f0d7caf3 --- /dev/null +++ b/src/www/pages/st/components/divider/index.njk @@ -0,0 +1,114 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Divider" %} +{% from "wmcads/components/divider/_divider.njk" import wmcadsDivider %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +

Default divider (Primary)

+{{ + compExample([ + wmcadsDivider() + ]) +}} + +

Cool Grey divider

+{{ + compExample([ + wmcadsDivider({ + class: 'grey' + }) + ]) +}} + +

WM Green divider

+{{ + compExample([ + wmcadsDivider({ + class: 'wmgreen' + }) + ]) +}} + +

WM Red divider

+{{ + compExample([ + wmcadsDivider({ + class: 'wmred' + }) + ]) +}} + +

WM Purple divider

+{{ + compExample([ + wmcadsDivider({ + class: 'wmpurple' + }) + ]) +}} + +

WM Blue divider

+{{ + compExample([ + wmcadsDivider({ + class: 'wmblue' + }) + ]) +}} + +

WM Furnace Orange divider

+{{ + compExample([ + wmcadsDivider({ + class: 'wmfurnaceorange' + }) + ]) +}} + +

WM Green Tint divider

+{{ + compExample([ + wmcadsDivider({ + class: 'wmtintsgreen' + }) + ]) +}} + +

WM Brown Tint divider

+{{ + compExample([ + wmcadsDivider({ + class: 'wmtintsbrown' + }) + ]) +}} + +

TfWM Pink divider

+{{ + compExample([ + wmcadsDivider({ + class: 'tfwmpink' + }) + ]) +}} + +

TfWM Yellow divider

+{{ + compExample([ + wmcadsDivider({ + class: 'tfwmyellow' + }) + ]) +}} + +

WM Blue divider - Half width

+{{ + compExample([ + wmcadsDivider({ + class: 'wmblue', + half: 'true' + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/document/index.njk b/src/www/pages/st/components/document/index.njk new file mode 100644 index 00000000..26067247 --- /dev/null +++ b/src/www/pages/st/components/document/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Document" %} +{% from "wmcads/components/document/_document.njk" import wmcadsDocument %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{{ + compExample([ + wmcadsDocument() + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/file-download/index.njk b/src/www/pages/st/components/file-download/index.njk new file mode 100644 index 00000000..daa6b231 --- /dev/null +++ b/src/www/pages/st/components/file-download/index.njk @@ -0,0 +1,136 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "File download" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{# Macros #} +{% from "wmcads/components/file-download/_file-download.njk" import wmcadsFileDownload %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

About

+{# What #} +

What does it do?

+ +
+

+ + +{# Accessible file #} +

Accessible file

+{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +{{ + compExample([ + wmcadsFileDownload({ + html: false, + default: true + }) + ]) +}} +

+ +{# Non-accessible file #} +

Non-accessible file

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +{{ + compExample([ + wmcadsFileDownload({ + accessible: true, + html: false, + default: true + }) + ]) +}} + + +{# Document link #} +

Document link

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ + +{{ + compExample([ + wmcadsFileDownload({ + html: true, + default: true + }) + ]) +}} + +{# Document link #} +

HTML & PDF links

+ +{{ + compExample([ + wmcadsFileDownload({ + html: false, + htmlInfo: true, + default: false, + htmlDoc: true, + pdfDoc: false, + dlName: 'Document name' + }) + ]) +}} + + + +{{ + compExample([ + wmcadsFileDownload({ + html: false, + htmlInfo: true, + default: false, + htmlDoc: false, + pdfDoc: true, + dlName: 'Download Document name (pdf, 7.88MB)' + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/form-elements/index.njk b/src/www/pages/st/components/form-elements/index.njk new file mode 100644 index 00000000..651ac070 --- /dev/null +++ b/src/www/pages/st/components/form-elements/index.njk @@ -0,0 +1,318 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Form elements" %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} + {# Label #} +

Form Label

+

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ + {% from "wmcads/components/form-elements/label/_label.njk" import wmcadsLabel %} + {{ + compExample([wmcadsLabel()]) + }} + {# End label #} + + +

+ {# Question #} +

Question

+

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ +

How it works?

+ + {% from "wmcads/components/form-elements/question/_question.njk" import wmcadsQuestion %} + {{ + compExample([wmcadsQuestion()]) + }} + {# End question #} + +

+ {# Progress Indicator #} +

Progress Indicator

+

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ + {% from "wmcads/components/form-elements/progress-indicator/_progress-indicator.njk" import wmcadsProgressIndicator %} + {{ + compExample([wmcadsProgressIndicator()]) + }} + {# Progress Indicator #} + +

+ {# Checkboxes #} +

Checkboxes

+

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ + {% from "wmcads/components/form-elements/checkboxes/_checkboxes.njk" import wmcadsCheckboxes %} + {{ + compExample([wmcadsCheckboxes()]) + }} + {# End Checkboxes #} + + +

+ {# Dropdown #} +

Dropdown

+

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ + {% from "wmcads/components/form-elements/dropdown/_dropdown.njk" import wmcadsDropdown %} + {{ + compExample([wmcadsDropdown()]) + }} + {# End Dropdown #} + +

+ {# Input #} +

Text Input / Text Field

+

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ + {% from "wmcads/components/form-elements/input/_input.njk" import wmcadsInput %} + {{ + compExample([wmcadsInput()]) + }} + {# End Input #} + + +

+ {# Radios #} +

Radios

+

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ + {% from "wmcads/components/form-elements/radios/_radios.njk" import wmcadsRadios %} + {{ + compExample([wmcadsRadios()]) + }} +

Inline Radios

+ {{ + compExample([wmcadsRadios({ + inline: true + })]) + }} + {# End Radios #} + + +

+ {# File uploader #} +

File uploader

+

What does it do?

+ +

+ When to use it? +

+ +

+ When not to use it? +

+ + {% from "wmcads/components/form-elements/file-upload/_file-upload.njk" import wmcadsFileUpload %} + {{ + compExample([wmcadsFileUpload()]) + }} +

With file uploaded

+ {{ + compExample([wmcadsFileUpload({ + fileSelected: true + })]) + }} + {# End File uploader #} + + +

+ {# Textarea #} +

Textarea

+

What does it do?

+ +

+ When to use it? +

+ +

+ When not to use it? +

+ + {% from "wmcads/components/form-elements/textarea/_textarea.njk" import wmcadsTextarea %} + {{ + compExample([wmcadsTextarea()]) + }} + {# End Textarea #} + +

+ {# Date input #} + {% from "wmcads/components/form-elements/date-input/_date-input.njk" import wmcadsDateInput %} +

Date Input

+

What does it do?

+ +

When to use it?

+ +

When not to use it?

+ + {{ + wmcadsInsetText ({ + contentHTML: "If you are looking for how to format the date within content i.e. \"4 June 2017\", check the dates section within the A to Z content style guide." + }) + }} + + {{ + compExample([ + wmcadsDateInput({ + + }) + ]) + }} +{# End Date input #} + + +

+ {# Handling error #} +

Handling errors

+

What does it do?

+ +

+ When to use it? +

+ +

+ When not to use it? +

+ +

+ How to use it +

+ + {{ + compExample([ + wmcadsInput({ + id: 'errorExample', + error:true + }) + ]) + }} + {# End handling errors #} + +{% endblock %} diff --git a/src/www/pages/st/components/hub-header/index.njk b/src/www/pages/st/components/hub-header/index.njk new file mode 100644 index 00000000..bfeea6f0 --- /dev/null +++ b/src/www/pages/st/components/hub-header/index.njk @@ -0,0 +1,56 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Hub header" %} +{% from "wmcads/components/hub-header/_hub-header.njk" import wmcadsHubHeader %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} + +{# primary hub header #} +

Primary hub header

+ +{{ + compExample([ + wmcadsHubHeader({ + showSubtitle: true, + icon: false + }) + ],{iframe:false + }) +}} + +{# primary hub header with icon #} +

Primary hub header with Icon

+ +{{ + compExample([ + wmcadsHubHeader({ + icon: true, + showSubtitle: true + }) + ],{iframe:false}) +}} + +{# primary hub header with image #} +

Primary hub header with Image

+ +{{ + compExample([ + wmcadsHubHeader({ + image: true, + showSubtitle: true + }) + ],{iframe:false}) +}} + +{# primary hub header without subtitle #} +

Primary hub header without subtitle

+ +{{ + compExample([ + wmcadsHubHeader({ + image: false + }) + ],{iframe:false}) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/images/index.njk b/src/www/pages/st/components/images/index.njk new file mode 100644 index 00000000..52aea827 --- /dev/null +++ b/src/www/pages/st/components/images/index.njk @@ -0,0 +1,70 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Images" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} + {# Image with hexagon mask #} +

Image with hexagon mask

+

+ What does it do? +

+ +

+ When to use it? +

+ +

+ When not to use it? +

+ + {% from "wmcads/components/images/_images.njk" import wmcadsImages %} + {{ + compExample([wmcadsImages({ + + })]) + }} +

+ {# Image with summary #} +

Image with summary

+

+ What does it do? +

+ +

+ When to use it? +

+ +

+ When not to use it? +

+ + {% from "wmcads/components/images/_image-with-summary.njk" import wmcadsImageWithSummary %} + {{ + compExample([wmcadsImageWithSummary({ + + })]) + }} + {# End label #} + +{% endblock %} diff --git a/src/www/pages/st/components/in-text-step/index.njk b/src/www/pages/st/components/in-text-step/index.njk new file mode 100644 index 00000000..3af178d2 --- /dev/null +++ b/src/www/pages/st/components/in-text-step/index.njk @@ -0,0 +1,50 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "In-text step" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} + {# In-text Step #} +

In-text step

+

+ What does it do? +

+ +

+ When to use it? +

+ +

+ When not to use it? +

+ + {% from "wmcads/components/in-text-step/_in-text-step.njk" import wmcadsInTextStep %} + {{ + compExample([wmcadsInTextStep({ + steps: [ + "Step text must end with a full stop.", + "Step text must end with a full stop.", + "Step text must end with a full stop." + ] + })]) + }} + + {# End label #} + +{% endblock %} diff --git a/src/www/pages/st/components/inclusive-growth-doughnut/index.njk b/src/www/pages/st/components/inclusive-growth-doughnut/index.njk new file mode 100644 index 00000000..50d4b130 --- /dev/null +++ b/src/www/pages/st/components/inclusive-growth-doughnut/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Incusive Growth Doughnut" %} +{% from "wmcads/components/inclusive-growth-doughnut/_inclusive-growth-doughnut.njk" import wmcadsIncusiveGrowthDoughnut %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{{ + compExample([ + wmcadsIncusiveGrowthDoughnut() + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/index.njk b/src/www/pages/st/components/index.njk new file mode 100644 index 00000000..5a52ba0e --- /dev/null +++ b/src/www/pages/st/components/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Components" %} +{% set ds = 'st' %} + +{% block content %} +

Components are reusable parts of the user interface that have been made to support a variety of + applications.

+ +

Individual components can be used in multiple different patterns and contexts. For example, the + text input component can be used to ask for an email address, a National Insurance number or someone’s name.

+

If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples provided will render exactly as they do inside the Design System.

+{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/inset-text/index.njk b/src/www/pages/st/components/inset-text/index.njk new file mode 100644 index 00000000..0c2c9987 --- /dev/null +++ b/src/www/pages/st/components/inset-text/index.njk @@ -0,0 +1,104 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Inset Text" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

Inset Text

+

What does it do?

+ + +

When to use it?

+ + +

When not to use it?

+ + +

How to use it?

+ + + {% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} + {{ + compExample([ + wmcadsInsetText({ + html: "Example of inset text" + }) + ]) + }} + {# End inset text #} + + +

+ {# Question #} +

Example Callout

+ +

What does it do?

+ + +

When to use it?

+ + +

When not to use it?

+ + +

How to use it?

+ + + + {% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} + {{ + compExample([ + wmcadsInsetText({ + html: "Example Callout title
Example callout description.", + label: "Example Callout" + }) + ]) + }} + {# End inset text #} + +{% endblock %} diff --git a/src/www/pages/st/components/links/index.njk b/src/www/pages/st/components/links/index.njk new file mode 100644 index 00000000..a790cc46 --- /dev/null +++ b/src/www/pages/st/components/links/index.njk @@ -0,0 +1,354 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Links" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

About

+

+ Buttons and links are items used to perform an action on a + page +

+

+ It's important to know when to use a link or a + button +

+

+ Links should be used when a users action won’t affect the website at all, + examples of these + are: +

+ + +

What do the link attritubes mean?

+

The href attritube is used to define the link address

+

The target attritube is used to define where to open the linked document. + See below to find + out more about the target attritube

+

The title attritube is used to define additional information about the + link. It's useful for + your users and accessibility. Try not to duplicate your link text- this hurts usability as + hard of sight users + using screen readers will here the same text twice.

+ +

Target attritube values:

+ +
+

+ + +{# Default link #} +

Default link

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{{ + compExample([ + wmcadsLink() + ]) +}} +

+ + +{# Back link #} +

Back link

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ +{# How it works #} +

How it works?

+ +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{{ + compExample([ + wmcadsLink( { isBackLink: true, text: "Back" } ) + ]) +}} + + +

+{# Link with chevron #} +

Link with chevron

+{# What #} +

What does it do?

+ +{# When to #} +

When to use it?

+ +{# When not to #} +

When not to use it?

+ +{# How #} +

How does it work?

+ +{{ + compExample([ + wmcadsLink({ + contentText: "Link", + withChevronLeft: true + }), + wmcadsLink({ + contentText: "Link", + withChevronRight: true + }) + ]) +}} + + +

+{# call to action button as link #} +

Call to action buttons

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as cta %} +{{ + compExample([ + cta({ + text: "Call to action button", + linkTitle: "This is a call to action link" + }), + cta({ + text: "Call to action icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a call to action link" + }) + ]) +}} +{# end: call to action button as link #} +

+ + +{# primary buttons #} +

Primary buttons

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as primary -%} +{{ + compExample([ + primary({ + classNames: "ds-btn--primary", + text: "Primary button", + linkTitle: "This is a primary link" + }), + primary({ + classNames: "ds-btn--primary", + text: "Primary icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a primary link" + }) + ]) +}} +{# end: primary button as link #} +

+ + +{# secondary buttons #} +

Secondary buttons

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as secondary -%} +{{ + compExample([ + secondary({ + classNames: "ds-btn--secondary", + text: "Secondary button", + linkTitle: "This is a secondary link" + }), + secondary({ + classNames: "ds-btn--secondary", + text: "Secondary icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a secondary link" + }) + ]) +}} +{# end: secondary button as link #} +

+ + +{# destructive button as link #} +

Destructive button as link

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as destructive -%} +{{ + compExample([ + destructive({ + classNames: "ds-btn--destructive", + text: "Destructive button", + linkTitle: "This is a destructive link" + }), + destructive({ + classNames: "ds-btn--destructive", + text: "Destructive icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a destructive link" + }) + ]) +}} +{# end: destructive button as link #} + + +

+{# start button as link #} +

Start button as link

+{# What #} +

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as start -%} +{{ + compExample([ + start({ + classNames: "ds-btn--start", + text: "Start button", + linkTitle: "This is a start link" + }), + start({ + classNames: "ds-btn--start", + text: "Start icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a start link" + }) + ]) +}} +{# end: start button as link #} +{% endblock %} diff --git a/src/www/pages/st/components/lists/index.njk b/src/www/pages/st/components/lists/index.njk new file mode 100644 index 00000000..079bffbf --- /dev/null +++ b/src/www/pages/st/components/lists/index.njk @@ -0,0 +1,144 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Lists" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{# Ordered List #} +

Ordered List

+

What does it do?

+ +{# When #} +

When to use it?

+ +{# When not #} +

When not to use it?

+ +{# How to #} +

How to use it?

+ +{% from "wmcads/components/lists/ordered-list/_ordered-list.njk" import wmcadsOrderedList %} +{{ + compExample([ + wmcadsOrderedList( + { + html: + "
  • Text +
      +
    1. Text +
        +
      1. Text
      2. +
      3. Text +
          +
        1. Text
        2. +
        +
      4. +
      5. Text
      6. +
      +
    2. +
    3. Text
    4. +
    +
  • +
  • Text
  • " + } + ) | trim + ]) +}} +

    + +{# Unordered list #} +

    Unordered List

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{# How to #} +

    How to use it?

    + + +{% from "wmcads/components/lists/unordered-list/_unordered-list.njk" import wmcadsUnorderedList %} +{{ + compExample([ + wmcadsUnorderedList( + { + html: + "
  • Text + +
  • " + } + ) | trim + ]) +}} + +{# Bare list #} +

    Bare List

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{# How to #} +

    How to use it?

    + + +{% from "wmcads/components/lists/bare-list/_bare-list.njk" import wmcadsBareList %} +{{ + compExample([ + wmcadsBareList( + { + html: + "
  • Text
  • +
  • Text
  • +
  • Link
  • " + } + ) | trim + ]) +}} + +{% endblock %} diff --git a/src/www/pages/st/components/loader/index.njk b/src/www/pages/st/components/loader/index.njk new file mode 100644 index 00000000..f79bc9b9 --- /dev/null +++ b/src/www/pages/st/components/loader/index.njk @@ -0,0 +1,67 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Loader" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{# Loader #} +

    Loader

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + + +

    + By default you should aim to use the 'normal sized loader'.
    + Only when the normal sized loader is not fit for purpose should you use the large or small sized loader. +

    + +

    Change the text within .ds-loader__content from 'Content is loading...' to something that describes what it is you are loading, this will help with accessibility.

    + +{% from "wmcads/components/loader/_loader.njk" import wmcadsLoader %} +{{ + compExample([ + wmcadsLoader({ + size: 'small' + }), + wmcadsLoader(), + wmcadsLoader({ + size: 'large' + }) + ]) +}} + + +{% endblock %} diff --git a/src/www/pages/st/components/message/index.njk b/src/www/pages/st/components/message/index.njk new file mode 100644 index 00000000..c376e92d --- /dev/null +++ b/src/www/pages/st/components/message/index.njk @@ -0,0 +1,126 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Message" %} + +{% from "wmcads/components/message/summary/_summary.njk" import wmcadsMsgSummary %} +{% from "wmcads/components/message/help/_help.njk" import wmcadsMsgHelp %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

    About

    +

    What does it do?

    + + +

    When to use it?

    + +
    +

    +{# Info message #} +

    Information

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'info', + title: 'Information about XXXXXXXXX was successfully updated!', + message: 'Details added what happened and what to do next. Lorem ipsum lorem ipsum. Lorem ipsum lorem ipsum text.' + }) + ]) +}} +{# End info message #} + +

    +{# Success message #} +

    Success

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'success', + title: 'Success confirmation', + message: 'Details added if needed to confirm action.' + }) + ]) +}} +{# End success message #} + +

    +{# Success message #} +

    Success (fill)

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'success-fill', + title: 'Success confirmation', + message: 'Details added if needed to confirm action.' + }) + ]) +}} +{# End success message #} + +

    +{# Warning message #} +

    Warning

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'warning', + title: 'Warning message', + message: 'Details added what happened and what to do next. Lorem ipsum lorem ipsum. Lorem ipsum lorem ipsum.' + }) + ]) +}} +{# End Warning message #} + +

    +{# Error message #} +

    Error

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'error', + title: 'Error message', + message: 'Details added what happened and what to do next. Lorem ipsum lorem ipsum. Lorem ipsum lorem ipsum.' + }) + ]) +}} + +{# End error message #} + +

    +{# Help message #} +

    Help

    + +

    When to use it?

    + +{{ compExample([ wmcadsMsgHelp({ message: 'Details added what happened and what to do next.
    +Lorem ipsum lorem ipsum. Lorem ipsum lorem ipsum.' }) ]) }} {# End Help message #} {% endblock %} diff --git a/src/www/pages/st/components/page-contents/index.njk b/src/www/pages/st/components/page-contents/index.njk new file mode 100644 index 00000000..7abd43bb --- /dev/null +++ b/src/www/pages/st/components/page-contents/index.njk @@ -0,0 +1,26 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Page contents" %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +

    Page contents

    +{{ + compExample([ + wmcadsPageContents({ + example: true + }) + ]) +}} + +

    Page contents with sections

    +{{ + compExample([ + wmcadsPageContents({ + example: false, + sections: true + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/page-header/index.njk b/src/www/pages/st/components/page-header/index.njk new file mode 100644 index 00000000..52fffe88 --- /dev/null +++ b/src/www/pages/st/components/page-header/index.njk @@ -0,0 +1,53 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Page header" %} +{% from "wmcads/components/page-header/_page-header.njk" import wmcadsPageHeader %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +

    Header with page name

    +{{ + compExample([ + wmcadsPageHeader({ + title: true + }) + ]) +}} +

    Header with page name and icon

    +{{ + compExample([ + wmcadsPageHeader({ + title: true, + icon:'general-info' + }) + ]) +}} +

    Plain Header

    +{{ + compExample([ + wmcadsPageHeader({ + title: false + }) + ]) +}} +

    Plain Header - Large

    +

    Where a larger page header is needed you can use the following which will modify the height to 600px.

    +{{ + compExample([ + wmcadsPageHeader({ + title: false, + large: true + }) + ]) +}} +

    Homepage Header

    +{{ + compExample([ + wmcadsPageHeader({ + title: true, + text: "Building a healthier, happier, better connected and more prosperous West Midlands", + home: true + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/phase-indicator/index.njk b/src/www/pages/st/components/phase-indicator/index.njk new file mode 100644 index 00000000..710fadbc --- /dev/null +++ b/src/www/pages/st/components/phase-indicator/index.njk @@ -0,0 +1,40 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Phase indicators" %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + + +{# When #} +

    When to use it?

    + +

    + A service can either be in Alpha (prototype stage) or Beta (when it is on a publicly accessible website). +

    + + {% from "wmcads/components/phase-indicator/_phase-indicator.njk" import wmcadsPhaseIndicator %} + {% from "wmcads/components/phase-indicator/_phase-indicator-link.njk" import wmcadsPhaseIndicatorLink %} + {% from "www/_partials/component-example/component-example.njk" import compExample %} + {{ + compExample([wmcadsPhaseIndicator()]) + + }} +{% endblock %} diff --git a/src/www/pages/st/components/portfolio-leads/index.njk b/src/www/pages/st/components/portfolio-leads/index.njk new file mode 100644 index 00000000..23493ca1 --- /dev/null +++ b/src/www/pages/st/components/portfolio-leads/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Portfolio leads" %} +{% from "wmcads/components/portfolio-leads/_portfolio-leads.njk" import wmcadsPortfolioLeads %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{{ + compExample([ + wmcadsPortfolioLeads() + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/share/index.njk b/src/www/pages/st/components/share/index.njk new file mode 100644 index 00000000..a753c8bb --- /dev/null +++ b/src/www/pages/st/components/share/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Share" %} +{% from "wmcads/components/share/_share.njk" import wmcadsShare %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{{ + compExample([ + wmcadsShare() + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/table/index.njk b/src/www/pages/st/components/table/index.njk new file mode 100644 index 00000000..91d3d6df --- /dev/null +++ b/src/www/pages/st/components/table/index.njk @@ -0,0 +1,80 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Table" %} +{% from "wmcads/components/table/_table.njk" import wmcadsTable %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

    About

    +

    What does it do?

    + +

    + When to use it? +

    + +

    + When not to use it? +

    + +

    + How it works +

    + + +
    +

    +{# Table #} +

    Table with Headers

    +{{ + compExample([ + wmcadsTable({ + rows: 3, + cols: 3, + caption: "Table Title" + }) + ]) +}} +{# End Table #} + +{# Table #} +

    Table without Headers

    +{{ + compExample([ + wmcadsTable({ + rows: 3, + cols: 3, + caption: "Table Title", + noHeaders: true + }) + ]) +}} +{# End Table #} + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/tag/index.njk b/src/www/pages/st/components/tag/index.njk new file mode 100644 index 00000000..f16fc018 --- /dev/null +++ b/src/www/pages/st/components/tag/index.njk @@ -0,0 +1,15 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Tag" %} +{% from "wmcads/components/tag/_tag.njk" import wmcadsTag %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{{ + compExample([ + wmcadsTag({ + text: 'info' + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/video-embed/index.njk b/src/www/pages/st/components/video-embed/index.njk new file mode 100644 index 00000000..0d7098f1 --- /dev/null +++ b/src/www/pages/st/components/video-embed/index.njk @@ -0,0 +1,26 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Video embed" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{# Macros #} +{% from "wmcads/components/video-embed/_video-embed.njk" import wmcadsVideoEmbed %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + + +{{ + compExample([ + wmcadsVideoEmbed({ + }) + ]) +}} + +

    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/components/warning-text/index.njk b/src/www/pages/st/components/warning-text/index.njk new file mode 100644 index 00000000..66eed249 --- /dev/null +++ b/src/www/pages/st/components/warning-text/index.njk @@ -0,0 +1,101 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Warning Text" %} +{% from "wmcads/components/warning-text/_warning-text.njk" import wmcadsWarningText %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

    About

    +

    What does it do?

    + +

    + When to use it? +

    +

    Use the warning for information that:

    + +

    + When not to use it? +

    + +

    + How it works +

    + + +
    +

    +{# Warning Text #} +

    Warning Text with exclamation mark icon - triangle

    +{{ + compExample([ + wmcadsWarningText({ + text: "Warning! Type something.", + icon: "general-warning-triangle" + }) + ]) +}} +{# End Warning Text #} + +{# Warning Text #} +

    Warning text with exclamation mark icon - round

    +{{ + compExample([ + wmcadsWarningText({ + text: "Warning! Type something.", + icon: "general-warning-circle" + }) + ]) +}} +{# End Warning Text #} + +{# Warning Text #} +

    Warning text with info icon - round

    +{{ + compExample([ + wmcadsWarningText({ + text: "Warning! Type something.", + icon: "general-info" + }) + ]) +}} +{# End Warning Text #} + +{# Warning Text #} +

    Warning text with success icon - round

    +{{ + compExample([ + wmcadsWarningText({ + text: "Type something.", + icon: "general-success" + }) + ]) +}} +{# End Warning Text #} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/index.njk b/src/www/pages/st/index.njk index cc3733bf..4279fc41 100755 --- a/src/www/pages/st/index.njk +++ b/src/www/pages/st/index.njk @@ -40,7 +40,7 @@ copy: "

    Make your service look and feel like WMCA: colours, icons, typography and utility classes

    ", smallTitle: true, readMore: true, - link: '/styles/', + link: '/st/styles/', linkText: 'Read more about styles', linkTitle: 'Styles' }) @@ -55,7 +55,7 @@ copy: "

    Reusable parts of the user interface: content, map and form elements; buttons and messages

    ", smallTitle: true, readMore: true, - link: '/components/', + link: '/st/components/', linkText: 'Read more about components', linkTitle: 'Components' }) @@ -70,7 +70,7 @@ copy: "

    Commonly used sets of components

    ", smallTitle: true, readMore: true, - link: '/patterns/', + link: '/st/patterns/', linkText: 'Read more about patterns', linkTitle: 'Patterns' }) @@ -85,7 +85,7 @@ copy: "

    Example template layouts

    ", smallTitle: true, readMore: true, - link: '/templates/', + link: '/st/templates/', linkText: 'Read more about templates', linkTitle: 'Templates' }) diff --git a/src/www/pages/st/patterns/autocomplete/index.njk b/src/www/pages/st/patterns/autocomplete/index.njk new file mode 100644 index 00000000..4bb89301 --- /dev/null +++ b/src/www/pages/st/patterns/autocomplete/index.njk @@ -0,0 +1,135 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Autocomplete" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{# Imports #} +{% from "wmcads/patterns/autocomplete/_autocomplete.njk" import wmcadsAutocomplete %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    +

    + The autocomplete component is an input field that offers the user text suggestions as they type.
    + This is often done by hitting an API endpoint with the users query when the user has finished typing. +

    +

    + The autocomplete pattern is a combination of the input and loader components. +

    +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + + +


    +{# Default #} +

    Default state

    +

    In its default state, the autcomplete component is made up of a text input with a search icon.

    +

    For best practice, ensure that the placeholder and aria-label describes what the autocompletes intended purpose is.

    +

    Notice that there is also a ds-loader component nested within the autocomplete, more on that in the next section.

    +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoComplete", + query: '' + }) + ]) | trim +}} + + +

    +{# Loading #} +

    Loading

    +

    + When a user types in a query, you may want to have some code that hits an API or gets the data/suggestions for the autocomplete from somewhere. To help users understand that they need to wait for something we can change the autocomplete to a loading state. + We do this by adding the class ds--is-loading to the top level of the autocomplete (this is the only difference between the loading state and default state code snippets). +

    +

    As mentioned in the previous section, there is a ds-loader component nested in the autocomplete.
    When adding the ds--is-loading class, it will hide the search icon and show the loading spinner in it's place.

    +

    Below is an example of how the autocomplete looks when a user has typed in 'My query' and is waiting for autocomplete suggestions to load.

    + +

    It is good practice to:

    + +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteQuery", + query: 'My query', + loading: true + }) + ]) | trim +}} + + +

    +{# Results #} +

    Suggestions

    +

    The final state of the autocomplete is showing the suggestions.

    +

    You'll notice there is a new section in the code snippet called ds-autocomplete-suggestions, this should be shown/visible when your API/data has loaded the suggestions.

    +

    It's good practice to:

    + + +

    Default (text)

    +

    The most commonly used suggestions will be displayed as text only.

    +

    + It is good practice to: +

    + + +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteSuggestions", + showSuggestions: true, + textSuggestions: true, + query: 'My query' + }) + ]) | trim +}} + +{# With disruption indicator #} +

    With disruption indicator

    +

    + This autocomplete is combined with the medium / normal - disruption indicator component. +

    +

    You will notice that the suggestions are much bigger than text only results, and have an overflow scrollbar. This scrollbar will appear if the height of the suggestion container goes over a certain height.

    +

    + As you can see from the code snippet, the main ds-autocomplete-suggestions and ds-autocomplete-suggestions__li classes are prevelant on the ul and li elements. Within the li element we have nested the disruption indicator component whilst also using the wmcads grid. This gives enough flexibility to style the suggestions to how we want, find out more in the next section. +

    +{{ + compExample([ + wmcadsAutocomplete({ + showSuggestions: true, + query: 'x15' + }) + ]) | trim +}} + +

    Customising suggestions

    +

    There are many ways in which you can show the suggestions, as the autocomplete component has been built in a way that the suggestion results can be custom styled to how you like.

    +

    + As long as you have the ul element with the class ds-autocomplete-suggestions which contains a direct child li element that has the class ds-autocomplete-suggestions__li then you can fully customise how you want the suggestions to look. +

    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/patterns/banner/index.njk b/src/www/pages/st/patterns/banner/index.njk new file mode 100644 index 00000000..6f2df8a8 --- /dev/null +++ b/src/www/pages/st/patterns/banner/index.njk @@ -0,0 +1,273 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Banner" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/banner/_banner.njk" import wmcadsBanner %} + +{% block content %} + +{% markdown %} + +## Normal + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentHTML: "This is a new service - your feedback will help us to improve it." + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Banner with phase indicator #} + +## With phase indicator + +{# What #} + +### What does it do? + +- Helps users to identify when a service is new +- Offers users the opportunity to give feedback about a new service + {# When to #} + +### When to use it? + +- When a service is new + +{# When not to #} + +### When not to use it? + +- On a service that has matured and has a steadily positive rate of satisfaction + +{# How #} + +### How it works + +- A service can be in Alpha (prototype stage) or Beta (when it is on a publicly-accessible website) +- The survey link must point to a Hotjar or service feedback survey, with the service name within the URL. For example, /?serviceName=descriptiveName. + A service can either be in Alpha (prototype stage) or Beta (when it is on a publicly accessible website). + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + phase: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Emergency banner #} + +## Emergency banner + +{# What #} + +

    What does it do

    + +- It communicates emergency information and provides advice on what to do. +- When an emergency is no longer relevant, the content will be archived or removed. + +{# When to #} + +

    When to use it?

    + +- When you need to communicate information that is urgent or critical, which will potentially affect a large group of our users. For example, if there is an emergency situation announced in Birmingham, the banner would advise all users on travel updates and guidance. +- The emergency banner should be placed directly below the main navigation. +- Only show one emergency banner notification at a time. + +{# When not to #} + +

    When not to use it?

    + +- When a warning or emergency is directly related to a task the user is completing. In this case, use the appropriate Message component to notify users of any issues. +- If the issue is related to a service we are providing such as our customer service, you should place the Warning text and Inset text components next to the affected service, detailing the issue. +- Any disruptions to travel will be highlighted on the home page through the Disruption indicator components. + +{# How #} + +

    How it works

    + +- The user can dismiss the Emergency banner through the 'Close' link. This will remove the current emergency banner from all pages they visit on the website. +- The On-page variant is only shown when a user is on the Emergency advice page, which can be accessed through the 'Read our latest advice' link. + +{# Sitewide #} + +### Sitewide + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} +{# On-page #} + +### On-page variant + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true, + onPage: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} +{% markdown %} + +{# Hub page banner #} + +## Hub page banner + +{# What #} + +

    What does it do?

    + +- Helps users to identify they have eventered a Hub section of the website +- Provides users with a short description of the chosen hub of the WMCA + +{# When #} + +

    When to use it?

    + +- Only on Hub Landing Pages + +

    When not to use it?

    + +- On pages where the content is not related to a hub overview + +

    How it works

    + +- The image container width will expand if users are viewing the page with a browser width higher than 1280px. +- The image within the container will zoom to fill the size of the image container. +- The image will be hidden on mobile devices. Our previous research found mobile users do not see the value of images on mobile pages. +- The image, optional logo or icon will change for each hub landing page. + +{% endmarkdown %} + +{% from "wmcads/patterns/hub-page-banner/_hub-page-banner.njk" import wmcadsHubPageBanner %} + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using a short description" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using an example brand logo with a longer text description", + logo: true + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{{ + compExample([ + wmcadsHubPageBanner({ + title: "Hub Header with a longer example title" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} + +{# Homepage banner #} + +## Homepage + +{# What #} + +

    What does it do?

    + +- Provides a complementary image associated with the West Midlands +- Highlights a welcome message for visitors of the West Midlands Combined Authority site + +{# When #} + +

    When to use it?

    + +- On the homepage + +

    When not to use it?

    + +- Regular content pages + +{% endmarkdown %} + +{% from "wmcads/patterns/banner/homepage-banner/_homepage-banner.njk" import wmcadsHomepageBanner %} + +{{ + compExample([ + wmcadsHomepageBanner() + ], { + componentPath: "wmcads/patterns/banner/homepage-banner/", + njk: true, + njkProps: wmcadsHomepageBannerProps + }) +}} + +{% endblock %} diff --git a/src/www/pages/st/patterns/board-members/index.njk b/src/www/pages/st/patterns/board-members/index.njk new file mode 100644 index 00000000..8abeaaf5 --- /dev/null +++ b/src/www/pages/st/patterns/board-members/index.njk @@ -0,0 +1,22 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Board Members" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{# Imports #} +{% from "wmcads/patterns/board-members/_board-members.njk" import wmcadsBoardMembers %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# Board members #} +

    Board Members

    + +{{ + compExample([ + wmcadsBoardMembers({ + + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/patterns/contact-details/index.njk b/src/www/pages/st/patterns/contact-details/index.njk new file mode 100644 index 00000000..c26dd6fc --- /dev/null +++ b/src/www/pages/st/patterns/contact-details/index.njk @@ -0,0 +1,111 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Contact details" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{# Imports #} +{% from "wmcads/patterns/contact-details/_contact-details.njk" import wmcadsContactDetails %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    About

    + {# What #} +

    What does it do?

    + + {# When #} +

    When to use it?

    + + {# When not #} +

    When not to use it?

    + + {# How it works #} +

    How it works?

    + +

    + GOV.UK has detailed information about how to display contact details. +

    + + +

    Contact Details - Address

    + + {{ + compExample([ + wmcadsInsetText( + { + thinner : true, + html: "Customer Services
    Transport for West Midlands
    16 Summer Lane
    Birmingham
    B19 3SD" + } + ) + ]) + }} + + +

    Contact Details - Template

    + + {{ + compExample([ + wmcadsInsetText({html: + wmcadsContactDetails({ + warningText: "We are currently experiencing problems with our
    telephone systems and cannot answer calls", + warningIcon: "general-warning-triangle", + content: " + customerservice@tfwm.org.uk
    + Telephone: 0345 303 6760
    + Monday to Tuesday and Thursday to Friday, 9am - 5pm,
    + Wednesday, 9.30am - 5pm" + }) | indent(6) | trim + }) + ]) + }} + + + +

    Contact Details - Template TfWM

    + + {{ + compExample([ + wmcadsInsetText({ + html: " +

    Transport for West Midlands

    +

    + Twitter
    + Facebook
    +

    +

    + Submit an enquiry
    + Telephone: 0345 303 6760
    +

    + Monday to Tuesday and Thursday to Friday, 9am - 5pm,
    + Wednesday, 9.30am - 5pm
    + Saturday and Sunday, closed + " + }) + ]) + }} + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/patterns/content-cards/index.njk b/src/www/pages/st/patterns/content-cards/index.njk new file mode 100644 index 00000000..5447f609 --- /dev/null +++ b/src/www/pages/st/patterns/content-cards/index.njk @@ -0,0 +1,237 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Content cards" %} +{% set section="Patterns" %} +{% set ds = 'st' %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +

    These are common applications of the content card component.

    +
    + +

    +{# Map card #} +

    Map card

    +{# What #} +

    What is it?

    + + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{# Map example #} +{% from "wmcads/patterns/content-cards/map/_map.njk" import wmcadsContentCardMap %} + +{{ + compExample([ + wmcadsContentCardMap() + ]) +}} + +

    +{# Travel update card #} +

    Travel update card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{# Set up travel updates #} +{% from "wmcads/patterns/content-cards/travel-updates/_travel-updates.njk" import wmcadsContentCardTravelUpdates %} + +{{ + compExample([ + wmcadsContentCardTravelUpdates() + ]) +}} + +

    +{# Button card #} +

    Button card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{# Set up buttons #} +{% from "wmcads/patterns/content-cards/buttons/_buttons.njk" import wmcadsContentCardButtons %} + +{{ + compExample([ + wmcadsContentCardButtons() + ]) +}} + +

    +{# Image card #} +

    Image card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When to to #} +

    When not to use it?

    + + +{# Set up image #} +{% from "wmcads/patterns/content-cards/image/_image.njk" import wmcadsContentCardImage %} + +{{ + compExample([ + wmcadsContentCardImage() + ]) +}} + +

    +{# In-line navigation card #} +

    In-line navigation card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# How to #} +

    How to use it

    + + +{# Set up inline navigation #} +{% from "wmcads/patterns/content-cards/inline-navigation/_inline-navigation.njk" import wmcadsContentCardInlineNavigation %} + +{{ + compExample([ + wmcadsContentCardInlineNavigation() + ]) +}} + +{# With current page #} +

    In-line navigation with current page

    + +{{ + compExample([ + wmcadsContentCardInlineNavigation({ + withCurrentPage: true + }) + ]) +}} + +

    +{# Email sign up card #} +

    Email sign up card

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +

    When adding a sign up form from Campaign Monitor, you are provided with HTML markup, but make sure not to change any of the generated attributes except for classes.

    +

    They have been changed in the following examples to avoid accessibility errors.

    +
    + +{# Set up email sign up #} +{% from "wmcads/patterns/content-cards/email-sign-up/_email-sign-up.njk" import wmcadsContentCardEmailSignUp %} + +{# Collapsed #} +

    Collapsed

    +

    This is the default state for the email sign up card.

    + +{{ + compExample([ + wmcadsContentCardEmailSignUp({ exampleSuffix: "example-1"}) + ]) +}} + +{# Expanded #} +

    Expanded

    +

    The collapsed card will expand when the 'continue' button is pressed/tapped.

    + +{{ + compExample([ + wmcadsContentCardEmailSignUp({ expanded: true, exampleSuffix: "example-2" }) + ]) +}} + +{# External link #} +

    External link

    +

    Use this content card when you want to send users to an external Campaign Monitor form if you want to capture more user data such as demographics, travel habits etc.

    + +{{ + compExample([ + wmcadsContentCardEmailSignUp({ externalLink: true, exampleSuffix: "example-3" }) + ]) +}} +{% endblock %} diff --git a/src/www/pages/st/patterns/cookies/index.njk b/src/www/pages/st/patterns/cookies/index.njk new file mode 100644 index 00000000..c2d1a93a --- /dev/null +++ b/src/www/pages/st/patterns/cookies/index.njk @@ -0,0 +1,87 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} {% set pageTitle = "Cookies" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/cookies/cookies-banner/_cookies-banner.njk" import wmcadsCookiesBanner %} +{% from "wmcads/patterns/cookies/cookies-manager/_cookies-manager.njk" import wmcadsCookiesManager %} + +{% block content %} + +

    About

    +{# What #} +

    What does it do?

    + +
    +

    +

    Cookie banner

    +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# How #} +

    How it works

    + +

    The Cookies banner should be placed above the main header and be on every page

    + +{{ + compExample([ + wmcadsCookiesBanner() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: false + }) | trim }} + +

    +

    Manage Cookies

    +{# When to #} +

    When to use it?

    + + +{{ + compExample([ + wmcadsCookiesManager() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: true + }) | trim }} + +{% endblock %} diff --git a/src/www/pages/st/patterns/feedback-loop/index.njk b/src/www/pages/st/patterns/feedback-loop/index.njk new file mode 100644 index 00000000..bf895172 --- /dev/null +++ b/src/www/pages/st/patterns/feedback-loop/index.njk @@ -0,0 +1,47 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Feedback loop" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/feedback-loop/_feedback-loop.njk" import wmcadsFeedbackLoop %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +
    +

    + +{{ + compExample([ + wmcadsFeedbackLoop({ + id: 'fb' + }) + ]) +}} + +

    +

    Open

    +{{ + compExample([ + wmcadsFeedbackLoop({ + isOpen: true, + id: 'fb-open' + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/patterns/footer/index.njk b/src/www/pages/st/patterns/footer/index.njk new file mode 100644 index 00000000..e5376086 --- /dev/null +++ b/src/www/pages/st/patterns/footer/index.njk @@ -0,0 +1,156 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Footer" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + + +

    +{# Full footer #} +

    Full variant of footer

    +

    The full variant of the footer may include menus which become collapsible on smaller devices.

    +

    To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

    +{{ + compExample([ + wmcadsFooter({ + columns: 3, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +

    +

    2 Column Variant

    + +{{ + compExample([ + wmcadsFooter({ + columns: 2, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + })], + { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
    + + +{# Mobile app variant #} + +

    When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the Transport for West Midlands footer.

    + +

    The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

    + +

    To use the mobile app variant:

    + + +

    + You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

    + +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/patterns/header-and-footer/index.njk b/src/www/pages/st/patterns/header-and-footer/index.njk new file mode 100644 index 00000000..d1e6d85a --- /dev/null +++ b/src/www/pages/st/patterns/header-and-footer/index.njk @@ -0,0 +1,213 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header and footer" %} +{% set section="Patterns" %} +{% set ds = 'st' %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +
    +

    + + + +{# Header #} +

    Header

    +{# Skip Link #} +

    Skip link

    +

    There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

    +

    Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

    +{# Logo #} +

    Logo

    +

    This must always be the West Midlands Combined Authority logo.

    +{# Phase indicator #} +

    Phase indicator

    +

    This component must be used if the service is not live, using the phase indicator guidance.

    +{# Navigation #} +

    Navigation

    +

    The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

    +

    The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

    +

    We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

    +{# Mobile apps #} +

    Mobile apps

    +

    When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

    +{# Search #} +

    Search

    +

    This functionality only shows for desktop and tablet users. When clicked, search expands and takes over the whole page.

    + +{{ + compExample([ + wmcadsHeader ({ + id: "mega-menu", + navItems: navItems, + banner: true, + linkTopLevel: true, + search: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + } + }) + ]) +}} + +{# With title variant #} +

    With a title variant of header

    +

    When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

    + +

    To use the title variant:

    + + + +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + withTitle: true, + id: "basic" + }) + ]) +}} + + +{# Mobile app variant #} +

    Mobile app variant of header

    +

    When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority header.

    + +

    To use the mobile app variant:

    + + +

    + You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'footer pattern', + link: '#mobile-app-footer' + }) + }} . +

    + +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + app: true, + exampleAria: "Mobile app header" + }) + ]) +}} + +

    + + +{# Full footer #} +

    Full variant of footer

    +

    The full variant of the footer may include menus which become collapsible on smaller devices.

    +

    To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

    +{{ + compExample([ + wmcadsFooter({ + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About West Midlands Combined Authority" + }, { + name: "WMCA Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
    + + +{# Mobile app variant #} + +

    When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority footer.

    + +

    The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

    + +

    To use the mobile app variant:

    + + +

    + You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

    + +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/patterns/header-demo/index.njk b/src/www/pages/st/patterns/header-demo/index.njk new file mode 100644 index 00000000..c32de977 --- /dev/null +++ b/src/www/pages/st/patterns/header-demo/index.njk @@ -0,0 +1,220 @@ + + + + {% include "www/_partials/_head.njk" %} + + + + + + {# header #} + {% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} + {{ + wmcadsHeader({ + id: "mega-menu-example", + search: true, + searchSuggestions: ["See live departures", "Find a timetable", "Check for disruptions", "Manage my Swift card", "Find ticket prices", "Get a refund", "Update Direct Debit", "Apply for a 16-18 photocard"], + navItems: [{ + name: "Plan a journey", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Swift and tickets", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "Get help", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + }], + megaMenu: true + }) + }} + {# header #} + + + {# main #} +
    + Close window +
    + {# main #} + + + {% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} + {{ + wmcadsFooter({ + bottomMenu: [{ + name: "Privacy & Cookies Policy", + link: "https://www.wmca.org.uk/privacy-cookies-policy/" + }] + }) + }} + + + + {% include "www/_partials/_scripts.njk" %} + + + + diff --git a/src/www/pages/st/patterns/header/index.njk b/src/www/pages/st/patterns/header/index.njk new file mode 100644 index 00000000..9cd9075a --- /dev/null +++ b/src/www/pages/st/patterns/header/index.njk @@ -0,0 +1,305 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/header-v2/_header-v2.njk" import wmcadsHeaderV2 %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/warning-text/_warning-text.njk" import wmcadsWarningText %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + + + +{# Header #} +

    Header

    +{# Skip Link #} +

    Skip link

    +

    There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

    +

    Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

    +{# Logo #} +

    Logo

    +

    This must always be the Transport for West Midlands logo.

    +{# Phase indicator #} +

    Phase indicator

    +

    This component must be used if the service is not live, using the phase indicator guidance.

    +{# Navigation #} +

    Navigation

    +

    The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

    +

    The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

    +

    We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

    +{# Mobile apps #} +

    Mobile apps

    +

    When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

    +{# Search #} +

    Search

    +

    This function expands the mega menu and reveals the search bar along with the ‘I want to…’ feature.

    +

    The ‘I want to...’ feature shows a list of the top page links which users access through search. This is to help users find the information they are searching for faster. These links are regularly updated using search data to maintain their relevance.

    +

    On mobile, the mega menu search function uses a primary purple background instead of the standard white background. Our user testing found users preferred the white link text on the primary purple background as it is clearer to read.

    + +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example-full", + navItems: [{ + name: "Styles" + },{ + name: "Components" + },{ + name: "Patterns" + },{ + name: "User research" + }], + banner: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + }, + exampleAria: "Full header", + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With mega menu #} +

    Mega menu with search example

    + +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example", + search: true, + placeholder: "fg", + brand: "wmca", + navItems: [{ + name: "The Mayor", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Who we are", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "What we do", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + },{ + name: "In my area" + },{ + name: "Contact us" + }], + megaMenu: true, + megaMenuDemo: true + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With title variant #} +

    With a title variant of header

    +

    When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

    + +

    To use the title variant:

    + + + +{{ + compExample([ + wmcadsHeaderV2({ + withTitle: true, + legacyMenu: true, + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +

    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/patterns/index.njk b/src/www/pages/st/patterns/index.njk new file mode 100644 index 00000000..c2a26ac6 --- /dev/null +++ b/src/www/pages/st/patterns/index.njk @@ -0,0 +1,16 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Patterns" %} +{% set section = "Patterns" %} +{% set ds = 'st' %} + +{% block content %} +

    Patterns are reusable parts of the user interface that have been made to support a variety of + applications.

    + +

    Individual patterns can be used in multiple different patterns and contexts. For example, the + text input component + can be used to ask for an email address, a National Insurance number or someone’s name.

    +

    If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples provided + will render exactly as they do inside the Design System.

    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/patterns/question-form/index.njk b/src/www/pages/st/patterns/question-form/index.njk new file mode 100644 index 00000000..6a51dd62 --- /dev/null +++ b/src/www/pages/st/patterns/question-form/index.njk @@ -0,0 +1,127 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Question form" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + +

    How it works?

    + + + +

    + {# Form Element #} +

    Form Element

    +

    This pattern can be populated with any form element, such as text, radio buttons, checkboxes, dropdown or file upload.

    + {% from "wmcads/patterns/question/form-element/_form-element.njk" import wmcadsFormElement %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsFormElement({ + text: "Question title", + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Form Element #} + + +

    + {# Reference #} +

    Reference

    +

    This pattern shows a question that shows defined steps and uses the backlink and progress indicator component.

    + {% from "wmcads/patterns/question/reference/_reference.njk" import wmcadsReference %} + {% from "wmcads/components/form-elements/input/_input.njk" import wmcadsInput %} + {{ + compExample([ + wmcadsReference({ + question: "What is your Direct Debit Reference?", + text: "

    This can be found in the email we sent you asking you to reinstate your Direct Debit and begins with a 6.

    If you didn’t receive this email, it is shown next to every payment to WMCA for your Direct Debit on your bank statement.

    ", + actualSection: "1", + totalSections: "3", + sectionName: "About your ticket", + fields: + wmcadsInput({ + label: "Direct Debit Reference", + classNames: "ds-col-1-2" + }) , + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Reference #} + + +

    + {# Summary #} +

    Summary

    +

    This shows the user all of the data they have entered before they submit the form. This stage allows the user to change any details before submitting the form.

    + {% from "wmcads/patterns/question/summary/_summary.njk" import wmcadsSummary %} + {% from "wmcads/components/table/_table.njk" import wmcadsTable %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsSummary({ + question: "Check your answers before reinstating your Direct Debit", + html: +"

    Now send your request

    +

    By submitting this request you are confirming that, to the best of your knowledge, the details you are providing are correct.
    +
    You consent to West Midlands Combined Authority possibly changing your Direct Debit date if it usually would occur in the next 10 days.
    +
    You also consent to West Midlands Combined Authority reinstating your Direct Debit instruction.

    ", + button: + wmcadsButton({ + classNames: "ds-btn--start", + text: "Accept & Send ", + iconRight: "general-chevron-right" + }) + }) + + ]) + }} + {# End Summary #} + + +

    + {# Confirmation Message #} +

    Confirmation Message

    +

    This is a confirmation message to show that the user has successfully submitted the data in the form, along with a reference or any information which the user needs to be made aware of.

    + {% from "wmcads/patterns/question/confirmation-message/_confirmation-message.njk" import wmcadsConfirmationMessage %} + {{ + compExample([ + wmcadsConfirmationMessage() | indent(4) | trim + ]) + }} + {# End Confirmation Message #} + +{% endblock %} diff --git a/src/www/pages/st/patterns/search/index.njk b/src/www/pages/st/patterns/search/index.njk new file mode 100644 index 00000000..23922220 --- /dev/null +++ b/src/www/pages/st/patterns/search/index.njk @@ -0,0 +1,147 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Search" %} +{% set section="Patterns" %} +{% set ds = 'st' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    What does it do?

    + +

    When to use it?

    + +

    How it works

    + + +

    + {# Search bar #} +

    Search bar

    + {% from "wmcads/patterns/search/search-bar/_search-bar.njk" import wmcadsSearchbar %} + {{ + compExample([ + wmcadsSearchbar() + ]) + }} + {# End Search bar #} + + +

    + {# Sort #} +

    Sort

    +

    What does it do?

    + + {% from "wmcads/patterns/search/sort/_sort.njk" import wmcadsSearchSort %} + {{ + compExample([ + wmcadsSearchSort() + ]) + }} + {# End sort #} + +

    + {# Search filter #} +

    Filter

    +

    What does it do?

    + +

    When to use it?

    + + {% from "wmcads/patterns/search/search-filter/_search-filter.njk" import wmcadsSearchFilter %} + {{ + compExample([ + wmcadsSearchFilter( + { + accordion: [{ + summaryTitle: "Topic", + options: [ + "Tickets", "Travel advice", "Planning a journey" + ] + }, + { + summaryTitle: "Page type", + options: [ + "Services", "News", "Bus routes", "Timetables", "Offers and promotions" + ] + } + ]} + ) + ], { + componentPath: "wmcads/patterns/search/search-filter/", + njk: false, + js: true, + iframe: false + }) + }} + + {# End search filter #} +

    + {# Search result #} +

    Search result

    +

    What does it do?

    + +

    How it works

    + + {% from "wmcads/patterns/search/search-result/_search-result.njk" import wmcadsSearchResult %} + {{ + compExample([ + wmcadsSearchResult( + { + pageTitle: "Swift: The smarter way to travel", + breadcrumbs: ['Home', 'Swift'], + excerpt: "Swift is the easy and flexible way to travel around the West Midlands. find the swift card for you. How do you travel? bus…" + } + ) + ]) + }} + {# End search result #} +

    + {# Pagination #} +

    Pagination links

    +

    What does it do?

    + + {% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} + {{ + compExample([ + wmcadsPagination({ + pageCount: 8, + activePage: 1 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 5 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 8 + }) + ]) + }} + {# End pagination #} +

    + +{% endblock %} diff --git a/src/www/pages/st/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js b/src/www/pages/st/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js new file mode 100644 index 00000000..8371607f --- /dev/null +++ b/src/www/pages/st/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js @@ -0,0 +1,71 @@ +function aToZContentStyleGuide() { + // FUNCTIONS + // Change accordion state + const changeAccordionState = (accordionElem, changeStateToOpen = true) => { + const accordionBtn = accordionElem.querySelector('.ds-accordion__summary-wrapper'); + if (changeStateToOpen) { + accordionElem.classList.add('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', true); + } else { + accordionElem.classList.remove('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', false); + } + }; + + // Change all accordion states at once + const changeAllAccordionStates = changeStateToOpen => { + const accordions = document.querySelectorAll('main .ds-accordion'); + accordions.forEach(accordion => changeAccordionState(accordion, changeStateToOpen)); + }; + + // Scroll to an anchor within an accordion + const scrollToAnchor = idWithHash => { + // Check if element is on the page + const elem = document.querySelector(idWithHash); + if (!elem || elem.classList.contains('ds-accordion__summary-wrapper')) { + return; + } + // Open accordion and scroll to element + changeAccordionState(elem.parentElement.parentElement); + elem.scrollIntoView(); + }; + + // Check for anchor to scroll to onload + const scrollToAnchorOnLoad = () => { + if (document.location.hash) { + scrollToAnchor(document.location.hash); + } + }; + + // Add event listener to all section links on the page + const setupScrollToAnchor = () => { + const anchors = document.querySelectorAll('main a[href^="#"]:not([href="#"])'); + // Loop through an add event listener + anchors.forEach(anchor => { + anchor.addEventListener('click', e => { + e.preventDefault(); + scrollToAnchor(anchor.hash); + }); + }); + }; + + // Set up controls + const setupAccordionControls = () => { + const controls = document.querySelectorAll('main .js-accordion-controls button'); + + controls.forEach(control => { + control.addEventListener('click', () => { + changeAllAccordionStates(control.classList.contains('js-accordion-controls-open')); + }); + }); + }; + + // CALL FUNCTIONS + if (document.querySelector('#atozofstyle')) { + scrollToAnchorOnLoad(); + setupScrollToAnchor(); + setupAccordionControls(); + } +} + +export default aToZContentStyleGuide; diff --git a/src/www/pages/st/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json b/src/www/pages/st/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json new file mode 100644 index 00000000..143a4f85 --- /dev/null +++ b/src/www/pages/st/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json @@ -0,0 +1,538 @@ +{ + "aToZOfStyles": [ + { + "letter": "A", + "styles": [ + { + "title": "Abbreviations and acronyms", + "content": "

    The first time you use an abbreviation or acronym explain it in full on each page unless it's well known, like UK or BBC. Then refer to it by initials.

    Do not use full stops in abbreviations: BBC, not B.B.C.

    If you only use a term once, you don't need to include the abbreviation afterwards.

    Use 'm' (for millions) and 'bn' (for billions) for sums of money and measurable quantities: £10bn; 1bn litres of water. However, spell out for people and countable nouns: 3 billion commuters; 10 billion tickets.

    Use lower case for standard measurements: kg; km; lb; mph but use upper case for KB; GB; MB.

    Exception: Spell out metres to prevent confusion with abbreviation for million.

    Note:

    1. Do not include a space between the number and the unit: 20km; 50kph; 100KB
    2. Never add an 's' to measurements: 20km, not 20kms

    Use lower case for ie and eg, but avoid using these terms altogether where possible. Use 'that is' or 'for example' instead.

    " + }, + { + "title": "Active voice", + "content": "

    Use the active voice, not the passive voice - it’s easier to read. For example:

    We’re going to get the train tomorrow (active voice)

    A train is going to be caught by us tomorrow (passive voice)

    " + }, + { + "title": "Addresses", + "content": "

    Use the contact details design pattern. This shows you how to format addresses.

    " + }, + { + "title": "Addressing the user", + "content": "

    Address the user as 'you' wherever possible.

    " + }, + { + "title": "Adult rate", + "content": "

    Do not hyphenate.

    " + }, + { + "title": "Ages", + "content": "

    Do not use hyphens in ages unless to avoid confusion, although it's always best to write in a way that avoids ambiguity. For example, 'a class of 15 16-year-old students took the A level course' can be written as '15 students aged 16 took the A level course'.

    Write ages like this: XX years old (for example, 66 years old).

    Exception - use hyphens when talking about age groups:

    " + }, + { + "title": "American and UK English", + "content": "

    Use UK English spelling and grammar. For example, use 'organise' not 'organize', 'modelling' not 'modeling', and 'fill in a form', not 'fill out a form'.

    American proper nouns, like 4th Mechanized Brigade or World Health Organization, take American English spelling.

    " + }, + { + "title": "Ampersand", + "content": "

    Use and rather than &, unless it's a department's logo image or a company's name as it appears on the Companies House register.

    " + }, + { + "title": "Antisocial", + "content": "

    Hyphenated.

    " + }, + { + "title": "A-road", + "content": "

    Hyphenated.

    " + } + ] + }, + { + "letter": "B", + "styles": [ + { + "title": "Bacs (Bankers Automated Clearing System)", + "content": "

    Use the acronym as it's more widely known than the full name. No need to include the full name in brackets.

    " + }, + { + "title": "bold", + "content": "

    Only use bold for instructions when you’re talking about an interactive service.

    You can use bold to explain what field a user needs to fill in on a form, or what button they need to select. For example: \"Select Continue.\"

    Use bold sparingly - using too much will make it difficult for users to know which parts of your content they need to pay the most attention to.

    Do not use bold in other situations, for example to emphasise text.

    To emphasise words or phrases, you can:

    " + }, + { + "title": "bus station", + "content": "

    Only use upper case if you're talking about a specific bus station: Dudley Bus Station, Coventry Pool Bus Station.

    Use lower case if you're talking about bus stations in general: You can find bike racks at our bus stations.

    " + }, + { + "title": "borough council", + "content": "

    Lower case except in a name: Dudley Metropolitan Borough Council.

    " + }, + { + "title": "Bullet points and numbered steps", + "content": "

    You can use bullet points to make text easier to read. Make sure that:

    Bullets should normally form a complete sentence following from the lead text. But it's sometimes necessary to add a short phrase to clarify whether all or some of the points apply. For example, 'You can only register a pension scheme that is (one of the following):'

    The number and type of examples in a list may lead the user to believe the list is exhaustive. This can be dealt with by

    Numbered steps

    Use numbered steps instead of bullet points to guide a user through a process. List the things the user needs to do in order. You do not need a lead-in line. Steps end in a full stop because each should be a complete sentence.

    " + } + ] + }, + { + "letter": "C", + "styles": [ + { + "title": "campaign/scheme names and brands", + "content": "

    If you have a scheme or campaign brand, explain the brand. Don't expect users to understand what you mean. If you say ‘be aware and share’ or ‘get your roll and stroll on’ out of context, it’s not clear what that means.

    Don’t capitalise slogans like ‘be aware and share’. If you’re talking about a specific brand or campaign, use capitals. For example, Workwise, PassProtect. Don’t tell people to ‘Be Aware and Share’, but do say ‘the Be Aware and Share’ campaign.

    For example:

    " + }, + { + "title": "cash fare", + "content": "Do not use - it's confusing. Say 'ticket bought on the bus, train or tram on the day' instead." + }, + { + "title": "Capitalisation", + "content": "

    DO NOT USE BLOCK CAPITALS FOR LARGE AMOUNTS OF TEXT AS IT'S QUITE HARD TO READ.

    Always use lower case, even in page titles. The exceptions to this are proper nouns.

    " + }, + { + "title": "checkbox", + "content": "

    Not \"check box\"

    " + }, + { + "title": "child rate", + "content": "

    Do not hyphenate.

    " + }, + { + "title": "click", + "content": "

    Don't use \"click\" when talking about user interfaces because not all users click. Use \"select\".

    You can use \"right-click\" if the user needs to right-click to open up a list of options to progress through the user journey.

    " + }, + { + "title": "collective nouns", + "content": "

    Treat as singular, except staff and police: the committee has but the staff are; the police want.

    A pair and a couple are both plural.

    " + }, + { + "title": "concessionary", + "content": "

    Try to avoid. Use these instead:

    It’s okay to use concessionary if you’re talking about the English National Concessionary Travel Scheme.

    " + }, + { + "title": "contact details", + "content": "

    Use the contact details design pattern.

    " + }, + { + "title": "contactless", + "content": "

    Not Contactless.

    " + }, + { + "title": "contractions", + "content": "

    You can use contractions to help make your text less formal.

    Avoid negative contractions like can't and don't. Many users find them harder to read, or misread them as the opposite of what they say. Use cannot instead of can't; do not instead of don’t.

    Avoid should've, could've, would've, they've too. These can also be hard to read.

    " + }, + { + "title": "co-operation", + "content": "

    Hyphenated.

    " + }, + { + "title": "coronavirus (COVID-19)", + "content": "

    Coronavirus is the virus which causes the illness COVID-19. Coronavirus is lower case.

    " + }, + { + "title": "council", + "content": "

    Use lower case when writing about local councils in general. Use capitals for the official name of a local council, for example: Birmingham City Council.

    " + }, + { + "title": "Council Tax", + "content": "

    Upper case.

    " + }, + { + "title": "customers", + "content": "

    Refer to 'customers' rather than 'passengers'.

    " + } + ] + }, + { + "letter": "D", + "styles": [ + { + "title": "Dates", + "content": "

    Use 'to' instead of a dash or slash in date ranges. 'To' is quicker to read than a dash, and it's easier for screen readers.

    Always explain what your date range represents, for example 'tax year 2013 to 2014' or 'September 2013 to July 2014'. Date ranges can be the academic year, calendar year or tax year. This is why date ranges must be very, very clear.

    " + }, + { + "title": "daytime", + "content": "

    But night-time.

    " + }, + { + "title": "Direct Debit", + "content": "

    Upper case.

    " + }, + { + "title": "Direct Debit Instruction", + "content": "

    Upper case.

    " + }, + { + "title": "disabled access", + "content": "

    Use this term when referring to disabled accessibility, as 'accessibility' has a wider meaning.

    " + }, + { + "title": "disabled people", + "content": "

    Not 'the disabled' or 'people with disabilities'.

    Read GOV.UK advice on words to use and avoid when talking about disability.

    " + }, + { + "title": "district council", + "content": "

    Lower case even in a name, like Warwick district council.

    " + } + ] + }, + { + "letter": "E", + "styles": [ + { + "title": "eg, etc and ie", + "content": "

    eg can sometimes be read aloud as 'egg' by screen reading software. Instead use 'for example' or 'such as' or 'like' or 'including' - whichever works best in the specific context.

    etc can usually be avoided. Try using 'for example' or 'such as' or 'like' or 'including'. Never use etc at the end of a list starting with these words.

    ie - used to clarify a sentence - is not always well understood. Try (re)writing sentences to avoid the need to use it. If that is not possible, use an alternative such as 'meaning' or 'that is'.

    " + }, + { + "title": "email", + "content": "

    Not e-mail.

    Always give the full email address when providing a hyperlink. For example, 'email ticketing@twfm.org.uk' not 'email the ticketing team'

    " + } + ] + }, + { + "letter": "F", + "styles": [ + { + "title": "FAQs (frequently asked questions)", + "content": "

    Do not use FAQs.

    If you write content by starting with user needs, you will not need to use FAQs.

    FAQs are discouraged because they:

    " + }, + { + "title": "fine", + "content": "

    Use 'fine' instead of 'financial penalty'.

    For example, \"You'll pay a £50 fine.\"" + }, + { + "title": "first person", + "content": "

    Use \"we'\" and \"us\" when addressing the user where possible. For example, instead of \"West Midlands Combined Authority has…\" say \"We have\" - it’s more personal.

    " + }, + { + "title": "fire and rescue service", + "content": "

    Lower case.

    " + }, + { + "title": "focus", + "content": "

    Focuses/focused/focusing. Not focusses/focussed/focussing.

    " + } + ] + }, + { + "letter": "G", + "styles": [ + { + "title": "government", + "content": "

    Lower case unless it's a full title. For example: 'UK government', but 'Her Majesty's Government of the United Kingdom of Great Britain and Northern Ireland'.

    " + } + ] + }, + { + "letter": "H", + "styles": [ + { + "title": "Hyphenation", + "content": "

    Hyphenate:

    Do not hyphenate:

    Do not use a hyphen unless it's confusing without it, for example, a little used-car is different from a little-used car. You can also refer to The Guardian style guide for advice on hyphenation.

    Use 'to' for time and date ranges, not hyphens.

    " + } + ] + }, + { + "letter": "I", + "styles": [ + { + "title": "ie", + "content": "

    see eg, etc and ie

    " + }, + { + "title": "Italics", + "content": "

    Do not use italics. They can be hard to read online.

    " + } + ] + }, + { + "letter": "J", + "styles": [ + { + "title": "job titles", + "content": "

    Use upper case when referring to a specific role: Lord Mayor of Birmingham.

    Use lower case if writing generally: service assistants, station managers.

    " + }, + { + "title": "Journey Planner", + "content": "

    Our travel tool that helps with live route-planning across our network

    A stand-alone link to it should be action-led and first-person: 'Plan my journey'.

    If giving instruction, it can be second-person (to avoid mixing perspectives): 'Plan your journey'.

    If listing tools, we can use the product name: 'Journey Planner'.

    " + } + ] + }, + { + "letter": "L", + "styles": [ + { + "title": "Links", + "content": "

    Front-load your link text with the relevant terms and make them active and specific. Do not use ‘click here’. Use text that describes the link instead.

    " + }, + { + "title": "Lists", + "content": "

    Lists should be bulleted to make them easier to read. See bullets and steps.

    Very long lists can be written as a paragraph with a lead-in sentence if it looks better: 'The following countries are in the EU: Spain, France, Italy...'

    " + }, + { + "title": "log in", + "content": "

    See sign in or log in.

    " + } + ] + }, + { + "letter": "M", + "styles": [ + { + "title": "measurements", + "content": "

    Use lower case for standard measurements: kg; km; mph; kph but use upper case for KB; GB; MB.

    Spell out metres to prevent confusion with abbreviation for million.

    Do not include a space between the number and the unit: 20km; 50mph; 100KB.

    Never add an 's' to measurements: 20km, not 20kms.

    " + }, + { + "title": "Metro", + "content": "

    Only use when talking about the company that runs the tram - West Midlands Metro. To talk about the tram as a mode of transport, use tram, not Metro.

    " + }, + { + "title": "money", + "content": "

    Use the £ symbol: £75.

    Do not use decimals unless pence are included: £75.50 but not £75.00.

    Do not use '£0.xx million' for amounts less than £1 million.

    Write out pence in full: calls will cost 4 pence per minute from a landline.

    Currencies are lower case.

    " + } + ] + }, + { + "letter": "N", + "styles": [ + { + "title": "nBus", + "content": "

    Use when talking about network bus tickets - always use a lower case ‘n’, upper case ‘B’.

    " + }, + { + "title": "nNetwork", + "content": "

    Use when talking about network tickets for the bus, train and tram - always use a lower case ‘n’, followed by an upper case ‘N’.

    " + }, + { + "title": "nTrain", + "content": "

    Use when talking about network train tickets - always use a lower case ‘n’, upper case ‘T’.

    " + }, + { + "title": "Numbers", + "content": "

    Use 'one' unless you're talking about a step, a point in a list or another situation where using the numeral makes more sense: 'in point 1 of the design instructions', for example. Or this:

    You'll be shown 14 clips that feature everyday road scenes.

    There will be:

    1. developing hazard in 13 clips
    2. developing hazards in the other clip

    Write all other numbers in numerals (including 2 to 9) except where it's part of a common expression like 'one or two of them' where numerals would look strange.

    If a number starts a sentence, write it out in full (Thirty-four, for example) except where it starts a title or subheading.

    For numerals over 999 - insert a comma for clarity: 9,000

    Spell out common fractions like two-thirds.

    Use a % sign for percentages: 50%.

    Use a 0 where there's no digit before the decimal point.

    Use '500 to 900' and not '500-900' (except in tables and for the 16-18 photocard).

    Use MB for anything over 1MB: 4MB not 4096KB.

    Use KB for anything under 1MB: 569KB not 0.55MB.

    Keep it as accurate as possible and up to 2 decimal places: 4.03MB.

    Addresses: use 'to' in address ranges: 49 to 53 Cherry Street.

    Ordinal numbers

    Spell out first to ninth. After that use 10th, 11th and so on.

    In tables, use numerals throughout.

    " + }, + { + "title": "NXWM", + "content": "

    see operator names.

    " + } + ] + }, + { + "letter": "O", + "styles": [ + { + "title": "off-peak", + "content": "

    Use lower case and include a hyphen.

    " + }, + { + "title": "older people", + "content": "

    Refer to older people rather than elderly people.

    " + }, + { + "title": "online", + "content": "

    One word. Do not use 'on-line' or 'on line'.

    " + }, + { + "title": "operator names", + "content": "

    Do not abbreviate the name. For example, do not use ‘WM Metro’, ‘NX West Midlands’ or ‘West Mids Railway’.

    You can use an acronym for timetables and passenger information. For example, ‘West Midlands Metro (WMM)’, ‘National Express West Midlands (NXWM)’ or ‘West Midlands Railway (WMR)’.

    Do not use the NXWM acronym without explaining it first. It is not a well known acronym.

    " + }, + { + "title": "or", + "content": "

    Do not use slashes instead of \"or\". For example, do not say \"Do this 3/4 times\".

    " + }, + { + "title": "opt in/out", + "content": "

    Verb: I would like to opt in

    " + }, + { + "title": "opt-in/out", + "content": "

    Adjective: an opt-in clause

    " + } + ] + }, + { + "letter": "P", + "styles": [ + { + "title": "paper ticket", + "content": "

    A ticket that’s printed on paper, not on a Swift card.

    " + }, + { + "title": "passengers", + "content": "

    Refer to 'customers' rather than 'passengers'.

    " + }, + { + "title": "pay as you go", + "content": "

    Do not hyphenate and always use lower case.

    " + }, + { + "title": "pay as you go credit", + "content": "

    Use to describe Swift cards with a stored cash value

    Note: Do not use 'pay as you go travel value (cash)' or 'pay as you go cash value'.

    " + }, + { + "title": "PDF", + "content": "Upper case. No need to explain the acronym." + }, + { + "title": "plain English", + "content": "

    Lower case plain and upper case English unless in a title: the Plain English Campaign.

    All content should be written in plain English. You should also make sure you use language your audience will understand. Use the Plain English Campaign’s A to Z of alternative words to avoid complex language.

    " + }, + { + "title": "phone numbers", + "content": "

    Phone numbers should be split into at least three groups of digits for readability, ideally with no more than four digits in any single group. For example: 020 7378 1705; 0343 222 6666; 0762 480 4299. See also the design pattern for contact details.

    " + } + ] + }, + { + "letter": "Q", + "styles": [ + { + "title": "quotation marks", + "content": "

    Use single quotation marks in all cases.

    Use double quotation marks if using a quote within a quote.

    If a quote runs on longer than one paragraph, include quotation marks at the beginning of each subsequent paragraph but only at the end of the final paragraph.

    Place full stops and commas inside quotes when they are complete sentences, otherwise place them outside: 'I want to buy a ticket,' said Mr Smith; When he said 'I promise', he didn't really mean it.

    " + } + ] + }, + { + "letter": "R", + "styles": [ + { + "title": "real time/realtime", + "content": "

    Where possible, use 'live' instead of 'realtime' or 'real time'

    real time (noun): this information is being updated in real time.
    realtime (adjective): realtime service information.
    Not real-time.

    " + }, + { + "title": "re-open", + "content": "

    Not reopen.

    " + } + ] + }, + { + "letter": "S", + "styles": [ + { + "title": "seasons", + "content": "

    Use lower case for spring, summer, autumn and winter.

    " + }, + { + "title": "Sentence length", + "content": "

    Do not use long sentences. Check sentences with more than 25 words to see if you can split them to make them clearer.

    " + }, + { + "title": "sign in or log in", + "content": "

    Use sign in rather than log in (verb) for calls-to-action where users enter their details to access a service.

    Do not use login as a noun - say what the user actually needs to enter (like username, password, National Insurance number).

    " + }, + { + "title": "State Pension", + "content": "

    Upper case.

    " + }, + { + "title": "Station", + "content": "

    Lower case. For example, Birmingham New Street station. Do not say tram station, say tram stop.

    " + }, + { + "title": "Stop", + "content": "

    Lower case. For example, Summer Lane bus stop.

    " + }, + { + "title": "Swift card", + "content": "

    Do not capitalise 'Card'.

    " + }, + { + "title": "step-free", + "content": "

    A route between street and platform that doesn't require the use of stairs or escalators.

    " + } + ] + }, + { + "letter": "T", + "styles": [ + { + "title": "terms and conditions", + "content": "

    Not Terms and Conditions or terms & conditions.

    " + }, + { + "title": "text message alerts", + "content": "

    Not SMS alerts.

    " + }, + { + "title": "TfWM", + "content": "

    See entry on Transport for West Midlands.

    " + }, + { + "title": "Times", + "content": "

    use 'to' in time ranges, not hyphens, en rules or em dashes: 10am to 11am (not 10-11am)
    5:30pm (not 1730hrs)
    midnight (not 00:00)
    midday (not 12 noon, noon or 12pm)
    6 hours 30 minutes
    Midnight is the first minute of the day, not the last. You should consider using \"11:59pm\" to avoid confusion about a single, specific time.

    For example, \"You must register by 11:59pm on Tuesday 14 June.\" can only be read one way, but \"You must register by midnight on Tuesday 14 June\" can be read in two ways (the end of Monday 13, or end of Tuesday 14).

    Timetables and printed passenger information use the 24-hour clock in HHMM format.

    " + }, + { + "title": "tram", + "content": "

    Not Metro.

    " + }, + { + "title": "tram stop", + "content": "

    Not station.

    " + }, + { + "title": "Transport for West Midlands", + "content": "

    Avoid referring to Transport for West Midlands (TfWM). Users don't need to know about it while getting travel advice.

    Explaining the relationship between West Midlands Combined Authority, TfWM and West Midlands Combined Authority (WMCA) is complicated. Use \"we\" instead. For example, \"we manage the Key Route Network (KRN)\" with a link to the TfWM policy page.

    " + } + ] + }, + { + "letter": "U", + "styles": [ + { + "title": "under-16s", + "content": "

    Requires a hyphen in all cases. This is true whenever referring to age groups: under-16s; under-18s; over-60s.

    Avoid the common error of adding an apostrophe when making a word or abbreviation plural as this makes it possessive: under-16s not under-16's.

    " + }, + { + "title": "URL", + "content": "

    Upper case. No need to explain the acronym.

    " + }, + { + "title": "username", + "content": "

    Not \"user name\".

    " + } + ] + }, + { + "letter": "W", + "styles": [ + { + "title": "web", + "content": "

    Lower case.

    " + }, + { + "title": "webpage", + "content": "

    One word.

    " + }, + { + "title": "website", + "content": "

    Not web-site or web site.

    " + }, + { + "title": "West Midlands Combined Authority", + "content": "

    Avoid referring to West Midlands Combined Authority (WMCA). Users don't need to know about it while getting travel advice.

    The exception is if you referring to a statutory responsibility or a contract. For example, concessionary passes or terms and conditions.

    " + }, + { + "title": "wifi", + "content": "

    Lower case, no hyphen.

    " + }, + { + "title": "WMCA", + "content": "

    See entry on West Midlands Combined Authority.

    " + }, + { + "title": "wmca.org.uk", + "content": "

    If you are linking to another page, you should use an in-text link rather than the full URL. See the entry on links for more information.

    Sometimes it is better to show the full URL. For example, when telling users to click a link to verify something in an email.

    It is important to use the right URL. Only use wmca.org.uk.

    Do not prefix the URL with ‘www.’ as this makes our URL hard to read. The domain extension ‘.co.uk’ makes it obvious to users that it is a URL.

    " + }, + { + "title": "www.", + "content": "

    See entry on wmca.org.uk.

    " + } + ] + }, + { + "letter": "Z", + "styles": [ + { + "title": "zero-hours contract", + "content": "

    Not \"zero-hour contract\" or \"zero hours contract\"

    " + } + ] + } + ] +} diff --git a/src/www/pages/st/styles/a-to-z-content-style-guide/index.njk b/src/www/pages/st/styles/a-to-z-content-style-guide/index.njk new file mode 100644 index 00000000..0fdb3e55 --- /dev/null +++ b/src/www/pages/st/styles/a-to-z-content-style-guide/index.njk @@ -0,0 +1,131 @@ +{% extends "www/_layouts/layout-fullwidth.njk" %} +{% set pageTitle="A to Z content style guide" %} {% set section = "Styles" %} +{% set ds = 'st' %} + +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +
    +
    +

    Writing content for West Midlands Combined Authority

    +

    + You should create all content with user-focused content design principles. This means content has an identified + user need and is written in plain English. +

    +

    + Do not use marketing speak - users will be visiting your website to perform a task (for example, buy a train ticket or find out about Swift cards). Your content shouldn’t try to sell them anything - instead, tell them the information they need to know in the simplest way possible. +

    +

    + Research has shown that both high literacy and low literacy users prefer plain English because it takes less time to read. Users won’t be on your website for fun - so make the experience quick and easy. +

    +

    + To find out more about why plain language is important, read: +

    +

    +

    + Read the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/content-design/what-is-content-design', + linkTitle: 'GOV.UK introduction to content design', + contentText: 'GOV.UK introduction to content design' + }) + }} + to find out more about content design principles. +

    +

    Design Team can help you to test your content with user research.

    +
    +

    About the A-Z of style guide

    +

    This style guide will help you to use consistent words across West Midlands Combined Authority services.

    +

    + If something is not covered by this style guide, check the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style', + linkTitle: 'GOV.UK Style Guide', + contentText: 'GOV.UK style guide' + }) + }} + . You can also email Samresha Purewal if you think something is missing from this guidance.

    +
    +

    Introducing West Midlands Combined Authority

    +

    If you’re talking about day-to-day services (bus, train or tram), you + may need to make it clear that West Midlands Combined Authority does not run these.

    For example, you could say: "We don’t run the buses, trains or trams. We can point you in the right direction if you need help." +

    +
    +
    + {# A to Z accordions #} +
    +
    +

    A to Z of style

    +
    +
    + + +
    +
    +
    + {% for section in aToZOfStyles %} +
    + +
    + {% for style in section.styles %} +
    + {{style.title}} +
    + {{style.content | safe}} + {% endfor %} +
    +
    + {% endfor %} +
    +
    +
    +
    +{% endblock %} diff --git a/src/www/pages/st/styles/colour-palettes/_color-palettes.js b/src/www/pages/st/styles/colour-palettes/_color-palettes.js new file mode 100644 index 00000000..f7e01e7d --- /dev/null +++ b/src/www/pages/st/styles/colour-palettes/_color-palettes.js @@ -0,0 +1,22 @@ +function colorPalettes() { + const colors = document.querySelectorAll('.ds-website-color-swatch__inner'); + + // Function to convert rgb to hex + function rgb2hex(rgb) { + const newRGB = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); + function hex(x) { + return `0${parseInt(x, 10).toString(16)}`.slice(-2); + } + return `#${hex(newRGB[1])}${hex(newRGB[2])}${hex(newRGB[3])}`; + } + + colors.forEach(swatch => { + const ele = swatch; + const rgbColor = getComputedStyle(swatch).backgroundColor; + const hexColor = rgb2hex(rgbColor); + + ele.nextElementSibling.querySelector('pre code .color-hex').innerText = `color: '${hexColor}'`; + }); +} + +export default colorPalettes; diff --git a/src/www/pages/st/styles/colour-palettes/_colorPalette.scss b/src/www/pages/st/styles/colour-palettes/_colorPalette.scss new file mode 100644 index 00000000..1b04dd76 --- /dev/null +++ b/src/www/pages/st/styles/colour-palettes/_colorPalette.scss @@ -0,0 +1,18 @@ +$cp-swatch-height: 50px; + +.ds-website-color-swatch { + padding: $size-sm; + + &__inner { + display: inline-block; + width: 100%; + height: $cp-swatch-height; + margin-bottom: $size-sm; + } +} + +@each $color, $hex in $palettes { + .ds-website-bg-color-#{$color} { + background-color: $hex; + } +} diff --git a/src/www/pages/st/styles/colour-palettes/index.njk b/src/www/pages/st/styles/colour-palettes/index.njk new file mode 100644 index 00000000..cb38afff --- /dev/null +++ b/src/www/pages/st/styles/colour-palettes/index.njk @@ -0,0 +1,78 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Colour Palettes" %} +{% set section="Styles" %} +{% set ds = 'st' %} + +{% from "www/_partials/_color-palette-macro.njk" import colorPalette %} + +{% block content %} +{# About #} +

    About

    +

    Below are the list of West Midlands Combined Authority colour palettes.

    +

    + We have tested our colours against the three most prevalent colour blind anomalies: protanopia, deuteranopia and tritanopia. While in some circumstances, particularly protanopia, colours can appear to be relatively similar. +

    +

    + These issues can be circumvented by not referring to specific colours. For instance, when referring to a green button with the word 'start' in, the phrase 'click the green button to start' would not be helpful. Instead, use 'click the start button', without a colour reference. +

    +

    + W3C AA Accessibility criteria requires the contrast of test to be enhanced, with a contrast ratio upwards of 3:1. +

    +

    + All brand/web colours meet this criteria, though the modal colour 'WM Railway' must only be used for iconography and graphical devices. +

    +

    The background only colours can only be used as a background colour and they are not intended for any other use.

    +
    + +{# Using in development #} +

    Using in development

    +

    wmcads SCSS

    +

    If you are using WMCA Design System's SCSS in development, you shouldn't use the HEX values! Instead you should always use the scss variables instead, for example use get-color(primary) instead of #3c1053. This ensures you are always using the most up-to-date colour. To find out more on how to use the get-color() function in SCSS, please refer to the notes for @function get-color() in _mixins.scss.

    + +

    Without wmcads SCSS

    +

    If you are not using WMCA Design System's SCSS then it is recommended to use the hex values below. It is highly adviseable to set these up as variables in your development enviornment, this ensures that you can easily change them to keep up-to-date with our colour palettes.

    +

    If you'd like to see how we have set the variables up, you can check out $palettes in _vars.scss and @function get-color() in _mixins.scss.

    + +{# Brand colours #} +
    +

    Brand colours

    +
    + {% for color in colors.brand %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
    + +{# Web colours #} +
    +

    Web colours

    +
    + {% for color in colors.web %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
    + +{# Background Only colours #} +
    +

    Background only colours

    +
    + {% for color in colors.backgroundOnly %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
    + +{% endblock %} diff --git a/src/www/pages/st/styles/examples/grid-column-spacing.njk b/src/www/pages/st/styles/examples/grid-column-spacing.njk new file mode 100644 index 00000000..dacd0c0b --- /dev/null +++ b/src/www/pages/st/styles/examples/grid-column-spacing.njk @@ -0,0 +1,211 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid column spacing" %} +{% set section = "Styles" %} +{% set ds = 'st' %} + +{% block content %} +

    Introduction to wmcads Grid column spacing

    +

    + Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

    +

    + The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

    +

    + Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

    +

    + Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

    +

    + Where {breakpoint} is one of breakpoint sizes described in the grid section. +

    + +

    When to use Grid column spacing

    + + +

    Examples

    + +

    Example 1

    +

    This example shows the use of the ds-content-card component displayed in a grid of thirds with spacing of 1rem.

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    +
    + content image +
    +

    Contact us

    +

    Get in touch if you want to know more about the budget.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    +
    + content image +
    +

    Contact us

    +

    Get in touch if you want to know more about the budget.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    Example 2

    +

    This example shows the use of the ds-content-card component displayed in a half grid with spacing of 2rem.

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    Example 3

    +

    This example shows the use of the ds-content-card component displayed in a half grid with spacing controlled by breakpoints.

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +

    The default spacing is 0.75rem (ds-grid--spacing-2-sm). Once the page width goes over 768px the spacing changes to 1rem (ds-grid--spacing-md-2-md).

    + + + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/styles/examples/grid-examples.njk b/src/www/pages/st/styles/examples/grid-examples.njk new file mode 100644 index 00000000..31fdf235 --- /dev/null +++ b/src/www/pages/st/styles/examples/grid-examples.njk @@ -0,0 +1,336 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid Examples" %} +{% set section = "Styles" %} +{% set ds = 'st' %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    Introduction to wmcads Grids

    +

    Grid classes vs. unit classes

    +

    wmcads Grids consist of two types of classes: the grid class (ds-grid) and unit classes (ds-col-*)

    +

    The widths of the units are fractions

    +

    Units have various class names that represent their widths. For example, ds-u-1-2 has a width of 50%, whereas ds-u-1-5 would have a width of 20%.

    +

    All child elements of a grid must be units

    +

    Child elements contained within an element with a ds-grid classname must be a grid unit with a ds-col-* classname.

    +

    Content goes inside grid units

    +

    All content which is visible to people needs to be contained inside a grid unit. This ensures that the content will be rendered properly.

    + +

    Examples

    +

    Let's start with a simple example. Here's a grid with three columns:

    + +
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + {%- endfilter %} +
    +
    + +

    The above example will keep the columns the same width no matter the page width.

    + +

    Adding responsive classes

    +

    We can control the width by adding responsive classes.

    + +

    When using Responsive Grids, you can control how the grid behaves at specific breakpoints by adding class names. wmcads default responsive grids comes with the following class names and media query breakpoints.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Default Media Queries
    KeyCSS Media QueryAppliesClassname
    NoneNoneAlways.ds-col-*
    sm@media screen and (min-width: 35.5em)≥ 568px.ds-col-sm-*
    md@media screen and (min-width: 48em)≥ 768px.ds-col-md-*
    lg@media screen and (min-width: 64em)≥ 1024px.ds-col-lg-*
    xl@media screen and (min-width: 80em)≥ 1280px.ds-col-xl-*
    + +

    Let's modify the example so the columns become full width on mobile:

    + +
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + {%- endfilter %} +
    +
    + +

    The above example has a default width of 1 (ds-col-1) so when the page is viewed below 586px the columns will display full width. When the page is viewed over 586px the columns will appear in 3 coloumns (ds-col-sm-1-3). + + +

    Justify Content

    + +

    You can justify the grid content bby adding these classes:

    + +

    ds-grid--justify-between

    +

    Items will have space between them

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-around

    +

    Items will have space before, between, and after them

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-end

    +

    Items are positioned at the end of the container

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-center

    +

    Items are positioned in the center of the container

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-even

    +

    Items will have equal space around them

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/styles/icons/_icons.scss b/src/www/pages/st/styles/icons/_icons.scss new file mode 100644 index 00000000..d03435ca --- /dev/null +++ b/src/www/pages/st/styles/icons/_icons.scss @@ -0,0 +1,12 @@ +.website-icons { + svg { + width: 60px; + height: 60px; + padding: $size-sm; + fill: get-color(primary); + } + + .text-center { + text-align: center; + } +} diff --git a/src/www/pages/st/styles/icons/index.njk b/src/www/pages/st/styles/icons/index.njk new file mode 100644 index 00000000..3ab7ec80 --- /dev/null +++ b/src/www/pages/st/styles/icons/index.njk @@ -0,0 +1,188 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Icons" %} +{% set section = "Styles" %} +{% set ds = 'st' %} + +{# The icon vars are an array that match the folders they come from in src/assets/icon/{foldername} #} +{% set iconGeneral = [ + "arrow", + "caret-down", + "caret-up", + "checkmark", + "chevron-right", + "circle-hollow", + "circle-solid", + "cross", + "expand", + "favourite", + "file", + "filter", + "id-card", + "info", + "location-arrow", + "minimise", + "paperclip", + "pdf", + "html", + "search", + "success", + "swap", + "trash", + "warning-circle", + "warning-triangle" +] %} + +{% set iconSocial = [ + "facebook", + "facebook-hex", + "twitter", + "twitter-hex", + "instagram", + "instagram-hex", + "linkedin", + "linkedin-hex", + "youtube", + "youtube-hex", + "email" +] %} + +{% set iconPortfolio = [ + "culture-and-digital", + "economy", + "environment", + "housing-and-land", + "inclusive-communities", + "skills", + "transport", + "wellbeing" +] %} + + +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} + +{% block content %} +{# How to use #} +

    About

    + +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + +
    + +{# Using Icons #} +

    Using icons

    +

    WMCA Design System icons are available as an SVG sprite to include in your HTML page.

    +

    How to use

    +

    Recommended

    +

    The Recommended method of using the icon sprite sheet is to refer directly to the one used in the design system. This ensures that your icons will always be up to date.

    +

    To get started, include the below snippet of javascript somewhere in your codebase. This will:

    + +
    +  
    +  {%- filter forceescape -%}
    +  
    +  
    +  {%- endfilter %}
    +  
    +
    + +

    Displaying an icon

    +

    To display an icon or glyph, use an icon tag (from the icon section at the bottom of the page) with a href attribute and xlink:href (as a fallback). Make sure that the xlink and href tags are pointing to the location of your downloaded icon sprite sheet.

    +

    The ICON-TAG-NAME should be replaced with the icon tag name of the icon you want to show from the Icons section below, for example #ds-general-arrow should be in the xlink:href and href attributes of the svg's <use> element.

    +
    +  
    +    {{-
    +      wmcadsIcon({
    +        icon: 'ICON-TAG-NAME'
    +      }) | forceescape | trim
    +    -}}
    +  
    +
    + + +

    Can't include via recommended method? Try hosting the sprites locally

    + + +
    + +{# Icons #} +

    Icons

    +

    Find below a list of all our icons and their tags below. To use, don't forget to prefix the tag with 'ds-'

    +

    General

    +
    + {% for icon in iconGeneral %} +
    + {{ + wmcadsIcon({ + icon: 'general-' + icon + }) + }} +

    {{ 'general-' + icon }}

    +
    + {% endfor %} +
    + +{# Portfolios #} +

    Portfolios

    +
    + {% for icon in iconPortfolio %} +
    + {{ + wmcadsIcon({ + icon: 'portfolio-' + icon + }) + }} +

    {{ 'portfolio-' + icon }}

    +
    + {% endfor %} +
    + +{# Social #} +

    Social

    +
    + {% for icon in iconSocial %} +
    + {{ + wmcadsIcon({ + icon: 'social-' + icon + }) + }} +

    {{ 'social-' + icon }}

    +
    + {% endfor %} +
    + +{% endblock %} diff --git a/src/www/pages/st/styles/images/index.njk b/src/www/pages/st/styles/images/index.njk new file mode 100644 index 00000000..b2ae3c95 --- /dev/null +++ b/src/www/pages/st/styles/images/index.njk @@ -0,0 +1,29 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Images" %} +{% set section = "Styles" %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +

    For more guidance on how to use images, please check WMCA brand guidelines.

    + +{% endblock %} diff --git a/src/www/pages/st/styles/index.njk b/src/www/pages/st/styles/index.njk new file mode 100644 index 00000000..e6794927 --- /dev/null +++ b/src/www/pages/st/styles/index.njk @@ -0,0 +1,15 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Styles" %} +{% set section = "Styles" %} +{% set ds = 'st' %} + +{% block content %} +

    Make your service look and feel like WMCA Design System.

    +

    If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples in the + Design System will not need any additional styling.

    +

    If you need to apply styles manually, you should still follow existing WMCA Design System conventions. For + example, do not assign + new meanings to colours, do not change the style of buttons or adjust the thickness of borders on + form inputs.

    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/st/styles/layout/index.njk b/src/www/pages/st/styles/layout/index.njk new file mode 100644 index 00000000..110039eb --- /dev/null +++ b/src/www/pages/st/styles/layout/index.njk @@ -0,0 +1,84 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Layout" %} +{% set section = "Styles" %} +{% set ds = 'st' %} + +{% block content %} +{# Standard content template #} +

    Standard content template

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# Guidance #} +

    Guidance for content editors

    + +

    Warning text with exclamation mark icon component: Please read the Creating effective content section below before writing content or placing content into your page.

    + + +
    +{# Publicity campaign template #} +

    Publicity campaign template

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# Guidance #} +

    Guidance for content editors

    + + + +
    +{# Creating effective content #} +

    Creating effective content

    +

    There is no minimum or maximum page length, however:

    + +

    Use clear and concise content because the longer text, the lower rate of readability and comprehension drops significantly.

    +

    Always place content with higher importance at the top of the page, with less important content following after.

    +

    If you have to use long content, break it down into smaller sections to make it easier for user to understand information. You can:

    + + +{% endblock %} diff --git a/src/www/pages/st/styles/maps/index.njk b/src/www/pages/st/styles/maps/index.njk new file mode 100644 index 00000000..9954a8f9 --- /dev/null +++ b/src/www/pages/st/styles/maps/index.njk @@ -0,0 +1,177 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Maps" %} +{% set section = "Styles" %} +{% set ds = 'st' %} + +{# Imports #} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# ESRI ArcGIS #} +

    ESRI ArcGIS

    + +{# About #} +

    About

    +

    + When it comes to mapping, West Midlands Combined Authority uses + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/labs/what-is-arcgis/", + linkTitle: "ESRI ArcGIS products", + linkTarget: "_blank", + contentText: "ESRI ArcGIS products" + }) + }} + to create, manage and share data on maps. Therefore, when developing maps use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. +

    + +{# Basemap #} +

    Basemap

    + + A screenshot showing an example of a map + +

    + When creating a map use the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as your basemap layer. This is to ensure maps are consistent across West Midlands Combined Authority services. +

    +

    The WMCA Basemap is a portal item, you can use the +{{ + wmcadsLink({ + link: "https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html", + linkTitle: "ArcGIS Basemap documentation", + linkTarget: "_blank", + contentText: "ArcGIS Basemap documentation" + }) + }} with the WMCA Basemap ID to include the basemap in your application. +

    + +{# Example of code #} +

    Example of the ESRI ArcGIS JavaScript API

    +
    +  
    +    // ESRI ArcGIS JS code...
    +    const basemap = new Basemap({
    +      baseLayers: [
    +        new VectorTileLayer({
    +          portalItem: {
    +            // set the baselayer to WMCA Basemap:
    +            // https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e
    +            id: '53f165a8863c4d40ba017042e248355e',
    +          },
    +        }),
    +      ],
    +    });
    +
    +    // Create a new map with the basemap set above
    +    const map = new Map({
    +      basemap,
    +    });
    +  
    +
    + +{# Can't use Esri ArcGIS #} +

    Can't use ESRI ArcGIS?

    +

    + We understand that you may not always be able to use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. + In these situations, style your map as closely to the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as possible. +

    +


    + + +{# User interface #} +

    User interface

    +

    + User interface elements on a map such as zoom, pan and location buttons follow particular pattern rules when being used. +

    +

    These pattern rules are:

    + + + + +{% endblock %} diff --git a/src/www/pages/st/styles/typography/index.njk b/src/www/pages/st/styles/typography/index.njk new file mode 100644 index 00000000..aa7e99ff --- /dev/null +++ b/src/www/pages/st/styles/typography/index.njk @@ -0,0 +1,75 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Typography" %} +{% set section = "Styles" %} +{% set ds = 'st' %} + +{% block content %} +{# About #} +

    About

    +

    + We have tested our typography with users, including those with dyslexia and those with low vision. The questionnaire presented respondents with two body fonts, set out in different sizes, line spacing and kerning. The options were shown randomly for each participant.

    +

    + Our findings were as such: +

    +

    +

    + As a public sector organisation, in addition to testing the above we are required to meet WCAG 2.1 guidelines at AA standard. + Therefore, features will be useable when text size is increased up to 200% and content reflowed for 400%. +

    +
    +{# Fonts #} +

    Fonts

    +

    + We utilise Google Fonts in our typography and all fonts used are pre-bundled in our design system CSS, so you won't need to include them seperately. +

    +

    + Find below, various examples of our typography in use. +

    + +{# DM Sans / Headings #} +

    DM Sans / headings

    +

    + The font DM Sans is used with font weight of 700 (bold) for heading elements only.
    + DM Sans font reference +

    +

    Things to note:

    + +
    +

    46px - Heading 1

    +

    32px - Heading 2

    +

    23px - Heading 3

    +

    18px - Heading 4

    +
    + +{# Noto sans / body copy #} +

    Noto Sans / body copy

    +

    + The font Noto Sans is used with the font weight of 400 (regular) and 700 (bold) for all elements other than headings. The default font size used is 16px.
    + Noto Sans font reference +

    +
    +

    Characters

    + Font size: 16px / 1rem

    + A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    + a b c d e f g h i j k l m n o p q r s t u v w x y z
    + 1 2 3 4 5 6 7 8 9 0
    + {% filter escape %} + ‘ ? ’ “ ! ” (%) [#] {@} / & \ < - + ÷ × = > ® © $ € £ ¥ ¢ : ; , . * + {% endfilter %} +
    +

    Styles

    + 400 - Regular
    + 400 - Regular italic
    + 700 - Bold
    + 700 - Bold italic +
    + +{% endblock %} diff --git a/src/www/pages/st/styles/utility-classes/index.njk b/src/www/pages/st/styles/utility-classes/index.njk new file mode 100644 index 00000000..bc076bb8 --- /dev/null +++ b/src/www/pages/st/styles/utility-classes/index.njk @@ -0,0 +1,276 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Utility classes" %} +{% set section = "Styles" %} +{% set ds = 'st' %} + +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} + +{% block content %} +{# About #} +

    About

    +

    + There are a variety of utility classes that can be used with the existing components and styles on. +

    + + +
    +{# Containers #} +

    Containers

    +

    + Containers are used to wrap content in a 'container'. The container will have a fixed max size and be centered on the page, it will adjust to 100% width when the page width is less than the container size. +

    + +
    +  
    +    .ds-container /* Container with max-width of 1280px */
    +
    +    /* This should be used on your main content section and will
    +    add a margin top to seperate from header/breadcrumb section */
    +    .ds-container.ds-container--main
    +  
    +
    + + +
    +{# Grid #} +

    Grid

    +

    + The WMCA Design System uses its own custom syntax grid system adopted from Pure CSS Grid. The grid system is already included in the bundled ds-components.min.css file so you don't need to include it seperately. +

    + +

    + You can Refer to the Pure CSS Grid documentation for reference on how to use our grid system, but bear in mind that: +

    + + + +

    You can also use modifier classes on the same element where the class .ds-grid is being used.

    +
    +  
    +    .ds-grid--justify-between
    +    .ds-grid--justify-around
    +    .ds-grid--justify-end
    +    .ds-grid--justify-center
    +  
    +
    + +{{ + wmcadsLink( { + link: "/styles/examples/grid-examples.html", + contentText: "Grid examples" + } + ) +}} + +

    Information for designers

    +

    + The grid is part of the Design System Sketch library or as a standalone template file. +

    +

    Screen sizes

    +

    +

    +

    +

    Sketch grid sizes

    +

    +

    +

    + +
    +{# Floats #} +

    Floats

    +

    + Floats an element in the intended direction. +

    + +
    +  
    +    .ds-float-left
    +    .ds-float-right
    +  
    +
    + + +
    +{# Text Align #} +

    Text Align

    +

    + Aligns text in the intended direction. +

    + +
    +  
    +    .ds-text-align-left
    +    .ds-text-align-center
    +    .ds-text-align-right
    +  
    +
    + + +
    +{# Show or hide on devices #} +

    Show or hide on devices

    +

    + When you want to hide an element based on if the device width is a desktop or mobile device. +

    + +
    +  
    +    .ds-hide-mobile /* Hide only on mobile devices or smaller (less than 48em)  */
    +    .ds-hide-desktop /* Hide only on desktop devices or larger (greater than 48em) */
    +    .ds-hide /* Hide on all devices */
    +  
    +
    + +
    +

    Spacing

    +

    + The spacing utility classes are used to adjust whitespace for an element via padding and margins. +

    +

    Before using the spacing utility classes, please consider:

    + + +

    + The classes are named using the format .ds-{type}-{side}-{size}. +

    +{# type #} +

    + Where {type} is one of: +

    + +{# side #} +

    + Where {side} is one of: +

    + +{# size #} +

    +Where {size} is one of: +

    + + +

    Some examples of using these utility classes...

    +
    +  
    +    .ds-m-xs // applies a margin of 0.25rem to all sides
    +    .ds-p-b-lg // applies a padding-bottom of 2rem
    +    .ds-m-l-none // sets left margin to 0
    +  
    +
    + +{# Grid columns spacing #} +

    Grid column spacing

    + +

    + Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

    +

    + The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

    +

    + Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

    +

    + Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

    +

    + Where {breakpoint} is one of breakpoint sizes described in the grid section. +

    + +

    Some examples of using these utility classes...

    +
    +  
    +    .ds-grid--spacing-2-md // applies a 1rem spacing between 2 columns
    +    .ds-grid--spacing-lg-4-lg // applies a 2rem spacing between 4 columns above a screen width of 1024px
    +  
    +
    + +{{ + wmcadsLink( { + link: "/styles/examples/grid-column-spacing.html", + contentText: "Grid column spacing examples" + } + ) +}} +

    + +
    +{# Background #} +

    Background Colour

    +

    + Changes background to the intended colour. +

    + +
    +  
    +    .bg-default
    +    .bg-white
    +    .bg-disabled-elements
    +    .bg-transparent
    +  
    +
    + +{% endblock %} diff --git a/src/www/pages/styles/index.njk b/src/www/pages/styles/index.njk index cca1707a..ecd7ea54 100755 --- a/src/www/pages/styles/index.njk +++ b/src/www/pages/styles/index.njk @@ -1,6 +1,7 @@ {% extends "www/_layouts/layout-left-pane.njk" %} {% set pageTitle = "Styles" %} {% set section = "Styles" %} +{% set ds = 'wmca' %} {% block content %}

    Make your service look and feel like WMCA Design System.

    diff --git a/src/www/pages/templates/index.njk b/src/www/pages/templates/index.njk index 4994e699..9bd5518e 100644 --- a/src/www/pages/templates/index.njk +++ b/src/www/pages/templates/index.njk @@ -1,7 +1,8 @@ -{% extends "www/_layouts/layout-left-pane.njk" %} -{% set pageTitle = "Templates" %} -{% set section = "Templates" %} - -{% block content %} -

    Example templates that make up the main West Midlands Combined Authority Website

    +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Templates" %} +{% set section = "Templates" %} +{% set ds = 'wmca' %} + +{% block content %} +

    Example templates that make up the main West Midlands Combined Authority Website

    {% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/accordion/index.njk b/src/www/pages/tfwm/components/accordion/index.njk new file mode 100644 index 00000000..0f12b9a0 --- /dev/null +++ b/src/www/pages/tfwm/components/accordion/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Accordion" %} +{% set ds = 'wmca' %} + +{% block content %} + +{% from "www/pages/shared/components/accordion/index.njk" import dsAccordionContent %} + +{{ + dsAccordionContent({}) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/breadcrumb/index.njk b/src/www/pages/tfwm/components/breadcrumb/index.njk new file mode 100644 index 00000000..4902faca --- /dev/null +++ b/src/www/pages/tfwm/components/breadcrumb/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Breadcrumb" %} +{% set ds = 'wmca' %} + +{% block content %} + +{% from "www/pages/shared/components/breadcrumb/index.njk" import dsBreadcrumbContent %} + +{{ + dsBreadcrumbContent({}) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/buttons/index.njk b/src/www/pages/tfwm/components/buttons/index.njk new file mode 100644 index 00000000..ebfc5e98 --- /dev/null +++ b/src/www/pages/tfwm/components/buttons/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Buttons" %} +{% set ds = 'wmca' %} + +{% block content %} + +{% from "www/pages/shared/components/buttons/index.njk" import dsButtonsContent %} + +{{ + dsButtonsContent({}) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/content-card/index.njk b/src/www/pages/tfwm/components/content-card/index.njk new file mode 100644 index 00000000..e02ef179 --- /dev/null +++ b/src/www/pages/tfwm/components/content-card/index.njk @@ -0,0 +1,136 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Content card" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{# Imports #} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} + +{% block content %} +{# About #} +

    About

    +

    Content cards contain components and text. Against the page background, they help to draw the users attention to important information and help users to navigate content.

    +

    The cards have many common use cases and applications, all of which can be found on the content cards pattern page.

    +
    + +

    +{# Content card #} +

    Content card

    +{# What #} +

    What is it?

    + +{# When not to #} +

    When not to use it?

    + + +

    Regular Card

    + +{{ + compExample([ + wmcadsContentCard({ + }) + + ]) +}} + +

    With Image

    + +{{ + compExample([ + wmcadsContentCard({ + src: true, + isSrcDefault: true + }) + ]) +}} + +

    Without Image

    + +{{ + compExample([ + wmcadsContentCard() + ]) +}} + + + +

    +{# Navigation card #} +

    Navigation card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +

    Navigation Card

    + +{{ + compExample([ + wmcadsContentCard({ + clickable: true + }) + ]) +}} + +

    With Image

    + +{{ + compExample([ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true + }) + ]) +}} + +

    Call To Action Card

    + +{{ + compExample([ + wmcadsContentCard({ + clickable: true, + isCta: true + }) + ]) +}} + +

    Event Card

    + +{{ + compExample([ + wmcadsContentCard({ + clickable: true, + isEvent: true + }) + ]) +}} + +

    News Card

    + +{{ + compExample([ + wmcadsContentCard({ + src: true, + clickable: false, + isNews: true + }) + ]) +}} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/content-tiles/index.njk b/src/www/pages/tfwm/components/content-tiles/index.njk new file mode 100644 index 00000000..d508becf --- /dev/null +++ b/src/www/pages/tfwm/components/content-tiles/index.njk @@ -0,0 +1,129 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Content tiles (deprecated)" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# Content tile small 1 #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} + +{# Content tile travel tips #} +{%- from "wmcads/components/content-tiles/travel-tips/travel-tips.njk" import wmcadsContentTileTravelTips -%} + +{# Content tile travel updates #} +{%- from "wmcads/components/content-tiles/travel-updates/travel-updates.njk" import wmcadsContentTileTravelUpdates -%} + +{# Content tile advice moving #} +{%- from "wmcads/components/content-tiles/advice-moving/advice-moving.njk" import wmcadsContentTileAdviceMoving -%} + + +

    Normal

    +

    General

    +{{ + compExample([ + wmcadsContentTilesNormal({ + copy: '

    See all major roadworks and events. These could affect your journey, plan ahead.

    ' + }) + ]) +}} + +

    General with one link

    +{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--with-one-link', + copy: '

    See all major roadworks and events. These could affect your journey, plan ahead.

    ', + readMore: true + }) + ]) +}} + +

    Yellow modifier

    +{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--yellow ds-content-tile--with-one-link', + copy: '

    See all major roadworks and events. These could affect your journey, plan ahead.

    ', + readMore: true + }) + ]) +}} + +

    Major Works

    +{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--with-one-link', + copy: ' + + ', + readMore: true + }) + ]) +}} + +

    Iframe (map)

    +{{ + compExample([ + wmcadsContentTilesNormal({ + copy: ' +

    Consider using City Road and Dudley Road, past City Hospital to head into Birmingham city centre or connect with the ring road.

    + + ' + }) + ]) +}} + +

    Nav

    +{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--nav', + title: 'Related content', + smallTitle: true + }) + ]) +}} + +

    Nav with legend

    +{{ + compExample([ + wmcadsContentTilesNormal({ + classModifiers: 'ds-content-tile--nav', + title: 'Related content', + smallTitle: true, + legend: 'Overview' + }) + ]) +}} + +

    Content tile travel tips

    +

    When to use it?

    + +{{ + compExample([ + wmcadsContentTileTravelTips() + ]) +}} + +

    Content tile travel updates

    +{{ + compExample([ + wmcadsContentTileTravelUpdates() + ]) +}} + +

    Content tile advice to keep moving

    +{{ + compExample([ + wmcadsContentTileAdviceMoving() + ]) +}} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/details/index.njk b/src/www/pages/tfwm/components/details/index.njk new file mode 100644 index 00000000..dd0989cf --- /dev/null +++ b/src/www/pages/tfwm/components/details/index.njk @@ -0,0 +1,60 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Details" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# Details component #} +{%- from "wmcads/components/details/_details.njk" import wmcadsDetails -%} + +

    About

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# How #} +

    How it works?

    + +
    +

    + +

    Reduced

    +{{ + compExample([ + wmcadsDetails({ + summary: "Detail summary", + content: "Lorem ipsum dolor sit amet consectetur adipisicing elit." + }) + ]) +}} + +

    Expanded

    +{{ + compExample([ + wmcadsDetails({ + expanded: true, + summary: "Detail summary", + content: "Lorem ipsum dolor sit amet consectetur adipisicing elit." + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/disruption-indicators/index.njk b/src/www/pages/tfwm/components/disruption-indicators/index.njk new file mode 100644 index 00000000..aa3bccfb --- /dev/null +++ b/src/www/pages/tfwm/components/disruption-indicators/index.njk @@ -0,0 +1,457 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Disruption indicators (deprecated)" %} +{# Get macros #} +{% from "wmcads/components/disruption-indicator/small/_small.njk" import wmcadsDisruptionIndicatorSmall %} +{% from "wmcads/components/disruption-indicator/medium/_medium.njk" import wmcadsDisruptionIndicatorMedium %} +{% from "wmcads/components/disruption-indicator/large/_large.njk" import wmcadsDisruptionIndicatorLarge %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% set modes = [ + "bus", + "coach", + "cycle", + "metro", + "plane", + "rail", + "roads", + "walk" +] %} + +{% block content %} +{# About #} +

    About

    +

    Disruption indicators are used to show the current service status within interfaces and maps.

    +

    There are three types all giving different levels of detail.

    +
    + +

    +{# Map pin #} +

    Small

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + + +{# Small:Minor disruptions #} +

    Minor disruption

    +{{ + compExample([ + wmcadsDisruptionIndicatorSmall({ + mode: 'bus' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'coach' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'cycle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'metro' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'plane' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'rail' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'roads' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'walk' + }) + ], + { + displayInline: true + }) +}} + +{# Small:Major disruptions #} +

    Major disruption

    +{{ + compExample([ + wmcadsDisruptionIndicatorSmall({ + mode: 'bus', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'coach', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'cycle', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'metro', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'plane', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'rail', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'roads', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'walk', + classModifiers: 'ds-disruption-indicator-small--error', + iconRight: 'general-warning-triangle' + }) + ], + { + displayInline: true + }) +}} + +{# Small:Severe disruptions #} +

    Severe disruption

    +{{ + compExample([ + wmcadsDisruptionIndicatorSmall({ + mode: 'bus', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'coach', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'cycle', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'metro', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'plane', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'rail', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'roads', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorSmall({ + mode: 'walk', + classModifiers: 'ds-disruption-indicator-small--severe', + iconRight: 'general-warning-triangle' + }) + ], + { + displayInline: true + }) +}} + +

    +{# Medium:Normal #} +

    Medium - Normal

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + + +{{ + compExample([ + wmcadsDisruptionIndicatorMedium(), + wmcadsDisruptionIndicatorMedium({ + classModifiers: 'ds-disruption-indicator-medium--success', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorMedium({ + classModifiers: 'ds-disruption-indicator-medium--warning', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorMedium({ + classModifiers: 'ds-disruption-indicator-medium--error', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorMedium({ + classModifiers: 'ds-disruption-indicator-medium--severe', + iconRight: 'general-warning-triangle' + }) + ]) +}} + +

    +{# Medium - Narrow #} +{% from "wmcads/components/disruption-indicator/medium/_medium.njk" import wmcadsDisruptionIndicatorMedium as wmcadsDisruptionIndicatorNarrow %} +

    Medium - Narrow

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not use it?

    + + +{{ + compExample([ + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--success ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--warning ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--error ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--severe ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorNarrow({ + comment: '', + classModifiers: 'ds-disruption-indicator-medium--error ds-disruption-indicator-medium--narrow', + iconLeft: 'modes-isolated-bus', + iconRight: 'general-trash' + }) + ], + { + displayInline: true + }) +}} + +

    +{# LARGE #} +

    Large

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# Research #} +

    Research

    + +

    Train

    +{{ + compExample( + [ + wmcadsDisruptionIndicatorLarge({ + comment: '', + mode: 'Train', + strongText: 'Good service', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'warning', + mode: 'Train', + strongText: 'Minor disruption', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Train', + strongText: 'Major disruption', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'severe', + mode: 'Train', + strongText: 'Severe disruption', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Train', + strongText: 'Major disruption', + text: 'Cross City Line', + iconLeft: 'modes-isolated-rail', + iconRight: 'general-trash', + iconRightBtn: true + }) + ] + ) +}} + +{# Tram #} +

    Tram

    +{{ + compExample( + [ + wmcadsDisruptionIndicatorLarge({ + comment: '', + mode: 'Tram', + strongText: 'Good service', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'warning', + mode: 'Tram', + strongText: 'Minor disruption', + text: 'Between Jewellery Quarter and Wolverhampton', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Tram', + strongText: 'Major disruption', + text: 'Between Jewellery Quarter and Wolverhampton', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'severe', + mode: 'Tram', + strongText: 'Severe disruption', + text: 'Between Jewellery Quarter and Wolverhampton', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Tram', + strongText: 'Major disruption', + text: 'Between Jewellery Quarter and Wolverhampton', + iconLeft: 'modes-isolated-metro', + iconRight: 'general-trash', + iconRightBtn: true + }) + ] + ) +}} + +{# Roads #} +

    Roads

    +{{ + compExample( + [ + wmcadsDisruptionIndicatorLarge({ + comment: '', + mode: 'Roads', + strongText: 'Usual traffic', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-success' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'warning', + mode: 'Roads', + strongText: 'Minor disruption', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-warning-circle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Roads', + strongText: 'Major disruption', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'severe', + mode: 'Roads', + strongText: 'Severe disruption', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-warning-triangle' + }), + wmcadsDisruptionIndicatorLarge({ + comment: '', + classModifier: 'error', + mode: 'Roads', + strongText: 'Major disruption', + text: 'A38', + iconLeft: 'modes-isolated-roads', + iconRight: 'general-trash', + iconRightBtn: true + }) + ] + ) +}} + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/divider/index.njk b/src/www/pages/tfwm/components/divider/index.njk new file mode 100644 index 00000000..b322ee36 --- /dev/null +++ b/src/www/pages/tfwm/components/divider/index.njk @@ -0,0 +1,113 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Divider" %} +{% from "wmcads/components/divider/_divider.njk" import wmcadsDivider %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    Default divider (Primary)

    +{{ + compExample([ + wmcadsDivider() + ]) +}} + +

    Cool Grey divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'grey' + }) + ]) +}} + +

    WM Green divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'wmgreen' + }) + ]) +}} + +

    WM Red divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'wmred' + }) + ]) +}} + +

    WM Purple divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'wmpurple' + }) + ]) +}} + +

    WM Blue divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'wmblue' + }) + ]) +}} + +

    WM Furnace Orange divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'wmfurnaceorange' + }) + ]) +}} + +

    WM Green Tint divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'wmtintsgreen' + }) + ]) +}} + +

    WM Brown Tint divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'wmtintsbrown' + }) + ]) +}} + +

    TfWM Pink divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'tfwmpink' + }) + ]) +}} + +

    TfWM Yellow divider

    +{{ + compExample([ + wmcadsDivider({ + class: 'tfwmyellow' + }) + ]) +}} + +

    WM Blue divider - Half width

    +{{ + compExample([ + wmcadsDivider({ + class: 'wmblue', + half: 'true' + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/document/index.njk b/src/www/pages/tfwm/components/document/index.njk new file mode 100644 index 00000000..be65d761 --- /dev/null +++ b/src/www/pages/tfwm/components/document/index.njk @@ -0,0 +1,12 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Document" %} +{% from "wmcads/components/document/_document.njk" import wmcadsDocument %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{{ + compExample([ + wmcadsDocument() + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/file-download/index.njk b/src/www/pages/tfwm/components/file-download/index.njk new file mode 100644 index 00000000..bbc8d6d9 --- /dev/null +++ b/src/www/pages/tfwm/components/file-download/index.njk @@ -0,0 +1,135 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "File download" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{# Macros #} +{% from "wmcads/components/file-download/_file-download.njk" import wmcadsFileDownload %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +
    +

    + + +{# Accessible file #} +

    Accessible file

    +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{{ + compExample([ + wmcadsFileDownload({ + html: false, + default: true + }) + ]) +}} +

    + +{# Non-accessible file #} +

    Non-accessible file

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{{ + compExample([ + wmcadsFileDownload({ + accessible: true, + html: false, + default: true + }) + ]) +}} + + +{# Document link #} +

    Document link

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{{ + compExample([ + wmcadsFileDownload({ + html: true, + default: true + }) + ]) +}} + +{# Document link #} +

    HTML & PDF links

    + +{{ + compExample([ + wmcadsFileDownload({ + html: false, + htmlInfo: true, + default: false, + htmlDoc: true, + pdfDoc: false, + dlName: 'Document name' + }) + ]) +}} + + + +{{ + compExample([ + wmcadsFileDownload({ + html: false, + htmlInfo: true, + default: false, + htmlDoc: false, + pdfDoc: true, + dlName: 'Download Document name (pdf, 7.88MB)' + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/form-elements/index.njk b/src/www/pages/tfwm/components/form-elements/index.njk new file mode 100644 index 00000000..4ea98fdf --- /dev/null +++ b/src/www/pages/tfwm/components/form-elements/index.njk @@ -0,0 +1,317 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Form elements" %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} + {# Label #} +

    Form Label

    +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + + {% from "wmcads/components/form-elements/label/_label.njk" import wmcadsLabel %} + {{ + compExample([wmcadsLabel()]) + }} + {# End label #} + + +

    + {# Question #} +

    Question

    +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + +

    How it works?

    + + {% from "wmcads/components/form-elements/question/_question.njk" import wmcadsQuestion %} + {{ + compExample([wmcadsQuestion()]) + }} + {# End question #} + +

    + {# Progress Indicator #} +

    Progress Indicator

    +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + + {% from "wmcads/components/form-elements/progress-indicator/_progress-indicator.njk" import wmcadsProgressIndicator %} + {{ + compExample([wmcadsProgressIndicator()]) + }} + {# Progress Indicator #} + +

    + {# Checkboxes #} +

    Checkboxes

    +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + + {% from "wmcads/components/form-elements/checkboxes/_checkboxes.njk" import wmcadsCheckboxes %} + {{ + compExample([wmcadsCheckboxes()]) + }} + {# End Checkboxes #} + + +

    + {# Dropdown #} +

    Dropdown

    +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + + {% from "wmcads/components/form-elements/dropdown/_dropdown.njk" import wmcadsDropdown %} + {{ + compExample([wmcadsDropdown()]) + }} + {# End Dropdown #} + +

    + {# Input #} +

    Text Input / Text Field

    +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + + {% from "wmcads/components/form-elements/input/_input.njk" import wmcadsInput %} + {{ + compExample([wmcadsInput()]) + }} + {# End Input #} + + +

    + {# Radios #} +

    Radios

    +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + + {% from "wmcads/components/form-elements/radios/_radios.njk" import wmcadsRadios %} + {{ + compExample([wmcadsRadios()]) + }} +

    Inline Radios

    + {{ + compExample([wmcadsRadios({ + inline: true + })]) + }} + {# End Radios #} + + +

    + {# File uploader #} +

    File uploader

    +

    What does it do?

    + +

    + When to use it? +

    + +

    + When not to use it? +

    + + {% from "wmcads/components/form-elements/file-upload/_file-upload.njk" import wmcadsFileUpload %} + {{ + compExample([wmcadsFileUpload()]) + }} +

    With file uploaded

    + {{ + compExample([wmcadsFileUpload({ + fileSelected: true + })]) + }} + {# End File uploader #} + + +

    + {# Textarea #} +

    Textarea

    +

    What does it do?

    + +

    + When to use it? +

    + +

    + When not to use it? +

    + + {% from "wmcads/components/form-elements/textarea/_textarea.njk" import wmcadsTextarea %} + {{ + compExample([wmcadsTextarea()]) + }} + {# End Textarea #} + +

    + {# Date input #} + {% from "wmcads/components/form-elements/date-input/_date-input.njk" import wmcadsDateInput %} +

    Date Input

    +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + + {{ + wmcadsInsetText ({ + contentHTML: "If you are looking for how to format the date within content i.e. \"4 June 2017\", check the dates section within the A to Z content style guide." + }) + }} + + {{ + compExample([ + wmcadsDateInput({ + + }) + ]) + }} +{# End Date input #} + + +

    + {# Handling error #} +

    Handling errors

    +

    What does it do?

    + +

    + When to use it? +

    + +

    + When not to use it? +

    + +

    + How to use it +

    + + {{ + compExample([ + wmcadsInput({ + id: 'errorExample', + error:true + }) + ]) + }} + {# End handling errors #} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/hub-header/index.njk b/src/www/pages/tfwm/components/hub-header/index.njk new file mode 100644 index 00000000..3fd9cf3b --- /dev/null +++ b/src/www/pages/tfwm/components/hub-header/index.njk @@ -0,0 +1,55 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Hub header" %} +{% from "wmcads/components/hub-header/_hub-header.njk" import wmcadsHubHeader %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} + +{# primary hub header #} +

    Primary hub header

    + +{{ + compExample([ + wmcadsHubHeader({ + showSubtitle: true, + icon: false + }) + ],{iframe:false + }) +}} + +{# primary hub header with icon #} +

    Primary hub header with Icon

    + +{{ + compExample([ + wmcadsHubHeader({ + icon: true, + showSubtitle: true + }) + ],{iframe:false}) +}} + +{# primary hub header with image #} +

    Primary hub header with Image

    + +{{ + compExample([ + wmcadsHubHeader({ + image: true, + showSubtitle: true + }) + ],{iframe:false}) +}} + +{# primary hub header without subtitle #} +

    Primary hub header without subtitle

    + +{{ + compExample([ + wmcadsHubHeader({ + image: false + }) + ],{iframe:false}) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/images/index.njk b/src/www/pages/tfwm/components/images/index.njk new file mode 100644 index 00000000..97368ba7 --- /dev/null +++ b/src/www/pages/tfwm/components/images/index.njk @@ -0,0 +1,69 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Images" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} + {# Image with hexagon mask #} +

    Image with hexagon mask

    +

    + What does it do? +

    + +

    + When to use it? +

    + +

    + When not to use it? +

    + + {% from "wmcads/components/images/_images.njk" import wmcadsImages %} + {{ + compExample([wmcadsImages({ + + })]) + }} +

    + {# Image with summary #} +

    Image with summary

    +

    + What does it do? +

    + +

    + When to use it? +

    + +

    + When not to use it? +

    + + {% from "wmcads/components/images/_image-with-summary.njk" import wmcadsImageWithSummary %} + {{ + compExample([wmcadsImageWithSummary({ + + })]) + }} + {# End label #} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/in-text-step/index.njk b/src/www/pages/tfwm/components/in-text-step/index.njk new file mode 100644 index 00000000..a1429c7a --- /dev/null +++ b/src/www/pages/tfwm/components/in-text-step/index.njk @@ -0,0 +1,49 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "In-text step" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} + {# In-text Step #} +

    In-text step

    +

    + What does it do? +

    + +

    + When to use it? +

    + +

    + When not to use it? +

    + + {% from "wmcads/components/in-text-step/_in-text-step.njk" import wmcadsInTextStep %} + {{ + compExample([wmcadsInTextStep({ + steps: [ + "Step text must end with a full stop.", + "Step text must end with a full stop.", + "Step text must end with a full stop." + ] + })]) + }} + + {# End label #} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/inclusive-growth-doughnut/index.njk b/src/www/pages/tfwm/components/inclusive-growth-doughnut/index.njk new file mode 100644 index 00000000..6ad7a7c3 --- /dev/null +++ b/src/www/pages/tfwm/components/inclusive-growth-doughnut/index.njk @@ -0,0 +1,12 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Incusive Growth Doughnut" %} +{% from "wmcads/components/inclusive-growth-doughnut/_inclusive-growth-doughnut.njk" import wmcadsIncusiveGrowthDoughnut %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{{ + compExample([ + wmcadsIncusiveGrowthDoughnut() + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/index.njk b/src/www/pages/tfwm/components/index.njk new file mode 100644 index 00000000..6f21f3e8 --- /dev/null +++ b/src/www/pages/tfwm/components/index.njk @@ -0,0 +1,13 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Components" %} +{% set ds = 'tfwm' %} + +{% block content %} +

    Components are reusable parts of the user interface that have been made to support a variety of + applications.

    + +

    Individual components can be used in multiple different patterns and contexts. For example, the + text input component can be used to ask for an email address, a National Insurance number or someone’s name.

    +

    If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples provided will render exactly as they do inside the Design System.

    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/inset-text/index.njk b/src/www/pages/tfwm/components/inset-text/index.njk new file mode 100644 index 00000000..f0164f3a --- /dev/null +++ b/src/www/pages/tfwm/components/inset-text/index.njk @@ -0,0 +1,104 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Inset Text" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + + +{% block content %} +{# About #} +

    Inset Text

    +

    What does it do?

    + + +

    When to use it?

    + + +

    When not to use it?

    + + +

    How to use it?

    + + + {% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} + {{ + compExample([ + wmcadsInsetText({ + html: "Example of inset text" + }) + ]) + }} + {# End inset text #} + + +

    + {# Question #} +

    Example Callout

    + +

    What does it do?

    + + +

    When to use it?

    + + +

    When not to use it?

    + + +

    How to use it?

    + + + + {% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} + {{ + compExample([ + wmcadsInsetText({ + html: "Example Callout title
    Example callout description.", + label: "Example Callout" + }) + ]) + }} + {# End inset text #} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/links/index.njk b/src/www/pages/tfwm/components/links/index.njk new file mode 100644 index 00000000..ce11a7c8 --- /dev/null +++ b/src/www/pages/tfwm/components/links/index.njk @@ -0,0 +1,353 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Links" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +

    + Buttons and links are items used to perform an action on a + page +

    +

    + It's important to know when to use a link or a + button +

    +

    + Links should be used when a users action won’t affect the website at all, + examples of these + are: +

    + + +

    What do the link attritubes mean?

    +

    The href attritube is used to define the link address

    +

    The target attritube is used to define where to open the linked document. + See below to find + out more about the target attritube

    +

    The title attritube is used to define additional information about the + link. It's useful for + your users and accessibility. Try not to duplicate your link text- this hurts usability as + hard of sight users + using screen readers will here the same text twice.

    + +

    Target attritube values:

    + +
    +

    + + +{# Default link #} +

    Default link

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{{ + compExample([ + wmcadsLink() + ]) +}} +

    + + +{# Back link #} +

    Back link

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{# How it works #} +

    How it works?

    + +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{{ + compExample([ + wmcadsLink( { isBackLink: true, text: "Back" } ) + ]) +}} + + +

    +{# Link with chevron #} +

    Link with chevron

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# How #} +

    How does it work?

    + +{{ + compExample([ + wmcadsLink({ + contentText: "Link", + withChevronLeft: true + }), + wmcadsLink({ + contentText: "Link", + withChevronRight: true + }) + ]) +}} + + +

    +{# call to action button as link #} +

    Call to action buttons

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as cta %} +{{ + compExample([ + cta({ + text: "Call to action button", + linkTitle: "This is a call to action link" + }), + cta({ + text: "Call to action icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a call to action link" + }) + ]) +}} +{# end: call to action button as link #} +

    + + +{# primary buttons #} +

    Primary buttons

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as primary -%} +{{ + compExample([ + primary({ + classNames: "ds-btn--primary", + text: "Primary button", + linkTitle: "This is a primary link" + }), + primary({ + classNames: "ds-btn--primary", + text: "Primary icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a primary link" + }) + ]) +}} +{# end: primary button as link #} +

    + + +{# secondary buttons #} +

    Secondary buttons

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as secondary -%} +{{ + compExample([ + secondary({ + classNames: "ds-btn--secondary", + text: "Secondary button", + linkTitle: "This is a secondary link" + }), + secondary({ + classNames: "ds-btn--secondary", + text: "Secondary icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a secondary link" + }) + ]) +}} +{# end: secondary button as link #} +

    + + +{# destructive button as link #} +

    Destructive button as link

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as destructive -%} +{{ + compExample([ + destructive({ + classNames: "ds-btn--destructive", + text: "Destructive button", + linkTitle: "This is a destructive link" + }), + destructive({ + classNames: "ds-btn--destructive", + text: "Destructive icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a destructive link" + }) + ]) +}} +{# end: destructive button as link #} + + +

    +{# start button as link #} +

    Start button as link

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{%- from "wmcads/components/link/as-button/_as-button.njk" import wmcadsLinkAsButton as start -%} +{{ + compExample([ + start({ + classNames: "ds-btn--start", + text: "Start button", + linkTitle: "This is a start link" + }), + start({ + classNames: "ds-btn--start", + text: "Start icon button", + iconRight: "general-chevron-right", + linkTitle: "This is a start link" + }) + ]) +}} +{# end: start button as link #} +{% endblock %} diff --git a/src/www/pages/tfwm/components/lists/index.njk b/src/www/pages/tfwm/components/lists/index.njk new file mode 100644 index 00000000..da9d7ed6 --- /dev/null +++ b/src/www/pages/tfwm/components/lists/index.njk @@ -0,0 +1,143 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Lists" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# Ordered List #} +

    Ordered List

    +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{# How to #} +

    How to use it?

    + +{% from "wmcads/components/lists/ordered-list/_ordered-list.njk" import wmcadsOrderedList %} +{{ + compExample([ + wmcadsOrderedList( + { + html: + "
  • Text +
      +
    1. Text +
        +
      1. Text
      2. +
      3. Text +
          +
        1. Text
        2. +
        +
      4. +
      5. Text
      6. +
      +
    2. +
    3. Text
    4. +
    +
  • +
  • Text
  • " + } + ) | trim + ]) +}} +

    + +{# Unordered list #} +

    Unordered List

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{# How to #} +

    How to use it?

    + + +{% from "wmcads/components/lists/unordered-list/_unordered-list.njk" import wmcadsUnorderedList %} +{{ + compExample([ + wmcadsUnorderedList( + { + html: + "
  • Text + +
  • " + } + ) | trim + ]) +}} + +{# Bare list #} +

    Bare List

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + +{# How to #} +

    How to use it?

    + + +{% from "wmcads/components/lists/bare-list/_bare-list.njk" import wmcadsBareList %} +{{ + compExample([ + wmcadsBareList( + { + html: + "
  • Text
  • +
  • Text
  • +
  • Link
  • " + } + ) | trim + ]) +}} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/loader/index.njk b/src/www/pages/tfwm/components/loader/index.njk new file mode 100644 index 00000000..ee0efb0f --- /dev/null +++ b/src/www/pages/tfwm/components/loader/index.njk @@ -0,0 +1,66 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Loader" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# Loader #} +

    Loader

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + + +

    + By default you should aim to use the 'normal sized loader'.
    + Only when the normal sized loader is not fit for purpose should you use the large or small sized loader. +

    + +

    Change the text within .ds-loader__content from 'Content is loading...' to something that describes what it is you are loading, this will help with accessibility.

    + +{% from "wmcads/components/loader/_loader.njk" import wmcadsLoader %} +{{ + compExample([ + wmcadsLoader({ + size: 'small' + }), + wmcadsLoader(), + wmcadsLoader({ + size: 'large' + }) + ]) +}} + + +{% endblock %} diff --git a/src/www/pages/tfwm/components/message/index.njk b/src/www/pages/tfwm/components/message/index.njk new file mode 100644 index 00000000..3600bf7e --- /dev/null +++ b/src/www/pages/tfwm/components/message/index.njk @@ -0,0 +1,125 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Message" %} + +{% from "wmcads/components/message/summary/_summary.njk" import wmcadsMsgSummary %} +{% from "wmcads/components/message/help/_help.njk" import wmcadsMsgHelp %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +

    What does it do?

    + + +

    When to use it?

    + +
    +

    +{# Info message #} +

    Information

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'info', + title: 'Information about XXXXXXXXX was successfully updated!', + message: 'Details added what happened and what to do next. Lorem ipsum lorem ipsum. Lorem ipsum lorem ipsum text.' + }) + ]) +}} +{# End info message #} + +

    +{# Success message #} +

    Success

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'success', + title: 'Success confirmation', + message: 'Details added if needed to confirm action.' + }) + ]) +}} +{# End success message #} + +

    +{# Success message #} +

    Success (fill)

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'success-fill', + title: 'Success confirmation', + message: 'Details added if needed to confirm action.' + }) + ]) +}} +{# End success message #} + +

    +{# Warning message #} +

    Warning

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'warning', + title: 'Warning message', + message: 'Details added what happened and what to do next. Lorem ipsum lorem ipsum. Lorem ipsum lorem ipsum.' + }) + ]) +}} +{# End Warning message #} + +

    +{# Error message #} +

    Error

    +{{ + compExample([ + wmcadsMsgSummary({ + type: 'error', + title: 'Error message', + message: 'Details added what happened and what to do next. Lorem ipsum lorem ipsum. Lorem ipsum lorem ipsum.' + }) + ]) +}} + +{# End error message #} + +

    +{# Help message #} +

    Help

    + +

    When to use it?

    + +{{ compExample([ wmcadsMsgHelp({ message: 'Details added what happened and what to do next.
    +Lorem ipsum lorem ipsum. Lorem ipsum lorem ipsum.' }) ]) }} {# End Help message #} {% endblock %} diff --git a/src/www/pages/tfwm/components/page-contents/index.njk b/src/www/pages/tfwm/components/page-contents/index.njk new file mode 100644 index 00000000..2e2ba43d --- /dev/null +++ b/src/www/pages/tfwm/components/page-contents/index.njk @@ -0,0 +1,25 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Page contents" %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    Page contents

    +{{ + compExample([ + wmcadsPageContents({ + example: true + }) + ]) +}} + +

    Page contents with sections

    +{{ + compExample([ + wmcadsPageContents({ + example: false, + sections: true + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/page-header/index.njk b/src/www/pages/tfwm/components/page-header/index.njk new file mode 100644 index 00000000..5667b47d --- /dev/null +++ b/src/www/pages/tfwm/components/page-header/index.njk @@ -0,0 +1,52 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Page header" %} +{% from "wmcads/components/page-header/_page-header.njk" import wmcadsPageHeader %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    Header with page name

    +{{ + compExample([ + wmcadsPageHeader({ + title: true + }) + ]) +}} +

    Header with page name and icon

    +{{ + compExample([ + wmcadsPageHeader({ + title: true, + icon:'general-info' + }) + ]) +}} +

    Plain Header

    +{{ + compExample([ + wmcadsPageHeader({ + title: false + }) + ]) +}} +

    Plain Header - Large

    +

    Where a larger page header is needed you can use the following which will modify the height to 600px.

    +{{ + compExample([ + wmcadsPageHeader({ + title: false, + large: true + }) + ]) +}} +

    Homepage Header

    +{{ + compExample([ + wmcadsPageHeader({ + title: true, + text: "Building a healthier, happier, better connected and more prosperous West Midlands", + home: true + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/patterns/autocomplete/index.njk b/src/www/pages/tfwm/components/patterns/autocomplete/index.njk new file mode 100644 index 00000000..0f829eb8 --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/autocomplete/index.njk @@ -0,0 +1,135 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Autocomplete" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/autocomplete/_autocomplete.njk" import wmcadsAutocomplete %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    +

    + The autocomplete component is an input field that offers the user text suggestions as they type.
    + This is often done by hitting an API endpoint with the users query when the user has finished typing. +

    +

    + The autocomplete pattern is a combination of the input and loader components. +

    +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + + +


    +{# Default #} +

    Default state

    +

    In its default state, the autcomplete component is made up of a text input with a search icon.

    +

    For best practice, ensure that the placeholder and aria-label describes what the autocompletes intended purpose is.

    +

    Notice that there is also a ds-loader component nested within the autocomplete, more on that in the next section.

    +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoComplete", + query: '' + }) + ]) | trim +}} + + +

    +{# Loading #} +

    Loading

    +

    + When a user types in a query, you may want to have some code that hits an API or gets the data/suggestions for the autocomplete from somewhere. To help users understand that they need to wait for something we can change the autocomplete to a loading state. + We do this by adding the class ds--is-loading to the top level of the autocomplete (this is the only difference between the loading state and default state code snippets). +

    +

    As mentioned in the previous section, there is a ds-loader component nested in the autocomplete.
    When adding the ds--is-loading class, it will hide the search icon and show the loading spinner in it's place.

    +

    Below is an example of how the autocomplete looks when a user has typed in 'My query' and is waiting for autocomplete suggestions to load.

    + +

    It is good practice to:

    + +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteQuery", + query: 'My query', + loading: true + }) + ]) | trim +}} + + +

    +{# Results #} +

    Suggestions

    +

    The final state of the autocomplete is showing the suggestions.

    +

    You'll notice there is a new section in the code snippet called ds-autocomplete-suggestions, this should be shown/visible when your API/data has loaded the suggestions.

    +

    It's good practice to:

    + + +

    Default (text)

    +

    The most commonly used suggestions will be displayed as text only.

    +

    + It is good practice to: +

    + + +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteSuggestions", + showSuggestions: true, + textSuggestions: true, + query: 'My query' + }) + ]) | trim +}} + +{# With disruption indicator #} +

    With disruption indicator

    +

    + This autocomplete is combined with the medium / normal - disruption indicator component. +

    +

    You will notice that the suggestions are much bigger than text only results, and have an overflow scrollbar. This scrollbar will appear if the height of the suggestion container goes over a certain height.

    +

    + As you can see from the code snippet, the main ds-autocomplete-suggestions and ds-autocomplete-suggestions__li classes are prevelant on the ul and li elements. Within the li element we have nested the disruption indicator component whilst also using the wmcads grid. This gives enough flexibility to style the suggestions to how we want, find out more in the next section. +

    +{{ + compExample([ + wmcadsAutocomplete({ + showSuggestions: true, + query: 'x15' + }) + ]) | trim +}} + +

    Customising suggestions

    +

    There are many ways in which you can show the suggestions, as the autocomplete component has been built in a way that the suggestion results can be custom styled to how you like.

    +

    + As long as you have the ul element with the class ds-autocomplete-suggestions which contains a direct child li element that has the class ds-autocomplete-suggestions__li then you can fully customise how you want the suggestions to look. +

    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/patterns/banner/index.njk b/src/www/pages/tfwm/components/patterns/banner/index.njk new file mode 100644 index 00000000..f7eee3ec --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/banner/index.njk @@ -0,0 +1,273 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Banner" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/banner/_banner.njk" import wmcadsBanner %} + +{% block content %} + +{% markdown %} + +## Normal + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentHTML: "This is a new service - your feedback will help us to improve it." + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Banner with phase indicator #} + +## With phase indicator + +{# What #} + +### What does it do? + +- Helps users to identify when a service is new +- Offers users the opportunity to give feedback about a new service + {# When to #} + +### When to use it? + +- When a service is new + +{# When not to #} + +### When not to use it? + +- On a service that has matured and has a steadily positive rate of satisfaction + +{# How #} + +### How it works + +- A service can be in Alpha (prototype stage) or Beta (when it is on a publicly-accessible website) +- The survey link must point to a Hotjar or service feedback survey, with the service name within the URL. For example, /?serviceName=descriptiveName. + A service can either be in Alpha (prototype stage) or Beta (when it is on a publicly accessible website). + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + phase: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Emergency banner #} + +## Emergency banner + +{# What #} + +

    What does it do

    + +- It communicates emergency information and provides advice on what to do. +- When an emergency is no longer relevant, the content will be archived or removed. + +{# When to #} + +

    When to use it?

    + +- When you need to communicate information that is urgent or critical, which will potentially affect a large group of our users. For example, if there is an emergency situation announced in Birmingham, the banner would advise all users on travel updates and guidance. +- The emergency banner should be placed directly below the main navigation. +- Only show one emergency banner notification at a time. + +{# When not to #} + +

    When not to use it?

    + +- When a warning or emergency is directly related to a task the user is completing. In this case, use the appropriate Message component to notify users of any issues. +- If the issue is related to a service we are providing such as our customer service, you should place the Warning text and Inset text components next to the affected service, detailing the issue. +- Any disruptions to travel will be highlighted on the home page through the Disruption indicator components. + +{# How #} + +

    How it works

    + +- The user can dismiss the Emergency banner through the 'Close' link. This will remove the current emergency banner from all pages they visit on the website. +- The On-page variant is only shown when a user is on the Emergency advice page, which can be accessed through the 'Read our latest advice' link. + +{# Sitewide #} + +### Sitewide + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} +{# On-page #} + +### On-page variant + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true, + onPage: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} +{% markdown %} + +{# Hub page banner #} + +## Hub page banner + +{# What #} + +

    What does it do?

    + +- Helps users to identify they have eventered a Hub section of the website +- Provides users with a short description of the chosen hub of the WMCA + +{# When #} + +

    When to use it?

    + +- Only on Hub Landing Pages + +

    When not to use it?

    + +- On pages where the content is not related to a hub overview + +

    How it works

    + +- The image container width will expand if users are viewing the page with a browser width higher than 1280px. +- The image within the container will zoom to fill the size of the image container. +- The image will be hidden on mobile devices. Our previous research found mobile users do not see the value of images on mobile pages. +- The image, optional logo or icon will change for each hub landing page. + +{% endmarkdown %} + +{% from "wmcads/patterns/hub-page-banner/_hub-page-banner.njk" import wmcadsHubPageBanner %} + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using a short description" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using an example brand logo with a longer text description", + logo: true + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{{ + compExample([ + wmcadsHubPageBanner({ + title: "Hub Header with a longer example title" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} + +{# Homepage banner #} + +## Homepage + +{# What #} + +

    What does it do?

    + +- Provides a complementary image associated with the West Midlands +- Highlights a welcome message for visitors of the West Midlands Combined Authority site + +{# When #} + +

    When to use it?

    + +- On the homepage + +

    When not to use it?

    + +- Regular content pages + +{% endmarkdown %} + +{% from "wmcads/patterns/banner/homepage-banner/_homepage-banner.njk" import wmcadsHomepageBanner %} + +{{ + compExample([ + wmcadsHomepageBanner() + ], { + componentPath: "wmcads/patterns/banner/homepage-banner/", + njk: true, + njkProps: wmcadsHomepageBannerProps + }) +}} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/patterns/board-members/index.njk b/src/www/pages/tfwm/components/patterns/board-members/index.njk new file mode 100644 index 00000000..2072efcb --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/board-members/index.njk @@ -0,0 +1,22 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Board Members" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/board-members/_board-members.njk" import wmcadsBoardMembers %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# Board members #} +

    Board Members

    + +{{ + compExample([ + wmcadsBoardMembers({ + + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/patterns/contact-details/index.njk b/src/www/pages/tfwm/components/patterns/contact-details/index.njk new file mode 100644 index 00000000..3299dd2b --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/contact-details/index.njk @@ -0,0 +1,111 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Contact details" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/contact-details/_contact-details.njk" import wmcadsContactDetails %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    About

    + {# What #} +

    What does it do?

    + + {# When #} +

    When to use it?

    + + {# When not #} +

    When not to use it?

    + + {# How it works #} +

    How it works?

    + +

    + GOV.UK has detailed information about how to display contact details. +

    + + +

    Contact Details - Address

    + + {{ + compExample([ + wmcadsInsetText( + { + thinner : true, + html: "Customer Services
    Transport for West Midlands
    16 Summer Lane
    Birmingham
    B19 3SD" + } + ) + ]) + }} + + +

    Contact Details - Template

    + + {{ + compExample([ + wmcadsInsetText({html: + wmcadsContactDetails({ + warningText: "We are currently experiencing problems with our
    telephone systems and cannot answer calls", + warningIcon: "general-warning-triangle", + content: " + customerservice@tfwm.org.uk
    + Telephone: 0345 303 6760
    + Monday to Tuesday and Thursday to Friday, 9am - 5pm,
    + Wednesday, 9.30am - 5pm" + }) | indent(6) | trim + }) + ]) + }} + + + +

    Contact Details - Template TfWM

    + + {{ + compExample([ + wmcadsInsetText({ + html: " +

    Transport for West Midlands

    +

    + Twitter
    + Facebook
    +

    +

    + Submit an enquiry
    + Telephone: 0345 303 6760
    +

    + Monday to Tuesday and Thursday to Friday, 9am - 5pm,
    + Wednesday, 9.30am - 5pm
    + Saturday and Sunday, closed + " + }) + ]) + }} + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/patterns/content-cards/index.njk b/src/www/pages/tfwm/components/patterns/content-cards/index.njk new file mode 100644 index 00000000..26a61062 --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/content-cards/index.njk @@ -0,0 +1,236 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Content cards" %} +{% set section="Patterns" %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +

    These are common applications of the content card component.

    +
    + +

    +{# Map card #} +

    Map card

    +{# What #} +

    What is it?

    + + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{# Map example #} +{% from "wmcads/patterns/content-cards/map/_map.njk" import wmcadsContentCardMap %} + +{{ + compExample([ + wmcadsContentCardMap() + ]) +}} + +

    +{# Travel update card #} +

    Travel update card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{# Set up travel updates #} +{% from "wmcads/patterns/content-cards/travel-updates/_travel-updates.njk" import wmcadsContentCardTravelUpdates %} + +{{ + compExample([ + wmcadsContentCardTravelUpdates() + ]) +}} + +

    +{# Button card #} +

    Button card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{# Set up buttons #} +{% from "wmcads/patterns/content-cards/buttons/_buttons.njk" import wmcadsContentCardButtons %} + +{{ + compExample([ + wmcadsContentCardButtons() + ]) +}} + +

    +{# Image card #} +

    Image card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When to to #} +

    When not to use it?

    + + +{# Set up image #} +{% from "wmcads/patterns/content-cards/image/_image.njk" import wmcadsContentCardImage %} + +{{ + compExample([ + wmcadsContentCardImage() + ]) +}} + +

    +{# In-line navigation card #} +

    In-line navigation card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# How to #} +

    How to use it

    + + +{# Set up inline navigation #} +{% from "wmcads/patterns/content-cards/inline-navigation/_inline-navigation.njk" import wmcadsContentCardInlineNavigation %} + +{{ + compExample([ + wmcadsContentCardInlineNavigation() + ]) +}} + +{# With current page #} +

    In-line navigation with current page

    + +{{ + compExample([ + wmcadsContentCardInlineNavigation({ + withCurrentPage: true + }) + ]) +}} + +

    +{# Email sign up card #} +

    Email sign up card

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +

    When adding a sign up form from Campaign Monitor, you are provided with HTML markup, but make sure not to change any of the generated attributes except for classes.

    +

    They have been changed in the following examples to avoid accessibility errors.

    +
    + +{# Set up email sign up #} +{% from "wmcads/patterns/content-cards/email-sign-up/_email-sign-up.njk" import wmcadsContentCardEmailSignUp %} + +{# Collapsed #} +

    Collapsed

    +

    This is the default state for the email sign up card.

    + +{{ + compExample([ + wmcadsContentCardEmailSignUp({ exampleSuffix: "example-1"}) + ]) +}} + +{# Expanded #} +

    Expanded

    +

    The collapsed card will expand when the 'continue' button is pressed/tapped.

    + +{{ + compExample([ + wmcadsContentCardEmailSignUp({ expanded: true, exampleSuffix: "example-2" }) + ]) +}} + +{# External link #} +

    External link

    +

    Use this content card when you want to send users to an external Campaign Monitor form if you want to capture more user data such as demographics, travel habits etc.

    + +{{ + compExample([ + wmcadsContentCardEmailSignUp({ externalLink: true, exampleSuffix: "example-3" }) + ]) +}} +{% endblock %} diff --git a/src/www/pages/tfwm/components/patterns/cookies/index.njk b/src/www/pages/tfwm/components/patterns/cookies/index.njk new file mode 100644 index 00000000..68ce0201 --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/cookies/index.njk @@ -0,0 +1,87 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} {% set pageTitle = "Cookies" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/cookies/cookies-banner/_cookies-banner.njk" import wmcadsCookiesBanner %} +{% from "wmcads/patterns/cookies/cookies-manager/_cookies-manager.njk" import wmcadsCookiesManager %} + +{% block content %} + +

    About

    +{# What #} +

    What does it do?

    + +
    +

    +

    Cookie banner

    +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# How #} +

    How it works

    + +

    The Cookies banner should be placed above the main header and be on every page

    + +{{ + compExample([ + wmcadsCookiesBanner() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: false + }) | trim }} + +

    +

    Manage Cookies

    +{# When to #} +

    When to use it?

    + + +{{ + compExample([ + wmcadsCookiesManager() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: true + }) | trim }} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/patterns/feedback-loop/index.njk b/src/www/pages/tfwm/components/patterns/feedback-loop/index.njk new file mode 100644 index 00000000..7766f45c --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/feedback-loop/index.njk @@ -0,0 +1,47 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Feedback loop" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/feedback-loop/_feedback-loop.njk" import wmcadsFeedbackLoop %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +
    +

    + +{{ + compExample([ + wmcadsFeedbackLoop({ + id: 'fb' + }) + ]) +}} + +

    +

    Open

    +{{ + compExample([ + wmcadsFeedbackLoop({ + isOpen: true, + id: 'fb-open' + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/patterns/footer/index.njk b/src/www/pages/tfwm/components/patterns/footer/index.njk new file mode 100644 index 00000000..136237b8 --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/footer/index.njk @@ -0,0 +1,156 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Footer" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + + +

    +{# Full footer #} +

    Full variant of footer

    +

    The full variant of the footer may include menus which become collapsible on smaller devices.

    +

    To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

    +{{ + compExample([ + wmcadsFooter({ + columns: 3, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +

    +

    2 Column Variant

    + +{{ + compExample([ + wmcadsFooter({ + columns: 2, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + })], + { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
    + + +{# Mobile app variant #} + +

    When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the Transport for West Midlands footer.

    + +

    The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

    + +

    To use the mobile app variant:

    + + +

    + You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

    + +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/patterns/header-and-footer/index.njk b/src/www/pages/tfwm/components/patterns/header-and-footer/index.njk new file mode 100644 index 00000000..8e42881b --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/header-and-footer/index.njk @@ -0,0 +1,212 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header and footer" %} +{% set section="Patterns" %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +
    +

    + + + +{# Header #} +

    Header

    +{# Skip Link #} +

    Skip link

    +

    There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

    +

    Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

    +{# Logo #} +

    Logo

    +

    This must always be the West Midlands Combined Authority logo.

    +{# Phase indicator #} +

    Phase indicator

    +

    This component must be used if the service is not live, using the phase indicator guidance.

    +{# Navigation #} +

    Navigation

    +

    The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

    +

    The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

    +

    We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

    +{# Mobile apps #} +

    Mobile apps

    +

    When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

    +{# Search #} +

    Search

    +

    This functionality only shows for desktop and tablet users. When clicked, search expands and takes over the whole page.

    + +{{ + compExample([ + wmcadsHeader ({ + id: "mega-menu", + navItems: navItems, + banner: true, + linkTopLevel: true, + search: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + } + }) + ]) +}} + +{# With title variant #} +

    With a title variant of header

    +

    When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

    + +

    To use the title variant:

    + + + +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + withTitle: true, + id: "basic" + }) + ]) +}} + + +{# Mobile app variant #} +

    Mobile app variant of header

    +

    When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority header.

    + +

    To use the mobile app variant:

    + + +

    + You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'footer pattern', + link: '#mobile-app-footer' + }) + }} . +

    + +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + app: true, + exampleAria: "Mobile app header" + }) + ]) +}} + +

    + + +{# Full footer #} +

    Full variant of footer

    +

    The full variant of the footer may include menus which become collapsible on smaller devices.

    +

    To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

    +{{ + compExample([ + wmcadsFooter({ + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About West Midlands Combined Authority" + }, { + name: "WMCA Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
    + + +{# Mobile app variant #} + +

    When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority footer.

    + +

    The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

    + +

    To use the mobile app variant:

    + + +

    + You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

    + +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/patterns/header-demo/index.njk b/src/www/pages/tfwm/components/patterns/header-demo/index.njk new file mode 100644 index 00000000..c32de977 --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/header-demo/index.njk @@ -0,0 +1,220 @@ + + + + {% include "www/_partials/_head.njk" %} + + + + + + {# header #} + {% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} + {{ + wmcadsHeader({ + id: "mega-menu-example", + search: true, + searchSuggestions: ["See live departures", "Find a timetable", "Check for disruptions", "Manage my Swift card", "Find ticket prices", "Get a refund", "Update Direct Debit", "Apply for a 16-18 photocard"], + navItems: [{ + name: "Plan a journey", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Swift and tickets", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "Get help", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + }], + megaMenu: true + }) + }} + {# header #} + + + {# main #} +
    + Close window +
    + {# main #} + + + {% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} + {{ + wmcadsFooter({ + bottomMenu: [{ + name: "Privacy & Cookies Policy", + link: "https://www.wmca.org.uk/privacy-cookies-policy/" + }] + }) + }} + + + + {% include "www/_partials/_scripts.njk" %} + + + + diff --git a/src/www/pages/tfwm/components/patterns/header/index.njk b/src/www/pages/tfwm/components/patterns/header/index.njk new file mode 100644 index 00000000..423c907b --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/header/index.njk @@ -0,0 +1,305 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/header-v2/_header-v2.njk" import wmcadsHeaderV2 %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/warning-text/_warning-text.njk" import wmcadsWarningText %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + + + +{# Header #} +

    Header

    +{# Skip Link #} +

    Skip link

    +

    There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

    +

    Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

    +{# Logo #} +

    Logo

    +

    This must always be the Transport for West Midlands logo.

    +{# Phase indicator #} +

    Phase indicator

    +

    This component must be used if the service is not live, using the phase indicator guidance.

    +{# Navigation #} +

    Navigation

    +

    The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

    +

    The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

    +

    We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

    +{# Mobile apps #} +

    Mobile apps

    +

    When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

    +{# Search #} +

    Search

    +

    This function expands the mega menu and reveals the search bar along with the ‘I want to…’ feature.

    +

    The ‘I want to...’ feature shows a list of the top page links which users access through search. This is to help users find the information they are searching for faster. These links are regularly updated using search data to maintain their relevance.

    +

    On mobile, the mega menu search function uses a primary purple background instead of the standard white background. Our user testing found users preferred the white link text on the primary purple background as it is clearer to read.

    + +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example-full", + navItems: [{ + name: "Styles" + },{ + name: "Components" + },{ + name: "Patterns" + },{ + name: "User research" + }], + banner: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + }, + exampleAria: "Full header", + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With mega menu #} +

    Mega menu with search example

    + +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example", + search: true, + placeholder: "fg", + brand: "wmca", + navItems: [{ + name: "The Mayor", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Who we are", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "What we do", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + },{ + name: "In my area" + },{ + name: "Contact us" + }], + megaMenu: true, + megaMenuDemo: true + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With title variant #} +

    With a title variant of header

    +

    When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

    + +

    To use the title variant:

    + + + +{{ + compExample([ + wmcadsHeaderV2({ + withTitle: true, + legacyMenu: true, + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +

    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/patterns/index.njk b/src/www/pages/tfwm/components/patterns/index.njk new file mode 100644 index 00000000..55ff4044 --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/index.njk @@ -0,0 +1,16 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Patterns" %} +{% set section = "Patterns" %} +{% set ds = 'mc' %} + +{% block content %} +

    Patterns are reusable parts of the user interface that have been made to support a variety of + applications.

    + +

    Individual patterns can be used in multiple different patterns and contexts. For example, the + text input component + can be used to ask for an email address, a National Insurance number or someone’s name.

    +

    If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples provided + will render exactly as they do inside the Design System.

    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/patterns/question-form/index.njk b/src/www/pages/tfwm/components/patterns/question-form/index.njk new file mode 100644 index 00000000..495871f1 --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/question-form/index.njk @@ -0,0 +1,127 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Question form" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + +

    How it works?

    + + + +

    + {# Form Element #} +

    Form Element

    +

    This pattern can be populated with any form element, such as text, radio buttons, checkboxes, dropdown or file upload.

    + {% from "wmcads/patterns/question/form-element/_form-element.njk" import wmcadsFormElement %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsFormElement({ + text: "Question title", + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Form Element #} + + +

    + {# Reference #} +

    Reference

    +

    This pattern shows a question that shows defined steps and uses the backlink and progress indicator component.

    + {% from "wmcads/patterns/question/reference/_reference.njk" import wmcadsReference %} + {% from "wmcads/components/form-elements/input/_input.njk" import wmcadsInput %} + {{ + compExample([ + wmcadsReference({ + question: "What is your Direct Debit Reference?", + text: "

    This can be found in the email we sent you asking you to reinstate your Direct Debit and begins with a 6.

    If you didn’t receive this email, it is shown next to every payment to WMCA for your Direct Debit on your bank statement.

    ", + actualSection: "1", + totalSections: "3", + sectionName: "About your ticket", + fields: + wmcadsInput({ + label: "Direct Debit Reference", + classNames: "ds-col-1-2" + }) , + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Reference #} + + +

    + {# Summary #} +

    Summary

    +

    This shows the user all of the data they have entered before they submit the form. This stage allows the user to change any details before submitting the form.

    + {% from "wmcads/patterns/question/summary/_summary.njk" import wmcadsSummary %} + {% from "wmcads/components/table/_table.njk" import wmcadsTable %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsSummary({ + question: "Check your answers before reinstating your Direct Debit", + html: +"

    Now send your request

    +

    By submitting this request you are confirming that, to the best of your knowledge, the details you are providing are correct.
    +
    You consent to West Midlands Combined Authority possibly changing your Direct Debit date if it usually would occur in the next 10 days.
    +
    You also consent to West Midlands Combined Authority reinstating your Direct Debit instruction.

    ", + button: + wmcadsButton({ + classNames: "ds-btn--start", + text: "Accept & Send ", + iconRight: "general-chevron-right" + }) + }) + + ]) + }} + {# End Summary #} + + +

    + {# Confirmation Message #} +

    Confirmation Message

    +

    This is a confirmation message to show that the user has successfully submitted the data in the form, along with a reference or any information which the user needs to be made aware of.

    + {% from "wmcads/patterns/question/confirmation-message/_confirmation-message.njk" import wmcadsConfirmationMessage %} + {{ + compExample([ + wmcadsConfirmationMessage() | indent(4) | trim + ]) + }} + {# End Confirmation Message #} + +{% endblock %} diff --git a/src/www/pages/tfwm/components/patterns/search/index.njk b/src/www/pages/tfwm/components/patterns/search/index.njk new file mode 100644 index 00000000..01d64df5 --- /dev/null +++ b/src/www/pages/tfwm/components/patterns/search/index.njk @@ -0,0 +1,147 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Search" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    What does it do?

    + +

    When to use it?

    + +

    How it works

    + + +

    + {# Search bar #} +

    Search bar

    + {% from "wmcads/patterns/search/search-bar/_search-bar.njk" import wmcadsSearchbar %} + {{ + compExample([ + wmcadsSearchbar() + ]) + }} + {# End Search bar #} + + +

    + {# Sort #} +

    Sort

    +

    What does it do?

    + + {% from "wmcads/patterns/search/sort/_sort.njk" import wmcadsSearchSort %} + {{ + compExample([ + wmcadsSearchSort() + ]) + }} + {# End sort #} + +

    + {# Search filter #} +

    Filter

    +

    What does it do?

    + +

    When to use it?

    + + {% from "wmcads/patterns/search/search-filter/_search-filter.njk" import wmcadsSearchFilter %} + {{ + compExample([ + wmcadsSearchFilter( + { + accordion: [{ + summaryTitle: "Topic", + options: [ + "Tickets", "Travel advice", "Planning a journey" + ] + }, + { + summaryTitle: "Page type", + options: [ + "Services", "News", "Bus routes", "Timetables", "Offers and promotions" + ] + } + ]} + ) + ], { + componentPath: "wmcads/patterns/search/search-filter/", + njk: false, + js: true, + iframe: false + }) + }} + + {# End search filter #} +

    + {# Search result #} +

    Search result

    +

    What does it do?

    + +

    How it works

    + + {% from "wmcads/patterns/search/search-result/_search-result.njk" import wmcadsSearchResult %} + {{ + compExample([ + wmcadsSearchResult( + { + pageTitle: "Swift: The smarter way to travel", + breadcrumbs: ['Home', 'Swift'], + excerpt: "Swift is the easy and flexible way to travel around the West Midlands. find the swift card for you. How do you travel? bus…" + } + ) + ]) + }} + {# End search result #} +

    + {# Pagination #} +

    Pagination links

    +

    What does it do?

    + + {% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} + {{ + compExample([ + wmcadsPagination({ + pageCount: 8, + activePage: 1 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 5 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 8 + }) + ]) + }} + {# End pagination #} +

    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/phase-indicator/index.njk b/src/www/pages/tfwm/components/phase-indicator/index.njk new file mode 100644 index 00000000..114e87c9 --- /dev/null +++ b/src/www/pages/tfwm/components/phase-indicator/index.njk @@ -0,0 +1,39 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Phase indicators" %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + + +{# When #} +

    When to use it?

    + +

    + A service can either be in Alpha (prototype stage) or Beta (when it is on a publicly accessible website). +

    + + {% from "wmcads/components/phase-indicator/_phase-indicator.njk" import wmcadsPhaseIndicator %} + {% from "wmcads/components/phase-indicator/_phase-indicator-link.njk" import wmcadsPhaseIndicatorLink %} + {% from "www/_partials/component-example/component-example.njk" import compExample %} + {{ + compExample([wmcadsPhaseIndicator()]) + + }} +{% endblock %} diff --git a/src/www/pages/tfwm/components/portfolio-leads/index.njk b/src/www/pages/tfwm/components/portfolio-leads/index.njk new file mode 100644 index 00000000..e545044a --- /dev/null +++ b/src/www/pages/tfwm/components/portfolio-leads/index.njk @@ -0,0 +1,12 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Portfolio leads" %} +{% from "wmcads/components/portfolio-leads/_portfolio-leads.njk" import wmcadsPortfolioLeads %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{{ + compExample([ + wmcadsPortfolioLeads() + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/share/index.njk b/src/www/pages/tfwm/components/share/index.njk new file mode 100644 index 00000000..6a7a7fd7 --- /dev/null +++ b/src/www/pages/tfwm/components/share/index.njk @@ -0,0 +1,12 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Share" %} +{% from "wmcads/components/share/_share.njk" import wmcadsShare %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{{ + compExample([ + wmcadsShare() + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js b/src/www/pages/tfwm/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js new file mode 100644 index 00000000..8371607f --- /dev/null +++ b/src/www/pages/tfwm/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js @@ -0,0 +1,71 @@ +function aToZContentStyleGuide() { + // FUNCTIONS + // Change accordion state + const changeAccordionState = (accordionElem, changeStateToOpen = true) => { + const accordionBtn = accordionElem.querySelector('.ds-accordion__summary-wrapper'); + if (changeStateToOpen) { + accordionElem.classList.add('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', true); + } else { + accordionElem.classList.remove('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', false); + } + }; + + // Change all accordion states at once + const changeAllAccordionStates = changeStateToOpen => { + const accordions = document.querySelectorAll('main .ds-accordion'); + accordions.forEach(accordion => changeAccordionState(accordion, changeStateToOpen)); + }; + + // Scroll to an anchor within an accordion + const scrollToAnchor = idWithHash => { + // Check if element is on the page + const elem = document.querySelector(idWithHash); + if (!elem || elem.classList.contains('ds-accordion__summary-wrapper')) { + return; + } + // Open accordion and scroll to element + changeAccordionState(elem.parentElement.parentElement); + elem.scrollIntoView(); + }; + + // Check for anchor to scroll to onload + const scrollToAnchorOnLoad = () => { + if (document.location.hash) { + scrollToAnchor(document.location.hash); + } + }; + + // Add event listener to all section links on the page + const setupScrollToAnchor = () => { + const anchors = document.querySelectorAll('main a[href^="#"]:not([href="#"])'); + // Loop through an add event listener + anchors.forEach(anchor => { + anchor.addEventListener('click', e => { + e.preventDefault(); + scrollToAnchor(anchor.hash); + }); + }); + }; + + // Set up controls + const setupAccordionControls = () => { + const controls = document.querySelectorAll('main .js-accordion-controls button'); + + controls.forEach(control => { + control.addEventListener('click', () => { + changeAllAccordionStates(control.classList.contains('js-accordion-controls-open')); + }); + }); + }; + + // CALL FUNCTIONS + if (document.querySelector('#atozofstyle')) { + scrollToAnchorOnLoad(); + setupScrollToAnchor(); + setupAccordionControls(); + } +} + +export default aToZContentStyleGuide; diff --git a/src/www/pages/tfwm/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json b/src/www/pages/tfwm/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json new file mode 100644 index 00000000..143a4f85 --- /dev/null +++ b/src/www/pages/tfwm/components/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json @@ -0,0 +1,538 @@ +{ + "aToZOfStyles": [ + { + "letter": "A", + "styles": [ + { + "title": "Abbreviations and acronyms", + "content": "

    The first time you use an abbreviation or acronym explain it in full on each page unless it's well known, like UK or BBC. Then refer to it by initials.

    Do not use full stops in abbreviations: BBC, not B.B.C.

    If you only use a term once, you don't need to include the abbreviation afterwards.

    Use 'm' (for millions) and 'bn' (for billions) for sums of money and measurable quantities: £10bn; 1bn litres of water. However, spell out for people and countable nouns: 3 billion commuters; 10 billion tickets.

    Use lower case for standard measurements: kg; km; lb; mph but use upper case for KB; GB; MB.

    Exception: Spell out metres to prevent confusion with abbreviation for million.

    Note:

    1. Do not include a space between the number and the unit: 20km; 50kph; 100KB
    2. Never add an 's' to measurements: 20km, not 20kms

    Use lower case for ie and eg, but avoid using these terms altogether where possible. Use 'that is' or 'for example' instead.

    " + }, + { + "title": "Active voice", + "content": "

    Use the active voice, not the passive voice - it’s easier to read. For example:

    We’re going to get the train tomorrow (active voice)

    A train is going to be caught by us tomorrow (passive voice)

    " + }, + { + "title": "Addresses", + "content": "

    Use the contact details design pattern. This shows you how to format addresses.

    " + }, + { + "title": "Addressing the user", + "content": "

    Address the user as 'you' wherever possible.

    " + }, + { + "title": "Adult rate", + "content": "

    Do not hyphenate.

    " + }, + { + "title": "Ages", + "content": "

    Do not use hyphens in ages unless to avoid confusion, although it's always best to write in a way that avoids ambiguity. For example, 'a class of 15 16-year-old students took the A level course' can be written as '15 students aged 16 took the A level course'.

    Write ages like this: XX years old (for example, 66 years old).

    Exception - use hyphens when talking about age groups:

    " + }, + { + "title": "American and UK English", + "content": "

    Use UK English spelling and grammar. For example, use 'organise' not 'organize', 'modelling' not 'modeling', and 'fill in a form', not 'fill out a form'.

    American proper nouns, like 4th Mechanized Brigade or World Health Organization, take American English spelling.

    " + }, + { + "title": "Ampersand", + "content": "

    Use and rather than &, unless it's a department's logo image or a company's name as it appears on the Companies House register.

    " + }, + { + "title": "Antisocial", + "content": "

    Hyphenated.

    " + }, + { + "title": "A-road", + "content": "

    Hyphenated.

    " + } + ] + }, + { + "letter": "B", + "styles": [ + { + "title": "Bacs (Bankers Automated Clearing System)", + "content": "

    Use the acronym as it's more widely known than the full name. No need to include the full name in brackets.

    " + }, + { + "title": "bold", + "content": "

    Only use bold for instructions when you’re talking about an interactive service.

    You can use bold to explain what field a user needs to fill in on a form, or what button they need to select. For example: \"Select Continue.\"

    Use bold sparingly - using too much will make it difficult for users to know which parts of your content they need to pay the most attention to.

    Do not use bold in other situations, for example to emphasise text.

    To emphasise words or phrases, you can:

    " + }, + { + "title": "bus station", + "content": "

    Only use upper case if you're talking about a specific bus station: Dudley Bus Station, Coventry Pool Bus Station.

    Use lower case if you're talking about bus stations in general: You can find bike racks at our bus stations.

    " + }, + { + "title": "borough council", + "content": "

    Lower case except in a name: Dudley Metropolitan Borough Council.

    " + }, + { + "title": "Bullet points and numbered steps", + "content": "

    You can use bullet points to make text easier to read. Make sure that:

    Bullets should normally form a complete sentence following from the lead text. But it's sometimes necessary to add a short phrase to clarify whether all or some of the points apply. For example, 'You can only register a pension scheme that is (one of the following):'

    The number and type of examples in a list may lead the user to believe the list is exhaustive. This can be dealt with by

    Numbered steps

    Use numbered steps instead of bullet points to guide a user through a process. List the things the user needs to do in order. You do not need a lead-in line. Steps end in a full stop because each should be a complete sentence.

    " + } + ] + }, + { + "letter": "C", + "styles": [ + { + "title": "campaign/scheme names and brands", + "content": "

    If you have a scheme or campaign brand, explain the brand. Don't expect users to understand what you mean. If you say ‘be aware and share’ or ‘get your roll and stroll on’ out of context, it’s not clear what that means.

    Don’t capitalise slogans like ‘be aware and share’. If you’re talking about a specific brand or campaign, use capitals. For example, Workwise, PassProtect. Don’t tell people to ‘Be Aware and Share’, but do say ‘the Be Aware and Share’ campaign.

    For example:

    " + }, + { + "title": "cash fare", + "content": "Do not use - it's confusing. Say 'ticket bought on the bus, train or tram on the day' instead." + }, + { + "title": "Capitalisation", + "content": "

    DO NOT USE BLOCK CAPITALS FOR LARGE AMOUNTS OF TEXT AS IT'S QUITE HARD TO READ.

    Always use lower case, even in page titles. The exceptions to this are proper nouns.

    " + }, + { + "title": "checkbox", + "content": "

    Not \"check box\"

    " + }, + { + "title": "child rate", + "content": "

    Do not hyphenate.

    " + }, + { + "title": "click", + "content": "

    Don't use \"click\" when talking about user interfaces because not all users click. Use \"select\".

    You can use \"right-click\" if the user needs to right-click to open up a list of options to progress through the user journey.

    " + }, + { + "title": "collective nouns", + "content": "

    Treat as singular, except staff and police: the committee has but the staff are; the police want.

    A pair and a couple are both plural.

    " + }, + { + "title": "concessionary", + "content": "

    Try to avoid. Use these instead:

    It’s okay to use concessionary if you’re talking about the English National Concessionary Travel Scheme.

    " + }, + { + "title": "contact details", + "content": "

    Use the contact details design pattern.

    " + }, + { + "title": "contactless", + "content": "

    Not Contactless.

    " + }, + { + "title": "contractions", + "content": "

    You can use contractions to help make your text less formal.

    Avoid negative contractions like can't and don't. Many users find them harder to read, or misread them as the opposite of what they say. Use cannot instead of can't; do not instead of don’t.

    Avoid should've, could've, would've, they've too. These can also be hard to read.

    " + }, + { + "title": "co-operation", + "content": "

    Hyphenated.

    " + }, + { + "title": "coronavirus (COVID-19)", + "content": "

    Coronavirus is the virus which causes the illness COVID-19. Coronavirus is lower case.

    " + }, + { + "title": "council", + "content": "

    Use lower case when writing about local councils in general. Use capitals for the official name of a local council, for example: Birmingham City Council.

    " + }, + { + "title": "Council Tax", + "content": "

    Upper case.

    " + }, + { + "title": "customers", + "content": "

    Refer to 'customers' rather than 'passengers'.

    " + } + ] + }, + { + "letter": "D", + "styles": [ + { + "title": "Dates", + "content": "

    Use 'to' instead of a dash or slash in date ranges. 'To' is quicker to read than a dash, and it's easier for screen readers.

    Always explain what your date range represents, for example 'tax year 2013 to 2014' or 'September 2013 to July 2014'. Date ranges can be the academic year, calendar year or tax year. This is why date ranges must be very, very clear.

    " + }, + { + "title": "daytime", + "content": "

    But night-time.

    " + }, + { + "title": "Direct Debit", + "content": "

    Upper case.

    " + }, + { + "title": "Direct Debit Instruction", + "content": "

    Upper case.

    " + }, + { + "title": "disabled access", + "content": "

    Use this term when referring to disabled accessibility, as 'accessibility' has a wider meaning.

    " + }, + { + "title": "disabled people", + "content": "

    Not 'the disabled' or 'people with disabilities'.

    Read GOV.UK advice on words to use and avoid when talking about disability.

    " + }, + { + "title": "district council", + "content": "

    Lower case even in a name, like Warwick district council.

    " + } + ] + }, + { + "letter": "E", + "styles": [ + { + "title": "eg, etc and ie", + "content": "

    eg can sometimes be read aloud as 'egg' by screen reading software. Instead use 'for example' or 'such as' or 'like' or 'including' - whichever works best in the specific context.

    etc can usually be avoided. Try using 'for example' or 'such as' or 'like' or 'including'. Never use etc at the end of a list starting with these words.

    ie - used to clarify a sentence - is not always well understood. Try (re)writing sentences to avoid the need to use it. If that is not possible, use an alternative such as 'meaning' or 'that is'.

    " + }, + { + "title": "email", + "content": "

    Not e-mail.

    Always give the full email address when providing a hyperlink. For example, 'email ticketing@twfm.org.uk' not 'email the ticketing team'

    " + } + ] + }, + { + "letter": "F", + "styles": [ + { + "title": "FAQs (frequently asked questions)", + "content": "

    Do not use FAQs.

    If you write content by starting with user needs, you will not need to use FAQs.

    FAQs are discouraged because they:

    " + }, + { + "title": "fine", + "content": "

    Use 'fine' instead of 'financial penalty'.

    For example, \"You'll pay a £50 fine.\"" + }, + { + "title": "first person", + "content": "

    Use \"we'\" and \"us\" when addressing the user where possible. For example, instead of \"West Midlands Combined Authority has…\" say \"We have\" - it’s more personal.

    " + }, + { + "title": "fire and rescue service", + "content": "

    Lower case.

    " + }, + { + "title": "focus", + "content": "

    Focuses/focused/focusing. Not focusses/focussed/focussing.

    " + } + ] + }, + { + "letter": "G", + "styles": [ + { + "title": "government", + "content": "

    Lower case unless it's a full title. For example: 'UK government', but 'Her Majesty's Government of the United Kingdom of Great Britain and Northern Ireland'.

    " + } + ] + }, + { + "letter": "H", + "styles": [ + { + "title": "Hyphenation", + "content": "

    Hyphenate:

    Do not hyphenate:

    Do not use a hyphen unless it's confusing without it, for example, a little used-car is different from a little-used car. You can also refer to The Guardian style guide for advice on hyphenation.

    Use 'to' for time and date ranges, not hyphens.

    " + } + ] + }, + { + "letter": "I", + "styles": [ + { + "title": "ie", + "content": "

    see eg, etc and ie

    " + }, + { + "title": "Italics", + "content": "

    Do not use italics. They can be hard to read online.

    " + } + ] + }, + { + "letter": "J", + "styles": [ + { + "title": "job titles", + "content": "

    Use upper case when referring to a specific role: Lord Mayor of Birmingham.

    Use lower case if writing generally: service assistants, station managers.

    " + }, + { + "title": "Journey Planner", + "content": "

    Our travel tool that helps with live route-planning across our network

    A stand-alone link to it should be action-led and first-person: 'Plan my journey'.

    If giving instruction, it can be second-person (to avoid mixing perspectives): 'Plan your journey'.

    If listing tools, we can use the product name: 'Journey Planner'.

    " + } + ] + }, + { + "letter": "L", + "styles": [ + { + "title": "Links", + "content": "

    Front-load your link text with the relevant terms and make them active and specific. Do not use ‘click here’. Use text that describes the link instead.

    " + }, + { + "title": "Lists", + "content": "

    Lists should be bulleted to make them easier to read. See bullets and steps.

    Very long lists can be written as a paragraph with a lead-in sentence if it looks better: 'The following countries are in the EU: Spain, France, Italy...'

    " + }, + { + "title": "log in", + "content": "

    See sign in or log in.

    " + } + ] + }, + { + "letter": "M", + "styles": [ + { + "title": "measurements", + "content": "

    Use lower case for standard measurements: kg; km; mph; kph but use upper case for KB; GB; MB.

    Spell out metres to prevent confusion with abbreviation for million.

    Do not include a space between the number and the unit: 20km; 50mph; 100KB.

    Never add an 's' to measurements: 20km, not 20kms.

    " + }, + { + "title": "Metro", + "content": "

    Only use when talking about the company that runs the tram - West Midlands Metro. To talk about the tram as a mode of transport, use tram, not Metro.

    " + }, + { + "title": "money", + "content": "

    Use the £ symbol: £75.

    Do not use decimals unless pence are included: £75.50 but not £75.00.

    Do not use '£0.xx million' for amounts less than £1 million.

    Write out pence in full: calls will cost 4 pence per minute from a landline.

    Currencies are lower case.

    " + } + ] + }, + { + "letter": "N", + "styles": [ + { + "title": "nBus", + "content": "

    Use when talking about network bus tickets - always use a lower case ‘n’, upper case ‘B’.

    " + }, + { + "title": "nNetwork", + "content": "

    Use when talking about network tickets for the bus, train and tram - always use a lower case ‘n’, followed by an upper case ‘N’.

    " + }, + { + "title": "nTrain", + "content": "

    Use when talking about network train tickets - always use a lower case ‘n’, upper case ‘T’.

    " + }, + { + "title": "Numbers", + "content": "

    Use 'one' unless you're talking about a step, a point in a list or another situation where using the numeral makes more sense: 'in point 1 of the design instructions', for example. Or this:

    You'll be shown 14 clips that feature everyday road scenes.

    There will be:

    1. developing hazard in 13 clips
    2. developing hazards in the other clip

    Write all other numbers in numerals (including 2 to 9) except where it's part of a common expression like 'one or two of them' where numerals would look strange.

    If a number starts a sentence, write it out in full (Thirty-four, for example) except where it starts a title or subheading.

    For numerals over 999 - insert a comma for clarity: 9,000

    Spell out common fractions like two-thirds.

    Use a % sign for percentages: 50%.

    Use a 0 where there's no digit before the decimal point.

    Use '500 to 900' and not '500-900' (except in tables and for the 16-18 photocard).

    Use MB for anything over 1MB: 4MB not 4096KB.

    Use KB for anything under 1MB: 569KB not 0.55MB.

    Keep it as accurate as possible and up to 2 decimal places: 4.03MB.

    Addresses: use 'to' in address ranges: 49 to 53 Cherry Street.

    Ordinal numbers

    Spell out first to ninth. After that use 10th, 11th and so on.

    In tables, use numerals throughout.

    " + }, + { + "title": "NXWM", + "content": "

    see operator names.

    " + } + ] + }, + { + "letter": "O", + "styles": [ + { + "title": "off-peak", + "content": "

    Use lower case and include a hyphen.

    " + }, + { + "title": "older people", + "content": "

    Refer to older people rather than elderly people.

    " + }, + { + "title": "online", + "content": "

    One word. Do not use 'on-line' or 'on line'.

    " + }, + { + "title": "operator names", + "content": "

    Do not abbreviate the name. For example, do not use ‘WM Metro’, ‘NX West Midlands’ or ‘West Mids Railway’.

    You can use an acronym for timetables and passenger information. For example, ‘West Midlands Metro (WMM)’, ‘National Express West Midlands (NXWM)’ or ‘West Midlands Railway (WMR)’.

    Do not use the NXWM acronym without explaining it first. It is not a well known acronym.

    " + }, + { + "title": "or", + "content": "

    Do not use slashes instead of \"or\". For example, do not say \"Do this 3/4 times\".

    " + }, + { + "title": "opt in/out", + "content": "

    Verb: I would like to opt in

    " + }, + { + "title": "opt-in/out", + "content": "

    Adjective: an opt-in clause

    " + } + ] + }, + { + "letter": "P", + "styles": [ + { + "title": "paper ticket", + "content": "

    A ticket that’s printed on paper, not on a Swift card.

    " + }, + { + "title": "passengers", + "content": "

    Refer to 'customers' rather than 'passengers'.

    " + }, + { + "title": "pay as you go", + "content": "

    Do not hyphenate and always use lower case.

    " + }, + { + "title": "pay as you go credit", + "content": "

    Use to describe Swift cards with a stored cash value

    Note: Do not use 'pay as you go travel value (cash)' or 'pay as you go cash value'.

    " + }, + { + "title": "PDF", + "content": "Upper case. No need to explain the acronym." + }, + { + "title": "plain English", + "content": "

    Lower case plain and upper case English unless in a title: the Plain English Campaign.

    All content should be written in plain English. You should also make sure you use language your audience will understand. Use the Plain English Campaign’s A to Z of alternative words to avoid complex language.

    " + }, + { + "title": "phone numbers", + "content": "

    Phone numbers should be split into at least three groups of digits for readability, ideally with no more than four digits in any single group. For example: 020 7378 1705; 0343 222 6666; 0762 480 4299. See also the design pattern for contact details.

    " + } + ] + }, + { + "letter": "Q", + "styles": [ + { + "title": "quotation marks", + "content": "

    Use single quotation marks in all cases.

    Use double quotation marks if using a quote within a quote.

    If a quote runs on longer than one paragraph, include quotation marks at the beginning of each subsequent paragraph but only at the end of the final paragraph.

    Place full stops and commas inside quotes when they are complete sentences, otherwise place them outside: 'I want to buy a ticket,' said Mr Smith; When he said 'I promise', he didn't really mean it.

    " + } + ] + }, + { + "letter": "R", + "styles": [ + { + "title": "real time/realtime", + "content": "

    Where possible, use 'live' instead of 'realtime' or 'real time'

    real time (noun): this information is being updated in real time.
    realtime (adjective): realtime service information.
    Not real-time.

    " + }, + { + "title": "re-open", + "content": "

    Not reopen.

    " + } + ] + }, + { + "letter": "S", + "styles": [ + { + "title": "seasons", + "content": "

    Use lower case for spring, summer, autumn and winter.

    " + }, + { + "title": "Sentence length", + "content": "

    Do not use long sentences. Check sentences with more than 25 words to see if you can split them to make them clearer.

    " + }, + { + "title": "sign in or log in", + "content": "

    Use sign in rather than log in (verb) for calls-to-action where users enter their details to access a service.

    Do not use login as a noun - say what the user actually needs to enter (like username, password, National Insurance number).

    " + }, + { + "title": "State Pension", + "content": "

    Upper case.

    " + }, + { + "title": "Station", + "content": "

    Lower case. For example, Birmingham New Street station. Do not say tram station, say tram stop.

    " + }, + { + "title": "Stop", + "content": "

    Lower case. For example, Summer Lane bus stop.

    " + }, + { + "title": "Swift card", + "content": "

    Do not capitalise 'Card'.

    " + }, + { + "title": "step-free", + "content": "

    A route between street and platform that doesn't require the use of stairs or escalators.

    " + } + ] + }, + { + "letter": "T", + "styles": [ + { + "title": "terms and conditions", + "content": "

    Not Terms and Conditions or terms & conditions.

    " + }, + { + "title": "text message alerts", + "content": "

    Not SMS alerts.

    " + }, + { + "title": "TfWM", + "content": "

    See entry on Transport for West Midlands.

    " + }, + { + "title": "Times", + "content": "

    use 'to' in time ranges, not hyphens, en rules or em dashes: 10am to 11am (not 10-11am)
    5:30pm (not 1730hrs)
    midnight (not 00:00)
    midday (not 12 noon, noon or 12pm)
    6 hours 30 minutes
    Midnight is the first minute of the day, not the last. You should consider using \"11:59pm\" to avoid confusion about a single, specific time.

    For example, \"You must register by 11:59pm on Tuesday 14 June.\" can only be read one way, but \"You must register by midnight on Tuesday 14 June\" can be read in two ways (the end of Monday 13, or end of Tuesday 14).

    Timetables and printed passenger information use the 24-hour clock in HHMM format.

    " + }, + { + "title": "tram", + "content": "

    Not Metro.

    " + }, + { + "title": "tram stop", + "content": "

    Not station.

    " + }, + { + "title": "Transport for West Midlands", + "content": "

    Avoid referring to Transport for West Midlands (TfWM). Users don't need to know about it while getting travel advice.

    Explaining the relationship between West Midlands Combined Authority, TfWM and West Midlands Combined Authority (WMCA) is complicated. Use \"we\" instead. For example, \"we manage the Key Route Network (KRN)\" with a link to the TfWM policy page.

    " + } + ] + }, + { + "letter": "U", + "styles": [ + { + "title": "under-16s", + "content": "

    Requires a hyphen in all cases. This is true whenever referring to age groups: under-16s; under-18s; over-60s.

    Avoid the common error of adding an apostrophe when making a word or abbreviation plural as this makes it possessive: under-16s not under-16's.

    " + }, + { + "title": "URL", + "content": "

    Upper case. No need to explain the acronym.

    " + }, + { + "title": "username", + "content": "

    Not \"user name\".

    " + } + ] + }, + { + "letter": "W", + "styles": [ + { + "title": "web", + "content": "

    Lower case.

    " + }, + { + "title": "webpage", + "content": "

    One word.

    " + }, + { + "title": "website", + "content": "

    Not web-site or web site.

    " + }, + { + "title": "West Midlands Combined Authority", + "content": "

    Avoid referring to West Midlands Combined Authority (WMCA). Users don't need to know about it while getting travel advice.

    The exception is if you referring to a statutory responsibility or a contract. For example, concessionary passes or terms and conditions.

    " + }, + { + "title": "wifi", + "content": "

    Lower case, no hyphen.

    " + }, + { + "title": "WMCA", + "content": "

    See entry on West Midlands Combined Authority.

    " + }, + { + "title": "wmca.org.uk", + "content": "

    If you are linking to another page, you should use an in-text link rather than the full URL. See the entry on links for more information.

    Sometimes it is better to show the full URL. For example, when telling users to click a link to verify something in an email.

    It is important to use the right URL. Only use wmca.org.uk.

    Do not prefix the URL with ‘www.’ as this makes our URL hard to read. The domain extension ‘.co.uk’ makes it obvious to users that it is a URL.

    " + }, + { + "title": "www.", + "content": "

    See entry on wmca.org.uk.

    " + } + ] + }, + { + "letter": "Z", + "styles": [ + { + "title": "zero-hours contract", + "content": "

    Not \"zero-hour contract\" or \"zero hours contract\"

    " + } + ] + } + ] +} diff --git a/src/www/pages/tfwm/components/styles/a-to-z-content-style-guide/index.njk b/src/www/pages/tfwm/components/styles/a-to-z-content-style-guide/index.njk new file mode 100644 index 00000000..d1434b5c --- /dev/null +++ b/src/www/pages/tfwm/components/styles/a-to-z-content-style-guide/index.njk @@ -0,0 +1,131 @@ +{% extends "www/_layouts/layout-fullwidth.njk" %} +{% set pageTitle="A to Z content style guide" %} {% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +
    +
    +

    Writing content for West Midlands Combined Authority

    +

    + You should create all content with user-focused content design principles. This means content has an identified + user need and is written in plain English. +

    +

    + Do not use marketing speak - users will be visiting your website to perform a task (for example, buy a train ticket or find out about Swift cards). Your content shouldn’t try to sell them anything - instead, tell them the information they need to know in the simplest way possible. +

    +

    + Research has shown that both high literacy and low literacy users prefer plain English because it takes less time to read. Users won’t be on your website for fun - so make the experience quick and easy. +

    +

    + To find out more about why plain language is important, read: +

    +

    +

    + Read the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/content-design/what-is-content-design', + linkTitle: 'GOV.UK introduction to content design', + contentText: 'GOV.UK introduction to content design' + }) + }} + to find out more about content design principles. +

    +

    Design Team can help you to test your content with user research.

    +
    +

    About the A-Z of style guide

    +

    This style guide will help you to use consistent words across West Midlands Combined Authority services.

    +

    + If something is not covered by this style guide, check the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style', + linkTitle: 'GOV.UK Style Guide', + contentText: 'GOV.UK style guide' + }) + }} + . You can also email Samresha Purewal if you think something is missing from this guidance.

    +
    +

    Introducing West Midlands Combined Authority

    +

    If you’re talking about day-to-day services (bus, train or tram), you + may need to make it clear that West Midlands Combined Authority does not run these.

    For example, you could say: "We don’t run the buses, trains or trams. We can point you in the right direction if you need help." +

    +
    +
    + {# A to Z accordions #} +
    +
    +

    A to Z of style

    +
    +
    + + +
    +
    +
    + {% for section in aToZOfStyles %} +
    + +
    + {% for style in section.styles %} +
    + {{style.title}} +
    + {{style.content | safe}} + {% endfor %} +
    +
    + {% endfor %} +
    +
    +
    +
    +{% endblock %} diff --git a/src/www/pages/tfwm/components/styles/colour-palettes/_color-palettes.js b/src/www/pages/tfwm/components/styles/colour-palettes/_color-palettes.js new file mode 100644 index 00000000..f7e01e7d --- /dev/null +++ b/src/www/pages/tfwm/components/styles/colour-palettes/_color-palettes.js @@ -0,0 +1,22 @@ +function colorPalettes() { + const colors = document.querySelectorAll('.ds-website-color-swatch__inner'); + + // Function to convert rgb to hex + function rgb2hex(rgb) { + const newRGB = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); + function hex(x) { + return `0${parseInt(x, 10).toString(16)}`.slice(-2); + } + return `#${hex(newRGB[1])}${hex(newRGB[2])}${hex(newRGB[3])}`; + } + + colors.forEach(swatch => { + const ele = swatch; + const rgbColor = getComputedStyle(swatch).backgroundColor; + const hexColor = rgb2hex(rgbColor); + + ele.nextElementSibling.querySelector('pre code .color-hex').innerText = `color: '${hexColor}'`; + }); +} + +export default colorPalettes; diff --git a/src/www/pages/tfwm/components/styles/colour-palettes/_colorPalette.scss b/src/www/pages/tfwm/components/styles/colour-palettes/_colorPalette.scss new file mode 100644 index 00000000..1b04dd76 --- /dev/null +++ b/src/www/pages/tfwm/components/styles/colour-palettes/_colorPalette.scss @@ -0,0 +1,18 @@ +$cp-swatch-height: 50px; + +.ds-website-color-swatch { + padding: $size-sm; + + &__inner { + display: inline-block; + width: 100%; + height: $cp-swatch-height; + margin-bottom: $size-sm; + } +} + +@each $color, $hex in $palettes { + .ds-website-bg-color-#{$color} { + background-color: $hex; + } +} diff --git a/src/www/pages/tfwm/components/styles/colour-palettes/index.njk b/src/www/pages/tfwm/components/styles/colour-palettes/index.njk new file mode 100644 index 00000000..bce499ac --- /dev/null +++ b/src/www/pages/tfwm/components/styles/colour-palettes/index.njk @@ -0,0 +1,78 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Colour Palettes" %} +{% set section="Styles" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/_color-palette-macro.njk" import colorPalette %} + +{% block content %} +{# About #} +

    About

    +

    Below are the list of West Midlands Combined Authority colour palettes.

    +

    + We have tested our colours against the three most prevalent colour blind anomalies: protanopia, deuteranopia and tritanopia. While in some circumstances, particularly protanopia, colours can appear to be relatively similar. +

    +

    + These issues can be circumvented by not referring to specific colours. For instance, when referring to a green button with the word 'start' in, the phrase 'click the green button to start' would not be helpful. Instead, use 'click the start button', without a colour reference. +

    +

    + W3C AA Accessibility criteria requires the contrast of test to be enhanced, with a contrast ratio upwards of 3:1. +

    +

    + All brand/web colours meet this criteria, though the modal colour 'WM Railway' must only be used for iconography and graphical devices. +

    +

    The background only colours can only be used as a background colour and they are not intended for any other use.

    +
    + +{# Using in development #} +

    Using in development

    +

    wmcads SCSS

    +

    If you are using WMCA Design System's SCSS in development, you shouldn't use the HEX values! Instead you should always use the scss variables instead, for example use get-color(primary) instead of #3c1053. This ensures you are always using the most up-to-date colour. To find out more on how to use the get-color() function in SCSS, please refer to the notes for @function get-color() in _mixins.scss.

    + +

    Without wmcads SCSS

    +

    If you are not using WMCA Design System's SCSS then it is recommended to use the hex values below. It is highly adviseable to set these up as variables in your development enviornment, this ensures that you can easily change them to keep up-to-date with our colour palettes.

    +

    If you'd like to see how we have set the variables up, you can check out $palettes in _vars.scss and @function get-color() in _mixins.scss.

    + +{# Brand colours #} +
    +

    Brand colours

    +
    + {% for color in colors.brand %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
    + +{# Web colours #} +
    +

    Web colours

    +
    + {% for color in colors.web %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
    + +{# Background Only colours #} +
    +

    Background only colours

    +
    + {% for color in colors.backgroundOnly %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/styles/examples/grid-column-spacing.njk b/src/www/pages/tfwm/components/styles/examples/grid-column-spacing.njk new file mode 100644 index 00000000..9edbe46e --- /dev/null +++ b/src/www/pages/tfwm/components/styles/examples/grid-column-spacing.njk @@ -0,0 +1,210 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid column spacing" %} +{% set section = "Styles" %} + +{% block content %} +

    Introduction to wmcads Grid column spacing

    +

    + Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

    +

    + The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

    +

    + Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

    +

    + Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

    +

    + Where {breakpoint} is one of breakpoint sizes described in the grid section. +

    + +

    When to use Grid column spacing

    + + +

    Examples

    + +

    Example 1

    +

    This example shows the use of the ds-content-card component displayed in a grid of thirds with spacing of 1rem.

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    +
    + content image +
    +

    Contact us

    +

    Get in touch if you want to know more about the budget.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    +
    + content image +
    +

    Contact us

    +

    Get in touch if you want to know more about the budget.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    Example 2

    +

    This example shows the use of the ds-content-card component displayed in a half grid with spacing of 2rem.

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    Example 3

    +

    This example shows the use of the ds-content-card component displayed in a half grid with spacing controlled by breakpoints.

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +

    The default spacing is 0.75rem (ds-grid--spacing-2-sm). Once the page width goes over 768px the spacing changes to 1rem (ds-grid--spacing-md-2-md).

    + + + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/styles/examples/grid-examples.njk b/src/www/pages/tfwm/components/styles/examples/grid-examples.njk new file mode 100644 index 00000000..52ec7236 --- /dev/null +++ b/src/www/pages/tfwm/components/styles/examples/grid-examples.njk @@ -0,0 +1,335 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid Examples" %} +{% set section = "Styles" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    Introduction to wmcads Grids

    +

    Grid classes vs. unit classes

    +

    wmcads Grids consist of two types of classes: the grid class (ds-grid) and unit classes (ds-col-*)

    +

    The widths of the units are fractions

    +

    Units have various class names that represent their widths. For example, ds-u-1-2 has a width of 50%, whereas ds-u-1-5 would have a width of 20%.

    +

    All child elements of a grid must be units

    +

    Child elements contained within an element with a ds-grid classname must be a grid unit with a ds-col-* classname.

    +

    Content goes inside grid units

    +

    All content which is visible to people needs to be contained inside a grid unit. This ensures that the content will be rendered properly.

    + +

    Examples

    +

    Let's start with a simple example. Here's a grid with three columns:

    + +
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + {%- endfilter %} +
    +
    + +

    The above example will keep the columns the same width no matter the page width.

    + +

    Adding responsive classes

    +

    We can control the width by adding responsive classes.

    + +

    When using Responsive Grids, you can control how the grid behaves at specific breakpoints by adding class names. wmcads default responsive grids comes with the following class names and media query breakpoints.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Default Media Queries
    KeyCSS Media QueryAppliesClassname
    NoneNoneAlways.ds-col-*
    sm@media screen and (min-width: 35.5em)≥ 568px.ds-col-sm-*
    md@media screen and (min-width: 48em)≥ 768px.ds-col-md-*
    lg@media screen and (min-width: 64em)≥ 1024px.ds-col-lg-*
    xl@media screen and (min-width: 80em)≥ 1280px.ds-col-xl-*
    + +

    Let's modify the example so the columns become full width on mobile:

    + +
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + {%- endfilter %} +
    +
    + +

    The above example has a default width of 1 (ds-col-1) so when the page is viewed below 586px the columns will display full width. When the page is viewed over 586px the columns will appear in 3 coloumns (ds-col-sm-1-3). + + +

    Justify Content

    + +

    You can justify the grid content bby adding these classes:

    + +

    ds-grid--justify-between

    +

    Items will have space between them

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-around

    +

    Items will have space before, between, and after them

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-end

    +

    Items are positioned at the end of the container

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-center

    +

    Items are positioned in the center of the container

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-even

    +

    Items will have equal space around them

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/styles/icons/_icons.scss b/src/www/pages/tfwm/components/styles/icons/_icons.scss new file mode 100644 index 00000000..d03435ca --- /dev/null +++ b/src/www/pages/tfwm/components/styles/icons/_icons.scss @@ -0,0 +1,12 @@ +.website-icons { + svg { + width: 60px; + height: 60px; + padding: $size-sm; + fill: get-color(primary); + } + + .text-center { + text-align: center; + } +} diff --git a/src/www/pages/tfwm/components/styles/icons/index.njk b/src/www/pages/tfwm/components/styles/icons/index.njk new file mode 100644 index 00000000..76c42c7f --- /dev/null +++ b/src/www/pages/tfwm/components/styles/icons/index.njk @@ -0,0 +1,188 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Icons" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# The icon vars are an array that match the folders they come from in src/assets/icon/{foldername} #} +{% set iconGeneral = [ + "arrow", + "caret-down", + "caret-up", + "checkmark", + "chevron-right", + "circle-hollow", + "circle-solid", + "cross", + "expand", + "favourite", + "file", + "filter", + "id-card", + "info", + "location-arrow", + "minimise", + "paperclip", + "pdf", + "html", + "search", + "success", + "swap", + "trash", + "warning-circle", + "warning-triangle" +] %} + +{% set iconSocial = [ + "facebook", + "facebook-hex", + "twitter", + "twitter-hex", + "instagram", + "instagram-hex", + "linkedin", + "linkedin-hex", + "youtube", + "youtube-hex", + "email" +] %} + +{% set iconPortfolio = [ + "culture-and-digital", + "economy", + "environment", + "housing-and-land", + "inclusive-communities", + "skills", + "transport", + "wellbeing" +] %} + + +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} + +{% block content %} +{# How to use #} +

    About

    + +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + +
    + +{# Using Icons #} +

    Using icons

    +

    WMCA Design System icons are available as an SVG sprite to include in your HTML page.

    +

    How to use

    +

    Recommended

    +

    The Recommended method of using the icon sprite sheet is to refer directly to the one used in the design system. This ensures that your icons will always be up to date.

    +

    To get started, include the below snippet of javascript somewhere in your codebase. This will:

    + +
    +  
    +  {%- filter forceescape -%}
    +  
    +  
    +  {%- endfilter %}
    +  
    +
    + +

    Displaying an icon

    +

    To display an icon or glyph, use an icon tag (from the icon section at the bottom of the page) with a href attribute and xlink:href (as a fallback). Make sure that the xlink and href tags are pointing to the location of your downloaded icon sprite sheet.

    +

    The ICON-TAG-NAME should be replaced with the icon tag name of the icon you want to show from the Icons section below, for example #ds-general-arrow should be in the xlink:href and href attributes of the svg's <use> element.

    +
    +  
    +    {{-
    +      wmcadsIcon({
    +        icon: 'ICON-TAG-NAME'
    +      }) | forceescape | trim
    +    -}}
    +  
    +
    + + +

    Can't include via recommended method? Try hosting the sprites locally

    + + +
    + +{# Icons #} +

    Icons

    +

    Find below a list of all our icons and their tags below. To use, don't forget to prefix the tag with 'ds-'

    +

    General

    +
    + {% for icon in iconGeneral %} +
    + {{ + wmcadsIcon({ + icon: 'general-' + icon + }) + }} +

    {{ 'general-' + icon }}

    +
    + {% endfor %} +
    + +{# Portfolios #} +

    Portfolios

    +
    + {% for icon in iconPortfolio %} +
    + {{ + wmcadsIcon({ + icon: 'portfolio-' + icon + }) + }} +

    {{ 'portfolio-' + icon }}

    +
    + {% endfor %} +
    + +{# Social #} +

    Social

    +
    + {% for icon in iconSocial %} +
    + {{ + wmcadsIcon({ + icon: 'social-' + icon + }) + }} +

    {{ 'social-' + icon }}

    +
    + {% endfor %} +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/styles/images/index.njk b/src/www/pages/tfwm/components/styles/images/index.njk new file mode 100644 index 00000000..e9dea0aa --- /dev/null +++ b/src/www/pages/tfwm/components/styles/images/index.njk @@ -0,0 +1,29 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Images" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +

    For more guidance on how to use images, please check WMCA brand guidelines.

    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/styles/index.njk b/src/www/pages/tfwm/components/styles/index.njk new file mode 100644 index 00000000..9b5b722d --- /dev/null +++ b/src/www/pages/tfwm/components/styles/index.njk @@ -0,0 +1,15 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Styles" %} +{% set section = "Styles" %} +{% set ds = 'mc' %} + +{% block content %} +

    Make your service look and feel like WMCA Design System.

    +

    If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples in the + Design System will not need any additional styling.

    +

    If you need to apply styles manually, you should still follow existing WMCA Design System conventions. For + example, do not assign + new meanings to colours, do not change the style of buttons or adjust the thickness of borders on + form inputs.

    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/styles/layout/index.njk b/src/www/pages/tfwm/components/styles/layout/index.njk new file mode 100644 index 00000000..219dae2d --- /dev/null +++ b/src/www/pages/tfwm/components/styles/layout/index.njk @@ -0,0 +1,84 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Layout" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# Standard content template #} +

    Standard content template

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# Guidance #} +

    Guidance for content editors

    + +

    Warning text with exclamation mark icon component: Please read the Creating effective content section below before writing content or placing content into your page.

    + + +
    +{# Publicity campaign template #} +

    Publicity campaign template

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# Guidance #} +

    Guidance for content editors

    + + + +
    +{# Creating effective content #} +

    Creating effective content

    +

    There is no minimum or maximum page length, however:

    + +

    Use clear and concise content because the longer text, the lower rate of readability and comprehension drops significantly.

    +

    Always place content with higher importance at the top of the page, with less important content following after.

    +

    If you have to use long content, break it down into smaller sections to make it easier for user to understand information. You can:

    + + +{% endblock %} diff --git a/src/www/pages/tfwm/components/styles/maps/index.njk b/src/www/pages/tfwm/components/styles/maps/index.njk new file mode 100644 index 00000000..cc521ac9 --- /dev/null +++ b/src/www/pages/tfwm/components/styles/maps/index.njk @@ -0,0 +1,177 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Maps" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# Imports #} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# ESRI ArcGIS #} +

    ESRI ArcGIS

    + +{# About #} +

    About

    +

    + When it comes to mapping, West Midlands Combined Authority uses + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/labs/what-is-arcgis/", + linkTitle: "ESRI ArcGIS products", + linkTarget: "_blank", + contentText: "ESRI ArcGIS products" + }) + }} + to create, manage and share data on maps. Therefore, when developing maps use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. +

    + +{# Basemap #} +

    Basemap

    + + A screenshot showing an example of a map + +

    + When creating a map use the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as your basemap layer. This is to ensure maps are consistent across West Midlands Combined Authority services. +

    +

    The WMCA Basemap is a portal item, you can use the +{{ + wmcadsLink({ + link: "https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html", + linkTitle: "ArcGIS Basemap documentation", + linkTarget: "_blank", + contentText: "ArcGIS Basemap documentation" + }) + }} with the WMCA Basemap ID to include the basemap in your application. +

    + +{# Example of code #} +

    Example of the ESRI ArcGIS JavaScript API

    +
    +  
    +    // ESRI ArcGIS JS code...
    +    const basemap = new Basemap({
    +      baseLayers: [
    +        new VectorTileLayer({
    +          portalItem: {
    +            // set the baselayer to WMCA Basemap:
    +            // https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e
    +            id: '53f165a8863c4d40ba017042e248355e',
    +          },
    +        }),
    +      ],
    +    });
    +
    +    // Create a new map with the basemap set above
    +    const map = new Map({
    +      basemap,
    +    });
    +  
    +
    + +{# Can't use Esri ArcGIS #} +

    Can't use ESRI ArcGIS?

    +

    + We understand that you may not always be able to use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. + In these situations, style your map as closely to the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as possible. +

    +


    + + +{# User interface #} +

    User interface

    +

    + User interface elements on a map such as zoom, pan and location buttons follow particular pattern rules when being used. +

    +

    These pattern rules are:

    + + + + +{% endblock %} diff --git a/src/www/pages/tfwm/components/styles/typography/index.njk b/src/www/pages/tfwm/components/styles/typography/index.njk new file mode 100644 index 00000000..ca9dff7e --- /dev/null +++ b/src/www/pages/tfwm/components/styles/typography/index.njk @@ -0,0 +1,75 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Typography" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# About #} +

    About

    +

    + We have tested our typography with users, including those with dyslexia and those with low vision. The questionnaire presented respondents with two body fonts, set out in different sizes, line spacing and kerning. The options were shown randomly for each participant.

    +

    + Our findings were as such: +

    +

    +

    + As a public sector organisation, in addition to testing the above we are required to meet WCAG 2.1 guidelines at AA standard. + Therefore, features will be useable when text size is increased up to 200% and content reflowed for 400%. +

    +
    +{# Fonts #} +

    Fonts

    +

    + We utilise Google Fonts in our typography and all fonts used are pre-bundled in our design system CSS, so you won't need to include them seperately. +

    +

    + Find below, various examples of our typography in use. +

    + +{# DM Sans / Headings #} +

    DM Sans / headings

    +

    + The font DM Sans is used with font weight of 700 (bold) for heading elements only.
    + DM Sans font reference +

    +

    Things to note:

    + +
    +

    46px - Heading 1

    +

    32px - Heading 2

    +

    23px - Heading 3

    +

    18px - Heading 4

    +
    + +{# Noto sans / body copy #} +

    Noto Sans / body copy

    +

    + The font Noto Sans is used with the font weight of 400 (regular) and 700 (bold) for all elements other than headings. The default font size used is 16px.
    + Noto Sans font reference +

    +
    +

    Characters

    + Font size: 16px / 1rem

    + A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    + a b c d e f g h i j k l m n o p q r s t u v w x y z
    + 1 2 3 4 5 6 7 8 9 0
    + {% filter escape %} + ‘ ? ’ “ ! ” (%) [#] {@} / & \ < - + ÷ × = > ® © $ € £ ¥ ¢ : ; , . * + {% endfilter %} +
    +

    Styles

    + 400 - Regular
    + 400 - Regular italic
    + 700 - Bold
    + 700 - Bold italic +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/styles/utility-classes/index.njk b/src/www/pages/tfwm/components/styles/utility-classes/index.njk new file mode 100644 index 00000000..ffe19480 --- /dev/null +++ b/src/www/pages/tfwm/components/styles/utility-classes/index.njk @@ -0,0 +1,276 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Utility classes" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} + +{% block content %} +{# About #} +

    About

    +

    + There are a variety of utility classes that can be used with the existing components and styles on. +

    + + +
    +{# Containers #} +

    Containers

    +

    + Containers are used to wrap content in a 'container'. The container will have a fixed max size and be centered on the page, it will adjust to 100% width when the page width is less than the container size. +

    + +
    +  
    +    .ds-container /* Container with max-width of 1280px */
    +
    +    /* This should be used on your main content section and will
    +    add a margin top to seperate from header/breadcrumb section */
    +    .ds-container.ds-container--main
    +  
    +
    + + +
    +{# Grid #} +

    Grid

    +

    + The WMCA Design System uses its own custom syntax grid system adopted from Pure CSS Grid. The grid system is already included in the bundled ds-components.min.css file so you don't need to include it seperately. +

    + +

    + You can Refer to the Pure CSS Grid documentation for reference on how to use our grid system, but bear in mind that: +

    + + + +

    You can also use modifier classes on the same element where the class .ds-grid is being used.

    +
    +  
    +    .ds-grid--justify-between
    +    .ds-grid--justify-around
    +    .ds-grid--justify-end
    +    .ds-grid--justify-center
    +  
    +
    + +{{ + wmcadsLink( { + link: "/styles/examples/grid-examples.html", + contentText: "Grid examples" + } + ) +}} + +

    Information for designers

    +

    + The grid is part of the Design System Sketch library or as a standalone template file. +

    +

    Screen sizes

    +

    +

    +

    +

    Sketch grid sizes

    +

    +

    +

    + +
    +{# Floats #} +

    Floats

    +

    + Floats an element in the intended direction. +

    + +
    +  
    +    .ds-float-left
    +    .ds-float-right
    +  
    +
    + + +
    +{# Text Align #} +

    Text Align

    +

    + Aligns text in the intended direction. +

    + +
    +  
    +    .ds-text-align-left
    +    .ds-text-align-center
    +    .ds-text-align-right
    +  
    +
    + + +
    +{# Show or hide on devices #} +

    Show or hide on devices

    +

    + When you want to hide an element based on if the device width is a desktop or mobile device. +

    + +
    +  
    +    .ds-hide-mobile /* Hide only on mobile devices or smaller (less than 48em)  */
    +    .ds-hide-desktop /* Hide only on desktop devices or larger (greater than 48em) */
    +    .ds-hide /* Hide on all devices */
    +  
    +
    + +
    +

    Spacing

    +

    + The spacing utility classes are used to adjust whitespace for an element via padding and margins. +

    +

    Before using the spacing utility classes, please consider:

    + + +

    + The classes are named using the format .ds-{type}-{side}-{size}. +

    +{# type #} +

    + Where {type} is one of: +

    + +{# side #} +

    + Where {side} is one of: +

    + +{# size #} +

    +Where {size} is one of: +

    + + +

    Some examples of using these utility classes...

    +
    +  
    +    .ds-m-xs // applies a margin of 0.25rem to all sides
    +    .ds-p-b-lg // applies a padding-bottom of 2rem
    +    .ds-m-l-none // sets left margin to 0
    +  
    +
    + +{# Grid columns spacing #} +

    Grid column spacing

    + +

    + Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

    +

    + The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

    +

    + Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

    +

    + Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

    +

    + Where {breakpoint} is one of breakpoint sizes described in the grid section. +

    + +

    Some examples of using these utility classes...

    +
    +  
    +    .ds-grid--spacing-2-md // applies a 1rem spacing between 2 columns
    +    .ds-grid--spacing-lg-4-lg // applies a 2rem spacing between 4 columns above a screen width of 1024px
    +  
    +
    + +{{ + wmcadsLink( { + link: "/styles/examples/grid-column-spacing.html", + contentText: "Grid column spacing examples" + } + ) +}} +

    + +
    +{# Background #} +

    Background Colour

    +

    + Changes background to the intended colour. +

    + +
    +  
    +    .bg-default
    +    .bg-white
    +    .bg-disabled-elements
    +    .bg-transparent
    +  
    +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/table/index.njk b/src/www/pages/tfwm/components/table/index.njk new file mode 100644 index 00000000..ba342b6e --- /dev/null +++ b/src/www/pages/tfwm/components/table/index.njk @@ -0,0 +1,79 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Table" %} +{% from "wmcads/components/table/_table.njk" import wmcadsTable %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +

    What does it do?

    + +

    + When to use it? +

    + +

    + When not to use it? +

    + +

    + How it works +

    + + +
    +

    +{# Table #} +

    Table with Headers

    +{{ + compExample([ + wmcadsTable({ + rows: 3, + cols: 3, + caption: "Table Title" + }) + ]) +}} +{# End Table #} + +{# Table #} +

    Table without Headers

    +{{ + compExample([ + wmcadsTable({ + rows: 3, + cols: 3, + caption: "Table Title", + noHeaders: true + }) + ]) +}} +{# End Table #} + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/tag/index.njk b/src/www/pages/tfwm/components/tag/index.njk new file mode 100644 index 00000000..de8df4bd --- /dev/null +++ b/src/www/pages/tfwm/components/tag/index.njk @@ -0,0 +1,14 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Tag" %} +{% from "wmcads/components/tag/_tag.njk" import wmcadsTag %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{{ + compExample([ + wmcadsTag({ + text: 'info' + }) + ]) +}} +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/templates/_general.scss b/src/www/pages/tfwm/components/templates/_general.scss new file mode 100644 index 00000000..5c212665 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/_general.scss @@ -0,0 +1,7 @@ +.ds-html { + .ds-page-contents { + @media screen and (max-width: $breakpoint-md) { + margin: 0 !important; + } + } +} diff --git a/src/www/pages/tfwm/components/templates/campaign-one-column/campaign-template.scss b/src/www/pages/tfwm/components/templates/campaign-one-column/campaign-template.scss new file mode 100644 index 00000000..ff53a866 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/campaign-one-column/campaign-template.scss @@ -0,0 +1,11 @@ +.template-campaign { + .partner { + display: flex !important; + align-items: center; + justify-content: center; + + @media screen and (max-width: $breakpoint-sm) { + padding: 0 !important; + } + } +} diff --git a/src/www/pages/tfwm/components/templates/campaign-one-column/index.njk b/src/www/pages/tfwm/components/templates/campaign-one-column/index.njk new file mode 100644 index 00000000..7046dac7 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/campaign-one-column/index.njk @@ -0,0 +1,206 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Campaign Template - One Column" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{% from "wmcads/components/page-header/_page-header.njk" import wmcadsPageHeader %} +{%- from "wmcads/components/button/_button.njk" import wmcadsButton as start -%} +{# Set array of tiles #} +{% block content %} + +
    + +
    +

    Roll & Stroll

    +
    + +{{ + wmcadsPageHeader({ + title: false, + large: true + }) +}} +
    +
    +
    +

    Roll & Stroll

    +

    Have your say on cycling & walking changes in your local area.

    +

    Lockdown has been quite a journey but cycling and walking is more popular than ever.

    +

    After marking this year the Big Summer of Cycling & Walking, let’s not stop now. We're continuing to invest in creating a region that supports healthy, greener and safer travelling. We want to help you get started or keep going.

    +

    Whatever your travel plans - whether it's a cycle around your local streets or a winter walkie - we're here to help you start the adventure before you get there. There’s never been a better time to stay fit and healthy than right now - so, get your roll & stroll on!

    + {{ + start({ + classNames: "ds-btn--start", + text: "Have your say", + iconRight: "general-chevron-right" + }) + }} + + +

    Cycling & walking in your area

    +
    +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Get Going Continue Rolling', + isDefault: true, + copy: 'Whether youre rolling to work or school, or catching some fresh air, theres always safe and new ways to get there.' + }) + }} +
    +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'All things strolling', + isDefault: true, + copy: 'Wherever youre heading, theres always new and safe ways to get there on foot. ' + }) + }} +
    +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Changes in your area', + isDefault: true, + copy: 'Understand what changes are being made in your area to help you travel safely' + }) + }} +
    +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Get active and travel safely', + isDefault: true, + copy: 'Enjoy being physically active and travelling outdoors responsibly and safely. ' + }) + }} +
    +
    + + +

    Get the best from your bike

    +
    + + + +
    +

    + Some random subtitle +

    +

    + Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt consectetur, eius repellat dolor vel corporis eos fugiat. Ut totam, incidunt sequi iusto nesciunt illum natus, dolores velit cumque, excepturi labore! +

    +
    +
    + +
    + + + +
    +

    + Some random subtitle +

    +

    + Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt consectetur, eius repellat dolor vel corporis eos fugiat. Ut totam, incidunt sequi iusto nesciunt illum natus, dolores velit cumque, excepturi labore! +

    +
    +
    + + + +

    Additional Information

    +
    +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Support for businesses', + isDefault: true, + copy: 'We have a wide range of options to support your business and employees at work and at home' + }) + }} +
    +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isThirdCard: false, + title: 'Be Aware and Share', + isDefault: true, + copy: 'If you drive in the West Midlands be prepared to share the road space with more Rollers and Strollers.' + }) + }} +
    +
    + + + +

    Campaign Funding Partners

    + +
    +
    + + Active Travel fund + +
    +
    + + Active Travel fund + +
    +
    +
    +
    +
    + +
    + campaign bottom image +
    + +
    +{% endblock %} diff --git a/src/www/pages/tfwm/components/templates/campaign-two-columns/campaign-template.js b/src/www/pages/tfwm/components/templates/campaign-two-columns/campaign-template.js new file mode 100644 index 00000000..774633d9 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/campaign-two-columns/campaign-template.js @@ -0,0 +1,37 @@ +const pageContents = () => { + const contents = document.querySelector('.ds-dynamic-page-contents'); + + if (contents != null) { + const headings = document.querySelectorAll('main h2'); + + headings.forEach(heading => { + const str = heading.innerHTML; + const linkStr = str.toLowerCase().replaceAll(' ', '-'); + const link = `#${linkStr}`; + + // add id to all the h2 + heading.setAttribute('id', linkStr); + + // function to decode htmlentities + function decodeHtml(html) { + const txt = document.createElement('textarea'); + txt.innerHTML = html; + return txt.value; + } + // function to add a link to the page contents + function createMenuItem() { + const li = document.createElement('a'); + li.textContent = decodeHtml(str); + li.setAttribute('href', link); + return li; + } + + // get the page contents + const menu = document.querySelector('.ds-page-contents'); + // add page contents link + menu.appendChild(createMenuItem()); + }); + } +}; + +export default pageContents; diff --git a/src/www/pages/tfwm/components/templates/campaign-two-columns/index.njk b/src/www/pages/tfwm/components/templates/campaign-two-columns/index.njk new file mode 100644 index 00000000..22d243c7 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/campaign-two-columns/index.njk @@ -0,0 +1,196 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Campaign Template - Two Columns" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{% from "wmcads/components/page-header/_page-header.njk" import wmcadsPageHeader %} +{%- from "wmcads/components/button/_button.njk" import wmcadsButton as start -%} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{# Set array of tiles #} +{% block content %} + +
    + +
    +

    Roll & Stroll

    +
    + +{{ + wmcadsPageHeader({ + title: false, + large: true + }) +}} +
    +
    + + +
    +

    Roll & Stroll

    +

    Have your say on cycling & walking changes in your local area.

    +

    Lockdown has been quite a journey but cycling and walking is more popular than ever.

    +

    After marking this year the Big Summer of Cycling & Walking, let’s not stop now. We're continuing to invest in creating a region that supports healthy, greener and safer travelling. We want to help you get started or keep going.

    +

    Whatever your travel plans - whether it's a cycle around your local streets or a winter walkie - we're here to help you start the adventure before you get there. There’s never been a better time to stay fit and healthy than right now - so, get your roll & stroll on!

    + {{ + start({ + classNames: "ds-btn--start", + text: "Have your say", + iconRight: "general-chevron-right" + }) + }} + + +

    Cycling & walking in your area

    +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Get Going Continue Rolling', + copy: 'Whether youre rolling to work or school, or catching some fresh air, theres always safe and new ways to get there.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'All things strolling', + copy: 'Wherever youre heading, theres always new and safe ways to get there on foot. ' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Changes in your area', + copy: 'Understand what changes are being made in your area to help you travel safely' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Get active and travel safely', + copy: 'Enjoy being physically active and travelling outdoors responsibly and safely. ' + }) + }} +
    + + +

    Get the best from your bike

    +
    + + + +
    +

    + Some random subtitle +

    +

    + Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt consectetur, eius repellat dolor vel corporis eos fugiat. Ut totam, incidunt sequi iusto nesciunt illum natus, dolores velit cumque, excepturi labore! +

    +
    +
    + +
    + + + +
    +

    + Some random subtitle +

    +

    + Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt consectetur, eius repellat dolor vel corporis eos fugiat. Ut totam, incidunt sequi iusto nesciunt illum natus, dolores velit cumque, excepturi labore! +

    +
    +
    + + + +

    Additional Information

    +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Support for businesses', + copy: 'We have a wide range of options to support your business and employees at work and at home' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Be Aware and Share', + copy: 'If you drive in the West Midlands be prepared to share the road space with more Rollers and Strollers.' + }) + }} +
    + + + +

    Campaign Funding Partners

    + +
    +
    + + Active Travel fund + +
    +
    +
    +
    +
    + +
    + campaign bottom image +
    + +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/templates/content-one-column/content-template.scss b/src/www/pages/tfwm/components/templates/content-one-column/content-template.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/www/pages/tfwm/components/templates/content-one-column/index.njk b/src/www/pages/tfwm/components/templates/content-one-column/index.njk new file mode 100644 index 00000000..eb79ee22 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/content-one-column/index.njk @@ -0,0 +1,95 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Content One Column" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +
    + header image +
    +
    +
    +
    +

    Adult Education Budget

    +

    From 2018, we’re responsible for the region's Adult Education Budget (AEB).

    +

    We target priority growth sectors from the Local Industrial Strategy. This improves skills and secure jobs in communities. It also helps to improve productivity in the region.

    +

    What the budget is

    +

    The budget helps residents and employers get the skills needed in the region. This helps people to get the jobs they need and increases the skills of current employees. It unlocks specialist training as well.

    +

    It also allows for more flexible and tailored learning programmes in the region. This helps people to take part in learning, build confidence and their wellbeing. It unlocks opportunities for more people.

    +

    Our challenges

    +

    We set out the challenges for the labour market in our Regional Skills Plan:

    +

    High levels of unemployment in some parts of the region + Poverty is growing for people who are working because of low wages + Low skill levels with less people qualified to skill level 4, or no qualifications at all + Employers struggle to find people with the skills they need

    +

    We use the budget to help improve confidence and opportunities for residents. It helps business find staff with the skills they need too.

    +

    Priorities for the budget

    +

    We will fund adult education through a range of delivery partners. Through commissioning, the budget will focus on:

    +

    Innovation

    +

    Looking at new ways of delivering learning. These will align with our priorities in the construction and digital sectors.

    +

    Talent & Progression

    +

    We'll develop new job schemes, and help build the skills of people in employment.

    +

    Collaboration

    +

    Working with our provider partners, we'll create an agile skills system. It will align to the needs of businesses and residents.

    +

    Sustainability

    +

    We're developing agreements with providers. These will check delivery against our key priorities. It will also track the impact of this approach.

    +
    +
    + +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault : true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isDoubleCard: true, + title: 'Pharetra Sollicitudin Bibendum', + copy: 'Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo.' + }) + }} +
    + +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/templates/content-template/content-template.scss b/src/www/pages/tfwm/components/templates/content-template/content-template.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/www/pages/tfwm/components/templates/content-template/index.njk b/src/www/pages/tfwm/components/templates/content-template/index.njk new file mode 100644 index 00000000..6c9b3333 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/content-template/index.njk @@ -0,0 +1,98 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Content Page Template" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +
    + header image +
    +
    +
    +
    +

    {{ pageTitle | safe}}

    +

    From 2018, we’re responsible for the region's Adult Education Budget (AEB).

    +

    We target priority growth sectors from the Local Industrial Strategy. This improves skills and secure jobs in communities. It also helps to improve productivity in the region.

    +

    What the budget is

    +

    The budget helps residents and employers get the skills needed in the region. This helps people to get the jobs they need and increases the skills of current employees. It unlocks specialist training as well.

    +

    It also allows for more flexible and tailored learning programmes in the region. This helps people to take part in learning, build confidence and their wellbeing. It unlocks opportunities for more people.

    +

    Our challenges

    +

    We set out the challenges for the labour market in our Regional Skills Plan:

    +

    High levels of unemployment in some parts of the region + Poverty is growing for people who are working because of low wages + Low skill levels with less people qualified to skill level 4, or no qualifications at all + Employers struggle to find people with the skills they need

    +

    We use the budget to help improve confidence and opportunities for residents. It helps business find staff with the skills they need too.

    +

    Priorities for the budget

    +

    We will fund adult education through a range of delivery partners. Through commissioning, the budget will focus on:

    +

    Innovation

    +

    Looking at new ways of delivering learning. These will align with our priorities in the construction and digital sectors.

    +

    Talent & Progression

    +

    We'll develop new job schemes, and help build the skills of people in employment.

    +

    Collaboration

    +

    Working with our provider partners, we'll create an agile skills system. It will align to the needs of businesses and residents.

    +

    Sustainability

    +

    We're developing agreements with providers. These will check delivery against our key priorities. It will also track the impact of this approach.

    +
    +
    +
    +
    + {{ + wmcadsContentCard({ + src: true, + isThirdCard: true, + title: 'Who weve funded', + copy: 'See which councils and providers weve funded, and what for.' + }) + }} +
    +
    + {{ + wmcadsContentCard({ + src: true, + isThirdCard: true, + title: 'Find training schemes', + copy: 'You can find training and education providers weve funded online.' + }) + }} +
    +
    + {{ + wmcadsContentCard({ + src: true, + isThirdCard: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} +
    +
    + {{ + wmcadsContentCard({ + src: true, + isThirdCard: true, + title: 'Pharetra Sollicitudin', + copy: 'Donec sed odio dui. Nullam quis risus eget urna mollis ornareleo.' + }) + }} +
    +
    + {{ + wmcadsContentCard({ + src: true, + isDoubleCard: true, + title: 'Pharetra Sollicitudin Bibendum', + copy: 'Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo.' + }) + }} +
    +
    +
    +
    +{% endblock %} diff --git a/src/www/pages/tfwm/components/templates/content-two-columns/content-template.scss b/src/www/pages/tfwm/components/templates/content-two-columns/content-template.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/www/pages/tfwm/components/templates/content-two-columns/index.njk b/src/www/pages/tfwm/components/templates/content-two-columns/index.njk new file mode 100644 index 00000000..788810ec --- /dev/null +++ b/src/www/pages/tfwm/components/templates/content-two-columns/index.njk @@ -0,0 +1,110 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Content Two Columns" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{# Set array of tiles #} +{% block content %} + +
    + +
    +

    Roll & Stroll

    +
    + +
    + header image +
    +
    +
    + + +
    +

    Adult Education Budget

    +

    From 2018, we’re responsible for the region's Adult Education Budget (AEB).

    +

    We target priority growth sectors from the Local Industrial Strategy. This improves skills and secure jobs in communities. It also helps to improve productivity in the region.

    +

    What the budget is

    +

    The budget helps residents and employers get the skills needed in the region. This helps people to get the jobs they need and increases the skills of current employees. It unlocks specialist training as well.

    +

    It also allows for more flexible and tailored learning programmes in the region. This helps people to take part in learning, build confidence and their wellbeing. It unlocks opportunities for more people.

    +

    Our challenges

    +

    We set out the challenges for the labour market in our Regional Skills Plan:

    +

    High levels of unemployment in some parts of the region + Poverty is growing for people who are working because of low wages + Low skill levels with less people qualified to skill level 4, or no qualifications at all + Employers struggle to find people with the skills they need

    +

    We use the budget to help improve confidence and opportunities for residents. It helps business find staff with the skills they need too.

    +

    Priorities for the budget

    +

    We will fund adult education through a range of delivery partners. Through commissioning, the budget will focus on:

    +

    Innovation

    +

    Looking at new ways of delivering learning. These will align with our priorities in the construction and digital sectors.

    +

    Talent & Progression

    +

    We'll develop new job schemes, and help build the skills of people in employment.

    +

    Collaboration

    +

    Working with our provider partners, we'll create an agile skills system. It will align to the needs of businesses and residents.

    +

    Sustainability

    +

    We're developing agreements with providers. These will check delivery against our key priorities. It will also track the impact of this approach.

    +
    + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isSrcDefault: true, + title: 'Contact us', + copy: 'Get in touch if you want to know more about the budget.' + }) + }} + {{ + wmcadsContentCard({ + clickable: true, + src: true, + isDoubleCard: true, + title: 'Pharetra Sollicitudin Bibendum', + copy: 'Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo.' + }) + }} +
    + +
    +
    +
    +
    +{% endblock %} diff --git a/src/www/pages/tfwm/components/templates/document-foreword/index.njk b/src/www/pages/tfwm/components/templates/document-foreword/index.njk new file mode 100644 index 00000000..7c4d0015 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/document-foreword/index.njk @@ -0,0 +1,137 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Local Transport Plan Green Paper" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/components/file-download/_file-download.njk" import wmcadsFileDownload %} +{% from "wmcads/components/video-embed/_video-embed.njk" import wmcadsVideoEmbed %} +{% from "wmcads/components/hub-header/_hub-header.njk" import wmcadsHubHeader %} +{% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} +{# Set array of tiles #} +{% block content %} + +
    +{{ +wmcadsHubHeader({ + image: false, + title: "Local Transport Plan Green Paper" + }) +}} +
    +
    + +
    +

    Foreword

    +

    As well as being at the heart of the UK’s +transport network, the West Midlands is at +another kind of crossroads; one at which there +is an opportunity to build back better from the +COVID-19 pandemic, to ensure we can carry +forward the reputation for economic success +the region has built in the new millennium +while improving the impacts of transport on +our towns, cities and local communities.

    + +

    This green paper sets out the challenges and +opportunities facing our transport system to +inspire deliberation with the public over the +kind of transport system we want to see in the +future. The decisions we make now about how +we plan, invest in and manage our transport +system will affect us all, as well as deciding +what legacy we leave for future generations.

    + +

    Over the past few years, the West Midlands has +seen substantial improvements to its transport +network. The West Midlands Metro has been +extended through Birmingham city centre +and a new line is under construction in the +Black Country, connecting Wednesbury with +Brierley Hill. We are improving our railways, +with improved and new stations planned at +Perry Barr, Darlaston, Willenhall, Aldridge and +the revival of the old Camp Hill line. Fleets +of electric buses are taking to the streets in +increasing numbers. And our active travel +revolution is well underway, with new cycling +and walking routes springing up across the +region. After decades of underinvestment, our +region is beginning to turn things around.

    + +

    But significant challenges remain in tackling +the defining issues of our time, such as climate +change, air quality, our health, and now our +economic recovery from the pandemic. This +paper poses some difficult questions about +how we address these challenges. But it also +offers real hope that, with a collective effort, +we can create a West Midlands that leads the +way in tackling these issues. We have a strong +entrepreneurial and innovative heritage to build +on. By thinking and acting differently we can +create a place where transport improves the +opportunities available to all our residents.

    + +

    A key aim of this paper is to understand what +our residents and communities want from their +transport network. Your views will inform our +new Local Transport Plan, due to be published +later in the year. +This green paper sets out five reasons why we +should consider changing the way we travel. +We call these our five Motives for Change. +These are focussed on creating a fairer, greener, +healthier, happier and more prosperous West +Midlands. In particular, we want to know how +the successive lockdowns have impacted our +relationship with the transport network and how +this should inform where we take the network in +the coming years. +This is the start of a conversation with +residents, organisations and businesses on +the kinds of changes we want to see in our +transport system and the trade-offs required. +So please engage with the prompts and issues +raised in this paper and let us know what you +think, so that together we can build a transport +network that will

    + +
    +
    +
    + +
    +

    Andy Street

    +

    Mayor of the West Midlands

    +
    +
    +
    + +
    +

    Councillor Ian Ward

    +

    Leader of Birmingham City Council

    +
    +
    + + +{{ + wmcadsPagination({ + pageCount: 8, + activePage: 1 + }) +}} +
    +
    +
    +
    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/templates/document-hub/index.njk b/src/www/pages/tfwm/components/templates/document-hub/index.njk new file mode 100644 index 00000000..6e488d31 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/document-hub/index.njk @@ -0,0 +1,62 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Document Hub" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/components/file-download/_file-download.njk" import wmcadsFileDownload %} +{# Set array of tiles #} +{% block content %} + +
    +
    +
    +

    Local Transport Plan Green Paper

    +

    Documents

    + {{ + wmcadsFileDownload({ + html: false, + htmlInfo: true, + default: true, + htmlDoc: false, + pdfDoc: false, + dlName: 'Local Transport Plan Green Paper' + ]) + }} + +

    Details

    +

    Getting transport right in our region requires us to have a plan for the future that balances the needs to provide access for everyone with the harmful impacts that transport can have on people and places.

    +

    This document sets out some of the big challenges that we need to address if we want transport to drive Inclusive Growth; sustainable and equitable growth where all citizens can shape, contribute and benefit from the advancement of the region.

    +

    These challenges are frames within the document as 5 Motives for Change.

    +
      +
    • Creating a fairer society
    • +
    • Supporting local communities and places
    • +
    • Becoming more active
    • +
    • Tackling the climate emergency
    • +
    • Sustaining economic success
    • +
    +
    +

    Alternative formats

    + {{ + wmcadsFileDownload({ + html: false, + htmlInfo: true, + default: false, + htmlDoc: false, + pdfDoc: true, + dlName: 'Download Local Transport Plan Green Paper (pdf, 7.88MB)' + }) + }} +
    + +
    +
    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/templates/document-paper/index.njk b/src/www/pages/tfwm/components/templates/document-paper/index.njk new file mode 100644 index 00000000..6e18a07f --- /dev/null +++ b/src/www/pages/tfwm/components/templates/document-paper/index.njk @@ -0,0 +1,104 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Reimagining transport in the West Midlands - WMLTP5 Green Paper" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/components/file-download/_file-download.njk" import wmcadsFileDownload %} +{% from "wmcads/components/video-embed/_video-embed.njk" import wmcadsVideoEmbed %} +{# Set array of tiles #} +{% block content %} + +
    +
    +
    +
    +

    Reimagining transport in the West Midlands - WMLTP5 Green Paper

    +
    +
    +
    +
    + {{ + wmcadsVideoEmbed({ + }) + }} + +

    TfWM is in the process of supporting the WMCA to update its current Local Transport Plan (LTP). This is a document that sets out the policies to promote safe, integrated, efficient and economic transport to, from and within our area as well as plans to implement those policies.

    +

    Publishing and reviewing the LTP is one of WMCA’s core statutory duties as the Local Transport Authority for the area covered by the West Midlands seven metropolitan districts/boroughs.

    + +

    Why do we need a Green Paper?

    +

    Getting transport right in our region requires us to have a plan for the future that balances the needs to provide access for everyone with the harmful impacts that transport can have on people and places. We’ve published a Green Paper to start a conversation about what a new Local Transport Plan should look like.

    +

    We will use the Green Paper to drive engagement with people, businesses and other key stakeholders across the region. We want you to get involved and work with us together, so we can get it right for where you live and work.

    +

    The COVID-19 pandemic has hit our region hard but it has also shown us how adaptable we can be and that change can bring new opportunities and benefits. We want to build back better from the pandemic. Doing so will need us to think about how transport can better support a prosperous and well-connected West Midlands which is fairer, greener and healthier.

    + +

    Our Motives for Change

    +

    We think there are some big challenges that we need to address if we want transport to drive Inclusive Growth; sustainable and equitable growth where all citizens can shape, contribute and benefit from the advancement of the region. We’ve framed these challenges in our 5 Motives for Change.

    +
      +
    • Creating a fairer society
    • +
    • Supporting local communities and places
    • +
    • Becoming more active
    • +
    • Tackling the climate emergency
    • +
    • Sustaining economic success
    • +
    +

    The Motives for Change are all important, but the need to tackle the climate emergency has a particular urgency that the other Motives for Change lack. Current predictions suggest that if we don’t rapidly reduce our carbon emissions, by 2030 we could face a global scenario in which we lose the ability to prevent escalating climate change and the harm it will cause around the world and in the West Midlands. That is why WMCA has declared a climate emergency and set a zero-carbon target for the West Midlands by 2041, with the first of four 5-year plans already published.

    +

    This suggests a new LTP could have a much stronger focus on achieving transformational change within the next 10 years, rather than focussing on a longer-term vision and more gradual change. This presents us with the opportunity to rapidly reimagine transport to deliver transformative improvement in the lives of millions of people across our region, and for the West Midlands to demonstrate leadership in tackling global and local problems.

    +
    + {{ + wmcadsFileDownload({ + html: true, + default: true, + htmlName: 'Long Term Plan Summary' + }) + }} +
    +
    + {{ + wmcadsFileDownload({ + html: true, + default: true, + htmlName: 'Local Transport Plan Green Paper' + }) + }} +
    +
    + +
    +
    +
    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/templates/document-section/index.njk b/src/www/pages/tfwm/components/templates/document-section/index.njk new file mode 100644 index 00000000..b8869507 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/document-section/index.njk @@ -0,0 +1,60 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Local Transport Plan Green Paper" %} {% set section = "Templates" %} +{# Imports #} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/components/hub-header/_hub-header.njk" import wmcadsHubHeader %} +{% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} +{% from "wmcads/components/images/_image-with-summary.njk" import wmcadsImageWithSummary %} +{# Set array of tiles #} +{% block content %} + +
    +{{ +wmcadsHubHeader({ + image: false, + title: "Local Transport Plan Green Paper" + }) +}} +
    +
    + +
    +

    Section 3: Our Motives for Change

    +

    Inclusive Growth in the West Midlands means that all citizens can shape, contribute and benefit from the advancement of the region.

    +

    It is a deliberate and socially purposeful model of economic growth – measured not only by how fast or aggressive it is; but also by how well it is shared across the whole population and place, and the capacity of our environment to sustain it.

    +

    WMCA’s goal for Inclusive Growth is to occupy a space where social need, economic ambition and our responsibilities to the environment are in balance.

    + + {{ + wmcadsImageWithSummary({ + img: "/img/examples/diagram.png", + title: "Inclusive Growth Framework", + summary: "The space for a balanced, inclusive economy is where social challenges can be met without degrading the environment" + }) + }} + +

    Transport’s relationship with Inclusive Growth is complex:

    +
      +
    • Meeting many of our needs and ambitions relies on transport connections
    • +
    • But those same transport connections have impacts that the environment can’t sustain and which are detrimental to other social and economic outcomes; and
    • +
    • Improving connections for a particular group of people, by a particular mode, to particular places can limit and even worsen connectivity elsewhere for others.
    • +
    + {{ + wmcadsPagination({ + pageCount: 8, + activePage: 5 + }) + }} +
    +
    +
    +
    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/templates/homepage/homepage.scss b/src/www/pages/tfwm/components/templates/homepage/homepage.scss new file mode 100644 index 00000000..a01fa204 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/homepage/homepage.scss @@ -0,0 +1,23 @@ +.homepage { + .what-we-do { + svg { + display: block; + width: 50px; + height: 50px; + fill: get-color(primary); + } + + i { + color: get-color(primary) !important; + } + + a { + display: block; + width: 90%; + } + + div { + margin: 0 0 20px 0; + } + } +} diff --git a/src/www/pages/tfwm/components/templates/homepage/index.njk b/src/www/pages/tfwm/components/templates/homepage/index.njk new file mode 100644 index 00000000..fba3dff1 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/homepage/index.njk @@ -0,0 +1,202 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Homepage Template" %} {% set section = "Templates" %} +{% set section="Templates" %} +{# Imports #} +{% from "wmcads/components/page-header/_page-header.njk" import wmcadsPageHeader %} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +{{ + wmcadsPageHeader({ + title: true, + text: "Building a healthier, happier, better connected and more prosperous West Midlands", + home: true, + topm: true + }) +}} +
    +
    +
    +

    What is the Combined Authority?

    +

    Combined Authorites are set up to improve their region’s economies. We invest in the region through collaboration with our partners, but we don’t replace local councils.

    +
    +
    +

    The Mayor

    +

    We’re led by the Mayor of the West Midlands. The current mayor is Andy Street, who is in office until May 2021.

    +

    The Mayor chairs the WMCA Board and acts as a voice for the region, nationally and globally.

    +
    +
    +

    What we do

    +
    + + +
    + + + + Environment +
    +
    + + + + Housing and Land +
    + + +
    + + + + Transport +
    +
    + + + + Wellbeing +
    +
    + +

    Latest News

    +
    + {{ + wmcadsContentCard({ + src: true, + title: 'WMCA donates computers to school children to tackle digital divide', + copy: '150 old staff laptops will be donated to Wowdot', + isNews: true, + isNewsSub: true + }) + }} + {{ + wmcadsContentCard({ + src: true, + title: 'WMCA donates computers to school children to tackle digital divide', + copy: '150 old staff laptops will be donated to Wowdot', + isNews: true, + isNewsSub: true + }) + }} + {{ + wmcadsContentCard({ + src: true, + title: 'Historic devolution agreement reached', + copy: 'The Government will contribute 40 million over the next 30 years', + isNews: true, + isNewsSub: true + }) + }} + {{ + wmcadsContentCard({ + src: true, + title: 'Historic devolution agreement reached', + copy: 'The Government will contribute 40 million over the next 30 years', + isNews: true, + isNewsSub: true + }) + }} +
    +See all news stories + +
    + {{ + wmcadsContentCard({ + src: true, + isSrcDefault: true, + title: 'Coronavirus support', + copy: 'Get advice and support during the pandemic such as finding a new job and applying for business grants.', + clickable: true + }) + }} + {{ + wmcadsContentCard({ + src: true, + isSrcDefault: true, + title: '2021 Mayoral election', + copy: 'Find out what the Mayor is reponsible for and how to vote.', + clickable: true + }) + }} +
    +
    + {{ + wmcadsContentCard({ + title: 'Upskill yourself in lockdown', + copy: 'Find out what the Mayor is reponsible for and how to vote.', + clickable: true + }) + }} + {{ + wmcadsContentCard({ + title: 'Thrive at Work', + copy: 'Join our free workplace wellbeing scheme to keep staff healthy, motivated and productive.', + clickable: true + }) + }} + {{ + wmcadsContentCard({ + title: 'Annual Plan 2021 - 2022', + copy: 'We’ve set our ambitions for each of our priorities over the next year.', + clickable: true + }) + }} +
    + +

    Upcoming events

    +
    + {{ + wmcadsContentCard({ + eventTitle: 'Mayors Mentors', + eventCopy: 'Find out about the Mayor’s Mentors scheme and how it can help you grow.', + clickable: true, + isEvent: true + }) + }} + {{ + wmcadsContentCard({ + eventTitle: 'Greater Birmingham LEP Skills Day', + eventCopy: 'Hear from employers and training providers on upskilling opportunities available.', + clickable: true, + isEvent: true + }) + }} + {{ + wmcadsContentCard({ + eventTitle: 'Sprint exhibition - Walsall', + eventCopy: 'Learn and ask questions about the upcoming Sprint works in the region.', + clickable: true, + isEvent: true + }) + }} +
    +See all WMCA events + +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/templates/index.njk b/src/www/pages/tfwm/components/templates/index.njk new file mode 100644 index 00000000..aaa455dc --- /dev/null +++ b/src/www/pages/tfwm/components/templates/index.njk @@ -0,0 +1,9 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Templates" %} +{% set section = "Templates" %} +{% set ds = 'mc' %} + + +{% block content %} +

    Example templates that make up the main West Midlands Combined Authority Website

    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/templates/news-article/index.njk b/src/www/pages/tfwm/components/templates/news-article/index.njk new file mode 100644 index 00000000..afa8b6f6 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/news-article/index.njk @@ -0,0 +1,68 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="News Article" %} {% set section = "Templates" %} +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/content-card/_content-card.njk" import wmcadsContentCard %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{# Set array of tiles #} +{% block content %} + +
    + +
    +
    +
    +

    Mayor highlights HS2 jobs boost as new contractor for Curzon Street station development is unveiled

    +

    Published: Monday 10 May 2021

    +

    HS2 Ltd today confirmed that a team made up of Mace and Dragados will build Birmingham’s new city centre high speed railway station, in a deal that is set to further boost the West Midlands economy.

    +

    The deal, which is worth up to £570m, will see Mace Dragados work with HS2 Ltd in two stages to finalise the detailed design and then build the landmark station.

    +

    The station itself will be net zero carbon in operation and adopt the latest eco-friendly design and sustainable technologies, including capturing rainwater and utilising sustainable power generation, with over 2,800m2 of solar panels located on platform canopies.

    + Curzon Street station development +

    Mayor of the West Midlands Andy Street welcomed the announcement and the major role HS2 will play in the regional recovery after the pandemic. He said:

    +

    “HS2 is at the heart of my plans to create 100,000 jobs in just two years to help the West Midlands recover from the coronavirus pandemic, and so I am absolutely thrilled by today’s news.

    +

    “Not only is this a major shot in the arm for our region’s construction sector that was performing so well pre-Covid, but the building of Curzon Street is also set to create hundreds of jobs.

    +

    “That’s local jobs for local people at such a difficult time, and I will ensure we continue to run construction training courses so residents can get the skills they need to take on these new roles.

    +

    “I’m also excited to see the commitment from HS2 ltd that the station will be net-zero, helping the West Midlands in its battle against the climate emergency and in our aim to become carbon neutral by 2041.

    +

    It is designed to meet a ‘BREEAM excellent’ standard, which is an industry recognised standard for buildings that reduce energy usage and materials waste and minimise their impact on the natural environment.

    +

    Mace and Dragados have a strong track record delivering some of the world’s most complex and exciting infrastructure projects, including the refurbishment of Birmingham New Street, Battersea Power Station (phase 2) and work on delivering the Spanish high speed rail network, including the major new Madrid Atocha and Barcelona Sants stations. They are also working together in a separate joint venture delivering HS2’s London terminus at Euston.

    +

    HS2 Ltd’s chief executive, Mark Thurston said:

    +

    “Birmingham Curzon Street is right at the heart of the HS2 project, providing a fantastic terminus for trains running right into the heart of the city centre. The station will play a vital role in the long-term economic future of the West Midlands, creating hundreds of jobs during construction and boosting the region after the pandemic.

    +

    “Mace and Dragados have some incredible experience delivering some of the world’s most challenging and exciting infrastructure projects, and I look forward to welcoming them to the team.

    +

    HS2 Minister Andrew Stephenson said:

    +

    “This is a huge moment for Birmingham and for HS2. The brand new, world class HS2 station at Birmingham Curzon Street will place the city at the beating heart of the new HS2 network.

    +

    “It marks a major investment in Birmingham’s future as we build back better from Covid-19 - breathing new life into the city centre, supporting hundreds of new skilled jobs and helping forge better connections across the whole country.

    +

    HS2 worked with WSP and Grimshaw Architects LLP on the design for Curzon Street, which is inspired by the great arched roofs built by the Victorian railway pioneers. The design takes that inspiration into the 21st Century, ensuring accessibility and a focus on the open space and landscaping around it.

    +

    Passengers will also be to access up to nine high speed trains an hour travelling north and south, and the Midland Metro - which runs alongside and underneath the station. Accessible pedestrian routes will connect to local bus services, Sprint rapid transit bus services and local rail services from the neighbouring Moor Street station. Cycle parking has also been incorporated, providing space for more than 550 bicycles.

    +

    Significant progress has already been made on site at Curzon Street. Site clearance is now complete and a massive archaeological programme, involving 70 archaeologists, has unearthed the world’s oldest railway roundhouse.

    +

    Contact the Media Team

    +
    + WMCA Media Team

    + media@wmca.org.uk
    + Available 7 days a week +
    +
    + +
    +
    +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/components/templates/newsroom/index.njk b/src/www/pages/tfwm/components/templates/newsroom/index.njk new file mode 100644 index 00000000..6540a5ae --- /dev/null +++ b/src/www/pages/tfwm/components/templates/newsroom/index.njk @@ -0,0 +1,100 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="News" %} {% set section = "Templates" %} +{# Imports #} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/patterns/search/search-bar/_search-bar.njk" import wmcadsSearchbar %} +{% from "wmcads/patterns/search/search-filter/_search-filter.njk" import wmcadsSearchFilter %} +{% from "wmcads/patterns/search/sort/_sort.njk" import wmcadsSearchSort %} +{% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} +{% from "wmcads/components/breadcrumb/_breadcrumb.njk" import wmcadsBreadcrumb %} +{% from "wmcads/patterns/search/search-result/_search-result.njk" import wmcadsSearchResult %} + +{# Set array of tiles #} +{% block content %} + +
    +
    +

    News

    +
    + {{wmcadsSearchbar({ + placeHolder: "News search..." + })}} +
    +
    +
    +
    +
    +

    Found 20 matching results

    + {{wmcadsSearchResult( + { + pageTitle: "New transport system will be sprinting for success at Commonwealth Games", + date: "Thursday 23 August 2018", + excerpt: "Top athletes are not the only ones aiming to be in peak condition for the 2022 Commonwealth Games in Birmingham – the region’s transport system is also..." + } + )}} + {{wmcadsSearchResult( + { + pageTitle: "Mayor tells business leaders why the West Midlands should be seen as a leading net zero region", + date: "Thursday 23 August 2018", + excerpt: "Mayor of the West Midlands Andy Street has told a cross-sector audience of local decision makers why the West Midlands should be seen as one of the UK’s leading regions in supporting the race to net zero." + } + )}} + {{wmcadsSearchResult( + { + pageTitle: "First of the new generation of bus shelters unveiled as work continues on the Sprint rapid bus route", + date: "Thursday 23 August 2018", + excerpt: "The first of a new generation of bus shelters has been unveiled in Perry Barr, Birmingham ready for the introduction of the Sprint rapid bus route next year." + } + )}} + {{wmcadsSearchResult( + { + pageTitle: "First of the new generation of bus shelters unveiled as work continues on the Sprint rapid bus route", + date: "Thursday 23 August 2018", + excerpt: "The first of a new generation of bus shelters has been unveiled in Perry Barr, Birmingham ready for the introduction of the Sprint rapid bus route next year." + } + )}} + {{wmcadsSearchResult( + { + pageTitle: "First of the new generation of bus shelters unveiled as work continues on the Sprint rapid bus route", + date: "Thursday 23 August 2018", + excerpt: "The first of a new generation of bus shelters has been unveiled in Perry Barr, Birmingham ready for the introduction of the Sprint rapid bus route next year." + } + )}} + + {{wmcadsPagination({ + pageCount: 6, + activePage: 1 + })}} +
    + +
    +
    +
    +{% endblock %} diff --git a/src/www/pages/tfwm/components/templates/newsroom/newsroom.scss b/src/www/pages/tfwm/components/templates/newsroom/newsroom.scss new file mode 100644 index 00000000..5bf93908 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/newsroom/newsroom.scss @@ -0,0 +1,40 @@ +.template-newsroom { + .ds-grid { + @media screen and (max-width: $breakpoint-md) { + flex-direction: column-reverse; + } + } + + .ds-p-r-xl { + @media screen and (max-width: $breakpoint-md) { + padding: 0; + } + } + + .ds-hide-mobile { + @media screen and (max-width: $breakpoint-sm) { + display: none; + } + } + + .ds-search-sort { + @media screen and (max-width: $breakpoint-sm) { + margin-top: $size-md; + } + } + + aside { + @media screen and (max-width: $breakpoint-md) { + display: flex !important; + flex-direction: column-reverse; + } + + .ds-search-sort { + @media screen and (max-width: $breakpoint-md) { + margin-top: $size-lg; + padding-top: $size-lg; + border-top: 1px solid get-color(brandCoolGrey); + } + } + } +} diff --git a/src/www/pages/tfwm/components/templates/newsroom/search-template.js b/src/www/pages/tfwm/components/templates/newsroom/search-template.js new file mode 100644 index 00000000..620deaa9 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/newsroom/search-template.js @@ -0,0 +1,58 @@ +const searchFilterJs = () => { + const showBtn = document.getElementById('show_filter_btn'); + const hideBtn = document.getElementById('hide_filter_btn'); + const showResults = document.getElementById('show_results_btn'); + const searchFilter = document.getElementById('search_filter'); + + if (searchFilter) { + const filterOptions = searchFilter.querySelectorAll('.ds-fe-checkboxes__input'); + + filterOptions.forEach(option => { + option.addEventListener('change', () => { + if ([...filterOptions].some(input => input.checked)) { + searchFilter.classList.add('ds-search-filter--has-inputs-checked'); + } else { + searchFilter.classList.remove('ds-search-filter--has-inputs-checked'); + } + }); + }); + + const showFilter = (show = true) => { + if (show) { + searchFilter.classList.add('ds-search-filter--is-open'); + searchFilter.setAttribute('aria-expanded', 'true'); + } else { + searchFilter.classList.remove('ds-search-filter--is-open'); + searchFilter.setAttribute('aria-expanded', 'false'); + } + }; + + const clearFilters = () => { + filterOptions.forEach(option => { + option.checked = false; // eslint-disable-line no-param-reassign + }); + searchFilter.classList.remove('ds-search-filter--has-inputs-checked'); + }; + + showBtn.addEventListener('click', e => { + e.preventDefault(); + showFilter(); + }); + + hideBtn.addEventListener('click', e => { + e.preventDefault(); + showFilter(false); + }); + + document.querySelectorAll('.ds-search-filter__clear-all').forEach(clearBtn => { + clearBtn.addEventListener('click', e => { + e.preventDefault(); + clearFilters(); + }); + }); + + showResults.addEventListener('click', () => showFilter(false)); + } +}; + +export default searchFilterJs; diff --git a/src/www/pages/tfwm/components/templates/search/index.njk b/src/www/pages/tfwm/components/templates/search/index.njk new file mode 100644 index 00000000..33a2f22f --- /dev/null +++ b/src/www/pages/tfwm/components/templates/search/index.njk @@ -0,0 +1,103 @@ +{% extends "www/_layouts/template-layout-fullwidth.njk" %} +{% set pageTitle="Search" %} {% set section = "Templates" %} +{# Imports #} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{% from "wmcads/components/page-contents/_page-contents.njk" import wmcadsPageContents %} +{% from "wmcads/patterns/search/search-bar/_search-bar.njk" import wmcadsSearchbar %} +{% from "wmcads/patterns/search/search-filter/_search-filter.njk" import wmcadsSearchFilter %} +{% from "wmcads/patterns/search/sort/_sort.njk" import wmcadsSearchSort %} +{% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} +{% from "wmcads/components/breadcrumb/_breadcrumb.njk" import wmcadsBreadcrumb %} +{% from "wmcads/patterns/search/search-result/_search-result.njk" import wmcadsSearchResult %} + +{# Set array of tiles #} +{% block content %} + + +{% endblock %} diff --git a/src/www/pages/tfwm/components/templates/search/search-template.js b/src/www/pages/tfwm/components/templates/search/search-template.js new file mode 100644 index 00000000..620deaa9 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/search/search-template.js @@ -0,0 +1,58 @@ +const searchFilterJs = () => { + const showBtn = document.getElementById('show_filter_btn'); + const hideBtn = document.getElementById('hide_filter_btn'); + const showResults = document.getElementById('show_results_btn'); + const searchFilter = document.getElementById('search_filter'); + + if (searchFilter) { + const filterOptions = searchFilter.querySelectorAll('.ds-fe-checkboxes__input'); + + filterOptions.forEach(option => { + option.addEventListener('change', () => { + if ([...filterOptions].some(input => input.checked)) { + searchFilter.classList.add('ds-search-filter--has-inputs-checked'); + } else { + searchFilter.classList.remove('ds-search-filter--has-inputs-checked'); + } + }); + }); + + const showFilter = (show = true) => { + if (show) { + searchFilter.classList.add('ds-search-filter--is-open'); + searchFilter.setAttribute('aria-expanded', 'true'); + } else { + searchFilter.classList.remove('ds-search-filter--is-open'); + searchFilter.setAttribute('aria-expanded', 'false'); + } + }; + + const clearFilters = () => { + filterOptions.forEach(option => { + option.checked = false; // eslint-disable-line no-param-reassign + }); + searchFilter.classList.remove('ds-search-filter--has-inputs-checked'); + }; + + showBtn.addEventListener('click', e => { + e.preventDefault(); + showFilter(); + }); + + hideBtn.addEventListener('click', e => { + e.preventDefault(); + showFilter(false); + }); + + document.querySelectorAll('.ds-search-filter__clear-all').forEach(clearBtn => { + clearBtn.addEventListener('click', e => { + e.preventDefault(); + clearFilters(); + }); + }); + + showResults.addEventListener('click', () => showFilter(false)); + } +}; + +export default searchFilterJs; diff --git a/src/www/pages/tfwm/components/templates/search/search.scss b/src/www/pages/tfwm/components/templates/search/search.scss new file mode 100644 index 00000000..a400b0f4 --- /dev/null +++ b/src/www/pages/tfwm/components/templates/search/search.scss @@ -0,0 +1,40 @@ +.template-search { + .ds-grid { + @media screen and (max-width: $breakpoint-md) { + flex-direction: column-reverse; + } + } + + .ds-p-r-xl { + @media screen and (max-width: $breakpoint-md) { + padding: 0; + } + } + + .ds-hide-mobile { + @media screen and (max-width: $breakpoint-sm) { + display: none; + } + } + + .ds-search-sort { + @media screen and (max-width: $breakpoint-sm) { + margin-top: $size-md; + } + } + + aside { + @media screen and (max-width: $breakpoint-md) { + display: flex !important; + flex-direction: column-reverse; + } + + .ds-search-sort { + @media screen and (max-width: $breakpoint-md) { + margin-top: $size-lg; + padding-top: $size-lg; + border-top: 1px solid get-color(brandCoolGrey); + } + } + } +} diff --git a/src/www/pages/tfwm/components/templates/templates.scss b/src/www/pages/tfwm/components/templates/templates.scss new file mode 100644 index 00000000..8d50b22b --- /dev/null +++ b/src/www/pages/tfwm/components/templates/templates.scss @@ -0,0 +1,16 @@ +// Vars +@import "../../../wmcads/assets/sass/vars"; + +// Mixins +@import "../../../wmcads/assets/sass/mixins"; + +// General styles +@import "general"; + +// Template specific styles +@import "homepage/homepage"; // Homepage +@import "campaign-one-column/campaign-template"; // Campaign page +@import "content-one-column/content-template"; // Content page +@import "content-two-columns/content-template"; // Content page +@import "search/search"; // Search page +@import "newsroom/newsroom"; // Newsroom Search page diff --git a/src/www/pages/tfwm/components/video-embed/index.njk b/src/www/pages/tfwm/components/video-embed/index.njk new file mode 100644 index 00000000..3d557a13 --- /dev/null +++ b/src/www/pages/tfwm/components/video-embed/index.njk @@ -0,0 +1,25 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Video embed" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{# Macros #} +{% from "wmcads/components/video-embed/_video-embed.njk" import wmcadsVideoEmbed %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + + +{{ + compExample([ + wmcadsVideoEmbed({ + }) + ]) +}} + +

    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/components/warning-text/index.njk b/src/www/pages/tfwm/components/warning-text/index.njk new file mode 100644 index 00000000..5ab977a1 --- /dev/null +++ b/src/www/pages/tfwm/components/warning-text/index.njk @@ -0,0 +1,100 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Warning Text" %} +{% from "wmcads/components/warning-text/_warning-text.njk" import wmcadsWarningText %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +

    What does it do?

    + +

    + When to use it? +

    +

    Use the warning for information that:

    + +

    + When not to use it? +

    + +

    + How it works +

    + + +
    +

    +{# Warning Text #} +

    Warning Text with exclamation mark icon - triangle

    +{{ + compExample([ + wmcadsWarningText({ + text: "Warning! Type something.", + icon: "general-warning-triangle" + }) + ]) +}} +{# End Warning Text #} + +{# Warning Text #} +

    Warning text with exclamation mark icon - round

    +{{ + compExample([ + wmcadsWarningText({ + text: "Warning! Type something.", + icon: "general-warning-circle" + }) + ]) +}} +{# End Warning Text #} + +{# Warning Text #} +

    Warning text with info icon - round

    +{{ + compExample([ + wmcadsWarningText({ + text: "Warning! Type something.", + icon: "general-info" + }) + ]) +}} +{# End Warning Text #} + +{# Warning Text #} +

    Warning text with success icon - round

    +{{ + compExample([ + wmcadsWarningText({ + text: "Type something.", + icon: "general-success" + }) + ]) +}} +{# End Warning Text #} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/index.njk b/src/www/pages/tfwm/index.njk index f4767a1c..898dc372 100755 --- a/src/www/pages/tfwm/index.njk +++ b/src/www/pages/tfwm/index.njk @@ -40,7 +40,7 @@ copy: "

    Make your service look and feel like WMCA: colours, icons, typography and utility classes

    ", smallTitle: true, readMore: true, - link: '/styles/', + link: '/tfwm/styles/', linkText: 'Read more about styles', linkTitle: 'Styles' }) @@ -55,7 +55,7 @@ copy: "

    Reusable parts of the user interface: content, map and form elements; buttons and messages

    ", smallTitle: true, readMore: true, - link: '/components/', + link: '/tfwm/components/', linkText: 'Read more about components', linkTitle: 'Components' }) @@ -70,7 +70,7 @@ copy: "

    Commonly used sets of components

    ", smallTitle: true, readMore: true, - link: '/patterns/', + link: '/tfwm/patterns/', linkText: 'Read more about patterns', linkTitle: 'Patterns' }) @@ -85,7 +85,7 @@ copy: "

    Example template layouts

    ", smallTitle: true, readMore: true, - link: '/templates/', + link: '/tfwm/templates/', linkText: 'Read more about templates', linkTitle: 'Templates' }) diff --git a/src/www/pages/tfwm/patterns/autocomplete/index.njk b/src/www/pages/tfwm/patterns/autocomplete/index.njk new file mode 100644 index 00000000..0f829eb8 --- /dev/null +++ b/src/www/pages/tfwm/patterns/autocomplete/index.njk @@ -0,0 +1,135 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Autocomplete" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/autocomplete/_autocomplete.njk" import wmcadsAutocomplete %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    +

    + The autocomplete component is an input field that offers the user text suggestions as they type.
    + This is often done by hitting an API endpoint with the users query when the user has finished typing. +

    +

    + The autocomplete pattern is a combination of the input and loader components. +

    +{# When #} +

    When to use it?

    + +{# When not #} +

    When not to use it?

    + + +


    +{# Default #} +

    Default state

    +

    In its default state, the autcomplete component is made up of a text input with a search icon.

    +

    For best practice, ensure that the placeholder and aria-label describes what the autocompletes intended purpose is.

    +

    Notice that there is also a ds-loader component nested within the autocomplete, more on that in the next section.

    +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoComplete", + query: '' + }) + ]) | trim +}} + + +

    +{# Loading #} +

    Loading

    +

    + When a user types in a query, you may want to have some code that hits an API or gets the data/suggestions for the autocomplete from somewhere. To help users understand that they need to wait for something we can change the autocomplete to a loading state. + We do this by adding the class ds--is-loading to the top level of the autocomplete (this is the only difference between the loading state and default state code snippets). +

    +

    As mentioned in the previous section, there is a ds-loader component nested in the autocomplete.
    When adding the ds--is-loading class, it will hide the search icon and show the loading spinner in it's place.

    +

    Below is an example of how the autocomplete looks when a user has typed in 'My query' and is waiting for autocomplete suggestions to load.

    + +

    It is good practice to:

    + +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteQuery", + query: 'My query', + loading: true + }) + ]) | trim +}} + + +

    +{# Results #} +

    Suggestions

    +

    The final state of the autocomplete is showing the suggestions.

    +

    You'll notice there is a new section in the code snippet called ds-autocomplete-suggestions, this should be shown/visible when your API/data has loaded the suggestions.

    +

    It's good practice to:

    + + +

    Default (text)

    +

    The most commonly used suggestions will be displayed as text only.

    +

    + It is good practice to: +

    + + +{{ + compExample([ + wmcadsAutocomplete({ + id: "autoCompleteSuggestions", + showSuggestions: true, + textSuggestions: true, + query: 'My query' + }) + ]) | trim +}} + +{# With disruption indicator #} +

    With disruption indicator

    +

    + This autocomplete is combined with the medium / normal - disruption indicator component. +

    +

    You will notice that the suggestions are much bigger than text only results, and have an overflow scrollbar. This scrollbar will appear if the height of the suggestion container goes over a certain height.

    +

    + As you can see from the code snippet, the main ds-autocomplete-suggestions and ds-autocomplete-suggestions__li classes are prevelant on the ul and li elements. Within the li element we have nested the disruption indicator component whilst also using the wmcads grid. This gives enough flexibility to style the suggestions to how we want, find out more in the next section. +

    +{{ + compExample([ + wmcadsAutocomplete({ + showSuggestions: true, + query: 'x15' + }) + ]) | trim +}} + +

    Customising suggestions

    +

    There are many ways in which you can show the suggestions, as the autocomplete component has been built in a way that the suggestion results can be custom styled to how you like.

    +

    + As long as you have the ul element with the class ds-autocomplete-suggestions which contains a direct child li element that has the class ds-autocomplete-suggestions__li then you can fully customise how you want the suggestions to look. +

    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/patterns/banner/index.njk b/src/www/pages/tfwm/patterns/banner/index.njk new file mode 100644 index 00000000..f7eee3ec --- /dev/null +++ b/src/www/pages/tfwm/patterns/banner/index.njk @@ -0,0 +1,273 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Banner" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/banner/_banner.njk" import wmcadsBanner %} + +{% block content %} + +{% markdown %} + +## Normal + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentHTML: "This is a new service - your feedback will help us to improve it." + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Banner with phase indicator #} + +## With phase indicator + +{# What #} + +### What does it do? + +- Helps users to identify when a service is new +- Offers users the opportunity to give feedback about a new service + {# When to #} + +### When to use it? + +- When a service is new + +{# When not to #} + +### When not to use it? + +- On a service that has matured and has a steadily positive rate of satisfaction + +{# How #} + +### How it works + +- A service can be in Alpha (prototype stage) or Beta (when it is on a publicly-accessible website) +- The survey link must point to a Hotjar or service feedback survey, with the service name within the URL. For example, /?serviceName=descriptiveName. + A service can either be in Alpha (prototype stage) or Beta (when it is on a publicly accessible website). + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + phase: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} + +{% markdown %} + +{# Emergency banner #} + +## Emergency banner + +{# What #} + +

    What does it do

    + +- It communicates emergency information and provides advice on what to do. +- When an emergency is no longer relevant, the content will be archived or removed. + +{# When to #} + +

    When to use it?

    + +- When you need to communicate information that is urgent or critical, which will potentially affect a large group of our users. For example, if there is an emergency situation announced in Birmingham, the banner would advise all users on travel updates and guidance. +- The emergency banner should be placed directly below the main navigation. +- Only show one emergency banner notification at a time. + +{# When not to #} + +

    When not to use it?

    + +- When a warning or emergency is directly related to a task the user is completing. In this case, use the appropriate Message component to notify users of any issues. +- If the issue is related to a service we are providing such as our customer service, you should place the Warning text and Inset text components next to the affected service, detailing the issue. +- Any disruptions to travel will be highlighted on the home page through the Disruption indicator components. + +{# How #} + +

    How it works

    + +- The user can dismiss the Emergency banner through the 'Close' link. This will remove the current emergency banner from all pages they visit on the website. +- The On-page variant is only shown when a user is on the Emergency advice page, which can be accessed through the 'Read our latest advice' link. + +{# Sitewide #} + +### Sitewide + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} +{# On-page #} + +### On-page variant + +{% endmarkdown %} + +{{ + compExample([ + wmcadsBanner({ + contentText: "Emergency notification title", + emergency: true, + onPage: true + }) + ], { + componentPath: "wmcads/patterns/banner/", + njk: true, + njkProps: wmcadsBannerProps, + js: false, + iframe: false + }) +}} +{% markdown %} + +{# Hub page banner #} + +## Hub page banner + +{# What #} + +

    What does it do?

    + +- Helps users to identify they have eventered a Hub section of the website +- Provides users with a short description of the chosen hub of the WMCA + +{# When #} + +

    When to use it?

    + +- Only on Hub Landing Pages + +

    When not to use it?

    + +- On pages where the content is not related to a hub overview + +

    How it works

    + +- The image container width will expand if users are viewing the page with a browser width higher than 1280px. +- The image within the container will zoom to fill the size of the image container. +- The image will be hidden on mobile devices. Our previous research found mobile users do not see the value of images on mobile pages. +- The image, optional logo or icon will change for each hub landing page. + +{% endmarkdown %} + +{% from "wmcads/patterns/hub-page-banner/_hub-page-banner.njk" import wmcadsHubPageBanner %} + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using a short description" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + + +{{ + compExample([ + wmcadsHubPageBanner({ + contentHTML: "Example using an example brand logo with a longer text description", + logo: true + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{{ + compExample([ + wmcadsHubPageBanner({ + title: "Hub Header with a longer example title" + }) + ], { + componentPath: "wmcads/patterns/hub-page-banner/", + njk: true, + njkProps: wmcadsHubPageBannerProps, + js: false, + iframe: true + }) +}} + +{% markdown %} + +{# Homepage banner #} + +## Homepage + +{# What #} + +

    What does it do?

    + +- Provides a complementary image associated with the West Midlands +- Highlights a welcome message for visitors of the West Midlands Combined Authority site + +{# When #} + +

    When to use it?

    + +- On the homepage + +

    When not to use it?

    + +- Regular content pages + +{% endmarkdown %} + +{% from "wmcads/patterns/banner/homepage-banner/_homepage-banner.njk" import wmcadsHomepageBanner %} + +{{ + compExample([ + wmcadsHomepageBanner() + ], { + componentPath: "wmcads/patterns/banner/homepage-banner/", + njk: true, + njkProps: wmcadsHomepageBannerProps + }) +}} + +{% endblock %} diff --git a/src/www/pages/tfwm/patterns/board-members/index.njk b/src/www/pages/tfwm/patterns/board-members/index.njk new file mode 100644 index 00000000..2072efcb --- /dev/null +++ b/src/www/pages/tfwm/patterns/board-members/index.njk @@ -0,0 +1,22 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Board Members" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/board-members/_board-members.njk" import wmcadsBoardMembers %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# Board members #} +

    Board Members

    + +{{ + compExample([ + wmcadsBoardMembers({ + + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/patterns/contact-details/index.njk b/src/www/pages/tfwm/patterns/contact-details/index.njk new file mode 100644 index 00000000..3299dd2b --- /dev/null +++ b/src/www/pages/tfwm/patterns/contact-details/index.njk @@ -0,0 +1,111 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Contact details" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "wmcads/patterns/contact-details/_contact-details.njk" import wmcadsContactDetails %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    About

    + {# What #} +

    What does it do?

    + + {# When #} +

    When to use it?

    + + {# When not #} +

    When not to use it?

    + + {# How it works #} +

    How it works?

    + +

    + GOV.UK has detailed information about how to display contact details. +

    + + +

    Contact Details - Address

    + + {{ + compExample([ + wmcadsInsetText( + { + thinner : true, + html: "Customer Services
    Transport for West Midlands
    16 Summer Lane
    Birmingham
    B19 3SD" + } + ) + ]) + }} + + +

    Contact Details - Template

    + + {{ + compExample([ + wmcadsInsetText({html: + wmcadsContactDetails({ + warningText: "We are currently experiencing problems with our
    telephone systems and cannot answer calls", + warningIcon: "general-warning-triangle", + content: " + customerservice@tfwm.org.uk
    + Telephone: 0345 303 6760
    + Monday to Tuesday and Thursday to Friday, 9am - 5pm,
    + Wednesday, 9.30am - 5pm" + }) | indent(6) | trim + }) + ]) + }} + + + +

    Contact Details - Template TfWM

    + + {{ + compExample([ + wmcadsInsetText({ + html: " +

    Transport for West Midlands

    +

    + Twitter
    + Facebook
    +

    +

    + Submit an enquiry
    + Telephone: 0345 303 6760
    +

    + Monday to Tuesday and Thursday to Friday, 9am - 5pm,
    + Wednesday, 9.30am - 5pm
    + Saturday and Sunday, closed + " + }) + ]) + }} + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/patterns/content-cards/index.njk b/src/www/pages/tfwm/patterns/content-cards/index.njk new file mode 100644 index 00000000..26a61062 --- /dev/null +++ b/src/www/pages/tfwm/patterns/content-cards/index.njk @@ -0,0 +1,236 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Content cards" %} +{% set section="Patterns" %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +{# About #} +

    About

    +

    These are common applications of the content card component.

    +
    + +

    +{# Map card #} +

    Map card

    +{# What #} +

    What is it?

    + + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{# Map example #} +{% from "wmcads/patterns/content-cards/map/_map.njk" import wmcadsContentCardMap %} + +{{ + compExample([ + wmcadsContentCardMap() + ]) +}} + +

    +{# Travel update card #} +

    Travel update card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{# Set up travel updates #} +{% from "wmcads/patterns/content-cards/travel-updates/_travel-updates.njk" import wmcadsContentCardTravelUpdates %} + +{{ + compExample([ + wmcadsContentCardTravelUpdates() + ]) +}} + +

    +{# Button card #} +

    Button card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + + +{# Set up buttons #} +{% from "wmcads/patterns/content-cards/buttons/_buttons.njk" import wmcadsContentCardButtons %} + +{{ + compExample([ + wmcadsContentCardButtons() + ]) +}} + +

    +{# Image card #} +

    Image card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When to to #} +

    When not to use it?

    + + +{# Set up image #} +{% from "wmcads/patterns/content-cards/image/_image.njk" import wmcadsContentCardImage %} + +{{ + compExample([ + wmcadsContentCardImage() + ]) +}} + +

    +{# In-line navigation card #} +

    In-line navigation card

    +{# What #} +

    What is it?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# How to #} +

    How to use it

    + + +{# Set up inline navigation #} +{% from "wmcads/patterns/content-cards/inline-navigation/_inline-navigation.njk" import wmcadsContentCardInlineNavigation %} + +{{ + compExample([ + wmcadsContentCardInlineNavigation() + ]) +}} + +{# With current page #} +

    In-line navigation with current page

    + +{{ + compExample([ + wmcadsContentCardInlineNavigation({ + withCurrentPage: true + }) + ]) +}} + +

    +{# Email sign up card #} +

    Email sign up card

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +

    When adding a sign up form from Campaign Monitor, you are provided with HTML markup, but make sure not to change any of the generated attributes except for classes.

    +

    They have been changed in the following examples to avoid accessibility errors.

    +
    + +{# Set up email sign up #} +{% from "wmcads/patterns/content-cards/email-sign-up/_email-sign-up.njk" import wmcadsContentCardEmailSignUp %} + +{# Collapsed #} +

    Collapsed

    +

    This is the default state for the email sign up card.

    + +{{ + compExample([ + wmcadsContentCardEmailSignUp({ exampleSuffix: "example-1"}) + ]) +}} + +{# Expanded #} +

    Expanded

    +

    The collapsed card will expand when the 'continue' button is pressed/tapped.

    + +{{ + compExample([ + wmcadsContentCardEmailSignUp({ expanded: true, exampleSuffix: "example-2" }) + ]) +}} + +{# External link #} +

    External link

    +

    Use this content card when you want to send users to an external Campaign Monitor form if you want to capture more user data such as demographics, travel habits etc.

    + +{{ + compExample([ + wmcadsContentCardEmailSignUp({ externalLink: true, exampleSuffix: "example-3" }) + ]) +}} +{% endblock %} diff --git a/src/www/pages/tfwm/patterns/cookies/index.njk b/src/www/pages/tfwm/patterns/cookies/index.njk new file mode 100644 index 00000000..68ce0201 --- /dev/null +++ b/src/www/pages/tfwm/patterns/cookies/index.njk @@ -0,0 +1,87 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} {% set pageTitle = "Cookies" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/cookies/cookies-banner/_cookies-banner.njk" import wmcadsCookiesBanner %} +{% from "wmcads/patterns/cookies/cookies-manager/_cookies-manager.njk" import wmcadsCookiesManager %} + +{% block content %} + +

    About

    +{# What #} +

    What does it do?

    + +
    +

    +

    Cookie banner

    +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# How #} +

    How it works

    + +

    The Cookies banner should be placed above the main header and be on every page

    + +{{ + compExample([ + wmcadsCookiesBanner() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: false + }) | trim }} + +

    +

    Manage Cookies

    +{# When to #} +

    When to use it?

    + + +{{ + compExample([ + wmcadsCookiesManager() + ], + { + componentPath: "wmcads/patterns/cookies/", + njk: false, + js: true, + iframe: true + }) | trim }} + +{% endblock %} diff --git a/src/www/pages/tfwm/patterns/feedback-loop/index.njk b/src/www/pages/tfwm/patterns/feedback-loop/index.njk new file mode 100644 index 00000000..7766f45c --- /dev/null +++ b/src/www/pages/tfwm/patterns/feedback-loop/index.njk @@ -0,0 +1,47 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Feedback loop" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/feedback-loop/_feedback-loop.njk" import wmcadsFeedbackLoop %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +
    +

    + +{{ + compExample([ + wmcadsFeedbackLoop({ + id: 'fb' + }) + ]) +}} + +

    +

    Open

    +{{ + compExample([ + wmcadsFeedbackLoop({ + isOpen: true, + id: 'fb-open' + }) + ]) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/patterns/footer/index.njk b/src/www/pages/tfwm/patterns/footer/index.njk new file mode 100644 index 00000000..136237b8 --- /dev/null +++ b/src/www/pages/tfwm/patterns/footer/index.njk @@ -0,0 +1,156 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Footer" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + + +

    +{# Full footer #} +

    Full variant of footer

    +

    The full variant of the footer may include menus which become collapsible on smaller devices.

    +

    To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

    +{{ + compExample([ + wmcadsFooter({ + columns: 3, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +

    +

    2 Column Variant

    + +{{ + compExample([ + wmcadsFooter({ + columns: 2, + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About Transport for West Midlands" + }, { + name: "WMN Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + })], + { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
    + + +{# Mobile app variant #} + +

    When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the Transport for West Midlands footer.

    + +

    The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

    + +

    To use the mobile app variant:

    + + +

    + You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

    + +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/patterns/header-and-footer/index.njk b/src/www/pages/tfwm/patterns/header-and-footer/index.njk new file mode 100644 index 00000000..8e42881b --- /dev/null +++ b/src/www/pages/tfwm/patterns/header-and-footer/index.njk @@ -0,0 +1,212 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header and footer" %} +{% set section="Patterns" %} +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +
    +

    + + + +{# Header #} +

    Header

    +{# Skip Link #} +

    Skip link

    +

    There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

    +

    Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

    +{# Logo #} +

    Logo

    +

    This must always be the West Midlands Combined Authority logo.

    +{# Phase indicator #} +

    Phase indicator

    +

    This component must be used if the service is not live, using the phase indicator guidance.

    +{# Navigation #} +

    Navigation

    +

    The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

    +

    The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

    +

    We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

    +{# Mobile apps #} +

    Mobile apps

    +

    When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

    +{# Search #} +

    Search

    +

    This functionality only shows for desktop and tablet users. When clicked, search expands and takes over the whole page.

    + +{{ + compExample([ + wmcadsHeader ({ + id: "mega-menu", + navItems: navItems, + banner: true, + linkTopLevel: true, + search: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + } + }) + ]) +}} + +{# With title variant #} +

    With a title variant of header

    +

    When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

    + +

    To use the title variant:

    + + + +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + withTitle: true, + id: "basic" + }) + ]) +}} + + +{# Mobile app variant #} +

    Mobile app variant of header

    +

    When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority header.

    + +

    To use the mobile app variant:

    + + +

    + You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'footer pattern', + link: '#mobile-app-footer' + }) + }} . +

    + +{{ + compExample([ + wmcadsHeader({ + navItems: navItems, + app: true, + exampleAria: "Mobile app header" + }) + ]) +}} + +

    + + +{# Full footer #} +

    Full variant of footer

    +

    The full variant of the footer may include menus which become collapsible on smaller devices.

    +

    To enable the collapsible footer menus on smaller screens you can include the recommended javascript below:

    +{{ + compExample([ + wmcadsFooter({ + menu1: { + name: "Resources & support", + menuItems: [{ + name: "Businesses" + },{ + name: "Education" + },{ + name: "Job centres" + },{ + name: "Young people" + }] + }, + menu2: { + name: "About us", + menuItems: [{ + name: "About West Midlands Combined Authority" + }, { + name: "WMCA Apps" + }] + }, + bottomMenu: [{ + name: "Accessibility" + }, + { + name: "Terms and Conditions" + }, + { + name: "Policies" + }] + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true, + iframe: true + }) +}} +
    + + +{# Mobile app variant #} + +

    When developing a mobile app, if you are limited for space and need extra room then it is recommended to use the mobile app variant of the West Midlands Combined Authority footer.

    + +

    The mobile app version of the footer ensures that it will not show on devices with a screen width less than 768px. This means the footer will only show on devices with a screen resolution bigger than 768px.

    + +

    To use the mobile app variant:

    + + +

    + You will most likely want to use this with the mobile variants of the + {{ wmcadsLink({ + contentText: 'breadcrumb component', + link: '/components/breadcrumb/#mobile-app-breadcrumb' + }) + }} and + {{ wmcadsLink({ + contentText: 'header pattern', + link: '#mobile-app-header' + }) + }} . +

    + +{{ + compExample([ + wmcadsFooter({ + app: true + }) + ], { + componentPath: "wmcads/patterns/footer/", + njk: false, + js: true + }) +}} + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/patterns/header-demo/index.njk b/src/www/pages/tfwm/patterns/header-demo/index.njk new file mode 100644 index 00000000..c32de977 --- /dev/null +++ b/src/www/pages/tfwm/patterns/header-demo/index.njk @@ -0,0 +1,220 @@ + + + + {% include "www/_partials/_head.njk" %} + + + + + + {# header #} + {% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} + {{ + wmcadsHeader({ + id: "mega-menu-example", + search: true, + searchSuggestions: ["See live departures", "Find a timetable", "Check for disruptions", "Manage my Swift card", "Find ticket prices", "Get a refund", "Update Direct Debit", "Apply for a 16-18 photocard"], + navItems: [{ + name: "Plan a journey", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Swift and tickets", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "Get help", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + }], + megaMenu: true + }) + }} + {# header #} + + + {# main #} +
    + Close window +
    + {# main #} + + + {% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} + {{ + wmcadsFooter({ + bottomMenu: [{ + name: "Privacy & Cookies Policy", + link: "https://www.wmca.org.uk/privacy-cookies-policy/" + }] + }) + }} + + + + {% include "www/_partials/_scripts.njk" %} + + + + diff --git a/src/www/pages/tfwm/patterns/header/index.njk b/src/www/pages/tfwm/patterns/header/index.njk new file mode 100644 index 00000000..423c907b --- /dev/null +++ b/src/www/pages/tfwm/patterns/header/index.njk @@ -0,0 +1,305 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Header" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{# Imports #} +{% from "www/_partials/component-example/component-example.njk" import compExample %} +{% from "wmcads/patterns/header/_header.njk" import wmcadsHeader %} +{% from "wmcads/patterns/header-v2/_header-v2.njk" import wmcadsHeaderV2 %} +{% from "wmcads/patterns/footer/_footer.njk" import wmcadsFooter %} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/warning-text/_warning-text.njk" import wmcadsWarningText %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + + + +{# Header #} +

    Header

    +{# Skip Link #} +

    Skip link

    +

    There is a hidden skip link for users with screen reader assistive technology. This allows users to quickly access the main content. All pages must include this.

    +

    Ensure there is a HTML element on the page with the ID of ds-main-content so the user can skip to this section.

    +{# Logo #} +

    Logo

    +

    This must always be the Transport for West Midlands logo.

    +{# Phase indicator #} +

    Phase indicator

    +

    This component must be used if the service is not live, using the phase indicator guidance.

    +{# Navigation #} +

    Navigation

    +

    The three top-level navigation items were decided by identifying our user’s top tasks using Gerry McGovern’s methodology. We overlaid a heatmap of the home page, where we found the same three areas were the most-used areas.

    +

    The top-level items open a structured megamenu to avoid cognitive overload. Users are familiar with this pattern from online shopping and transport operators.

    +

    We only use three top-level items as we prefer not to use hamburger menus on mobile. Users are required to make an extra click to reveal the navigation, therefore you cannot glance at navigation options.

    +{# Mobile apps #} +

    Mobile apps

    +

    When designing an app, you should use a tab bar and avoid using hamburger items wherever possible. Limit the tabs to the most important tasks using user research.

    +{# Search #} +

    Search

    +

    This function expands the mega menu and reveals the search bar along with the ‘I want to…’ feature.

    +

    The ‘I want to...’ feature shows a list of the top page links which users access through search. This is to help users find the information they are searching for faster. These links are regularly updated using search data to maintain their relevance.

    +

    On mobile, the mega menu search function uses a primary purple background instead of the standard white background. Our user testing found users preferred the white link text on the primary purple background as it is clearer to read.

    + +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example-full", + navItems: [{ + name: "Styles" + },{ + name: "Components" + },{ + name: "Patterns" + },{ + name: "User research" + }], + banner: true, + breadcrumbs: { + section: section, + pageTitle: pageTitle + }, + exampleAria: "Full header", + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With mega menu #} +

    Mega menu with search example

    + +{{ + compExample([ + wmcadsHeaderV2({ + id: "mega-menu-example", + search: true, + placeholder: "fg", + brand: "wmca", + navItems: [{ + name: "The Mayor", + subnavItems: [{ + name: "Plan your journey", + icon: "general-route", + subnavItems: [{ + name: "Journey planner" + }, + { + name: "Find a timetable" + }, + { + name: "Live and planned disruptions" + }, + { + name: "Major roadworks and events" + }] + }, + { + name: "Ways to travel", + icon: "general-location-arrow", + subnavItems: [{ + name: "Walking" + }, + { + name: "Cycling" + }, + { + name: "Buses" + }, + { + name: "Trains" + }, + { + name: "Trams" + }, + { + name: "Park and ride" + }, + { + name: "Driving" + }] + }, + { + name: "Travel information", + icon: "general-info", + subnavItems: [{ + name: "How to travel with accessibility needs" + }, + { + name: "How to travel safely" + }, + { + name: "How to get to hospital" + }] + }, + { + name: "Discover our region", + icon: "general-star", + subnavItems: [{ + name: "Places and attractions to visit" + }, + { + name: "Find discount vouchers" + }] + }] + }, { + name: "Who we are", + subnavItems: [{ + name: "Find a ticket", + icon: "general-search", + subnavItems: [{ + name: "Ticket finder" + }, + { + name: "Types of ticket" + }] + }, + { + name: "Discounts and free travel passes", + icon: "general-wallet", + subnavItems: [{ + name: "Under 18s" + }, + { + name: "Students" + }, + { + name: "Families and groups" + }, + { + name: "Finding or starting a new job" + }, + { + name: "Disabled person's pass" + }, + { + name: "Older person's pass" + }, + { + name: "WASPI women's pass" + }] + },{ + name: "Manage your Swift card", + icon: "swift-bird-icon", + subnavItems: [{ + name: "How to use your Swift card" + }, + { + name: "Update your personal details" + }, + { + name: "Top up your Swift card" + }, + { + name: "View your payment history" + }, + { + name: "View your travel history" + }, + { + name: "Replace your lost Swift card" + }] + },{ + name: "Manage your ticket", + icon: "general-ticket", + subnavItems: [ + { + name: "Update your Direct Debit" + }, + { + name: "Get a refund" + }, + { + name: "Make a payment" + }, + { + name: "Replace your lost ticket or pass" + } + ] + }] + },{ + name: "What we do", + subnavItems: [{ + name: "Contact an operator" + }, + { + name: "Find a travel centre" + }, + { + name: "Find lost property" + }, + { + name: "Give feedback" + }, + { + name: "Contact us" + }, + { + name: "Report anti-social behaviour" + }, + { + name: "Request a new bus shelter or stop pole" + }, + { + name: "Report a problem with a shelter or stop" + }] + },{ + name: "In my area" + },{ + name: "Contact us" + }], + megaMenu: true, + megaMenuDemo: true + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +{# With title variant #} +

    With a title variant of header

    +

    When developing a service you may not need the navigation of the main website. When this is the case, you can place the title of the service in the header (providing their is no other h1 element on the page).

    + +

    To use the title variant:

    + + + +{{ + compExample([ + wmcadsHeaderV2({ + withTitle: true, + legacyMenu: true, + brand: "wmca" + }) + ], { + componentPath: "wmcads/patterns/header-v2/", + njk: false, + js: true, + iframe: true + }) +}} + +

    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/patterns/index.njk b/src/www/pages/tfwm/patterns/index.njk new file mode 100644 index 00000000..03e8d073 --- /dev/null +++ b/src/www/pages/tfwm/patterns/index.njk @@ -0,0 +1,16 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Patterns" %} +{% set section = "Patterns" %} +{% set ds = 'tfwm' %} + +{% block content %} +

    Patterns are reusable parts of the user interface that have been made to support a variety of + applications.

    + +

    Individual patterns can be used in multiple different patterns and contexts. For example, the + text input component + can be used to ask for an email address, a National Insurance number or someone’s name.

    +

    If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples provided + will render exactly as they do inside the Design System.

    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/patterns/question-form/index.njk b/src/www/pages/tfwm/patterns/question-form/index.njk new file mode 100644 index 00000000..495871f1 --- /dev/null +++ b/src/www/pages/tfwm/patterns/question-form/index.njk @@ -0,0 +1,127 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Question form" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + +

    How it works?

    + + + +

    + {# Form Element #} +

    Form Element

    +

    This pattern can be populated with any form element, such as text, radio buttons, checkboxes, dropdown or file upload.

    + {% from "wmcads/patterns/question/form-element/_form-element.njk" import wmcadsFormElement %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsFormElement({ + text: "Question title", + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Form Element #} + + +

    + {# Reference #} +

    Reference

    +

    This pattern shows a question that shows defined steps and uses the backlink and progress indicator component.

    + {% from "wmcads/patterns/question/reference/_reference.njk" import wmcadsReference %} + {% from "wmcads/components/form-elements/input/_input.njk" import wmcadsInput %} + {{ + compExample([ + wmcadsReference({ + question: "What is your Direct Debit Reference?", + text: "

    This can be found in the email we sent you asking you to reinstate your Direct Debit and begins with a 6.

    If you didn’t receive this email, it is shown next to every payment to WMCA for your Direct Debit on your bank statement.

    ", + actualSection: "1", + totalSections: "3", + sectionName: "About your ticket", + fields: + wmcadsInput({ + label: "Direct Debit Reference", + classNames: "ds-col-1-2" + }) , + button: + wmcadsButton({ + text: "Continue", + type: "Submit", + classNames: "ds-col-1" + }) + }) + ]) + }} + {# End Reference #} + + +

    + {# Summary #} +

    Summary

    +

    This shows the user all of the data they have entered before they submit the form. This stage allows the user to change any details before submitting the form.

    + {% from "wmcads/patterns/question/summary/_summary.njk" import wmcadsSummary %} + {% from "wmcads/components/table/_table.njk" import wmcadsTable %} + {% from "wmcads/components/button/_button.njk" import wmcadsButton %} + {{ + compExample([ + wmcadsSummary({ + question: "Check your answers before reinstating your Direct Debit", + html: +"

    Now send your request

    +

    By submitting this request you are confirming that, to the best of your knowledge, the details you are providing are correct.
    +
    You consent to West Midlands Combined Authority possibly changing your Direct Debit date if it usually would occur in the next 10 days.
    +
    You also consent to West Midlands Combined Authority reinstating your Direct Debit instruction.

    ", + button: + wmcadsButton({ + classNames: "ds-btn--start", + text: "Accept & Send ", + iconRight: "general-chevron-right" + }) + }) + + ]) + }} + {# End Summary #} + + +

    + {# Confirmation Message #} +

    Confirmation Message

    +

    This is a confirmation message to show that the user has successfully submitted the data in the form, along with a reference or any information which the user needs to be made aware of.

    + {% from "wmcads/patterns/question/confirmation-message/_confirmation-message.njk" import wmcadsConfirmationMessage %} + {{ + compExample([ + wmcadsConfirmationMessage() | indent(4) | trim + ]) + }} + {# End Confirmation Message #} + +{% endblock %} diff --git a/src/www/pages/tfwm/patterns/search/index.njk b/src/www/pages/tfwm/patterns/search/index.njk new file mode 100644 index 00000000..01d64df5 --- /dev/null +++ b/src/www/pages/tfwm/patterns/search/index.njk @@ -0,0 +1,147 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Search" %} +{% set section="Patterns" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    What does it do?

    + +

    When to use it?

    + +

    How it works

    + + +

    + {# Search bar #} +

    Search bar

    + {% from "wmcads/patterns/search/search-bar/_search-bar.njk" import wmcadsSearchbar %} + {{ + compExample([ + wmcadsSearchbar() + ]) + }} + {# End Search bar #} + + +

    + {# Sort #} +

    Sort

    +

    What does it do?

    + + {% from "wmcads/patterns/search/sort/_sort.njk" import wmcadsSearchSort %} + {{ + compExample([ + wmcadsSearchSort() + ]) + }} + {# End sort #} + +

    + {# Search filter #} +

    Filter

    +

    What does it do?

    + +

    When to use it?

    + + {% from "wmcads/patterns/search/search-filter/_search-filter.njk" import wmcadsSearchFilter %} + {{ + compExample([ + wmcadsSearchFilter( + { + accordion: [{ + summaryTitle: "Topic", + options: [ + "Tickets", "Travel advice", "Planning a journey" + ] + }, + { + summaryTitle: "Page type", + options: [ + "Services", "News", "Bus routes", "Timetables", "Offers and promotions" + ] + } + ]} + ) + ], { + componentPath: "wmcads/patterns/search/search-filter/", + njk: false, + js: true, + iframe: false + }) + }} + + {# End search filter #} +

    + {# Search result #} +

    Search result

    +

    What does it do?

    + +

    How it works

    + + {% from "wmcads/patterns/search/search-result/_search-result.njk" import wmcadsSearchResult %} + {{ + compExample([ + wmcadsSearchResult( + { + pageTitle: "Swift: The smarter way to travel", + breadcrumbs: ['Home', 'Swift'], + excerpt: "Swift is the easy and flexible way to travel around the West Midlands. find the swift card for you. How do you travel? bus…" + } + ) + ]) + }} + {# End search result #} +

    + {# Pagination #} +

    Pagination links

    +

    What does it do?

    + + {% from "wmcads/patterns/search/pagination/_pagination.njk" import wmcadsPagination %} + {{ + compExample([ + wmcadsPagination({ + pageCount: 8, + activePage: 1 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 5 + }), + wmcadsPagination({ + pageCount: 8, + activePage: 8 + }) + ]) + }} + {# End pagination #} +

    + +{% endblock %} diff --git a/src/www/pages/tfwm/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js b/src/www/pages/tfwm/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js new file mode 100644 index 00000000..8371607f --- /dev/null +++ b/src/www/pages/tfwm/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.js @@ -0,0 +1,71 @@ +function aToZContentStyleGuide() { + // FUNCTIONS + // Change accordion state + const changeAccordionState = (accordionElem, changeStateToOpen = true) => { + const accordionBtn = accordionElem.querySelector('.ds-accordion__summary-wrapper'); + if (changeStateToOpen) { + accordionElem.classList.add('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', true); + } else { + accordionElem.classList.remove('ds-is--open'); + accordionBtn.setAttribute('aria-expanded', false); + } + }; + + // Change all accordion states at once + const changeAllAccordionStates = changeStateToOpen => { + const accordions = document.querySelectorAll('main .ds-accordion'); + accordions.forEach(accordion => changeAccordionState(accordion, changeStateToOpen)); + }; + + // Scroll to an anchor within an accordion + const scrollToAnchor = idWithHash => { + // Check if element is on the page + const elem = document.querySelector(idWithHash); + if (!elem || elem.classList.contains('ds-accordion__summary-wrapper')) { + return; + } + // Open accordion and scroll to element + changeAccordionState(elem.parentElement.parentElement); + elem.scrollIntoView(); + }; + + // Check for anchor to scroll to onload + const scrollToAnchorOnLoad = () => { + if (document.location.hash) { + scrollToAnchor(document.location.hash); + } + }; + + // Add event listener to all section links on the page + const setupScrollToAnchor = () => { + const anchors = document.querySelectorAll('main a[href^="#"]:not([href="#"])'); + // Loop through an add event listener + anchors.forEach(anchor => { + anchor.addEventListener('click', e => { + e.preventDefault(); + scrollToAnchor(anchor.hash); + }); + }); + }; + + // Set up controls + const setupAccordionControls = () => { + const controls = document.querySelectorAll('main .js-accordion-controls button'); + + controls.forEach(control => { + control.addEventListener('click', () => { + changeAllAccordionStates(control.classList.contains('js-accordion-controls-open')); + }); + }); + }; + + // CALL FUNCTIONS + if (document.querySelector('#atozofstyle')) { + scrollToAnchorOnLoad(); + setupScrollToAnchor(); + setupAccordionControls(); + } +} + +export default aToZContentStyleGuide; diff --git a/src/www/pages/tfwm/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json b/src/www/pages/tfwm/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json new file mode 100644 index 00000000..143a4f85 --- /dev/null +++ b/src/www/pages/tfwm/styles/a-to-z-content-style-guide/_a-to-z-content-style-guide.njk.json @@ -0,0 +1,538 @@ +{ + "aToZOfStyles": [ + { + "letter": "A", + "styles": [ + { + "title": "Abbreviations and acronyms", + "content": "

    The first time you use an abbreviation or acronym explain it in full on each page unless it's well known, like UK or BBC. Then refer to it by initials.

    Do not use full stops in abbreviations: BBC, not B.B.C.

    If you only use a term once, you don't need to include the abbreviation afterwards.

    Use 'm' (for millions) and 'bn' (for billions) for sums of money and measurable quantities: £10bn; 1bn litres of water. However, spell out for people and countable nouns: 3 billion commuters; 10 billion tickets.

    Use lower case for standard measurements: kg; km; lb; mph but use upper case for KB; GB; MB.

    Exception: Spell out metres to prevent confusion with abbreviation for million.

    Note:

    1. Do not include a space between the number and the unit: 20km; 50kph; 100KB
    2. Never add an 's' to measurements: 20km, not 20kms

    Use lower case for ie and eg, but avoid using these terms altogether where possible. Use 'that is' or 'for example' instead.

    " + }, + { + "title": "Active voice", + "content": "

    Use the active voice, not the passive voice - it’s easier to read. For example:

    We’re going to get the train tomorrow (active voice)

    A train is going to be caught by us tomorrow (passive voice)

    " + }, + { + "title": "Addresses", + "content": "

    Use the contact details design pattern. This shows you how to format addresses.

    " + }, + { + "title": "Addressing the user", + "content": "

    Address the user as 'you' wherever possible.

    " + }, + { + "title": "Adult rate", + "content": "

    Do not hyphenate.

    " + }, + { + "title": "Ages", + "content": "

    Do not use hyphens in ages unless to avoid confusion, although it's always best to write in a way that avoids ambiguity. For example, 'a class of 15 16-year-old students took the A level course' can be written as '15 students aged 16 took the A level course'.

    Write ages like this: XX years old (for example, 66 years old).

    Exception - use hyphens when talking about age groups:

    " + }, + { + "title": "American and UK English", + "content": "

    Use UK English spelling and grammar. For example, use 'organise' not 'organize', 'modelling' not 'modeling', and 'fill in a form', not 'fill out a form'.

    American proper nouns, like 4th Mechanized Brigade or World Health Organization, take American English spelling.

    " + }, + { + "title": "Ampersand", + "content": "

    Use and rather than &, unless it's a department's logo image or a company's name as it appears on the Companies House register.

    " + }, + { + "title": "Antisocial", + "content": "

    Hyphenated.

    " + }, + { + "title": "A-road", + "content": "

    Hyphenated.

    " + } + ] + }, + { + "letter": "B", + "styles": [ + { + "title": "Bacs (Bankers Automated Clearing System)", + "content": "

    Use the acronym as it's more widely known than the full name. No need to include the full name in brackets.

    " + }, + { + "title": "bold", + "content": "

    Only use bold for instructions when you’re talking about an interactive service.

    You can use bold to explain what field a user needs to fill in on a form, or what button they need to select. For example: \"Select Continue.\"

    Use bold sparingly - using too much will make it difficult for users to know which parts of your content they need to pay the most attention to.

    Do not use bold in other situations, for example to emphasise text.

    To emphasise words or phrases, you can:

    " + }, + { + "title": "bus station", + "content": "

    Only use upper case if you're talking about a specific bus station: Dudley Bus Station, Coventry Pool Bus Station.

    Use lower case if you're talking about bus stations in general: You can find bike racks at our bus stations.

    " + }, + { + "title": "borough council", + "content": "

    Lower case except in a name: Dudley Metropolitan Borough Council.

    " + }, + { + "title": "Bullet points and numbered steps", + "content": "

    You can use bullet points to make text easier to read. Make sure that:

    Bullets should normally form a complete sentence following from the lead text. But it's sometimes necessary to add a short phrase to clarify whether all or some of the points apply. For example, 'You can only register a pension scheme that is (one of the following):'

    The number and type of examples in a list may lead the user to believe the list is exhaustive. This can be dealt with by

    Numbered steps

    Use numbered steps instead of bullet points to guide a user through a process. List the things the user needs to do in order. You do not need a lead-in line. Steps end in a full stop because each should be a complete sentence.

    " + } + ] + }, + { + "letter": "C", + "styles": [ + { + "title": "campaign/scheme names and brands", + "content": "

    If you have a scheme or campaign brand, explain the brand. Don't expect users to understand what you mean. If you say ‘be aware and share’ or ‘get your roll and stroll on’ out of context, it’s not clear what that means.

    Don’t capitalise slogans like ‘be aware and share’. If you’re talking about a specific brand or campaign, use capitals. For example, Workwise, PassProtect. Don’t tell people to ‘Be Aware and Share’, but do say ‘the Be Aware and Share’ campaign.

    For example:

    " + }, + { + "title": "cash fare", + "content": "Do not use - it's confusing. Say 'ticket bought on the bus, train or tram on the day' instead." + }, + { + "title": "Capitalisation", + "content": "

    DO NOT USE BLOCK CAPITALS FOR LARGE AMOUNTS OF TEXT AS IT'S QUITE HARD TO READ.

    Always use lower case, even in page titles. The exceptions to this are proper nouns.

    " + }, + { + "title": "checkbox", + "content": "

    Not \"check box\"

    " + }, + { + "title": "child rate", + "content": "

    Do not hyphenate.

    " + }, + { + "title": "click", + "content": "

    Don't use \"click\" when talking about user interfaces because not all users click. Use \"select\".

    You can use \"right-click\" if the user needs to right-click to open up a list of options to progress through the user journey.

    " + }, + { + "title": "collective nouns", + "content": "

    Treat as singular, except staff and police: the committee has but the staff are; the police want.

    A pair and a couple are both plural.

    " + }, + { + "title": "concessionary", + "content": "

    Try to avoid. Use these instead:

    It’s okay to use concessionary if you’re talking about the English National Concessionary Travel Scheme.

    " + }, + { + "title": "contact details", + "content": "

    Use the contact details design pattern.

    " + }, + { + "title": "contactless", + "content": "

    Not Contactless.

    " + }, + { + "title": "contractions", + "content": "

    You can use contractions to help make your text less formal.

    Avoid negative contractions like can't and don't. Many users find them harder to read, or misread them as the opposite of what they say. Use cannot instead of can't; do not instead of don’t.

    Avoid should've, could've, would've, they've too. These can also be hard to read.

    " + }, + { + "title": "co-operation", + "content": "

    Hyphenated.

    " + }, + { + "title": "coronavirus (COVID-19)", + "content": "

    Coronavirus is the virus which causes the illness COVID-19. Coronavirus is lower case.

    " + }, + { + "title": "council", + "content": "

    Use lower case when writing about local councils in general. Use capitals for the official name of a local council, for example: Birmingham City Council.

    " + }, + { + "title": "Council Tax", + "content": "

    Upper case.

    " + }, + { + "title": "customers", + "content": "

    Refer to 'customers' rather than 'passengers'.

    " + } + ] + }, + { + "letter": "D", + "styles": [ + { + "title": "Dates", + "content": "

    Use 'to' instead of a dash or slash in date ranges. 'To' is quicker to read than a dash, and it's easier for screen readers.

    Always explain what your date range represents, for example 'tax year 2013 to 2014' or 'September 2013 to July 2014'. Date ranges can be the academic year, calendar year or tax year. This is why date ranges must be very, very clear.

    " + }, + { + "title": "daytime", + "content": "

    But night-time.

    " + }, + { + "title": "Direct Debit", + "content": "

    Upper case.

    " + }, + { + "title": "Direct Debit Instruction", + "content": "

    Upper case.

    " + }, + { + "title": "disabled access", + "content": "

    Use this term when referring to disabled accessibility, as 'accessibility' has a wider meaning.

    " + }, + { + "title": "disabled people", + "content": "

    Not 'the disabled' or 'people with disabilities'.

    Read GOV.UK advice on words to use and avoid when talking about disability.

    " + }, + { + "title": "district council", + "content": "

    Lower case even in a name, like Warwick district council.

    " + } + ] + }, + { + "letter": "E", + "styles": [ + { + "title": "eg, etc and ie", + "content": "

    eg can sometimes be read aloud as 'egg' by screen reading software. Instead use 'for example' or 'such as' or 'like' or 'including' - whichever works best in the specific context.

    etc can usually be avoided. Try using 'for example' or 'such as' or 'like' or 'including'. Never use etc at the end of a list starting with these words.

    ie - used to clarify a sentence - is not always well understood. Try (re)writing sentences to avoid the need to use it. If that is not possible, use an alternative such as 'meaning' or 'that is'.

    " + }, + { + "title": "email", + "content": "

    Not e-mail.

    Always give the full email address when providing a hyperlink. For example, 'email ticketing@twfm.org.uk' not 'email the ticketing team'

    " + } + ] + }, + { + "letter": "F", + "styles": [ + { + "title": "FAQs (frequently asked questions)", + "content": "

    Do not use FAQs.

    If you write content by starting with user needs, you will not need to use FAQs.

    FAQs are discouraged because they:

    " + }, + { + "title": "fine", + "content": "

    Use 'fine' instead of 'financial penalty'.

    For example, \"You'll pay a £50 fine.\"" + }, + { + "title": "first person", + "content": "

    Use \"we'\" and \"us\" when addressing the user where possible. For example, instead of \"West Midlands Combined Authority has…\" say \"We have\" - it’s more personal.

    " + }, + { + "title": "fire and rescue service", + "content": "

    Lower case.

    " + }, + { + "title": "focus", + "content": "

    Focuses/focused/focusing. Not focusses/focussed/focussing.

    " + } + ] + }, + { + "letter": "G", + "styles": [ + { + "title": "government", + "content": "

    Lower case unless it's a full title. For example: 'UK government', but 'Her Majesty's Government of the United Kingdom of Great Britain and Northern Ireland'.

    " + } + ] + }, + { + "letter": "H", + "styles": [ + { + "title": "Hyphenation", + "content": "

    Hyphenate:

    Do not hyphenate:

    Do not use a hyphen unless it's confusing without it, for example, a little used-car is different from a little-used car. You can also refer to The Guardian style guide for advice on hyphenation.

    Use 'to' for time and date ranges, not hyphens.

    " + } + ] + }, + { + "letter": "I", + "styles": [ + { + "title": "ie", + "content": "

    see eg, etc and ie

    " + }, + { + "title": "Italics", + "content": "

    Do not use italics. They can be hard to read online.

    " + } + ] + }, + { + "letter": "J", + "styles": [ + { + "title": "job titles", + "content": "

    Use upper case when referring to a specific role: Lord Mayor of Birmingham.

    Use lower case if writing generally: service assistants, station managers.

    " + }, + { + "title": "Journey Planner", + "content": "

    Our travel tool that helps with live route-planning across our network

    A stand-alone link to it should be action-led and first-person: 'Plan my journey'.

    If giving instruction, it can be second-person (to avoid mixing perspectives): 'Plan your journey'.

    If listing tools, we can use the product name: 'Journey Planner'.

    " + } + ] + }, + { + "letter": "L", + "styles": [ + { + "title": "Links", + "content": "

    Front-load your link text with the relevant terms and make them active and specific. Do not use ‘click here’. Use text that describes the link instead.

    " + }, + { + "title": "Lists", + "content": "

    Lists should be bulleted to make them easier to read. See bullets and steps.

    Very long lists can be written as a paragraph with a lead-in sentence if it looks better: 'The following countries are in the EU: Spain, France, Italy...'

    " + }, + { + "title": "log in", + "content": "

    See sign in or log in.

    " + } + ] + }, + { + "letter": "M", + "styles": [ + { + "title": "measurements", + "content": "

    Use lower case for standard measurements: kg; km; mph; kph but use upper case for KB; GB; MB.

    Spell out metres to prevent confusion with abbreviation for million.

    Do not include a space between the number and the unit: 20km; 50mph; 100KB.

    Never add an 's' to measurements: 20km, not 20kms.

    " + }, + { + "title": "Metro", + "content": "

    Only use when talking about the company that runs the tram - West Midlands Metro. To talk about the tram as a mode of transport, use tram, not Metro.

    " + }, + { + "title": "money", + "content": "

    Use the £ symbol: £75.

    Do not use decimals unless pence are included: £75.50 but not £75.00.

    Do not use '£0.xx million' for amounts less than £1 million.

    Write out pence in full: calls will cost 4 pence per minute from a landline.

    Currencies are lower case.

    " + } + ] + }, + { + "letter": "N", + "styles": [ + { + "title": "nBus", + "content": "

    Use when talking about network bus tickets - always use a lower case ‘n’, upper case ‘B’.

    " + }, + { + "title": "nNetwork", + "content": "

    Use when talking about network tickets for the bus, train and tram - always use a lower case ‘n’, followed by an upper case ‘N’.

    " + }, + { + "title": "nTrain", + "content": "

    Use when talking about network train tickets - always use a lower case ‘n’, upper case ‘T’.

    " + }, + { + "title": "Numbers", + "content": "

    Use 'one' unless you're talking about a step, a point in a list or another situation where using the numeral makes more sense: 'in point 1 of the design instructions', for example. Or this:

    You'll be shown 14 clips that feature everyday road scenes.

    There will be:

    1. developing hazard in 13 clips
    2. developing hazards in the other clip

    Write all other numbers in numerals (including 2 to 9) except where it's part of a common expression like 'one or two of them' where numerals would look strange.

    If a number starts a sentence, write it out in full (Thirty-four, for example) except where it starts a title or subheading.

    For numerals over 999 - insert a comma for clarity: 9,000

    Spell out common fractions like two-thirds.

    Use a % sign for percentages: 50%.

    Use a 0 where there's no digit before the decimal point.

    Use '500 to 900' and not '500-900' (except in tables and for the 16-18 photocard).

    Use MB for anything over 1MB: 4MB not 4096KB.

    Use KB for anything under 1MB: 569KB not 0.55MB.

    Keep it as accurate as possible and up to 2 decimal places: 4.03MB.

    Addresses: use 'to' in address ranges: 49 to 53 Cherry Street.

    Ordinal numbers

    Spell out first to ninth. After that use 10th, 11th and so on.

    In tables, use numerals throughout.

    " + }, + { + "title": "NXWM", + "content": "

    see operator names.

    " + } + ] + }, + { + "letter": "O", + "styles": [ + { + "title": "off-peak", + "content": "

    Use lower case and include a hyphen.

    " + }, + { + "title": "older people", + "content": "

    Refer to older people rather than elderly people.

    " + }, + { + "title": "online", + "content": "

    One word. Do not use 'on-line' or 'on line'.

    " + }, + { + "title": "operator names", + "content": "

    Do not abbreviate the name. For example, do not use ‘WM Metro’, ‘NX West Midlands’ or ‘West Mids Railway’.

    You can use an acronym for timetables and passenger information. For example, ‘West Midlands Metro (WMM)’, ‘National Express West Midlands (NXWM)’ or ‘West Midlands Railway (WMR)’.

    Do not use the NXWM acronym without explaining it first. It is not a well known acronym.

    " + }, + { + "title": "or", + "content": "

    Do not use slashes instead of \"or\". For example, do not say \"Do this 3/4 times\".

    " + }, + { + "title": "opt in/out", + "content": "

    Verb: I would like to opt in

    " + }, + { + "title": "opt-in/out", + "content": "

    Adjective: an opt-in clause

    " + } + ] + }, + { + "letter": "P", + "styles": [ + { + "title": "paper ticket", + "content": "

    A ticket that’s printed on paper, not on a Swift card.

    " + }, + { + "title": "passengers", + "content": "

    Refer to 'customers' rather than 'passengers'.

    " + }, + { + "title": "pay as you go", + "content": "

    Do not hyphenate and always use lower case.

    " + }, + { + "title": "pay as you go credit", + "content": "

    Use to describe Swift cards with a stored cash value

    Note: Do not use 'pay as you go travel value (cash)' or 'pay as you go cash value'.

    " + }, + { + "title": "PDF", + "content": "Upper case. No need to explain the acronym." + }, + { + "title": "plain English", + "content": "

    Lower case plain and upper case English unless in a title: the Plain English Campaign.

    All content should be written in plain English. You should also make sure you use language your audience will understand. Use the Plain English Campaign’s A to Z of alternative words to avoid complex language.

    " + }, + { + "title": "phone numbers", + "content": "

    Phone numbers should be split into at least three groups of digits for readability, ideally with no more than four digits in any single group. For example: 020 7378 1705; 0343 222 6666; 0762 480 4299. See also the design pattern for contact details.

    " + } + ] + }, + { + "letter": "Q", + "styles": [ + { + "title": "quotation marks", + "content": "

    Use single quotation marks in all cases.

    Use double quotation marks if using a quote within a quote.

    If a quote runs on longer than one paragraph, include quotation marks at the beginning of each subsequent paragraph but only at the end of the final paragraph.

    Place full stops and commas inside quotes when they are complete sentences, otherwise place them outside: 'I want to buy a ticket,' said Mr Smith; When he said 'I promise', he didn't really mean it.

    " + } + ] + }, + { + "letter": "R", + "styles": [ + { + "title": "real time/realtime", + "content": "

    Where possible, use 'live' instead of 'realtime' or 'real time'

    real time (noun): this information is being updated in real time.
    realtime (adjective): realtime service information.
    Not real-time.

    " + }, + { + "title": "re-open", + "content": "

    Not reopen.

    " + } + ] + }, + { + "letter": "S", + "styles": [ + { + "title": "seasons", + "content": "

    Use lower case for spring, summer, autumn and winter.

    " + }, + { + "title": "Sentence length", + "content": "

    Do not use long sentences. Check sentences with more than 25 words to see if you can split them to make them clearer.

    " + }, + { + "title": "sign in or log in", + "content": "

    Use sign in rather than log in (verb) for calls-to-action where users enter their details to access a service.

    Do not use login as a noun - say what the user actually needs to enter (like username, password, National Insurance number).

    " + }, + { + "title": "State Pension", + "content": "

    Upper case.

    " + }, + { + "title": "Station", + "content": "

    Lower case. For example, Birmingham New Street station. Do not say tram station, say tram stop.

    " + }, + { + "title": "Stop", + "content": "

    Lower case. For example, Summer Lane bus stop.

    " + }, + { + "title": "Swift card", + "content": "

    Do not capitalise 'Card'.

    " + }, + { + "title": "step-free", + "content": "

    A route between street and platform that doesn't require the use of stairs or escalators.

    " + } + ] + }, + { + "letter": "T", + "styles": [ + { + "title": "terms and conditions", + "content": "

    Not Terms and Conditions or terms & conditions.

    " + }, + { + "title": "text message alerts", + "content": "

    Not SMS alerts.

    " + }, + { + "title": "TfWM", + "content": "

    See entry on Transport for West Midlands.

    " + }, + { + "title": "Times", + "content": "

    use 'to' in time ranges, not hyphens, en rules or em dashes: 10am to 11am (not 10-11am)
    5:30pm (not 1730hrs)
    midnight (not 00:00)
    midday (not 12 noon, noon or 12pm)
    6 hours 30 minutes
    Midnight is the first minute of the day, not the last. You should consider using \"11:59pm\" to avoid confusion about a single, specific time.

    For example, \"You must register by 11:59pm on Tuesday 14 June.\" can only be read one way, but \"You must register by midnight on Tuesday 14 June\" can be read in two ways (the end of Monday 13, or end of Tuesday 14).

    Timetables and printed passenger information use the 24-hour clock in HHMM format.

    " + }, + { + "title": "tram", + "content": "

    Not Metro.

    " + }, + { + "title": "tram stop", + "content": "

    Not station.

    " + }, + { + "title": "Transport for West Midlands", + "content": "

    Avoid referring to Transport for West Midlands (TfWM). Users don't need to know about it while getting travel advice.

    Explaining the relationship between West Midlands Combined Authority, TfWM and West Midlands Combined Authority (WMCA) is complicated. Use \"we\" instead. For example, \"we manage the Key Route Network (KRN)\" with a link to the TfWM policy page.

    " + } + ] + }, + { + "letter": "U", + "styles": [ + { + "title": "under-16s", + "content": "

    Requires a hyphen in all cases. This is true whenever referring to age groups: under-16s; under-18s; over-60s.

    Avoid the common error of adding an apostrophe when making a word or abbreviation plural as this makes it possessive: under-16s not under-16's.

    " + }, + { + "title": "URL", + "content": "

    Upper case. No need to explain the acronym.

    " + }, + { + "title": "username", + "content": "

    Not \"user name\".

    " + } + ] + }, + { + "letter": "W", + "styles": [ + { + "title": "web", + "content": "

    Lower case.

    " + }, + { + "title": "webpage", + "content": "

    One word.

    " + }, + { + "title": "website", + "content": "

    Not web-site or web site.

    " + }, + { + "title": "West Midlands Combined Authority", + "content": "

    Avoid referring to West Midlands Combined Authority (WMCA). Users don't need to know about it while getting travel advice.

    The exception is if you referring to a statutory responsibility or a contract. For example, concessionary passes or terms and conditions.

    " + }, + { + "title": "wifi", + "content": "

    Lower case, no hyphen.

    " + }, + { + "title": "WMCA", + "content": "

    See entry on West Midlands Combined Authority.

    " + }, + { + "title": "wmca.org.uk", + "content": "

    If you are linking to another page, you should use an in-text link rather than the full URL. See the entry on links for more information.

    Sometimes it is better to show the full URL. For example, when telling users to click a link to verify something in an email.

    It is important to use the right URL. Only use wmca.org.uk.

    Do not prefix the URL with ‘www.’ as this makes our URL hard to read. The domain extension ‘.co.uk’ makes it obvious to users that it is a URL.

    " + }, + { + "title": "www.", + "content": "

    See entry on wmca.org.uk.

    " + } + ] + }, + { + "letter": "Z", + "styles": [ + { + "title": "zero-hours contract", + "content": "

    Not \"zero-hour contract\" or \"zero hours contract\"

    " + } + ] + } + ] +} diff --git a/src/www/pages/tfwm/styles/a-to-z-content-style-guide/index.njk b/src/www/pages/tfwm/styles/a-to-z-content-style-guide/index.njk new file mode 100644 index 00000000..d1434b5c --- /dev/null +++ b/src/www/pages/tfwm/styles/a-to-z-content-style-guide/index.njk @@ -0,0 +1,131 @@ +{% extends "www/_layouts/layout-fullwidth.njk" %} +{% set pageTitle="A to Z content style guide" %} {% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# Imports #} +{%- from "wmcads/components/content-tiles/normal/_normal.njk" import wmcadsContentTilesNormal -%} +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} +{% from "wmcads/components/inset-text/_inset-text.njk" import wmcadsInsetText %} +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} +{# Set array of tiles #} +{% block content %} + +{# About the style guide #} +
    +
    +

    Writing content for West Midlands Combined Authority

    +

    + You should create all content with user-focused content design principles. This means content has an identified + user need and is written in plain English. +

    +

    + Do not use marketing speak - users will be visiting your website to perform a task (for example, buy a train ticket or find out about Swift cards). Your content shouldn’t try to sell them anything - instead, tell them the information they need to know in the simplest way possible. +

    +

    + Research has shown that both high literacy and low literacy users prefer plain English because it takes less time to read. Users won’t be on your website for fun - so make the experience quick and easy. +

    +

    + To find out more about why plain language is important, read: +

    +

    +

    + Read the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/content-design/what-is-content-design', + linkTitle: 'GOV.UK introduction to content design', + contentText: 'GOV.UK introduction to content design' + }) + }} + to find out more about content design principles. +

    +

    Design Team can help you to test your content with user research.

    +
    +

    About the A-Z of style guide

    +

    This style guide will help you to use consistent words across West Midlands Combined Authority services.

    +

    + If something is not covered by this style guide, check the + {{ + wmcadsLink({ + link: 'https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style', + linkTitle: 'GOV.UK Style Guide', + contentText: 'GOV.UK style guide' + }) + }} + . You can also email Samresha Purewal if you think something is missing from this guidance.

    +
    +

    Introducing West Midlands Combined Authority

    +

    If you’re talking about day-to-day services (bus, train or tram), you + may need to make it clear that West Midlands Combined Authority does not run these.

    For example, you could say: "We don’t run the buses, trains or trams. We can point you in the right direction if you need help." +

    +
    +
    + {# A to Z accordions #} +
    +
    +

    A to Z of style

    +
    +
    + + +
    +
    +
    + {% for section in aToZOfStyles %} +
    + +
    + {% for style in section.styles %} +
    + {{style.title}} +
    + {{style.content | safe}} + {% endfor %} +
    +
    + {% endfor %} +
    +
    +
    +
    +{% endblock %} diff --git a/src/www/pages/tfwm/styles/colour-palettes/_color-palettes.js b/src/www/pages/tfwm/styles/colour-palettes/_color-palettes.js new file mode 100644 index 00000000..f7e01e7d --- /dev/null +++ b/src/www/pages/tfwm/styles/colour-palettes/_color-palettes.js @@ -0,0 +1,22 @@ +function colorPalettes() { + const colors = document.querySelectorAll('.ds-website-color-swatch__inner'); + + // Function to convert rgb to hex + function rgb2hex(rgb) { + const newRGB = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); + function hex(x) { + return `0${parseInt(x, 10).toString(16)}`.slice(-2); + } + return `#${hex(newRGB[1])}${hex(newRGB[2])}${hex(newRGB[3])}`; + } + + colors.forEach(swatch => { + const ele = swatch; + const rgbColor = getComputedStyle(swatch).backgroundColor; + const hexColor = rgb2hex(rgbColor); + + ele.nextElementSibling.querySelector('pre code .color-hex').innerText = `color: '${hexColor}'`; + }); +} + +export default colorPalettes; diff --git a/src/www/pages/tfwm/styles/colour-palettes/_colorPalette.scss b/src/www/pages/tfwm/styles/colour-palettes/_colorPalette.scss new file mode 100644 index 00000000..1b04dd76 --- /dev/null +++ b/src/www/pages/tfwm/styles/colour-palettes/_colorPalette.scss @@ -0,0 +1,18 @@ +$cp-swatch-height: 50px; + +.ds-website-color-swatch { + padding: $size-sm; + + &__inner { + display: inline-block; + width: 100%; + height: $cp-swatch-height; + margin-bottom: $size-sm; + } +} + +@each $color, $hex in $palettes { + .ds-website-bg-color-#{$color} { + background-color: $hex; + } +} diff --git a/src/www/pages/tfwm/styles/colour-palettes/index.njk b/src/www/pages/tfwm/styles/colour-palettes/index.njk new file mode 100644 index 00000000..bce499ac --- /dev/null +++ b/src/www/pages/tfwm/styles/colour-palettes/index.njk @@ -0,0 +1,78 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle="Colour Palettes" %} +{% set section="Styles" %} +{% set ds = 'wmca' %} + +{% from "www/_partials/_color-palette-macro.njk" import colorPalette %} + +{% block content %} +{# About #} +

    About

    +

    Below are the list of West Midlands Combined Authority colour palettes.

    +

    + We have tested our colours against the three most prevalent colour blind anomalies: protanopia, deuteranopia and tritanopia. While in some circumstances, particularly protanopia, colours can appear to be relatively similar. +

    +

    + These issues can be circumvented by not referring to specific colours. For instance, when referring to a green button with the word 'start' in, the phrase 'click the green button to start' would not be helpful. Instead, use 'click the start button', without a colour reference. +

    +

    + W3C AA Accessibility criteria requires the contrast of test to be enhanced, with a contrast ratio upwards of 3:1. +

    +

    + All brand/web colours meet this criteria, though the modal colour 'WM Railway' must only be used for iconography and graphical devices. +

    +

    The background only colours can only be used as a background colour and they are not intended for any other use.

    +
    + +{# Using in development #} +

    Using in development

    +

    wmcads SCSS

    +

    If you are using WMCA Design System's SCSS in development, you shouldn't use the HEX values! Instead you should always use the scss variables instead, for example use get-color(primary) instead of #3c1053. This ensures you are always using the most up-to-date colour. To find out more on how to use the get-color() function in SCSS, please refer to the notes for @function get-color() in _mixins.scss.

    + +

    Without wmcads SCSS

    +

    If you are not using WMCA Design System's SCSS then it is recommended to use the hex values below. It is highly adviseable to set these up as variables in your development enviornment, this ensures that you can easily change them to keep up-to-date with our colour palettes.

    +

    If you'd like to see how we have set the variables up, you can check out $palettes in _vars.scss and @function get-color() in _mixins.scss.

    + +{# Brand colours #} +
    +

    Brand colours

    +
    + {% for color in colors.brand %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
    + +{# Web colours #} +
    +

    Web colours

    +
    + {% for color in colors.web %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
    + +{# Background Only colours #} +
    +

    Background only colours

    +
    + {% for color in colors.backgroundOnly %} + {{ + colorPalette({ + varName: color.varName, + name: color.name + }) + }} + {% endfor %} +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/styles/examples/grid-column-spacing.njk b/src/www/pages/tfwm/styles/examples/grid-column-spacing.njk new file mode 100644 index 00000000..9edbe46e --- /dev/null +++ b/src/www/pages/tfwm/styles/examples/grid-column-spacing.njk @@ -0,0 +1,210 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid column spacing" %} +{% set section = "Styles" %} + +{% block content %} +

    Introduction to wmcads Grid column spacing

    +

    + Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

    +

    + The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

    +

    + Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

    +

    + Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

    +

    + Where {breakpoint} is one of breakpoint sizes described in the grid section. +

    + +

    When to use Grid column spacing

    + + +

    Examples

    + +

    Example 1

    +

    This example shows the use of the ds-content-card component displayed in a grid of thirds with spacing of 1rem.

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    +
    + content image +
    +

    Contact us

    +

    Get in touch if you want to know more about the budget.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    +
    + content image +
    +

    Contact us

    +

    Get in touch if you want to know more about the budget.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    Example 2

    +

    This example shows the use of the ds-content-card component displayed in a half grid with spacing of 2rem.

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    Example 3

    +

    This example shows the use of the ds-content-card component displayed in a half grid with spacing controlled by breakpoints.

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +

    The default spacing is 0.75rem (ds-grid--spacing-2-sm). Once the page width goes over 768px the spacing changes to 1rem (ds-grid--spacing-md-2-md).

    + + + + + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/styles/examples/grid-examples.njk b/src/www/pages/tfwm/styles/examples/grid-examples.njk new file mode 100644 index 00000000..52ec7236 --- /dev/null +++ b/src/www/pages/tfwm/styles/examples/grid-examples.njk @@ -0,0 +1,335 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Grid Examples" %} +{% set section = "Styles" %} +{% from "www/_partials/component-example/component-example.njk" import compExample %} + +{% block content %} +

    Introduction to wmcads Grids

    +

    Grid classes vs. unit classes

    +

    wmcads Grids consist of two types of classes: the grid class (ds-grid) and unit classes (ds-col-*)

    +

    The widths of the units are fractions

    +

    Units have various class names that represent their widths. For example, ds-u-1-2 has a width of 50%, whereas ds-u-1-5 would have a width of 20%.

    +

    All child elements of a grid must be units

    +

    Child elements contained within an element with a ds-grid classname must be a grid unit with a ds-col-* classname.

    +

    Content goes inside grid units

    +

    All content which is visible to people needs to be contained inside a grid unit. This ensures that the content will be rendered properly.

    + +

    Examples

    +

    Let's start with a simple example. Here's a grid with three columns:

    + +
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + {%- endfilter %} +
    +
    + +

    The above example will keep the columns the same width no matter the page width.

    + +

    Adding responsive classes

    +

    We can control the width by adding responsive classes.

    + +

    When using Responsive Grids, you can control how the grid behaves at specific breakpoints by adding class names. wmcads default responsive grids comes with the following class names and media query breakpoints.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Default Media Queries
    KeyCSS Media QueryAppliesClassname
    NoneNoneAlways.ds-col-*
    sm@media screen and (min-width: 35.5em)≥ 568px.ds-col-sm-*
    md@media screen and (min-width: 48em)≥ 768px.ds-col-md-*
    lg@media screen and (min-width: 64em)≥ 1024px.ds-col-lg-*
    xl@media screen and (min-width: 80em)≥ 1280px.ds-col-xl-*
    + +

    Let's modify the example so the columns become full width on mobile:

    + +
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +

    Thirds

    +

    Thirds

    +

    Thirds

    +
    + {%- endfilter %} +
    +
    + +

    The above example has a default width of 1 (ds-col-1) so when the page is viewed below 586px the columns will display full width. When the page is viewed over 586px the columns will appear in 3 coloumns (ds-col-sm-1-3). + + +

    Justify Content

    + +

    You can justify the grid content bby adding these classes:

    + +

    ds-grid--justify-between

    +

    Items will have space between them

    + +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-around

    +

    Items will have space before, between, and after them

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-end

    +

    Items are positioned at the end of the container

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-center

    +

    Items are positioned in the center of the container

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +
    +

    ds-grid--justify-even

    +

    Items will have equal space around them

    +
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + +
    +  
    +  {%- filter forceescape %}
    +  
    +
    +
    + content image +
    +

    Who weve funded

    +

    See which councils and providers weve funded, and what for.

    +
    +
    +
    +
    +
    + content image +
    +

    Find training schemes

    +

    You can find training and education providers weve funded online.

    +
    +
    +
    +
    + {%- endfilter %} +
    +
    + +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/styles/icons/_icons.scss b/src/www/pages/tfwm/styles/icons/_icons.scss new file mode 100644 index 00000000..d03435ca --- /dev/null +++ b/src/www/pages/tfwm/styles/icons/_icons.scss @@ -0,0 +1,12 @@ +.website-icons { + svg { + width: 60px; + height: 60px; + padding: $size-sm; + fill: get-color(primary); + } + + .text-center { + text-align: center; + } +} diff --git a/src/www/pages/tfwm/styles/icons/index.njk b/src/www/pages/tfwm/styles/icons/index.njk new file mode 100644 index 00000000..76c42c7f --- /dev/null +++ b/src/www/pages/tfwm/styles/icons/index.njk @@ -0,0 +1,188 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Icons" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# The icon vars are an array that match the folders they come from in src/assets/icon/{foldername} #} +{% set iconGeneral = [ + "arrow", + "caret-down", + "caret-up", + "checkmark", + "chevron-right", + "circle-hollow", + "circle-solid", + "cross", + "expand", + "favourite", + "file", + "filter", + "id-card", + "info", + "location-arrow", + "minimise", + "paperclip", + "pdf", + "html", + "search", + "success", + "swap", + "trash", + "warning-circle", + "warning-triangle" +] %} + +{% set iconSocial = [ + "facebook", + "facebook-hex", + "twitter", + "twitter-hex", + "instagram", + "instagram-hex", + "linkedin", + "linkedin-hex", + "youtube", + "youtube-hex", + "email" +] %} + +{% set iconPortfolio = [ + "culture-and-digital", + "economy", + "environment", + "housing-and-land", + "inclusive-communities", + "skills", + "transport", + "wellbeing" +] %} + + +{% from "wmcads/components/icon/_icon.njk" import wmcadsIcon %} + +{% block content %} +{# How to use #} +

    About

    + +

    What does it do?

    + +

    When to use it?

    + +

    When not to use it?

    + +
    + +{# Using Icons #} +

    Using icons

    +

    WMCA Design System icons are available as an SVG sprite to include in your HTML page.

    +

    How to use

    +

    Recommended

    +

    The Recommended method of using the icon sprite sheet is to refer directly to the one used in the design system. This ensures that your icons will always be up to date.

    +

    To get started, include the below snippet of javascript somewhere in your codebase. This will:

    + +
    +  
    +  {%- filter forceescape -%}
    +  
    +  
    +  {%- endfilter %}
    +  
    +
    + +

    Displaying an icon

    +

    To display an icon or glyph, use an icon tag (from the icon section at the bottom of the page) with a href attribute and xlink:href (as a fallback). Make sure that the xlink and href tags are pointing to the location of your downloaded icon sprite sheet.

    +

    The ICON-TAG-NAME should be replaced with the icon tag name of the icon you want to show from the Icons section below, for example #ds-general-arrow should be in the xlink:href and href attributes of the svg's <use> element.

    +
    +  
    +    {{-
    +      wmcadsIcon({
    +        icon: 'ICON-TAG-NAME'
    +      }) | forceescape | trim
    +    -}}
    +  
    +
    + + +

    Can't include via recommended method? Try hosting the sprites locally

    + + +
    + +{# Icons #} +

    Icons

    +

    Find below a list of all our icons and their tags below. To use, don't forget to prefix the tag with 'ds-'

    +

    General

    +
    + {% for icon in iconGeneral %} +
    + {{ + wmcadsIcon({ + icon: 'general-' + icon + }) + }} +

    {{ 'general-' + icon }}

    +
    + {% endfor %} +
    + +{# Portfolios #} +

    Portfolios

    +
    + {% for icon in iconPortfolio %} +
    + {{ + wmcadsIcon({ + icon: 'portfolio-' + icon + }) + }} +

    {{ 'portfolio-' + icon }}

    +
    + {% endfor %} +
    + +{# Social #} +

    Social

    +
    + {% for icon in iconSocial %} +
    + {{ + wmcadsIcon({ + icon: 'social-' + icon + }) + }} +

    {{ 'social-' + icon }}

    +
    + {% endfor %} +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/styles/images/index.njk b/src/www/pages/tfwm/styles/images/index.njk new file mode 100644 index 00000000..e9dea0aa --- /dev/null +++ b/src/www/pages/tfwm/styles/images/index.njk @@ -0,0 +1,29 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Images" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# About #} +

    About

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +

    For more guidance on how to use images, please check WMCA brand guidelines.

    + +{% endblock %} diff --git a/src/www/pages/tfwm/styles/index.njk b/src/www/pages/tfwm/styles/index.njk new file mode 100644 index 00000000..9bf90c6a --- /dev/null +++ b/src/www/pages/tfwm/styles/index.njk @@ -0,0 +1,15 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Styles" %} +{% set section = "Styles" %} +{% set ds = 'tfwm' %} + +{% block content %} +

    Make your service look and feel like WMCA Design System.

    +

    If you are using the WMCA Design System Prototype Kit or have WMCA Design System Frontend included in your build, the + coded examples in the + Design System will not need any additional styling.

    +

    If you need to apply styles manually, you should still follow existing WMCA Design System conventions. For + example, do not assign + new meanings to colours, do not change the style of buttons or adjust the thickness of borders on + form inputs.

    +{% endblock %} \ No newline at end of file diff --git a/src/www/pages/tfwm/styles/layout/index.njk b/src/www/pages/tfwm/styles/layout/index.njk new file mode 100644 index 00000000..219dae2d --- /dev/null +++ b/src/www/pages/tfwm/styles/layout/index.njk @@ -0,0 +1,84 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Layout" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# Standard content template #} +

    Standard content template

    +{# What #} +

    What does it do?

    + +{# When #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# Guidance #} +

    Guidance for content editors

    + +

    Warning text with exclamation mark icon component: Please read the Creating effective content section below before writing content or placing content into your page.

    + + +
    +{# Publicity campaign template #} +

    Publicity campaign template

    +{# What #} +

    What does it do?

    + +{# When to #} +

    When to use it?

    + +{# When not to #} +

    When not to use it?

    + +{# Guidance #} +

    Guidance for content editors

    + + + +
    +{# Creating effective content #} +

    Creating effective content

    +

    There is no minimum or maximum page length, however:

    + +

    Use clear and concise content because the longer text, the lower rate of readability and comprehension drops significantly.

    +

    Always place content with higher importance at the top of the page, with less important content following after.

    +

    If you have to use long content, break it down into smaller sections to make it easier for user to understand information. You can:

    + + +{% endblock %} diff --git a/src/www/pages/tfwm/styles/maps/index.njk b/src/www/pages/tfwm/styles/maps/index.njk new file mode 100644 index 00000000..cc521ac9 --- /dev/null +++ b/src/www/pages/tfwm/styles/maps/index.njk @@ -0,0 +1,177 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Maps" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{# Imports #} +{%- from "wmcads/components/link/link/_link.njk" import wmcadsLink -%} + +{% block content %} +{# ESRI ArcGIS #} +

    ESRI ArcGIS

    + +{# About #} +

    About

    +

    + When it comes to mapping, West Midlands Combined Authority uses + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/labs/what-is-arcgis/", + linkTitle: "ESRI ArcGIS products", + linkTarget: "_blank", + contentText: "ESRI ArcGIS products" + }) + }} + to create, manage and share data on maps. Therefore, when developing maps use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. +

    + +{# Basemap #} +

    Basemap

    + + A screenshot showing an example of a map + +

    + When creating a map use the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as your basemap layer. This is to ensure maps are consistent across West Midlands Combined Authority services. +

    +

    The WMCA Basemap is a portal item, you can use the +{{ + wmcadsLink({ + link: "https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html", + linkTitle: "ArcGIS Basemap documentation", + linkTarget: "_blank", + contentText: "ArcGIS Basemap documentation" + }) + }} with the WMCA Basemap ID to include the basemap in your application. +

    + +{# Example of code #} +

    Example of the ESRI ArcGIS JavaScript API

    +
    +  
    +    // ESRI ArcGIS JS code...
    +    const basemap = new Basemap({
    +      baseLayers: [
    +        new VectorTileLayer({
    +          portalItem: {
    +            // set the baselayer to WMCA Basemap:
    +            // https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e
    +            id: '53f165a8863c4d40ba017042e248355e',
    +          },
    +        }),
    +      ],
    +    });
    +
    +    // Create a new map with the basemap set above
    +    const map = new Map({
    +      basemap,
    +    });
    +  
    +
    + +{# Can't use Esri ArcGIS #} +

    Can't use ESRI ArcGIS?

    +

    + We understand that you may not always be able to use + {{ + wmcadsLink({ + link: "https://developers.arcgis.com/documentation/core-concepts/apis-sdks-apps/#choosing-an-arcgis-api-or-sdk", + linkTitle: "ArcGIS APIs and SDKs", + linkTarget: "_blank", + contentText: "ArcGIS APIs and SDKs" + }) + }}. + In these situations, style your map as closely to the + {{ + wmcadsLink({ + link: "https://tfwm.maps.arcgis.com/home/item.html?id=53f165a8863c4d40ba017042e248355e", + linkTitle: "WMCA Basemap", + linkTarget: "_blank", + contentText: "WMCA Basemap" + }) + }} as possible. +

    +


    + + +{# User interface #} +

    User interface

    +

    + User interface elements on a map such as zoom, pan and location buttons follow particular pattern rules when being used. +

    +

    These pattern rules are:

    + + + + +{% endblock %} diff --git a/src/www/pages/tfwm/styles/typography/index.njk b/src/www/pages/tfwm/styles/typography/index.njk new file mode 100644 index 00000000..ca9dff7e --- /dev/null +++ b/src/www/pages/tfwm/styles/typography/index.njk @@ -0,0 +1,75 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Typography" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% block content %} +{# About #} +

    About

    +

    + We have tested our typography with users, including those with dyslexia and those with low vision. The questionnaire presented respondents with two body fonts, set out in different sizes, line spacing and kerning. The options were shown randomly for each participant.

    +

    + Our findings were as such: +

    +

    +

    + As a public sector organisation, in addition to testing the above we are required to meet WCAG 2.1 guidelines at AA standard. + Therefore, features will be useable when text size is increased up to 200% and content reflowed for 400%. +

    +
    +{# Fonts #} +

    Fonts

    +

    + We utilise Google Fonts in our typography and all fonts used are pre-bundled in our design system CSS, so you won't need to include them seperately. +

    +

    + Find below, various examples of our typography in use. +

    + +{# DM Sans / Headings #} +

    DM Sans / headings

    +

    + The font DM Sans is used with font weight of 700 (bold) for heading elements only.
    + DM Sans font reference +

    +

    Things to note:

    + +
    +

    46px - Heading 1

    +

    32px - Heading 2

    +

    23px - Heading 3

    +

    18px - Heading 4

    +
    + +{# Noto sans / body copy #} +

    Noto Sans / body copy

    +

    + The font Noto Sans is used with the font weight of 400 (regular) and 700 (bold) for all elements other than headings. The default font size used is 16px.
    + Noto Sans font reference +

    +
    +

    Characters

    + Font size: 16px / 1rem

    + A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    + a b c d e f g h i j k l m n o p q r s t u v w x y z
    + 1 2 3 4 5 6 7 8 9 0
    + {% filter escape %} + ‘ ? ’ “ ! ” (%) [#] {@} / & \ < - + ÷ × = > ® © $ € £ ¥ ¢ : ; , . * + {% endfilter %} +
    +

    Styles

    + 400 - Regular
    + 400 - Regular italic
    + 700 - Bold
    + 700 - Bold italic +
    + +{% endblock %} diff --git a/src/www/pages/tfwm/styles/utility-classes/index.njk b/src/www/pages/tfwm/styles/utility-classes/index.njk new file mode 100644 index 00000000..ffe19480 --- /dev/null +++ b/src/www/pages/tfwm/styles/utility-classes/index.njk @@ -0,0 +1,276 @@ +{% extends "www/_layouts/layout-left-pane.njk" %} +{% set pageTitle = "Utility classes" %} +{% set section = "Styles" %} +{% set ds = 'wmca' %} + +{% from "wmcads/components/link/link/_link.njk" import wmcadsLink %} + +{% block content %} +{# About #} +

    About

    +

    + There are a variety of utility classes that can be used with the existing components and styles on. +

    + + +
    +{# Containers #} +

    Containers

    +

    + Containers are used to wrap content in a 'container'. The container will have a fixed max size and be centered on the page, it will adjust to 100% width when the page width is less than the container size. +

    + +
    +  
    +    .ds-container /* Container with max-width of 1280px */
    +
    +    /* This should be used on your main content section and will
    +    add a margin top to seperate from header/breadcrumb section */
    +    .ds-container.ds-container--main
    +  
    +
    + + +
    +{# Grid #} +

    Grid

    +

    + The WMCA Design System uses its own custom syntax grid system adopted from Pure CSS Grid. The grid system is already included in the bundled ds-components.min.css file so you don't need to include it seperately. +

    + +

    + You can Refer to the Pure CSS Grid documentation for reference on how to use our grid system, but bear in mind that: +

    + + + +

    You can also use modifier classes on the same element where the class .ds-grid is being used.

    +
    +  
    +    .ds-grid--justify-between
    +    .ds-grid--justify-around
    +    .ds-grid--justify-end
    +    .ds-grid--justify-center
    +  
    +
    + +{{ + wmcadsLink( { + link: "/styles/examples/grid-examples.html", + contentText: "Grid examples" + } + ) +}} + +

    Information for designers

    +

    + The grid is part of the Design System Sketch library or as a standalone template file. +

    +

    Screen sizes

    +

    +

    +

    +

    Sketch grid sizes

    +

    +

    +

    + +
    +{# Floats #} +

    Floats

    +

    + Floats an element in the intended direction. +

    + +
    +  
    +    .ds-float-left
    +    .ds-float-right
    +  
    +
    + + +
    +{# Text Align #} +

    Text Align

    +

    + Aligns text in the intended direction. +

    + +
    +  
    +    .ds-text-align-left
    +    .ds-text-align-center
    +    .ds-text-align-right
    +  
    +
    + + +
    +{# Show or hide on devices #} +

    Show or hide on devices

    +

    + When you want to hide an element based on if the device width is a desktop or mobile device. +

    + +
    +  
    +    .ds-hide-mobile /* Hide only on mobile devices or smaller (less than 48em)  */
    +    .ds-hide-desktop /* Hide only on desktop devices or larger (greater than 48em) */
    +    .ds-hide /* Hide on all devices */
    +  
    +
    + +
    +

    Spacing

    +

    + The spacing utility classes are used to adjust whitespace for an element via padding and margins. +

    +

    Before using the spacing utility classes, please consider:

    + + +

    + The classes are named using the format .ds-{type}-{side}-{size}. +

    +{# type #} +

    + Where {type} is one of: +

    + +{# side #} +

    + Where {side} is one of: +

    + +{# size #} +

    +Where {size} is one of: +

    + + +

    Some examples of using these utility classes...

    +
    +  
    +    .ds-m-xs // applies a margin of 0.25rem to all sides
    +    .ds-p-b-lg // applies a padding-bottom of 2rem
    +    .ds-m-l-none // sets left margin to 0
    +  
    +
    + +{# Grid columns spacing #} +

    Grid column spacing

    + +

    + Spacing can be applied in between .ds-col-* elements by adding a class to the parent .ds-grid. +

    +

    + The classes are named using the format .ds-grid--spacing-{col-count}-{size}. +

    +

    + Where {col-count} is the number of columns per row and {size} is the same as in the spacing utility classes above. +

    +

    + Spacing can also be applied responsively using the format .ds-grid--spacing-{breakpoint}-{col-count}-{size}. +

    +

    + Where {breakpoint} is one of breakpoint sizes described in the grid section. +

    + +

    Some examples of using these utility classes...

    +
    +  
    +    .ds-grid--spacing-2-md // applies a 1rem spacing between 2 columns
    +    .ds-grid--spacing-lg-4-lg // applies a 2rem spacing between 4 columns above a screen width of 1024px
    +  
    +
    + +{{ + wmcadsLink( { + link: "/styles/examples/grid-column-spacing.html", + contentText: "Grid column spacing examples" + } + ) +}} +

    + +
    +{# Background #} +

    Background Colour

    +

    + Changes background to the intended colour. +

    + +
    +  
    +    .bg-default
    +    .bg-white
    +    .bg-disabled-elements
    +    .bg-transparent
    +  
    +
    + +{% endblock %}