From fb8013580e4aa9808d283e4616a66761a09011be Mon Sep 17 00:00:00 2001 From: SriHV Date: Mon, 16 Dec 2024 12:46:09 +0000 Subject: [PATCH] changes as per comments --- __snapshots__/layout/_template.spec.js.snap | 156 ++++++++++-------- ...mple-header-basic_0_document_0_desktop.png | 3 + ...ample-header-basic_0_document_1_tablet.png | 3 + ...ample-header-basic_0_document_2_mobile.png | 3 + src/components/header/_macro-options.md | 38 ++--- src/components/header/_macro.njk | 2 +- ...tion-only.njk => example-header-basic.njk} | 2 +- 7 files changed, 113 insertions(+), 94 deletions(-) create mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_0_desktop.png create mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_1_tablet.png create mode 100644 backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_2_mobile.png rename src/components/header/{example-header-with-navigation-only.njk => example-header-basic.njk} (78%) diff --git a/__snapshots__/layout/_template.spec.js.snap b/__snapshots__/layout/_template.spec.js.snap index 62e0c6dbc0..29380095bf 100644 --- a/__snapshots__/layout/_template.spec.js.snap +++ b/__snapshots__/layout/_template.spec.js.snap @@ -234,28 +234,30 @@ exports[`base page template matches the favicons block override snapshot 1`] = ` -
-
-
-
- - + +
+
+
+
- -
Social survey
+ + + +
Social survey
+ + +
+
- - -
-
+ @@ -473,28 +475,30 @@ exports[`base page template matches the footer block override snapshot 1`] = `
-
-
-
-
- - + +
+
+
+
- -
Social survey
+ + + +
Social survey
+ + +
+
- - -
-
+ @@ -882,29 +886,30 @@ exports[`base page template matches the full configuration snapshot 1`] = `
-
-
-
-
- - + +
+
+ - - -
+ +
+ @@ -936,14 +941,14 @@ exports[`base page template matches the full configuration snapshot 1`] = ` -
- - -
- - +
+ + +
+ + @@ -975,12 +980,13 @@ exports[`base page template matches the full configuration snapshot 1`] = ` - -
- + +
+ +
-
+ @@ -1961,28 +1967,30 @@ exports[`base page template matches the meta block override snapshot 1`] = `
-
-
-
-
- - + +
+
+
+
- -
Social survey
+ + + +
Social survey
+ + +
+
- - -
-
+ @@ -2184,28 +2192,30 @@ exports[`base page template matches the social block override snapshot 1`] = `
-
-
-
-
- - + +
+
+
+
- -
Social survey
+ + + +
Social survey
+ + +
+
- - -
-
+ diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_0_desktop.png b/backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_0_desktop.png new file mode 100644 index 0000000000..84b7f01461 --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_0_desktop.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03c53a0bcd6fe29cd4c9fe59227cc4f2612f00f0a08eb0c2a53d7334c241fcd6 +size 14266 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_1_tablet.png b/backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_1_tablet.png new file mode 100644 index 0000000000..f34345bbff --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_1_tablet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65f329afc04fde5ff5f541b2712b183accab1446bd76d6944042949de4413fab +size 9069 diff --git a/backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_2_mobile.png b/backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_2_mobile.png new file mode 100644 index 0000000000..75468ba73d --- /dev/null +++ b/backstop_data/bitmaps_reference/ds-vr-test__components_header_example-header-basic_0_document_2_mobile.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb39535ce7f5f1affd77107ef3155d32b4197e7b0805065b221d379d05f9e88f +size 5422 diff --git a/src/components/header/_macro-options.md b/src/components/header/_macro-options.md index 78571609a7..c1f6dd20d0 100644 --- a/src/components/header/_macro-options.md +++ b/src/components/header/_macro-options.md @@ -1,22 +1,22 @@ -| Name | Type | Required | Description | -| --------------------- | ------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| phase | `PhaseBanner` [_(ref)_](/components/phase-banner) | false | Settings to set the Phase banner component within the HTML `
` element | -| wide | boolean | false | Set to “true” to increase the maximum width of the layout container to 1280px | -| fullWidth | boolean | false | Set to “true” to increase the maximum width of the layout container to the full width of the viewport | -| classes | string | false | Classes to add to the wrapping `header` | -| variants | array or string | false | An array of values or single value (string) to adjust the component using available variants: “internal”, "neutral" and “description” | -| mastheadLogoUrl | string | false | Wraps the masthead logo in a link. Set the URL for the HTML `href` attribute for the link. | -| mastheadLogo | object`` | false | Settings for a [custom organisation logo](#mastheadlogo) in the masthead. Defaults to the ONS logo. | -| language | object`` | false | Settings for the [language selector](#language) | -| serviceLinks | object`` | false | Settings for the [service links](#servicelinks) in the masthead | -| title | string | true (unless `titleLogo` is set or variant is set to nav-only) | The title for the service | -| description | string | false | Tagline or description for the service | -| titleAsH1 | boolean | false | Override to wrap the header `title` in an `

