govuk_publishing_components 12.0.1 → 12.1.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 (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/application.js +0 -1
  3. data/app/assets/javascripts/{component_guide/no_slimmer.js → govuk_publishing_components/dependencies.js} +2 -2
  4. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +2 -1
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +6 -3
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +1 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss +29 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -0
  9. data/app/models/govuk_publishing_components/component_doc.rb +0 -4
  10. data/app/views/govuk_publishing_components/component_guide/show.html.erb +0 -6
  11. data/app/views/govuk_publishing_components/components/_admin_analytics.html.erb +7 -0
  12. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +4 -4
  13. data/app/views/govuk_publishing_components/components/docs/admin_analytics.yml +2 -1
  14. data/app/views/govuk_publishing_components/components/docs/button.yml +0 -6
  15. data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +0 -1
  16. data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +14 -11
  17. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +0 -1
  18. data/app/views/govuk_publishing_components/components/docs/skip_link.yml +0 -1
  19. data/app/views/govuk_publishing_components/components/docs/tabs.yml +0 -1
  20. data/app/views/layouts/govuk_publishing_components/application.html.erb +1 -1
  21. data/config/initializers/assets.rb +0 -6
  22. data/lib/govuk_publishing_components/version.rb +1 -1
  23. metadata +3 -5
  24. data/app/assets/javascripts/govuk_publishing_components/admin_scripts.js +0 -2
  25. data/app/assets/stylesheets/govuk_publishing_components/admin_styles.scss +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7e628f695d27fab28cdd1c5f3ccd9f4cc64072f74d99632161415be96e071f7
4
- data.tar.gz: f149159545b6d352235327dd5e1a07c9871085aed4c6eac8daec15422dd868ca
3
+ metadata.gz: 72fafab7cf3f7469c29c69b902693f7de941fae8628e74bf436552f442c6120c
4
+ data.tar.gz: b9705621014e8d577e223fdcad143187997e6bdad1d94d23a96817a15f7d3cfb
5
5
  SHA512:
6
- metadata.gz: ce62ca884692de80d481d60233ff466647d93999fb212c11d0315ca1efc1ef6febd7861dd84a57fb98d003a93ccb953da76a40342d9f7d92786fd21470b90966
7
- data.tar.gz: 12db548d533afd3a89629d351840613cb4e88e46c2492bfcb6656450d4937153219a39c977f85f64e95bf2e57cf4c83e3313e370ebedef35e4229267b98b9783
6
+ metadata.gz: c11f346224e358f56ae9d6bc924aae648a3017cb12ae06ecf518b540d343bd644c334d693b898675ef24384dded15471c641d3426ca39fb0990df10a04488f2d
7
+ data.tar.gz: 94e87dcc0493b6dd93848e0ef15d9c5c645f54d4422fd72c0892007280b7532e31a16343c61d0562f50b3eb4c440be9001c0da1d83952cc6e323d07dc1a97436
@@ -1,3 +1,2 @@
1
- //= require ./no_slimmer
2
1
  //= require_tree ./vendor
3
2
  //= require_tree .
@@ -1,5 +1,5 @@
1
- // This adds in javascript that initialiases components and dependencies
2
- // that would normally be provided by slimmer
1
+ // This adds in javascript that initialises components and dependencies
2
+ // that are provided by Slimmer in public frontend applications.
3
3
  //= require jquery/dist/jquery
4
4
  //= require govuk/modules
5
5
 
@@ -1,6 +1,5 @@
1
1
  // Include all of the GOV.UK Frontend styles. This includes fonts, and individual components.
2
2
  @import "components/helpers/govuk-frontend-settings";
3
- @import "govuk-frontend/all";
4
3
 
5
4
  // This is the file that the application needs to include in order to use
6
5
  // the components.
@@ -36,6 +35,7 @@
36
35
  @import "components/inverse-header";
37
36
  @import "components/label";
38
37
  @import "components/layout-footer";
38
+ @import "components/layout-for-admin";
39
39
  @import "components/layout-header";
40
40
  @import "components/lead-paragraph";
41
41
  @import "components/metadata";
@@ -59,5 +59,6 @@
59
59
  @import "components/table";
60
60
  @import "components/taxonomy-list";
61
61
  @import "components/taxonomy-navigation";
62
+ @import "components/textarea";
62
63
  @import "components/title";
63
64
  @import "components/translation-nav";
@@ -45,7 +45,8 @@ $gem-destructive-button-border-colour: govuk-colour("black");
45
45
 
46
46
  &:link,
47
47
  &:visited,
48
- &:active {
48
+ &:active,
49
+ &:focus {
49
50
  color: $gem-secondary-button-colour;
50
51
  background-color: $gem-secondary-button-background-colour;
51
52
  text-decoration: none;
@@ -76,7 +77,8 @@ $gem-destructive-button-border-colour: govuk-colour("black");
76
77
 
77
78
  &:link,
78
79
  &:visited,
79
- &:active {
80
+ &:active,
81
+ &:focus {
80
82
  color: $gem-quiet-button-colour;
81
83
  background-color: $gem-secondary-button-background-colour;
82
84
  text-decoration: none;
@@ -104,7 +106,8 @@ $gem-destructive-button-border-colour: govuk-colour("black");
104
106
 
105
107
  &:link,
106
108
  &:visited,
107
- &:active {
109
+ &:active,
110
+ &:focus {
108
111
  background-color: $gem-destructive-button-background-colour;
109
112
  }
110
113
 
@@ -2,6 +2,7 @@
2
2
  color: $gem-text-colour;
3
3
  padding: $gem-spacing-scale-3;
4
4
  border: $gem-border-width-mobile solid $gem-error-colour;
5
+ margin-bottom: $gem-spacing-scale-4;
5
6
 
6
7
  @include media(tablet) {
7
8
  padding: $gem-spacing-scale-4;
@@ -1 +1,29 @@
1
- // This component relies on styles from GOV.UK Frontend
1
+ @import "helpers/govuk-frontend-settings";
2
+ @import "govuk-frontend/core/template";
3
+ @import "govuk-frontend/objects/width-container";
4
+
5
+ .gem-c-layout-for-admin {
6
+ // .govuk-main-wrapper
7
+ @import "govuk-frontend/objects/main-wrapper";
8
+
9
+ // .govuk-link
10
+ @import "govuk-frontend/core/links";
11
+
12
+ // .govuk-list
13
+ @import "govuk-frontend/core/lists";
14
+
15
+ // .govuk-section-break
16
+ @import "govuk-frontend/core/section-break";
17
+
18
+ // .govuk-heading
19
+ @import "govuk-frontend/core/typography";
20
+
21
+ // .govuk-grid-column-two-thirds
22
+ @import "govuk-frontend/objects/grid";
23
+
24
+ // .govuk-visually-hidden
25
+ @import "govuk-frontend/utilities/visually-hidden";
26
+
27
+ // .govuk-!-margin-bottom-3, etc
28
+ @import "govuk-frontend/overrides/spacing";
29
+ }
@@ -1,5 +1,6 @@
1
1
  @import "helpers/govuk-frontend-settings";
2
2
  @import "govuk-frontend/components/header/header";
3
+ @import "govuk-frontend/components/tag/tag";
3
4
 
4
5
  .gem-c-layout-header--production .govuk-header__container {
5
6
  border-bottom-color: govuk-colour("bright-red");
@@ -46,10 +46,6 @@ module GovukPublishingComponents
46
46
  component[:display_preview].nil? ? true : component[:display_preview]
47
47
  end
48
48
 
49
- def part_of_admin_layout?
50
- component[:part_of_admin_layout]
51
- end
52
-
53
49
  def html_body
54
50
  govspeak_to_html(body) if body.present?
55
51
  end
@@ -1,12 +1,6 @@
1
1
  <% content_for :title, "#{@component_doc.name} component" %>
2
2
  <%= render 'govuk_publishing_components/components/title', title: @component_doc.name, context: "Component" %>
3
3
 
4
- <% if @component_doc.part_of_admin_layout? %>
5
- <%= render "govuk_publishing_components/components/notice", title: "Admin layout only" do %>
6
- <p>This component only works inside the <%= link_to "layout for admin component", "/component-guide/layout_for_admin" %>.</p>
7
- <% end %>
8
- <% end %>
9
-
10
4
  <div class="component-show">
11
5
  <div class="govuk-grid-row">
12
6
  <div class="govuk-grid-column-two-thirds">
@@ -1,3 +1,5 @@
1
+ <% user_organisation ||= nil %>
2
+
1
3
  <script class="analytics">
2
4
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3
5
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@@ -6,5 +8,10 @@
6
8
 
7
9
  ga('create', 'UA-26179049-6', '<%= ENV['GOVUK_APP_DOMAIN'] %>');
8
10
  ga('set', 'anonymizeIp', true);
11
+
12
+ <% if user_organisation %>
13
+ ga('set', 'dimension8', "<%= user_organisation.presence || '(not set)' %>");
14
+ <% end %>
15
+
9
16
  ga('send', 'pageview');
10
17
  </script>
@@ -4,20 +4,20 @@
4
4
  <html lang="en" class="govuk-template">
5
5
  <head>
6
6
  <meta charset="utf-8" />
7
- <title><%= browser_title %> GOV.UK <%= product_name %></title>
7
+ <title><%= browser_title %> - GOV.UK <%= product_name %></title>
8
8
  <meta name="robots" content="noindex,nofollow,noimageindex">
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1">
10
10
  <%= csrf_meta_tags %>
11
11
  <%= favicon_link_tag "govuk_publishing_components/favicon-#{environment}.png" %>
12
- <%= stylesheet_link_tag "govuk_publishing_components/admin_styles" %>
12
+ <%= stylesheet_link_tag "application" %>
13
13
  <%= javascript_include_tag "govuk_publishing_components/vendor/modernizr" %>
14
14
  <%= yield :head %>
15
15
  </head>
16
- <body class="govuk-template__body">
16
+ <body class="gem-c-layout-for-admin govuk-template__body">
17
17
  <script>
18
18
  document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
19
19
  </script>
20
20
  <%= yield %>
21
- <%= javascript_include_tag "govuk_publishing_components/admin_scripts" %>
21
+ <%= javascript_include_tag "application" %>
22
22
  </body>
23
23
  </html>
@@ -6,4 +6,5 @@ accessibility_criteria: |
6
6
  display_html: true
7
7
  examples:
8
8
  default:
9
- data: {}
9
+ data:
10
+ user_organisation: "HMRC"
@@ -42,21 +42,15 @@ examples:
42
42
  secondary_button:
43
43
  data:
44
44
  text: "Secondary button"
45
- href: "#"
46
45
  secondary: true
47
- rel: "external"
48
46
  secondary_quiet_button:
49
47
  data:
50
48
  text: "Secondary quiet button"
51
- href: "#"
52
49
  secondary_quiet: true
53
- rel: "external"
54
50
  destructive_button:
55
51
  data:
56
52
  text: "Destructive button"
57
- href: "#"
58
53
  destructive: true
59
- rel: "external"
60
54
  start_now_button_with_info_text:
61
55
  data:
62
56
  text: "Start now"
@@ -1,6 +1,5 @@
1
1
  name: Layout footer (experimental)
2
2
  description: The footer provides copyright, licensing and other information
3
- part_of_admin_layout: true
4
3
  govuk_frontend_components:
5
4
  - footer
6
5
  accessibility_criteria: |
@@ -1,21 +1,24 @@
1
1
  name: Admin layout (experimental)
2
2
  description: A layout to be used by admin applications
3
3
  body: |
4
- This component uses [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend),
5
- part of the GOV.UK Design System.
6
-
7
- It also includes the styles for the other components in this gem, so that you can use
8
- these components as well.
9
-
10
4
  This component is experimental. Breaking changes are likely and we'll not release
11
- major version of the gem for these changes.
5
+ major version of the gem for these changes. Typically you'll use this together
6
+ with the [layout header component](/component-guide/layout_header) and the
7
+ [layout footer component](/component-guide/layout_footer).
8
+
9
+ Because it is an entire HTML document, this component can only be [previewed on a separate page](/admin).
12
10
 
13
- Because it is an entire layout, this component can only be [previewed on a separate page](/admin).
11
+ Inside this component you can use a number of classes provided by govuk-frontend:
14
12
 
15
- Typically you'll use this together with:
13
+ - [Typography classes](https://design-system.service.gov.uk/styles/typography/) like `.govuk-link`, `.govuk-heading`
14
+ - [Layout grid classes](https://design-system.service.gov.uk/styles/layout/) like `.govuk-grid-column-two-thirds`
15
+ - [Spacing classes](https://design-system.service.gov.uk/styles/spacing/) like `.govuk-!-margin-bottom-3`
16
+ - [List classes](https://design-system.service.gov.uk/styles/typography/#lists) like `.govuk-list` and `.govuk-list--bullet`
17
+ - [Section break classes](https://design-system.service.gov.uk/styles/typography/#section-break) like `.govuk-section-break`
18
+ - The `.govuk-visually-hidden` class to hide things
16
19
 
17
- - the [layout header component](/component-guide/layout_header)
18
- - the [layout footer component](/component-guide/layout_footer)
20
+ Be *very* careful when using one of these classes, prefer to use a component
21
+ instead of consuming govuk-frontend directly.
19
22
 
20
23
  display_preview: false
21
24
  display_html: true
@@ -3,7 +3,6 @@ description: The header provides the crown logo, product or service name and nav
3
3
  body: |
4
4
  Requires the specification of the environment (development, integration,
5
5
  staging or production).
6
- part_of_admin_layout: true
7
6
  govuk_frontend_components:
8
7
  - header
9
8
  examples:
@@ -1,6 +1,5 @@
1
1
  name: Skip link (experimental)
2
2
  description: Skip link component helps keyboard-only users skip to the main content on a page
3
- part_of_admin_layout: true
4
3
  govuk_frontend_components:
5
4
  - skip-link
6
5
  accessibility_criteria: |
@@ -1,6 +1,5 @@
1
1
  name: "Tabs (experimental)"
2
2
  description: "The tabs component lets users toggle between related sections of content."
3
- part_of_admin_layout: true
4
3
  body: |
5
4
  This component is based on the [design system tabs component](https://design-system.service.gov.uk/components/tabs/)
6
5
  and is currently experimental. If using this component, please feed back any research findings to the
@@ -25,7 +25,7 @@
25
25
 
26
26
  <%= javascript_include_tag "govuk_publishing_components/vendor/modernizr" %>
27
27
  </head>
28
- <body class="govuk-template__body <%= 'hide-header-and-footer' if @preview %>">
28
+ <body class="gem-c-layout-for-admin govuk-template__body <%= 'hide-header-and-footer' if @preview %>">
29
29
  <script>
30
30
  document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
31
31
  </script>
@@ -1,12 +1,6 @@
1
1
  Rails.application.config.assets.precompile += %w(
2
2
  govuk_publishing_components/vendor/modernizr.js
3
- govuk_publishing_components/admin_scripts.js
4
- govuk_publishing_components/admin_styles.css
5
- govuk_publishing_components/admin_styles_ie8.css
6
3
  govuk_publishing_components/component_guide.css
7
- component_guide/all_components.css
8
- component_guide/all_components_print.css
9
- component_guide/no_slimmer.js
10
4
  govuk_publishing_components/search-button.png
11
5
  govuk_publishing_components/favicon-development.png
12
6
  govuk_publishing_components/favicon-integration.png
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '12.0.1'.freeze
2
+ VERSION = '12.1.0'.freeze
3
3
  end
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: 12.0.1
4
+ version: 12.1.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: 2018-10-11 00:00:00.000000000 Z
11
+ date: 2018-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -304,11 +304,9 @@ files:
304
304
  - app/assets/images/govuk_publishing_components/search-button.png
305
305
  - app/assets/javascripts/component_guide/accessibility-test.js
306
306
  - app/assets/javascripts/component_guide/application.js
307
- - app/assets/javascripts/component_guide/no_slimmer.js
308
307
  - app/assets/javascripts/component_guide/vendor/axe.min.js
309
308
  - app/assets/javascripts/component_guide/vendor/matches-polyfill.min.js
310
309
  - app/assets/javascripts/component_guide/visual-regression.js
311
- - app/assets/javascripts/govuk_publishing_components/admin_scripts.js
312
310
  - app/assets/javascripts/govuk_publishing_components/all_components.js
313
311
  - app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js
314
312
  - app/assets/javascripts/govuk_publishing_components/components/error-summary.js
@@ -316,6 +314,7 @@ files:
316
314
  - app/assets/javascripts/govuk_publishing_components/components/initial-focus.js
317
315
  - app/assets/javascripts/govuk_publishing_components/components/radio.js
318
316
  - app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
317
+ - app/assets/javascripts/govuk_publishing_components/dependencies.js
319
318
  - app/assets/javascripts/govuk_publishing_components/lib/current-location.js
320
319
  - app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
321
320
  - app/assets/javascripts/govuk_publishing_components/lib/toggle.js
@@ -323,7 +322,6 @@ files:
323
322
  - app/assets/stylesheets/component_guide/application.scss
324
323
  - app/assets/stylesheets/govuk_publishing_components/_all_components.scss
325
324
  - app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss
326
- - app/assets/stylesheets/govuk_publishing_components/admin_styles.scss
327
325
  - app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss
328
326
  - app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss
329
327
  - app/assets/stylesheets/govuk_publishing_components/components/_button.scss
@@ -1,2 +0,0 @@
1
- //= require component_guide/no_slimmer
2
- //= require govuk_publishing_components/all_components
@@ -1,10 +0,0 @@
1
- // Include all of the GOV.UK Frontend styles. This includes fonts, and individual components.
2
- @import "govuk_publishing_components/components/helpers/govuk-frontend-settings";
3
- @import "govuk-frontend/all";
4
-
5
- // Include our GOV.UK components
6
- @import "govuk_publishing_components/all_components";
7
-
8
- // Components that are only available inside the admin layout
9
- @import "govuk_publishing_components/components/layout-footer";
10
- @import "govuk_publishing_components/components/layout-header";