govuk_publishing_components 71.1.0 → 71.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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +1 -1
  3. data/app/assets/stylesheets/component_guide/application.scss +22 -4
  4. data/app/assets/stylesheets/govuk_publishing_components/_base.scss +1 -2
  5. data/app/assets/stylesheets/govuk_publishing_components/all-components.scss +3 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +1 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_app-promo-banner.scss +1 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +25 -19
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_datetime-fields.scss +20 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +2 -5
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +9 -11
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +8 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +7 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +2 -5
  16. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +125 -2
  17. data/app/assets/stylesheets/govuk_publishing_components/lib/_brand-colours.scss +28 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/{components/mixins → mixins}/_index.scss +0 -1
  19. data/app/assets/stylesheets/govuk_publishing_components/specific-components.scss +2 -2
  20. data/app/models/govuk_publishing_components/component_doc.rb +16 -1
  21. data/app/views/govuk_publishing_components/component_guide/show.html.erb +11 -0
  22. data/app/views/govuk_publishing_components/components/_datetime_fields.html.erb +112 -0
  23. data/app/views/govuk_publishing_components/components/_details.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/docs/chart.yml +13 -2
  25. data/app/views/govuk_publishing_components/components/docs/datetime_fields.yml +74 -0
  26. data/config/locales/mfe.yml +258 -0
  27. data/lib/govuk_publishing_components/presenters/datetime_fields_helper.rb +68 -0
  28. data/lib/govuk_publishing_components/version.rb +1 -1
  29. data/lib/govuk_publishing_components.rb +1 -0
  30. metadata +2156 -2094
  31. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +0 -29
  32. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_colours.scss +0 -12
  33. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +0 -127
  34. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss +0 -7
  35. /data/app/assets/stylesheets/govuk_publishing_components/lib/{_print_support.scss → _print-support.scss} +0 -0
  36. /data/app/assets/stylesheets/govuk_publishing_components/{components/mixins → mixins}/_high-contrast-outline.scss +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b52ceb254eb609759602cb6bc0e2a6b5db708b5934acd2d533ce0c719da617fb
4
- data.tar.gz: 6560960dcd97afd22c9a79035cd0342d711ec9495272eba304e7d4ec82a315ae
3
+ metadata.gz: e41065db2d174e5c5b2f465ede0a7b92d81f43d5fb3d6c8b00477c5493ab9c3d
4
+ data.tar.gz: 67a7c7a4188ac85206597848d344e5febdf7443d11dc45a7f3c9eed33a8b958e
5
5
  SHA512:
6
- metadata.gz: d6cb5790d20ba98d55bc3a62481f468fc3b54eea9022c44dc9dbbf7d26571fc83a721c02fbcc7e3fbaa0f7298c4d493874e96a1254574a6c98652186f0fbba3f
7
- data.tar.gz: 6ecbb506695215fb52444d463c8be8354906b4ee986059ed1929d98840c9d5501ea43918a692b9b78a83af990991ee1d899d8371778d0215624fbe2a9578659c
6
+ metadata.gz: 07e057684be3e136834192725d1a13d51da4cec216ad611c10baf199743c53417de77c1078acfce451c296cd766900e6853c21de8d33b51ce63ed0afca64471c
7
+ data.tar.gz: d55e27a86e41dc64c0d6cede116a34d1eeac18e0148f70aa11512a81077962592788a17c032ff4a3d040b4b7170c85a7f340b67753487fcf2b77552f77866c26
@@ -73,7 +73,7 @@
73
73
 
