govuk_publishing_components 28.2.0 → 28.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics/auto-track-event.js +22 -22
- data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +9 -5
- data/app/assets/javascripts/govuk_publishing_components/analytics/track-click.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +2 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +5 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +67 -21
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -2
- data/app/views/govuk_publishing_components/components/_big_number.html.erb +12 -8
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +22 -18
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +25 -22
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +26 -0
- data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +14 -8
- data/lib/govuk_publishing_components/presenters/big_number_helper.rb +30 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +1 -0
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1cdf4c30d55a0c5ec9b7708ecc5866d5f554ed0be27ffe9f23df9ae3a8862ac9
         | 
| 4 | 
            +
              data.tar.gz: a2183c0f935738d9bedafae81ce3f1e5b0715ceeebe3b8eb301b7c7a79d0f56b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: aa3b9eeccbbfe40a2c2a304bd28bce06e4f52d2154ef5ea2affb22792d90a3964da0f6d542be541ee04bef5818a5c62e50220f69b626827ba5066192cd78a7b7
         | 
| 7 | 
            +
              data.tar.gz: 2eaca61cd01cc1a788c5f6ac3668c60a36ebb1fe82befecc56fa90f7181b3a1142b7559c07bd9d809bb176e1969de6c820582d4ac5f0a05ab3304e9df3e91caa
         | 
| @@ -199,7 +199,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {}; | |
| 199 199 |  | 
| 200 200 | 
             
                for (var i = 0; i < this.config.percentages.length; i++) {
         | 
| 201 201 | 
             
                  var percent = this.config.percentages[i]
         | 
| 202 | 
            -
                   | 
| 202 | 
            +
                  // subtract 1 pixel to solve a bug where 100% can't be reached in some cases
         | 
| 203 | 
            +
                  var pos = ((pageHeight / 100) * percent) - 1
         | 
| 203 204 | 
             
                  var alreadySeen = false
         | 
| 204 205 | 
             
                  if (trackedNodes.length) {
         | 
| 205 206 | 
             
                    alreadySeen = trackedNodes[i].alreadySeen
         | 
| @@ -1,30 +1,30 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 1 | 
            +
            window.GOVUK = window.GOVUK || {}
         | 
| 2 | 
            +
            window.GOVUK.Modules = window.GOVUK.Modules || {};
         | 
| 3 3 |  | 
| 4 | 
            -
             | 
| 5 | 
            -
               | 
| 4 | 
            +
            (function (Modules) {
         | 
| 5 | 
            +
              function AutoTrackEvent ($module) {
         | 
| 6 | 
            +
                this.$module = $module
         | 
| 7 | 
            +
              }
         | 
| 6 8 |  | 
| 7 | 
            -
               | 
| 8 | 
            -
                 | 
| 9 | 
            -
             | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
                  var value = element.data('track-value')
         | 
| 9 | 
            +
              AutoTrackEvent.prototype.init = function () {
         | 
| 10 | 
            +
                var options = { nonInteraction: 1 } // automatic events shouldn't affect bounce rate
         | 
| 11 | 
            +
                var category = this.$module.getAttribute('data-track-category')
         | 
| 12 | 
            +
                var action = this.$module.getAttribute('data-track-action')
         | 
| 13 | 
            +
                var label = this.$module.getAttribute('data-track-label')
         | 
| 14 | 
            +
                var value = parseInt(this.$module.getAttribute('data-track-value'))
         | 
| 14 15 |  | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 16 | 
            +
                if (typeof label === 'string') {
         | 
| 17 | 
            +
                  options.label = label
         | 
| 18 | 
            +
                }
         | 
| 18 19 |  | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 20 | 
            +
                if (value || value === 0) {
         | 
| 21 | 
            +
                  options.value = value
         | 
| 22 | 
            +
                }
         | 
| 22 23 |  | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
                  }
         | 
| 24 | 
            +
                if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
         | 
| 25 | 
            +
                  window.GOVUK.analytics.trackEvent(category, action, options)
         | 
| 26 26 | 
             
                }
         | 
| 27 27 | 
             
              }
         | 
| 28 28 |  | 
| 29 | 
            -
               | 
| 30 | 
            -
            })(window)
         | 
| 29 | 
            +
              Modules.AutoTrackEvent = AutoTrackEvent
         | 
| 30 | 
            +
            })(window.GOVUK.Modules)
         | 
| @@ -1,5 +1,3 @@ | |
| 1 | 
            -
            /* global $ */
         | 
| 2 | 
            -
             | 
