govuk_publishing_components 52.0.0 → 52.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 198f8ac365179c47560311c0629f3ff7e8e698cc3dbc96d2e7b400e8fc090a0d
4
- data.tar.gz: dee1f0c019a773b93009f9028ae39e9f4c9cb8c3d344df15e89c04a9021dae50
3
+ metadata.gz: 65d358986b5bbd3ce3b30799d7cf7222b529b5c423633090273f08edb53b0bba
4
+ data.tar.gz: f9552e528d85ae9ba87045e65527e82a47eb13847713f8d8a7d6f2557e0e8328
5
5
  SHA512:
6
- metadata.gz: ee48bbc9936311ebceb2c168f63ac94e13345b59507e1cf9a7268c5a752a1f7898a5a985e4cf9e606bb186f6b4cce4b830f7ef1fc9cf4cdbc593160f9cbff7db
7
- data.tar.gz: 8468d0dd135db6de987149366fb6388b07603c2e8cc9248f2ab2818d17136e2af361c28a871bd17bf5cf97433fefafd1828a70b4ceaba1b20c2879b9f132d12c
6
+ metadata.gz: f6d4f5ed822cef7d67afcf398939c6e900bc1da3c35aa2701832680363aede5b7a8e882c64d744c771e1dbf9de683a4412353c7e7fdead23a6b4243425cf18f1
7
+ data.tar.gz: 52242c912e87ea2e6f7f0f6a4ed8ca91ea67b25ad485d0065b87659b44fd03ef3cd66ac58297a6e6ea1df082aa3e45c929f5c25bce323e0ffd9543f27aa74618
@@ -6,3 +6,15 @@
6
6
  break-inside: avoid;
7
7
  }
8
8
  }
9
+
10
+ .gem-c-inset-text {
11
+ padding-top: govuk-spacing(4);
12
+
13
+ .govuk-inset-text {
14
+ margin-top: 0;
15
+ }
16
+
17
+ @include govuk-media-query($from: tablet) {
18
+ padding-top: govuk-spacing(6);
19
+ }
20
+ }
@@ -5,13 +5,15 @@
5
5
  local_assigns[:margin_bottom] ||= 6
6
6
 
7
7
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
8
- component_helper.add_class("gem-c-inset-text govuk-inset-text gem-c-force-print-link-styles-within")
8
+ component_helper.add_class("gem-c-inset-text gem-c-force-print-link-styles-within")
9
9
  component_helper.set_id(id)
10
10
  %>
11
11
  <%= tag.div(**component_helper.all_attributes) do %>
12
- <% if defined? text %>
13
- <%= text %>
14
- <% elsif block_given? %>
15
- <%= yield %>
16
- <% end %>
12
+ <div class="govuk-inset-text">
13
+ <% if defined? text %>
14
+ <%= text %>
15
+ <% elsif block_given? %>
16
+ <%= yield %>
17
+ <% end %>
18
+ </div>
17
19
  <% end %>
@@ -9,6 +9,7 @@
9
9
  sortable ||= false
10
10
  filterable ||= false
11
11
  label ||= t("components.table.filter_label")
12
+ margin_bottom ||= nil
12
13
 
13
14
  table_id = "table-id-#{SecureRandom.hex(4)}"
14
15
  filter_count_id = "filter-count-id-#{SecureRandom.hex(4)}"
@@ -16,10 +17,11 @@
16
17
 
17
18
  <% @table = capture do %>
18
19
  <%= GovukPublishingComponents::AppHelpers::TableHelper.helper(self, caption, {
19
- sortable: sortable,
20
- filterable: filterable,
21
- caption_classes: caption_classes,
22
- table_id: table_id
20
+ sortable:,
21
+ filterable:,
22
+ caption_classes:,
23
+ table_id:,
24
+ margin_bottom:,
23
25
  }) do |t| %>
24
26
 
25
27
  <% if head.any? %>
@@ -140,7 +140,7 @@ examples:
140
140
  - text: £80
141
141
  format: numeric
142
142
  with_filter:
143
- description: This option allows table rows to be filtered by user input. Since this filtering is implemented client-side the filter section is not displayed by default but displays only when JavaScript is enabled. The label for the input field can be set when the coponent is rendered via the `label` key. if this is not set a fallback value will display.
143
+ description: This option allows table rows to be filtered by user input. Since this filtering is implemented client-side the filter section is not displayed by default but displays only when JavaScript is enabled. The label for the input field can be set when the component is rendered via the `label` key. If this is not set a fallback value will display.
144
144
  data:
145
145
  filterable: true
146
146
  label: Filter months
@@ -169,3 +169,34 @@ examples:
169
169
  format: numeric
170
170
  - text: £125
171
171
  format: numeric
172
+ with_custom_margin_bottom:
173
+ description: 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). By default, this component has a margin bottom of `30px`, as determined by the design system styles.
174
+ data:
175
+ margin_bottom: 0
176
+ filterable: true
177
+ label: Filter months
178
+ head:
179
+ - text: Month you apply
180
+ - text: Rate for bicycles
181
+ format: numeric
182
+ - text: Rate for vehicles
183
+ format: numeric
184
+ rows:
185
+ -
186
+ - text: January
187
+ - text: £85
188
+ format: numeric
189
+ - text: £95
190
+ format: numeric
191
+ -
192
+ - text: February
193
+ - text: £75
194
+ format: numeric
195
+ - text: £55
196
+ format: numeric
197
+ -
198
+ - text: March
199
+ - text: £165
200
+ format: numeric
201
+ - text: £125
202
+ format: numeric
@@ -8,6 +8,7 @@ module GovukPublishingComponents
8
8
 
9
9
  classes = %w[gem-c-table govuk-table]
10
10
  classes << "govuk-table--sortable" if opt[:sortable]
11
+ classes << "govuk-!-margin-bottom-#{opt[:margin_bottom]}" if [*0..9].include?(opt[:margin_bottom])
11
12
 
12
13
  caption_classes = %w[govuk-table__caption]
13
14
  caption_classes << opt[:caption_classes] if opt[:caption_classes]
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "52.0.0".freeze
2
+ VERSION = "52.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 52.0.0
4
+ version: 52.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-20 00:00:00.000000000 Z
10
+ date: 2025-02-21 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: govuk_app_config
@@ -1997,7 +1997,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1997
1997
  - !ruby/object:Gem::Version
1998
1998
  version: '0'
1999
1999
  requirements: []
2000
- rubygems_version: 3.6.4
2000
+ rubygems_version: 3.6.5
2001
2001
  specification_version: 4
2002
2002
  summary: A gem to document components in GOV.UK frontend applications
2003
2003
  test_files: []