Commit Graph

1123 Commits

Author SHA1 Message Date
Tom Byers
1941151513 Merge pull request #3715 from alphagov/add-govuk-radios
Add GOVUK radios [part 1]
2020-11-18 11:38:25 +00:00
Tom Byers
ad3ff9e539 Merge pull request #3713 from alphagov/fix-fix-for-template-list-focus-styles
Fix how template list item focus extends
2020-11-17 11:23:43 +00:00
Tom Byers
070ed818cf Add HTML and CSS for extended GSM characters
Based on feedback from this pull request:

https://github.com/alphagov/notifications-admin/pull/3711
2020-11-13 22:40:32 +00:00
Tom Byers
48499f0c00 Bring in Jinja and Sass for radios component 2020-11-11 10:21:32 +00:00
Tom Byers
44402e0949 Fix how template list item focus extends
We use a hack to extend the focus style of single
links in template list items (those not part of a
path of links).

This extended the 'focus box' downwards so it
covered the hint text below the link by the height
of the link (which is block-level).

Problems happen if the link wraps to multiple
lines. The hint is always on one line so the focus
looks over-extended.

These changes guard against those problems by
using the line-height instead of the block-height.
They include adding a Sass function to reference
the line-heights in GOVUK Frontend's Sass API:

https://frontend.design-system.service.gov.uk/sass-api-reference/#govuk-typography-scale
2020-11-06 15:25:47 +00:00
Tom Byers
36708ccad0 Merge pull request #3700 from alphagov/fix-template-list-item-focus-style
Fix template list item focus style
2020-10-30 15:58:35 +00:00
Tom Byers
cad8953e25 Fix indent for folder items without ancestors
These make space for the folder icon using
padding-left when they have ancestors as they are
inline so it only effects the line the first link
is on. Without ancestors they are block-level so
padding-left pads the whole block.

We had a block of CSS that fixed this, by using
text-indent for those without ancestors but the
selector was broken by changes to the HTML (it was
no longer the :first-child).

This uses the :first-of-type pseudo-class instead
to ignore preceding elements of different types.

Also includes changes that move styles for links
out from under elements with a class of
.message-name, which was removed in the previous
commit.
2020-10-30 13:44:02 +00:00
Tom Byers
2d5a165a2d Swap headings for list items in template list
I'm mainly making this change because it's useful
for the CSS that styles the hint text when the
link is focused for the link to have no parent
container.

That being said, there isn't really enough content
underneath these headings to justify them as it is.
I've wrapped them in a list instead because:
- they're structured like a list
- we already called them a `template-list`

This commit also replaces the `message-type` class
on the paragraph below where the headings went,
for consistency. It also removes the CSS for that
class as I couldn't find anywhere else that used
it now.
2020-10-27 21:31:08 +00:00
Tom Byers
0aa1dd89e9 Make hint text focus colour match link 2020-10-27 17:15:58 +00:00
Tom Byers
43d7d0a034 Fix hint text colour contrast when focused
Uses a colour that will be added to the core
palette in GOVUK Frontend.

See: https://design-system.service.gov.uk/styles/colour/#main-colours
2020-10-27 15:55:57 +00:00
Tom Byers
744d76e8d9 Replace old focus CSS for message-name/-type
Template list items without checkboxes use the
`.message-name` and `.message-type` classes for
their links and hints.

This means styles used to expand the focus area
previously are clashing with the new approach.

This removes the old ones and gives
`.message-type` paragraphs a non-static position
to give them a z-position and so raise them above
the expanded link area.
2020-10-27 15:55:57 +00:00
Tom Byers
5058727587 Tweak template-list items on mobile
The font-size goes down to 16px on mobile. This
changes the line-height too which makes it too
small. This bumps it back up the be the same as on
desktop which makes space for the icon (if a
folder) and gives the link more space.