| 3 1 | 
             
            ;(function (global) {
         | 
| 4 2 | 
             
              'use strict'
         | 
| 5 3 |  | 
| @@ -15,15 +13,21 @@ | |
| 15 13 | 
             
              var STATE_PATTERN = /state=.[^&]+/g
         | 
| 16 14 |  | 
| 17 15 | 
             
              function shouldStripDates () {
         | 
| 18 | 
            -
                 | 
| 16 | 
            +
                var metas = document.querySelectorAll('meta[name="govuk:static-analytics:strip-dates"]')
         | 
| 17 | 
            +
                return metas.length > 0
         | 
| 19 18 | 
             
              }
         | 
| 20 19 |  | 
| 21 20 | 
             
              function shouldStripPostcodes () {
         | 
| 22 | 
            -
                 | 
| 21 | 
            +
                var metas = document.querySelectorAll('meta[name="govuk:static-analytics:strip-postcodes"]')
         | 
| 22 | 
            +
                return metas.length > 0
         | 
| 23 23 | 
             
              }
         | 
| 24 24 |  | 
| 25 25 | 
             
              function queryStringParametersToStrip () {
         | 
| 26 | 
            -
                var  | 
| 26 | 
            +
                var meta = document.querySelector('meta[name="govuk:static-analytics:strip-query-string-parameters"]')
         | 
| 27 | 
            +
                var value = false
         | 
| 28 | 
            +
                if (meta) {
         | 
| 29 | 
            +
                  value = meta.getAttribute('content')
         | 
| 30 | 
            +
                }
         | 
| 27 31 | 
             
                var parameters = []
         | 
| 28 32 |  | 
| 29 33 | 
             
                if (value) {
         | 
| @@ -4,10 +4,11 @@ window.GOVUK = window.GOVUK || {} | |
| 4 4 | 
             
            window.GOVUK.Modules = window.GOVUK.Modules || {};
         | 
| 5 5 |  | 
| 6 6 | 
             
            (function (Modules) {
         | 
| 7 | 
            -
              function GemTrackClick () { | 
| 7 | 
            +
              function GemTrackClick ($module) {
         | 
| 8 | 
            +
                this.$module = $module
         | 
| 9 | 
            +
              }
         | 
| 8 10 |  | 
| 9 | 
            -
              GemTrackClick.prototype. | 
| 10 | 
            -
                this.$module = $module[0]
         | 
| 11 | 
            +
              GemTrackClick.prototype.init = function () {
         | 
| 11 12 | 
             
                this.$module.handleClick = this.handleClick.bind(this)
         | 
| 12 13 | 
             
                var trackLinksOnly = this.$module.hasAttribute('data-track-links-only')
         | 
| 13 14 | 
             
                var limitToElementClass = this.$module.getAttribute('data-limit-to-element-class')
         | 
| @@ -1,4 +1,3 @@ | |
| 1 | 
            -
            /* eslint-env jquery */
         | 
| 2 1 | 
             
            // = require govuk/components/details/details.js
         | 
| 3 2 | 
             
            window.GOVUK = window.GOVUK || {}
         | 
| 4 3 | 
             
            window.GOVUK.Modules = window.GOVUK.Modules || {}
         | 
| @@ -15,8 +14,8 @@ window.GOVUK.Modules.GovukDetails = window.GOVUKFrontend; | |
| 15 14 |  | 
| 16 15 | 
             
              GemDetails.prototype.init = function () {
         | 
| 17 16 | 
             
                if (this.customTrackLabel) { // If a custom label has been provided, we can simply call the tracking module
         | 
| 18 | 
            -
                  var trackDetails = new window.GOVUK.Modules.GemTrackClick()
         | 
| 19 | 
            -
                  trackDetails. | 
| 17 | 
            +
                  var trackDetails = new window.GOVUK.Modules.GemTrackClick(this.$summary)
         | 
| 18 | 
            +
                  trackDetails.init()
         | 
| 20 19 | 
             
                } else if (this.detailsClick) { // If no custom label is set, we use the open/close status as the label
         | 
| 21 20 | 
             
                  this.detailsClick.addEventListener('click', function (event) {
         | 
| 22 21 | 
             
                    this.trackDefault(this.$summary)
         | 
    
        data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
    CHANGED
    
    | @@ -2,7 +2,7 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            window.GOVUK = window.GOVUK || {};
         | 
| 4 4 |  | 
| 5 | 
            -
            (function (GOVUK | 
| 5 | 
            +
            (function (GOVUK) {
         | 
| 6 6 | 
             
              'use strict'
         | 
| 7 7 |  | 
| 8 8 | 
             
              var BarchartEnhancement = function ($element) {
         | 
| @@ -30,4 +30,4 @@ window.GOVUK = window.GOVUK || {}; | |
| 30 30 | 
             
              }
         | 
| 31 31 |  | 
| 32 32 | 
             
              GOVUK.GovspeakBarchartEnhancement = BarchartEnhancement
         | 
| 33 | 
            -
            }(window.GOVUK | 
| 33 | 
            +
            }(window.GOVUK))
         | 
| @@ -1,12 +1,11 @@ | |
| 1 1 | 
             
            .gem-c-big-number {
         | 
| 2 2 | 
             
              margin-bottom: govuk-spacing(3);
         | 
| 3 | 
            -
              @include govuk-typography-common;
         | 
| 4 3 | 
             
              @include govuk-text-colour;
         | 
| 5 4 | 
             
            }
         | 
| 6 5 |  | 
| 7 6 | 
             
            .gem-c-big-number__value {
         | 
| 7 | 
            +
              @include govuk-font($size: false, $weight: bold);
         | 
| 8 8 | 
             
              font-size: 80px;
         | 
| 9 | 
            -
              @include govuk-typography-weight-bold;
         | 
| 10 9 | 
             
              line-height: 1;
         | 
| 11 10 |  | 
| 12 11 | 
             
              @if $govuk-typography-use-rem {
         | 
| @@ -55,3 +54,7 @@ | |
| 55 54 | 
             
                }
         | 
| 56 55 | 
             
              }
         | 
| 57 56 | 
             
            }
         | 
| 57 | 
            +
             | 
| 58 | 
            +
            .gem-c-big-number__suffix {
         | 
| 59 | 
            +
              vertical-align: middle;
         | 
| 60 | 
            +
            }
         | 
| @@ -6,6 +6,7 @@ $chevron-indent-spacing: 7px; | |
| 6 6 | 
             
            $black-bar-height: 50px;
         | 
| 7 7 | 
             
            $search-width-or-height: $black-bar-height;
         | 
| 8 8 | 
             
            $pseudo-underline-height: 3px;
         | 
| 9 | 
            +
            $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
         | 
| 9 10 |  | 
| 10 11 | 
             
            @mixin chevron($colour, $update: false) {
         | 
| 11 12 | 
             
              @if ($update == true) {
         | 
| @@ -18,7 +19,7 @@ $pseudo-underline-height: 3px; | |
| 18 19 | 
             
                content: "";
         | 
| 19 20 | 
             
                display: inline-block;
         | 
| 20 21 | 
             
                height: 8px;
         | 
| 21 | 
            -
                margin: 0  | 
| 22 | 
            +
                margin: 0 10px 0 2px;
         | 
| 22 23 | 
             
                vertical-align: middle;
         | 
| 23 24 | 
             
                width: 8px;
         | 
| 24 25 | 
             
              }
         | 
| @@ -172,6 +173,15 @@ $pseudo-underline-height: 3px; | |
| 172 173 | 
             
              @include govuk-media-query($from: "desktop") {
         | 
| 173 174 | 
             
                border-bottom: 0;
         | 
| 174 175 | 
             
                padding: 0;
         | 
| 176 | 
            +
             | 
| 177 | 
            +
                &:first-of-type {
         | 
| 178 | 
            +
                  margin-right: -1px;
         | 
| 179 | 
            +
             | 
| 180 | 
            +
                  .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 181 | 
            +
                    border-left: 1px solid $button-pipe-colour;
         | 
| 182 | 
            +
                    border-right: 1px solid $button-pipe-colour;
         | 
| 183 | 
            +
                  }
         | 
| 184 | 
            +
                }
         | 
| 175 185 | 
             
              }
         | 
| 176 186 | 
             
            }
         | 
| 177 187 |  | 
| @@ -313,22 +323,28 @@ $pseudo-underline-height: 3px; | |
| 313 323 | 
             
              padding: 0;
         | 
| 314 324 |  | 
| 315 325 | 
             
              @include focus-not-focus-visible {
         | 
| 316 | 
            -
                 | 
| 317 | 
            -
                   | 
| 326 | 
            +
                .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 327 | 
            +
                  &:before {
         | 
| 328 | 
            +
                    @include chevron($govuk-link-colour);
         | 
| 329 | 
            +
                  }
         | 
| 318 330 | 
             
                }
         | 
| 319 331 | 
             
              }
         | 
| 320 332 |  | 
| 321 333 | 
             
              @include focus-not-focus-visible {
         | 
| 322 334 | 
             
                &:hover {
         | 
| 323 | 
            -
                   | 
| 324 | 
            -
                     | 
| 335 | 
            +
                  .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 336 | 
            +
                    &:before {
         | 
| 337 | 
            +
                      @include chevron($govuk-link-hover-colour, true);
         | 
| 338 | 
            +
                    }
         | 
| 325 339 | 
             
                  }
         | 
| 326 340 | 
             
                }
         | 
| 327 341 | 
             
              }
         | 
| 328 342 |  | 
| 329 343 | 
             
              &:focus {
         | 
| 330 | 
            -
                 | 
| 331 | 
            -
                   | 
| 344 | 
            +
                .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 345 | 
            +
                  &:before {
         | 
| 346 | 
            +
                    @include chevron($govuk-focus-text-colour, true);
         | 
| 347 | 
            +
                  }
         | 
| 332 348 | 
             
                }
         | 
| 333 349 | 
             
              }
         | 
| 334 350 |  | 
| @@ -345,12 +361,15 @@ $pseudo-underline-height: 3px; | |
| 345 361 | 
             
                    font-size: govuk-px-to-rem(16px);
         | 
| 346 362 | 
             
                  }
         | 
| 347 363 | 
             
                  height: $black-bar-height;
         | 
| 348 | 
            -
                  padding: govuk-spacing(3) govuk-spacing(6) govuk-spacing(3) govuk-spacing(5);
         | 
| 349 364 | 
             
                  position: relative;
         | 
| 350 365 | 
             
                  text-decoration: none;
         | 
| 351 366 |  | 
| 352 | 
            -
                   | 
| 353 | 
            -
                     | 
| 367 | 
            +
                  .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 368 | 
            +
                    border-color: $button-pipe-colour;
         | 
| 369 | 
            +
             | 
| 370 | 
            +
                    &:before {
         | 
| 371 | 
            +
                      @include chevron(govuk-colour("white"), true);
         | 
| 372 | 
            +
                    }
         | 
| 354 373 | 
             
                  }
         | 
| 355 374 | 
             
                }
         | 
| 356 375 | 
             
                @include focus-not-focus-visible {
         | 
| @@ -362,8 +381,12 @@ $pseudo-underline-height: 3px; | |
| 362 381 | 
             
                      background: govuk-colour("mid-grey");
         | 
| 363 382 | 
             
                    }
         | 
| 364 383 |  | 
| 365 | 
            -
                     | 
| 366 | 
            -
                       | 
| 384 | 
            +
                    .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 385 | 
            +
                      border-color: $button-pipe-colour;
         | 
| 386 | 
            +
             | 
| 387 | 
            +
                      &:before {
         | 
| 388 | 
            +
                        @include chevron($button-pipe-colour, true);
         | 
| 389 | 
            +
                      }
         | 
| 367 390 | 
             
                    }
         | 
| 368 391 | 
             
                  }
         | 
| 369 392 | 
             
                }
         | 
| @@ -375,16 +398,22 @@ $pseudo-underline-height: 3px; | |
| 375 398 | 
             
                    background: $govuk-focus-text-colour;
         | 
| 376 399 | 
             
                  }
         | 
| 377 400 |  | 
| 378 | 
            -
                   | 
| 379 | 
            -
                     | 
| 401 | 
            +
                  .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 402 | 
            +
                    border-color: $govuk-focus-colour;
         | 
| 403 | 
            +
             | 
| 404 | 
            +
                    &:before {
         | 
| 405 | 
            +
                      @include chevron($govuk-focus-text-colour, true);
         | 
| 406 | 
            +
                    }
         | 
| 380 407 | 
             
                  }
         | 
| 381 408 | 
             
                }
         | 
