Skip to content

Commit 41ab7e3

Browse files
Add changelog entry
1 parent 443ef0a commit 41ab7e3

1 file changed

Lines changed: 107 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,57 @@ This was added in [pull request #1685: Add card enhancement to summary list](htt
6565

6666
### :wastebasket: **Deprecated features**
6767

68+
#### Rename Nunjucks macro options for images
69+
70+
For consistency with other components, Nunjucks macro options for images have changed. The previous names are deprecated and will be removed in a future release.
71+
72+
If you're using the `card` Nunjucks macro with the `imgURL` or `imgALT` options in your service, you should:
73+
74+
- replace the `imgURL` option with the nested `image.src` option
75+
- replace the `imgALT` option with the nested `image.alt` option
76+
77+
```patch
78+
{{ card({
79+
- imgURL: "https://service-manual.nhs.uk/assets/blog-prototype-kit.png",
80+
- imgALT: "Illustration showing icons, design system components and a terminal app. Each one follows a dotted line into a laptop to become a prototype.",
81+
+ image: {
82+
+ src: "https://service-manual.nhs.uk/assets/blog-prototype-kit.png",
83+
+ alt: "Illustration showing icons, design system components and a terminal app. Each one follows a dotted line into a laptop to become a prototype."
84+
+ },
85+
heading: "Why we are reinvesting in the NHS prototype kit"
86+
}) }}
87+
```
88+
89+
If you're using the `hero` Nunjucks macro with the `imageURL` option in your service, you should:
90+
91+
- replace the `imageURL` option with the nested `image.src` option
92+
93+
```patch
94+
{{ hero({
95+
- imageURL: "https://service-manual.nhs.uk/assets/blog-prototype-kit.png"
96+
+ image: {
97+
+ src: "https://service-manual.nhs.uk/assets/blog-prototype-kit.png"
98+
+ }
99+
}) }}
100+
```
101+
102+
If you're using the `image` Nunjucks macro with the `caption` option in your service, you should:
103+
104+
- replace the `caption` option with the nested `caption.text` option
105+
106+
```patch
107+
{{ image({
108+
src: "https://service-manual.nhs.uk/assets/image-example-stretch-marks-600w.jpg",
109+
alt: "Close-up of a person's tummy showing a number of creases in the skin under their belly button. Shown on light brown skin.",
110+
- caption: "Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time."
111+
+ caption: {
112+
+ text: "Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time."
113+
+ }
114+
}) }}
115+
```
116+
117+
This change was introduced in [pull request #1763: Review Nunjucks params for header search and images](https://github.com/nhsuk/nhsuk-frontend/pull/1763).
118+
68119
#### Rename input prefix and suffix HTML class
69120

70121
HTML markup for the input component has been updated to align `nhsuk-input-wrapper` with other wrapping classes such as `nhsuk-main-wrapper` and `nhsuk-label-wrapper`.
@@ -116,6 +167,62 @@ This change was introduced in [pull request #1749: Remove font files for unsuppo
116167

117168
### :recycle: **Changes**
118169

170+
#### Update the HTML for header search
171+
172+
For consistency with header navigation and account, we’ve added new Nunjucks macro options:
173+
174+
- Header `search.attributes` option
175+
- Header `search.classes` option
176+
- Header `search.method` option
177+
178+
We've also updated the HTML for the header search to use [an inline smaller button](https://service-manual.nhs.uk/design-system/components/buttons#smaller-buttons) from [NHS.UK frontend v10.2.0](https://github.com/nhsuk/nhsuk-frontend/releases/tag/v10.2.0).
179+
180+
If you are not using Nunjucks macros, update your HTML markup using the [header examples in the NHS digital service manual](https://service-manual.nhs.uk/design-system/components/header) as follows:
181+
182+
- add the `novalidate` boolean attribute to search form element
183+
- add the `novalidate` boolean attribute to account item forms
184+
185+
```patch
186+
<search class="nhsuk-header__search">
187+
- <form class="nhsuk-header__search-form" id="search" action="https://www.nhs.uk/search/" method="get">
188+
+ <form class="nhsuk-header__search-form" id="search" action="https://www.nhs.uk/search/" method="get" novalidate>
189+
```
190+
191+
```patch
192+
- <form class="nhsuk-header__account-form" action="/log-out" method="post">
193+
+ <form class="nhsuk-header__account-form" action="/log-out" method="post" novalidate>
194+
<button class="nhsuk-header__account-button">
195+
```
196+
197+
- add the `<div class="form-group"> </div>` wrapper around the search label, input and button
198+
- add the `<div class="nhsuk-input-wrapper"> </div>` wrapper around the search input and button
199+
- add the `nhsuk-button` and `nhsuk-button--small` classes to the search button
200+
- remove the `nhsuk-header__search-submit` class from the search button
201+
202+
```patch
203+
<form class="nhsuk-header__search-form" id="search" action="https://www.nhs.uk/search/" method="get" novalidate>
204+
+ <div class="nhsuk-form-group">
205+
<label class="nhsuk-label nhsuk-u-visually-hidden" for="search-field">
206+
Search the NHS website
207+
</label>
208+
+ <div class="nhsuk-input-wrapper">
209+
<input class="nhsuk-input nhsuk-header__search-input" id="search-field" name="q" type="search" autocomplete="off" placeholder="Search">
210+
- <button class="nhsuk-header__search-submit" data-module="nhsuk-button" type="submit">
211+
+ <button class="nhsuk-button nhsuk-button--small" data-module="nhsuk-button" type="submit">
212+
<svg class="nhsuk-icon nhsuk-icon--search" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" role="img" aria-label="Search">
213+
<title>Search</title>
214+
<path d="m20.7 19.3-4.1-4.1a7 7 0 1 0-1.4 1.4l4 4.1a1 1 0 0 0 1.5 0c.4-.4.4-1 0-1.4ZM6 11a5 5 0 1 1 10 0 5 5 0 0 1-10 0Z"/>
215+
</svg>
216+
</button>
217+
+ </div>
218+
+ </div>
219+
</form>
220+
```
221+
222+
Support for header search HTML without `nhsuk-form-group` and `nhsuk-input-wrapper` wrappers is deprecated and will be removed in a future release.
223+
224+
This change was introduced in [pull request #1763: Review Nunjucks params for header search and images](https://github.com/nhsuk/nhsuk-frontend/pull/1763).
225+
119226
#### Update the HTML for responsive table cell content
120227

121228
We've updated the HTML for the responsive table component to wrap HTML content within `<span>` elements.

0 commit comments

Comments
 (0)