Skip to content

Commit

Permalink
Update the default aria-label on breadcrumbs components
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Sep 16, 2024
1 parent 4170a87 commit edf8798
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
### Changed

- Updated the default `aria-label` on breadcrumbs components from "Breadcrumb" to "Breadcrumbs"

### Deprecated
### Removed
### Fixed
Expand Down
10 changes: 5 additions & 5 deletions src/nationalarchives/components/breadcrumbs/fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
]
},
"html": "<nav class=\"tna-breadcrumbs\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumb\"><ol class=\"tna-breadcrumbs__list\"><li class=\"tna-breadcrumbs__item\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\">Alpha</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\">Beta</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\">Gamma</a></li></ol></nav>"
"html": "<nav class=\"tna-breadcrumbs\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumbs\"><ol class=\"tna-breadcrumbs__list\"><li class=\"tna-breadcrumbs__item\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\">Alpha</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\">Beta</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\">Gamma</a></li></ol></nav>"
},
{
"name": "non-collapsing",
Expand All @@ -40,7 +40,7 @@
],
"noCollapse": true
},
"html": "<nav class=\"tna-breadcrumbs tna-breadcrumbs--no-collapse\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumb\"><ol class=\"tna-breadcrumbs__list\"><li class=\"tna-breadcrumbs__item\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\">Alpha</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\">Beta</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\">Gamma</a></li></ol></nav>"
"html": "<nav class=\"tna-breadcrumbs tna-breadcrumbs--no-collapse\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumbs\"><ol class=\"tna-breadcrumbs__list\"><li class=\"tna-breadcrumbs__item\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\">Alpha</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\">Beta</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\">Gamma</a></li></ol></nav>"
},
{
"name": "Structured data",
Expand All @@ -61,7 +61,7 @@
],
"structuredData": true
},
"html": "<nav class=\"tna-breadcrumbs\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumb\"><ol class=\"tna-breadcrumbs__list\" itemscope itemtype=\"https://schema.org/BreadcrumbList\"><li class=\"tna-breadcrumbs__item\" itemprop=\"itemListElement\" itemscope itemtype=\"https://schema.org/ListItem\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\" itemprop=\"item\"><span itemprop=\"name\">Alpha</span></a><meta itemprop=\"position\" content=\"1\"></li><li class=\"tna-breadcrumbs__item\" itemprop=\"itemListElement\" itemscope itemtype=\"https://schema.org/ListItem\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\" itemprop=\"item\"><span itemprop=\"name\">Beta</span></a><meta itemprop=\"position\" content=\"2\"></li><li class=\"tna-breadcrumbs__item\" itemprop=\"itemListElement\" itemscope itemtype=\"https://schema.org/ListItem\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\" itemprop=\"item\"><span itemprop=\"name\">Gamma</span></a><meta itemprop=\"position\" content=\"3\"></li></ol></nav>"
"html": "<nav class=\"tna-breadcrumbs\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumbs\"><ol class=\"tna-breadcrumbs__list\" itemscope itemtype=\"https://schema.org/BreadcrumbList\"><li class=\"tna-breadcrumbs__item\" itemprop=\"itemListElement\" itemscope itemtype=\"https://schema.org/ListItem\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\" itemprop=\"item\"><span itemprop=\"name\">Alpha</span></a><meta itemprop=\"position\" content=\"1\"></li><li class=\"tna-breadcrumbs__item\" itemprop=\"itemListElement\" itemscope itemtype=\"https://schema.org/ListItem\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\" itemprop=\"item\"><span itemprop=\"name\">Beta</span></a><meta itemprop=\"position\" content=\"2\"></li><li class=\"tna-breadcrumbs__item\" itemprop=\"itemListElement\" itemscope itemtype=\"https://schema.org/ListItem\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\" itemprop=\"item\"><span itemprop=\"name\">Gamma</span></a><meta itemprop=\"position\" content=\"3\"></li></ol></nav>"
},
{
"name": "with classes",
Expand All @@ -82,7 +82,7 @@
],
"classes": "tna-breadcrumbs--test"
},
"html": "<nav class=\"tna-breadcrumbs tna-breadcrumbs--test\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumb\"><ol class=\"tna-breadcrumbs__list\"><li class=\"tna-breadcrumbs__item\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\">Alpha</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\">Beta</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\">Gamma</a></li></ol></nav>"
"html": "<nav class=\"tna-breadcrumbs tna-breadcrumbs--test\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumbs\"><ol class=\"tna-breadcrumbs__list\"><li class=\"tna-breadcrumbs__item\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\">Alpha</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\">Beta</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\">Gamma</a></li></ol></nav>"
},
{
"name": "with attributes",
Expand All @@ -105,7 +105,7 @@
"data-testattribute": "foobar"
}
},
"html": "<nav class=\"tna-breadcrumbs\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumb\" data-testattribute=\"foobar\"><ol class=\"tna-breadcrumbs__list\"><li class=\"tna-breadcrumbs__item\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\">Alpha</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\">Beta</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\">Gamma</a></li></ol></nav>"
"html": "<nav class=\"tna-breadcrumbs\" data-module=\"tna-breadcrumbs\" aria-label=\"Breadcrumbs\" data-testattribute=\"foobar\"><ol class=\"tna-breadcrumbs__list\"><li class=\"tna-breadcrumbs__item\"><a href=\"#/alpha\" class=\"tna-breadcrumbs__link\">Alpha</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/beta\" class=\"tna-breadcrumbs__link\">Beta</a></li><li class=\"tna-breadcrumbs__item\"><a href=\"#/gamma\" class=\"tna-breadcrumbs__link\">Gamma</a></li></ol></nav>"
}
]
}
2 changes: 1 addition & 1 deletion src/nationalarchives/components/breadcrumbs/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{%- set containerClasses = containerClasses.concat('tna-breadcrumbs--no-collapse') -%}
{%- endif -%}
{%- set classes = containerClasses | join(' ') -%}
<nav class="tna-breadcrumbs{% if classes %} {{ classes }}{% endif %}" data-module="tna-breadcrumbs" aria-label="Breadcrumb"{%- for attribute, value in params.attributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}>
<nav class="tna-breadcrumbs{% if classes %} {{ classes }}{% endif %}" data-module="tna-breadcrumbs" aria-label="Breadcrumbs"{%- for attribute, value in params.attributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}>
<ol class="tna-breadcrumbs__list" {%- if params.structuredData %} itemscope itemtype="https://schema.org/BreadcrumbList"{% endif %}>
{%- for item in params.items %}
<li class="tna-breadcrumbs__item" {%- if params.structuredData %} itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"{% endif %}>
Expand Down
Loading

0 comments on commit edf8798

Please sign in to comment.