| 382 409 | 
             
              }
         | 
| 383 410 |  | 
| 384 411 | 
             
              &.gem-c-layout-super-navigation-header__open-button {
         | 
| 385 412 | 
             
                @include focus-not-focus-visible {
         | 
| 386 | 
            -
                   | 
| 387 | 
            -
                     | 
| 413 | 
            +
                  .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 414 | 
            +
                    &:before {
         | 
| 415 | 
            +
                      @include prefixed-transform($rotate: 225deg, $translateY: 1px);
         | 
| 416 | 
            +
                    }
         | 
| 388 417 | 
             
                  }
         | 
| 389 418 | 
             
                }
         | 
| 390 419 |  | 
| @@ -393,8 +422,13 @@ $pseudo-underline-height: 3px; | |
| 393 422 | 
             
                    background: govuk-colour("light-grey");
         | 
| 394 423 | 
             
                    color: $govuk-link-colour;
         | 
| 395 424 |  | 
| 396 | 
            -
                     | 
| 397 | 
            -
             | 
| 425 | 
            +
                    // stylelint-disable max-nesting-depth
         | 
| 426 | 
            +
                    .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 427 | 
            +
                      border-color: govuk-colour("light-grey");
         | 
| 428 | 
            +
             | 
| 429 | 
            +
                      &:before {
         | 
| 430 | 
            +
                        @include chevron($govuk-link-colour, true);
         | 
| 431 | 
            +
                      }
         | 
