govuk_publishing_components 21.41.4 → 21.42.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/stylesheets/govuk_publishing_components/components/_accordion.scss +10 -0
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +14 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 24829cd84e2ddb267b818d1d885391681240e46cac461922e7389dc173c797c6
|
|
4
|
+
data.tar.gz: 1e07e232b562ebfc957807cc4c08a28ce29d3d7b4ae5c31ad00283f5ce30f651
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a59631eac2c60297c23f7fac1b136baa6d4ed48a75d03aace3ddd5b9eba136d39c772df2602bb88d7336824e581137acf8a3a78e273a1b681241183eb9155f43
|
|
7
|
+
data.tar.gz: 45bfd361a06cfcff26f939f5469c6e6f1c9790059fdb63ae3556b731308e1a6ae86e60be28c01c94b67ed3fa7dfaea0803dd737607023f59ebd8876b11aec84f
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
@import "govuk/components/accordion/accordion";
|
|
2
2
|
|
|
3
|
+
.gem-c-accordion {
|
|
4
|
+
.govuk-accordion__section-heading {
|
|
5
|
+
// this is a temporary addition to fix the line height when it
|
|
6
|
+
// is being overridden by styles from govuk-template in collections
|
|
7
|
+
@include govuk-media-query($until: desktop) {
|
|
8
|
+
@include govuk-font(24, $weight: bold, $line-height: 1.6);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
.govuk-accordion--condensed {
|
|
4
14
|
.govuk-accordion__section-button {
|
|
5
15
|
@include govuk-media-query($from: tablet) {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
<%
|
|
2
|
+
local_assigns[:margin_bottom] ||= 6
|
|
2
3
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
3
4
|
|
|
4
5
|
id ||= "default-id-#{SecureRandom.hex(4)}"
|
|
5
6
|
items ||= []
|
|
6
7
|
condensed ||= false
|
|
8
|
+
|
|
7
9
|
accordion_classes = %w(gem-c-accordion govuk-accordion)
|
|
8
10
|
accordion_classes << 'govuk-accordion--condensed' if condensed
|
|
11
|
+
accordion_classes << (shared_helper.get_margin_bottom)
|
|
9
12
|
|
|
10
13
|
data_attributes ||= {}
|
|
11
14
|
data_attributes[:module] = 'govuk-accordion'
|
|
@@ -233,6 +233,20 @@ examples:
|
|
|
233
233
|
text: "How people read"
|
|
234
234
|
content:
|
|
235
235
|
html: "<p class='govuk-body'>This is the content for How people read.</p>"
|
|
236
|
+
with_margin_bottom:
|
|
237
|
+
description: |
|
|
238
|
+
The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of 30px.
|
|
239
|
+
data:
|
|
240
|
+
margin_bottom: 0
|
|
241
|
+
items:
|
|
242
|
+
- heading:
|
|
243
|
+
text: "Writing well for the web"
|
|
244
|
+
content:
|
|
245
|
+
html: "<p class='govuk-body'>This is the content for Writing well for the web.</p>"
|
|
246
|
+
- heading:
|
|
247
|
+
text: "Writing well for specialists"
|
|
248
|
+
content:
|
|
249
|
+
html: "<p class='govuk-body'>This is the content for Writing well for specialists.</p>"
|
|
236
250
|
with_section_open:
|
|
237
251
|
description: |
|
|
238
252
|
Adding `expanded: true` to the item will mean the section will default to being open, rather than closed. Once a user has opened or closed a section, the state of each section will be remembered - this can override a section's default.
|
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: 21.
|
|
4
|
+
version: 21.42.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: 2020-04-
|
|
11
|
+
date: 2020-04-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: gds-api-adapters
|