govuk_publishing_components 24.17.0 → 24.18.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: c57ef1405fbd96f5987dc24d795eb197a2682388ba0f3ccd4d09e933a5c0e8d2
4
- data.tar.gz: 1213a4f3a3ac27a30ddba5a3f265607a1ff2970a5ee47896759c50986ab16f19
3
+ metadata.gz: 61e7fb8fb022f0732bc0ffdc8626fcce56f7728d3d36027b67ee5a86faef7e63
4
+ data.tar.gz: b4e5fc6caa343d11430891f9dfb4ffc575f45a402e3bafea20af2be76ed04e9b
5
5
  SHA512:
6
- metadata.gz: f769ee68de178a08f866be215ed3c01a9a113c83cc56c120dbb47093659dfeeda6e4ca5f20d576b000125efaff11423a034a4931a138f31fcf95b6fae6c91809
7
- data.tar.gz: 6aa9cd20cc9e8bd4c3a5c377bb863ec02704bbbf8eddf9f28153b102b0c32b001b5f23ca7539a453b67cdc7b551447e762c6ff1a47114a20581e876e1ed083f4
6
+ metadata.gz: 5df1326ef3d37fca25e48f3c7c4abb7aa69b2b787c9c319a1021e7bb2dc912e0ab940abbf3d430207b6b5c8e87d9b35b1cde87921e07471c298c0c16b7a3cab7
7
+ data.tar.gz: 9c4ac815e5f75c77a6239abfe5adf448f39c3e93b8b94e27a084233caa0240672a963420ac8ad8a9671c15bb49ba99a34e0b37f8516268e9b140bc2dd8116e87
data/README.md CHANGED
@@ -1,103 +1,52 @@
1
- GOV.UK Publishing Components
1
+ # GOV.UK Publishing Components
2
+
2
3
  [![status](https://badgen.net/github/status/alphagov/govuk_publishing_components/master)](https://ci.integration.publishing.service.gov.uk/job/govuk_publishing_components/job/master/)
3
4
  [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
4
5
  [![Stylelint Style Guide](https://img.shields.io/badge/code_style-stylelint-brightgreen.svg)](https://github.com/alphagov/stylelint-config-gds/)
5
- =====================
6
6
 
7
- GOV.UK Publishing Components is a Ruby gem to document and distribute components for GOV.UK applications.
7
+ A Ruby gem to document and distribute components for GOV.UK applications. It provides:
8
8
 
9
- It provides:
10
9
  - a shared library of components
11
10
  - helpers to generate component payloads
12
11
  - an application to preview components and provide guidance
12
+ - [GOV.UK Design System](https://design-system.service.gov.uk/) styles and components (via [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend))
13
13
 
14
- Components should be added to this gem if they are required in more than one application, otherwise they should be added to that application.
15
-
16
- ## How to
17
-
18
- - [Install and use this gem](/docs/install-and-use.md)
19
- - [Use a component in your application](/docs/use-components.md)
20
- - [Generate a new component](/docs/generate-a-new-component.md)
21
- - [Develop a component](/docs/develop-component.md)
22
- - [Run the component guide](/docs/run-component-guide.md)
23
- - [Move a component from an application to the gem](/docs/moving-components-upstream-into-this-gem.md)
24
- - [Publish/release a new version of the gem](/docs/publishing-to-rubygems.md)
25
- - [Keep this gem in sync with the Design System](/docs/upgrade-govuk-frontend.md)
26
-
27
- ## Architecture / structure
28
-
29
- ![](https://docs.google.com/drawings/d/e/2PACX-1vRj6JM7cQvngDl3Gr_U9G4xga2gsU7Z-d2qHHQcsBdjsW4WaC9_eQdryBJIS69cLkrY7S0fK9BcrPSF/pub?w=960&h=720)
30
-
31
- [Source](https://docs.google.com/drawings/d/1N8-kbyCN_xOvvshN6d2HnQz5i5Bqed2WIatI3Nj9gNQ/edit)
32
-
33
- There are 2 types of helper classes in this app:
34
-
35
- - [AppHelpers](lib/govuk_publishing_components/app_helpers). Are exposed to the applications using this gem. They should be documented using RDoc.
36
- - [Component Presenters](lib/govuk_publishing_components/presenters). Anything in these classes is only for use within the components. They should be marked `@private`.
14
+ Components should be added to this gem if they are required in more than one application, otherwise they should be added to that application. All components should meet the same standards of browser and assistive technology support described in [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend#browser-and-assistive-technology-support).
37
15
 
38
- ## Relationship with GOV.UK Design System
16
+ ## Technical documentation
39
17
 
40
- GOV.UK Publishing Components also makes [GOV.UK Design System](https://design-system.service.gov.uk/) styles and components available to GOV.UK's frontend applications. This gem consumes [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend) via [Yarn](https://classic.yarnpkg.com/).
18
+ You can use the [GOV.UK Docker environment](https://github.com/alphagov/govuk-docker) or the local `startup.sh` script to run the app. Read the [guidance on local frontend development](https://docs.publishing.service.gov.uk/manual/local-frontend-development.html) to find out more about each approach, before you get started.
41
19
 
42
- ## Browser and assistive technology support
20
+ If you are using GOV.UK Docker, remember to combine it with the commands that follow. See the [GOV.UK Docker usage instructions](https://github.com/alphagov/govuk-docker#usage) for examples.
43
21
 
44
- GOV.UK Publishing Components shares the same standards in terms of browser and assistive technology support with [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend#browser-and-assistive-technology-support).
45
-
46
- ## Documentation
47
-
48
- [See the rubydoc.info documentation](http://www.rubydoc.info/gems/govuk_publishing_components)
49
-
50
- ## Working locally
51
-
52
- ### Install dependencies
53
-
54
- As well as the Ruby, you will also need the [Yarn package manager](https://classic.yarnpkg.com/en/docs/install/) to allow installing [npm](https://npmjs.com) dependencies.
55
-
56
- Install the application's dependencies with:
22
+ ### Running the test suite
57
23
 
58
24
  ```sh
59
- bundle install
60
- yarn install
25
+ bundle exec rake
61
26
  ```
62
27
 
63
- ### Running a local app with a local gem
64
-
65
- The GDS Developer Docs has a [guide on local frontend development](https://docs.publishing.service.gov.uk/manual/local-frontend-development.html) that covers setting up a local app to use the local version of the components gem in Docker and using the `./startup.sh` script.
28
+ To run JavaScript tests (only):
66
29
 
67
- ### Running tests
68
-
69
- The default rake task runs all the linting and test tasks:
70
-
71
- ```sh
72
- bin/rake
73
30
  ```
74
- Javascript is tested using Jasmine and the [Jasmine gem](https://github.com/pivotal/jasmine-gem). Tests can be run either in the browser or on the command line via the dummy app’s tasks:
75
-
76
- ```sh
77
- # browser
31
+ # run JS tests in browser
78
32
  bin/rake app:jasmine
79
33
 
80
- # command line
34
+ # run JS tests on command line
81
35
  bin/rake app:jasmine:ci
82
36
  ```
83
37
 
84
- ### Viewing the component guide
85
-
86
- View the component guide in your browser with:
87
-
88
- ```sh
89
- ./startup.sh
90
- ```
91
-
92
- The guide should be available at http://localhost:3212
93
-
94
- ### View documentation
95
-
96
- Preview documentation in your browser with:
97
-
98
- ```sh
99
- bundle exec yard server --reload
100
- ```
38
+ ### Further documentation
39
+
40
+ - [Install and use this gem](docs/install-and-use.md)
41
+ - [Use a component in your application](docs/use-components.md)
42
+ - [Generate a new component](docs/generate-a-new-component.md)
43
+ - [Testing a component](docs/testing-components.md)
44
+ - [Move a component from an application to the gem](docs/moving-components-upstream-into-this-gem.md)
45
+ - [Publish/release a new version of the gem](docs/publishing-to-rubygems.md)
46
+ - [Keep this gem in sync with the Design System](docs/upgrade-govuk-frontend.md)
47
+ - [Code documentation on rubydoc.info](http://www.rubydoc.info/gems/govuk_publishing_components)
48
+ - [Component conventions](docs/component_conventions.md)
49
+ - [Component principles](docs/component_principles.md)
101
50
 
102
51
  ## Licence
103
52
 
@@ -1,4 +1,5 @@
1
1
  <%
2
+ local_assigns[:margin_bottom] ||= 6
2
3
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
3
4
  id ||= nil
4
5
  id_prefix ||= "radio-#{SecureRandom.hex(4)}"
@@ -27,6 +28,7 @@
27
28
  hint ||= nil
28
29
  error_message ||= nil
29
30
  error_items ||= []
31
+ margin_bottom = margin_bottom ||= 6
30
32
 
31
33
  has_error = error_message || error_items.any?
32
34
  hint_id = "hint-#{SecureRandom.hex(4)}" if hint
@@ -34,6 +36,7 @@
34
36
 
35
37
  form_group_css_classes = %w(govuk-form-group)
36
38
  form_group_css_classes << "govuk-form-group--error" if has_error
39
+ form_group_css_classes << shared_helper.get_margin_bottom
37
40
 
38
41
  radio_classes = %w(govuk-radios)
39
42
  radio_classes << "govuk-radios--small" if small
@@ -109,10 +109,14 @@ examples:
109
109
  items:
110
110
  - href: '/help'
111
111
  text: Help
112
+ - href: '/help/privacy-notice'
113
+ text: Privacy
112
114
  - href: '/help/cookies'
113
115
  text: Cookies
114
116
  - href: '/contact'
115
117
  text: Contact
118
+ - href: '/help/accessibility-statement'
119
+ text: Accessibility statement
116
120
  - href: '/help/terms-conditions'
117
121
  text: Terms and conditions
118
122
  - href: '/cymraeg'
@@ -150,10 +154,14 @@ examples:
150
154
  items:
151
155
  - href: '/help'
152
156
  text: Help
157
+ - href: '/help/privacy-notice'
158
+ text: Privacy
153
159
  - href: '/help/cookies'
154
160
  text: Cookies
155
161
  - href: '/contact'
156
162
  text: Contact
163
+ - href: '/help/accessibility-statement'
164
+ text: Accessibility statement
157
165
  - href: '/help/terms-conditions'
158
166
  text: Terms and conditions
159
167
  - href: '/cymraeg'
@@ -65,6 +65,16 @@ examples:
65
65
  text: "Use GOV.UK Verify"
66
66
  hint_text: "You'll have an account if you've already proved your identity with a certified company, such as the Post Office."
67
67
  bold: true
68
+ with_bottom_margin:
69
+ 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). It defaults to a margin bottom of 30px (6)."
70
+ data:
71
+ name: "radio-group"
72
+ margin_bottom: 9
73
+ items:
74
+ - value: "government-gateway"
75
+ text: "Use Government Gateway"
76
+ - value: "govuk-verify"
77
+ text: "Use GOV.UK Verify"
68
78
  with_hint_on_form_group:
69
79
  data:
70
80
  name: "radio-group-error"
@@ -330,10 +330,18 @@ module GovukPublishingComponents
330
330
  href: "/help",
331
331
  text: "Help",
332
332
  },
333
+ {
334
+ href: "/help/privacy-notice",
335
+ text: "Privacy",
336
+ },
333
337
  {
334
338
  href: "/help/cookies",
335
339
  text: "Cookies",
336
340
  },
341
+ {
342
+ href: "/help/accessibility-statement",
343
+ text: "Accessibility statement",
344
+ },
337
345
  {
338
346
  href: "/contact",
339
347
  text: "Contact",
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.17.0".freeze
2
+ VERSION = "24.18.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: 24.17.0
4
+ version: 24.18.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: 2021-06-29 00:00:00.000000000 Z
11
+ date: 2021-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config