| 398 432 | 
             
                    }
         | 
| 399 433 |  | 
| 400 434 | 
             
                    &:after {
         | 
| @@ -406,8 +440,12 @@ $pseudo-underline-height: 3px; | |
| 406 440 | 
             
                    background-color: $govuk-focus-colour;
         | 
| 407 441 | 
             
                    color: $govuk-focus-text-colour;
         | 
| 408 442 |  | 
| 409 | 
            -
                     | 
| 410 | 
            -
                       | 
| 443 | 
            +
                    .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 444 | 
            +
                      border-color: $govuk-focus-colour;
         | 
| 445 | 
            +
             | 
| 446 | 
            +
                      &:before {
         | 
| 447 | 
            +
                        @include chevron($govuk-focus-text-colour, true);
         | 
| 448 | 
            +
                      }
         | 
| 411 449 | 
             
                    }
         | 
| 412 450 |  | 
| 413 451 | 
             
                    &:after {
         | 
| @@ -416,12 +454,20 @@ $pseudo-underline-height: 3px; | |
| 416 454 | 
             
                  }
         | 
| 417 455 | 
             
                }
         | 
| 418 456 | 
             
              }
         | 
| 457 | 
            +
              // stylelint-enable max-nesting-depth
         | 
| 419 458 |  | 
| 420 459 | 
             
              .js-module-initialised & {
         | 
| 421 460 | 
             
                @include govuk-link-style-no-underline;
         | 
| 422 461 | 
             
              }
         | 
| 423 462 | 
             
            }
         | 
| 424 463 |  | 
| 464 | 
            +
            .gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner {
         | 
| 465 | 
            +
              @include govuk-media-query($from: "desktop") {
         | 
| 466 | 
            +
                display: inline-block;
         | 
| 467 | 
            +
                padding: govuk-spacing(2) govuk-spacing(6) govuk-spacing(2) govuk-spacing(5);
         | 
| 468 | 
            +
              }
         | 
| 469 | 
            +
            }
         | 
| 470 | 
            +
             | 
| 425 471 | 
             
            // Search link and dropdown.
         | 
