diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 15171f8a..5e1b5da3 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -13,15 +13,15 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - + - name: Set up Node.js uses: actions/setup-node@v2 with: node-version-file: .nvmrc - + - name: Enable corepack run: corepack enable - + - name: Set Yarn version run: yarn set version stable diff --git a/.storybook/manager.ts b/.storybook/manager.ts index 44bea631..0e2f6b66 100644 --- a/.storybook/manager.ts +++ b/.storybook/manager.ts @@ -1,16 +1,15 @@ import { addons } from '@storybook/manager-api'; import nhsTheme from './theme'; -import { startCase, upperFirst } from "lodash"; +import { startCase, upperFirst } from 'lodash'; -const sentenceCase = string => { - if (typeof string !== 'string') return '' - return upperFirst(startCase(string).toLowerCase()) -} +const sentenceCase = (string) => { + if (typeof string !== 'string') return ''; + return upperFirst(startCase(string).toLowerCase()); +}; addons.setConfig({ sidebar: { - renderLabel: ({ name, type }) => - sentenceCase(name), + renderLabel: ({ name, type }) => sentenceCase(name), }, - theme: nhsTheme + theme: nhsTheme, }); diff --git a/.storybook/preview-body.html b/.storybook/preview-body.html new file mode 100644 index 00000000..a76f826b --- /dev/null +++ b/.storybook/preview-body.html @@ -0,0 +1,4 @@ + diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html deleted file mode 100644 index 439f564f..00000000 --- a/.storybook/preview-head.html +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/.storybook/storybook.scss b/.storybook/storybook.scss index 5e3e892c..b168b639 100644 --- a/.storybook/storybook.scss +++ b/.storybook/storybook.scss @@ -1,5 +1,5 @@ // Allow current nhsuk styles to override legacy -@import '../node_modules/nhsuk-frontend/packages/nhsuk.scss'; +@import 'nhsuk-frontend/dist/nhsuk'; .tag-wrapper { display: flex; diff --git a/.vscode/launch.json b/.vscode/launch.json index df0b1c2d..f136a878 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,20 +1,16 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "request": "launch", - "name": "Launch Program", - "skipFiles": [ - "/**" - ], - "program": "${workspaceFolder}/dist/index.js", - "outFiles": [ - "${workspaceFolder}/**/*.js" - ] - } - ] -} \ No newline at end of file + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "skipFiles": ["/**"], + "program": "${workspaceFolder}/dist/index.js", + "outFiles": ["${workspaceFolder}/**/*.js"] + } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index ea44614a..5141e92b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # NHS.UK React components -## 5.0.0 - TBC +## 6.0.0-beta.0 - 30 September 2025 + +This version provides support for nhsuk-frontend version 10. + +For a full list of changes in this release please refer to the [migration doc](https://github.com/NHSDigital/nhsuk-react-components/blob/main/docs/upgrade-to-6.0.md). + +## 5.0.0 - 4 November 2024 This version provides support for nhsuk-frontend version 9. diff --git a/bundle-base.tsconfig.json b/bundle-base.tsconfig.json index 6bc40994..f2c7791e 100644 --- a/bundle-base.tsconfig.json +++ b/bundle-base.tsconfig.json @@ -23,8 +23,7 @@ "@navigation/*": ["src/components/navigation/*"], "@typography/*": ["src/components/typography/*"], "@util/*": ["src/util/*"], - "@patterns/*": ["src/patterns/*"], - "@resources/*": ["src/resources/*"] + "@patterns/*": ["src/patterns/*"] } }, "include": ["src"], diff --git a/docs/upgrade-to-2.0.md b/docs/upgrade-to-2.0.md index 16948774..e87882ac 100644 --- a/docs/upgrade-to-2.0.md +++ b/docs/upgrade-to-2.0.md @@ -1,6 +1,6 @@ # Upgrading to 2.0 -There are some breaking changes you'll need to be aware of when upgrading to v2. These are mostly related to us upgrading our dependency on [nhsuk-frontend to v4](https://github.com/nhsuk/nhsuk-frontend/blob/master/CHANGELOG.md#400---26-october-2020) which also includes some breaking changes. +There are some breaking changes you'll need to be aware of when upgrading to v2. These are mostly related to us upgrading our dependency on [nhsuk-frontend to v4](https://github.com/nhsuk/nhsuk-frontend/blob/master/CHANGELOG.md#400---26-october-2020) which also includes some breaking changes. ## New Card Component @@ -59,11 +59,11 @@ The `Panel` and `Promo` components have been removed from `nhsuk-frontend` since ```jsx // Old Imports -import { Button, Panel, Promo } from "nhsuk-react-components"; +import { Button, Panel, Promo } from 'nhsuk-react-components'; // New Imports -import { Button } from "nhsuk-react-components"; -import { Panel, Promo } from "nhsuk-react-components/dist/deprecated"; +import { Button } from 'nhsuk-react-components'; +import { Panel, Promo } from 'nhsuk-react-components/dist/deprecated'; ``` A warning is printed to the console in dev environments when using these components, as they are set to be removed in the next major release. @@ -73,7 +73,7 @@ A warning is printed to the console in dev environments when using these compone In line with the upstream nhsuk-frontend, NHS Design Kit and GDS recommendations, we now render the input boxes in the date component as follows: ```html - + ``` There is more on this change here: diff --git a/docs/upgrade-to-3.0.md b/docs/upgrade-to-3.0.md index 131eb64d..0e92b5c6 100644 --- a/docs/upgrade-to-3.0.md +++ b/docs/upgrade-to-3.0.md @@ -2,11 +2,11 @@ > v3.0 is an upcoming release, this page is a work in progress. -There are some breaking changes you'll need to be aware of when upgrading to v3. These are mostly related to us upgrading our dependency on [nhsuk-frontend to v5](https://github.com/nhsuk/nhsuk-frontend/blob/main/CHANGELOG.md#500---16-march-2021) which also includes some breaking changes. +There are some breaking changes you'll need to be aware of when upgrading to v3. These are mostly related to us upgrading our dependency on [nhsuk-frontend to v5](https://github.com/nhsuk/nhsuk-frontend/blob/main/CHANGELOG.md#500---16-march-2021) which also includes some breaking changes. ## Review Date component is now a pattern -The `ReviewDate` component has been removed from nhsuk-frontend in version 5.0.0. This component is now a `pattern` in the nhsuk-frontend library. +The `ReviewDate` component has been removed from nhsuk-frontend in version 5.0.0. This component is now a `pattern` in the nhsuk-frontend library. The only change is that the Default import has a new path. @@ -16,12 +16,12 @@ There are no functional changes to the component, and it works exactly as it did ```tsx // Old Import -import { ReviewDate } from "nhsuk-react-components"; -import ReviewDate from "nhsuk-react-components/lib/components/review-date"; +import { ReviewDate } from 'nhsuk-react-components'; +import ReviewDate from 'nhsuk-react-components/lib/components/review-date'; // New Import -import { ReviewDate } from "nhsuk-react-components"; -import ReviewDate from "nhsuk-react-components/lib/patterns/review-date"; +import { ReviewDate } from 'nhsuk-react-components'; +import ReviewDate from 'nhsuk-react-components/lib/patterns/review-date'; ``` ## NHS Logo PNG Fallback Removed @@ -38,4 +38,4 @@ In NHS.UK Frontend v5 and above, the header text now defaults to wrapping undern ## The `prefixText` prop has been added to the `DoDontList.Item` component -You can now add prefixed text to each `DoDontList.Item` component by supplying the `prefixText` prop. Items with a `type` of `dont` will automatically have a 'do not' prefix text added in the next major release to align with the NHS.UK frontend library v5. \ No newline at end of file +You can now add prefixed text to each `DoDontList.Item` component by supplying the `prefixText` prop. Items with a `type` of `dont` will automatically have a 'do not' prefix text added in the next major release to align with the NHS.UK frontend library v5. diff --git a/docs/upgrade-to-6.0.md b/docs/upgrade-to-6.0.md new file mode 100644 index 00000000..b16402ff --- /dev/null +++ b/docs/upgrade-to-6.0.md @@ -0,0 +1,466 @@ +# Upgrading to 6.0 + +There are some breaking changes you'll need to be aware of when upgrading to v6. + +[NHS.UK frontend v10.0.0](https://github.com/nhsuk/nhsuk-frontend/releases/tag/v10.0.0) introduces some breaking changes to file paths, full width buttons on mobile, the header component and others. It also stops Internet Explorer 11 and other older browsers from running NHS.UK frontend JavaScript. + +You must read and apply these updates carefully to make sure your service does not break. + +## Breaking changes + +### Update the JavaScript supported script snippet + +You must now use the NHS.UK frontend v10.x feature detection snippet to check for ` +``` + +### Update fieldset legend and label size, font weight + +To align with NHS.UK frontend, the fieldset legend and label components no longer default to size "XL" when `isPageHeading: true` is set and the `bold` prop has been removed. + +You must make the following changes to `labelProps` and `