katalyst-govuk-formbuilder 1.18.0 → 1.18.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b21416c3b2f36907d08ea36d0ba31104c2b47475d03541ce2af406d398f09c7c
4
- data.tar.gz: 950078f71d4de5c2fa36cf2f487b2e8aceee639d79dbebd7a64f276976fa1c08
3
+ metadata.gz: a178eb2f8c15cf5feae7f1d8b54aeea17fc2bd403075a33e9d0eefb59d0a1d78
4
+ data.tar.gz: d7e76e1752f0fbfb86ba5d4acabf12b66d902ceeb07d82b137bf1d9076454f0d
5
5
  SHA512:
6
- metadata.gz: 3fb032aed594b3b8e8e8f8e512b55b5d1ab14f0aa4e0555cbbcce107010eae98327bfde224ed3d94d477c7708d45667025a78ed33c76d2521f131cc529d3f679
7
- data.tar.gz: a9cb7a049ca07325e72df9bccca2c1caedd99c85831182c331defebb15f99c905876b1d358ccad841bb0f8eb7093e56b3198515768c0af89e4c099025a6d2c13
6
+ metadata.gz: 32fec79b423b236ccf044c9f4f30300971e32c9c76a158439219193ffbd2b5e021524849c8efe9018b4f56627c0b633be46c9512e8e7ec329b4d73d6bd7fbdf4
7
+ data.tar.gz: 2809bae41bc0b7b99fc77a11d92a21f71e06019ee29a41ff06b8d3444f3ec50fbdd99804adf317b8d55f4a1d0e59b1f6db820aae744e1c4872be35a639afa916
@@ -47,7 +47,7 @@
47
47
 
48
48
 
49
49
  :root {
50
- --govuk-frontend-version: "5.10.0";
50
+ --govuk-frontend-version: "5.10.2";
51
51
  --govuk-frontend-breakpoint-mobile: 20rem;
52
52
  --govuk-frontend-breakpoint-tablet: 40.0625rem;
53
53
  --govuk-frontend-breakpoint-desktop: 48.0625rem;
@@ -80,8 +80,12 @@
80
80
  background-color: #ffdd00;
81
81
  box-shadow: 0 -2px #ffdd00, 0 4px #0b0c0c;
82
82
  text-decoration: none;
83
- -webkit-box-decoration-break: clone;
84
- box-decoration-break: clone;
83
+ }
84
+ @supports not (text-wrap: balance) {
85
+ .govuk-link:focus {
86
+ -webkit-box-decoration-break: clone;
87
+ box-decoration-break: clone;
88
+ }
85
89
  }
86
90
  .govuk-link:link {
87
91
  color: #1d70b8;
@@ -2225,8 +2229,12 @@
2225
2229
  background-color: #ffdd00;
2226
2230
  box-shadow: 0 -2px #ffdd00, 0 4px #0b0c0c;
2227
2231
  text-decoration: none;
2228
- -webkit-box-decoration-break: clone;
2229
- box-decoration-break: clone;
2232
+ }
2233
+ @supports not (text-wrap: balance) {
2234
+ .govuk-error-summary__list a:focus {
2235
+ -webkit-box-decoration-break: clone;
2236
+ box-decoration-break: clone;
2237
+ }
2230
2238
  }
2231
2239
  .govuk-error-summary__list a:link, .govuk-error-summary__list a:visited {
2232
2240
  color: #d4351c;
@@ -623,6 +623,7 @@ class CharacterCount extends ConfigurableComponent {
623
623
  identifier: `Count message (\`id="${textareaDescriptionId}"\`)`
624
624
  });
625
625
  }