| 426 472 | 
             
            .gem-c-layout-super-navigation-header__search-item-link {
         | 
| 427 473 | 
             
              &:link,
         | 
| @@ -550,7 +596,7 @@ $pseudo-underline-height: 3px; | |
| 550 596 | 
             
                box-shadow: none;
         | 
| 551 597 |  | 
| 552 598 | 
             
                .gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
         | 
| 553 | 
            -
                  border-color:  | 
| 599 | 
            +
                  border-color: $button-pipe-colour;
         | 
| 554 600 | 
             
                  color: govuk-colour("white");
         | 
| 555 601 |  | 
| 556 602 | 
             
                  @include govuk-media-query($from: 360px) {
         | 
| @@ -1,7 +1,8 @@ | |
| 1 1 | 
             
            <%
         | 
| 2 2 | 
             
              shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
         | 
| 3 | 
            +
              big_number_helper = GovukPublishingComponents::Presenters::BigNumberHelper.new(local_assigns)
         | 
| 3 4 |  | 
| 4 | 
            -
              number ||=  | 
| 5 | 
            +
              number ||= false
         | 
| 5 6 | 
             
              label ||= nil
         | 
| 6 7 | 
             
              href ||= nil
         | 
| 7 8 | 
             
              data_attributes ||= nil
         | 
| @@ -9,17 +10,20 @@ | |
| 9 10 | 
             
              classes = ["gem-c-big-number"]
         | 
| 10 11 | 
             
              classes << shared_helper.get_margin_bottom
         | 
| 11 12 |  | 
| 12 | 
            -
              value_classes =  | 
| 13 | 
            -
              
         | 
| 14 | 
            -
              if label.nil? && href
         | 
| 15 | 
            -
                value_classes << "gem-c-big-number__value--decorated"
         | 
| 16 | 
            -
              end
         | 
| 17 | 
            -
             | 
| 13 | 
            +
              value_classes = big_number_helper.value_classes
         | 
| 18 14 | 
             
            %>
         | 
| 19 15 | 
             
            <% if number %>
         | 
| 20 16 | 
             
              <% big_number_value = capture do %>
         | 
| 21 17 | 
             
                <%= tag.span class: value_classes, data: href ? nil : data_attributes do %>
         | 
| 22 | 
            -
                   | 
| 18 | 
            +
                  <%
         | 
| 19 | 
            +
                    # The below check is to account for small symbols awkwardly sitting above the baseline in our typeface and adjust them to sit at the baseline for the purpose of visual harmony
         | 
| 20 | 
            +
                    # Currently the only small symbol used with big numbers are pluses so they are specifically applied in the below code
         | 
| 21 | 
            +
                  %>
         | 
| 22 | 
            +
                  <% if big_number_helper.number_has_plus_suffix? %>
         | 
| 23 | 
            +
                    <%= number[0...-1] %><%= tag.span "+", class: "gem-c-big-number__suffix" %>
         | 
| 24 | 
            +
                  <% else %>
         | 
| 25 | 
            +
                    <%= number %>
         | 
| 26 | 
            +
                  <% end %>
         | 
| 23 27 | 
             
                <% end %>
         | 
| 24 28 |  | 
| 25 29 | 
             
                <% unless label.nil? %>
         | 
    
        data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
    CHANGED
    
    | @@ -108,24 +108,28 @@ | |
| 108 108 | 
             
                              track_dimension_index: "29",
         | 
| 109 109 | 
             
                            }
         | 
| 110 110 | 
             
                          } %>
         | 
| 111 | 
            -
                           | 
| 112 | 
            -
                             | 
| 113 | 
            -
                               | 
| 114 | 
            -
             | 
| 115 | 
            -
             | 
| 116 | 
            -
             | 
| 117 | 
            -
             | 
| 118 | 
            -
             | 
| 119 | 
            -
                               | 
| 120 | 
            -
             | 
| 121 | 
            -
             | 
| 122 | 
            -
             | 
| 123 | 
            -
             | 
| 124 | 
            -
             | 
| 125 | 
            -
             | 
| 126 | 
            -
             | 
| 127 | 
            -
             | 
| 128 | 
            -
             | 
| 111 | 
            +
                          <% if has_children %>
         | 
| 112 | 
            +
                            <%= content_tag(:button, {
         | 
| 113 | 
            +
                              aria: {
         | 
| 114 | 
            +
                                controls: "super-navigation-menu__section-#{unique_id}",
         | 
| 115 | 
            +
                                expanded: false,
         | 
| 116 | 
            +
                                label: show_menu_text,
         | 
| 117 | 
            +
                              },
         | 
| 118 | 
            +
                              class: "gem-c-layout-super-navigation-header__navigation-second-toggle-button",
         | 
| 119 | 
            +
                              data: {
         | 
| 120 | 
            +
                                text_for_hide: hide_menu_text,
         | 
| 121 | 
            +
                                text_for_show: show_menu_text,
         | 
| 122 | 
            +
                                toggle_desktop_group: "top",
         | 
| 123 | 
            +
                                toggle_mobile_group: "second",
         | 
| 124 | 
            +
                                tracking_key: tracking_label,
         | 
| 125 | 
            +
                              },
         | 
| 126 | 
            +
                              hidden: true,
         | 
| 127 | 
            +
                              id: "super-navigation-menu__section-#{unique_id}-toggle",
         | 
| 128 | 
            +
                              type: "button",
         | 
| 129 | 
            +
                            }) do %>
         | 
