From 94d1f7a79cb73061874d4bc0448c89a0a09e5307 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 10:19:59 +0100 Subject: [PATCH 01/28] Accordion - add required fields to examples --- src/govuk/components/accordion/accordion.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/govuk/components/accordion/accordion.yaml b/src/govuk/components/accordion/accordion.yaml index 38e98c33e2..bc4f23aba2 100644 --- a/src/govuk/components/accordion/accordion.yaml +++ b/src/govuk/components/accordion/accordion.yaml @@ -150,6 +150,7 @@ examples: - name: classes hidden: true data: + id: accordion-classes classes: myClass items: - heading: @@ -159,6 +160,7 @@ examples: - name: attributes hidden: true data: + id: accordion-attributes attributes: data-attribute: value items: @@ -169,6 +171,7 @@ examples: - name: custom heading level hidden: true data: + id: accordion-heading headingLevel: 3 items: - heading: @@ -178,6 +181,7 @@ examples: - name: heading html hidden: true data: + id: accordion-heading-html items: - heading: html: Section A @@ -186,6 +190,7 @@ examples: - name: with falsey values hidden: true data: + id: accordion-falsey items: - heading: text: Section A From 67c89b377255dbdb49f4bb33ad602b70ee26dbc7 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 10:22:37 +0100 Subject: [PATCH 02/28] Add missing required attribute for breadcrumbs --- src/govuk/components/breadcrumbs/breadcrumbs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/govuk/components/breadcrumbs/breadcrumbs.yaml b/src/govuk/components/breadcrumbs/breadcrumbs.yaml index e43c051452..21b61d26f4 100644 --- a/src/govuk/components/breadcrumbs/breadcrumbs.yaml +++ b/src/govuk/components/breadcrumbs/breadcrumbs.yaml @@ -18,6 +18,7 @@ params: description: Link for the breadcrumbs item. If not specified, breadcrumbs item is a normal list item. - name: attributes type: object + required: false description: HTML attributes (for example data attributes) to add to the individual crumb. - name: classes type: string From 1b90b347543cc5fa2d40066e0e1e835b2a34bb6d Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 10:23:48 +0100 Subject: [PATCH 03/28] Breadcrumbs - add required fields to examples --- src/govuk/components/breadcrumbs/breadcrumbs.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/govuk/components/breadcrumbs/breadcrumbs.yaml b/src/govuk/components/breadcrumbs/breadcrumbs.yaml index 21b61d26f4..876cbcca37 100644 --- a/src/govuk/components/breadcrumbs/breadcrumbs.yaml +++ b/src/govuk/components/breadcrumbs/breadcrumbs.yaml @@ -103,12 +103,18 @@ examples: hidden: true data: classes: app-breadcrumbs--custom-modifier + items: + - + text: Home - name: attributes hidden: true data: attributes: id: my-navigation role: navigation + items: + - + text: Home - name: item attributes hidden: true data: From fa580c235c364c05eed67991203e8384a5b090f4 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 10:27:35 +0100 Subject: [PATCH 04/28] Button - add required fields to examples --- src/govuk/components/button/button.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/govuk/components/button/button.yaml b/src/govuk/components/button/button.yaml index 9932d30b60..dd8c4be677 100644 --- a/src/govuk/components/button/button.yaml +++ b/src/govuk/components/button/button.yaml @@ -146,6 +146,7 @@ examples: hidden: true data: element: button + text: Submit attributes: aria-controls: example-id data-tracking-dimension: 123 @@ -153,6 +154,7 @@ examples: hidden: true data: element: a + text: Submit attributes: aria-controls: example-id data-tracking-dimension: 123 @@ -160,37 +162,44 @@ examples: hidden: true data: element: input + text: Submit attributes: aria-controls: example-id data-tracking-dimension: 123 - name: classes hidden: true data: + text: Submit element: button classes: app-button--custom-modifier - name: link classes hidden: true data: + text: Submit element: a classes: app-button--custom-modifier - name: input classes hidden: true data: + text: Submit element: input classes: app-button--custom-modifier - name: name hidden: true data: + text: Submit element: button name: start-now - name: type hidden: true data: + text: Submit element: button type: button - name: input type hidden: true data: + text: Submit element: input type: button - name: explicit link @@ -202,15 +211,18 @@ examples: - name: no href hidden: true data: + text: Submit element: a - name: value hidden: true data: + text: Submit element: button value: start - name: html hidden: true data: + text: Submit element: button html: Start now - name: no data From be4c4bec60694228a36e3264a2da68efbef5ecc2 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 10:50:54 +0100 Subject: [PATCH 05/28] Character count - add required fields to examples --- .../character-count/character-count.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/govuk/components/character-count/character-count.yaml b/src/govuk/components/character-count/character-count.yaml index 6e473841b6..c77d90f898 100644 --- a/src/govuk/components/character-count/character-count.yaml +++ b/src/govuk/components/character-count/character-count.yaml @@ -158,33 +158,68 @@ examples: - name: classes hidden: true data: + id: with-classes + name: with-classes + maxlength: 10 + label: + text: With classes classes: app-character-count--custom-modifier - name: attributes hidden: true data: + id: with-attributes + name: with-attributes + maxlength: 10 + label: + text: With attributes attributes: data-attribute: my data value - name: formGroup with classes hidden: true data: + id: with-formgroup + name: with-formgroup + maxlength: 10 + label: + text: With formgroup formGroup: classes: app-character-count--custom-modifier - name: custom classes on countMessage hidden: true data: + id: with-custom-countmessage-class + name: with-custom-countmessage-class + maxlength: 10 + label: + text: With custom countMessage class countMessage: classes: app-custom-count-message - name: spellcheck enabled hidden: true data: + id: with-spellcheck + name: with-spellcheck + maxlength: 10 + label: + text: With spellcheck spellcheck: true - name: spellcheck disabled hidden: true data: + id: without-spellcheck + name: without-spellcheck + maxlength: 10 + label: + text: Without spellcheck spellcheck: false - name: custom classes with error message hidden: true data: + id: with-custom-error-class + name: with-custom-error-class + maxlength: 10 + label: + text: With custom error class classes: app-character-count--custom-modifier errorMessage: text: Error message From deef1e3289b16a7e587b8ec7b4866d4eaa8cee0f Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:21:47 +0100 Subject: [PATCH 06/28] Checkboxes - add required fields to examples --- .../components/checkboxes/checkboxes.yaml | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/govuk/components/checkboxes/checkboxes.yaml b/src/govuk/components/checkboxes/checkboxes.yaml index 3f7e859b09..46808dd278 100644 --- a/src/govuk/components/checkboxes/checkboxes.yaml +++ b/src/govuk/components/checkboxes/checkboxes.yaml @@ -144,6 +144,7 @@ examples: - name: with hints on items data: + name: with-hints-on-items fieldset: legend: text: How do you want to sign in? @@ -244,7 +245,7 @@ examples: - name: with fieldset and error message data: - name: colours + name: nationality errorMessage: text: Please accept the terms and conditions fieldset: @@ -663,6 +664,11 @@ examples: hidden: true data: name: example + items: + - value: british + text: British + - value: irish + text: Irish errorMessage: text: Please select an option fieldset: @@ -682,6 +688,11 @@ examples: text: What is your nationality? hint: text: If you have dual nationality, select all options that are relevant to you. + items: + - value: british + text: British + - value: irish + text: Irish - name: label with attributes hidden: true data: @@ -706,6 +717,11 @@ examples: attributes: data-attribute: value data-second-attribute: second-value + items: + - value: british + text: British + - value: irish + text: Irish - name: fieldset html params hidden: true data: @@ -713,6 +729,11 @@ examples: fieldset: legend: html: What is your nationality? + items: + - value: british + text: British + - value: irish + text: Irish - name: with single option set 'aria-describedby' on input, and describedBy hidden: true data: @@ -755,6 +776,11 @@ examples: describedBy: some-id legend: text: What is your nationality? + items: + - value: british + text: British + - value: irish + text: Irish From c55fa4f6eab7282d48d97c17b1ae2ecc49866da7 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:24:16 +0100 Subject: [PATCH 07/28] Date input - add required fields to examples --- .../components/date-input/date-input.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/govuk/components/date-input/date-input.yaml b/src/govuk/components/date-input/date-input.yaml index 204d19c481..12b423c035 100644 --- a/src/govuk/components/date-input/date-input.yaml +++ b/src/govuk/components/date-input/date-input.yaml @@ -276,19 +276,23 @@ examples: - name: classes hidden: true data: + id: with-classes classes: app-date-input--custom-modifier - name: attributes hidden: true data: + id: with-attributes attributes: data-attribute: my data value - name: with empty items hidden: true data: + id: with-empty-items items: [] - name: custom pattern hidden: true data: + id: with-custom-pattern items: - name: day @@ -296,6 +300,7 @@ examples: - name: custom inputmode hidden: true data: + id: with-custom-inputmode items: - name: day @@ -304,6 +309,7 @@ examples: - name: with nested name hidden: true data: + id: with-nested-name items: - name: day[dd] @@ -314,13 +320,17 @@ examples: - name: with id on items hidden: true data: + id: with-item-id items: - id: day + name: day - id: month + name: month - - year: year + id: year + name: year - name: suffixed id hidden: true data: @@ -335,13 +345,17 @@ examples: - name: with values hidden: true data: + id: with-values items: - id: day + name: day - id: month + name: month - id: year + name: year value: 2018 - name: with hint and describedBy hidden: true @@ -366,12 +380,14 @@ examples: - name: fieldset html hidden: true data: + id: with-fieldset-html fieldset: legend: html: What is your date of birth? - name: items with classes hidden: true data: + id: with-item-classes items: - name: day @@ -385,6 +401,7 @@ examples: - name: items without classes hidden: true data: + id: without-item-classes items: - name: day From 33f337e28c9abdb486ef53c261336282864189b0 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:26:06 +0100 Subject: [PATCH 08/28] Details - add required fields to examples --- src/govuk/components/details/details.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/govuk/components/details/details.yaml b/src/govuk/components/details/details.yaml index 435e86a5f5..8ece2a08a5 100644 --- a/src/govuk/components/details/details.yaml +++ b/src/govuk/components/details/details.yaml @@ -67,29 +67,39 @@ examples: hidden: true data: id: my-details-element + summaryText: Expand this section + text: Here are some more details - name: html as text hidden: true data: + summaryText: Expand this section text: More about the greater than symbol (>) - name: html hidden: true data: + summaryText: Expand this section html: More about bold text - name: summary html as text hidden: true data: summaryText: The greater than symbol (>) is the best + text: Here are some more details - name: summary html hidden: true data: summaryHtml: Use bold text sparingly + text: Here are some more details - name: classes hidden: true data: classes: some-additional-class + text: Here are some more details + summaryText: Expand me - name: attributes hidden: true data: + text: Here are some more details + summaryText: Expand me attributes: data-some-data-attribute: i-love-data another-attribute: true From 2183583c32f47d7d2d0d1b0a439863b9e583f092 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:26:54 +0100 Subject: [PATCH 09/28] Error Message - add required fields to examples --- src/govuk/components/error-message/error-message.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/govuk/components/error-message/error-message.yaml b/src/govuk/components/error-message/error-message.yaml index 4ab3a077af..94d73e5928 100644 --- a/src/govuk/components/error-message/error-message.yaml +++ b/src/govuk/components/error-message/error-message.yaml @@ -48,10 +48,12 @@ examples: hidden: true data: id: my-error-message-id + text: This is an error message - name: classes hidden: true data: classes: custom-class + text: This is an error message - name: html as text hidden: true data: @@ -63,6 +65,7 @@ examples: - name: attributes hidden: true data: + text: This is an error message attributes: data-test: attribute id: my-error-message From db2cd3dfd48987408f5e0c818986950d02da1395 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:29:27 +0100 Subject: [PATCH 10/28] Error Summary - add required fields to examples --- .../error-summary/error-summary.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/govuk/components/error-summary/error-summary.yaml b/src/govuk/components/error-summary/error-summary.yaml index aa86783b8a..2ad81f1d76 100644 --- a/src/govuk/components/error-summary/error-summary.yaml +++ b/src/govuk/components/error-summary/error-summary.yaml @@ -90,35 +90,62 @@ examples: hidden: true data: titleText: Alert, alert + errorList: + - + text: Invalid username or password - name: title html hidden: true data: titleHtml: Alert, alert + errorList: + - + text: Invalid username or password - name: description hidden: true data: + titleText: There is a problem descriptionText: Lorem ipsum + errorList: + - + text: Invalid username or password - name: html as descriptionText hidden: true data: + titleText: There is a problem descriptionText: See errors below (▼) + errorList: + - + text: Invalid username or password - name: description html hidden: true data: + titleText: There is a problem descriptionHtml: See errors below + errorList: + - + text: Invalid username or password - name: classes hidden: true data: + titleText: There is a problem classes: extra-class one-more-class + errorList: + - + text: Invalid username or password - name: attributes hidden: true data: + titleText: There is a problem attributes: first-attribute: 'true' second-attribute: 'false' + errorList: + - + text: Invalid username or password - name: error list with attributes hidden: true data: + titleText: There is a problem errorList: - text: Error-1 @@ -129,18 +156,21 @@ examples: - name: error list with html as text hidden: true data: + titleText: There is a problem errorList: - text: Descriptive link to the question with an error - name: error list with html hidden: true data: + titleText: There is a problem errorList: - html: The date your passport was issued must be in the past - name: error list with html link hidden: true data: + titleText: There is a problem errorList: - html: Descriptive link to the question with an error @@ -148,6 +178,7 @@ examples: - name: error list with html as text link hidden: true data: + titleText: There is a problem errorList: - text: Descriptive link to the question with an error From 2f59c13463a22df32fe3a34ad6b7b0e4c1e92db1 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:32:16 +0100 Subject: [PATCH 11/28] File upload - add required fields to examples --- .../components/file-upload/file-upload.yaml | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/govuk/components/file-upload/file-upload.yaml b/src/govuk/components/file-upload/file-upload.yaml index a5b025b391..fdfe0d606c 100644 --- a/src/govuk/components/file-upload/file-upload.yaml +++ b/src/govuk/components/file-upload/file-upload.yaml @@ -100,37 +100,64 @@ examples: - name: attributes hidden: true data: + id: file-upload-attributes + name: file-upload-attributes + label: + text: Upload a file attributes: accept: .jpg, .jpeg, .png - name: classes hidden: true data: + id: file-upload-classes + name: file-upload-classes + label: + text: Upload a file classes: app-file-upload--custom-modifier - name: with describedBy hidden: true data: + id: file-upload-describedby + name: file-upload-describedby + label: + text: Upload a file describedBy: some-id - name: with hint and describedBy hidden: true data: + id: file-upload-hint-describedby + name: file-upload-hint-describedby + label: + text: Upload a file describedBy: some-id hint: text: Your photo may be in your Pictures, Photos, Downloads or Desktop folder. Or in an app like iPhoto. - name: error hidden: true data: - id: "file-upload-with-error" + id: file-upload-with-error + name: file-upload-with-error + label: + text: Upload a file errorMessage: text: Error message - name: with error and describedBy hidden: true data: + id: file-upload-error-describedby + name: file-upload-error-describedby + label: + text: Upload a file describedBy: some-id errorMessage: text: Error message - name: with error, describedBy and hint hidden: true data: + id: file-upload-error-describedby-hint + name: file-upload-error-describedby-hint + label: + text: Upload a file describedBy: some-id errorMessage: text: Error message From 82b194a72bbb1e9818ec6e46456419f28339e111 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 16:07:49 +0100 Subject: [PATCH 12/28] Footer - add required fields to examples --- src/govuk/components/footer/footer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/govuk/components/footer/footer.yaml b/src/govuk/components/footer/footer.yaml index 173ccb4ba7..730d9b3ae8 100644 --- a/src/govuk/components/footer/footer.yaml +++ b/src/govuk/components/footer/footer.yaml @@ -347,7 +347,7 @@ examples: - name: with navigation item attributes data: navigation: - - + - title: Single column list 1 items: - href: '#1' text: Navigation item 1 From 66eb960575369f668a55b39f126c269ca8659c92 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:40:25 +0100 Subject: [PATCH 13/28] Hint - add required fields to examples --- src/govuk/components/hint/hint.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/govuk/components/hint/hint.yaml b/src/govuk/components/hint/hint.yaml index 4a4b4e3b99..2bd2dde15f 100644 --- a/src/govuk/components/hint/hint.yaml +++ b/src/govuk/components/hint/hint.yaml @@ -52,10 +52,12 @@ examples: data: id: example-hint classes: app-hint--custom-modifier + text: It's on your National Insurance card, benefit letter, payslip or P60. - name: id hidden: true data: id: my-hint + text: It's on your National Insurance card, benefit letter, payslip or P60. - name: html as text hidden: true data: @@ -63,5 +65,6 @@ examples: - name: attributes hidden: true data: + text: It's on your National Insurance card, benefit letter, payslip or P60. attributes: data-attribute: my data value From cd32bbb03bb4b9c3ee55e10c3f3c749355825025 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:43:59 +0100 Subject: [PATCH 14/28] Input - add required fields to examples --- src/govuk/components/input/input.yaml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/govuk/components/input/input.yaml b/src/govuk/components/input/input.yaml index 6f0b6c36fd..0415e8cda0 100644 --- a/src/govuk/components/input/input.yaml +++ b/src/govuk/components/input/input.yaml @@ -311,39 +311,71 @@ examples: - name: classes hidden: true data: + id: with-classes + name: with-classes + label: + text: With classes classes: app-input--custom-modifier - name: custom type hidden: true data: + id: with-custom-type + name: with-custom-type + label: + text: With custom type type: number - name: value hidden: true data: + id: with-value + name: with-value + label: + text: With value value: QQ 12 34 56 C - name: with describedBy hidden: true data: + id: with-describedby + name: with-describedby + label: + text: With describedBy describedBy: some-id - name: attributes hidden: true data: + id: with-attributes + name: with-attributes + label: + text: With attributes attributes: data-attribute: my data value - name: hint with describedBy hidden: true data: + id: with-hint-describedby + name: with-hint-describedby + label: + text: With hint describedBy describedBy: some-id hint: text: It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’. - name: error with describedBy hidden: true data: + id: with-error-describedby + name: with-error-describedby + label: + text: With error describedBy describedBy: some-id errorMessage: text: Error message - name: with error and hint hidden: true data: + id: with-error-hint + name: with-error-hint + label: + text: With error and hint errorMessage: text: Error message hint: @@ -351,6 +383,10 @@ examples: - name: with error, hint and describedBy hidden: true data: + id: with-error-hint-describedby + name: with-error-hint-describedby + label: + text: With error, hint and describedBy errorMessage: text: Error message hint: @@ -359,6 +395,10 @@ examples: - name: inputmode hidden: true data: + id: with-inputmode + name: with-inputmode + label: + text: With inputmode inputmode: decimal - name: with prefix with html as text From d775e0551fb99150fa6d7946e8966e1dbd7f4fb3 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:45:35 +0100 Subject: [PATCH 15/28] Inset text - add required fields to examples --- src/govuk/components/inset-text/inset-text.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/govuk/components/inset-text/inset-text.yaml b/src/govuk/components/inset-text/inset-text.yaml index c7721a37cd..5c0868aa17 100644 --- a/src/govuk/components/inset-text/inset-text.yaml +++ b/src/govuk/components/inset-text/inset-text.yaml @@ -42,10 +42,12 @@ examples: hidden: true data: classes: app-inset-text--custom-modifier + text: It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application. - name: id hidden: true data: id: my-inset-text + text: It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application. - name: html as text hidden: true data: @@ -53,5 +55,6 @@ examples: - name: attributes hidden: true data: + text: It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application. attributes: data-attribute: my data value From 7f808073015850717ac5646968299996b9f692bd Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:49:45 +0100 Subject: [PATCH 16/28] Panel - add required fields to examples --- src/govuk/components/panel/panel.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/govuk/components/panel/panel.yaml b/src/govuk/components/panel/panel.yaml index 4174ebd234..efeebf03cf 100644 --- a/src/govuk/components/panel/panel.yaml +++ b/src/govuk/components/panel/panel.yaml @@ -44,25 +44,33 @@ examples: hidden: true data: titleText: Application not complete + text: Please complete form 1 - name: title html hidden: true data: titleHtml: Application not complete + html: Please complete form 1 - name: body html as text hidden: true data: + titleText: Application complete text: Your reference number
HDJ2123F - name: body html hidden: true data: + titleText: Application complete html: Your reference number
HDJ2123F - name: classes hidden: true data: + titleText: Application complete + text: Your reference number is HDJ2123F classes: extra-class one-more-class - name: attributes hidden: true data: + titleText: Application complete + text: Your reference number is HDJ2123F attributes: first-attribute: true second-attribute: false From 6e3f4a9217e0023d194709cc7f3a2c8cfbcda000 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:50:42 +0100 Subject: [PATCH 17/28] Phase banner - add required fields to examples --- src/govuk/components/phase-banner/phase-banner.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/govuk/components/phase-banner/phase-banner.yaml b/src/govuk/components/phase-banner/phase-banner.yaml index 66c8189a91..67b690705a 100644 --- a/src/govuk/components/phase-banner/phase-banner.yaml +++ b/src/govuk/components/phase-banner/phase-banner.yaml @@ -32,6 +32,7 @@ examples: - name: classes hidden: true data: + text: This is a new service – your feedback will help us to improve it classes: extra-class one-more-class - name: text hidden: true @@ -44,17 +45,20 @@ examples: - name: attributes hidden: true data: + text: This is a new service – your feedback will help us to improve it attributes: first-attribute: true second-attribute: false - name: tag html hidden: true data: + text: This is a new service – your feedback will help us to improve it tag: html: alpha - name: tag classes hidden: true data: + text: This is a new service – your feedback will help us to improve it tag: classes: govuk-tag--inactive text: alpha From 33907518e696f22b69d26e04d3f28a24e71b094b Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:56:30 +0100 Subject: [PATCH 18/28] Radios - add required fields to examples --- .../__snapshots__/template.test.js.snap | 1 + src/govuk/components/radios/radios.yaml | 45 ++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/govuk/components/radios/__snapshots__/template.test.js.snap b/src/govuk/components/radios/__snapshots__/template.test.js.snap index d009615053..3e9af7c04f 100644 --- a/src/govuk/components/radios/__snapshots__/template.test.js.snap +++ b/src/govuk/components/radios/__snapshots__/template.test.js.snap @@ -28,6 +28,7 @@ exports[`Radios nested dependant components passes through label params without diff --git a/src/govuk/components/radios/radios.yaml b/src/govuk/components/radios/radios.yaml index 745d81c635..3b1233dbaf 100644 --- a/src/govuk/components/radios/radios.yaml +++ b/src/govuk/components/radios/radios.yaml @@ -697,9 +697,13 @@ examples: hint: text: This includes changing your last name or spelling your name differently. items: - - hint: + - value: yes + text: Yes + hint: text: Hint for yes option here - - hint: + - value: no + text: No + hint: text: Hint for no option here - name: with describedBy and hint hidden: true @@ -711,12 +715,22 @@ examples: text: Have you changed your name? hint: text: This includes changing your last name or spelling your name differently. + items: + - value: yes + text: Yes + - value: no + text: No - name: with error message hidden: true data: name: example-error-message errorMessage: text: Please select an option + items: + - value: yes + text: Yes + - value: no + text: No - name: with error message and idPrefix hidden: true data: @@ -724,6 +738,11 @@ examples: idPrefix: id-prefix errorMessage: text: Please select an option + items: + - value: yes + text: Yes + - value: no + text: No - name: with hint and error message hidden: true data: @@ -735,6 +754,11 @@ examples: text: Have you changed your name? hint: text: This includes changing your last name or spelling your name differently. + items: + - value: yes + text: Yes + - value: no + text: No - name: with hint, error message and describedBy hidden: true data: @@ -747,9 +771,15 @@ examples: text: Have you changed your name? hint: text: This includes changing your last name or spelling your name differently. + items: + - value: yes + text: Yes + - value: no + text: No - name: label with attributes hidden: true data: + name: with-label-attributes items: - value: yes text: Yes @@ -770,12 +800,23 @@ examples: data-second-attribute: second-value hint: text: This includes changing your last name or spelling your name differently. + items: + - value: yes + text: Yes + - value: no + text: No - name: fieldset with html hidden: true data: + name: with-fieldset-html fieldset: legend: html: Have you changed your name? + items: + - value: yes + text: Yes + - value: no + text: No - name: with fieldset, error message and describedBy hidden: true data: From c5f438253877a46164cbf200fdfc34ee55d38a7e Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 14:59:47 +0100 Subject: [PATCH 19/28] Select - add required fields to examples --- src/govuk/components/select/select.yaml | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/govuk/components/select/select.yaml b/src/govuk/components/select/select.yaml index f01502f663..0865c9ec39 100644 --- a/src/govuk/components/select/select.yaml +++ b/src/govuk/components/select/select.yaml @@ -172,15 +172,35 @@ examples: - name: with describedBy hidden: true data: + id: with-describedby + name: with-describedby + items: + - + value: 1 + text: GOV.UK frontend option 1 + - + value: 2 + text: GOV.UK frontend option 2 describedBy: some-id - name: attributes hidden: true data: + id: with-attributes + name: with-attributes + items: + - + value: 1 + text: GOV.UK frontend option 1 + - + value: 2 + text: GOV.UK frontend option 2 attributes: data-attribute: my data value - name: attributes on items hidden: true data: + id: with-item-attributes + name: with-item-attributes value: 2 items: - @@ -196,6 +216,8 @@ examples: - name: with falsey values hidden: true data: + id: with-falsey-values + name: with-falsey-values items: - text: Option 1 @@ -208,25 +230,50 @@ examples: hidden: true data: id: select-with-hint + name: select-with-hint hint: text: Hint text goes here - name: hint and describedBy hidden: true data: id: select-with-hint + name: select-with-hint describedBy: some-id hint: text: Hint text goes here + items: + - + value: 1 + text: GOV.UK frontend option 1 + - + value: 2 + text: GOV.UK frontend option 2 - name: error hidden: true data: id: select-with-error + name: select-with-error errorMessage: text: Error message + items: + - + value: 1 + text: GOV.UK frontend option 1 + - + value: 2 + text: GOV.UK frontend option 2 - name: error and describedBy hidden: true data: id: select-with-error + name: select-with-error describedBy: some-id errorMessage: text: Error message + items: + - + value: 1 + text: GOV.UK frontend option 1 + - + value: 2 + text: GOV.UK frontend option 2 From eb02b2561737ddfc90c4ca135137868fe0b28744 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 15:00:49 +0100 Subject: [PATCH 20/28] Skip link - add required fields to examples --- src/govuk/components/skip-link/skip-link.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/govuk/components/skip-link/skip-link.yaml b/src/govuk/components/skip-link/skip-link.yaml index 57f34c3bef..ffb9593b93 100644 --- a/src/govuk/components/skip-link/skip-link.yaml +++ b/src/govuk/components/skip-link/skip-link.yaml @@ -40,6 +40,7 @@ examples: - name: custom href hidden: true data: + text: Skip to custom content href: "#custom" - name: custom text hidden: true @@ -56,10 +57,12 @@ examples: - name: classes hidden: true data: + text: Skip link classes: app-skip-link--custom-class - name: attributes hidden: true data: + text: Skip link attributes: data-test: attribute aria-label: Skip to content From 3f0bc3d696b6a74fbf474c8787bfb57c04939501 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 15:05:58 +0100 Subject: [PATCH 21/28] Summary list - add required fields to examples --- .../components/summary-list/summary-list.yaml | 61 ++++++++++++++++--- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/src/govuk/components/summary-list/summary-list.yaml b/src/govuk/components/summary-list/summary-list.yaml index 0301bf1620..d91fba29cf 100644 --- a/src/govuk/components/summary-list/summary-list.yaml +++ b/src/govuk/components/summary-list/summary-list.yaml @@ -550,6 +550,11 @@ examples: - name: attributes hidden: true data: + rows: + - key: + text: Name + value: + text: Firstname Lastname attributes: data-attribute-1: value-1 data-attribute-2: value-2 @@ -559,17 +564,23 @@ examples: rows: - key: text: Name + value: + text: Firstname Lastname - null - false - "" - key: text: Name 2 + value: + text: Firstname2 Lastname2 - name: key with html hidden: true data: rows: - key: html: Name + value: + html: Firstname Lastname - name: key with classes hidden: true data: @@ -577,40 +588,62 @@ examples: - key: text: Name classes: app-custom-class + value: + text: Firstname Lastname - name: value with html hidden: true data: rows: - key: + text: Name value: html: email@email.com - name: actions href hidden: true data: rows: - - actions: + - key: + text: Name + value: + text: Firstname Lastname + actions: items: - href: https://www.gov.uk + text: Go to GOV.UK - name: actions with html hidden: true data: rows: - - actions: + - key: + text: Name + value: + text: Firstname Lastname + actions: items: - html: Edit name + href: "#" - name: actions with classes hidden: true data: rows: - - actions: + - key: + text: Name + value: + text: Firstname Lastname + actions: classes: app-custom-class items: - text: Edit + href: "/edit" - name: actions with attributes hidden: true data: rows: - - actions: + - key: + text: Name + value: + text: Firstname Lastname + actions: items: - text: Edit href: '#' @@ -621,7 +654,11 @@ examples: hidden: true data: rows: - - actions: + - key: + text: Name + value: + text: Firstname Lastname + actions: items: - text: First action href: '#' @@ -629,7 +666,11 @@ examples: hidden: true data: rows: - - actions: + - key: + text: Name + value: + text: Firstname Lastname + actions: items: - text: Edit href: '#' @@ -638,7 +679,11 @@ examples: hidden: true data: rows: - - actions: + - key: + text: Name + value: + text: Firstname Lastname + actions: items: [] - name: rows with classes hidden: true @@ -646,5 +691,7 @@ examples: rows: - key: text: Name + value: + text: Firstname Lastname classes: app-custom-class From a7d310b0df6224c87edecbe05ea58c4dbe02712c Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 15:08:08 +0100 Subject: [PATCH 22/28] Table - add required fields to examples --- src/govuk/components/table/table.yaml | 28 +++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/govuk/components/table/table.yaml b/src/govuk/components/table/table.yaml index 136c117cfb..ca4142e6fb 100644 --- a/src/govuk/components/table/table.yaml +++ b/src/govuk/components/table/table.yaml @@ -171,33 +171,45 @@ examples: hidden: true data: classes: custom-class-goes-here + rows: + - + - text: Jan + - text: Feb - name: attributes hidden: true data: attributes: data-foo: bar + rows: + - + - text: Jan + - text: Feb - name: html as text hidden: true data: head: - text: Foo rows: - - - - text: Foo + - + - text: Foo - name: html hidden: true data: head: - html: Foo bar rows: - - - - html: Foo bar + - + - html: Foo bar - name: head with classes hidden: true data: head: - text: Foo classes: my-custom-class + rows: + - + - text: Jan + - text: Feb - name: head with rowspan and colspan hidden: true data: @@ -205,12 +217,20 @@ examples: - text: Foo rowspan: 2 colspan: 2 + rows: + - + - text: Jan + - text: Feb - name: head with attributes hidden: true data: head: - attributes: data-fizz: buzz + rows: + - + - text: Jan + - text: Feb - name: with firstCellIsHeader true hidden: true data: From 8dd6a4006da1acb63809e18eb820cd0e63f38b86 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 15:10:31 +0100 Subject: [PATCH 23/28] Tabs - add required fields to examples --- src/govuk/components/tabs/tabs.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/govuk/components/tabs/tabs.yaml b/src/govuk/components/tabs/tabs.yaml index 430fb97cec..1d29b8ef44 100644 --- a/src/govuk/components/tabs/tabs.yaml +++ b/src/govuk/components/tabs/tabs.yaml @@ -206,25 +206,47 @@ examples: hidden: true data: classes: app-tabs--custom-modifier + items: + - label: Tab 1 + id: tab-1 + panel: + text: Information about tabs - name: id hidden: true data: id: my-tabs + items: + - label: Tab 1 + id: tab-1 + panel: + text: Information about tabs - name: title hidden: true data: title: Custom title for Contents + items: + - label: Tab 1 + id: tab-1 + panel: + text: Information about tabs - name: attributes hidden: true data: attributes: data-attribute: my data value + items: + - label: Tab 1 + id: tab-1 + panel: + text: Information about tabs - name: item with attributes hidden: true data: items: - id: tab-1 label: Tab 1 + panel: + text: Information about tabs attributes: data-attribute: my-attribute data-attribute-2: my-attribute-2 @@ -279,9 +301,11 @@ examples: data: items: - label: Tab 1 + id: tab-1 panel: text:

Panel 1 content

- label: Tab 2 + id: tab-2 panel: text:

Panel 2 content

- name: html @@ -289,9 +313,11 @@ examples: data: items: - label: Tab 1 + id: tab-1 panel: html:

Panel 1 content

- label: Tab 2 + id: tab-2 panel: html:

Panel 2 content

From 1f3c11619869462c21ff71e29e43bf8410409ae0 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 15:13:08 +0100 Subject: [PATCH 24/28] Textarea - add required fields to examples --- src/govuk/components/textarea/textarea.yaml | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/govuk/components/textarea/textarea.yaml b/src/govuk/components/textarea/textarea.yaml index 2022c78165..da657f6053 100644 --- a/src/govuk/components/textarea/textarea.yaml +++ b/src/govuk/components/textarea/textarea.yaml @@ -149,25 +149,44 @@ examples: - name: classes hidden: true data: + id: with-classes + name: with-classes + label: + text: With classes classes: app-textarea--custom-modifier - name: attributes hidden: true data: + id: with-attributes + name: with-attributes + label: + text: With attributes attributes: data-attribute: my data value - name: with describedBy hidden: true data: + id: with-describedby + name: with-describedby + label: + text: With describedBy describedBy: some-id - name: with hint and described by hidden: true data: + id: with-hint-describedby + name: with-hint-describedby + label: + text: With hint and describedBy describedBy: some-id hint: text: It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’. - name: with error message and described by hidden: true data: + name: textarea-with-error + label: + text: Textarea with error describedBy: some-id id: textarea-with-error errorMessage: @@ -175,6 +194,10 @@ examples: - name: with hint and error message hidden: true data: + id: with-hint-error + name: with-hint-error + label: + text: With hint and error errorMessage: text: Error message hint: @@ -182,6 +205,10 @@ examples: - name: with hint, error message and described by hidden: true data: + id: with-hint-error-describedby + name: with-hint-error-describedby + label: + text: With hint, error and describedBy describedBy: some-id errorMessage: text: Error message From 2b325df5f1593a3c898808bb9b703a6350dfb963 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Fri, 16 Oct 2020 15:13:55 +0100 Subject: [PATCH 25/28] Warning text - add required fields to examples --- src/govuk/components/warning-text/warning-text.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/govuk/components/warning-text/warning-text.yaml b/src/govuk/components/warning-text/warning-text.yaml index 8a6cefe416..a574d4fa4f 100644 --- a/src/govuk/components/warning-text/warning-text.yaml +++ b/src/govuk/components/warning-text/warning-text.yaml @@ -34,6 +34,8 @@ examples: - name: attributes hidden: true data: + text: You can be fined up to £5,000 if you don’t register. + iconFallbackText: Warning attributes: id: my-warning-text data-test: attribute @@ -46,10 +48,13 @@ examples: - name: html hidden: true data: + text: You can be fined up to £5,000 if you don’t register. + iconFallbackText: Warning html: Some custom warning text - name: html as text hidden: true data: + iconFallbackText: Warning text: Some custom warning text - name: icon fallback text only hidden: true From d0d625ad8eaea1421887eb422f0e64f5b5a56726 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Tue, 27 Oct 2020 16:54:08 +0000 Subject: [PATCH 26/28] Remove no-data date input example --- src/govuk/components/date-input/date-input.yaml | 3 --- src/govuk/components/date-input/template.test.js | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/govuk/components/date-input/date-input.yaml b/src/govuk/components/date-input/date-input.yaml index 12b423c035..86c1c13bff 100644 --- a/src/govuk/components/date-input/date-input.yaml +++ b/src/govuk/components/date-input/date-input.yaml @@ -270,9 +270,6 @@ examples: data-example-year: year # Hidden examples are not shown in the review app, but are used for tests and HTML fixtures -- name: no data - hidden: true - data: {} - name: classes hidden: true data: diff --git a/src/govuk/components/date-input/template.test.js b/src/govuk/components/date-input/template.test.js index f2975dbb78..3d14c6cbab 100644 --- a/src/govuk/components/date-input/template.test.js +++ b/src/govuk/components/date-input/template.test.js @@ -94,7 +94,7 @@ describe('Date input', () => { }) it('renders with default items', () => { - const $ = render('date-input', examples['no data']) + const $ = render('date-input', examples.default) const $items = $('.govuk-date-input__item') const $firstItemInput = $('.govuk-date-input:first-child .govuk-date-input__input') From da7b4f6369886dfe4f8e31e6095789ef88e0238a Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Wed, 28 Oct 2020 09:31:41 +0000 Subject: [PATCH 27/28] Warning text: remove invalid example and test --- src/govuk/components/warning-text/template.test.js | 7 ------- src/govuk/components/warning-text/warning-text.yaml | 4 ---- 2 files changed, 11 deletions(-) diff --git a/src/govuk/components/warning-text/template.test.js b/src/govuk/components/warning-text/template.test.js index f8bacaf77e..2552b4132f 100644 --- a/src/govuk/components/warning-text/template.test.js +++ b/src/govuk/components/warning-text/template.test.js @@ -48,13 +48,6 @@ describe('Warning text', () => { expect($component.hasClass('govuk-warning-text--custom-class')).toBeTruthy() }) - it('renders with text option only', () => { - const $ = render('warning-text', examples['text only']) - - const $component = $('.govuk-warning-text') - expect($component.html()).toContain('Some custom warning text') - }) - it('renders custom assistive text', () => { const $ = render('warning-text', examples['icon fallback text only']) diff --git a/src/govuk/components/warning-text/warning-text.yaml b/src/govuk/components/warning-text/warning-text.yaml index a574d4fa4f..4bf2b3f690 100644 --- a/src/govuk/components/warning-text/warning-text.yaml +++ b/src/govuk/components/warning-text/warning-text.yaml @@ -60,7 +60,3 @@ examples: hidden: true data: iconFallbackText: Some custom fallback text - - name: text only - hidden: true - data: - text: Some custom warning text From 49c530882a7379bd87315faf5332bb0f36910c26 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Wed, 28 Oct 2020 09:55:13 +0000 Subject: [PATCH 28/28] Mark label for attribute as not required --- src/govuk/components/label/label.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/govuk/components/label/label.yaml b/src/govuk/components/label/label.yaml index dae460ce8e..e5f6829870 100644 --- a/src/govuk/components/label/label.yaml +++ b/src/govuk/components/label/label.yaml @@ -9,7 +9,7 @@ params: description: If `text` is set, this is not required. HTML to use within the label. If `html` is provided, the `text` argument will be ignored. - name: for type: string - required: true + required: false description: The value of the for attribute, the id of the input the label is associated with. - name: isPageHeading type: boolean