Skip to content

Commit

Permalink
Change headingHref to href on index grids
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed May 28, 2024
1 parent 7bf51b2 commit 9beb2ba
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Index grids can now have supertitles
- Index grids can now have supertitles, `hrefClasses` and `hrefAttributes`

### Changed

- Detail summaries no longer stretch the full width of the container
- Index grid `headingHref` changed to `href`

### Deprecated
### Removed
Expand Down
1 change: 1 addition & 0 deletions src/nationalarchives/components/index-grid/fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"headingLevel": 2,
"headingSize": "xl",
"headingHref": "#",
"hrefClasses": "test",
"items": [
{
"href": "#/category-0",
Expand Down
12 changes: 9 additions & 3 deletions src/nationalarchives/components/index-grid/index-grid.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const argTypes = {
title: { control: "text" },
headingLevel: { control: { type: "number", min: 1, max: 6 } },
headingSize: { control: "inline-radio", options: ["s", "m", "l", "xl"] },
headingHref: { control: "text" },
href: { control: "text" },
hrefClasses: { control: "text" },
hrefAttributes: { control: "object" },
body: { control: "text" },
text: { control: "text" },
items: { control: "object" },
Expand Down Expand Up @@ -34,7 +36,9 @@ const Template = ({
title,
headingLevel,
headingSize,
headingHref,
href,
hrefClasses,
hrefAttributes,
body,
text,
items,
Expand All @@ -51,7 +55,9 @@ const Template = ({
title,
headingLevel,
headingSize,
headingHref,
href,
hrefClasses,
hrefAttributes,
body,
text,
items,
Expand Down
22 changes: 20 additions & 2 deletions src/nationalarchives/components/index-grid/macro-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,22 @@
"description": "The physical size of the index grid title (`xl`, `l`, `m` or `s`)."
},
{
"name": "headingHref",
"name": "href",
"type": "string",
"required": false,
"description": "A URL to use as a link in the grid’s heading."
"description": "A URL to use as a link in the grids heading."
},
{
"name": "hrefClasses",
"type": "string",
"required": false,
"description": "Classes to add to the elements of the index grid that use `href`."
},
{
"name": "hrefAttributes",
"type": "object",
"required": false,
"description": "HTML attributes (for example data attributes) to add to the elements of the index grid that use `href`."
},
{
"name": "body",
Expand Down Expand Up @@ -122,6 +134,12 @@
"required": false,
"description": ""
},
{
"name": "plainSupertitle",
"type": "boolean",
"required": false,
"description": "Use a plain supertitle, removing the accented background colour."
},
{
"name": "classes",
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ const Template = ({ theme, accent }) => {
params: {
title: "My dogs 1",
headingLevel: 3,
headingHref: "#",
href: "#",
items: Array(4)
.fill({
...{
Expand Down Expand Up @@ -811,7 +811,7 @@ const Template = ({ theme, accent }) => {
params: {
title: "My dogs 2",
headingLevel: 3,
headingHref: "#",
href: "#",
items: Array(4)
.fill({
...{
Expand Down Expand Up @@ -905,7 +905,7 @@ const Template = ({ theme, accent }) => {
params: {
title: "My dogs 3",
headingLevel: 3,
headingHref: "#",
href: "#",
items: Array(4)
.fill({
...{
Expand Down Expand Up @@ -999,7 +999,7 @@ const Template = ({ theme, accent }) => {
params: {
title: "My dogs 4",
headingLevel: 3,
headingHref: "#",
href: "#",
items: Array(4)
.fill({
...{
Expand Down Expand Up @@ -1093,7 +1093,7 @@ const Template = ({ theme, accent }) => {
params: {
title: "My dogs 5",
headingLevel: 3,
headingHref: "#",
href: "#",
items: Array(4)
.fill({
...{
Expand Down

0 comments on commit 9beb2ba

Please sign in to comment.