| 130 | 
            +
                              <%= tag.span link[:label], class: "gem-c-layout-super-navigation-header__navigation-second-toggle-button-inner" %>
         | 
| 131 | 
            +
                            <% end %>
         | 
| 132 | 
            +
                          <% end %>
         | 
| 129 133 | 
             
                        </div>
         | 
| 130 134 | 
             
                        <% if has_children %>
         | 
| 131 135 | 
             
                          <div
         | 
| @@ -55,38 +55,41 @@ | |
| 55 55 | 
             
                        class: "govuk-link govuk-link--no-underline gem-c-share-links__link #{brand_helper.color_class}" do %>
         | 
| 56 56 | 
             
                        <span class="gem-c-share-links__link-icon">
         | 
| 57 57 | 
             
                          <% if link[:icon] == 'facebook' %>
         | 
| 58 | 
            -
                            <svg xmlns="http://www.w3.org/2000/svg"  | 
| 59 | 
            -
                              <path fill="currentColor" d=" | 
| 60 | 
            -
                              <path fill="#FFF" d="M17.892 10.751h1.787V8.009L17.216 8c-2.73 0-3.352 2.045-3.352 3.353v1.828h-1.581v2.824h1.581V24h3.322v-7.995h2.242l.291-2.824h-2.533V11.52c.001-.623.415-.769.706-.769z"/>
         | 
| 58 | 
            +
                            <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
         | 
| 59 | 
            +
                              <path fill="currentColor" d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
         | 
| 61 60 | 
             
                            </svg>
         | 
| 62 | 
            -
             | 
| 63 61 | 
             
                          <% elsif link[:icon] == 'twitter' %>
         | 
| 64 | 
            -
                            <svg xmlns="http://www.w3.org/2000/svg"  | 
| 65 | 
            -
                              <path fill="currentColor" d=" | 
| 66 | 
            -
                              <path fill="#FFF" d="M8 21.027a9.286 9.286 0 0 0 5.032 1.475c6.038 0 9.34-5.002 9.34-9.339 0-.143-.004-.284-.012-.425a6.619 6.619 0 0 0 1.639-1.699c-.6.265-1.234.439-1.885.516a3.287 3.287 0 0 0 1.443-1.816 6.571 6.571 0 0 1-2.086.797 3.28 3.28 0 0 0-5.592 2.993 9.311 9.311 0 0 1-6.766-3.43 3.294 3.294 0 0 0-.443 1.651 3.28 3.28 0 0 0 1.46 2.732 3.278 3.278 0 0 1-1.488-.411v.041a3.288 3.288 0 0 0 2.633 3.22 3.28 3.28 0 0 1-1.481.055 3.285 3.285 0 0 0 3.065 2.281 6.59 6.59 0 0 1-4.076 1.404A6.76 6.76 0 0 1 8 21.027z"/>
         | 
| 62 | 
            +
                            <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
         | 
| 63 | 
            +
                              <path fill="currentColor" d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"/>
         | 
| 67 64 | 
             
                            </svg>
         | 
| 68 | 
            -
             | 
| 69 65 | 
             
                          <% elsif link[:icon] == 'email' %>
         | 
| 70 | 
            -
                            <svg xmlns="http://www.w3.org/2000/svg"  | 
| 71 | 
            -
             | 
| 66 | 
            +
                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 73.84 73.84" aria-hidden="true" focusable="false">
         | 
| 67 | 
            +
                              <path fill="currentColor" d="M36.92,0A36.92,36.92,0,1,0,73.84,36.92,36.92,36.92,0,0,0,36.92,0ZM58.37,21,36.92,39.45,15.47,21ZM11.65,23.66,26.27,36.23,11.65,49.9ZM15.1,52.83,29.7,39.18l7.22,6.21,7.22-6.21,14.6,13.65ZM62.19,49.9,47.57,36.23,62.19,23.66Z"/>
         | 
| 68 | 
            +
                            </svg>
         | 
| 72 69 | 
             
                          <% elsif link[:icon] == 'flickr' %>
         | 
| 73 | 
            -
                            <svg  | 
| 74 | 
            -
             | 
| 70 | 
            +
                            <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
         | 
| 71 | 
            +
                              <path fill="currentColor" d="M5.334 6.666C2.3884 6.666 0 9.055 0 12c0 2.9456 2.3884 5.334 5.334 5.334 2.9456 0 5.332-2.3884 5.332-5.334 0-2.945-2.3864-5.334-5.332-5.334zm13.332 0c-2.9456 0-5.332 2.389-5.332 5.334 0 2.9456 2.3864 5.334 5.332 5.334C21.6116 17.334 24 14.9456 24 12c0-2.945-2.3884-5.334-5.334-5.334Z"/>
         | 
| 72 | 
            +
                            </svg>
         | 
| 75 73 | 
             
                          <% elsif link[:icon] == 'instagram' %>
         | 
| 76 | 
            -
                            <svg  | 
| 77 | 
            -
             | 
| 74 | 
            +
                            <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
         | 
| 75 | 
            +
                              <path fill="currentColor" d="M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"/>
         | 
| 76 | 
            +
                            </svg>
         | 
| 78 77 | 
             
                          <% elsif link[:icon] == 'linkedin' %>
         | 
| 79 | 
            -
                            <svg  | 
| 80 | 
            -
             | 
