govuk_design_system_formbuilder 4.0.0 → 4.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: 6910a6f80e3a522452d48392d6393d09c62996e91ebef776113c3a1df4f4690d
4
- data.tar.gz: ed742d70a77cd65a758211888fc304aa5e122b0c7a6311fd42fcb1d3ca4a86b4
3
+ metadata.gz: 7f5a6a3bf20a1265053dcc1412b8e1cd3a401b67000d4baea725d1e38de52115
4
+ data.tar.gz: 336536cec3118c2b2f408bfd17e173b12026031bf4147bf92fac910c4a73fff9
5
5
  SHA512:
6
- metadata.gz: dfef2a8d28874f33d616d7271bfafadf73474d4593ac734428ba3b9a54a5ca6e39fdccb2cd8e35d219ec7802b99b09b64d0368a680b1002347da59fea6d64b0a
7
- data.tar.gz: 118aad431b99903782a310413b67ce21dc945591aaed9bc99c5b1c89244d4e360689fcaa9fde3f98067d93c53aa9814af24f6cfb935010ac90b33bfb06c0e1e1
6
+ metadata.gz: c9ccef41328fbf34c365e0d18f4709a3ef25d26ad4a22b0ca0836f36835eb14a7628b0a5100f0724fe05b422e9ae184c236648d421389e2aecaf5d39610c4279
7
+ data.tar.gz: e08a35440a95b29e82e62c9ab0b3c5bbb421899eb4b118331ea29d818a55c257965e0e983b311038a60956aefcbb01d2ed6a2719ae1f6fedf69d073c4da03ffa
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # GOV.UK Design System Form Builder for Rails
1
+ # GOV.UK Form Builder for Ruby on Rails
2
2
 