74
74
  this.done = function () {
75
75
  if (xhr.status === 200) {
76
- this.showFormSuccess(xhr.message)
76
+ this.showFormSuccess()
77
77
  this.revealInitialPrompt()
78
78
  this.activeForm.hidden = true
79
79
  clearInterval(this.timerInterval)
@@ -2,9 +2,6 @@
2
2
  @use "sass:color";
3
3
  @import "govuk_publishing_components/all-components";
4
4
 
5
- // Include required helpers
6
- @import "../../stylesheets/govuk_publishing_components/components/helpers/markdown-typography";
7
-
8
5
  $gem-guide-border-width: 1px;
9
6
 
10
7
  .component-doc {
@@ -182,7 +179,28 @@ $gem-guide-border-width: 1px;
182
179
 
183
180
  .component-markdown {
184
181
  margin-bottom: govuk-spacing(8);
185
- @include markdown-typography;
182
+
183
+ p {
184
+ @include govuk-typography-common;
185
+ @include govuk-font-size(19);
186
+ }
187
+
188
+ a {
189
+ @include govuk-link-common;
190
+ @include govuk-link-style-default;
191
+ }
192
+
193
+ ol,
194
+ ul {
195
+ @extend %govuk-list;
196
+ @extend %govuk-list--bullet;
197
+ }
198
+
199
+ code {
200
+ padding: 0 govuk-spacing(1);
201
+ color: govuk-colour("red");
202
+ background-color: govuk-colour("black", $variant: "tint-95");
203
+ }
186
204
  }
187
205
 
188
206
  .component-markdown--no-margin {
@@ -3,5 +3,4 @@
3
3
 
4
4
  @import "settings/index";
5
5
  @import "govuk/base";
6
- @import "govuk_publishing_components/components/helpers/colours";
7
- @import "govuk_publishing_components/components/mixins/index";
6
+ @import "govuk_publishing_components/mixins/index";
@@ -7,9 +7,9 @@ $govuk-output-custom-properties: true;
7
7
  @import "govuk/utilities/index";
8
8
  @import "govuk/overrides/index";
9
9
 
10
- @import "govuk_publishing_components/components/helpers/brand-colours";
10
+ @import "govuk_publishing_components/lib/brand-colours";
11
11
  @import "govuk_publishing_components/lib/link";
12
- @import "govuk_publishing_components/lib/print_support";
12
+ @import "govuk_publishing_components/lib/print-support";
13
13
 
14
14
  @import "components/accordion";
15
15
  @import "components/action-link";
@@ -33,6 +33,7 @@ $govuk-output-custom-properties: true;
33
33
  @import "components/cookie-banner";
34
34
  @import "components/cross-service-header";
35
35
  @import "components/date-input";
36
+ @import "components/datetime-fields";
36
37
  @import "components/details";
37
38
  @import "components/devolved-nations";
38
39
  @import "components/document-list";
@@ -23,7 +23,7 @@
23
23
  width: 28px;
24
24
 
25
25
  .gem-c-action-link__icon__circle {
26
- fill: $govuk-blue-tint-80;
26
+ fill: govuk-colour("blue", $variant: "tint-80");
27
27
 
28
28
  .gem-c-action-link--inverse & {
29
29
  fill: govuk-colour("white");
@@ -2,7 +2,7 @@
2
2
  display: none;
3
3
  padding: govuk-spacing(5) 0;
4
4
  border-top: 4px solid govuk-functional-colour(brand);
5
- background-color: $govuk-blue-tint-95;
5
+ background-color: govuk-colour("blue", $variant: "tint-95");
6
6
  color: govuk-functional-colour(text);
7
7
  }
8
8
 
@@ -12,7 +12,13 @@
12
12
  // https://trello.com/c/KEkNsxG3/142-3-implement-customisable-spacing-for-components
13
13
  .gem-c-button--bottom-margin,
14
14
  .gem-c-button__info-text--bottom-margin {
15
- @include responsive-bottom-margin;
15
+ // TODO: review this spacing with a designer to see if the custom
16
+ // margin can be replaced with standard GOV.UK Frontend spacing.
17
+ margin-bottom: govuk-spacing(3);
18
+
19
+ @include govuk-media-query($from: tablet) {
20
+ margin-bottom: govuk-spacing(7);
21
+ }
16
22
  }
17
23
 
18
24
  .gem-c-button--inline {
@@ -39,28 +45,28 @@
39
45
 
40
46
  .gem-c-button--secondary {
41
47
  padding: (govuk-spacing(2) - $govuk-border-width-form-element) govuk-spacing(2); // s1
42
- border-color: $gem-secondary-button-colour;
43
- color: $gem-secondary-button-colour;
44
- background-color: $gem-secondary-button-background-colour;
48
+ border-color: govuk-colour("green", $variant: "shade-25");
49
+ color: govuk-colour("green", $variant: "shade-25");
50
+ background-color: govuk-colour("white");
45
51
  box-shadow: none;
46
52
 
47
53
  &:link,
48
54
  &:visited,
49
55
  &:active,
50
56
  &:focus {
51
- color: $gem-secondary-button-colour;
52
- background-color: $gem-secondary-button-background-colour;
57
+ color: govuk-colour("green", $variant: "shade-25");
58
+ background-color: govuk-colour("white");
53
59
  text-decoration: none;
54
60
  }
55
61
 
56
62
  &:link:focus {
57
- color: $gem-secondary-button-colour;
63
+ color: govuk-colour("green", $variant: "shade-25");
58
64
  }
59
65
 
60
66
  &:hover {
61
- border-color: $gem-secondary-button-hover-colour;
62
- color: $gem-secondary-button-hover-colour;
63
- background-color: $gem-secondary-button-hover-background-colour;
67
+ border-color: govuk-colour("green", $variant: "shade-50");
68
+ color: govuk-colour("green", $variant: "shade-50");
69
+ background-color: govuk-colour("black", $variant: "tint-95");
64
70
  text-decoration: none;
65
71
  }
66
72
 
@@ -71,28 +77,28 @@
71
77
 
72
78
  .gem-c-button--secondary-quiet {
73
79
  padding: (govuk-spacing(2) - $govuk-border-width-form-element) govuk-spacing(2); // s1
74
- border-color: $gem-quiet-button-colour;
75
- color: $gem-quiet-button-colour;
76
- background-color: $gem-secondary-button-background-colour;
80
+ border-color: govuk-functional-colour("secondary-text");
81
+ color: govuk-functional-colour("secondary-text");
82
+ background-color: govuk-colour("white");
77
83
  box-shadow: none;
78
84
 
79
85
  &:link,
80
86
  &:visited,
81
87
  &:active,
82
88
  &:focus {
83
- color: $gem-quiet-button-colour;
84
- background-color: $gem-secondary-button-background-colour;
89
+ color: govuk-functional-colour("secondary-text");
90
+ background-color: govuk-colour("white");
85
91
  text-decoration: none;
86
92
  }
87
93
 
88
94
  &:link:focus {
89
- color: $gem-quiet-button-colour;
95
+ color: govuk-functional-colour("secondary-text");
90
96
  }
91
97
 
92
98
  &:hover {
93
- border-color: $gem-quiet-button-hover-colour;
94
- color: $gem-quiet-button-hover-colour;
95
- background-color: $gem-quiet-button-hover-background-colour;
99
+ border-color: govuk-colour("black");
100
+ color: govuk-colour("black");
101
+ background-color: govuk-colour("black", $variant: "tint-80");
96
102
  text-decoration: none;
97
103
  }
98
104
 
@@ -0,0 +1,20 @@
1
+ .gem-c-datetime-fields__date-time-wrapper {
2
+ margin-top: govuk-spacing(-2);
3
+ }
4
+
5
+ .gem-c-datetime-fields__date-time {
6
+ display: inline-block;
7
+ margin-right: govuk-spacing(2);
8
+ margin-top: govuk-spacing(2);
9
+
10
+ .govuk-select {
11
+ max-width: 4.5em;
12
+ min-width: 4.5em;
13
+ }
14
+ }
15
+
16
+ .gem-c-datetime-fields__time-separator {
17
+ display: inline-block;
18
+ margin: govuk-spacing(6) + 5 govuk-spacing(2) 0 0;
19
+ margin-bottom: 0;
20
+ }
@@ -1,12 +1,9 @@
1
- $feedback-prompt-background-colour: $govuk-blue-tint-95;
2
- $feedback-prompt-border-top-colour: $govuk-blue-tint-50;
3
-
4
1
  .gem-c-feedback {
5
2
  background: govuk-colour("white");
6
3
  margin-top: govuk-spacing(6);
7
- background-color: $feedback-prompt-background-colour;
4
+ background-color: govuk-colour("blue", $variant: "tint-95");
8
5
  color: govuk-colour("black");
9
- border-top: 1px solid $feedback-prompt-border-top-colour;
6
+ border-top: 1px solid govuk-colour("blue", $variant: "tint-50");
10
7
 
11
8
  @include govuk-media-query($from: desktop) {
12
9
  margin-top: govuk-spacing(9);
@@ -1,6 +1,6 @@
1
1
  .gem-c-inverse-header {
2
2
  width: 100%;
3
- background-color: $govuk-blue-tint-80;
3
+ background-color: govuk-colour("blue", $variant: "tint-80");
4
4
  margin-bottom: govuk-spacing(6);
5
5
  padding: govuk-spacing(3) govuk-spacing(6) govuk-spacing(6);
6
6
  box-sizing: border-box;
@@ -7,8 +7,6 @@ $pseudo-underline-height: 3px;
7
7
 
8
8
  $navbar-height: 61px;
9
9
 
10
- $button-pipe-colour: $govuk-blue-tint-95;
11
-
12
10
  $nav-button-horizontal-padding: govuk-spacing(3);
13
11
  $nav-button-horizontal-padding-chevron-breakpoint: govuk-spacing(4);
14
12
 
@@ -201,7 +199,7 @@ $search-icon-height: 20px;
201
199
  .gem-c-layout-super-navigation-header__navigation-item-link {
202
200
  .gem-c-layout-super-navigation-header__navigation-item-link-inner {
203
201
  padding: $menu-button-padding;
204
- border-right: 1px solid $button-pipe-colour;
202
+ border-right: 1px solid govuk-colour("blue", $variant: "tint-95");
205
203
 
206
204
  @include govuk-media-query($from: $chevron-breakpoint) {
207
205
  padding: $menu-button-padding-chevron-breakpoint;
@@ -257,7 +255,7 @@ $search-icon-height: 20px;
257
255
 
258
256
  .gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
259
257
  display: inline-block;
260
- border-right: 1px solid $button-pipe-colour;
258
+ border-right: 1px solid govuk-colour("blue", $variant: "tint-95");
261
259
  margin: 0;
262
260
  padding: $menu-button-padding;
263
261
 
@@ -328,7 +326,7 @@ $search-icon-height: 20px;
328
326
  }
329
327
 
330
328
  .gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
331
- border-right-color: $button-pipe-colour;
329
+ border-right-color: govuk-colour("blue", $variant: "tint-95");
332
330
 
333
331
  @include govuk-media-query($from: $chevron-breakpoint) {
334
332
  &::before {
@@ -379,7 +377,7 @@ $search-icon-height: 20px;
379
377
  }
380
378
 
381
379
  @include focus-not-focus-visible {
382
- background: $govuk-blue-tint-95;
380
+ background: govuk-colour("blue", $variant: "tint-95");
383
381
 
384
382
  &::after {
385
383
  background-color: govuk-functional-colour(link);
@@ -387,7 +385,7 @@ $search-icon-height: 20px;
387
385
 
388
386
  .gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
389
387
  color: govuk-functional-colour(link);
390
- border-right-color: $button-pipe-colour;
388
+ border-right-color: govuk-colour("blue", $variant: "tint-95");
391
389
 
392
390
  @include govuk-media-query($from: $chevron-breakpoint) {
393
391
  &::before {
@@ -494,8 +492,8 @@ $search-icon-height: 20px;
494
492
  }
495
493
 
496
494
  @include focus-not-focus-visible {
497
- background: $govuk-blue-tint-95;
498
- outline: 1px solid $govuk-blue-tint-95; // overlap the border of the nav menu so it won't appear when menu open
495
+ background: govuk-colour("blue", $variant: "tint-95");
496
+ outline: 1px solid govuk-colour("blue", $variant: "tint-95"); // overlap the border of the nav menu so it won't appear when menu open
499
497
 
500
498
  color: govuk-colour("blue");
501
499
 
@@ -541,7 +539,7 @@ $search-icon-height: 20px;
541
539
  .gem-c-layout-super-navigation-header__navigation-dropdown-menu {
542
540
  width: 100%;
543
541
  order: 1; // Ensure the dropdown menu appears after the super navigation buttons which have a default order of 0
544
- background: $govuk-blue-tint-95;
542
+ background: govuk-colour("blue", $variant: "tint-95");
545
543
  padding-top: govuk-spacing(6);
546
544
 
547
545
  @include govuk-media-query($from: "desktop") {
@@ -560,7 +558,7 @@ $search-icon-height: 20px;
560
558
  top: $navbar-height;
561
559
  bottom: 0;
562
560
  width: 100%;
563
- background: $govuk-blue-tint-95;
561
+ background: govuk-colour("blue", $variant: "tint-95");
564
562
  box-shadow: 0 1px govuk-colour("black", $variant: "tint-80");
565
563
  }
566
564
  }
@@ -3,7 +3,14 @@
3
3
  // Ensure the text has a line-length of around 60 characters
4
4
  max-width: 30em;
5
5
  color: govuk-functional-colour(text);
6
- @include responsive-bottom-margin;
6
+ // TODO: review this spacing with a designer to see if the custom
7
+ // margin can be replaced with standard GOV.UK Frontend spacing.
8
+ margin-bottom: govuk-spacing(3);
9
+
10
+ @include govuk-media-query($from: tablet) {
11
+ margin-bottom: govuk-spacing(7);
12
+ }
13
+
7
14
  @include govuk-font(24);
8
15
  }
9
16
 
@@ -1,7 +1,13 @@
1
1
  .gem-c-metadata {
2
2
  color: govuk-functional-colour(text);
3
3
  @include govuk-font(16);
4
- @include responsive-bottom-margin;
4
+ // TODO: review this spacing with a designer to see if the custom
5
+ // margin can be replaced with standard GOV.UK Frontend spacing.
6
+ margin-bottom: govuk-spacing(3);
7
+
8
+ @include govuk-media-query($from: tablet) {
9
+ margin-bottom: govuk-spacing(7);
10
+ }
5
11
 
6
12
  a {
7
13
  font-weight: bold;
@@ -3,9 +3,6 @@
3
3
  $input-size: 40px;
4
4
  $large-input-size: 50px;
5
5
 
6
- $search-submit-button-colour: $govuk-blue-tint-80;
7
- $search-submit-button-hover-colour: $govuk-blue-tint-95;
8
-
9
6
  @mixin large-mode {
10
7
  .gem-c-search__label {
11
8
  @include govuk-font($size: 19, $line-height: $large-input-size);
@@ -185,11 +182,11 @@ $search-submit-button-hover-colour: $govuk-blue-tint-95;
185
182
  }
186
183
 
187
184
  .gem-c-search__submit {
188
- background-color: $search-submit-button-colour;
185
+ background-color: govuk-colour("blue", $variant: "tint-80");
189
186
  color: govuk-colour("blue");
190
187
 
191
188
  &:hover {
192
- background-color: $search-submit-button-hover-colour;
189
+ background-color: govuk-colour("blue", $variant: "tint-95");
193
190
  }
194
191
  }
195
192
 
@@ -9,11 +9,134 @@
9
9
  // - alphagov/govspeak: ✔︎
10
10
 
11
11
  // stylelint-disable max-nesting-depth
12
- @import "../helpers/markdown-typography";
13
12
 
14
13
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
15
14
  .gem-c-govspeak {
16
- @include markdown-typography;
15
+ color: govuk-functional-colour(text);
16
+ @include govuk-font($size: 16);
17
+
18
+ ol,
19
+ ul,
20
+ p {
21
+ margin: 0 0 govuk-spacing(4);
22
+ @include govuk-font($size: 19);
23
+ }
24
+
25
+ // Headings
26
+
27
+ // put some spacing between any element followed by a heading
28
+ // has to be padding on the heading otherwise margins would overlap
29
+
30
+ * + h2,
31
+ * + h3 {
32
+ padding-top: govuk-spacing(4);
33
+ }
34
+
35
+ // Markdown is expected to be styled within a document with a H1 title
36
+ // thus H1's are not expected and are discouraged by bare styling
37
+
38
+ h1 {
39
+ margin: 0;
40
+ padding: 0;
41
+ @include govuk-font($size: 19);
42
+ @include govuk-text-break-word;
43
+ }
44
+
45
+ h2 {
46
+ margin: 0 0 govuk-spacing(4);
47
+ @include govuk-font($size: 24, $weight: bold);
48
+ @include govuk-text-break-word;
49
+ }
50
+
51
+ h3 {
52
+ margin: 0 0 govuk-spacing(4);
53
+ @include govuk-font($size: 19, $weight: bold);
54
+ @include govuk-text-break-word;
55
+ }
56
+
57
+ // H4, H5 and H6 are discouraged and thus styled the same
58
+
59
+ h4,
60
+ h5,
61
+ h6 {
62
+ margin: 0;
63
+ @include govuk-font($size: 19, $weight: bold);
64
+ @include govuk-text-break-word;
65
+ }
66
+
67
+ // Links
68
+
69
+ // stylelint-disable-next-line selector-no-qualifying-type
70
+ a:not(.govuk-button) {
71
+ @include govuk-link-common;
72
+ @include govuk-link-style-default;
73
+ @include govuk-text-break-word;
74
+
75
+ &:focus {
76
+ @include govuk-focused-text;
77
+ }
78
+
79
+ @include govuk-media-query($media-type: print) {
80
+ color: govuk-functional-colour(print-text) !important; // stylelint-disable-line declaration-no-important
81
+ }
82
+ }
83
+
84
+ // Lists
85
+
86
+ ol,
87
+ ul {
88
+ // we intentionally don't set list-style for ol elements, so that they can
89
+ // utilise the type attribute for the formatting. Browsers default to a
90
+ // style of decimal.
91
+ list-style-position: outside;
92
+ margin: 0 0 govuk-spacing(4) govuk-spacing(4);
93
+ padding: 0;
94
+ }
95
+
96
+ ul {
97
+ list-style: disc;
98
+ }
99
+
100
+ .list-no-bullets {
101
+ list-style: none;
102
+ margin: 0;
103
+ }
104
+
105
+ li {
106
+ margin: 0 0 govuk-spacing(2);
107
+ padding: 0;
108
+
109
+ p {
110
+ margin: 0 0 govuk-spacing(2);
111
+ }
112
+ }
113
+
114
+ // Text styles
115
+
116
+ sup {
117
+ font-size: .8em;
118
+ line-height: .7em;
119
+ vertical-align: super;
120
+ }
121
+
122
+ abbr {
123
+ cursor: help;
124
+ text-decoration: none;
125
+ }
126
+
127
+ // Horizontal Rule
128
+
129
+ hr {
130
+ margin-top: govuk-spacing(6) - 1px;
131
+ margin-bottom: govuk-spacing(6);
132
+ border-top: 1px solid govuk-functional-colour(border);
133
+ }
134
+
135
+ code {
136
+ padding: 0 5px;
137
+ color: #d13118;
138
+ background-color: govuk-colour("black", $variant: "tint-95");
139
+ }
17
140
 
18
141
  &.gem-c-govspeak--direction-rtl ol,
19
142
  &.gem-c-govspeak--direction-rtl ul {
@@ -0,0 +1,28 @@
1
+ // Loop over all of the organisation colours provided by govuk-frontend and add a `brand--` prefix
2
+ // https://github.com/alphagov/govuk-frontend/blob/main/packages/govuk-frontend/src/govuk/settings/_colours-organisations.scss#L22
3
+ @each $organisation in map-keys($govuk-colours-organisations) {
4
+ .brand--#{$organisation} {
5
+ // the & declaration allows border-color to also be applied to the parent
6
+ // element as required by the heading component, adds 2KB to the CSS
7
+ &.brand__border-color,
8
+ .brand__border-color {
9
+ border-color: govuk-organisation-colour($organisation, $contrast-safe: false);
10
+ }
11
+ }
12
+ }
13
+
14
+ // Brand colour overrides
15
+ .brand--government-digital-service {
16
+ &.brand__border-color,
17
+ .brand__border-color {
18
+ border-color: #16eeee;
19
+ }
20
+ }
21
+
22
+ // This can be removed once the organisation is added to govuk-frontend
23
+ .brand--department-for-business-innovation-science-trade {
24
+ &.brand__border-color,
25
+ .brand__border-color {
26
+ border-color: #ff4328;
27
+ }
28
+ }
@@ -1,2 +1 @@
1
1
  @import "high-contrast-outline";
2
- @import "margins";
@@ -7,6 +7,6 @@ $govuk-output-custom-properties: true;
7
7
  @import "govuk/utilities/index";
8
8
  @import "govuk/overrides/index";
9
9
 
10
- @import "govuk_publishing_components/components/helpers/brand-colours";
10
+ @import "govuk_publishing_components/lib/brand-colours";
11
11
  @import "govuk_publishing_components/lib/link";
12
- @import "govuk_publishing_components/lib/print_support";
12
+ @import "govuk_publishing_components/lib/print-support";
@@ -7,7 +7,8 @@ module GovukPublishingComponents
7
7
  :component,
8
8
  :accessibility_excluded_rules,
9
9
  :source,
10
- :embed
10
+ :embed,
11
+ :children
11
12
 
12
13
  def initialize(component)
13
14
  @component = component
@@ -18,6 +19,7 @@ module GovukPublishingComponents
18
19
  @accessibility_excluded_rules = component[:accessibility_excluded_rules]
19
20
  @source = component[:source]
20
21
  @embed = component[:embed]
22
+ @children = find_children
21
23
  end
22
24
 
23
25
  def accessibility_criteria
@@ -110,6 +112,19 @@ module GovukPublishingComponents
110
112
  end
111
113
  end
112
114
 
115
+ def find_children
116
+ filename = "_#{@id.downcase.gsub(' ', '_')}.html.erb"
117
+ file = "#{Dir.pwd}/app/views/govuk_publishing_components/#{GovukPublishingComponents::Config.component_directory_name}/#{filename}"
118
+ file = Rails.root.join("app", "views", GovukPublishingComponents::Config.component_directory_name, filename) if Rails.env.test?
119
+ return [] unless File.exist?(file)
120
+
121
+ src = File.read(file)
122
+ match = src.scan(/["']{1}(govuk_publishing_components\/components\/[a-z_-]+["']{1})/)
123
+ match.flatten.uniq.map(&:to_s).sort.map do |m|
124
+ m.gsub("govuk_publishing_components/components/", "").tr('\"\'', "")
125
+ end
126
+ end
127
+
113
128
  private
114
129
 
115
130
  def markdown_to_html(markdown)
@@ -57,6 +57,7 @@
57
57
  { href: "#how-to-call-this-component", text: "How to call this component" },
58
58
  ({ href: "#govuk-design-system", text: "GOV.UK Design System" } if @component_doc.govuk_frontend_components.any?),
59
59
  ({ href: "#accessibility-acceptance-criteria", text: "Accessibility acceptance criteria" } if @component_doc.accessibility_criteria.present?),
60
+ ({ href: "#children", text: "Child components" } if @component_doc.children.any?),
60
61
  ].compact,
61
62
  }),
62
63
  ({
@@ -109,6 +110,16 @@
109
110
  </div>
110
111
  <% end %>
111
112
 
113
+ <% if @component_doc.children.any? %>
114
+ <h3 class="govuk-heading-m" id="children">Child components</h3>
115
+ <p class="govuk-body">This component contains the following components. Note that these components may also contain child components.</p>
116
+ <ul class="govuk-list govuk-list--bullet">
117
+ <% @component_doc.children.each do |child| %>
118
+ <li><a href="/component-guide/<%= child %>" class="govuk-link"><%= child.gsub("_", " ") %></a></li>
119
+ <% end %>
120
+ </ul>
121
+ <% end %>
122
+
112
123
  <% if @component_doc.other_examples.any? or @component_doc.uses_component_wrapper_helper? %>
113
124
  <h2 class="govuk-heading-l" id="other-examples">Other examples</h2>
114
125