nhsuk-frontend 10.2.2 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nhsuk/common/configuration/extract-config-by-namespace.d.mts +2 -2
- package/dist/nhsuk/common/configuration/extract-config-by-namespace.d.mts.map +1 -1
- package/dist/nhsuk/common/configuration/extract-config-by-namespace.js +2 -2
- package/dist/nhsuk/common/configuration/extract-config-by-namespace.mjs +2 -2
- package/dist/nhsuk/common/configuration/index.js +1 -0
- package/dist/nhsuk/common/configuration/index.js.map +1 -1
- package/dist/nhsuk/common/configuration/index.mjs +1 -1
- package/dist/nhsuk/common/configuration/normalise-dataset.d.mts.map +1 -1
- package/dist/nhsuk/common/configuration/normalise-dataset.js +1 -1
- package/dist/nhsuk/common/configuration/normalise-dataset.js.map +1 -1
- package/dist/nhsuk/common/configuration/normalise-dataset.mjs +2 -2
- package/dist/nhsuk/common/configuration/normalise-dataset.mjs.map +1 -1
- package/dist/nhsuk/common/configuration/normalise-string.d.mts +9 -2
- package/dist/nhsuk/common/configuration/normalise-string.d.mts.map +1 -1
- package/dist/nhsuk/common/configuration/normalise-string.js +52 -2
- package/dist/nhsuk/common/configuration/normalise-string.js.map +1 -1
- package/dist/nhsuk/common/configuration/normalise-string.mjs +52 -3
- package/dist/nhsuk/common/configuration/normalise-string.mjs.map +1 -1
- package/dist/nhsuk/common/nhsuk-frontend-version.js +1 -1
- package/dist/nhsuk/common/nhsuk-frontend-version.mjs +1 -1
- package/dist/nhsuk/components/_index.scss +34 -22
- package/dist/nhsuk/components/_index.scss.map +1 -1
- package/dist/nhsuk/components/action-link/_index.scss +11 -11
- package/dist/nhsuk/components/action-link/_index.scss.map +1 -1
- package/dist/nhsuk/components/back-link/_index.scss +1 -1
- package/dist/nhsuk/components/back-link/_index.scss.map +1 -1
- package/dist/nhsuk/components/back-link/fixtures.json +17 -17
- package/dist/nhsuk/components/breadcrumb/fixtures.json +2 -11
- package/dist/nhsuk/components/button/_index.scss +8 -8
- package/dist/nhsuk/components/button/_index.scss.map +1 -1
- package/dist/nhsuk/components/button/button.d.mts +5 -5
- package/dist/nhsuk/components/button/button.d.mts.map +1 -1
- package/dist/nhsuk/components/button/button.js +3 -3
- package/dist/nhsuk/components/button/button.mjs +3 -3
- package/dist/nhsuk/components/button/fixtures.json +28 -28
- package/dist/nhsuk/components/card/_index.scss +177 -19
- package/dist/nhsuk/components/card/_index.scss.map +1 -1
- package/dist/nhsuk/components/card/fixtures.json +365 -19
- package/dist/nhsuk/components/card/macro-options.json +102 -6
- package/dist/nhsuk/components/card/template.njk +93 -30
- package/dist/nhsuk/components/character-count/_index.scss +4 -1
- package/dist/nhsuk/components/character-count/_index.scss.map +1 -1
- package/dist/nhsuk/components/character-count/character-count.d.mts +29 -8
- package/dist/nhsuk/components/character-count/character-count.d.mts.map +1 -1
- package/dist/nhsuk/components/character-count/character-count.js +43 -21
- package/dist/nhsuk/components/character-count/character-count.js.map +1 -1
- package/dist/nhsuk/components/character-count/character-count.mjs +43 -21
- package/dist/nhsuk/components/character-count/character-count.mjs.map +1 -1
- package/dist/nhsuk/components/checkboxes/_index.scss +18 -18
- package/dist/nhsuk/components/checkboxes/_index.scss.map +1 -1
- package/dist/nhsuk/components/checkboxes/checkboxes.d.mts +50 -8
- package/dist/nhsuk/components/checkboxes/checkboxes.d.mts.map +1 -1
- package/dist/nhsuk/components/checkboxes/checkboxes.js +66 -12
- package/dist/nhsuk/components/checkboxes/checkboxes.js.map +1 -1
- package/dist/nhsuk/components/checkboxes/checkboxes.mjs +66 -12
- package/dist/nhsuk/components/checkboxes/checkboxes.mjs.map +1 -1
- package/dist/nhsuk/components/checkboxes/fixtures.json +237 -57
- package/dist/nhsuk/components/checkboxes/template.njk +1 -1
- package/dist/nhsuk/components/contents-list/_index.scss +4 -24
- package/dist/nhsuk/components/contents-list/_index.scss.map +1 -1
- package/dist/nhsuk/components/details/_index.scss +104 -7
- package/dist/nhsuk/components/details/_index.scss.map +1 -1
- package/dist/nhsuk/components/details/fixtures.json +4 -4
- package/dist/nhsuk/components/error-summary/error-summary.d.mts +5 -5
- package/dist/nhsuk/components/error-summary/error-summary.d.mts.map +1 -1
- package/dist/nhsuk/components/error-summary/error-summary.js +3 -3
- package/dist/nhsuk/components/error-summary/error-summary.mjs +3 -3
- package/dist/nhsuk/components/fieldset/_index.scss +1 -1
- package/dist/nhsuk/components/fieldset/_index.scss.map +1 -1
- package/dist/nhsuk/components/file-upload/README.md +9 -0
- package/dist/nhsuk/components/file-upload/_file-upload.scss +3 -0
- package/dist/nhsuk/components/file-upload/_file-upload.scss.map +1 -0
- package/dist/nhsuk/components/file-upload/_index.scss +251 -0
- package/dist/nhsuk/components/file-upload/_index.scss.map +1 -0
- package/dist/nhsuk/components/file-upload/file-upload.d.mts +227 -0
- package/dist/nhsuk/components/file-upload/file-upload.d.mts.map +1 -0
- package/dist/nhsuk/components/file-upload/file-upload.js +562 -0
- package/dist/nhsuk/components/file-upload/file-upload.js.map +1 -0
- package/dist/nhsuk/components/file-upload/file-upload.mjs +559 -0
- package/dist/nhsuk/components/file-upload/file-upload.mjs.map +1 -0
- package/dist/nhsuk/components/file-upload/fixtures.json +302 -0
- package/dist/nhsuk/components/file-upload/macro-options.json +167 -0
- package/dist/nhsuk/components/file-upload/macro.njk +3 -0
- package/dist/nhsuk/components/file-upload/template.njk +108 -0
- package/dist/nhsuk/components/header/_index.scss +65 -45
- package/dist/nhsuk/components/header/_index.scss.map +1 -1
- package/dist/nhsuk/components/header/fixtures.json +17 -17
- package/dist/nhsuk/components/header/header.d.mts +74 -6
- package/dist/nhsuk/components/header/header.d.mts.map +1 -1
- package/dist/nhsuk/components/header/header.js +87 -18
- package/dist/nhsuk/components/header/header.js.map +1 -1
- package/dist/nhsuk/components/header/header.mjs +87 -18
- package/dist/nhsuk/components/header/header.mjs.map +1 -1
- package/dist/nhsuk/components/header/macro-options.json +24 -0
- package/dist/nhsuk/components/header/template.njk +64 -13
- package/dist/nhsuk/components/hero/_index.scss +16 -16
- package/dist/nhsuk/components/hero/_index.scss.map +1 -1
- package/dist/nhsuk/components/hero/fixtures.json +8 -3
- package/dist/nhsuk/components/hero/macro-options.json +17 -3
- package/dist/nhsuk/components/hero/template.njk +33 -10
- package/dist/nhsuk/components/images/fixtures.json +3 -1
- package/dist/nhsuk/components/images/macro-options.json +22 -2
- package/dist/nhsuk/components/images/template.njk +22 -5
- package/dist/nhsuk/components/index.d.mts +1 -0
- package/dist/nhsuk/components/index.js +3 -0
- package/dist/nhsuk/components/index.js.map +1 -1
- package/dist/nhsuk/components/index.mjs +1 -0
- package/dist/nhsuk/components/index.mjs.map +1 -1
- package/dist/nhsuk/components/input/_index.scss +19 -2
- package/dist/nhsuk/components/input/_index.scss.map +1 -1
- package/dist/nhsuk/components/input/fixtures.json +8 -8
- package/dist/nhsuk/components/input/macro-options.json +6 -0
- package/dist/nhsuk/components/input/template.njk +5 -1
- package/dist/nhsuk/components/notification-banner/notification-banner.d.mts +5 -5
- package/dist/nhsuk/components/notification-banner/notification-banner.d.mts.map +1 -1
- package/dist/nhsuk/components/notification-banner/notification-banner.js +3 -3
- package/dist/nhsuk/components/notification-banner/notification-banner.mjs +3 -3
- package/dist/nhsuk/components/pagination/_index.scss +1 -1
- package/dist/nhsuk/components/pagination/_index.scss.map +1 -1
- package/dist/nhsuk/components/panel/_index.scss +34 -0
- package/dist/nhsuk/components/panel/_index.scss.map +1 -1
- package/dist/nhsuk/components/panel/fixtures.json +90 -0
- package/dist/nhsuk/components/panel/macro-options.json +12 -0
- package/dist/nhsuk/components/panel/template.njk +27 -5
- package/dist/nhsuk/components/password-input/password-input.d.mts +12 -5
- package/dist/nhsuk/components/password-input/password-input.d.mts.map +1 -1
- package/dist/nhsuk/components/password-input/password-input.js +17 -9
- package/dist/nhsuk/components/password-input/password-input.js.map +1 -1
- package/dist/nhsuk/components/password-input/password-input.mjs +17 -9
- package/dist/nhsuk/components/password-input/password-input.mjs.map +1 -1
- package/dist/nhsuk/components/radios/_index.scss +10 -10
- package/dist/nhsuk/components/radios/_index.scss.map +1 -1
- package/dist/nhsuk/components/radios/fixtures.json +192 -10
- package/dist/nhsuk/components/radios/radios.d.mts +50 -8
- package/dist/nhsuk/components/radios/radios.d.mts.map +1 -1
- package/dist/nhsuk/components/radios/radios.js +66 -12
- package/dist/nhsuk/components/radios/radios.js.map +1 -1
- package/dist/nhsuk/components/radios/radios.mjs +66 -12
- package/dist/nhsuk/components/radios/radios.mjs.map +1 -1
- package/dist/nhsuk/components/radios/template.njk +1 -1
- package/dist/nhsuk/components/select/_index.scss +1 -1
- package/dist/nhsuk/components/select/_index.scss.map +1 -1
- package/dist/nhsuk/components/skip-link/_index.scss +1 -1
- package/dist/nhsuk/components/skip-link/_index.scss.map +1 -1
- package/dist/nhsuk/components/skip-link/skip-link.d.mts +38 -7
- package/dist/nhsuk/components/skip-link/skip-link.d.mts.map +1 -1
- package/dist/nhsuk/components/skip-link/skip-link.js +60 -16
- package/dist/nhsuk/components/skip-link/skip-link.js.map +1 -1
- package/dist/nhsuk/components/skip-link/skip-link.mjs +60 -16
- package/dist/nhsuk/components/skip-link/skip-link.mjs.map +1 -1
- package/dist/nhsuk/components/summary-list/_index.scss +46 -36
- package/dist/nhsuk/components/summary-list/_index.scss.map +1 -1
- package/dist/nhsuk/components/summary-list/fixtures.json +459 -19
- package/dist/nhsuk/components/summary-list/macro-options.json +7 -0
- package/dist/nhsuk/components/summary-list/template.njk +24 -11
- package/dist/nhsuk/components/tables/_index.scss +16 -1
- package/dist/nhsuk/components/tables/_index.scss.map +1 -1
- package/dist/nhsuk/components/tables/fixtures.json +306 -66
- package/dist/nhsuk/components/tables/macro-options.json +8 -13
- package/dist/nhsuk/components/tables/template.njk +28 -19
- package/dist/nhsuk/components/tabs/_index.scss +2 -10
- package/dist/nhsuk/components/tabs/_index.scss.map +1 -1
- package/dist/nhsuk/components/tabs/fixtures.json +5 -5
- package/dist/nhsuk/components/tabs/tabs.d.mts +66 -8
- package/dist/nhsuk/components/tabs/tabs.d.mts.map +1 -1
- package/dist/nhsuk/components/tabs/tabs.js +120 -24
- package/dist/nhsuk/components/tabs/tabs.js.map +1 -1
- package/dist/nhsuk/components/tabs/tabs.mjs +120 -24
- package/dist/nhsuk/components/tabs/tabs.mjs.map +1 -1
- package/dist/nhsuk/components/task-list/_index.scss +4 -4
- package/dist/nhsuk/components/task-list/_index.scss.map +1 -1
- package/dist/nhsuk/components/textarea/_index.scss +2 -2
- package/dist/nhsuk/components/textarea/_index.scss.map +1 -1
- package/dist/nhsuk/components/warning-callout/_index.scss +1 -0
- package/dist/nhsuk/components/warning-callout/_index.scss.map +1 -1
- package/dist/nhsuk/components/warning-callout/fixtures.json +2 -2
- package/dist/nhsuk/components/warning-callout/template.njk +16 -20
- package/dist/nhsuk/configurable-component.d.mts +3 -3
- package/dist/nhsuk/configurable-component.d.mts.map +1 -1
- package/dist/nhsuk/configurable-component.js +3 -3
- package/dist/nhsuk/configurable-component.mjs +3 -3
- package/dist/nhsuk/core/_nhsuk-frontend-properties.scss +1 -1
- package/dist/nhsuk/core/elements/_page.scss +36 -16
- package/dist/nhsuk/core/elements/_page.scss.map +1 -1
- package/dist/nhsuk/core/elements/_table.scss +1 -1
- package/dist/nhsuk/core/elements/_table.scss.map +1 -1
- package/dist/nhsuk/core/generic/_font-face.scss +26 -18
- package/dist/nhsuk/core/generic/_font-face.scss.map +1 -1
- package/dist/nhsuk/core/objects/_button-group.scss +9 -11
- package/dist/nhsuk/core/objects/_button-group.scss.map +1 -1
- package/dist/nhsuk/core/objects/_input-wrapper.scss +1 -0
- package/dist/nhsuk/core/objects/_input-wrapper.scss.map +1 -1
- package/dist/nhsuk/core/settings/_breakpoints.scss +16 -1
- package/dist/nhsuk/core/settings/_breakpoints.scss.map +1 -1
- package/dist/nhsuk/core/settings/_globals.scss +119 -15
- package/dist/nhsuk/core/settings/_globals.scss.map +1 -1
- package/dist/nhsuk/core/settings/_typography.scss +1 -1
- package/dist/nhsuk/core/settings/_typography.scss.map +1 -1
- package/dist/nhsuk/core/styles/_lists.scss +2 -2
- package/dist/nhsuk/core/styles/_lists.scss.map +1 -1
- package/dist/nhsuk/core/styles/_typography.scss +12 -10
- package/dist/nhsuk/core/styles/_typography.scss.map +1 -1
- package/dist/nhsuk/core/tools/_buttons.scss +2 -1
- package/dist/nhsuk/core/tools/_buttons.scss.map +1 -1
- package/dist/nhsuk/core/tools/_functions.scss +18 -4
- package/dist/nhsuk/core/tools/_functions.scss.map +1 -1
- package/dist/nhsuk/core/tools/_index.scss +1 -0
- package/dist/nhsuk/core/tools/_index.scss.map +1 -1
- package/dist/nhsuk/core/tools/_links.scss +1 -0
- package/dist/nhsuk/core/tools/_links.scss.map +1 -1
- package/dist/nhsuk/core/tools/_mixins.scss +51 -32
- package/dist/nhsuk/core/tools/_mixins.scss.map +1 -1
- package/dist/nhsuk/core/tools/_sass-mq.scss +1 -5
- package/dist/nhsuk/core/tools/_sass-mq.scss.map +1 -1
- package/dist/nhsuk/core/tools/_shape-arrow.scss +2 -0
- package/dist/nhsuk/core/tools/_shape-arrow.scss.map +1 -1
- package/dist/nhsuk/core/tools/_shape-chevron.scss +2 -2
- package/dist/nhsuk/core/tools/_shape-chevron.scss.map +1 -1
- package/dist/nhsuk/core/tools/_shape-dash.scss +31 -0
- package/dist/nhsuk/core/tools/_shape-dash.scss.map +1 -0
- package/dist/nhsuk/core/tools/_spacing.scss +23 -9
- package/dist/nhsuk/core/tools/_spacing.scss.map +1 -1
- package/dist/nhsuk/core/tools/_typography.scss +56 -19
- package/dist/nhsuk/core/tools/_typography.scss.map +1 -1
- package/dist/nhsuk/core/utilities/_list-border.scss +2 -1
- package/dist/nhsuk/core/utilities/_list-border.scss.map +1 -1
- package/dist/nhsuk/core/vendor/sass-mq.scss +1 -1
- package/dist/nhsuk/core/vendor/sass-mq.scss.map +1 -1
- package/dist/nhsuk/index.d.mts +34 -0
- package/dist/nhsuk/index.d.mts.map +1 -1
- package/dist/nhsuk/index.js +16 -1
- package/dist/nhsuk/index.js.map +1 -1
- package/dist/nhsuk/index.mjs +16 -2
- package/dist/nhsuk/index.mjs.map +1 -1
- package/dist/nhsuk/macros/attributes.njk +42 -2
- package/dist/nhsuk/nhsuk-dynamic-type.scss +5 -0
- package/dist/nhsuk/nhsuk-dynamic-type.scss.map +1 -0
- package/dist/nhsuk/nhsuk-frontend-10.3.0.min.css +3 -0
- package/dist/nhsuk/nhsuk-frontend-10.3.0.min.css.map +1 -0
- package/dist/nhsuk/nhsuk-frontend-10.3.0.min.js +2 -0
- package/dist/nhsuk/nhsuk-frontend-10.3.0.min.js.map +1 -0
- package/dist/nhsuk/nhsuk-frontend-dynamic-type-10.3.0.min.css +3 -0
- package/dist/nhsuk/nhsuk-frontend-dynamic-type-10.3.0.min.css.map +1 -0
- package/dist/nhsuk/nhsuk-frontend-dynamic-type.css +10296 -0
- package/dist/nhsuk/nhsuk-frontend-dynamic-type.css.map +1 -0
- package/dist/nhsuk/nhsuk-frontend-dynamic-type.min.css +2 -0
- package/dist/nhsuk/nhsuk-frontend-dynamic-type.min.css.map +1 -0
- package/dist/nhsuk/nhsuk-frontend.css +5080 -4245
- package/dist/nhsuk/nhsuk-frontend.css.map +1 -1
- package/dist/nhsuk/nhsuk-frontend.js +1085 -127
- package/dist/nhsuk/nhsuk-frontend.js.map +1 -1
- package/dist/nhsuk/nhsuk-frontend.min.css +1 -1
- package/dist/nhsuk/nhsuk-frontend.min.css.map +1 -1
- package/dist/nhsuk/nhsuk-frontend.min.js +1 -1
- package/dist/nhsuk/nhsuk-frontend.min.js.map +1 -1
- package/package.json +1 -2
- package/src/nhsuk/common/configuration/extract-config-by-namespace.mjs +2 -2
- package/src/nhsuk/common/configuration/normalise-dataset.mjs +5 -2
- package/src/nhsuk/common/configuration/normalise-string.mjs +59 -2
- package/src/nhsuk/components/_index.scss +34 -22
- package/src/nhsuk/components/action-link/_index.scss +11 -11
- package/src/nhsuk/components/back-link/_index.scss +1 -1
- package/src/nhsuk/components/button/_index.scss +8 -8
- package/src/nhsuk/components/button/button.mjs +3 -3
- package/src/nhsuk/components/card/_index.scss +177 -19
- package/src/nhsuk/components/card/template.njk +93 -30
- package/src/nhsuk/components/character-count/_index.scss +4 -1
- package/src/nhsuk/components/character-count/character-count.mjs +44 -20
- package/src/nhsuk/components/checkboxes/_index.scss +18 -18
- package/src/nhsuk/components/checkboxes/checkboxes.mjs +64 -12
- package/src/nhsuk/components/checkboxes/template.njk +1 -1
- package/src/nhsuk/components/contents-list/_index.scss +4 -24
- package/src/nhsuk/components/details/_index.scss +65 -7
- package/src/nhsuk/components/error-summary/error-summary.mjs +3 -3
- package/src/nhsuk/components/fieldset/_index.scss +1 -1
- package/src/nhsuk/components/file-upload/README.md +9 -0
- package/src/nhsuk/components/file-upload/_file-upload.scss +1 -0
- package/src/nhsuk/components/file-upload/_index.scss +249 -0
- package/src/nhsuk/components/file-upload/file-upload.mjs +586 -0
- package/src/nhsuk/components/file-upload/macro.njk +3 -0
- package/src/nhsuk/components/file-upload/template.njk +108 -0
- package/src/nhsuk/components/header/_index.scss +65 -40
- package/src/nhsuk/components/header/header.mjs +76 -22
- package/src/nhsuk/components/header/template.njk +64 -13
- package/src/nhsuk/components/hero/_index.scss +16 -16
- package/src/nhsuk/components/hero/template.njk +33 -10
- package/src/nhsuk/components/images/template.njk +22 -5
- package/src/nhsuk/components/index.mjs +1 -0
- package/src/nhsuk/components/input/_index.scss +14 -2
- package/src/nhsuk/components/input/template.njk +5 -1
- package/src/nhsuk/components/notification-banner/notification-banner.mjs +3 -3
- package/src/nhsuk/components/pagination/_index.scss +1 -1
- package/src/nhsuk/components/panel/_index.scss +34 -0
- package/src/nhsuk/components/panel/template.njk +27 -5
- package/src/nhsuk/components/password-input/password-input.mjs +20 -10
- package/src/nhsuk/components/radios/_index.scss +10 -10
- package/src/nhsuk/components/radios/radios.mjs +64 -12
- package/src/nhsuk/components/radios/template.njk +1 -1
- package/src/nhsuk/components/select/_index.scss +1 -1
- package/src/nhsuk/components/skip-link/_index.scss +1 -1
- package/src/nhsuk/components/skip-link/skip-link.mjs +56 -12
- package/src/nhsuk/components/summary-list/_index.scss +46 -36
- package/src/nhsuk/components/summary-list/template.njk +24 -11
- package/src/nhsuk/components/tables/_index.scss +16 -1
- package/src/nhsuk/components/tables/template.njk +28 -19
- package/src/nhsuk/components/tabs/_index.scss +2 -10
- package/src/nhsuk/components/tabs/tabs.mjs +94 -28
- package/src/nhsuk/components/task-list/_index.scss +4 -4
- package/src/nhsuk/components/textarea/_index.scss +2 -2
- package/src/nhsuk/components/warning-callout/_index.scss +1 -0
- package/src/nhsuk/components/warning-callout/template.njk +16 -20
- package/src/nhsuk/configurable-component.mjs +3 -3
- package/src/nhsuk/core/elements/_page.scss +34 -16
- package/src/nhsuk/core/elements/_table.scss +1 -1
- package/src/nhsuk/core/generic/_font-face.scss +26 -18
- package/src/nhsuk/core/objects/_button-group.scss +9 -11
- package/src/nhsuk/core/objects/_input-wrapper.scss +1 -0
- package/src/nhsuk/core/settings/_breakpoints.scss +16 -1
- package/src/nhsuk/core/settings/_globals.scss +119 -15
- package/src/nhsuk/core/settings/_typography.scss +1 -1
- package/src/nhsuk/core/styles/_lists.scss +2 -2
- package/src/nhsuk/core/styles/_typography.scss +12 -10
- package/src/nhsuk/core/tools/_buttons.scss +2 -1
- package/src/nhsuk/core/tools/_functions.scss +18 -4
- package/src/nhsuk/core/tools/_index.scss +1 -0
- package/src/nhsuk/core/tools/_links.scss +1 -0
- package/src/nhsuk/core/tools/_mixins.scss +51 -28
- package/src/nhsuk/core/tools/_sass-mq.scss +1 -5
- package/src/nhsuk/core/tools/_shape-arrow.scss +2 -0
- package/src/nhsuk/core/tools/_shape-chevron.scss +2 -2
- package/src/nhsuk/core/tools/_shape-dash.scss +29 -0
- package/src/nhsuk/core/tools/_spacing.scss +23 -9
- package/src/nhsuk/core/tools/_typography.scss +56 -19
- package/src/nhsuk/core/utilities/_list-border.scss +2 -1
- package/src/nhsuk/core/vendor/sass-mq.scss +1 -1
- package/src/nhsuk/index.mjs +19 -5
- package/src/nhsuk/macros/attributes.njk +42 -2
- package/src/nhsuk/nhsuk-dynamic-type.scss +3 -0
|
@@ -29,7 +29,7 @@ export type SchemaProperty = {
|
|
|
29
29
|
/**
|
|
30
30
|
* - Property type
|
|
31
31
|
*/
|
|
32
|
-
type: "string" | "boolean" | "number" | "object";
|
|
32
|
+
type: "string" | "boolean" | "number" | "object" | "array";
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* Schema condition for component config
|
|
@@ -46,6 +46,6 @@ export type SchemaCondition<ConfigurationType extends Partial<Record<keyof Confi
|
|
|
46
46
|
};
|
|
47
47
|
export type NestedKey = keyof ObjectNested;
|
|
48
48
|
export type ObjectNested = {
|
|
49
|
-
[key: string]: string | boolean | number | ObjectNested | undefined;
|
|
49
|
+
[key: string]: string | boolean | number | (string | number | boolean)[] | ObjectNested | undefined;
|
|
50
50
|
};
|
|
51
51
|
//# sourceMappingURL=extract-config-by-namespace.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-config-by-namespace.d.mts","sourceRoot":"","sources":["../../../../src/nhsuk/common/configuration/extract-config-by-namespace.mjs"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,yCANiE,iBAAiB,SAApE,OAAO,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,OAAO,CAAC,CAAE,UACrD,MAAM,CAAC,iBAAiB,CAAC,WACzB,YAAY,aACZ,MAAM,iBAAiB,GACrB,YAAY,GAAG,SAAS,CAgDpC;;;;mBAKgE,iBAAiB,SAApE,OAAO,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,OAAO,CAAC,CAAE;;;;gBAElD,MAAM,CAAC,MAAM,iBAAiB,EAAE,cAAc,GAAG,SAAS,CAAC;;;;;;;;;;;;;UAQ3D,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ;;;;;
|
|
1
|
+
{"version":3,"file":"extract-config-by-namespace.d.mts","sourceRoot":"","sources":["../../../../src/nhsuk/common/configuration/extract-config-by-namespace.mjs"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,yCANiE,iBAAiB,SAApE,OAAO,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,OAAO,CAAC,CAAE,UACrD,MAAM,CAAC,iBAAiB,CAAC,WACzB,YAAY,aACZ,MAAM,iBAAiB,GACrB,YAAY,GAAG,SAAS,CAgDpC;;;;mBAKgE,iBAAiB,SAApE,OAAO,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,OAAO,CAAC,CAAE;;;;gBAElD,MAAM,CAAC,MAAM,iBAAiB,EAAE,cAAc,GAAG,SAAS,CAAC;;;;;;;;;;;;;UAQ3D,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO;;;;;4BAMD,iBAAiB,SAApE,OAAO,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,OAAO,CAAC,CAAE;;;;cAElD,CAAC,MAAM,iBAAiB,CAAC,EAAE;;;;kBAC3B,MAAM;;wBAIP,MAAM,YAAY;2BAClB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,GAAG,YAAY,GAAG,SAAS,CAAA;CAAE"}
|
|
@@ -72,7 +72,7 @@ function extractConfigByNamespace(schema, dataset, namespace) {
|
|
|
72
72
|
* Schema property for component config
|
|
73
73
|
*
|
|
74
74
|
* @typedef {object} SchemaProperty
|
|
75
|
-
* @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
|
|
75
|
+
* @property {'string' | 'boolean' | 'number' | 'object' | 'array'} type - Property type
|
|
76
76
|
*/
|
|
77
77
|
|
|
78
78
|
/**
|
|
@@ -86,7 +86,7 @@ function extractConfigByNamespace(schema, dataset, namespace) {
|
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* @typedef {keyof ObjectNested} NestedKey
|
|
89
|
-
* @typedef {{ [key: string]: string | boolean | number | ObjectNested | undefined }} ObjectNested
|
|
89
|
+
* @typedef {{ [key: string]: string | boolean | number | (string | number | boolean)[] | ObjectNested | undefined }} ObjectNested
|
|
90
90
|
*/
|
|
91
91
|
|
|
92
92
|
exports.extractConfigByNamespace = extractConfigByNamespace;
|
|
@@ -70,7 +70,7 @@ function extractConfigByNamespace(schema, dataset, namespace) {
|
|
|
70
70
|
* Schema property for component config
|
|
71
71
|
*
|
|
72
72
|
* @typedef {object} SchemaProperty
|
|
73
|
-
* @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
|
|
73
|
+
* @property {'string' | 'boolean' | 'number' | 'object' | 'array'} type - Property type
|
|
74
74
|
*/
|
|
75
75
|
|
|
76
76
|
/**
|
|
@@ -84,7 +84,7 @@ function extractConfigByNamespace(schema, dataset, namespace) {
|
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* @typedef {keyof ObjectNested} NestedKey
|
|
87
|
-
* @typedef {{ [key: string]: string | boolean | number | ObjectNested | undefined }} ObjectNested
|
|
87
|
+
* @typedef {{ [key: string]: string | boolean | number | (string | number | boolean)[] | ObjectNested | undefined }} ObjectNested
|
|
88
88
|
*/
|
|
89
89
|
|
|
90
90
|
export { extractConfigByNamespace };
|
|
@@ -13,6 +13,7 @@ exports.extractConfigByNamespace = extractConfigByNamespace.extractConfigByNames
|
|
|
13
13
|
exports.mergeConfigs = mergeConfigs.mergeConfigs;
|
|
14
14
|
exports.normaliseDataset = normaliseDataset.normaliseDataset;
|
|
15
15
|
exports.normaliseOptions = normaliseOptions.normaliseOptions;
|
|
16
|
+
exports.normaliseArray = normaliseString.normaliseArray;
|
|
16
17
|
exports.normaliseString = normaliseString.normaliseString;
|
|
17
18
|
exports.validateConfig = validateConfig.validateConfig;
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":null,"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -2,6 +2,6 @@ export { extractConfigByNamespace } from './extract-config-by-namespace.mjs';
|
|
|
2
2
|
export { mergeConfigs } from './merge-configs.mjs';
|
|
3
3
|
export { normaliseDataset } from './normalise-dataset.mjs';
|
|
4
4
|
export { normaliseOptions } from './normalise-options.mjs';
|
|
5
|
-
export { normaliseString } from './normalise-string.mjs';
|
|
5
|
+
export { normaliseArray, normaliseString } from './normalise-string.mjs';
|
|
6
6
|
export { validateConfig } from './validate-config.mjs';
|
|
7
7
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalise-dataset.d.mts","sourceRoot":"","sources":["../../../../src/nhsuk/common/configuration/normalise-dataset.mjs"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,iCANiE,iBAAiB,SAApE,OAAO,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,OAAO,CAAC,CAAE,EACO,eAAe,SAAxE,CAAC,MAAM,iBAAiB,EAAE,cAAc,GAAG,SAAS,CAAC,EAAG,aAC3D,eAAe,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,iBAAiB,CAAC,CAAA;CAAE,WACxD,YAAY,GACV,YAAY,
|
|
1
|
+
{"version":3,"file":"normalise-dataset.d.mts","sourceRoot":"","sources":["../../../../src/nhsuk/common/configuration/normalise-dataset.mjs"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,iCANiE,iBAAiB,SAApE,OAAO,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,OAAO,CAAC,CAAE,EACO,eAAe,SAAxE,CAAC,MAAM,iBAAiB,EAAE,cAAc,GAAG,SAAS,CAAC,EAAG,aAC3D,eAAe,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,iBAAiB,CAAC,CAAA;CAAE,WACxD,YAAY,GACV,YAAY,CA6CxB;oCAIwD,aAAa;qCADlC,qBAAqB;4BACA,aAAa;kCAAb,aAAa"}
|
|
@@ -32,7 +32,7 @@ function normaliseDataset(Component, dataset) {
|
|
|
32
32
|
// Cast the `namespace` to string so it can be used to access the dataset
|
|
33
33
|
const field = namespace.toString();
|
|
34
34
|
if (field in dataset) {
|
|
35
|
-
out[field] = normaliseString.normaliseString(dataset[field], property);
|
|
35
|
+
out[field] = (property == null ? void 0 : property.type) === 'array' ? normaliseString.normaliseArray(dataset[field]) : normaliseString.normaliseString(dataset[field], property);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalise-dataset.js","sources":["../../../../src/nhsuk/common/configuration/normalise-dataset.mjs"],"sourcesContent":null,"names":["normaliseDataset","Component","dataset","isObject","schema","ConfigError","formatErrorMessage","out","entries","Object","properties","entry","namespace","property","field","toString","
|
|
1
|
+
{"version":3,"file":"normalise-dataset.js","sources":["../../../../src/nhsuk/common/configuration/normalise-dataset.mjs"],"sourcesContent":null,"names":["normaliseDataset","Component","dataset","isObject","schema","ConfigError","formatErrorMessage","out","entries","Object","properties","entry","namespace","property","field","toString","type","normaliseArray","normaliseString","extractConfigByNamespace"],"mappings":";;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAgBA,CAACC,SAAS,EAAEC,OAAO,EAAE;AACnD,EAAA,IAAI,CAACC,cAAQ,CAACF,SAAS,CAACG,MAAM,CAAC,EAAE;IAC/B,MAAM,IAAIC,mBAAW,CACnBC,wBAAkB,CAChBL,SAAS,EACT,mEACF,CACF,CAAC;AACH,EAAA;AAEA,EAAA,MAAMM,GAAG,8BAAgC,EAAG;AAC5C,EAAA,MAAMC,OAAO;EACXC,MAAM,CAACD,OAAO,CAACP,SAAS,CAACG,MAAM,CAACM,UAAU,CAC3C;;AAED;AACA,EAAA,KAAK,MAAMC,KAAK,IAAIH,OAAO,EAAE;AAC3B,IAAA,MAAM,CAACI,SAAS,EAAEC,QAAQ,CAAC,GAAGF,KAAK;;AAEnC;AACA,IAAA,MAAMG,KAAK,GAAGF,SAAS,CAACG,QAAQ,EAAE;IAElC,IAAID,KAAK,IAAIZ,OAAO,EAAE;AACpBK,MAAAA,GAAG,CAACO,KAAK,CAAC,GACR,CAAAD,QAAQ,IAAA,IAAA,GAAA,KAAA,CAAA,GAARA,QAAQ,CAAEG,IAAI,MAAK,OAAO,GACtBC,8BAAc,CAACf,OAAO,CAACY,KAAK,CAAC,CAAC,GAC9BI,+BAAe,CAAChB,OAAO,CAACY,KAAK,CAAC,EAAED,QAAQ,CAAC;AACjD,IAAA;;AAEA;AACJ;AACA;AACA;IACI,IAAI,CAAAA,QAAQ,IAAA,IAAA,GAAA,KAAA,CAAA,GAARA,QAAQ,CAAEG,IAAI,MAAK,QAAQ,EAAE;AAC/BT,MAAAA,GAAG,CAACO,KAAK,CAAC,GAAGK,iDAAwB,CACnClB,SAAS,CAACG,MAAM,EAChBF,OAAO,EACPU,SACF,CAAC;AACH,IAAA;AACF,EAAA;AAEA,EAAA,OAAOL,GAAG;AACZ;;AAEA;AACA;AACA;AACA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigError } from '../../errors/index.mjs';
|
|
2
2
|
import { isObject, formatErrorMessage } from '../index.mjs';
|
|
3
3
|
import { extractConfigByNamespace } from './extract-config-by-namespace.mjs';
|
|
4
|
-
import { normaliseString } from './normalise-string.mjs';
|
|
4
|
+
import { normaliseArray, normaliseString } from './normalise-string.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Normalise dataset
|
|
@@ -30,7 +30,7 @@ function normaliseDataset(Component, dataset) {
|
|
|
30
30
|
// Cast the `namespace` to string so it can be used to access the dataset
|
|
31
31
|
const field = namespace.toString();
|
|
32
32
|
if (field in dataset) {
|
|
33
|
-
out[field] = normaliseString(dataset[field], property);
|
|
33
|
+
out[field] = (property == null ? void 0 : property.type) === 'array' ? normaliseArray(dataset[field]) : normaliseString(dataset[field], property);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalise-dataset.mjs","sources":["../../../../src/nhsuk/common/configuration/normalise-dataset.mjs"],"sourcesContent":null,"names":["normaliseDataset","Component","dataset","isObject","schema","ConfigError","formatErrorMessage","out","entries","Object","properties","entry","namespace","property","field","toString","
|
|
1
|
+
{"version":3,"file":"normalise-dataset.mjs","sources":["../../../../src/nhsuk/common/configuration/normalise-dataset.mjs"],"sourcesContent":null,"names":["normaliseDataset","Component","dataset","isObject","schema","ConfigError","formatErrorMessage","out","entries","Object","properties","entry","namespace","property","field","toString","type","normaliseArray","normaliseString","extractConfigByNamespace"],"mappings":";;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAgBA,CAACC,SAAS,EAAEC,OAAO,EAAE;AACnD,EAAA,IAAI,CAACC,QAAQ,CAACF,SAAS,CAACG,MAAM,CAAC,EAAE;IAC/B,MAAM,IAAIC,WAAW,CACnBC,kBAAkB,CAChBL,SAAS,EACT,mEACF,CACF,CAAC;AACH,EAAA;AAEA,EAAA,MAAMM,GAAG,8BAAgC,EAAG;AAC5C,EAAA,MAAMC,OAAO;EACXC,MAAM,CAACD,OAAO,CAACP,SAAS,CAACG,MAAM,CAACM,UAAU,CAC3C;;AAED;AACA,EAAA,KAAK,MAAMC,KAAK,IAAIH,OAAO,EAAE;AAC3B,IAAA,MAAM,CAACI,SAAS,EAAEC,QAAQ,CAAC,GAAGF,KAAK;;AAEnC;AACA,IAAA,MAAMG,KAAK,GAAGF,SAAS,CAACG,QAAQ,EAAE;IAElC,IAAID,KAAK,IAAIZ,OAAO,EAAE;AACpBK,MAAAA,GAAG,CAACO,KAAK,CAAC,GACR,CAAAD,QAAQ,IAAA,IAAA,GAAA,KAAA,CAAA,GAARA,QAAQ,CAAEG,IAAI,MAAK,OAAO,GACtBC,cAAc,CAACf,OAAO,CAACY,KAAK,CAAC,CAAC,GAC9BI,eAAe,CAAChB,OAAO,CAACY,KAAK,CAAC,EAAED,QAAQ,CAAC;AACjD,IAAA;;AAEA;AACJ;AACA;AACA;IACI,IAAI,CAAAA,QAAQ,IAAA,IAAA,GAAA,KAAA,CAAA,GAARA,QAAQ,CAAEG,IAAI,MAAK,QAAQ,EAAE;AAC/BT,MAAAA,GAAG,CAACO,KAAK,CAAC,GAAGK,wBAAwB,CACnClB,SAAS,CAACG,MAAM,EAChBF,OAAO,EACPU,SACF,CAAC;AACH,IAAA;AACF,EAAA;AAEA,EAAA,OAAOL,GAAG;AACZ;;AAEA;AACA;AACA;AACA;;;;"}
|
|
@@ -9,10 +9,17 @@
|
|
|
9
9
|
* Designed to be used to convert config passed via data attributes (which are
|
|
10
10
|
* always strings) into something sensible.
|
|
11
11
|
*
|
|
12
|
-
* @param {string | undefined} value - The value to normalise
|
|
12
|
+
* @param {string | number | boolean | undefined} value - The value to normalise
|
|
13
13
|
* @param {SchemaProperty} [property] - Component schema property
|
|
14
14
|
* @returns Normalised data
|
|
15
15
|
*/
|
|
16
|
-
export function normaliseString(value: string | undefined, property?: SchemaProperty): string | number | boolean | undefined;
|
|
16
|
+
export function normaliseString(value: string | number | boolean | undefined, property?: SchemaProperty): string | number | boolean | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Normalise array of strings
|
|
19
|
+
*
|
|
20
|
+
* @param {string | (string | number | boolean | undefined)[] | undefined} value - The value to normalise
|
|
21
|
+
* @returns Normalised array of data
|
|
22
|
+
*/
|
|
23
|
+
export function normaliseArray(value: string | (string | number | boolean | undefined)[] | undefined): (string | number | boolean)[];
|
|
17
24
|
import type { SchemaProperty } from './index.mjs';
|
|
18
25
|
//# sourceMappingURL=normalise-string.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalise-string.d.mts","sourceRoot":"","sources":["../../../../src/nhsuk/common/configuration/normalise-string.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,uCAJW,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"normalise-string.d.mts","sourceRoot":"","sources":["../../../../src/nhsuk/common/configuration/normalise-string.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,uCAJW,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,aACrC,cAAc,yCAwCxB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,iCAoBxE;oCA+BkC,aAAa"}
|
|
@@ -11,12 +11,15 @@
|
|
|
11
11
|
* Designed to be used to convert config passed via data attributes (which are
|
|
12
12
|
* always strings) into something sensible.
|
|
13
13
|
*
|
|
14
|
-
* @param {string | undefined} value - The value to normalise
|
|
14
|
+
* @param {string | number | boolean | undefined} value - The value to normalise
|
|
15
15
|
* @param {SchemaProperty} [property] - Component schema property
|
|
16
16
|
* @returns Normalised data
|
|
17
17
|
*/
|
|
18
18
|
function normaliseString(value, property) {
|
|
19
|
-
|
|
19
|
+
if (!isValid(value)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const trimmedValue = value.toString().trim();
|
|
20
23
|
let output;
|
|
21
24
|
let outputType = property == null ? void 0 : property.type;
|
|
22
25
|
|
|
@@ -45,9 +48,56 @@ function normaliseString(value, property) {
|
|
|
45
48
|
return output;
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Normalise array of strings
|
|
53
|
+
*
|
|
54
|
+
* @param {string | (string | number | boolean | undefined)[] | undefined} value - The value to normalise
|
|
55
|
+
* @returns Normalised array of data
|
|
56
|
+
*/
|
|
57
|
+
function normaliseArray(value) {
|
|
58
|
+
let values = Array.isArray(value) ? value : [];
|
|
59
|
+
|
|
60
|
+
// Attempt to parse string as array
|
|
61
|
+
if (typeof value === 'string') {
|
|
62
|
+
try {
|
|
63
|
+
var _JSON$parse;
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
65
|
+
values = (_JSON$parse = JSON.parse(decodeURIComponent(value), getArrayValue)) != null ? _JSON$parse : [];
|
|
66
|
+
} catch (_unused) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Normalise and filter array values
|
|
72
|
+
return values.map(value => normaliseString(value)).filter(value => value !== undefined);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Accept valid array values only
|
|
77
|
+
*
|
|
78
|
+
* Used as reviver function in `JSON.parse()`
|
|
79
|
+
*
|
|
80
|
+
* @this {unknown}
|
|
81
|
+
* @param {string} key
|
|
82
|
+
* @param {unknown} value
|
|
83
|
+
*/
|
|
84
|
+
function getArrayValue(key, value) {
|
|
85
|
+
return isValid(value) || key === '' && Array.isArray(value) ? value : undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Whether value is valid
|
|
90
|
+
*
|
|
91
|
+
* @param {unknown} value
|
|
92
|
+
*/
|
|
93
|
+
function isValid(value) {
|
|
94
|
+
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
|
|
95
|
+
}
|
|
96
|
+
|
|
48
97
|
/**
|
|
49
98
|
* @import { SchemaProperty } from './index.mjs'
|
|
50
99
|
*/
|
|
51
100
|
|
|
101
|
+
exports.normaliseArray = normaliseArray;
|
|
52
102
|
exports.normaliseString = normaliseString;
|
|
53
103
|
//# sourceMappingURL=normalise-string.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalise-string.js","sources":["../../../../src/nhsuk/common/configuration/normalise-string.mjs"],"sourcesContent":null,"names":["normaliseString","value","property","trimmedValue","trim","output","outputType","type","includes","length","isFinite","Number"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAACC,KAAK,EAAEC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"normalise-string.js","sources":["../../../../src/nhsuk/common/configuration/normalise-string.mjs"],"sourcesContent":null,"names":["normaliseString","value","property","isValid","trimmedValue","toString","trim","output","outputType","type","includes","length","isFinite","Number","normaliseArray","values","Array","isArray","_JSON$parse","JSON","parse","decodeURIComponent","getArrayValue","_unused","map","filter","undefined","key"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAACC,KAAK,EAAEC,QAAQ,EAAE;AAC/C,EAAA,IAAI,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;AACnB,IAAA;AACF,EAAA;EAEA,MAAMG,YAAY,GAAGH,KAAK,CAACI,QAAQ,EAAE,CAACC,IAAI,EAAE;AAE5C,EAAA,IAAIC,MAAM;AACV,EAAA,IAAIC,UAAU,GAAGN,QAAQ,IAAA,IAAA,GAAA,KAAA,CAAA,GAARA,QAAQ,CAAEO,IAAI;;AAE/B;EACA,IAAI,CAACD,UAAU,EAAE;IACf,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAACE,QAAQ,CAACN,YAAY,CAAC,EAAE;AAC5CI,MAAAA,UAAU,GAAG,SAAS;AACxB,IAAA;;AAEA;AACA;AACA,IAAA,IAAIJ,YAAY,CAACO,MAAM,GAAG,CAAC,IAAIC,QAAQ,CAACC,MAAM,CAACT,YAAY,CAAC,CAAC,EAAE;AAC7DI,MAAAA,UAAU,GAAG,QAAQ;AACvB,IAAA;AACF,EAAA;AAEA,EAAA,QAAQA,UAAU;AAChB,IAAA,KAAK,SAAS;MACZD,MAAM,GAAGH,YAAY,KAAK,MAAM;AAChC,MAAA;AAEF,IAAA,KAAK,QAAQ;AACXG,MAAAA,MAAM,GAAGM,MAAM,CAACT,YAAY,CAAC;AAC7B,MAAA;AAEF,IAAA;AACEG,MAAAA,MAAM,GAAGN,KAAK;AAClB;AAEA,EAAA,OAAOM,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,cAAcA,CAACb,KAAK,EAAE;EACpC,IAAIc,MAAM,GAAGC,KAAK,CAACC,OAAO,CAAChB,KAAK,CAAC,GAAGA,KAAK,GAAG,EAAE;;AAE9C;AACA,EAAA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,IAAI;AAAA,MAAA,IAAAiB,WAAA;AACF;AACAH,MAAAA,MAAM,IAAAG,WAAA,GAAGC,IAAI,CAACC,KAAK,CAACC,kBAAkB,CAACpB,KAAK,CAAC,EAAEqB,aAAa,CAAC,KAAA,IAAA,GAAAJ,WAAA,GAAI,EAAE;IACrE,CAAC,CAAC,OAAAK,OAAA,EAAM;AACN,MAAA,OAAO,EAAE;AACX,IAAA;AACF,EAAA;;AAEA;AACA,EAAA,OAAOR,MAAM,CACVS,GAAG,CAAEvB,KAAK,IAAKD,eAAe,CAACC,KAAK,CAAC,CAAC,CACtCwB,MAAM,CAAExB,KAAK,IAAKA,KAAK,KAAKyB,SAAS,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASJ,aAAaA,CAACK,GAAG,EAAE1B,KAAK,EAAE;AACjC,EAAA,OAAOE,OAAO,CAACF,KAAK,CAAC,IAAK0B,GAAG,KAAK,EAAE,IAAIX,KAAK,CAACC,OAAO,CAAChB,KAAK,CAAE,GACzDA,KAAK,GACLyB,SAAS;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASvB,OAAOA,CAACF,KAAK,EAAE;AACtB,EAAA,OACE,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,SAAS;AAE9B;;AAEA;AACA;AACA;;;;;"}
|
|
@@ -9,12 +9,15 @@
|
|
|
9
9
|
* Designed to be used to convert config passed via data attributes (which are
|
|
10
10
|
* always strings) into something sensible.
|
|
11
11
|
*
|
|
12
|
-
* @param {string | undefined} value - The value to normalise
|
|
12
|
+
* @param {string | number | boolean | undefined} value - The value to normalise
|
|
13
13
|
* @param {SchemaProperty} [property] - Component schema property
|
|
14
14
|
* @returns Normalised data
|
|
15
15
|
*/
|
|
16
16
|
function normaliseString(value, property) {
|
|
17
|
-
|
|
17
|
+
if (!isValid(value)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const trimmedValue = value.toString().trim();
|
|
18
21
|
let output;
|
|
19
22
|
let outputType = property == null ? void 0 : property.type;
|
|
20
23
|
|
|
@@ -43,9 +46,55 @@ function normaliseString(value, property) {
|
|
|
43
46
|
return output;
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Normalise array of strings
|
|
51
|
+
*
|
|
52
|
+
* @param {string | (string | number | boolean | undefined)[] | undefined} value - The value to normalise
|
|
53
|
+
* @returns Normalised array of data
|
|
54
|
+
*/
|
|
55
|
+
function normaliseArray(value) {
|
|
56
|
+
let values = Array.isArray(value) ? value : [];
|
|
57
|
+
|
|
58
|
+
// Attempt to parse string as array
|
|
59
|
+
if (typeof value === 'string') {
|
|
60
|
+
try {
|
|
61
|
+
var _JSON$parse;
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
63
|
+
values = (_JSON$parse = JSON.parse(decodeURIComponent(value), getArrayValue)) != null ? _JSON$parse : [];
|
|
64
|
+
} catch (_unused) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Normalise and filter array values
|
|
70
|
+
return values.map(value => normaliseString(value)).filter(value => value !== undefined);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Accept valid array values only
|
|
75
|
+
*
|
|
76
|
+
* Used as reviver function in `JSON.parse()`
|
|
77
|
+
*
|
|
78
|
+
* @this {unknown}
|
|
79
|
+
* @param {string} key
|
|
80
|
+
* @param {unknown} value
|
|
81
|
+
*/
|
|
82
|
+
function getArrayValue(key, value) {
|
|
83
|
+
return isValid(value) || key === '' && Array.isArray(value) ? value : undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Whether value is valid
|
|
88
|
+
*
|
|
89
|
+
* @param {unknown} value
|
|
90
|
+
*/
|
|
91
|
+
function isValid(value) {
|
|
92
|
+
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
|
|
93
|
+
}
|
|
94
|
+
|
|
46
95
|
/**
|
|
47
96
|
* @import { SchemaProperty } from './index.mjs'
|
|
48
97
|
*/
|
|
49
98
|
|
|
50
|
-
export { normaliseString };
|
|
99
|
+
export { normaliseArray, normaliseString };
|
|
51
100
|
//# sourceMappingURL=normalise-string.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalise-string.mjs","sources":["../../../../src/nhsuk/common/configuration/normalise-string.mjs"],"sourcesContent":null,"names":["normaliseString","value","property","trimmedValue","trim","output","outputType","type","includes","length","isFinite","Number"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAACC,KAAK,EAAEC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"normalise-string.mjs","sources":["../../../../src/nhsuk/common/configuration/normalise-string.mjs"],"sourcesContent":null,"names":["normaliseString","value","property","isValid","trimmedValue","toString","trim","output","outputType","type","includes","length","isFinite","Number","normaliseArray","values","Array","isArray","_JSON$parse","JSON","parse","decodeURIComponent","getArrayValue","_unused","map","filter","undefined","key"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAACC,KAAK,EAAEC,QAAQ,EAAE;AAC/C,EAAA,IAAI,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;AACnB,IAAA;AACF,EAAA;EAEA,MAAMG,YAAY,GAAGH,KAAK,CAACI,QAAQ,EAAE,CAACC,IAAI,EAAE;AAE5C,EAAA,IAAIC,MAAM;AACV,EAAA,IAAIC,UAAU,GAAGN,QAAQ,IAAA,IAAA,GAAA,KAAA,CAAA,GAARA,QAAQ,CAAEO,IAAI;;AAE/B;EACA,IAAI,CAACD,UAAU,EAAE;IACf,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAACE,QAAQ,CAACN,YAAY,CAAC,EAAE;AAC5CI,MAAAA,UAAU,GAAG,SAAS;AACxB,IAAA;;AAEA;AACA;AACA,IAAA,IAAIJ,YAAY,CAACO,MAAM,GAAG,CAAC,IAAIC,QAAQ,CAACC,MAAM,CAACT,YAAY,CAAC,CAAC,EAAE;AAC7DI,MAAAA,UAAU,GAAG,QAAQ;AACvB,IAAA;AACF,EAAA;AAEA,EAAA,QAAQA,UAAU;AAChB,IAAA,KAAK,SAAS;MACZD,MAAM,GAAGH,YAAY,KAAK,MAAM;AAChC,MAAA;AAEF,IAAA,KAAK,QAAQ;AACXG,MAAAA,MAAM,GAAGM,MAAM,CAACT,YAAY,CAAC;AAC7B,MAAA;AAEF,IAAA;AACEG,MAAAA,MAAM,GAAGN,KAAK;AAClB;AAEA,EAAA,OAAOM,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,cAAcA,CAACb,KAAK,EAAE;EACpC,IAAIc,MAAM,GAAGC,KAAK,CAACC,OAAO,CAAChB,KAAK,CAAC,GAAGA,KAAK,GAAG,EAAE;;AAE9C;AACA,EAAA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,IAAI;AAAA,MAAA,IAAAiB,WAAA;AACF;AACAH,MAAAA,MAAM,IAAAG,WAAA,GAAGC,IAAI,CAACC,KAAK,CAACC,kBAAkB,CAACpB,KAAK,CAAC,EAAEqB,aAAa,CAAC,KAAA,IAAA,GAAAJ,WAAA,GAAI,EAAE;IACrE,CAAC,CAAC,OAAAK,OAAA,EAAM;AACN,MAAA,OAAO,EAAE;AACX,IAAA;AACF,EAAA;;AAEA;AACA,EAAA,OAAOR,MAAM,CACVS,GAAG,CAAEvB,KAAK,IAAKD,eAAe,CAACC,KAAK,CAAC,CAAC,CACtCwB,MAAM,CAAExB,KAAK,IAAKA,KAAK,KAAKyB,SAAS,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASJ,aAAaA,CAACK,GAAG,EAAE1B,KAAK,EAAE;AACjC,EAAA,OAAOE,OAAO,CAACF,KAAK,CAAC,IAAK0B,GAAG,KAAK,EAAE,IAAIX,KAAK,CAACC,OAAO,CAAChB,KAAK,CAAE,GACzDA,KAAK,GACLyB,SAAS;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASvB,OAAOA,CAACF,KAAK,EAAE;AACtB,EAAA,OACE,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,SAAS;AAE9B;;AAEA;AACA;AACA;;;;"}
|
|
@@ -2,41 +2,53 @@
|
|
|
2
2
|
/// Components
|
|
3
3
|
////
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
@forward "back-link";
|
|
7
|
-
@forward "breadcrumb";
|
|
5
|
+
// Form elements
|
|
8
6
|
@forward "button";
|
|
9
|
-
@forward "card";
|
|
10
|
-
@forward "contents-list";
|
|
11
|
-
@forward "date-input";
|
|
12
|
-
@forward "details";
|
|
13
|
-
@forward "do-dont-list";
|
|
14
7
|
@forward "error-message";
|
|
15
8
|
@forward "error-summary";
|
|
16
9
|
@forward "fieldset";
|
|
17
|
-
@forward "footer";
|
|
18
|
-
@forward "header";
|
|
19
|
-
@forward "hero";
|
|
20
10
|
@forward "hint";
|
|
21
|
-
@forward "images";
|
|
22
|
-
@forward "input";
|
|
23
|
-
@forward "inset-text";
|
|
24
11
|
@forward "label";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@forward "panel";
|
|
12
|
+
|
|
13
|
+
// Form components
|
|
28
14
|
@forward "checkboxes";
|
|
29
|
-
@forward "
|
|
15
|
+
@forward "input";
|
|
30
16
|
@forward "radios";
|
|
31
17
|
@forward "select";
|
|
32
|
-
@forward "
|
|
18
|
+
@forward "textarea";
|
|
19
|
+
|
|
20
|
+
// Form components (composite)
|
|
21
|
+
@forward "character-count";
|
|
22
|
+
@forward "date-input";
|
|
23
|
+
@forward "file-upload";
|
|
24
|
+
@forward "password-input";
|
|
25
|
+
|
|
26
|
+
// Content presentation
|
|
27
|
+
@forward "details";
|
|
28
|
+
@forward "do-dont-list";
|
|
29
|
+
@forward "hero";
|
|
30
|
+
@forward "images";
|
|
31
|
+
@forward "inset-text";
|
|
32
|
+
@forward "notification-banner";
|
|
33
|
+
@forward "panel";
|
|
33
34
|
@forward "summary-list";
|
|
34
35
|
@forward "tables";
|
|
36
|
+
@forward "tabs";
|
|
35
37
|
@forward "tag";
|
|
36
38
|
@forward "task-list";
|
|
37
|
-
@forward "textarea";
|
|
38
39
|
@forward "warning-callout";
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
// Navigation
|
|
42
|
+
@forward "action-link";
|
|
43
|
+
@forward "back-link";
|
|
44
|
+
@forward "contents-list";
|
|
45
|
+
@forward "footer";
|
|
46
|
+
@forward "pagination";
|
|
47
|
+
@forward "skip-link";
|
|
48
|
+
|
|
49
|
+
// Navigation (composite)
|
|
50
|
+
@forward "breadcrumb";
|
|
51
|
+
@forward "card";
|
|
52
|
+
@forward "header";
|
|
41
53
|
|
|
42
54
|
/*# sourceMappingURL=_index.scss.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/nhsuk/components/_index.scss"],"names":[],"mappings":"AAAA,GAAG;AACH,aAAa;AACb,GAAG;;AAEH,
|
|
1
|
+
{"version":3,"sources":["../../../src/nhsuk/components/_index.scss"],"names":[],"mappings":"AAAA,GAAG;AACH,aAAa;AACb,GAAG;;AAEH,eAAe;AACf,iBAAiB;AACjB,wBAAwB;AACxB,wBAAwB;AACxB,mBAAmB;AACnB,eAAe;AACf,gBAAgB;;AAEhB,iBAAiB;AACjB,qBAAqB;AACrB,gBAAgB;AAChB,iBAAiB;AACjB,iBAAiB;AACjB,mBAAmB;;AAEnB,6BAA6B;AAC7B,0BAA0B;AAC1B,qBAAqB;AACrB,sBAAsB;AACtB,yBAAyB;;AAEzB,sBAAsB;AACtB,kBAAkB;AAClB,uBAAuB;AACvB,eAAe;AACf,iBAAiB;AACjB,qBAAqB;AACrB,8BAA8B;AAC9B,gBAAgB;AAChB,uBAAuB;AACvB,iBAAiB;AACjB,eAAe;AACf,cAAc;AACd,oBAAoB;AACpB,0BAA0B;;AAE1B,YAAY;AACZ,sBAAsB;AACtB,oBAAoB;AACpB,wBAAwB;AACxB,iBAAiB;AACjB,qBAAqB;AACrB,oBAAoB;;AAEpB,wBAAwB;AACxB,qBAAqB;AACrB,eAAe;AACf,iBAAiB","file":"_index.scss","sourcesContent":["////\n/// Components\n////\n\n// Form elements\n@forward \"button\";\n@forward \"error-message\";\n@forward \"error-summary\";\n@forward \"fieldset\";\n@forward \"hint\";\n@forward \"label\";\n\n// Form components\n@forward \"checkboxes\";\n@forward \"input\";\n@forward \"radios\";\n@forward \"select\";\n@forward \"textarea\";\n\n// Form components (composite)\n@forward \"character-count\";\n@forward \"date-input\";\n@forward \"file-upload\";\n@forward \"password-input\";\n\n// Content presentation\n@forward \"details\";\n@forward \"do-dont-list\";\n@forward \"hero\";\n@forward \"images\";\n@forward \"inset-text\";\n@forward \"notification-banner\";\n@forward \"panel\";\n@forward \"summary-list\";\n@forward \"tables\";\n@forward \"tabs\";\n@forward \"tag\";\n@forward \"task-list\";\n@forward \"warning-callout\";\n\n// Navigation\n@forward \"action-link\";\n@forward \"back-link\";\n@forward \"contents-list\";\n@forward \"footer\";\n@forward \"pagination\";\n@forward \"skip-link\";\n\n// Navigation (composite)\n@forward \"breadcrumb\";\n@forward \"card\";\n@forward \"header\";\n"]}
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
////
|
|
17
17
|
|
|
18
18
|
@include nhsuk-exports("nhsuk/components/action-link") {
|
|
19
|
-
$_small-icon-size: $nhsuk-icon-size;
|
|
20
|
-
$_small-icon-spacing: math.
|
|
19
|
+
$_small-icon-size: nhsuk-px-to-rem($nhsuk-icon-size);
|
|
20
|
+
$_small-icon-spacing: math.div($_small-icon-size, 10);
|
|
21
21
|
|
|
22
|
-
$_large-icon-size: 36px;
|
|
23
|
-
$_large-icon-spacing: math.
|
|
22
|
+
$_large-icon-size: nhsuk-px-to-rem(36px);
|
|
23
|
+
$_large-icon-spacing: math.div($_large-icon-size, 10);
|
|
24
24
|
|
|
25
25
|
.nhsuk-action-link {
|
|
26
26
|
box-sizing: border-box;
|
|
27
27
|
display: inline-block; // [1]
|
|
28
28
|
position: relative; // [3]
|
|
29
|
-
padding-left:
|
|
29
|
+
padding-left: $_small-icon-size + $_small-icon-spacing; // [2]
|
|
30
30
|
text-decoration: none; // [4]
|
|
31
31
|
|
|
32
32
|
&:not(:focus):hover {
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
@include nhsuk-responsive-margin(6, "bottom");
|
|
45
45
|
|
|
46
46
|
@include nhsuk-media-query($from: tablet) {
|
|
47
|
-
padding-left:
|
|
48
|
-
line-height: nhsuk-line-height($_large-icon-size, $font-size:
|
|
47
|
+
padding-left: $_large-icon-size + $_large-icon-spacing; // [2]
|
|
48
|
+
line-height: nhsuk-line-height($_large-icon-size, $font-size: 22px);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.nhsuk-icon {
|
|
52
52
|
position: absolute;
|
|
53
|
-
left:
|
|
53
|
+
left: -$_small-icon-spacing;
|
|
54
54
|
// stylelint-disable-next-line declaration-no-important
|
|
55
55
|
fill: nhsuk-colour("green") !important;
|
|
56
56
|
|
|
57
57
|
@include nhsuk-media-query($from: tablet) {
|
|
58
|
-
left:
|
|
59
|
-
width:
|
|
60
|
-
height:
|
|
58
|
+
left: -$_large-icon-spacing;
|
|
59
|
+
width: $_large-icon-size;
|
|
60
|
+
height: $_large-icon-size;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/nhsuk/components/action-link/_index.scss"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,+BAA+B;AAC/B,4BAA4B;AAC5B,8BAA8B;AAC9B,kCAAkC;;AAElC,GAAG;AACH,wBAAwB;AACxB,EAAE;AACF,mEAAmE;AACnE,iDAAiD;AACjD,kEAAkE;AAClE,gEAAgE;AAChE,EAAE;AACF,gCAAgC;AAChC,GAAG;;AAEH;EACE,
|
|
1
|
+
{"version":3,"sources":["../../../../src/nhsuk/components/action-link/_index.scss"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,+BAA+B;AAC/B,4BAA4B;AAC5B,8BAA8B;AAC9B,kCAAkC;;AAElC,GAAG;AACH,wBAAwB;AACxB,EAAE;AACF,mEAAmE;AACnE,iDAAiD;AACjD,kEAAkE;AAClE,gEAAgE;AAChE,EAAE;AACF,gCAAgC;AAChC,GAAG;;AAEH;EACE,oDAAoD;EACpD,qDAAqD;;EAErD,wCAAwC;EACxC,qDAAqD;;EAErD;IACE,sBAAsB;IACtB,qBAAqB,EAAE,KAAK;IAC5B,kBAAkB,EAAE,KAAK;IACzB,sDAAsD,EAAE,KAAK;IAC7D,qBAAqB,EAAE,KAAK;;IAE5B;MACE;QACE,0BAA0B,EAAE,KAAK;MACnC;IACF;;IAEA,uEAAuE;;IAEvE;MACE,wDAAwD;IAC1D;;IAEA,6CAA6C;;IAE7C;MACE,sDAAsD,EAAE,KAAK;MAC7D,mEAAmE;IACrE;;IAEA;MACE,kBAAkB;MAClB,2BAA2B;MAC3B,sDAAsD;MACtD,sCAAsC;;MAEtC;QACE,2BAA2B;QAC3B,wBAAwB;QACxB,yBAAyB;MAC3B;IACF;;IAEA;MACE,sDAAsD;MACtD,yCAAyC;IAC3C;EACF;;EAEA;IACE,+BAA+B;;IAE/B;MACE,qBAAqB,EAAE,KAAK;IAC9B;;IAEA;MACE,sDAAsD;MACtD,2CAA2C;IAC7C;EACF;AACF","file":"_index.scss","sourcesContent":["@use \"sass:math\";\n@use \"../../core/settings\" as *;\n@use \"../../core/tools\" as *;\n@use \"../../core/helpers\" as *;\n@forward \"../../core/styles/icons\";\n\n////\n/// Action link component\n///\n/// 1. Display inline-block so top and bottom margins are respected.\n/// 2. Add sufficient space between icon and text.\n/// 3. Position is relative so the arrow icon can display absolute.\n/// 4. Text decoration none used to override default <a> styling.\n///\n/// @group components/action-link\n////\n\n@include nhsuk-exports(\"nhsuk/components/action-link\") {\n $_small-icon-size: nhsuk-px-to-rem($nhsuk-icon-size);\n $_small-icon-spacing: math.div($_small-icon-size, 10);\n\n $_large-icon-size: nhsuk-px-to-rem(36px);\n $_large-icon-spacing: math.div($_large-icon-size, 10);\n\n .nhsuk-action-link {\n box-sizing: border-box;\n display: inline-block; // [1]\n position: relative; // [3]\n padding-left: $_small-icon-size + $_small-icon-spacing; // [2]\n text-decoration: none; // [4]\n\n &:not(:focus):hover {\n .nhsuk-action-link__text {\n text-decoration: underline; // [5]\n }\n }\n\n @include nhsuk-font(22, $weight: bold, $line-height: $_small-icon-size);\n\n @include nhsuk-print-colour {\n @include nhsuk-link-style-text($nhsuk-print-text-colour);\n }\n\n @include nhsuk-responsive-margin(6, \"bottom\");\n\n @include nhsuk-media-query($from: tablet) {\n padding-left: $_large-icon-size + $_large-icon-spacing; // [2]\n line-height: nhsuk-line-height($_large-icon-size, $font-size: 22px);\n }\n\n .nhsuk-icon {\n position: absolute;\n left: -$_small-icon-spacing;\n // stylelint-disable-next-line declaration-no-important\n fill: nhsuk-colour(\"green\") !important;\n\n @include nhsuk-media-query($from: tablet) {\n left: -$_large-icon-spacing;\n width: $_large-icon-size;\n height: $_large-icon-size;\n }\n }\n\n &:focus .nhsuk-icon {\n // stylelint-disable-next-line declaration-no-important\n fill: $nhsuk-focus-text-colour !important;\n }\n }\n\n .nhsuk-action-link--reverse {\n @include nhsuk-link-style-white;\n\n &:link {\n text-decoration: none; // [4]\n }\n\n &:not(:focus) .nhsuk-icon {\n // stylelint-disable-next-line declaration-no-important\n fill: $nhsuk-reverse-text-colour !important;\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/nhsuk/components/back-link/_index.scss"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,4BAA4B;;AAE5B,GAAG;AACH,sBAAsB;AACtB,EAAE;AACF,kCAAkC;AAClC,0CAA0C;AAC1C,EAAE;AACF,8BAA8B;AAC9B,GAAG;;AAEH;EACE,eAAe;;EAEf;IACE,sBAAsB;IACtB,qBAAqB;;IAErB,kBAAkB;;IAElB,UAAU;IACV,
|
|
1
|
+
{"version":3,"sources":["../../../../src/nhsuk/components/back-link/_index.scss"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,4BAA4B;;AAE5B,GAAG;AACH,sBAAsB;AACtB,EAAE;AACF,kCAAkC;AAClC,0CAA0C;AAC1C,EAAE;AACF,8BAA8B;AAC9B,GAAG;;AAEH;EACE,eAAe;;EAEf;IACE,sBAAsB;IACtB,qBAAqB;;IAErB,kBAAkB;;IAElB,UAAU;IACV,gDAAgD;;IAEhD,SAAS;;IAET,gBAAgB;;IAEhB,eAAe;;IAEf,gCAAgC;IAChC,iCAAiC;IACjC,0CAA0C;IAC1C,0CAA0C;IAC1C,yBAAyB,EAAE,KAAK;;IAEhC;MACE,WAAW;;MAEX,kBAAkB;MAClB,MAAM;MACN,SAAS;MACT,OAAO;;MAEP,YAAY;;MAEZ,yEAAyE;IAC3E;EACF;;EAEA;IACE,+BAA+B;EACjC;AACF","file":"_index.scss","sourcesContent":["@use \"../../core/settings\" as *;\n@use \"../../core/tools\" as *;\n\n////\n/// Back link component\n///\n/// 1. Allow space for the chevron.\n/// 2. Hide back link on print stylesheets.\n///\n/// @group components/back-link\n////\n\n@include nhsuk-exports(\"nhsuk/components/back-link\") {\n $_font-size: 16;\n\n .nhsuk-back-link {\n box-sizing: border-box;\n display: inline-block;\n\n position: relative;\n\n padding: 0;\n padding-left: nhsuk-em($_font-size, $_font-size);\n\n border: 0;\n\n background: none;\n\n cursor: pointer;\n\n @include nhsuk-font($_font-size);\n @include nhsuk-link-style-default;\n @include nhsuk-link-style-no-visited-state;\n @include nhsuk-responsive-margin(4, \"top\");\n @include nhsuk-print-hide; // [2]\n\n &::before {\n content: \"\";\n\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n\n margin: auto;\n\n @include nhsuk-shape-chevron(left, $colour: currentcolor, $font-size: 19);\n }\n }\n\n .nhsuk-back-link--reverse {\n @include nhsuk-link-style-white;\n }\n}\n"]}
|
|
@@ -19,23 +19,6 @@
|
|
|
19
19
|
"options": {},
|
|
20
20
|
"html": "<a class=\"nhsuk-back-link\" href=\"#\">\n Back\n</a>"
|
|
21
21
|
},
|
|
22
|
-
{
|
|
23
|
-
"name": "as a button",
|
|
24
|
-
"context": {
|
|
25
|
-
"text": "Back",
|
|
26
|
-
"element": "button"
|
|
27
|
-
},
|
|
28
|
-
"screenshot": {
|
|
29
|
-
"states": [
|
|
30
|
-
"focus",
|
|
31
|
-
"hover",
|
|
32
|
-
"active"
|
|
33
|
-
],
|
|
34
|
-
"selector": ".nhsuk-back-link"
|
|
35
|
-
},
|
|
36
|
-
"options": {},
|
|
37
|
-
"html": "<button class=\"nhsuk-back-link\">\n Back\n</button>"
|
|
38
|
-
},
|
|
39
22
|
{
|
|
40
23
|
"name": "reverse",
|
|
41
24
|
"context": {
|
|
@@ -66,6 +49,23 @@
|
|
|
66
49
|
"screenshot": false,
|
|
67
50
|
"options": {},
|
|
68
51
|
"html": "<a class=\"nhsuk-back-link\" href=\"#\">\n <span class=\"nhsuk-u-visually-hidden\">Back to</span> Search results\n</a>"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "as a button",
|
|
55
|
+
"context": {
|
|
56
|
+
"text": "Back",
|
|
57
|
+
"element": "button"
|
|
58
|
+
},
|
|
59
|
+
"screenshot": {
|
|
60
|
+
"states": [
|
|
61
|
+
"focus",
|
|
62
|
+
"hover",
|
|
63
|
+
"active"
|
|
64
|
+
],
|
|
65
|
+
"selector": ".nhsuk-back-link"
|
|
66
|
+
},
|
|
67
|
+
"options": {},
|
|
68
|
+
"html": "<button class=\"nhsuk-back-link\">\n Back\n</button>"
|
|
69
69
|
}
|
|
70
70
|
]
|
|
71
71
|
}
|
|
@@ -20,14 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
|
-
"screenshot":
|
|
24
|
-
"states": [
|
|
25
|
-
"focus",
|
|
26
|
-
"hover",
|
|
27
|
-
"active"
|
|
28
|
-
],
|
|
29
|
-
"selector": ".nhsuk-breadcrumb a"
|
|
30
|
-
},
|
|
23
|
+
"screenshot": true,
|
|
31
24
|
"options": {},
|
|
32
25
|
"html": "<nav class=\"nhsuk-breadcrumb\" aria-label=\"Breadcrumb\">\n <ol class=\"nhsuk-breadcrumb__list\">\n <li class=\"nhsuk-breadcrumb__list-item\">\n <a class=\"nhsuk-breadcrumb__link\" href=\"#\">Home</a>\n </li>\n <li class=\"nhsuk-breadcrumb__list-item\">\n <a class=\"nhsuk-breadcrumb__link\" href=\"#\">NHS services</a>\n </li>\n <li class=\"nhsuk-breadcrumb__list-item\">\n <a class=\"nhsuk-breadcrumb__link\" href=\"#\">Hospitals</a>\n </li>\n </ol>\n \n \n <a class=\"nhsuk-back-link\" href=\"#\">\n <span class=\"nhsuk-u-visually-hidden\">Back to</span> Hospitals\n </a>\n \n</nav>"
|
|
33
26
|
},
|
|
@@ -91,9 +84,7 @@
|
|
|
91
84
|
}
|
|
92
85
|
]
|
|
93
86
|
},
|
|
94
|
-
"screenshot":
|
|
95
|
-
"selector": ".nhsuk-breadcrumb a"
|
|
96
|
-
},
|
|
87
|
+
"screenshot": true,
|
|
97
88
|
"options": {
|
|
98
89
|
"layout": "background-blue"
|
|
99
90
|
},
|