govuk_publishing_components 8.2.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,49 @@
1
+ // Govspeak contact
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/contact
3
+ //
4
+ // Support:
5
+ // - alphagov/whitehall: ✔︎
6
+ // - alphagov/govspeak: ✔︎
7
+
8
+ .gem-c-govspeak {
9
+ // .address is used by the `$A` markdown pattern
10
+ .address,
11
+ .contact {
12
+ border-left: 1px solid $border-colour;
13
+ padding-left: $gutter-half;
14
+ margin-bottom: $gutter;
15
+ margin-top: $gutter;
16
+ }
17
+
18
+ .contact {
19
+ @extend %contain-floats;
20
+ position: relative;
21
+
22
+ .content {
23
+ float: none;
24
+ width: $full-width;
25
+
26
+ h3 {
27
+ @include bold-19;
28
+ margin-bottom: 5px;
29
+ }
30
+
31
+ .email-url-number {
32
+ .email {
33
+ word-wrap: break-word;
34
+ }
35
+
36
+ span {
37
+ display: block;
38
+ }
39
+ }
40
+
41
+ .comments {
42
+ @include core-16;
43
+ @include media(tablet) {
44
+ margin-bottom: 0;
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,25 @@
1
+ // Govspeak example callout
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/example
3
+ //
4
+ // Support:
5
+ // - alphagov/whitehall: ✔︎
6
+ // - alphagov/govspeak: ✔︎
7
+
8
+ .gem-c-govspeak {
9
+ .example {
10
+ border-left: 1em solid $panel-colour;
11
+ padding: 1em 0 1em 1em;
12
+ margin: 2em 0;
13
+
14
+ // Remove margin from the last element
15
+ p:last-child,
16
+ ul:last-child,
17
+ ol:last-child {
18
+ margin-bottom: 0;
19
+ }
20
+
21
+ strong {
22
+ display: block;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,27 @@
1
+ // Govspeak footnotes callout
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/footnotes
3
+ //
4
+ // Support:
5
+ //
6
+ // This appears to be built into kramdown, we're just applying styling to it.
7
+ // https://kramdown.gettalong.org/syntax.html#footnotes
8
+ //
9
+ // - alphagov/whitehall: ✔︎
10
+ // - alphagov/govspeak: ✔︎
11
+
12
+ .gem-c-govspeak {
13
+ .footnotes {
14
+ border-top: 1px solid $border-colour;
15
+ margin-top: $gutter;
16
+ padding-top: $gutter-one-third;
17
+
18
+ ol {
19
+ margin-top: 0;
20
+ padding-top: 0;
21
+
22
+ li p {
23
+ margin: 10px 0;
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,22 @@
1
+ // Govspeak fractions
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/image_fractions
3
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/text_fractions
4
+ //
5
+ // Support:
6
+ // - alphagov/whitehall: ✔︎
7
+ // - alphagov/govspeak: ✘
8
+
9
+ .gem-c-govspeak {
10
+ .fraction {
11
+ sup,
12
+ sub {
13
+ @include core-14;
14
+ }
15
+
16
+ img {
17
+ display: inline-block;
18
+ width: auto;
19
+ margin: 0 0 -5px;
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,42 @@
1
+ $highlight-answer-bg-color: #28a197;
2
+ $highlight-answer-color: #fff;
3
+
4
+ .gem-c-govspeak .highlight-answer {
5
+ background-color: $highlight-answer-bg-color;
6
+ color: $highlight-answer-color;
7
+ text-align: center;
8
+ padding: 1.75em 0.75em 1.25em;
9
+ margin: 0 -1em 1em;
10
+
11
+ p {
12
+ @include bold-24;
13
+ color: $highlight-answer-color;
14
+
15
+ em {
16
+ @include bold-80;
17
+ display: block;
18
+ padding-top: 0.1em;
19
+ color: $highlight-answer-color;
20
+ }
21
+ }
22
+
23
+ p:last-child {
24
+ margin-bottom: 0;
25
+ }
26
+
27
+ @include media-down(mobile) {
28
+ margin: 0 0 1em;
29
+ @include core-48;
30
+
31
+ p {
32
+ font-size: 1em;
33
+ line-height: inherit;
34
+
35
+ em {
36
+ font-size: 1em;
37
+ padding-top: 0;
38
+ display: inline;
39
+ }
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,32 @@
1
+ // Govspeak images
2
+ //
3
+ // Support:
4
+ // - alphagov/whitehall: ✔︎
5
+ // - alphagov/govspeak: ✔︎
6
+
7
+ .gem-c-govspeak {
8
+ img {
9
+ width: auto;
10
+ height: auto;
11
+ max-width: $full-width;
12
+ }
13
+
14
+ figure {
15
+ width: $full-width;
16
+ clear: both;
17
+ overflow: hidden;
18
+ padding: $gutter-one-third 0 0;
19
+
20
+ img {
21
+ display: inline;
22
+ text-align: center;
23
+ width: auto;
24
+ height: auto;
25
+ max-width: $full-width;
26
+ }
27
+
28
+ figcaption {
29
+ @include core-14;
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,22 @@
1
+ // Govspeak information callout
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/information_callout
3
+ //
4
+ // Support:
5
+ //
6
+ // - alphagov/whitehall: ✔︎
7
+ // - alphagov/govspeak: ✔︎
8
+
9
+ .gem-c-govspeak {
10
+ .info-notice {
11
+ border-left: 1em solid $panel-colour;
12
+ padding: 1em 0 1em 1em;
13
+ margin: 2em 0;
14
+
15
+ // Remove margin from the last element
16
+ p:last-child,
17
+ ul:last-child,
18
+ ol:last-child {
19
+ margin-bottom: 0;
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,26 @@
1
+ // Govspeak legislative list
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/legislative_lists
3
+
4
+ // Support:
5
+ // - alphagov/whitehall: ✔︎
6
+ // - alphagov/govspeak: ✔︎
7
+
8
+ .gem-c-govspeak {
9
+ .legislative-list {
10
+ list-style: none;
11
+ margin: 5px 0;
12
+
13
+ li {
14
+ margin: 5px 0;
15
+ }
16
+
17
+ p {
18
+ margin: 20px 0;
19
+ }
20
+
21
+ ol {
22
+ margin: 10px 0 10px $gutter;
23
+ list-style: none;
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,15 @@
1
+ // Govspeak media player
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/with_youtube_embed
3
+ //
4
+ // Support:
5
+ // - alphagov/whitehall: ✔︎
6
+ // - alphagov/govspeak: ✔︎
7
+
8
+ .gem-c-govspeak {
9
+ // Video player styles from frontend toolkit
10
+ @import "design-patterns/media-player";
11
+
12
+ .media-player {
13
+ @include media-player;
14
+ }
15
+ }
@@ -0,0 +1,29 @@
1
+ .gem-c-govspeak .place {
2
+ margin: 1.5em 0;
3
+ border-bottom: solid 1px $border-colour;
4
+ padding-bottom: 1.5em;
5
+
6
+ .address {
7
+ margin: 0;
8
+ padding: 0;
9
+ width: auto;
10
+ display: block;
11
+ }
12
+
13
+ .url {
14
+ overflow: hidden;
15
+ text-overflow: ellipsis;
16
+ }
17
+
18
+ .additional-information {
19
+ @include core-16;
20
+
21
+ p {
22
+ margin: 0.25em 0;
23
+ }
24
+ }
25
+
26
+ @include media-down(mobile) {
27
+ margin: 0.75em 0;
28
+ }
29
+ }
@@ -0,0 +1,29 @@
1
+ // Govspeak statistic headline
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/statistic_headlines
3
+ //
4
+ // Support:
5
+ // - alphagov/whitehall: ✔︎
6
+ // - alphagov/govspeak: ✔︎
7
+
8
+ .gem-c-govspeak {
9
+ .stat-headline {
10
+ margin-bottom: $gutter-half;
11
+ margin-top: $gutter-half;
12
+
13
+ @include media(tablet) {
14
+ margin-bottom: $gutter-two-thirds;
15
+ margin-top: $gutter-two-thirds;
16
+ }
17
+
18
+ p {
19
+ @include bold-19;
20
+ margin: 0;
21
+ }
22
+
23
+ em {
24
+ display: block;
25
+ @include bold-80;
26
+ margin: 3px 0 -5px;
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,24 @@
1
+ .gem-c-govspeak .steps {
2
+ padding-left: 0;
3
+ margin-left: 0;
4
+ overflow: hidden;
5
+
6
+ > li {
7
+ background-position: 0 0.87em;
8
+ background-repeat: no-repeat;
9
+ list-style-type: decimal;
10
+ margin-left: 0;
11
+ padding: 0.75em 0 0.75em 2.2em;
12
+
13
+ @for $i from 1 through 14 {
14
+ &:nth-child(#{$i}) {
15
+ background-image: image-url("icon-steps/icon-step-#{$i}.png");
16
+
17
+ @include device-pixel-ratio() {
18
+ background-image: image-url("icon-steps/icon-step-#{$i}-2x.png");
19
+ background-size: 24px 24px;
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,24 @@
1
+ .gem-c-govspeak .summary {
2
+ margin: 0 0 2em;
3
+ padding: 0;
4
+ color: $text-colour;
5
+
6
+ p {
7
+ @include core-19;
8
+ }
9
+
10
+ @include media-down(mobile) {
11
+ margin: 0 0 2em;
12
+ padding: 0;
13
+ }
14
+
15
+ p,
16
+ h2 {
17
+ border: none;
18
+ margin: 0 0.75em 0 0;
19
+ }
20
+
21
+ h2 {
22
+ line-height: 1.35em;
23
+ }
24
+ }
@@ -0,0 +1,38 @@
1
+ // Govspeak tables
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/tables
3
+ //
4
+ // Support:
5
+ // - alphagov/whitehall: ✔︎
6
+ // - alphagov/govspeak: ✔︎
7
+
8
+ .gem-c-govspeak {
9
+ table {
10
+ border-collapse: collapse;
11
+ border-spacing: 0;
12
+ margin: $gutter 0;
13
+ width: $full-width;
14
+ @include core-14;
15
+
16
+ caption {
17
+ text-align: left;
18
+ margin-bottom: 0.5em;
19
+ }
20
+
21
+ th,
22
+ td {
23
+ vertical-align: top;
24
+ padding: $gutter-one-third $gutter-one-third $gutter-one-third 0;
25
+ border-bottom: solid 1px $border-colour;
26
+ }
27
+
28
+ th {
29
+ text-align: left;
30
+ color: $black;
31
+ @include bold-14;
32
+ }
33
+
34
+ td small {
35
+ font-size: 1em;
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,224 @@
1
+ // Govspeak typography
2
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/heading_levels
3
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/lists
4
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/nested_lists
5
+ // https://govuk-static.herokuapp.com/component-guide/govspeak/blockquote
6
+ //
7
+ // Support:
8
+ // - alphagov/whitehall: ✔︎
9
+ // - alphagov/govspeak: ✔︎
10
+
11
+ .gem-c-govspeak {
12
+ ol,
13
+ ul,
14
+ p {
15
+ @include core-19;
16
+ margin-top: $gutter-half;
17
+ margin-bottom: $gutter-half;
18
+
19
+ @include media(tablet) {
20
+ margin-top: $gutter-two-thirds;
21
+ margin-bottom: $gutter-two-thirds;
22
+ }
23
+ }
24
+
25
+ // Headings
26
+
27
+ h2 {
28
+ @include bold-27;
29
+ margin-top: $gutter;
30
+
31
+ @include media(desktop) {
32
+ margin-top: $gutter * 1.5;
33
+ }
34
+ }
35
+
36
+ h3 {
37
+ @include bold-19;
38
+ margin-top: $gutter + 5px;
39
+ }
40
+
41
+ h4 {
42
+ @include bold-19;
43
+ margin-top: $gutter + 5px;
44
+ }
45
+
46
+ h4,
47
+ h5,
48
+ h6 {
49
+ @include bold-19;
50
+
51
+ + p {
52
+ margin-top: 5px;
53
+ }
54
+ }
55
+
56
+ h2:first-child,
57
+ h3:first-child,
58
+ h4:first-child,
59
+ p:first-child {
60
+ margin-top: 0;
61
+ }
62
+
63
+ // Links
64
+
65
+ a {
66
+ text-decoration: underline;
67
+ }
68
+
69
+ // Lists
70
+
71
+ ol,
72
+ ul {
73
+ list-style: decimal;
74
+ list-style-position: outside;
75
+ margin-left: $gutter-two-thirds;
76
+
77
+ ul,
78
+ ol {
79
+ margin-top: 0;
80
+ margin-bottom: 0;
81
+ padding: 0;
82
+ }
83
+
84
+ @include ie(7) {
85
+ li {
86
+ margin-left: $gutter;
87
+ }
88
+ }
89
+ }
90
+
91
+ ul {
92
+ list-style: disc;
93
+ list-style-position: outside;
94
+ }
95
+
96
+ li {
97
+ margin-bottom: 5px;
98
+
99
+ p {
100
+ margin: 0;
101
+ padding: 0;
102
+ }
103
+
104
+ p + p,
105
+ p + ul,
106
+ p + ol,
107
+ ul + p,
108
+ ul + ol,
109
+ ol + p,
110
+ ol + ul {
111
+ margin-top: 5px;
112
+ }
113
+ }
114
+
115
+ &.direction-rtl ol,
116
+ &.direction-rtl ul {
117
+ margin-left: 0;
118
+ margin-right: $gutter-two-thirds;
119
+
120
+ ul,
121
+ ol {
122
+ margin-top: 0;
123
+ margin-bottom: 0;
124
+ }
125
+ }
126
+
127
+ // Block quotes
128
+
129
+ blockquote {
130
+ padding: 0 0 0 $gutter-two-thirds;
131
+ margin: 0;
132
+ border: 0;
133
+
134
+ @include media(desktop) {
135
+ margin: 0 0 0 (-$gutter);
136
+ }
137
+
138
+ p {
139
+ padding-left: $gutter-half;
140
+
141
+ @include media(tablet) {
142
+ padding-left: $gutter;
143
+ }
144
+
145
+ &:before {
146
+ content: "\201C";
147
+ float: left;
148
+ clear: both;
149
+ margin-left: -$gutter-half;
150
+ }
151
+
152
+ &:last-child:after {
153
+ content: "\201D";
154
+ }
155
+ }
156
+ }
157
+
158
+ &.direction-rtl blockquote {
159
+ padding: 0 $gutter-two-thirds 0 0;
160
+
161
+ @include media(desktop) {
162
+ margin: 0 (-$gutter) 0 0;
163
+ }
164
+
165
+ p {
166
+ padding-right: $gutter-half;
167
+ padding-left: 0;
168
+
169
+ @include media(tablet) {
170
+ padding-right: $gutter;
171
+ padding-left: 0;
172
+ }
173
+
174
+ &:before {
175
+ content: "\201D";
176
+ float: right;
177
+ margin-right: -$gutter-half;
178
+ margin-left: 0;
179
+ }
180
+
181
+ &:last-child:after {
182
+ content: "\201C";
183
+ }
184
+ }
185
+ }
186
+
187
+ // Text styles
188
+
189
+ strong {
190
+ font-weight: 400;
191
+ }
192
+
193
+ // rich-govspeak is a modifier for the govspeak component
194
+ // that allows bold text. Used by the highway code manual.
195
+ &.rich-govspeak {
196
+ strong {
197
+ font-weight: bold;
198
+ }
199
+ }
200
+
201
+ em,
202
+ i {
203
+ font-style: normal;
204
+ font-weight: inherit;
205
+ }
206
+
207
+ sup {
208
+ font-size: 0.8em;
209
+ line-height: 0.7em;
210
+ vertical-align: super;
211
+ }
212
+
213
+ abbr {
214
+ cursor: help;
215
+ }
216
+
217
+ // Horizontal Rule
218
+
219
+ hr {
220
+ margin-top: $gutter - 1px;
221
+ margin-bottom: $gutter;
222
+ border-top: 1px solid $border-colour;
223
+ }
224
+ }