3
- [![Tests](https://github.com/DFE-Digital/govuk-formbuilder/workflows/Tests/badge.svg)](https://github.com/DFE-Digital/govuk-formbuilder/actions)
4
- [![Maintainability](https://api.codeclimate.com/v1/badges/110136fb22341d3ba646/maintainability)](https://codeclimate.com/github/DFE-Digital/govuk-formbuilder/maintainability)
5
- [![Gem Version](https://badge.fury.io/rb/govuk_design_system_formbuilder.svg)](https://badge.fury.io/rb/govuk_design_system_formbuilder)
3
+ [![Tests](https://github.com/x-govuk/govuk-form-builder/workflows/Tests/badge.svg)](https://github.com/x-govuk/govuk-form-builder/actions)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/110136fb22341d3ba646/maintainability)](https://codeclimate.com/github/x-govuk/govuk-form-builder/maintainability)
5
+ [![Gem version](https://img.shields.io/gem/dt/govuk_design_system_formbuilder?logo=rubygems)](https://rubygems.org/gems/govuk_design_system_formbuilder)
6
6
  [![Gem](https://img.shields.io/gem/dt/govuk_design_system_formbuilder?logo=rubygems)](https://rubygems.org/gems/govuk_design_system_formbuilder)
7
- [![Test Coverage](https://api.codeclimate.com/v1/badges/110136fb22341d3ba646/test_coverage)](https://codeclimate.com/github/DFE-Digital/govuk-formbuilder/test_coverage)
8
- [![GitHub license](https://img.shields.io/github/license/DFE-Digital/govuk_design_system_formbuilder)](https://github.com/DFE-Digital/govuk-formbuilder/blob/main/LICENSE)
9
- [![GOV.UK Design System Version](https://img.shields.io/badge/GOV.UK%20Design%20System-4.6.0-brightgreen)](https://design-system.service.gov.uk)
7
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/110136fb22341d3ba646/test_coverage)](https://codeclimate.com/github/x-govuk/govuk-form-builder/test_coverage)
8
+ [![GitHub license](https://img.shields.io/github/license/x-govuk/govuk-form-builder)](https://github.com/x-govuk/govuk-form-builder/blob/main/LICENSE)
9
+ [![GOV.UK Design System version](https://img.shields.io/badge/GOV.UK%20Design%20System-4.7.0-brightgreen)](https://design-system.service.gov.uk)
10
10
  [![Rails](https://img.shields.io/badge/Rails-6.1.7%20%E2%95%B1%207.0.4-E16D6D)](https://weblog.rubyonrails.org/releases/)
11
11
  [![Ruby](https://img.shields.io/badge/Ruby-3.0.5%20%20%E2%95%B1%203.1.3%20%20%E2%95%B1%203.2.0-E16D6D)](https://www.ruby-lang.org/en/downloads/)
12
12
 
@@ -16,22 +16,18 @@ It is intended to make creating forms **quick**, **easy** and **familiar** for R
16
16
 
17
17
  ## Documentation
18
18
 
19
- The gem comes with [a full guide](https://govuk-form-builder.netlify.app/) that
20
- covers most aspects of day-to-day use, along with code and output examples. The
21
- examples in the guide are generated from the builder itself so it will always
22
- be up to date.
19
+ The gem comes with [a full guide](https://govuk-form-builder.netlify.app/) that covers most aspects of day-to-day use, along with code and output examples. The examples in the guide are generated from the builder itself so it will always be up to date.
23
20
 
24
21
  [![Netlify Status](https://api.netlify.com/api/v1/badges/d4c50b8d-6ca3-4797-9ab3-6e0731c72b44/deploy-status)](https://app.netlify.com/sites/govuk-form-builder/deploys)
25
22
 
26
- ## What's included
23
+ ## Whats included
27
24
 
28
25
  * 100% compatibility with the GOV.UK Design System
29
26
  * Full control of labels, legends, hints, captions and fieldsets
30
- * No overwriting of Rails' default form helpers
27
+ * No overwriting of Rails default form helpers
31
28
  * Automatic ARIA associations between hints, errors and inputs
32
29
  * Most helpers take blocks for arbitrary content
33
- * Additional params for programmatically adding hints to check box and radio
34
- button collections
30
+ * Additional params for programmatically adding hints to check box and radio button collections
35
31
  * Full I18n support
36
32
  * Automatic handling of ActiveRecord validation error messages
37
33
  * No external dependencies
@@ -40,29 +36,22 @@ be up to date.
40
36
 
41
37
  ## Installation
42
38
 
43
- You can install the form builder gem by running the `gem install
44
- govuk_design_system_formbuilder` or by adding the following line
45
- to your `Gemfile`:
39
+ You can install the form builder gem by running the `gem install govuk_design_system_formbuilder` or by adding the following line to your `Gemfile`:
46
40
 
47
41
  ```sh
48
42
  gem 'govuk_design_system_formbuilder'
49
43
  ```
50
44
 
51
- To make full use of this tool, you will need a Rails application with the latest [GOV.UK
52
- Frontend](https://github.com/alphagov/govuk-frontend) assets installed and
53
- configured.
45
+ To make full use of this tool, you will need a Rails application with the latest [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend) assets installed and configured.
54
46
 
55
- To get up and running quickly and easily try kickstarting your project with a
56
- pre-configured template:
47
+ To get up and running quickly and easily try kickstarting your project with a pre-configured template:
57
48
 
58
49
  * [DfE Rails Template](https://github.com/DFE-Digital/rails-template)
59
50
  * [DEFRA Ruby Template](https://github.com/DEFRA/defra-ruby-template)
60
51
 
61
52
  ## Setup
62
53
 
63
- To use the form builder in an ad hoc basis you can specify it as an argument to
64
- `form_for` or `form_with`. These examples are written in [Slim](https://github.com/slim-template/slim) but
65
- other templating languages like ERB and [Haml](https://haml.info/) work just as well.
54
+ To use the form builder in an ad hoc basis you can specify it as an argument to `form_for` or `form_with`. These examples are written in [Slim](https://github.com/slim-template/slim) but other templating languages like ERB and [Haml](https://haml.info/) work just as well.
66
55
 
67
56
  ```slim
68
57
  = form_for @some_object, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f|
@@ -92,16 +81,14 @@ Now we can get started!
92
81
  :name,
93
82
  :description,
94
83
  label: { text: "Which department do you work for?" },
95
- hint: { text: "If you don't know ask your manager" }
84
+ hint: { text: "If you dont know ask your manager" }
96
85
 
97
86
  = f.govuk_submit 'Away we go!'
98
87
  ```
99
88
 
100
89
  ## Developing and running the tests
101
90
 
102
- The form builder is tested with RSpec. To run all the tests first ensure that
103
- the development and testing prerequisite gems are installed. At the root of a
104
- freshly-cloned repo run:
91
+ The form builder is tested with RSpec. To run all the tests first ensure that the development and testing prerequisite gems are installed. At the root of a freshly-cloned repo run:
105
92
 
106
93
  ```sh
107
94
  bundle
@@ -115,12 +102,9 @@ bundle exec rspec
115
102
 
116
103
  ## Contributing
117
104
 
118
- Bug reports and feature requests are most welcome, please raise an issue or
119
- submit a pull request.
105
+ Bug reports and feature requests are most welcome, please raise an issue or submit a pull request.
120
106
 
121
- Currently we're using [GOVUK Lint](https://github.com/alphagov/govuk-lint) to
122
- ensure code meets the GOV.UK guidelines. Please ensure that any PRs also adhere
123
- to this standard.
107
+ Currently were using [GOVUK Lint](https://github.com/alphagov/govuk-lint) to ensure code meets the GOV.UK guidelines. Please ensure that any PRs also adhere to this standard.
124
108
 
125
109
  To help keep the logs clean and tidy, please configure git to use your full name:
126
110
 
@@ -130,18 +114,18 @@ git config --global user.name "Julius Hibbert"
130
114
 
131
115
  ## Services using this library
132
116
 
133
- Approximately [100 services use this library](https://github.com/DFE-Digital/govuk-formbuilder/network/dependents),
117
+ Approximately [100 services use this library](https://github.com/x-govuk/govuk-form-builder/network/dependents),
134
118
  here are a few from the <abbr title="Department for Education">DfE</abbr>, <abbr title="Ministry of Justice">MoJ</abbr>, and
135
119
  <abbr title="Department for Business, Energy & Industrial Strategy">BEIS</abbr>.
136
120
 
137
- * [Apply for teacher training](https://www.github.com/DFE-Digital/apply-for-teacher-training)
138
- * [Teaching Vacancies](https://www.github.com/DFE-Digital/teaching-vacancies)
139
- * [Get a teacher training adviser](https://www.github.com/DFE-Digital/get-teacher-training-adviser-service/)
140
- * [Claim for crown court defence](https://www.github.com/ministryofjustice/Claim-for-Crown-Court-Defence)
141
- * [Appeal to the tax tribunal](https://www.github.com/ministryofjustice/tax-tribunals-datacapture)
142
- * [Apply to court about child arrangements](https://www.github.com/ministryofjustice/c100-application)
143
- * [Trade Tariff duty calculator](https://www.github.com/trade-tariff/trade-tariff-duty-calculator)
144
- * [Report your official development assistance](https://www.github.com/UKGovernmentBEIS/beis-report-official-development-assistance)
121
+ * [Apply for teacher training](https://www.github.com/x-govuk/apply-for-teacher-training)
122
+ * [Teaching Vacancies](https://www.github.com/x-govuk/teaching-vacancies)
123
+ * [Get a teacher training adviser](https://www.github.com/x-govuk/get-teacher-training-adviser-service/)
124
+ * [Claim for crown court defence](https://www.github.com/ministryofjustice/Claim-for-Crown-Court-Defence)
125
+ * [Appeal to the tax tribunal](https://www.github.com/ministryofjustice/tax-tribunals-datacapture)
126
+ * [Apply to court about child arrangements](https://www.github.com/ministryofjustice/c100-application)
127
+ * [Trade Tariff duty calculator](https://www.github.com/trade-tariff/trade-tariff-duty-calculator)
128
+ * [Report your official development assistance](https://www.github.com/UKGovernmentBEIS/beis-report-official-development-assistance)
145
129
 
146
130
  ## Form building services using this library
147
131
 
@@ -150,5 +134,4 @@ here are a few from the <abbr title="Department for Education">DfE</abbr>, <abbr
150
134
 
151
135
  ## Thanks
152
136
 
153
- This project was inspired by [Ministry of Justice's GovukElementsFormBuilder](https://github.com/ministryofjustice/govuk_elements_form_builder),
154
- but is leaner, more modular and written in a more idiomatic style.
137
+ This project was inspired by [Ministry of Justices GovukElementsFormBuilder](https://github.com/ministryofjustice/govuk_elements_form_builder), but is leaner, more modular and written in a more idiomatic style.
@@ -857,6 +857,7 @@ module GOVUKDesignSystemFormBuilder
857
857
  # @param text [String,Proc] the button text. When a +Proc+ is provided its contents will be rendered within the button element
858
858
  # @param warning [Boolean] makes the button red ({https://design-system.service.gov.uk/components/button/#warning-buttons warning}) when true
859
859
  # @param secondary [Boolean] makes the button grey ({https://design-system.service.gov.uk/components/button/#secondary-buttons secondary}) when true
860
+ # @param inverse [Boolean] inverts the colours of the button. Note this isn't yet part of the design system.
860
861
  # @param prevent_double_click [Boolean] adds JavaScript to safeguard the
861
862
  # form from being submitted more than once
862
863
  # @param validate [Boolean] adds the formnovalidate to the submit button when true, this disables all
@@ -881,8 +882,8 @@ module GOVUKDesignSystemFormBuilder
881
882
  # = f.govuk_submit "Proceed", prevent_double_click: true do
882
883
  # = link_to 'Cancel', some_other_path, class: 'govuk-button__secondary'
883
884
  #
884
- def govuk_submit(text = config.default_submit_button_text, warning: false, secondary: false, prevent_double_click: true, validate: config.default_submit_validate, disabled: false, **kwargs, &block)
885
- Elements::Submit.new(self, text, warning: warning, secondary: secondary, prevent_double_click: prevent_double_click, validate: validate, disabled: disabled, **kwargs, &block).html
885
+ def govuk_submit(text = config.default_submit_button_text, warning: false, secondary: false, inverse: false, prevent_double_click: true, validate: config.default_submit_validate, disabled: false, **kwargs, &block)
886
+ Elements::Submit.new(self, text, warning: warning, secondary: secondary, inverse: inverse, prevent_double_click: prevent_double_click, validate: validate, disabled: disabled, **kwargs, &block).html
886
887
  end
887
888
 
888
889
  # Generates three inputs for the +day+, +month+ and +year+ components of a date
@@ -5,7 +5,7 @@ module GOVUKDesignSystemFormBuilder
5
5
  include Traits::HTMLClasses
6
6
  include Traits::HTMLAttributes
7
7
 
8
- def initialize(builder, text, warning:, secondary:, prevent_double_click:, validate:, disabled:, **kwargs, &block)
8
+ def initialize(builder, text, warning:, secondary:, inverse:, prevent_double_click:, validate:, disabled:, **kwargs, &block)
9
9
  super(builder, nil, nil)
10
10
 
11
11
  fail ArgumentError, 'buttons can be warning or secondary' if warning && secondary
@@ -14,6 +14,7 @@ module GOVUKDesignSystemFormBuilder
14
14
  @prevent_double_click = prevent_double_click
15
15
  @warning = warning
16
16
  @secondary = secondary
17
+ @inverse = inverse
17
18
  @validate = validate
18
19
  @disabled = disabled
19
20
  @html_attributes = kwargs
@@ -68,6 +69,7 @@ module GOVUKDesignSystemFormBuilder
68
69
  "button--warning" => @warning,
69
70
  "button--secondary" => @secondary,
70
71
  "button--disabled" => @disabled,
72
+ "button--inverse" => @inverse,
71
73
  ).prefix(brand)
72
74
  end
73
75
  end
@@ -1,3 +1,3 @@
1
1
  module GOVUKDesignSystemFormBuilder
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '4.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_design_system_formbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Yates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-26 00:00:00.000000000 Z
11
+ date: 2023-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-attributes-utils
@@ -134,14 +134,14 @@ dependencies:
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: 4.10.0
137
+ version: 4.11.0
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: 4.10.0
144
+ version: 4.11.0
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: simplecov
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -260,14 +260,14 @@ dependencies:
260
260
  requirements:
261
261
  - - "~>"
262
262
  - !ruby/object:Gem::Version
263
- version: 0.22.0
263
+ version: 0.24.0
264
264
  type: :development
265
265
  prerelease: false
266
266
  version_requirements: !ruby/object:Gem::Requirement
267
267
  requirements:
268
268
  - - "~>"
269
269
  - !ruby/object:Gem::Version
270
- version: 0.22.0
270
+ version: 0.24.0
271
271
  - !ruby/object:Gem::Dependency
272
272
  name: webrick
273
273
  requirement: !ruby/object:Gem::Requirement
@@ -282,8 +282,8 @@ dependencies:
282
282
  - - "~>"
283
283
  - !ruby/object:Gem::Version
284
284
  version: 1.8.1
285
- description: A Rails form builder that generates form inputs adhering to the GOV.UK
286
- Design System
285
+ description: This library provides view components for the GOV.UK Design System. It
286
+ makes creating services more familiar for Ruby on Rails developers.
287
287
  email:
288
288
  - peter.yates@graphia.co.uk
289
289
  executables: []
@@ -350,12 +350,12 @@ homepage: https://govuk-form-builder.netlify.app
350
350
  licenses:
351
351
  - MIT
352
352
  metadata:
353
- bug_tracker_uri: https://github.com/DFE-Digital/govuk-formbuilder/issues
354
- changelog_uri: https://github.com/DFE-Digital/govuk-formbuilder/releases
353
+ bug_tracker_uri: https://github.com/x-govuk/govuk-form-builder/issues
354
+ changelog_uri: https://github.com/x-govuk/govuk-form-builder/releases
355
355
  documentation_uri: https://www.rubydoc.info/gems/govuk_design_system_formbuilder/GOVUKDesignSystemFormBuilder/Builder
356
356
  homepage_uri: https://govuk-form-builder.netlify.app
357
- source_code_uri: https://github.com/DFE-Digital/govuk-formbuilder
358
- github_repo: https://github.com/DFE-Digital/govuk-formbuilder
357
+ source_code_uri: https://github.com/x-govuk/govuk-form-builder
358
+ github_repo: https://github.com/x-govuk/govuk-form-builder
359
359
  post_install_message:
360
360
  rdoc_options: []
361
361
  require_paths:
@@ -374,5 +374,5 @@ requirements: []
374
374
  rubygems_version: 3.2.33
375
375
  signing_key:
376
376
  specification_version: 4
377
- summary: GOV.UK-compliant Rails form builder
377
+ summary: GOV.UK Form Builder for Ryby on Rails
378
378
  test_files: []