diff --git a/src/components/cookies-banner/_macro-options.md b/src/components/cookies-banner/_macro-options.md index 456b0bae99..c5d3dfe295 100644 --- a/src/components/cookies-banner/_macro-options.md +++ b/src/components/cookies-banner/_macro-options.md @@ -1,18 +1,18 @@ -| Name | Type | Required | Description | -| -------------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| lang | string | false | All parameters have defaults for both English and Welsh. If `'lang': 'cy'` is provided the banner will render with Welsh language defaults. If `'lang': 'en'` or no `lang` parameter is provided then English language defaults will be used to render the banner. | -| ariaLabel | string | false | Aria label for the cookie banner region (default is 'cookies banner') | -| statementTitle | string | false | The title text for content for the cookie banner that prefixes the `serviceName` (default is 'Cookies on') | -| serviceName | string | false | The name of the service/website that follows the `statementTitle` (default is 'ons.gov.uk') | -| statementText | string | false | The text content for the cookie banner. HTML is allowed to create paragraphs. Default is: ”Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work. We would like to set additional cookies to remember your settings and understand how you use the site. This helps us to improve our services.” | -| acceptedText | string | false | The text content when cookies have been accepted. Will prefix the `preferencesText` (default is 'You’ve accepted all additional cookies.') | -| rejectedText | string | false | The text content when cookies have been rejected. Will prefix the `preferencesText` (default is 'You’ve rejected all additional cookies.') | -| preferencesText | string | false | The text content for the confirmation cookie message. HTML is allowable to embed links. Will follow the `acceptedText` or `rejectedText` (default is 'You can change your cookie preferences at any time.') | -| acceptButtonText | string | false | Text for the accept button (default is 'Accept additional cookies') | -| rejectButtonText | string | false | Text for the reject button (default is 'Reject additional preferences') | -| confirmationButtonText | string | false | Text for the confirmation banner button (default is 'Hide') | -| confirmationButtonTextAria | string | false | Additional descriptive text for the confirmation banner button to assist screen readers (default is 'the cookie message') | -| settingsLinkText | string | false | Text for link to cookie settings page (default is 'View cookies') | -| settingsLinkTextURL | string | false | URL for the cookies settings page (default is '/cookies') | -| 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 | +| Name | Type | Required | Description | +| ---------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| lang | string | false | All parameters have defaults for both English and Welsh. If `'lang': 'cy'` is provided the banner will render with Welsh language defaults. If `'lang': 'en'` or no `lang` parameter is provided then English language defaults will be used to render the banner. | +| ariaLabel | string | false | Aria label for the cookie banner region (default is 'cookies banner') | +| statementTitle | string | false | The title text for content for the cookie banner that prefixes the `serviceName` (default is 'Cookies on') | +| serviceName | string | false | The name of the service/website that follows the `statementTitle` (default is 'ons.gov.uk') | +| statementText | string | false | The text content for the cookie banner. HTML is allowed to create paragraphs. Default is: ”Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work. We would like to set additional cookies to remember your settings and understand how you use the site. This helps us to improve our services.” | +| acceptedText | string | false | The text content when cookies have been accepted. Will prefix the `preferencesText` (default is 'You’ve accepted all additional cookies.') | +| rejectedText | string | false | The text content when cookies have been rejected. Will prefix the `preferencesText` (default is 'You’ve rejected all additional cookies.') | +| preferencesText | string | false | The text content for the confirmation cookie message. HTML is allowable to embed links. Will follow the `acceptedText` or `rejectedText` (default is 'You can change your cookie preferences at any time.') | +| acceptButtonText | string | false | Text for the accept button (default is 'Accept additional cookies') | +| rejectButtonText | string | false | Text for the reject button (default is 'Reject additional preferences') | +| confirmationButtonText | string | false | Text for the confirmation banner button (default is 'Hide') | +| contextSuffix | string | false | Additional descriptive text for the confirmation banner button to assist screen readers (default is 'the cookie message') | +| settingsLinkText | string | false | Text for link to cookie settings page (default is 'View cookies') | +| settingsLinkTextURL | string | false | URL for the cookies settings page (default is '/cookies') | +| 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 | diff --git a/src/components/cookies-banner/_macro.njk b/src/components/cookies-banner/_macro.njk index e8c6fd06cf..9c9030439d 100644 --- a/src/components/cookies-banner/_macro.njk +++ b/src/components/cookies-banner/_macro.njk @@ -26,7 +26,7 @@ {% set rejectedText = 'You have rejected all additional cookies.' %} {% set preferencesText = 'You can change your cookie preferences at any time.' %} {% set confirmationButtonText = 'Hide' %} - {% set confirmationButtonTextAria = 'this message' %} + {% set contextSuffix = 'this message' %} {% endif %}
@@ -78,7 +78,7 @@ onsButton({ "type": 'button', "text": params.confirmationButtonText | default(confirmationButtonText), - "buttonContext": params.confirmationButtonTextAria | default(confirmationButtonTextAria), + "buttonContext": params.contextSuffix | default(contextSuffix), "classes": 'ons-btn--secondary ons-btn--small ons-js-hide-button' }) }} diff --git a/src/components/cookies-banner/_macro.spec.js b/src/components/cookies-banner/_macro.spec.js index 4475b41dff..b8ba5a2d72 100644 --- a/src/components/cookies-banner/_macro.spec.js +++ b/src/components/cookies-banner/_macro.spec.js @@ -16,7 +16,7 @@ const EXAMPLE_COOKIES_BANNER_PARAMS = { rejectButtonText: 'Reject additional cookies override', preferencesText: 'Text override', confirmationButtonText: 'Hide override', - confirmationButtonTextAria: 'the cookie message override', + contextSuffix: 'the cookie message override', }; describe('macro: cookies-banner', () => { @@ -112,7 +112,7 @@ describe('macro: cookies-banner', () => { expect(buttonSpy.occurrences[2].text).toBe('Hide override'); }); - it('has the correct `confirmationButtonTextAria` for `buttonContext`', () => { + it('has the correct `contextSuffix` for `buttonContext`', () => { const faker = templateFaker(); const buttonSpy = faker.spy('button');