` heading | -| titleLogo | object`` | false | Settings for a [custom title logo](#titlelogo) in the header. | -| titleUrl | string | false | Wraps the title logo in a link. Set the URL for the HTML `href` attribute for the link. | -| button | object`` | false | Settings for the [sign out button](#signoutbutton) in the header used to exit a transactional service | -| navigation | array`` | false | Settings for the [main menu links](#navigation) | -| siteSearchAutosuggest | `Autosuggest` [_(ref)_](/components/autosuggest) | false | Sets the autosuggest functionality in the header | +| Name | Type | Required | Description | +| --------------------- | ------------------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| phase | `PhaseBanner` [_(ref)_](/components/phase-banner) | false | Settings to set the Phase banner component within the HTML `
` element | +| wide | boolean | false | Set to “true” to increase the maximum width of the layout container to 1280px | +| fullWidth | boolean | false | Set to “true” to increase the maximum width of the layout container to the full width of the viewport | +| classes | string | false | Classes to add to the wrapping `header` | +| variants | array or string | false | An array of values or single value (string) to adjust the component using available variants: “internal”, "neutral", “description” and "basic" | +| mastheadLogoUrl | string | false | Wraps the masthead logo in a link. Set the URL for the HTML `href` attribute for the link. | +| mastheadLogo | object`` | false | Settings for a [custom organisation logo](#mastheadlogo) in the masthead. Defaults to the ONS logo. | +| language | object`` | false | Settings for the [language selector](#language) | +| serviceLinks | object`` | false | Settings for the [service links](#servicelinks) in the masthead | +| title | string | true (unless `titleLogo` is set or variant is set to nav-only) | The title for the service | +| description | string | false | Tagline or description for the service | +| titleAsH1 | boolean | false | Override to wrap the header `title` in an `

` heading | +| titleLogo | object`` | false | Settings for a [custom title logo](#titlelogo) in the header. | +| titleUrl | string | false | Wraps the title logo in a link. Set the URL for the HTML `href` attribute for the link. | +| button | object`` | false | Settings for the [sign out button](#signoutbutton) in the header used to exit a transactional service | +| navigation | array`` | false | Settings for the [main menu links](#navigation) | +| siteSearchAutosuggest | `Autosuggest` [_(ref)_](/components/autosuggest) | false | Sets the autosuggest functionality in the header | ## MastheadLogo diff --git a/src/components/header/_macro.njk b/src/components/header/_macro.njk index dff3f8fd3a..d75d0981b4 100644 --- a/src/components/header/_macro.njk +++ b/src/components/header/_macro.njk @@ -218,7 +218,7 @@ {% endif %}

- {% if params.variants != "nav-only" %} + {% if params.variants != "basic" %}