govuk-components 1.1.0 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6f8009727bd1da1e578c97b2b2dfe48b6e86a97f0e7854e16edbb3bf7991154
4
- data.tar.gz: a0442f769f7fb611a083b34707210fa11a499708d64c9b9aab0081218262e7f2
3
+ metadata.gz: 93a84a3c93600e18249b9cb15f53ef3abc0d04cfc57f47790215af5ed24526c6
4
+ data.tar.gz: 810056d2494f56058ba9be66d36a952e31780cda1ba4e8a239d80f421dc2cfbe
5
5
  SHA512:
6
- metadata.gz: d4cacf374531c0c9cd3f41750cc1e640f543fd4eb21b587690fa653fb683a6a29c515acd1938b24ceeee62b32b772a5becc6fb856102260608ead6f31f5a482c
7
- data.tar.gz: 18846eb057b53d9ed93ef5bffe9c3d676a46c9522997d316ac6054fb7348adef0e064a86210a8f9755942a7a5eeeb6556db4263b2aea01b53caeae5d75c864a9
6
+ metadata.gz: 22ce8154eb8c60b69bd34fde51e32fa651cf19e816523115d3b564f2bfed1921a35ae8205781b5c53e943203db2dfd48d64316db9984306e582127f42d9da132
7
+ data.tar.gz: 75fb99c2da5e8644abd9dcc1d03bdc1b83d902a4271e3b71cde0f8151179abcee6fbf4a49d0f08f4484249966354768c801ecbf75384bfb943dcb58e61eaef8d
data/README.md CHANGED
@@ -16,6 +16,7 @@ This gem provides a suite of reusable components for the [GOV.UK Design System](
16
16
  | [Accordion](app/components/govuk_component/accordion.rb) | `govuk_accordion` |
17
17
  | [Back link](app/components/govuk_component/back_link.rb) | `govuk_back_link` |
18
18
  | [Breadcrumbs](app/components/govuk_component/breadcrumbs.rb) | `govuk_breadcrumbs` |
19
+ | [Cookie banner](app/components/govuk_component/cookie_banner.rb) | `govuk_cookie_banner` |
19
20
  | [Details](app/components/govuk_component/details.rb) | `govuk_details` |
20
21
  | [Footer](app/components/govuk_component/footer.rb) | `govuk_footer` |
21
22
  | [Header](app/components/govuk_component/header.rb) | `govuk_header` |
@@ -0,0 +1,21 @@
1
+ <%= tag.div(class: classes, role: "region", aria: { label: aria_label }, **html_attributes) do %>
2
+ <div class="govuk-cookie-banner__message govuk-width-container">
3
+ <div class="govuk-grid-row">
4
+ <div class="govuk-grid-column-two-thirds">
5
+ <% if title.present? %>
6
+ <h2 class="govuk-cookie-banner__heading govuk-heading-m">
7
+ <%= title %>
8
+ </h2>
9
+ <% end %>
10
+
11
+ <div class="govuk-cookie-banner__content">
12
+ <%= body %>
13
+ </div>
14
+ </div>
15
+ </div>
16
+
17
+ <div class="govuk-button-group">
18
+ <%= actions %>
19
+ </div>
20
+ </div>
21
+ <% end %>
@@ -0,0 +1,18 @@
1
+ class GovukComponent::CookieBanner < GovukComponent::Base
2
+ with_content_areas :body, :actions
3
+
4
+ attr_accessor :title, :aria_label
5
+
6
+ def initialize(title: nil, aria_label: "Cookie banner", classes: [], html_attributes: {})
7
+ super(classes: classes, html_attributes: html_attributes)
8
+
9
+ @title = title
10
+ @aria_label = aria_label
11
+ end
12
+
13
+ private
14
+
15
+ def default_classes
16
+ %w(govuk-cookie-banner)
17
+ end
18
+ end
@@ -1,4 +1,4 @@
1
- <%= tag.div(class: classes.append(success_class).compact, **html_attributes, role: "region", aria: { labelledby: title_id }, data: data_params) do %>
1
+ <%= tag.div(class: classes.append(success_class).compact, role: "region", aria: { labelledby: title_id }, data: data_params, **html_attributes) do %>
2
2
  <div class="govuk-notification-banner__header">
3
3
  <%= content_tag(title_tag, class: "govuk-notification-banner__title", id: title_id) do %>
4
4
  <%= title %>
@@ -3,6 +3,7 @@ module GovukComponentsHelper
3
3
  govuk_accordion: 'GovukComponent::Accordion',
4
4
  govuk_back_link: 'GovukComponent::BackLink',
5
5
  govuk_breadcrumbs: 'GovukComponent::Breadcrumbs',
6
+ govuk_cookie_banner: 'GovukComponent::CookieBanner',
6
7
  govuk_details: 'GovukComponent::Details',
7
8
  govuk_footer: 'GovukComponent::Footer',
8
9
  govuk_header: 'GovukComponent::Header',
@@ -1,5 +1,5 @@
1
1
  module Govuk
2
2
  module Components
3
- VERSION = '1.1.0'.freeze
3
+ VERSION = '1.1.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DfE developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-23 00:00:00.000000000 Z
11
+ date: 2021-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 2.22.1
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: 2.25.0
36
+ version: 2.26.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 2.22.1
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: 2.25.0
46
+ version: 2.26.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: capybara
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -160,6 +160,8 @@ files:
160
160
  - app/components/govuk_component/base.rb
161
161
  - app/components/govuk_component/breadcrumbs.html.erb
162
162
  - app/components/govuk_component/breadcrumbs.rb
163
+ - app/components/govuk_component/cookie_banner.html.erb
164
+ - app/components/govuk_component/cookie_banner.rb
163
165
  - app/components/govuk_component/details.html.erb
164
166
  - app/components/govuk_component/details.rb
165
167
  - app/components/govuk_component/footer.html.erb