626
+ this.$errorMessage = this.$root.querySelector('.govuk-error-message');
626
627
  if (`${$textareaDescription.textContent}`.match(/^\s*$/)) {
627
628
  $textareaDescription.textContent = this.i18n.t('textareaDescription', {
628
629
  count: this.maxLength
@@ -681,7 +682,9 @@ class CharacterCount extends ConfigurableComponent {
681
682
  const remainingNumber = this.maxLength - this.count(this.$textarea.value);
682
683
  const isError = remainingNumber < 0;
683
684
  this.$visibleCountMessage.classList.toggle('govuk-character-count__message--disabled', !this.isOverThreshold());
684
- this.$textarea.classList.toggle('govuk-textarea--error', isError);
685
+ if (!this.$errorMessage) {
686
+ this.$textarea.classList.toggle('govuk-textarea--error', isError);
687
+ }
685
688
  this.$visibleCountMessage.classList.toggle('govuk-error-message', isError);
686
689
  this.$visibleCountMessage.classList.toggle('govuk-hint', !isError);
687
690
  this.$visibleCountMessage.textContent = this.getCountMessage();
@@ -18,7 +18,7 @@ class f extends l{constructor(e,t={}){super(e,t),this.debounceFormSubmitTimer=nu
18
18
  *
19
19
  * @preserve
20
20
  * @augments ConfigurableComponent<CharacterCountConfig>
21
- */f.moduleName="govuk-button",f.defaults=Object.freeze({preventDoubleClick:!1}),f.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class v extends l{[c](e){let t={};return("maxwords"in e||"maxlength"in e)&&(t={maxlength:void 0,maxwords:void 0}),t}constructor(e,t={}){var o,s;super(e,t),this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const a=this.$root.querySelector(".govuk-js-character-count");if(!(a instanceof HTMLTextAreaElement||a instanceof HTMLInputElement))throw new r({component:v,element:a,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const u=function(e,t){const n=[];for(const[o,s]of Object.entries(e)){const e=[];if(Array.isArray(s)){for(const{required:n,errorMessage:o}of s)n.every((e=>!!t[e]))||e.push(o);"anyOf"!==o||s.length-e.length>=1||n.push(...e)}}return n}(v.schema,this.config);if(u[0])throw new i(n(v,u[0]));this.i18n=new m(this.config.i18n,{locale:g(this.$root,"lang")}),this.maxLength=null!=(o=null!=(s=this.config.maxwords)?s:this.config.maxlength)?o:1/0,this.$textarea=a;const c=`${this.$textarea.id}-info`,l=document.getElementById(c);if(!l)throw new r({component:v,element:l,identifier:`Count message (\`id="${c}"\`)`});`${l.textContent}`.match(/^\s*$/)&&(l.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",l);const h=document.createElement("div");h.className="govuk-character-count__sr-status govuk-visually-hidden",h.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=h,l.insertAdjacentElement("afterend",h);const d=document.createElement("div");d.className=l.className,d.classList.add("govuk-character-count__status"),d.setAttribute("aria-hidden","true"),this.$visibleCountMessage=d,l.insertAdjacentElement("afterend",d),l.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",(()=>this.updateCountMessage())),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",(()=>this.handleKeyUp())),this.$textarea.addEventListener("focus",(()=>this.handleFocus())),this.$textarea.addEventListener("blur",(()=>this.handleBlur()))}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval((()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}),1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const e=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$textarea.classList.toggle("govuk-textarea--error",e),this.$visibleCountMessage.classList.toggle("govuk-error-message",e),this.$visibleCountMessage.classList.toggle("govuk-hint",!e),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(e){if(this.config.maxwords){var t;return(null!=(t=e.match(/\S+/g))?t:[]).length}return e.length}getCountMessage(){const e=this.maxLength-this.count(this.$textarea.value),t=this.config.maxwords?"words":"characters";return this.formatCountMessage(e,t)}formatCountMessage(e,t){if(0===e)return this.i18n.t(`${t}AtLimit`);const n=e<0?"OverLimit":"UnderLimit";return this.i18n.t(`${t}${n}`,{count:Math.abs(e)})}isOverThreshold(){if(!this.config.threshold)return!0;const e=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=e}}v.moduleName="govuk-character-count",v.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),v.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});
21
+ */f.moduleName="govuk-button",f.defaults=Object.freeze({preventDoubleClick:!1}),f.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class v extends l{[c](e){let t={};return("maxwords"in e||"maxlength"in e)&&(t={maxlength:void 0,maxwords:void 0}),t}constructor(e,t={}){var o,s;super(e,t),this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const a=this.$root.querySelector(".govuk-js-character-count");if(!(a instanceof HTMLTextAreaElement||a instanceof HTMLInputElement))throw new r({component:v,element:a,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const u=function(e,t){const n=[];for(const[o,s]of Object.entries(e)){const e=[];if(Array.isArray(s)){for(const{required:n,errorMessage:o}of s)n.every((e=>!!t[e]))||e.push(o);"anyOf"!==o||s.length-e.length>=1||n.push(...e)}}return n}(v.schema,this.config);if(u[0])throw new i(n(v,u[0]));this.i18n=new m(this.config.i18n,{locale:g(this.$root,"lang")}),this.maxLength=null!=(o=null!=(s=this.config.maxwords)?s:this.config.maxlength)?o:1/0,this.$textarea=a;const c=`${this.$textarea.id}-info`,l=document.getElementById(c);if(!l)throw new r({component:v,element:l,identifier:`Count message (\`id="${c}"\`)`});this.$errorMessage=this.$root.querySelector(".govuk-error-message"),`${l.textContent}`.match(/^\s*$/)&&(l.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",l);const h=document.createElement("div");h.className="govuk-character-count__sr-status govuk-visually-hidden",h.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=h,l.insertAdjacentElement("afterend",h);const d=document.createElement("div");d.className=l.className,d.classList.add("govuk-character-count__status"),d.setAttribute("aria-hidden","true"),this.$visibleCountMessage=d,l.insertAdjacentElement("afterend",d),l.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",(()=>this.updateCountMessage())),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",(()=>this.handleKeyUp())),this.$textarea.addEventListener("focus",(()=>this.handleFocus())),this.$textarea.addEventListener("blur",(()=>this.handleBlur()))}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval((()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}),1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const e=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$errorMessage||this.$textarea.classList.toggle("govuk-textarea--error",e),this.$visibleCountMessage.classList.toggle("govuk-error-message",e),this.$visibleCountMessage.classList.toggle("govuk-hint",!e),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(e){if(this.config.maxwords){var t;return(null!=(t=e.match(/\S+/g))?t:[]).length}return e.length}getCountMessage(){const e=this.maxLength-this.count(this.$textarea.value),t=this.config.maxwords?"words":"characters";return this.formatCountMessage(e,t)}formatCountMessage(e,t){if(0===e)return this.i18n.t(`${t}AtLimit`);const n=e<0?"OverLimit":"UnderLimit";return this.i18n.t(`${t}${n}`,{count:Math.abs(e)})}isOverThreshold(){if(!this.config.threshold)return!0;const e=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=e}}v.moduleName="govuk-character-count",v.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),v.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});
22
22
  /**
23
23
  * Checkboxes component
24
24
  *
@@ -30,6 +30,16 @@
30
30
  color: $govuk-header-text;
31
31
  }
32
32
 
33
+ .govuk-header--with-js-navigation {
34
+ @include govuk-media-query($until: desktop) {
35
+ .govuk-header__logo {
36
+ // Protect the absolute positioned menu button from overlapping with the
37
+ // logo with right padding using the button's width
38
+ padding-right: $govuk-header-menu-button-width;
39
+ }
40
+ }
41
+ }
42
+
33
43
  .govuk-header__container--full-width {
34
44
  padding: 0 govuk-spacing(3);
35
45
  border-color: $govuk-header-border-color;
@@ -94,12 +104,17 @@
94
104
  @include _govuk-rebrand {
95
105
  margin-right: govuk-px-to-rem(7px); // 1 'dot'
96
106
  margin-bottom: $govuk-header-rebrand-logo-bottom-margin;
107
+
108
+ // Remove right-margin if there's no product name
109
+ &:last-child {
110
+ margin-right: 0;
111
+ }
97
112
  }
98
113
  }
99
114
 
100
115
  // Colour in the Dot
101
116
  .govuk-logo-dot {
102
- fill: #11e0f1;
117
+ fill: #00ffe0;
103
118
 
104
119
  // Override Dot colour when printing
105
120
  @include govuk-media-query($media-type: print) {
@@ -279,10 +294,6 @@
279
294
  .govuk-header__logo {
280
295
  @include govuk-responsive-margin($govuk-header-vertical-spacing-value, "bottom");
281
296
 
282
- // Protect the absolute positioned menu button from overlapping with the
283
- // logo with right padding using the button's width
284
- padding-right: $govuk-header-menu-button-width;
285
-
286
297
  @include govuk-media-query($from: desktop) {
287
298
  width: 33.33%;
288
299
  padding-right: $govuk-gutter-half;
@@ -1,7 +1,7 @@
1
1
  :root {
2
2
  // This variable is automatically overwritten during builds and releases.
3
3
  // It doesn't need to be updated manually.
4
- --govuk-frontend-version: "5.10.0";
4
+ --govuk-frontend-version: "5.10.2";
5
5
 
6
6
  // CSS custom property for each breakpoint
7
7
  @each $name, $value in $govuk-breakpoints {
@@ -66,6 +66,17 @@
66
66
  @error "Unknown organisation `#{$organisation}`";
67
67
  }
68
68
 
69
+ // Output a deprecation warning if the legacy colour palette is being used.
70
+ // Remove in next major version.
71
+ $is-legacy: $govuk-colours-organisations == $_govuk-legacy-organisation-colours;
72
+ @if $is-legacy and _should-warn("legacy-organisation-colours") {
73
+ @warn _warning-text("legacy-organisation-colours",
74
+ "We've updated the organisation colour palette. Opt in to the new " +
75
+ "colours using `$govuk-new-organisation-colours: true`. The old " +
76
+ "palette is deprecated and we'll remove it in the next major version."
77
+ );
78
+ }
79
+
69
80
  // Output a warning if $websafe is set.
70
81
  @if $websafe and _should-warn("organisation-colour-websafe-param") {
71
82
  @warn _warning-text("organisation-colour-websafe-param",
@@ -24,10 +24,20 @@
24
24
  // box shadow adds the "underline"
25
25
  text-decoration: none;
26
26
 
27
- // When a focused box is broken by e.g. a line break, ensure that the
28
- // box-shadow is applied to each fragment independently.
29
- -webkit-box-decoration-break: clone;
30
- box-decoration-break: clone;
27
+ // Fixes an issue in Chromium 108–111 where the box-shadow on the focus state
28
+ // is missing on links that wrap across multiple lines [1].
29
+ //
30
+ // However, text-wrap: balance doesn't play nicely with box-decoration-break:
31
+ // clone, causing links to re-flow when focused [2]. As text-wrap: balance
32
+ // wasn't introduced until Chromium 114 we can use it as a way to target
33
+ // this fix to just 108–111.
34
+ //
35
+ // [1]: http://crbug.com/40884971
36
+ // [2]: https://github.com/alphagov/govuk-frontend/issues/5878
37
+ @supports not (text-wrap: balance) {
38
+ -webkit-box-decoration-break: clone;
39
+ box-decoration-break: clone;
40
+ }
31
41
  }
32
42
 
33
43
  /// Focused box
@@ -190,7 +190,7 @@
190
190
  // No match? Try with string type (e.g. $size: "16" not 16)
191
191
  @if not $font-map {
192
192
  @each $font-size in map-keys($govuk-typography-scale) {
193
- @if not $font-map and #{$font-size} == #{$size} {
193
+ @if not $font-map and "#{$font-size}" == "#{$size}" {
194
194
  $font-map: map-get($govuk-typography-scale, $font-size);
195
195
  }
196
196
  }
@@ -359,15 +359,6 @@ $govuk-colours-organisations: $_govuk-legacy-organisation-colours !default;
359
359
  $govuk-colours-organisations: $_govuk-organisation-colours;
360
360
  }
361
361
 
362
- // Output a deprecation warning if the legacy colour palette is being used.
363
- // Remove in next major version.
364
- @if $govuk-colours-organisations == $_govuk-legacy-organisation-colours {
365
- @include _warning(
366
- "legacy-organisation-colours",
367
- "The legacy organisation colour palette has been deprecated and will be removed in the next major version."
368
- );
369
- }
370
-
371
362
  /// Organisation colour aliases
372
363
  ///
373
364
  /// Some organisations have been renamed within our code over time. Here we
@@ -21,9 +21,9 @@
21
21
  /// }
22
22
  ///
23
23
  ///
24
- /// @param {String} [$property] - The name of the property being rebranded
25
- /// @param {String} [$from] - The original value of the property
26
- /// @param {String} [$to] - The rebranded value of the property
24
+ /// @param {String} $property - The name of the property being rebranded
25
+ /// @param {String} $from - The original value of the property
26
+ /// @param {String} $to - The rebranded value of the property
27
27
  /// @throw if `$property` is set but `$from` or `$to` are missing
28
28
  /// @access private
29
29
  @mixin _govuk-rebrand($property: null, $from: null, $to: null) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-govuk-formbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive