diff --git a/CHANGELOG.md b/CHANGELOG.md index 75be3a72..8cb03beb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + +- Changed `attributes` to `formGroupAttributes` and `classes` to `formClasses` on checkboxes and radios - `attributes` and `classes` now get applied to each checkbox and radio element + ### Deprecated ### Removed ### Fixed diff --git a/src/nationalarchives/components/checkboxes/macro-options.json b/src/nationalarchives/components/checkboxes/macro-options.json index 1af137a5..6e7892d4 100644 --- a/src/nationalarchives/components/checkboxes/macro-options.json +++ b/src/nationalarchives/components/checkboxes/macro-options.json @@ -87,16 +87,28 @@ "required": false, "description": "" }, + { + "name": "formGroupClasses", + "type": "string", + "required": false, + "description": "Classes to add to the checkboxes form group." + }, + { + "name": "formGroupAttributes", + "type": "string", + "required": false, + "description": "HTML attributes (for example data attributes) to add to the checkboxes form group." + }, { "name": "classes", "type": "string", "required": false, - "description": "Classes to add to the checkboxes." + "description": "Classes to add to the checkbox elements." }, { "name": "attributes", "type": "object", "required": false, - "description": "HTML attributes (for example data attributes) to add to the checkboxes." + "description": "HTML attributes (for example data attributes) to add to the checkbox elements." } ] diff --git a/src/nationalarchives/components/checkboxes/template.njk b/src/nationalarchives/components/checkboxes/template.njk index 9656e9a8..99119748 100644 --- a/src/nationalarchives/components/checkboxes/template.njk +++ b/src/nationalarchives/components/checkboxes/template.njk @@ -2,7 +2,7 @@ {%- if params.inline -%} {%- set containerClasses = containerClasses.concat('tna-form__group--inline') -%} {%- endif -%} -
+
@@ -22,7 +22,7 @@
{%- for item in params.items %}
- + diff --git a/src/nationalarchives/components/radios/macro-options.json b/src/nationalarchives/components/radios/macro-options.json index 60929808..5a267824 100644 --- a/src/nationalarchives/components/radios/macro-options.json +++ b/src/nationalarchives/components/radios/macro-options.json @@ -87,16 +87,28 @@ "required": false, "description": "" }, + { + "name": "formGroupClasses", + "type": "string", + "required": false, + "description": "Classes to add to the radios form group." + }, + { + "name": "formGroupAttributes", + "type": "string", + "required": false, + "description": "HTML attributes (for example data attributes) to add to the radios form group." + }, { "name": "classes", "type": "string", "required": false, - "description": "Classes to add to the radios." + "description": "Classes to add to the radio elements." }, { "name": "attributes", "type": "object", "required": false, - "description": "HTML attributes (for example data attributes) to add to the radios." + "description": "HTML attributes (for example data attributes) to add to the radio elements." } ] diff --git a/src/nationalarchives/components/radios/template.njk b/src/nationalarchives/components/radios/template.njk index de6e1a45..69b4dacd 100644 --- a/src/nationalarchives/components/radios/template.njk +++ b/src/nationalarchives/components/radios/template.njk @@ -2,7 +2,7 @@ {%- if params.inline -%} {%- set containerClasses = containerClasses.concat('tna-form__group--inline') -%} {%- endif -%} -
+
@@ -22,7 +22,7 @@
{%- for item in params.items %}
- +