govuk_publishing_components 64.1.2 → 64.2.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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +5 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +0 -20
- data/app/controllers/govuk_publishing_components/applications_page_controller.rb +5 -2
- data/app/controllers/govuk_publishing_components/audit_controller.rb +3 -2
- data/app/models/govuk_publishing_components/applications_page.rb +39 -4
- data/app/views/govuk_publishing_components/applications_page/_table-content.html.erb +9 -0
- data/app/views/govuk_publishing_components/applications_page/show.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_service_navigation.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/attachment.yml +1 -2
- data/app/views/govuk_publishing_components/components/docs/details.yml +1 -8
- data/app/views/govuk_publishing_components/components/docs/error_alert.yml +2 -4
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +7 -7
- data/app/views/govuk_publishing_components/components/docs/modal_dialogue.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/table.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +2 -6
- data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +2 -3
- data/lib/govuk_publishing_components/presenters/pagination_helper.rb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +31 -3
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +31 -3
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +95 -23
- data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +17 -17
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +17 -17
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-no-content-licence.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-custom-meta.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-meta-links.html +59 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +30 -28
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +31 -9
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-default.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-first-page.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-last-page.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +9 -9
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +18 -18
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +30 -2
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +30 -2
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +30 -2
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-default.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-inverse.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item-and-collapsenavigationonmobile-set-to-true.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-html-navigation-items.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-large-navigation.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-a-current-item.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-non-link-navigation-items.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name-and-navigation.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/macros/attributes.njk +30 -14
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/govuk/components/radios/_index.scss"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,2BAA2B;AAC3B,uBAAuB;AACvB,wBAAwB;;AAExB;EACE,+BAA+B;EAC/B,wBAAwB;EACxB,2EAA2E;EAC3E,8BAA8B;EAC9B,wDAAwD;EACxD,yEAAyE;EACzE,yEAAyE;EACzE,sBAAsB;EACtB,mDAAmD;;EAEnD;IACE,aAAa;IACb,eAAe;IACf,kBAAkB;IAClB,+BAA+B;EACjC;;EAEA;;IAEE,gBAAgB;EAClB;;EAEA;IACE,uEAAuE;IACvE,iEAAiE;IACjE,UAAU;IACV,+BAA+B;IAC/B,gCAAgC;IAChC,SAAS;IACT,UAAU;IACV,eAAe;EACjB;;EAEA;IACE,kBAAkB;;IAElB,wEAAwE;IACxE,qEAAqE;IACrE,yEAAyE;IACzE,iEAAiE;I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ACD,qEAAqE;IACrE,sEAAsE;IACtE,oEAAoE;IACpE,wCAAwC;IACxC;MACE,iDAAiD;MACjD,kDAAkD;MAClD,qDAAqD;MACrD,mBAAmB;MACnB,wDAAwD;IAC1D;;IAEA,yEAAyE;IACzE,+BAA+B;IAC/B,CAAC;IACD,wEAAwE;IACxE,oDAAoD;IACpD;MACE,wEAAwE;MACxE;QACE,wBAAwB;MAC1B;MACA,iBAAiB;MACjB;;oDAE8C,EAAE,GAAG;IACrD;;IAEA,wEAAwE;IACxE,yCAAyC;IACzC,CAAC;IACD,wEAAwE;IACxE,sEAAsE;IACtE,2DAA2D;IAC3D;MACE;QACE,mBAAmB;MACrB;;MAEA;QACE,+DAA+D;MACjE;IACF;EACF;AACF","file":"_index.scss","sourcesContent":["@import \"../error-message/index\";\n@import \"../fieldset/index\";\n@import \"../hint/index\";\n@import \"../label/index\";\n\n@include govuk-exports(\"govuk/component/radios\") {\n $govuk-touch-target-gutter: 4px;\n $govuk-radios-size: 40px;\n $govuk-touch-target-size: ($govuk-radios-size + $govuk-touch-target-gutter);\n $govuk-small-radios-size: 24px;\n $govuk-radios-label-padding-left-right: govuk-spacing(3);\n // When the default focus width is used on a curved edge it looks visually\n // smaller. So for the circular radios we bump the default to make it look\n // visually consistent.\n $govuk-radios-focus-width: $govuk-focus-width + 1px;\n\n .govuk-radios__item {\n display: flex;\n flex-wrap: wrap;\n position: relative;\n margin-bottom: govuk-spacing(2);\n }\n\n .govuk-radios__item:last-child,\n .govuk-radios__item:last-of-type {\n margin-bottom: 0;\n }\n\n .govuk-radios__input {\n // Allow the input to sit above the label, enabling its proper detection\n // when exploring by touch or using automation tools like Selenium\n z-index: 1;\n width: $govuk-touch-target-size;\n height: $govuk-touch-target-size;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n }\n\n .govuk-radios__label {\n align-self: center;\n\n // Ensure that the width of the label is never more than the width of the\n // container minus the input width minus the padding on either side of\n // the label. This prevents the label from going onto the next line due to\n // __item using flex-wrap because we want hints on a separate line\n max-width: calc(100% - #{($govuk-radios-label-padding-left-right + $govuk-touch-target-size + govuk-spacing(3))});\n margin-bottom: 0;\n padding: (govuk-spacing(1) + $govuk-border-width-form-element) govuk-spacing(3);\n cursor: pointer;\n // remove 300ms pause on mobile\n touch-action: manipulation;\n }\n\n // ( ) Radio ring\n .govuk-radios__label::before {\n content: \"\";\n box-sizing: border-box;\n position: absolute;\n top: ($govuk-touch-target-gutter / 2);\n left: ($govuk-touch-target-gutter / 2);\n width: $govuk-radios-size;\n height: $govuk-radios-size;\n border: $govuk-border-width-form-element solid currentcolor;\n border-radius: 50%;\n background: transparent;\n }\n\n // • Radio button\n //\n // We create the 'button' entirely out of 'border' so that they remain\n // 'filled' even when colours are overridden in the browser.\n .govuk-radios__label::after {\n $radio-button-size: govuk-spacing(2);\n\n content: \"\";\n position: absolute;\n\n // Positioned by getting half the touch target, so we have the centre of the\n // input, and then moving back by the button's border width, thus positioning\n // the centre of the button in the centre of the input.\n top: (($govuk-touch-target-size / 2) - $radio-button-size);\n left: (($govuk-touch-target-size / 2) - $radio-button-size);\n width: 0;\n height: 0;\n border: $radio-button-size solid currentcolor;\n border-radius: 50%;\n opacity: 0;\n background: currentcolor;\n }\n\n .govuk-radios__hint {\n display: block;\n width: 100%;\n margin-top: govuk-spacing(-1);\n padding-right: $govuk-radios-label-padding-left-right;\n padding-left: ($govuk-radios-label-padding-left-right + $govuk-touch-target-size);\n }\n\n // This is to bypass govuk-hint's specificity on hints following labels having\n // a margin bottom of 10px (govuk-spacing(2)). Because radios are flexbox,\n // the margin doesn't collapse so we have to do this manually.\n .govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl) + .govuk-radios__hint {\n margin-bottom: 0;\n }\n\n // Focused state\n .govuk-radios__input:focus + .govuk-radios__label::before {\n border-width: 4px;\n\n // When colours are overridden, the yellow box-shadow becomes invisible\n // which means the focus state is less obvious. By adding a transparent\n // outline, which becomes solid (text-coloured) in that context, we ensure\n // the focus remains clearly visible.\n outline: $govuk-focus-width solid transparent;\n outline-offset: 1px;\n\n // When in an explicit forced-color mode, we can use the Highlight system\n // color for the outline to better match focus states of native controls\n @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n outline-color: Highlight;\n }\n\n box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;\n }\n\n // Selected state\n .govuk-radios__input:checked + .govuk-radios__label::after {\n opacity: 1;\n }\n\n // Disabled state\n .govuk-radios__input:disabled,\n .govuk-radios__input:disabled + .govuk-radios__label {\n cursor: not-allowed;\n }\n\n .govuk-radios__input:disabled + .govuk-radios__label,\n .govuk-radios__input:disabled ~ .govuk-hint {\n opacity: 0.5;\n }\n\n // =========================================================\n // Inline radios\n // =========================================================\n\n .govuk-radios--inline {\n @media #{govuk-from-breakpoint(tablet)} {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n\n .govuk-radios__item {\n margin-right: govuk-spacing(4);\n }\n }\n }\n\n // =========================================================\n // Dividers ('or')\n // =========================================================\n\n .govuk-radios__divider {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n $govuk-divider-size: $govuk-radios-size !default;\n width: $govuk-divider-size;\n margin-bottom: govuk-spacing(2);\n text-align: center;\n }\n\n // =========================================================\n // Conditional reveals\n // =========================================================\n\n // The narrow border is used in the conditional reveals because the border has\n // to be an even number in order to be centred under the 40px checkbox radio.\n $conditional-border-width: $govuk-border-width-narrow;\n // Calculate the amount of padding needed to keep the border centered against\n // the radios.\n $conditional-border-padding: ($govuk-touch-target-size / 2) - ($conditional-border-width / 2);\n // Move the border centered with the radios\n $conditional-margin-left: $conditional-border-padding;\n // Move the contents of the conditional inline with the label\n $conditional-padding-left: $conditional-border-padding + $govuk-radios-label-padding-left-right;\n\n .govuk-radios__conditional {\n @include govuk-responsive-margin(4, \"bottom\");\n margin-left: $conditional-margin-left;\n padding-left: $conditional-padding-left;\n border-left: $conditional-border-width solid $govuk-border-colour;\n\n .govuk-frontend-supported &--hidden {\n display: none;\n }\n\n & > :last-child {\n margin-bottom: 0;\n }\n }\n\n // =========================================================\n // Small checkboxes\n // =========================================================\n\n .govuk-radios--small {\n $input-offset: ($govuk-touch-target-size - $govuk-small-radios-size) / 2;\n\n .govuk-radios__item {\n margin-bottom: 0;\n }\n\n // Shift the touch target into the left margin so that the visible edge of\n // the control is aligned\n //\n // ┆Which colour is your favourite?\n // ┌┆───┐\n // │┆() │ Purple\n // └┆▲──┘\n // ▲┆└─ Radio pseudo element, aligned with margin\n // └─── Touch target (invisible input), shifted into the margin\n .govuk-radios__input {\n margin-left: $input-offset * -1;\n }\n\n .govuk-radios__label {\n // Create a tiny space between the small radio hover state so that it\n // doesn't clash with the label\n padding-left: 1px;\n }\n\n // ( ) Radio ring\n //\n // Reduce the size of the control [1], vertically centering it within the\n // touch target [2]\n // Left here is 0 because we've shifted the input into the left margin\n .govuk-radios__label::before {\n top: $input-offset; // 2\n left: 0;\n width: $govuk-small-radios-size; // 1\n height: $govuk-small-radios-size; // 1\n }\n\n // • Radio button\n //\n // Reduce the size of the 'button' and center it within the ring\n .govuk-radios__label::after {\n $radio-button-size: govuk-spacing(1);\n\n // The same calculation as normal radio buttons but reduce the border width\n top: (($govuk-touch-target-size / 2) - $radio-button-size);\n left: ((($govuk-touch-target-size / 2) - $radio-button-size) - $input-offset);\n border-width: $radio-button-size;\n }\n\n // Fix position of hint with small radios\n //\n // Do not use hints with small radios – because they're within the input\n // wrapper they trigger the hover state, but clicking them doesn't actually\n // activate the control.\n //\n // (If you do use them, they won't look completely broken... but seriously,\n // don't use them)\n .govuk-radios__hint {\n padding-left: ($govuk-small-radios-size + $input-offset);\n }\n\n // Align conditional reveals with small radios\n .govuk-radios__conditional {\n $margin-left: ($govuk-small-radios-size / 2) - ($conditional-border-width / 2);\n margin-left: $margin-left;\n padding-left: ($govuk-touch-target-size - $input-offset) - ($margin-left + $conditional-border-width);\n }\n\n .govuk-radios__divider {\n width: $govuk-small-radios-size;\n margin-bottom: govuk-spacing(1);\n }\n\n // Hover state for small radios.\n //\n // We use a hover state for small radios because the touch target size\n // is so much larger than their visible size, and so we need to provide\n // feedback to the user as to which radio they will select when their\n // cursor is outside of the visible area.\n .govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label::before {\n // Forced colours modes tend to ignore box-shadow.\n // Apply an outline for those modes to use instead.\n outline: $govuk-radios-focus-width dashed transparent;\n outline-offset: 1px;\n box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;\n }\n\n // Because we've overridden the border-shadow provided by the focus state,\n // we need to redefine that too.\n //\n // We use two box shadows, one that restores the original focus state [1]\n // and another that then applies the hover state [2].\n .govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label::before {\n // Set different HCM colour when we have both hover/focus applied at once\n @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n outline-color: Highlight;\n }\n // prettier-ignore\n box-shadow:\n 0 0 0 $govuk-radios-focus-width $govuk-focus-colour // 1,\n 0 0 0 $govuk-hover-width $govuk-hover-colour; // 2\n }\n\n // For devices that explicitly don't support hover, don't provide a hover\n // state (e.g. on touch devices like iOS).\n //\n // We can't use `@media (hover: hover)` because we wouldn't get the hover\n // state in browsers that don't support `@media (hover)` (like Internet\n // Explorer) – so we have to 'undo' the hover state instead.\n @media (hover: none), (pointer: coarse) {\n .govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label::before {\n box-shadow: initial;\n }\n\n .govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label::before {\n box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/govuk/components/radios/_index.scss"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,2BAA2B;AAC3B,uBAAuB;AACvB,wBAAwB;;AAExB;EACE,+BAA+B;EAC/B,wBAAwB;EACxB,2EAA2E;EAC3E,8BAA8B;EAC9B,wDAAwD;EACxD,yEAAyE;EACzE,yEAAyE;EACzE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6EAA6E;MAC7E,gCAAgC;IAClC;;IAEA,wCAAwC;IACxC,CAAC;IACD,uEAAuE;IACvE,0EAA0E;IAC1E,uBAAuB;IACvB,CAAC;IACD,0EAA0E;IAC1E,iBAAiB;IACjB;MACE,wDAAwD;IAC1D;;IAEA,6CAA6C;IAC7C;MACE,8EAA8E;MAC9E,yBAAyB;MACzB,qGAAqG;IACvG;;IAEA;MACE,+BAA+B;MAC/B,+BAA+B;IACjC;;IAEA,+BAA+B;IAC/B,CAAC;IACD,qEAAqE;IACrE,sEAAsE;IACtE,oEAAoE;IACpE,wCAAwC;IACxC;MACE,iDAAiD;MACjD,kDAAkD;MAClD,qDAAqD;MACrD,mBAAmB;MACnB,wDAAwD;IAC1D;;IAEA,yEAAyE;IACzE,+BAA+B;IAC/B,CAAC;IACD,wEAAwE;IACxE,oDAAoD;IACpD;MACE,wEAAwE;MACxE;QACE,wBAAwB;MAC1B;MACA,iBAAiB;MACjB;;oDAE8C,EAAE,GAAG;IACrD;;IAEA,wEAAwE;IACxE,yCAAyC;IACzC,CAAC;IACD,wEAAwE;IACxE,sEAAsE;IACtE,2DAA2D;IAC3D;MACE;QACE,mBAAmB;MACrB;;MAEA;QACE,+DAA+D;MACjE;IACF;EACF;AACF","file":"_index.scss","sourcesContent":["@import \"../error-message/index\";\n@import \"../fieldset/index\";\n@import \"../hint/index\";\n@import \"../label/index\";\n\n@include govuk-exports(\"govuk/component/radios\") {\n $govuk-touch-target-gutter: 4px;\n $govuk-radios-size: 40px;\n $govuk-touch-target-size: ($govuk-radios-size + $govuk-touch-target-gutter);\n $govuk-small-radios-size: 24px;\n $govuk-radios-label-padding-left-right: govuk-spacing(3);\n // When the default focus width is used on a curved edge it looks visually\n // smaller. So for the circular radios we bump the default to make it look\n // visually consistent.\n $govuk-radios-focus-width: $govuk-focus-width + 1px;\n\n .govuk-radios__item {\n display: flex;\n flex-wrap: wrap;\n position: relative;\n margin-bottom: govuk-spacing(2);\n }\n\n .govuk-radios__item:last-child,\n .govuk-radios__item:last-of-type {\n margin-bottom: 0;\n }\n\n .govuk-radios__input {\n // Allow the input to sit above the label, enabling its proper detection\n // when exploring by touch or using automation tools like Selenium\n z-index: 1;\n width: $govuk-touch-target-size;\n height: $govuk-touch-target-size;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n }\n\n .govuk-radios__label {\n align-self: center;\n\n // Ensure that the width of the label is never more than the width of the\n // container minus the input width minus the padding on either side of\n // the label. This prevents the label from going onto the next line due to\n // __item using flex-wrap because we want hints on a separate line\n max-width: calc(100% - #{($govuk-radios-label-padding-left-right + $govuk-touch-target-size + govuk-spacing(3))});\n margin-bottom: 0;\n padding: (govuk-spacing(1) + $govuk-border-width-form-element) govuk-spacing(3);\n cursor: pointer;\n // remove 300ms pause on mobile\n touch-action: manipulation;\n }\n\n // ( ) Radio ring\n .govuk-radios__label::before {\n content: \"\";\n box-sizing: border-box;\n position: absolute;\n top: ($govuk-touch-target-gutter / 2);\n left: ($govuk-touch-target-gutter / 2);\n width: $govuk-radios-size;\n height: $govuk-radios-size;\n border: $govuk-border-width-form-element solid currentcolor;\n border-radius: 50%;\n background: transparent;\n }\n\n // • Radio button\n //\n // We create the 'button' entirely out of 'border' so that they remain\n // 'filled' even when colours are overridden in the browser.\n .govuk-radios__label::after {\n $radio-button-size: govuk-spacing(2);\n\n content: \"\";\n position: absolute;\n\n // Positioned by getting half the touch target, so we have the centre of the\n // input, and then moving back by the button's border width, thus positioning\n // the centre of the button in the centre of the input.\n top: (($govuk-touch-target-size / 2) - $radio-button-size);\n left: (($govuk-touch-target-size / 2) - $radio-button-size);\n width: 0;\n height: 0;\n border: $radio-button-size solid currentcolor;\n border-radius: 50%;\n opacity: 0;\n background: currentcolor;\n }\n\n .govuk-radios__hint {\n display: block;\n width: 100%;\n margin-top: govuk-spacing(-1);\n padding-right: $govuk-radios-label-padding-left-right;\n padding-left: ($govuk-radios-label-padding-left-right + $govuk-touch-target-size);\n }\n\n // This is to bypass govuk-hint's specificity on hints following labels having\n // a margin bottom of 10px (govuk-spacing(2)). Because radios are flexbox,\n // the margin doesn't collapse so we have to do this manually.\n .govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl) + .govuk-radios__hint {\n margin-bottom: 0;\n }\n\n // Focused state\n .govuk-radios__input:focus + .govuk-radios__label::before {\n border-width: 4px;\n\n // When colours are overridden, the yellow box-shadow becomes invisible\n // which means the focus state is less obvious. By adding a transparent\n // outline, which becomes solid (text-coloured) in that context, we ensure\n // the focus remains clearly visible.\n outline: $govuk-focus-width solid transparent;\n outline-offset: 1px;\n\n // When in an explicit forced-color mode, we can use the Highlight system\n // color for the outline to better match focus states of native controls\n @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n outline-color: Highlight;\n }\n\n box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;\n }\n\n // Selected state\n .govuk-radios__input:checked + .govuk-radios__label::after {\n opacity: 1;\n }\n\n // Disabled state\n .govuk-radios__input:disabled,\n .govuk-radios__input:disabled + .govuk-radios__label {\n cursor: not-allowed;\n }\n\n .govuk-radios__input:disabled + .govuk-radios__label,\n .govuk-radios__input:disabled ~ .govuk-hint {\n opacity: 0.5;\n }\n\n // =========================================================\n // Inline radios\n // =========================================================\n\n .govuk-radios--inline {\n @media #{govuk-from-breakpoint(tablet)} {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n\n .govuk-radios__item {\n margin-right: govuk-spacing(4);\n }\n }\n }\n\n // =========================================================\n // Dividers ('or')\n // =========================================================\n\n .govuk-radios__divider {\n @include govuk-font($size: 19);\n @include govuk-text-colour;\n $govuk-divider-size: $govuk-radios-size !default;\n width: $govuk-divider-size;\n margin-bottom: govuk-spacing(2);\n text-align: center;\n }\n\n // =========================================================\n // Conditional reveals\n // =========================================================\n\n // The narrow border is used in the conditional reveals because the border has\n // to be an even number in order to be centred under the 40px checkbox radio.\n $conditional-border-width: $govuk-border-width-narrow;\n // Calculate the amount of padding needed to keep the border centered against\n // the radios.\n $conditional-border-padding: ($govuk-touch-target-size / 2) - ($conditional-border-width / 2);\n // Move the border centered with the radios\n $conditional-margin-left: $conditional-border-padding;\n // Move the contents of the conditional inline with the label\n $conditional-padding-left: $conditional-border-padding + $govuk-radios-label-padding-left-right;\n\n .govuk-radios__conditional {\n @include govuk-responsive-margin(4, \"bottom\");\n margin-left: $conditional-margin-left;\n padding-left: $conditional-padding-left;\n border-left: $conditional-border-width solid $govuk-border-colour;\n\n .govuk-frontend-supported &--hidden {\n display: none;\n }\n\n & > :last-child {\n margin-bottom: 0;\n }\n }\n\n // =========================================================\n // Small checkboxes\n // =========================================================\n\n .govuk-radios--small {\n $input-offset: ($govuk-touch-target-size - $govuk-small-radios-size) / 2;\n\n .govuk-radios__item {\n margin-bottom: 0;\n }\n\n // Shift the touch target into the left margin so that the visible edge of\n // the control is aligned\n //\n // ┆Which colour is your favourite?\n // ┌┆───┐\n // │┆() │ Purple\n // └┆▲──┘\n // ▲┆└─ Radio pseudo element, aligned with margin\n // └─── Touch target (invisible input), shifted into the margin\n .govuk-radios__input {\n margin-left: $input-offset * -1;\n }\n\n .govuk-radios__label {\n // Create a tiny space between the small radio hover state so that it\n // doesn't clash with the label\n padding-left: 1px;\n }\n\n // ( ) Radio ring\n //\n // Reduce the size of the control [1], vertically centering it within the\n // touch target [2]\n // Left here is 0 because we've shifted the input into the left margin\n .govuk-radios__label::before {\n top: $input-offset; // 2\n left: 0;\n width: $govuk-small-radios-size; // 1\n height: $govuk-small-radios-size; // 1\n }\n\n // • Radio button\n //\n // Reduce the size of the 'button' and center it within the ring\n .govuk-radios__label::after {\n $radio-button-size: govuk-spacing(1);\n\n // The same calculation as normal radio buttons but reduce the border width\n top: (($govuk-touch-target-size / 2) - $radio-button-size);\n left: ((($govuk-touch-target-size / 2) - $radio-button-size) - $input-offset);\n border-width: $radio-button-size;\n }\n\n // Fix position of hint with small radios\n //\n // Do not use hints with small radios – because they're within the input\n // wrapper they trigger the hover state, but clicking them doesn't actually\n // activate the control.\n //\n // (If you do use them, they won't look completely broken... but seriously,\n // don't use them)\n .govuk-radios__hint {\n padding-left: ($govuk-small-radios-size + $input-offset);\n }\n\n // Align conditional reveals with small radios\n .govuk-radios__conditional {\n $margin-left: ($govuk-small-radios-size / 2) - ($conditional-border-width / 2);\n margin-left: $margin-left;\n padding-left: ($govuk-touch-target-size - $input-offset) - ($margin-left + $conditional-border-width);\n }\n\n .govuk-radios__divider {\n width: $govuk-small-radios-size;\n margin-bottom: govuk-spacing(1);\n }\n\n // Hover state for small radios.\n //\n // We use a hover state for small radios because the touch target size\n // is so much larger than their visible size, and so we need to provide\n // feedback to the user as to which radio they will select when their\n // cursor is outside of the visible area.\n .govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label::before {\n // Forced colours modes tend to ignore box-shadow.\n // Apply an outline for those modes to use instead.\n outline: $govuk-radios-focus-width dashed transparent;\n outline-offset: 1px;\n box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;\n }\n\n // Because we've overridden the border-shadow provided by the focus state,\n // we need to redefine that too.\n //\n // We use two box shadows, one that restores the original focus state [1]\n // and another that then applies the hover state [2].\n .govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label::before {\n // Set different HCM colour when we have both hover/focus applied at once\n @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n outline-color: Highlight;\n }\n // prettier-ignore\n box-shadow:\n 0 0 0 $govuk-radios-focus-width $govuk-focus-colour, // 1\n 0 0 0 $govuk-hover-width $govuk-hover-colour; // 2\n }\n\n // For devices that explicitly don't support hover, don't provide a hover\n // state (e.g. on touch devices like iOS).\n //\n // We can't use `@media (hover: hover)` because we wouldn't get the hover\n // state in browsers that don't support `@media (hover)` (like Internet\n // Explorer) – so we have to 'undo' the hover state instead.\n @media (hover: none), (pointer: coarse) {\n .govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label::before {\n box-shadow: initial;\n }\n\n .govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label::before {\n box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;\n }\n }\n }\n}\n"]}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"no-js"
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
35
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"name": "with navigation with a current item",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"description": "The current item indicates that the user is present on that exact page. It looks the same as an active item, but marks this item as the one the user is currently viewing in ARIA.",
|
|
62
62
|
"pageTemplateOptions": {},
|
|
63
63
|
"screenshot": false,
|
|
64
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item govuk-service-navigation__item--active\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\" aria-current=\"page\">\n \n <strong class=\"govuk-service-navigation__active-fallback\">Navigation item 2</strong>\n\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
64
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item govuk-service-navigation__item--active\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\" aria-current=\"page\">\n \n <strong class=\"govuk-service-navigation__active-fallback\">Navigation item 2</strong>\n\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"name": "with large navigation",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"description": "",
|
|
138
138
|
"pageTemplateOptions": {},
|
|
139
139
|
"screenshot": false,
|
|
140
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/benefits\">\n \nBenefits\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/births-deaths-marriages\">\n \nBirths, deaths, marriages and care\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/business\">\n \nBusiness and self-employed\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/childcare-parenting\">\n \nChildcare and parenting\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/citizenship\">\n \nCitizenship and living in the UK\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/justice\">\n \nCrime, justice and the law\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/disabilities\">\n \nDisabled people\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/driving\">\n \nDriving and transport\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/education\">\n \nEducation and learning\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/employing-people\">\n \nEmploying people\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/environment-countryside\">\n \nEnvironment and countryside\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/housing-local-services\">\n \nHousing and local services\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/tax\">\n \nMoney and tax\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/abroad\">\n \nPassports, travel and living abroad\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/visas-immigration\">\n \nVisas and immigration\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/working\">\n \nWorking, jobs and pensions\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
140
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/benefits\">\n \nBenefits\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/births-deaths-marriages\">\n \nBirths, deaths, marriages and care\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/business\">\n \nBusiness and self-employed\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/childcare-parenting\">\n \nChildcare and parenting\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/citizenship\">\n \nCitizenship and living in the UK\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/justice\">\n \nCrime, justice and the law\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/disabilities\">\n \nDisabled people\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/driving\">\n \nDriving and transport\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/education\">\n \nEducation and learning\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/employing-people\">\n \nEmploying people\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/environment-countryside\">\n \nEnvironment and countryside\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/housing-local-services\">\n \nHousing and local services\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/tax\">\n \nMoney and tax\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/abroad\">\n \nPassports, travel and living abroad\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/visas-immigration\">\n \nVisas and immigration\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/browse/working\">\n \nWorking, jobs and pensions\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
"name": "with HTML navigation items",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"description": "",
|
|
162
162
|
"pageTemplateOptions": {},
|
|
163
163
|
"screenshot": false,
|
|
164
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \n<em>Navigation item 1</em>\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \n<em>Navigation item 2</em>\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \n<em>Navigation item 3</em>\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
164
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \n<em>Navigation item 1</em>\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \n<em>Navigation item 2</em>\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \n<em>Navigation item 3</em>\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
"name": "with non-link navigation items",
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
"description": "",
|
|
183
183
|
"pageTemplateOptions": {},
|
|
184
184
|
"screenshot": false,
|
|
185
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <span class=\"govuk-service-navigation__text\">\n \nNavigation item 1\n </span>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <span class=\"govuk-service-navigation__text\">\n \n<em>Navigation item 2</em>\n </span>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <span class=\"govuk-service-navigation__text\">\n \nNavigation item 3\n </span>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
185
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <span class=\"govuk-service-navigation__text\">\n \nNavigation item 1\n </span>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <span class=\"govuk-service-navigation__text\">\n \n<em>Navigation item 2</em>\n </span>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <span class=\"govuk-service-navigation__text\">\n \nNavigation item 3\n </span>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
188
|
"name": "with service name",
|
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
"description": "",
|
|
249
249
|
"pageTemplateOptions": {},
|
|
250
250
|
"screenshot": false,
|
|
251
|
-
"html": "<section aria-label=\"Service information\" class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n <span class=\"govuk-service-navigation__service-name\">\n <a href=\"#/\" class=\"govuk-service-navigation__link\">\n Apply for a juggling license\n </a>\n </span>\n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item govuk-service-navigation__item--active\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\" aria-current=\"true\">\n \n <strong class=\"govuk-service-navigation__active-fallback\">Navigation item 2</strong>\n\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </section>"
|
|
251
|
+
"html": "<section aria-label=\"Service information\" class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n <span class=\"govuk-service-navigation__service-name\">\n <a href=\"#/\" class=\"govuk-service-navigation__link\">\n Apply for a juggling license\n </a>\n </span>\n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item govuk-service-navigation__item--active\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\" aria-current=\"true\">\n \n <strong class=\"govuk-service-navigation__active-fallback\">Navigation item 2</strong>\n\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </section>"
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
"name": "inverse",
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
"bodyClasses": "app-template__body--inverse"
|
|
283
283
|
},
|
|
284
284
|
"screenshot": false,
|
|
285
|
-
"html": "<section aria-label=\"Service information\" class=\"govuk-service-navigation govuk-service-navigation--inverse\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n <span class=\"govuk-service-navigation__service-name\">\n <a href=\"#/\" class=\"govuk-service-navigation__link\">\n Apply for a juggling license\n </a>\n </span>\n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item govuk-service-navigation__item--active\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\" aria-current=\"true\">\n \n <strong class=\"govuk-service-navigation__active-fallback\">Navigation item 2</strong>\n\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </section>"
|
|
285
|
+
"html": "<section aria-label=\"Service information\" class=\"govuk-service-navigation govuk-service-navigation--inverse\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n <span class=\"govuk-service-navigation__service-name\">\n <a href=\"#/\" class=\"govuk-service-navigation__link\">\n Apply for a juggling license\n </a>\n </span>\n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item govuk-service-navigation__item--active\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\" aria-current=\"true\">\n \n <strong class=\"govuk-service-navigation__active-fallback\">Navigation item 2</strong>\n\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </section>"
|
|
286
286
|
},
|
|
287
287
|
{
|
|
288
288
|
"name": "with collapseNavigationOnMobile set to false",
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
"description": "",
|
|
352
352
|
"pageTemplateOptions": {},
|
|
353
353
|
"screenshot": false,
|
|
354
|
-
"html": "<section aria-label=\"Service information\" class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n <span class=\"govuk-service-navigation__service-name\">\n <a href=\"#/\" class=\"govuk-service-navigation__link\">\n Apply for a juggling license\n </a>\n </span>\n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nLog out\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </section>"
|
|
354
|
+
"html": "<section aria-label=\"Service information\" class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n <span class=\"govuk-service-navigation__service-name\">\n <a href=\"#/\" class=\"govuk-service-navigation__link\">\n Apply for a juggling license\n </a>\n </span>\n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nLog out\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </section>"
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
357
|
"name": "with no options set",
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
"description": "",
|
|
421
421
|
"pageTemplateOptions": {},
|
|
422
422
|
"screenshot": false,
|
|
423
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Enter the NavZone\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Enter the NavZone\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
423
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Enter the NavZone\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Enter the NavZone\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
426
|
"name": "with custom navigation toggle label",
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
"description": "",
|
|
442
442
|
"pageTemplateOptions": {},
|
|
443
443
|
"screenshot": false,
|
|
444
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" aria-label=\"Enter the NavZone\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
444
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" aria-label=\"Enter the NavZone\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
445
445
|
},
|
|
446
446
|
{
|
|
447
447
|
"name": "with identical navigation toggle text and label",
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
"description": "",
|
|
464
464
|
"pageTemplateOptions": {},
|
|
465
465
|
"screenshot": false,
|
|
466
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Enter the NavZone\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Enter the NavZone\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
466
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Enter the NavZone\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Enter the NavZone\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
467
467
|
},
|
|
468
468
|
{
|
|
469
469
|
"name": "with custom navigation label",
|
|
@@ -484,7 +484,7 @@
|
|
|
484
484
|
"description": "",
|
|
485
485
|
"pageTemplateOptions": {},
|
|
486
486
|
"screenshot": false,
|
|
487
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Main navigation\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
487
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Main navigation\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
488
488
|
},
|
|
489
489
|
{
|
|
490
490
|
"name": "with custom navigation toggle text and navigation label",
|
|
@@ -506,7 +506,7 @@
|
|
|
506
506
|
"description": "",
|
|
507
507
|
"pageTemplateOptions": {},
|
|
508
508
|
"screenshot": false,
|
|
509
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"The NavZone\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Enter the NavZone\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
509
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"The NavZone\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Enter the NavZone\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
510
510
|
},
|
|
511
511
|
{
|
|
512
512
|
"name": "with custom navigation classes",
|
|
@@ -527,7 +527,7 @@
|
|
|
527
527
|
"description": "",
|
|
528
528
|
"pageTemplateOptions": {},
|
|
529
529
|
"screenshot": false,
|
|
530
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper app-my-neat-navigation-class\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
530
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper app-my-neat-navigation-class\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
531
531
|
},
|
|
532
532
|
{
|
|
533
533
|
"name": "with custom navigation ID",
|
|
@@ -548,7 +548,7 @@
|
|
|
548
548
|
"description": "",
|
|
549
549
|
"pageTemplateOptions": {},
|
|
550
550
|
"screenshot": false,
|
|
551
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"main-nav\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"main-nav\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
551
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"main-nav\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"main-nav\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
552
552
|
},
|
|
553
553
|
{
|
|
554
554
|
"name": "with navigation having empty values",
|
|
@@ -572,7 +572,7 @@
|
|
|
572
572
|
"description": "",
|
|
573
573
|
"pageTemplateOptions": {},
|
|
574
574
|
"screenshot": false,
|
|
575
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
575
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
576
576
|
},
|
|
577
577
|
{
|
|
578
578
|
"name": "with navigation having only empty values",
|
|
@@ -628,7 +628,7 @@
|
|
|
628
628
|
"description": "The active item indicates that the user is within that section, but not on the exact page being linked. It looks the same as a current item, but marks this item as an ancestor to the one the user is viewing in ARIA (e.g. a parent section).",
|
|
629
629
|
"pageTemplateOptions": {},
|
|
630
630
|
"screenshot": false,
|
|
631
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item govuk-service-navigation__item--active\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\" aria-current=\"true\">\n \n <strong class=\"govuk-service-navigation__active-fallback\">Navigation item 2</strong>\n\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
631
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item govuk-service-navigation__item--active\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\" aria-current=\"true\">\n \n <strong class=\"govuk-service-navigation__active-fallback\">Navigation item 2</strong>\n\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
632
632
|
},
|
|
633
633
|
{
|
|
634
634
|
"name": "with slotted content",
|
|
@@ -674,7 +674,7 @@
|
|
|
674
674
|
"htmlClasses": "govuk-template--rebranded"
|
|
675
675
|
},
|
|
676
676
|
"screenshot": true,
|
|
677
|
-
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden>\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
677
|
+
"html": "<div class=\"govuk-service-navigation\"\ndata-module=\"govuk-service-navigation\"\n>\n <div class=\"govuk-width-container\">\n\n <div class=\"govuk-service-navigation__container\">\n \n\n \n <nav aria-label=\"Menu\" class=\"govuk-service-navigation__wrapper\">\n <button type=\"button\" class=\"govuk-service-navigation__toggle govuk-js-service-navigation-toggle\" aria-controls=\"navigation\" hidden aria-hidden=\"true\">\n Menu\n </button>\n\n <ul class=\"govuk-service-navigation__list\" id=\"navigation\" >\n\n \n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/1\">\n \nNavigation item 1\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/2\">\n \nNavigation item 2\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/3\">\n \nNavigation item 3\n </a>\n </li>\n\n \n <li class=\"govuk-service-navigation__item\">\n <a class=\"govuk-service-navigation__link\" href=\"#/4\">\n \nNavigation item 4\n </a>\n </li>\n\n </ul>\n </nav>\n </div>\n\n </div>\n\n </div>"
|
|
678
678
|
}
|
|
679
679
|
],
|
|
680
680
|
"previewLayout": "full-width"
|
|
@@ -210,9 +210,9 @@
|
|
|
210
210
|
}
|
|
211
211
|
if (this.mql.matches) {
|
|
212
212
|
this.$menu.removeAttribute('hidden');
|
|
213
|
-
this.$menuButton
|
|
213
|
+
setAttributes(this.$menuButton, attributesForHidingButton);
|
|
214
214
|
} else {
|
|
215
|
-
this.$menuButton.
|
|
215
|
+
removeAttributes(this.$menuButton, Object.keys(attributesForHidingButton));
|
|
216
216
|
this.$menuButton.setAttribute('aria-expanded', this.menuIsOpen.toString());
|
|
217
217
|
if (this.menuIsOpen) {
|
|
218
218
|
this.$menu.removeAttribute('hidden');
|
|
@@ -227,6 +227,34 @@
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
ServiceNavigation.moduleName = 'govuk-service-navigation';
|
|
230
|
+
const attributesForHidingButton = {
|
|
231
|
+
hidden: '',
|
|
232
|
+
'aria-hidden': 'true'
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Sets a group of attributes on the given element
|
|
237
|
+
*
|
|
238
|
+
* @param {Element} $element - The element to set the attribute on
|
|
239
|
+
* @param {{[attributeName: string]: string}} attributes - The attributes to set
|
|
240
|
+
*/
|
|
241
|
+
function setAttributes($element, attributes) {
|
|
242
|
+
for (const attributeName in attributes) {
|
|
243
|
+
$element.setAttribute(attributeName, attributes[attributeName]);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Removes a list of attributes from the given element
|
|
249
|
+
*
|
|
250
|
+
* @param {Element} $element - The element to remove the attributes from
|
|
251
|
+
* @param {string[]} attributeNames - The names of the attributes to remove
|
|
252
|
+
*/
|
|
253
|
+
function removeAttributes($element, attributeNames) {
|
|
254
|
+
for (const attributeName of attributeNames) {
|
|
255
|
+
$element.removeAttribute(attributeName);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
230
258
|
|
|
231
259
|
exports.ServiceNavigation = ServiceNavigation;
|
|
232
260
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-navigation.bundle.js","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/component.mjs","../../../../src/govuk/components/service-navigation/service-navigation.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @template {Partial<Record<keyof ObjectType, unknown>>} ObjectType\n * @param {unknown | ObjectType} option - Option to check\n * @returns {option is ObjectType} Whether the option is an object\n */\nexport function isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Check for valid scope\n *\n * @internal\n * @template {Element | Document} ScopeType\n * @param {unknown | ScopeType} $scope - Scope of the document to search within\n * @returns {$scope is ScopeType} Whether the scope can be queried\n */\nexport function isScope($scope) {\n return !!$scope && ($scope instanceof Element || $scope instanceof Document)\n}\n\n/**\n * Format error message\n *\n * @internal\n * @param {ComponentWithModuleName} Component - Component that threw the error\n * @param {string} message - Error message\n * @returns {string} - Formatted error message\n */\nexport function formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`\n}\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\n/* eslint-enable jsdoc/valid-types */\n","import { formatErrorMessage, isObject } from '../common/index.mjs'\n\n/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @virtual\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (isObject(messageOrOptions)) {\n const { component, identifier, element, expectedType } = messageOrOptions\n\n message = identifier\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n\n // Prepend with module name (optional)\n if (component) {\n message = formatErrorMessage(component, message)\n }\n }\n\n super(message)\n }\n}\n\n/**\n * Indicates that a component is already initialised\n */\nexport class InitError extends GOVUKFrontendError {\n name = 'InitError'\n\n /**\n * @internal\n * @param {ComponentWithModuleName | string} componentOrMessage - name of the component module\n */\n constructor(componentOrMessage) {\n const message =\n typeof componentOrMessage === 'string'\n ? componentOrMessage\n : formatErrorMessage(\n componentOrMessage,\n `Root element (\\`$root\\`) already initialised`\n )\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {Element | Document | null} [element] - The element in error (optional)\n * @property {ComponentWithModuleName} [component] - Component throwing the error (optional)\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {string} [expectedType] - The type that was expected for the identifier (optional)\n */\n\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n","import { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class Component {\n /**\n * @type {typeof Element}\n */\n static elementType = HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\n","import { getBreakpoint } from '../../common/index.mjs'\nimport { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\n/**\n * Service Navigation component\n *\n * @preserve\n */\nexport class ServiceNavigation extends Component {\n /** @private */\n $menuButton\n\n /** @private */\n $menu\n\n /**\n * Remember the open/closed state of the nav so we can maintain it when the\n * screen is resized.\n *\n * @private\n */\n menuIsOpen = false\n\n /**\n * A global const for storing a matchMedia instance which we'll use to detect\n * when a screen size change happens. We rely on it being null if the feature\n * isn't available to initially apply hidden attributes\n *\n * @private\n * @type {MediaQueryList | null}\n */\n mql = null\n\n /**\n * @param {Element | null} $root - HTML element to use for header\n */\n constructor($root) {\n super($root)\n\n const $menuButton = this.$root.querySelector(\n '.govuk-js-service-navigation-toggle'\n )\n\n // Headers don't necessarily have a navigation. When they don't, the menu\n // toggle won't be rendered by our macro (or may be omitted when writing\n // plain HTML)\n if (!$menuButton) {\n return this\n }\n\n const menuId = $menuButton.getAttribute('aria-controls')\n if (!menuId) {\n throw new ElementError({\n component: ServiceNavigation,\n identifier:\n 'Navigation button (`<button class=\"govuk-js-service-navigation-toggle\">`) attribute (`aria-controls`)'\n })\n }\n\n const $menu = document.getElementById(menuId)\n if (!$menu) {\n throw new ElementError({\n component: ServiceNavigation,\n element: $menu,\n identifier: `Navigation (\\`<ul id=\"${menuId}\">\\`)`\n })\n }\n\n this.$menu = $menu\n this.$menuButton = $menuButton\n\n this.setupResponsiveChecks()\n\n this.$menuButton.addEventListener('click', () =>\n this.handleMenuButtonClick()\n )\n }\n\n /**\n * Setup viewport resize check\n *\n * @private\n */\n setupResponsiveChecks() {\n const breakpoint = getBreakpoint('tablet')\n\n if (!breakpoint.value) {\n throw new ElementError({\n component: ServiceNavigation,\n identifier: `CSS custom property (\\`${breakpoint.property}\\`) on pseudo-class \\`:root\\``\n })\n }\n\n // Media query list for GOV.UK Frontend desktop breakpoint\n this.mql = window.matchMedia(`(min-width: ${breakpoint.value})`)\n\n // MediaQueryList.addEventListener isn't supported by Safari < 14 so we need\n // to be able to fall back to the deprecated MediaQueryList.addListener\n if ('addEventListener' in this.mql) {\n this.mql.addEventListener('change', () => this.checkMode())\n } else {\n // @ts-expect-error Property 'addListener' does not exist\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n this.mql.addListener(() => this.checkMode())\n }\n\n this.checkMode()\n }\n\n /**\n * Sync menu state\n *\n * Uses the global variable menuIsOpen to correctly set the accessible and\n * visual states of the menu and the menu button.\n * Additionally will force the menu to be visible and the menu button to be\n * hidden if the matchMedia is triggered to desktop.\n *\n * @private\n */\n checkMode() {\n if (!this.mql || !this.$menu || !this.$menuButton) {\n return\n }\n\n if (this.mql.matches) {\n this.$menu.removeAttribute('hidden')\n this.$menuButton.setAttribute('hidden', '')\n } else {\n this.$menuButton.removeAttribute('hidden')\n this.$menuButton.setAttribute('aria-expanded', this.menuIsOpen.toString())\n\n if (this.menuIsOpen) {\n this.$menu.removeAttribute('hidden')\n } else {\n this.$menu.setAttribute('hidden', '')\n }\n }\n }\n\n /**\n * Handle menu button click\n *\n * When the menu button is clicked, change the visibility of the menu and then\n * sync the accessibility state and menu button state\n *\n * @private\n */\n handleMenuButtonClick() {\n this.menuIsOpen = !this.menuIsOpen\n this.checkMode()\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-service-navigation'\n}\n"],"names":["getBreakpoint","name","property","value","window","getComputedStyle","document","documentElement","getPropertyValue","undefined","isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","body","classList","contains","isArray","option","Array","isObject","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","_$root","childConstructor","elementType","checkSupport","checkInitialised","setAttribute","ServiceNavigation","$menuButton","$menu","menuIsOpen","mql","querySelector","menuId","getAttribute","getElementById","setupResponsiveChecks","addEventListener","handleMenuButtonClick","breakpoint","matchMedia","checkMode","addListener","matches","removeAttribute","toString"],"mappings":";;;;;;EAeO,SAASA,aAAaA,CAACC,IAAI,EAAE;EAClC,EAAA,MAAMC,QAAQ,GAAG,CAAA,mBAAA,EAAsBD,IAAI,CAAA,CAAE;EAG7C,EAAA,MAAME,KAAK,GAAGC,MAAM,CACjBC,gBAAgB,CAACC,QAAQ,CAACC,eAAe,CAAC,CAC1CC,gBAAgB,CAACN,QAAQ,CAAC;IAE7B,OAAO;MACLA,QAAQ;MACRC,KAAK,EAAEA,KAAK,IAAIM;KACjB;EACH;EAwDO,SAASC,aAAaA,CAACC,KAAK,EAAEC,UAAU,EAAE;IAC/C,OACED,K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ACgB,eAAe,CAAC,QAAQ,CAAC;EAC1C,MAAA,IAAI,CAAChB,WAAW,CAACF,YAAY,CAAC,eAAe,EAAE,IAAI,CAACI,UAAU,CAACe,QAAQ,EAAE,CAAC;QAE1E,IAAI,IAAI,CAACf,UAAU,EAAE;EACnB,QAAA,IAAI,CAACD,KAAK,CAACe,eAAe,CAAC,QAAQ,CAAC;EACtC,MAAA,CAAC,MAAM;UACL,IAAI,CAACf,KAAK,CAACH,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC;EACvC,MAAA;EACF,IAAA;EACF,EAAA;EAUAY,EAAAA,qBAAqBA,GAAG;EACtB,IAAA,IAAI,CAACR,UAAU,GAAG,CAAC,IAAI,CAACA,UAAU;MAClC,IAAI,CAACW,SAAS,EAAE;EAClB,EAAA;EAMF;EApJad,iBAAiB,CAmJrBrC,UAAU,GAAG,0BAA0B;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"service-navigation.bundle.js","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/component.mjs","../../../../src/govuk/components/service-navigation/service-navigation.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @template {Partial<Record<keyof ObjectType, unknown>>} ObjectType\n * @param {unknown | ObjectType} option - Option to check\n * @returns {option is ObjectType} Whether the option is an object\n */\nexport function isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Check for valid scope\n *\n * @internal\n * @template {Element | Document} ScopeType\n * @param {unknown | ScopeType} $scope - Scope of the document to search within\n * @returns {$scope is ScopeType} Whether the scope can be queried\n */\nexport function isScope($scope) {\n return !!$scope && ($scope instanceof Element || $scope instanceof Document)\n}\n\n/**\n * Format error message\n *\n * @internal\n * @param {ComponentWithModuleName} Component - Component that threw the error\n * @param {string} message - Error message\n * @returns {string} - Formatted error message\n */\nexport function formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`\n}\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\n/* eslint-enable jsdoc/valid-types */\n","import { formatErrorMessage, isObject } from '../common/index.mjs'\n\n/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @virtual\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n super(\n $scope\n ? supportMessage\n : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n )\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (isObject(messageOrOptions)) {\n const { component, identifier, element, expectedType } = messageOrOptions\n\n message = identifier\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n\n // Prepend with module name (optional)\n if (component) {\n message = formatErrorMessage(component, message)\n }\n }\n\n super(message)\n }\n}\n\n/**\n * Indicates that a component is already initialised\n */\nexport class InitError extends GOVUKFrontendError {\n name = 'InitError'\n\n /**\n * @internal\n * @param {ComponentWithModuleName | string} componentOrMessage - name of the component module\n */\n constructor(componentOrMessage) {\n const message =\n typeof componentOrMessage === 'string'\n ? componentOrMessage\n : formatErrorMessage(\n componentOrMessage,\n `Root element (\\`$root\\`) already initialised`\n )\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {Element | Document | null} [element] - The element in error (optional)\n * @property {ComponentWithModuleName} [component] - Component throwing the error (optional)\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {string} [expectedType] - The type that was expected for the identifier (optional)\n */\n\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n","import { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class Component {\n /**\n * @type {typeof Element}\n */\n static elementType = HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\n","import { getBreakpoint } from '../../common/index.mjs'\nimport { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\n/**\n * Service Navigation component\n *\n * @preserve\n */\nexport class ServiceNavigation extends Component {\n /** @private */\n $menuButton\n\n /** @private */\n $menu\n\n /**\n * Remember the open/closed state of the nav so we can maintain it when the\n * screen is resized.\n *\n * @private\n */\n menuIsOpen = false\n\n /**\n * A global const for storing a matchMedia instance which we'll use to detect\n * when a screen size change happens. We rely on it being null if the feature\n * isn't available to initially apply hidden attributes\n *\n * @private\n * @type {MediaQueryList | null}\n */\n mql = null\n\n /**\n * @param {Element | null} $root - HTML element to use for header\n */\n constructor($root) {\n super($root)\n\n const $menuButton = this.$root.querySelector(\n '.govuk-js-service-navigation-toggle'\n )\n\n // Headers don't necessarily have a navigation. When they don't, the menu\n // toggle won't be rendered by our macro (or may be omitted when writing\n // plain HTML)\n if (!$menuButton) {\n return this\n }\n\n const menuId = $menuButton.getAttribute('aria-controls')\n if (!menuId) {\n throw new ElementError({\n component: ServiceNavigation,\n identifier:\n 'Navigation button (`<button class=\"govuk-js-service-navigation-toggle\">`) attribute (`aria-controls`)'\n })\n }\n\n const $menu = document.getElementById(menuId)\n if (!$menu) {\n throw new ElementError({\n component: ServiceNavigation,\n element: $menu,\n identifier: `Navigation (\\`<ul id=\"${menuId}\">\\`)`\n })\n }\n\n this.$menu = $menu\n this.$menuButton = $menuButton\n\n this.setupResponsiveChecks()\n\n this.$menuButton.addEventListener('click', () =>\n this.handleMenuButtonClick()\n )\n }\n\n /**\n * Setup viewport resize check\n *\n * @private\n */\n setupResponsiveChecks() {\n const breakpoint = getBreakpoint('tablet')\n\n if (!breakpoint.value) {\n throw new ElementError({\n component: ServiceNavigation,\n identifier: `CSS custom property (\\`${breakpoint.property}\\`) on pseudo-class \\`:root\\``\n })\n }\n\n // Media query list for GOV.UK Frontend desktop breakpoint\n this.mql = window.matchMedia(`(min-width: ${breakpoint.value})`)\n\n // MediaQueryList.addEventListener isn't supported by Safari < 14 so we need\n // to be able to fall back to the deprecated MediaQueryList.addListener\n if ('addEventListener' in this.mql) {\n this.mql.addEventListener('change', () => this.checkMode())\n } else {\n // @ts-expect-error Property 'addListener' does not exist\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n this.mql.addListener(() => this.checkMode())\n }\n\n this.checkMode()\n }\n\n /**\n * Sync menu state\n *\n * Uses the global variable menuIsOpen to correctly set the accessible and\n * visual states of the menu and the menu button.\n * Additionally will force the menu to be visible and the menu button to be\n * hidden if the matchMedia is triggered to desktop.\n *\n * @private\n */\n checkMode() {\n if (!this.mql || !this.$menu || !this.$menuButton) {\n return\n }\n\n if (this.mql.matches) {\n this.$menu.removeAttribute('hidden')\n setAttributes(this.$menuButton, attributesForHidingButton)\n } else {\n removeAttributes(this.$menuButton, Object.keys(attributesForHidingButton))\n this.$menuButton.setAttribute('aria-expanded', this.menuIsOpen.toString())\n\n if (this.menuIsOpen) {\n this.$menu.removeAttribute('hidden')\n } else {\n this.$menu.setAttribute('hidden', '')\n }\n }\n }\n\n /**\n * Handle menu button click\n *\n * When the menu button is clicked, change the visibility of the menu and then\n * sync the accessibility state and menu button state\n *\n * @private\n */\n handleMenuButtonClick() {\n this.menuIsOpen = !this.menuIsOpen\n this.checkMode()\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-service-navigation'\n}\n\n/**\n * Collection of attributes that needs setting on a `<button>`\n * to fully hide it, both visually and from screen-readers,\n * and prevent its activation while hidden\n */\nconst attributesForHidingButton = {\n hidden: '',\n // Fix button still appearing in VoiceOver's form control's menu despite being hidden\n // https://bugs.webkit.org/show_bug.cgi?id=300899\n 'aria-hidden': 'true'\n}\n\n/**\n * Sets a group of attributes on the given element\n *\n * @param {Element} $element - The element to set the attribute on\n * @param {{[attributeName: string]: string}} attributes - The attributes to set\n */\nfunction setAttributes($element, attributes) {\n for (const attributeName in attributes) {\n $element.setAttribute(attributeName, attributes[attributeName])\n }\n}\n\n/**\n * Removes a list of attributes from the given element\n *\n * @param {Element} $element - The element to remove the attributes from\n * @param {string[]} attributeNames - The names of the attributes to remove\n */\nfunction removeAttributes($element, attributeNames) {\n for (const attributeName of attributeNames) {\n $element.removeAttribute(attributeName)\n }\n}\n"],"names":["getBreakpoint","name","property","value","window","getComputedStyle","document","documentElement","getPropertyValue","undefined","isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","body","classList","contains","isArray","option","Array","isObject","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","_$root","childConstructor","elementType","checkSupport","checkInitialised","setAttribute","ServiceNavigation","$menuButton","$menu","menuIsOpen","mql","querySelector","menuId","getAttribute","getElementById","setupResponsiveChecks","addEventListener","handleMenuButtonClick","breakpoint","matchMedia","checkMode","addListener","matches","removeAttribute","setAttributes","attributesForHidingButton","removeAttributes","Object","keys","toString","hidden","$element","attributes","attributeName","attributeNames"],"mappings":";;;;;;EAeO,SAASA,aAAaA,CAACC,IAAI,EAAE;EAClC,EAAA,MAAMC,QAAQ,GAAG,CAAA,mBAAA,EAAsBD,IAAI,CAAA,CAAE;EAG7C,EAAA,MAAME,KAAK,GAAGC,MAAM,CACjBC,gBAAgB,CAACC,QAAQ,CAACC,eAAe,CAAC,CAC1CC,gBAAgB,CAACN,QAAQ,CAAC;IAE7B,OAAO;MACLA,QAAQ;MACRC,KAAK,EAAEA,KAAK,IAAIM;KACjB;EACH;EAwDO,SAASC,aAAaA,CAACC,KAAK,EAAEC,UAAU,EAAE;IAC/C,OACED,KAAK,YAAYE,WAAW,IAC5BF,KAAK,CAACG,YAAY,CAAC,CAAA,KAAA,EAAQF,UAAU,CAAA,KAAA,CAAO,CAAC;EAEjD;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;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