Also reduces the horizontal space between the icon
and its link by the same amount the font-size
changes.
2020-10-27 15:55:57 +00:00
Tom Byers
3263706fcd Reset click size of template list link
Was previously larger for links at the root level
but this was lost when the HTML for these items
was changed.

See
https://github.com/alphagov/notifications-admin/pull/2750
for details on the previous style.
2020-10-27 15:55:57 +00:00
Chris Hill-Scott
cc04a924d0 Make list of areas on dashboard use full width
When the list of areas is restricted to half the width of the page it
starts to look pretty higgledy-piggledy when you have lots of areas or
areas with very long names.

To do this I’ve ripped out the table markup in favour of headings,
paragraphs and lists. Probably pros and cons for each, but it was really
hard to do the layout with the content in a table.
2020-10-27 15:19:10 +00:00
Chris Hill-Scott
91e74929eb Use live indicator on individual broadcast page
So the view of an individual broadcast feel consistent when coming from
the dashboard.
2020-10-19 14:29:09 +01:00
Chris Hill-Scott
8ff9ec6d97 Replace generated content with proper heading
Brings in https://github.com/alphagov/notifications-utils/pull/797 but
adapts the CSS so nothing changes visually
2020-10-12 15:55:30 +01:00
Chris Hill-Scott
3f338d45ca Rename CSS classes for consistency
This prefixes everything to do with areas/the map with `area-list`, so
from looking at one element you know which `.scss` file will contain the
relevant code.
2020-10-12 15:53:09 +01:00
Chris Hill-Scott
d3a599a3d5 Adjust spacing and border on details map
We hide the map inside a details element.

Because the map has such a strong shape I don’t think it needs the grey
border to contain it. This commit removes the border, and adjusts the
spacing to group things by proximity alone.

By removing the border and associated gutter we can give more space to
the map, and make the page look less busy.
2020-10-12 15:53:09 +01:00
Chris Hill-Scott
d7d113090c Restyle the broadcast message preview
The preview of the broadcast message, with the 2px thick black lines no
longer matched the style of the area labels, which have moved to just
having a tinted background.

This commit restyles the broadcast message preview (including the
exclamation mark icon) to use shading only to differentiate the message
from the rest of the page.

This should make the page fit together more cohesively, and feel less
busy.
2020-10-12 15:53:09 +01:00
Chris Hill-Scott
3c7364408b Make selected areas more tag-like
I’ve never liked the style of the selected areas on the preview of a
broadcast message. They were a compromise, taking what’s on the map page
and giving it a shaded background so it looks less like a text box.

The trouble is all these stroked elements jumbled together made the page
look very busy. I think it can be a bit calmer if they look more like
the ‘tag’ component[1] from the Design System, which only uses shading.

Going for black text not blue, because it’s one less piece of visual
differentiation – again, trying to keep the busyness level down.

1. https://design-system.service.gov.uk/components/tag/
2020-10-12 15:53:09 +01:00
Tom Byers
e848db0d04 Merge pull request #3673 from alphagov/remove-page-title-hack-from-autofocus
Don't prefix with the page title when focusing on load
2020-10-09 13:42:26 +01:00
Tom Byers
fafe58a79b Merge pull request #3664 from alphagov/fix-template-controls-for-screenreaders
Fix template controls for screenreaders
2020-10-06 14:02:27 +01:00
Tom Byers
90504d9b6c Don't prefix with the page title on focus
Doing this was helpful to Voiceover users as its
announcement of the label meant the page title
(normally announced onload) wasn't skipped.

This isn't the case with JAWS so, prefixing the
title makes it announce it twice.

JAWS has a lot more users and the title being
announced twice is more confusing than not at all
so this removes it.
2020-10-06 11:58:59 +01:00
Tom Byers
678934cf49 Fix copy-to-clipboard button CSS
In a lot of browsers, the static position is 0px
anyway so there's no problem.

In IE11, the button sits to the left of the
paragraph above by default. Setting it in the CSS
fixes the issue.
2020-10-02 17:22:45 +01:00
Tom Byers
87dcea779e Make footer popup forms groups & add labelling
The existing behaviour focused the form control
for each popup (radios or textbox) when opened.

This gives no indication the submit button or
cancel link have been added to the page.

These changes:
- make the parent element a region to group all
  the new content
- label the region to link it to the button that
  opened it
- add a description to the region so users know
  how to use it and that all the controls have
  been added to the page
2020-10-02 15:08:09 +01:00
Tom Byers
2693e5e2b6 Replace use of Array.from
Array.from isn't supported by any version of IE.

We still need to convert a nodelist to an array so
we can either:
1. include the polyfill for Array.from from core-js
2. use [].slice

We don't use Array.from anywhere else so this uses
the second one.
2020-10-02 14:30:10 +01:00
Tom Byers
5819b5da2d Change context for cancel link
Every other control refers to the group name so
the cancel link should too.
2020-10-01 13:30:44 +01:00
Tom Byers
099b42b31e Make all control buttons aria-expanded=false
Suggested by the Digital Accessibility Centre in
their report. Giving these buttons
aria-expanded=false indicates:
- they control a section on the page
- that section is collapsed (and so clicking the
  button will open it)
2020-10-01 11:51:50 +01:00
Pea M. Tyczynska
f4f2e5d13a Merge pull request #3622 from alphagov/searchbox-make-autofocus-optional
Autofocus off by default on live-search
2020-09-29 10:58:00 +01:00
Tom Byers
2639406ae2 Simulate page load announcement in autofocus JS
Screenreaders announce the title of the page when
it loads and their users are used to it signifying
a new page.

By focusing a form control when the page loads,
this announcement is replaced with that of the
control label.

This commit prefixes the label with the page title so it
gets announced when the page loads, notifying
screenreader users that they are on a new page.

The page title prefix is removed once focus shifts
from the form control as its presence in any
further announcements could be confusing.
2020-09-29 10:47:13 +01:00
Chris Hill-Scott
67bdd27dd0 Tweak position of key icons to align with text 2020-09-25 09:49:27 +01:00
Chris Hill-Scott
19730dad6e Rotate the map key icons
We’ve had some feedback that the map key icons look a bit like
checkboxes, and that this might have confused a user during the
research.

So we need a way of making them look different to checkboxes. We don’t
want to change the border thickness because it matches what’s on the
map. A different approach is changing the shape.

Shapes that might still be confusing:
- circles (look like radio buttons)
- triangles (look like a warning)

So this commit changes the shape to a diamond, which is easy to acheive
by rotating the square 45 degrees.
2020-09-24 16:15:31 +01:00
Chris Hill-Scott
f79a5ca020 Style ‘likely’ area with a dashed line
We’ve had some feedback that relying only on luminosity and position to
differentiate between the ‘will get alert’ and ‘likely to get alert’
areas on the map might not be enough.

We don’t want to introduce another colour because:
- it will make the map look very busy
- not many other colours contrast with the map tiles as well as blue
- relying on colour only to communicate information is also bad for
  accessibility

Instead we can make one of the lines a different style. I’ve gone for
dashed on the ‘likely’ line because it looks nice, and gives some
suggestion of a porous boundary.

Implementing this means using CSS border image, because a `dashed`
border (which we still have as a fallback) doesn’t render with
consistent dash sizes from browser to browser. We need consistency to
match the dashes that the map will be drawing (which use SVG not CSS
so don’t have the same problem).
2020-09-24 16:15:31 +01:00
Chris Hill-Scott
4f0347b26d Merge pull request #3646 from alphagov/remove-yellow
Replace uses of $yellow for focus
2020-09-23 16:32:14 +01:00
Chris Hill-Scott
cc456fa718 Merge pull request #3642 from alphagov/live-broadcast-tag
Show an indication that a broadcast service is live
2020-09-23 15:32:33 +01:00
Chris Hill-Scott
36dd974b7e Merge pull request #3647 from alphagov/local-colour
Don’t use $yellow to indicate local environment
2020-09-23 15:32:25 +01:00
Chris Hill-Scott
c8f0664bf7 Show an indication that a broadcast service is live
We want it to be very clear whether you’re in live or training mode
because:
- you may be switching back and forth between them
- doing something in live mode when you think you’re in training mode
  would have… consequences

