diff --git a/packages/govuk-frontend/src/govuk/components/character-count/character-count.yaml b/packages/govuk-frontend/src/govuk/components/character-count/character-count.yaml index b9af4bb2e6b..d22764c22ba 100644 --- a/packages/govuk-frontend/src/govuk/components/character-count/character-count.yaml +++ b/packages/govuk-frontend/src/govuk/components/character-count/character-count.yaml @@ -55,6 +55,12 @@ params: type: object required: false description: HTML attributes (for example data attributes) to add to the form group. + - name: beforeHtml + type: string + description: HTML to add before the form group content, within the form group. + - name: afterHtml + type: string + description: HTML to add after the form group content, within the form group. - name: classes type: string required: false diff --git a/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.yaml b/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.yaml index c32b4771cf9..f1df910cd46 100644 --- a/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.yaml +++ b/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.yaml @@ -31,6 +31,12 @@ params: type: object required: false description: HTML attributes (for example data attributes) to add to the form group. + - name: beforeHtml + type: string + description: HTML to add before the form group content, within the form group. + - name: afterHtml + type: string + description: HTML to add after the form group content, within the form group. - name: idPrefix type: string required: false diff --git a/packages/govuk-frontend/src/govuk/components/checkboxes/template.njk b/packages/govuk-frontend/src/govuk/components/checkboxes/template.njk index 2daefaf04ea..241371f100e 100644 --- a/packages/govuk-frontend/src/govuk/components/checkboxes/template.njk +++ b/packages/govuk-frontend/src/govuk/components/checkboxes/template.njk @@ -104,6 +104,7 @@ {% endset -%}
+{% if params.formGroup.beforeHtml %}{{ params.formGroup.beforeHtml | safe | indent(2, true) }}{% endif %} {% if params.fieldset %} {% call govukFieldset({ describedBy: describedBy, @@ -116,4 +117,5 @@ {% else %} {{ innerHtml | trim | safe }} {% endif %} +{% if params.formGroup.afterHtml %}{{ params.formGroup.afterHtml | safe | indent(2, true) }}{% endif %}
diff --git a/packages/govuk-frontend/src/govuk/components/date-input/date-input.yaml b/packages/govuk-frontend/src/govuk/components/date-input/date-input.yaml index b1d31f717d0..b3f050b88af 100644 --- a/packages/govuk-frontend/src/govuk/components/date-input/date-input.yaml +++ b/packages/govuk-frontend/src/govuk/components/date-input/date-input.yaml @@ -67,6 +67,12 @@ params: type: object required: false description: HTML attributes (for example data attributes) to add to the form group. + - name: beforeHtml + type: string + description: HTML to add before the form group content, within the form group. + - name: afterHtml + type: string + description: HTML to add after the form group content, within the form group. - name: fieldset type: object required: false diff --git a/packages/govuk-frontend/src/govuk/components/date-input/template.njk b/packages/govuk-frontend/src/govuk/components/date-input/template.njk index 42aa0d4c3ab..f074765bfe7 100644 --- a/packages/govuk-frontend/src/govuk/components/date-input/template.njk +++ b/packages/govuk-frontend/src/govuk/components/date-input/template.njk @@ -77,6 +77,7 @@ {% endset -%}
+{% if params.formGroup.beforeHtml %}{{ params.formGroup.beforeHtml | safe | indent(2, true) }}{% endif %} {% if params.fieldset %} {#- We override the fieldset's role to 'group' because otherwise JAWS does not announce the description for a fieldset comprised of text inputs, but @@ -94,4 +95,5 @@ {% else %} {{ innerHtml | trim | safe }} {% endif %} +{% if params.formGroup.afterHtml %}{{ params.formGroup.afterHtml | safe | indent(2, true) }}{% endif %}
diff --git a/packages/govuk-frontend/src/govuk/components/file-upload/file-upload.yaml b/packages/govuk-frontend/src/govuk/components/file-upload/file-upload.yaml index 9bfdb03c8be..97608064215 100644 --- a/packages/govuk-frontend/src/govuk/components/file-upload/file-upload.yaml +++ b/packages/govuk-frontend/src/govuk/components/file-upload/file-upload.yaml @@ -47,6 +47,12 @@ params: type: object required: false description: HTML attributes (for example data attributes) to add to the form group. + - name: beforeHtml + type: string + description: HTML to add before the form group content, within the form group. + - name: afterHtml + type: string + description: HTML to add after the form group content, within the form group. - name: classes type: string required: false diff --git a/packages/govuk-frontend/src/govuk/components/file-upload/template.njk b/packages/govuk-frontend/src/govuk/components/file-upload/template.njk index ee5cd01dbf3..137f33a0d79 100644 --- a/packages/govuk-frontend/src/govuk/components/file-upload/template.njk +++ b/packages/govuk-frontend/src/govuk/components/file-upload/template.njk @@ -6,6 +6,7 @@ aria-describedby – for example hints or error messages -#} {% set describedBy = params.describedBy if params.describedBy else "" %}
+{% if params.formGroup.beforeHtml %}{{ params.formGroup.beforeHtml | safe | indent(2, true) }}{% endif %} {{ govukLabel({ html: params.label.html, text: params.label.text, @@ -42,4 +43,5 @@ {%- if params.disabled %} disabled{% endif %} {%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %} {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}> +{% if params.formGroup.afterHtml %}{{ params.formGroup.afterHtml | safe | indent(2, true) }}{% endif %}
diff --git a/packages/govuk-frontend/src/govuk/components/input/input.yaml b/packages/govuk-frontend/src/govuk/components/input/input.yaml index fae40ceef46..a1072c5c284 100644 --- a/packages/govuk-frontend/src/govuk/components/input/input.yaml +++ b/packages/govuk-frontend/src/govuk/components/input/input.yaml @@ -97,6 +97,12 @@ params: type: object required: false description: HTML attributes (for example data attributes) to add to the form group. + - name: beforeHtml + type: string + description: HTML to add before the form group content, within the form group. + - name: afterHtml + type: string + description: HTML to add after the form group content, within the form group. - name: classes type: string required: false diff --git a/packages/govuk-frontend/src/govuk/components/input/template.njk b/packages/govuk-frontend/src/govuk/components/input/template.njk index 9fea708e4c9..3bc7c6fe4d3 100644 --- a/packages/govuk-frontend/src/govuk/components/input/template.njk +++ b/packages/govuk-frontend/src/govuk/components/input/template.njk @@ -7,6 +7,7 @@ {% set describedBy = params.describedBy if params.describedBy else "" -%}
+{% if params.formGroup.beforeHtml %}{{ params.formGroup.beforeHtml | safe | indent(2, true) }}{% endif %} {{ govukLabel({ html: params.label.html, text: params.label.text, @@ -64,5 +65,5 @@ {% endif -%} {%- if params.prefix or params.suffix %}
{% endif %} - +{% if params.formGroup.afterHtml %}{{ params.formGroup.afterHtml | safe | indent(2, true) }}{% endif %} diff --git a/packages/govuk-frontend/src/govuk/components/radios/radios.yaml b/packages/govuk-frontend/src/govuk/components/radios/radios.yaml index 3a21c699a6e..93eb5acbc6e 100644 --- a/packages/govuk-frontend/src/govuk/components/radios/radios.yaml +++ b/packages/govuk-frontend/src/govuk/components/radios/radios.yaml @@ -27,6 +27,12 @@ params: type: object required: false description: HTML attributes (for example data attributes) to add to the form group. + - name: beforeHtml + type: string + description: HTML to add before the form group content, within the form group. + - name: afterHtml + type: string + description: HTML to add after the form group content, within the form group. - name: idPrefix type: string required: false diff --git a/packages/govuk-frontend/src/govuk/components/radios/template.njk b/packages/govuk-frontend/src/govuk/components/radios/template.njk index 57fbc794194..731a4ad9def 100644 --- a/packages/govuk-frontend/src/govuk/components/radios/template.njk +++ b/packages/govuk-frontend/src/govuk/components/radios/template.njk @@ -94,6 +94,7 @@ {% endset -%}
+{% if params.formGroup.beforeHtml %}{{ params.formGroup.beforeHtml | safe | indent(2, true) }}{% endif %} {% if params.fieldset %} {% call govukFieldset({ describedBy: describedBy, @@ -106,4 +107,5 @@ {% else %} {{ innerHtml | trim | safe }} {% endif %} +{% if params.formGroup.afterHtml %}{{ params.formGroup.afterHtml | safe | indent(2, true) }}{% endif %}
diff --git a/packages/govuk-frontend/src/govuk/components/select/select.yaml b/packages/govuk-frontend/src/govuk/components/select/select.yaml index b5ca85f5e99..821adbfc56e 100644 --- a/packages/govuk-frontend/src/govuk/components/select/select.yaml +++ b/packages/govuk-frontend/src/govuk/components/select/select.yaml @@ -72,6 +72,12 @@ params: type: object required: false description: HTML attributes (for example data attributes) to add to the form group. + - name: beforeHtml + type: string + description: HTML to add before the form group content, within the form group. + - name: afterHtml + type: string + description: HTML to add after the form group content, within the form group. - name: classes type: string required: false diff --git a/packages/govuk-frontend/src/govuk/components/select/template.njk b/packages/govuk-frontend/src/govuk/components/select/template.njk index 9f04c83b737..f57a7d53372 100644 --- a/packages/govuk-frontend/src/govuk/components/select/template.njk +++ b/packages/govuk-frontend/src/govuk/components/select/template.njk @@ -6,6 +6,7 @@ aria-describedby – for example hints or error messages -#} {% set describedBy = params.describedBy if params.describedBy else "" %}
+{% if params.formGroup.beforeHtml %}{{ params.formGroup.beforeHtml | safe | indent(2, true) }}{% endif %} {{ govukLabel({ html: params.label.html, text: params.label.text, @@ -53,4 +54,5 @@ {% endif %} {% endfor %} +{% if params.formGroup.afterHtml %}{{ params.formGroup.afterHtml | safe | indent(2, true) }}{% endif %}
diff --git a/packages/govuk-frontend/src/govuk/components/textarea/template.njk b/packages/govuk-frontend/src/govuk/components/textarea/template.njk index 660e86363f4..dd949477297 100644 --- a/packages/govuk-frontend/src/govuk/components/textarea/template.njk +++ b/packages/govuk-frontend/src/govuk/components/textarea/template.njk @@ -6,6 +6,7 @@ aria-describedby – for example hints or error messages -#} {% set describedBy = params.describedBy if params.describedBy else "" %}
+{% if params.formGroup.beforeHtml %}{{ params.formGroup.beforeHtml | safe | indent(2, true) }}{% endif %} {{ govukLabel({ html: params.label.html, text: params.label.text, @@ -43,4 +44,5 @@ {%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %} {%- if params.autocomplete %} autocomplete="{{ params.autocomplete }}"{% endif %} {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>{{ params.value }} + {% if params.formGroup.afterHtml %}{{ params.formGroup.afterHtml | safe | indent(2, true) }}{% endif %}
diff --git a/packages/govuk-frontend/src/govuk/components/textarea/textarea.yaml b/packages/govuk-frontend/src/govuk/components/textarea/textarea.yaml index f7321e40194..5732eaf945f 100644 --- a/packages/govuk-frontend/src/govuk/components/textarea/textarea.yaml +++ b/packages/govuk-frontend/src/govuk/components/textarea/textarea.yaml @@ -55,6 +55,12 @@ params: type: object required: false description: HTML attributes (for example data attributes) to add to the form group. + - name: beforeHtml + type: string + description: HTML to add before the form group content, within the form group. + - name: afterHtml + type: string + description: HTML to add after the form group content, within the form group. - name: classes type: string required: false