| 78 | 
            +
                            <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
         | 
| 79 | 
            +
                              <path fill="currentColor" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>
         | 
| 80 | 
            +
                            </svg>
         | 
| 81 81 | 
             
                          <% elsif link[:icon] == 'youtube' %>
         | 
| 82 | 
            -
                            <svg xmlns="http://www.w3.org/2000/svg"  | 
| 83 | 
            -
             | 
| 82 | 
            +
                            <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
         | 
| 83 | 
            +
                              <path fill="currentColor" d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/>
         | 
| 84 | 
            +
                            </svg>
         | 
| 84 85 | 
             
                          <% elsif link[:icon] == 'whatsapp' %>
         | 
| 85 | 
            -
                            <svg xmlns="http://www.w3.org/2000/svg"  | 
| 86 | 
            -
             | 
| 86 | 
            +
                            <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
         | 
| 87 | 
            +
                              <path fill="currentColor" d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/>
         | 
| 88 | 
            +
                            </svg>
         | 
| 87 89 | 
             
                          <% else %>
         | 
| 88 | 
            -
                            <svg xmlns="http://www.w3.org/2000/svg"  | 
| 89 | 
            -
             | 
| 90 | 
            +
                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 73.84 73.84" aria-hidden="true" focusable="false">
         | 
| 91 | 
            +
                              <path fill="currentColor" d="M36.92,0A36.92,36.92,0,1,0,73.84,36.92,36.92,36.92,0,0,0,36.92,0ZM56.3,48.27a1.42,1.42,0,0,1-1.42,1.42h-19v9.18l-9.18-9.18H19a1.43,1.43,0,0,1-1.43-1.43V20.52A1.43,1.43,0,0,1,19,19.09H54.88a1.43,1.43,0,0,1,1.42,1.42Z"/>
         | 
| 92 | 
            +
                            </svg>
         | 
| 90 93 | 
             
                          <% end %>
         | 
| 91 94 | 
             
                        </span><%= link_text %><% end %>
         | 
| 92 95 | 
             
                    </li>
         | 
| @@ -23,6 +23,12 @@ | |
| 23 23 | 
             
                  <h3 class="gem-c-feedback__form-heading"><%= t("components.feedback.help_us_improve_govuk") %></h3>
         | 
| 24 24 | 
             
                  <p id="feedback_explanation" class="gem-c-feedback__form-paragraph"><%= t("components.feedback.dont_include_personal_info") %></p>
         | 
| 25 25 |  | 
| 26 | 
            +
                  <% # Added for spam bots only %>
         | 
| 27 | 
            +
                  <div class="govuk-visually-hidden" aria-hidden="true">
         | 
| 28 | 
            +
                    <label for="feedback_maybe">This field is for robots only. Please leave blank</label>
         | 
| 29 | 
            +
                    <input id="feedback_maybe" type="text" pattern=".{0}" tabindex="-1" autocomplete="off" >
         | 
| 30 | 
            +
                  </div>
         | 
| 31 | 
            +
             | 