By adding a label next to the service name you’ll will have some
indication, on every page, which mode you are in.

Style of the label is based on the ‘Tag’ component from the Design
System:
https://design-system.service.gov.uk/components/tag/#showing-multiple-statuses
2020-09-23 13:05:07 +01:00
Chris Hill-Scott
6f389d044e Don’t use $yellow to indicate local environment
It clashes with the new `$govuk-focus-colour` now. This commit changes
it to half way between `govuk-colour("dark-grey")` (`#505a5f`) and
`govuk-colour("mid-grey")` (`#b1b4b6`) from the Design System. Dark was
too dark and mid was too light.

It also adds a line of JS to let us easily switch the header to blue by
clicking on it, which is useful for taking screenshots etc.
2020-09-23 11:02:21 +01:00
Chris Hill-Scott
b20ba2349e Replace uses of $yellow for focus
There are a few places where we missed updating to the new focus styles
because they were using the `$yellow` SASS variable and not the
`$focus-colour` variable.

This commit updates them to the new colour, and where needed adds the
black lower border to match.
2020-09-23 10:50:43 +01:00
Tom Byers
cf07d79024 Make difference between table frames obvious
...by naming the attributes related to
accessibility.

Also includes tests for this.
2020-09-23 10:33:58 +01:00
Tom Byers
041f061dec Make only the scrollable table focusable
The JS clones the scrollable table so was passing
its attributes across to the fixed one (which
provides the row headings).

This bug was pushed in:

https://github.com/alphagov/notifications-admin/pull/3637
2020-09-23 09:58:27 +01:00
Tom Byers
de89e3cc11 Make fullscreen focusable
Includes:
- adding tabindex=0 to make it focusable
- giving it a focus style matching GOVUK Frontend
- giving it a label matching the table caption

Taken from this article:

https://adrianroselli.com/2017/11/a-responsive-accessible-table.html#ResponsiveScrollingKeyboard
2020-09-19 22:03:45 +01:00
Tom Byers
4b28846c6b Make selection summary (counter) more detailed 2020-09-18 12:10:32 +01:00
Tom Byers
43935457d8 Change live-search so it announces results
If there is a search term when the page loads, a
statement about the results is added to the
searchbox label.

All subsequent searches are announced via an aria
live-region.
2020-09-17 14:38:40 +01:00
Chris Hill-Scott
8806734f03 Merge pull request #3633 from alphagov/focus-area-remove
Use new focus colour for remove area button
2020-09-17 13:31:19 +01:00
karlchillmaid
60a63c69ee Merge pull request #3578 from alphagov/update-sent-status-label
Update sent status label
2020-09-17 13:16:41 +01:00
Chris Hill-Scott
23e6e30092 Use new focus colour for remove area button
It already adds a black border on focus so doesn’t need the thick lower
border.
2020-09-17 12:46:45 +01:00
Chris Hill-Scott
daaa3d69a3 Make sent international status display on 2 lines
Otherwise it wraps awkwardly
2020-09-17 12:33:46 +01:00
Tom Byers
10280eb662 Merge pull request #3630 from alphagov/fix-copy-to-clipboard-selection
Fix copy to clipboard selection
2020-09-16 15:40:03 +01:00
Tom Byers
308f9980d3 Fixes for focus issues on /templates page(s)
Includes:
- fixes for the cancel button, when selecting a
  template type (after clicking 'New template')
- making the folder icon black, to match the text,
  on template list items
2020-09-16 14:43:48 +01:00