Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Version 5.0.0 #456

Merged
merged 75 commits into from
Dec 8, 2023
Merged

Version 5.0.0 #456

merged 75 commits into from
Dec 8, 2023

Conversation

frankieroberto
Copy link
Collaborator

@frankieroberto frankieroberto commented Oct 26, 2023

Following the release of GOV.UK Design System v5.0, govuk-components v5.0.0 will be released. The headline features are:

Release notes will be drafted in #469.

peteryates and others added 6 commits August 23, 2023 13:00
The task list component displays all the tasks a user needs to do, and
allows users to easily identify which ones are done and which they still
need to do.

Refs: alphagov/govuk-design-system/pull/1994
These are only needed to preview the guide until the task list is
released and available in govuk-frontend. This commit can be dropped
prior to merge.
@netlify
Copy link

netlify bot commented Oct 26, 2023

Deploy Preview for govuk-components ready!

Name Link
🔨 Latest commit a70be3e
🔍 Latest deploy log https://app.netlify.com/sites/govuk-components/deploys/6573402f41d5ac0008e55cf3
😎 Deploy Preview https://deploy-preview-456--govuk-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

peteryates and others added 10 commits October 27, 2023 10:22
This maintains the usual flow of supporting the most recent two major
versions
Statuses can now be provided as strings, hash or with a block, offering
complete flexibility.

Co-authored-by: Frankie Roberto <frankie@frankieroberto.com>
Update the classes to match the new ones upstream

alphagov/govuk-frontend#3952
@peteryates
Copy link
Member

I suggest we make this the v5.0 branch and merge the other v5.0 work into it.

frankieroberto and others added 25 commits November 28, 2023 12:01
From the a PR on `govuk-frontend`:

> In testing the new lockup in various accessibility tools, I found that VoiceOver on macOS does not expose the SVG's title element in the Web Rotor's list of links, although it will announce it audibly when the link or graphic is focused.
>
> Additionally, VoiceOver on iOS only announced the 'GOV.UK' text if the logo graphic was by itself. It omitted it if there was other text (such as a product name) within the same link.
>
> Adding an aria-label to the SVG seems to rectify both of these issues. It doesn't appear to have side effects in any other screen readers that I tested or when VO announces the link or graphic audibly.

alphagov/govuk-frontend#4497
Opps, applied it to the wrong element in #467
It would be nice to be able to simply add visually hidden text to links
and buttons without having to manually construct the HTML. It comes in
really handy when working in dense admin interfaces where there might
just be enough space for 'View', but we want to give screenreader users
and idea of _where_ the link will take them.

## Work so far

- Split out `#extract_button_link_args`
- Rework and simplify the link and button helpers
- Add `govuk_visually_hidden` helper which makes creating visually
hidden text easy
- Add keyword arguments `visually_hidden_prefix` and
`visually_hidden_suffix` which injects the visually hidden text before
or after the link or button text

## Example use

With keyword arguments:

```erb
<%= govuk_link_to("Delete", "#", visually_hidden_suffix: "first item")  %>
```

With a block:

```erb
<%= govuk_link_to("#") do %>
  Delete <%= govuk_visually_hidden("first item") %>
<% end %>
```

Both will output:

```html
<a href="#" class="govuk-link">Delete<span class="govuk-visually-hidden"> first item</span></a>
```

Prefixes work in the same way:

```erb
<%= govuk_link_to("Mr Jones", "#", visually_hidden_prefix: "Remove")  %>
```

```html
<a href="#" class="govuk-link"><span class="govuk-visually-hidden">Remove </span>Mr Jones</a>
```
Turns out this should only be applied directly to focusable elements like links and buttons.
Turns out this should only be applied directly to focusable elements
like links and buttons.

Also added a test for the block syntax option, and refactored a bit.
These icons shouldn't be committed to git, as they're copied from
`govuk-frontend` in a build step – and also ignored via `.gitignore`. In
any case, we don't reference these icons from the guide as we use the
x-govuk icon.
This fixes a bug where this syntax was no longer working in ERb:

```erb
<%= govuk_link_to "/" do %>
    <%= "test" %>
  <% end %>
```

I think was because the private method was using `block.call` rather
than passing the block to the `link_to` helper which then passes it to
`content_tag` which then calls `capture(&block)` using the OutputBuffer.
If you use the block syntax, then the href is actually confusingly the variable named `name` as it is the first argument, rather than the one named `href`.

Unfortunately the tests didn't pick this up as the mock for `url_for` always returned the right variable, even if passed `nil`. Swapping this out for a minimal implementation of `url_for` avoids these false positives.
@peteryates peteryates added this pull request to the merge queue Dec 8, 2023
Merged via the queue into main with commit 00d582f Dec 8, 2023
13 checks passed
@peteryates peteryates deleted the govuk-frontend-v5 branch December 8, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants