govuk_publishing_components 8.2.0 → 9.0.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 (71) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/govuk-logo.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/icon-pointer-2x.png +0 -0
  4. data/app/assets/images/govuk_publishing_components/icon-pointer.png +0 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +4 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +3 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +70 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +134 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +29 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +123 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +33 -0
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +15 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +34 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +111 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +11 -0
  17. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +25 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +306 -0
  19. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +49 -0
  20. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +25 -0
  21. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +27 -0
  22. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +22 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +42 -0
  24. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +32 -0
  25. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +22 -0
  26. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +26 -0
  27. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +15 -0
  28. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +29 -0
  29. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +29 -0
  30. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +24 -0
  31. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss +24 -0
  32. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +38 -0
  33. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +224 -0
  34. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +41 -0
  35. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/form-download.scss +24 -0
  36. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_contents-list-helper.scss +25 -0
  37. data/app/assets/stylesheets/govuk_publishing_components/components/print/_contents-list.scss +19 -0
  38. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss +5 -0
  39. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +65 -0
  40. data/app/views/govuk_publishing_components/component_guide/example.html.erb +1 -1
  41. data/app/views/govuk_publishing_components/component_guide/index.html.erb +1 -1
  42. data/app/views/govuk_publishing_components/component_guide/show.html.erb +3 -3
  43. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +84 -0
  44. data/app/views/govuk_publishing_components/components/_govspeak.html.erb +14 -0
  45. data/app/views/govuk_publishing_components/components/_govspeak_html_publication.html.erb +9 -0
  46. data/app/views/govuk_publishing_components/components/_image_card.html.erb +41 -0
  47. data/app/views/govuk_publishing_components/components/_lead_paragraph.html.erb +0 -3
  48. data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -0
  49. data/app/views/govuk_publishing_components/components/_notice.html.erb +22 -0
  50. data/app/views/govuk_publishing_components/components/_share_links.html.erb +68 -30
  51. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +218 -0
  52. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +653 -0
  53. data/app/views/govuk_publishing_components/components/docs/govspeak_html_publication.yml +183 -0
  54. data/app/views/govuk_publishing_components/components/docs/image_card.yml +160 -0
  55. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
  56. data/app/views/govuk_publishing_components/components/docs/machine_readable_metadata.yml +17 -1
  57. data/app/views/govuk_publishing_components/components/docs/notice.yml +27 -0
  58. data/app/views/govuk_publishing_components/components/docs/share_links.yml +119 -18
  59. data/config/initializers/assets.rb +3 -0
  60. data/config/locales/en.yml +2 -0
  61. data/lib/govuk_publishing_components.rb +2 -1
  62. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +27 -0
  63. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +55 -0
  64. data/lib/govuk_publishing_components/presenters/machine_readable/article_schema.rb +5 -1
  65. data/lib/govuk_publishing_components/presenters/machine_readable/page.rb +5 -1
  66. data/lib/govuk_publishing_components/presenters/machine_readable/person_schema.rb +39 -0
  67. data/lib/govuk_publishing_components/presenters/schema_org.rb +3 -0
  68. data/lib/govuk_publishing_components/version.rb +1 -1
  69. metadata +49 -4
  70. data/app/assets/javascripts/govuk_publishing_components/lib/track-share-button-clicks.js +0 -26
  71. data/lib/govuk_publishing_components/presenters/sanitisation.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e88c86057a77da6fc577ecf2b7c95a5c37fdc6627335d6798838390be5e74658
4
- data.tar.gz: 63dd6a60c53f6c03538e33a3880c88336a48978a92673d19e9e1f5db9a5b81ab
3
+ metadata.gz: bf10b89816a774564689adfe4b90428a270c463f15f501195a7a38d1554b6ac4
4
+ data.tar.gz: 4f5e300eff4bbe5a9070742cfad1173add058aa69e2411f6e88bd8bc6fc6ed64
5
5
  SHA512:
6
- metadata.gz: 2df4fc9c44e66544eb54b8ccfab24989833888d9b82fca80f620cac81799a1ce8522ba9f1a59bb937469a876fa1005d4fde54c942fe563629ec447a491500162
7
- data.tar.gz: 8c1dd8ccdebf70b01f695bad66b8f07532bf69d6c4914c7cc516cbaddcd169f5903015b39c41ed024dd7fd0b1363f97f972159d1a2bf6b6930d943dcfcdc03a7
6
+ metadata.gz: 84247657400caa6a5150e6b5c0ceacfac8998a1aee8df9322603760d1d0f3787a85b5293c2736921bb608969b257828ff28b2d8d9b9d2c8d098680106b58b2c2
7
+ data.tar.gz: 59631efa93616e3f94ec2cc75c482b00672286e2fbb8ea7d481ed080f35ab0ba7352f3d24836cfeeacd44ca6e3ad4e48834690b7441f43e208e5f22eaa8d31c6
@@ -12,15 +12,19 @@
12
12
  @import "components/back-link";
13
13
  @import "components/breadcrumbs";
14
14
  @import "components/button";
15
+ @import "components/contents-list";
15
16
  @import "components/document-list";
16
17
  @import "components/error-summary";
17
18
  @import "components/feedback";
18
19
  @import "components/fieldset";
20
+ @import "components/govspeak";
19
21
  @import "components/heading";
22
+ @import "components/image-card";
20
23
  @import "components/input";
21
24
  @import "components/inverse-header";
22
25
  @import "components/label";
23
26
  @import "components/lead-paragraph";
27
+ @import "components/notice";
24
28
  @import "components/phase-banner";
25
29
  @import "components/previous-and-next-navigation";
26
30
  @import "components/radio";
@@ -7,7 +7,10 @@
7
7
  @import "typography";
8
8
  @import "colours";
9
9
 
10
+ @import "components/print/contents-list";
10
11
  @import "components/print/feedback";
12
+ @import "components/print/govspeak-html-publication";
13
+ @import "components/print/govspeak";
11
14
  @import "components/print/step-by-step-nav-header";
12
15
  @import "components/print/step-by-step-nav";
13
16
  @import "components/print/title";
@@ -35,7 +35,7 @@
35
35
  padding-bottom: 0.15em;
36
36
  }
37
37
 
38
- background-image: image-url("icon-pointer.png");
38
+ background-image: image-url("govuk_publishing_components/icon-pointer.png");
39
39
  background-position: 100% 50%;
40
40
  background-repeat: no-repeat;
41
41
 
@@ -44,7 +44,7 @@
44
44
  }
45
45
 
46
46
  @include device-pixel-ratio() {
47
- background-image: image-url("icon-pointer-2x.png");
47
+ background-image: image-url("govuk_publishing_components/icon-pointer-2x.png");
48
48
  background-size: 30px 19px;
49
49
  }
50
50
  }