| 26 32 | 
             
                  <%= render "govuk_publishing_components/components/textarea", {
         | 
| 27 33 | 
             
                    label: {
         | 
| 28 34 | 
             
                      text: t("components.feedback.what_doing")
         | 
| @@ -46,3 +52,23 @@ | |
| 46 52 | 
             
                </div>
         | 
| 47 53 | 
             
              </div>
         | 
| 48 54 | 
             
            </form>
         | 
| 55 | 
            +
             | 
| 56 | 
            +
            <%
         | 
| 57 | 
            +
              # I've added the following script inline in case of a scenario where a bot is able to parse the page, 
         | 
| 58 | 
            +
              # without downloading any of the external scripts. 
         | 
| 59 | 
            +
              # This seems to be a more reliable way to make sure the script is executed.
         | 
| 60 | 
            +
            %>
         | 
| 61 | 
            +
             | 
| 62 | 
            +
            <script>
         | 
| 63 | 
            +
              document.addEventListener("DOMContentLoaded", function () {
         | 
| 64 | 
            +
                var input = document.querySelector("#feedback_maybe"),
         | 
| 65 | 
            +
                  form = document.querySelector("#something-is-wrong")
         | 
| 66 | 
            +
             | 
| 67 | 
            +
                form.addEventListener("submit", spamCapture);
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                function spamCapture(e) {
         | 
| 70 | 
            +
                  if (input.value.length !== 0) return;
         | 
| 71 | 
            +
                  e.preventDefault();
         | 
| 72 | 
            +
                }
         | 
| 73 | 
            +
              });
         | 
| 74 | 
            +
            </script>
         | 
| @@ -1,17 +1,23 @@ | |
| 1 | 
            -
            <%
         | 
| 2 | 
            -
              contact_govuk_path = "/contact/govuk"
         | 
| 3 | 
            -
            %>
         | 
| 4 | 
            -
             | 
| 5 1 | 
             
            <div class="gem-c-feedback__prompt gem-c-feedback__js-show js-prompt" tabindex="-1">
         | 
| 6 2 | 
             
              <div class="gem-c-feedback__prompt-questions js-prompt-questions" hidden>
         | 
| 7 3 | 
             
                <h2 class="gem-c-feedback__prompt-question"><%= t("components.feedback.is_this_page_useful") %></h2>
         | 
| 8 4 |  | 
| 9 5 | 
             
                <ul class="gem-c-feedback__option-list">
         | 
| 10 | 
            -
                  <li class="gem-c-feedback__option-list-item" style="display: none" hidden | 
| 11 | 
            -
                     | 
| 12 | 
            -
                     | 
| 6 | 
            +
                  <li class="gem-c-feedback__option-list-item govuk-visually-hidden" style="display: none" hidden>
         | 
| 7 | 
            +
                    <% # Maybe button exists only to try and capture clicks by bots %>
         | 
| 8 | 
            +
                    <%= link_to "/contact/govuk", {
         | 
| 9 | 
            +
                      class: 'gem-c-feedback__prompt-link',
         | 
| 10 | 
            +
                      data: {
         | 
| 11 | 
            +
                        'track-category' => 'yesNoFeedbackForm',
         | 
| 12 | 
            +
                        'track-action' => 'ffMaybeClick'
         | 
| 13 | 
            +
                      },
         | 
| 14 | 
            +
                      role: 'button',
         | 
| 15 | 
            +
                      style: 'display: none',
         | 
| 16 | 
            +
                      hidden: 'hidden',
         | 
| 17 | 
            +
                      'aria-hidden': 'true',
         | 
| 18 | 
            +
                    } do %>
         | 
| 13 19 | 
             
                      <%= t("components.feedback.maybe") %>
         | 
| 14 | 
            -
                     | 
| 20 | 
            +
                    <% end %>
         | 
| 15 21 | 
             
                  </li>
         | 
| 16 22 | 
             
                  <li class="gem-c-feedback__option-list-item">
         | 
| 17 23 | 
             
                    <button class="govuk-button gem-c-feedback__prompt-link js-page-is-useful" data-track-category="yesNoFeedbackForm" data-track-action="ffYesClick">
         | 
| @@ -0,0 +1,30 @@ | |
| 1 | 
            +
            module GovukPublishingComponents
         | 
| 2 | 
            +
              module Presenters
         | 
| 3 | 
            +
                class BigNumberHelper
         | 
| 4 | 
            +
                  def initialize(local_assigns)
         | 
| 5 | 
            +
                    @label = local_assigns[:label]
         | 
| 6 | 
            +
                    @href = local_assigns[:href]
         | 
| 7 | 
            +
                    @number = local_assigns[:number] || nil
         | 
| 8 | 
            +
                  end
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                  def value_classes
         | 
| 11 | 
            +
                    class_list = ["gem-c-big-number__value"]
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                    if @label.nil? && @href
         | 
| 14 | 
            +
                      class_list << "gem-c-big-number__value--decorated"
         | 
| 15 | 
            +
                    end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                    class_list
         | 
| 18 | 
            +
                  end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                  # This function is to check for small symbols which alter how the number is rendered lightly
         | 
| 21 | 
            +
                  # We do this to account for small symbols awkwardly sitting above the baseline in our typeface and adjust them to sit at the baseline for the purpose of visual harmony
         | 
| 22 | 
            +
                  # Currently the only small symbol used with big numbers are pluses so they are specifically targetted in the below code
         | 
| 23 | 
            +
                  def number_has_plus_suffix?
         | 
| 24 | 
            +
                    if @number.is_a? String
         | 
| 25 | 
            +
                      @number.ends_with?("+")
         | 
| 26 | 
            +
                    end
         | 
| 27 | 
            +
                  end
         | 
| 28 | 
            +
                end
         | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
            end
         | 
| @@ -6,6 +6,7 @@ require "govuk_publishing_components/config" | |
| 6 6 | 
             
            require "govuk_publishing_components/engine"
         | 
| 7 7 | 
             
            require "govuk_publishing_components/presenters/shared_helper"
         | 
| 8 8 | 
             
            require "govuk_publishing_components/presenters/attachment"
         | 
| 9 | 
            +
            require "govuk_publishing_components/presenters/big_number_helper"
         | 
| 9 10 | 
             
            require "govuk_publishing_components/presenters/breadcrumbs"
         | 
| 10 11 | 
             
            require "govuk_publishing_components/presenters/breadcrumb_selector"
         | 
| 11 12 | 
             
            require "govuk_publishing_components/presenters/button_helper"
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: govuk_publishing_components
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 28. | 
| 4 | 
            +
              version: 28.3.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - GOV.UK Dev
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022-01- | 
| 11 | 
            +
            date: 2022-01-24 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: govuk_app_config
         | 
| @@ -931,6 +931,7 @@ files: | |
| 931 931 | 
             
            - lib/govuk_publishing_components/engine.rb
         | 
| 932 932 | 
             
            - lib/govuk_publishing_components/minitest/component_guide_test.rb
         | 
| 933 933 | 
             
            - lib/govuk_publishing_components/presenters/attachment.rb
         | 
| 934 | 
            +
            - lib/govuk_publishing_components/presenters/big_number_helper.rb
         | 
| 934 935 | 
             
            - lib/govuk_publishing_components/presenters/breadcrumb_selector.rb
         | 
| 935 936 | 
             
            - lib/govuk_publishing_components/presenters/breadcrumbs.rb
         | 
| 936 937 | 
             
            - lib/govuk_publishing_components/presenters/button_helper.rb
         |