@@ -0,0 +1,70 @@
1
+ @import "helpers/contents-list-helper";
2
+
3
+ .gem-c-contents-list {
4
+ // Always render the contents list above a
5
+ // back to contents link
6
+ position: relative;
7
+ margin-bottom: $gutter-two-thirds;
8
+ z-index: 1;
9
+ background: $white;
10
+ box-shadow: 0 20px 15px -10px $white;
11
+ }
12
+
13
+ .gem-c-contents-list--no-underline {
14
+ .gem-c-contents-list__link {
15
+ text-decoration: none;
16
+
17
+ &:hover,
18
+ &:focus,
19
+ &:active {
20
+ text-decoration: underline;
21
+ }
22
+ }
23
+ }
24
+
25
+ .gem-c-contents-list__link {
26
+ .gem-c-contents-list__list-item--parent > & {
27
+ font-weight: bold;
28
+ }
29
+ }
30
+
31
+ .gem-c-contents-list__list-item {
32
+ padding-top: $gutter-one-third;
33
+ line-height: 1.3;
34
+ list-style-type: none;
35
+
36
+ @include media(tablet) {
37
+ padding-top: $gutter-one-quarter;
38
+ }
39
+ }
40
+
41
+ .gem-c-contents-list__list-item--dashed {
42
+ $contents-spacing: $gutter-half + 10;
43
+ margin-left: $contents-spacing;
44
+ padding-right: $contents-spacing;
45
+
46
+ &:before {
47
+ content: "— ";
48
+ margin-left: -$contents-spacing;
49
+ padding-right: 5px;
50
+
51
+ .direction-rtl & {
52
+ margin-left: 0;
53
+ margin-right: -$contents-spacing;
54
+ padding-right: 0;
55
+ padding-left: 5px;
56
+ }
57
+ }
58
+
59
+ // Focus styles on IE8 and older include the
60
+ // left margin, creating an odd white box with
61
+ // orange border around the em dash.
62
+ // Use inline-block and vertical alignment to
63
+ // fix focus styles
64
+ //
65
+ // https://github.com/alphagov/government-frontend/pull/420#issuecomment-320632386
66
+ .lte-ie8 & .gem-c-contents-list__link {
67
+ display: inline-block;
68
+ vertical-align: top;
69
+ }
70
+ }
@@ -0,0 +1,134 @@
1
+ // Override govspeak styles with HTML publication specific ones
2
+ .gem-c-govspeak-html-publication {
3
+ margin-bottom: $gutter * 1.5;
4
+ z-index: 2;
5
+
6
+ // This fixes the positioning of the sticky element. The reason it's done on the parent element
7
+ // is because directly messing with the positioning of the sticky element produces undesirable results.
8
+ // The nested govspeak component handles its own text direction independently, but will
9
+ // coincide with the direction of its parent anyway in all usecases.
10
+ &.direction-rtl {
11
+ direction: rtl;
12
+ text-align: start;
13
+ }
14
+
15
+ .gem-c-govspeak {
16
+ h2 {
17
+ @include bold-36;
18
+ }
19
+
20
+ h3 {
21
+ @include bold-27;
22
+ }
23
+
24
+ .stat-headline:first-child {
25
+ margin-top: $gutter;
26
+
27
+ @include media(tablet) {
28
+ margin-top: ($gutter * 2) + $gutter-two-thirds;
29
+ }
30
+ }
31
+
32
+ h2,
33
+ h3 {
34
+ margin-top: $gutter;
35
+
36
+ @include media(tablet) {
37
+ margin-top: ($gutter * 2) + $gutter-two-thirds;
38
+ }
39
+ }
40
+
41
+ h2:first-child,
42
+ h3:first-child {
43
+ margin-top: $gutter-two-thirds;
44
+
45
+ @include media(tablet) {
46
+ margin-top: 0;
47
+ }
48
+ }
49
+
50
+ h3 .number,
51
+ h4 .number,
52
+ h5 .number,
53
+ h6 .number {
54
+ margin-right: 0.1em;
55
+
56
+ .direction-rtl & {
57
+ margin-right: 0;
58
+ margin-left: 0.1em;
59
+ }
60
+ }
61
+
62
+ // scss-lint:disable QualifyingElement
63
+ // this class will only be for tables and is to distinguish from a bare `table`
64
+ // the row classes below should not be applied to anything else but `tr`s
65
+ table.financial-data {
66
+
67
+ .numeric {
68
+ text-align: right;
69
+ font-family: $nta-light-tabular;
70
+ }
71
+
72
+ // make all elements inside thead look the same
73
+ // (td can sometimes be used to overcome complexity of multiple lines in thead)
74
+ // and make all of thead and tfoot stand out
75
+ thead,
76
+ tfoot {
77
+ background-color: $grey-3;
78
+ }
79
+
80
+ thead th,
81
+ thead td {
82
+ font-weight: bold;
83
+ }
84
+
85
+ // don't make `th`s bold unless they are a section heading or a (sub)total row
86
+ tbody th,
87
+ tfoot th {
88
+ font-weight: normal;
89
+ }
90
+
91
+ // needs padding due to occasional background colour
92
+ // is intentionally small and not balanced with other padding
93
+ // as tables can be quite wide
94
+ tr > :first-child {
95
+ padding-left: $gutter-one-third / 2;
96
+ }
97
+
98
+ // add spacing so that groupings are clearer
99
+ tr.section-heading > * {
100
+ font-weight: bold;
101
+ padding-top: $gutter;
102
+ }
103
+
104
+ // ideally this should be just a top margin on the tfoot
105
+ // but as that is very tricky, this is more complex
106
+ tbody:last-of-type tr:last-child > *,
107
+ tfoot ~ tbody:last-of-type tr:last-child > * {
108
+ padding-bottom: $gutter;
109
+ }
110
+
111
+ tbody:last-child tr:last-child > * {
112
+ padding-bottom: $gutter-one-third;
113
+ }
114
+
115
+ // total and subtotal rows
116
+ tr.subtotal > *,
117
+ tr.total > * {
118
+ border-top: 3px solid $grey-2;
119
+ }
120
+
121
+ tr.total > *,
122
+ tbody tr.subtotal > * {
123
+ font-weight: bold;
124
+ }
125
+
126
+ // the total is usually in the tfoot, so already has that background colour
127
+ // but when it's used inside the tbody, it should also be highlighted
128
+ tr.total {
129
+ background-color: $grey-3;
130
+ }
131
+ }
132
+ // scss-lint:enable QualifyingElement
133
+ }
134
+ }
@@ -0,0 +1,29 @@
1
+ @import "govspeak/advisory";
2
+ @import "govspeak/attachment";
3
+ @import "govspeak/button";
4
+ @import "govspeak/call-to-action";
5
+ @import "govspeak/charts";
6
+ @import "govspeak/contact";
7
+ @import "govspeak/example";
8
+ @import "govspeak/footnotes";
9
+ @import "govspeak/form-download";
10
+ @import "govspeak/fraction";
11
+ @import "govspeak/highlight-answer";
12
+ @import "govspeak/images";
13
+ @import "govspeak/information-callout";
14
+ @import "govspeak/legislative-list";
15
+ @import "govspeak/media-player";
16
+ @import "govspeak/place";
17
+ @import "govspeak/stat-headline";
18
+ @import "govspeak/steps";
19
+ @import "govspeak/summary";
20
+ @import "govspeak/tables";
21
+ @import "govspeak/typography";
22
+ @import "govspeak/warning-callout";
23
+
24
+ .gem-c-govspeak {
25
+ &.direction-rtl {
26
+ direction: rtl;
27
+ text-align: start;
28
+ }
29
+ }
@@ -0,0 +1,123 @@
1
+ @import 'grid_layout';
2
+
3
+ .gem-c-image-card {
4
+ // if this extends grid-row a margin-bottom can't
5
+ // be applied as the extend overrides it
6
+ @extend %contain-floats;
7
+ margin: 0 (-$gutter-half) $gutter (-$gutter-half);
8
+ position: relative;
9
+ }
10
+
11
+ .gem-c-image-card__image-wrapper {
12
+ @include grid-column( 1 / 3, mobile );
13
+
14
+ @include media(tablet) {
15
+ margin-bottom: $gutter-one-third;
16
+ }
17
+
18
+ + .gem-c-image-card__text-wrapper {
19
+ @include media(mobile) {
20
+ padding-left: 0;
21
+ }
22
+ }
23
+ }
24
+
25
+ .gem-c-image-card__image {
26
+ display: block;
27
+ max-width: 100%;
28
+ }
29
+
30
+ .gem-c-image-card__text-wrapper {
31
+ @include grid-column( 2 / 3, mobile );
32
+ }
33
+
34
+ .gem-c-image-card__title {
35
+ @include bold-19;
36
+ }
37
+
38
+ .gem-c-image-card__title-link {
39
+ // the after element extends the link to cover the image, removing the
40
+ // need for a duplicate link. Other elements apart from the image are given
41
+ // position relative and a higher z-index to put them above the after element
42
+ &:after {
43
+ content: "";
44
+ position: absolute;
45
+ z-index: 1;
46
+ top: 0;
47
+ left: $gutter-half;
48
+ right: $gutter-half;
49
+ height: 100%;
50
+ $ie-background: rgba(255, 255, 255, 0);
51
+ background: $ie-background; // because internet explorer
52
+ }
53
+ }
54
+
55
+ .gem-c-image-card__context,
56
+ .gem-c-image-card__description {
57
+ position: relative;
58
+ z-index: 2;
59
+ }
60
+
61
+ .gem-c-image-card__context {
62
+ @include core-14;
63
+ color: $grey-1;
64
+ }
65
+
66
+ .gem-c-image-card__description {
67
+ padding-top: $gutter-one-quarter;
68
+ }
69
+
70
+ .gem-c-image-card__list {
71
+ position: relative;
72
+ z-index: 2;
73
+ padding: $gutter-one-quarter 0 0 0;
74
+ margin: 0;
75
+ list-style: none;
76
+
77
+ &.gem-c-image-card__list--indented {
78
+ padding-left: $gutter-half;
79
+
80
+ .gem-c-image-card__list-item {
81
+ position: relative;
82
+
83
+ &:before {
84
+ content: "-";
85
+ position: absolute;
86
+ left: -$gutter-half;
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ .gem-c-image-card--large {
93
+ .gem-c-image-card__image-wrapper {
94
+ @include grid-column( 2 / 3, tablet );
95
+ }
96
+
97
+ .gem-c-image-card__text-wrapper {
98
+ @include grid-column( 1 / 3, tablet );
99
+ }
100
+
101
+ .gem-c-image-card__image-wrapper {
102
+ @include media(mobile) {
103
+ margin-bottom: $gutter-one-third;
104
+ }
105
+ }
106
+
107
+ .gem-c-image-card__image-wrapper,
108
+ .gem-c-image-card__text-wrapper {
109
+ @include media(mobile) {
110
+ float: none;
111
+ width: auto;
112
+ }
113
+ }
114
+
115
+ .gem-c-image-card__title {
116
+ @include bold-24;
117
+ padding-bottom: $gutter-one-third;
118
+ }
119
+
120
+ .gem-c-image-card__description {
121
+ @include core-19;
122
+ }
123
+ }
@@ -0,0 +1,33 @@
1
+ .gem-c-notice {
2
+ clear: both;
3
+ padding: $gutter-two-thirds;
4
+ border: 2px solid $govuk-blue;
5
+
6
+ @include media(mobile) {
7
+ padding: $gutter-half;
8
+ }
9
+
10
+ .govuk-govspeak {
11
+ p:last-child {
12
+ margin-bottom: 0;
13
+ }
14
+ }
15
+ }
16
+
17
+ .gem-c-notice--bottom-margin {
18
+ @include responsive-bottom-margin;
19
+ }
20
+
21
+ .gem-c-notice__title {
22
+ @include bold-27;
23
+ margin-bottom: $gutter-one-third;
24
+
25
+ &:last-child {
26
+ margin-bottom: 0;
27
+ }
28
+ }
29
+
30
+ .gem-c-notice__description {
31
+ @include core-19;
32
+ margin-bottom: 0;
33
+ }