govuk_design_system_formbuilder 1.1.1 → 1.1.2

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: f58f2c2f54f6eadcee54e9c65b2c405fcc6f21c62f37be8c785e0f5091826047
4
- data.tar.gz: 6d0f856f7ae0e98026ac7be7398462517e2f89bb2962a06dd2a18aeb5d27bd4f
3
+ metadata.gz: 1d08d8255b04e84a583124a0c184f7d0ec1a8205cc8ee9920ebe32e32878514c
4
+ data.tar.gz: 30b1cd1e04973288157c1f633d6eff728a1985455e7f88bd3ae383913be02e81
5
5
  SHA512:
6
- metadata.gz: 8b6706e22bcfad4ec7152ac9efb456e164095ef202ba95f1f5f66f58828dedda0d5c8a56954e4dc666ebb84b4ae28552739b7823106661477ecb94145f170f0e
7
- data.tar.gz: f8bfa7becbc68ebd15cd9bc1191ec308d207961b24f944b257ecf1cf7d49bf6680db53b09f137b91eaefdececd41343f395e7accf0e124060e4bd06296a6334f
6
+ metadata.gz: 3192d2182a6a60bd7fd9052b5895cfb79e60f254d25c44655f34d69d541d198574b385412f181bdd7bb120ff20c2ac7fb198b06fcb56b7666d57acc429d8f23e
7
+ data.tar.gz: b53549bb342a2f4363d8261d8c1ef080c55961399cc8781cb090802964b25268dc874a4c2a0510ba842d4c8738af75c24272e7760bb1bc204e7d4500d2dbcc56
data/README.md CHANGED
@@ -129,6 +129,12 @@ Currently we're using [GOVUK Lint](https://github.com/alphagov/govuk-lint) to
129
129
  ensure code meets the GOV.UK guidelines. Please ensure that any PRs also adhere
130
130
  to this standard.
131
131
 
132
+ To help keep the logs clean and tidy, please configure git to use your full name:
133
+
134
+ ```sh
135
+ git config --global user.name "Julius Hibbert"
136
+ ```
137
+
132
138
  ## Thanks 👩🏽‍⚖️
133
139
 
134
140
  This project was inspired by [Ministry of Justice's GovukElementsFormBuilder](https://github.com/ministryofjustice/govuk_elements_form_builder),
@@ -80,6 +80,30 @@ module GOVUKDesignSystemFormBuilder
80
80
  Elements::Inputs::Email.new(self, object_name, attribute_name, hint_text: hint_text, label: label, width: width, **args, &block).html
81
81
  end
82
82
 
83
+ # Generates a input of type +password+
84
+ #
85
+ # @param attribute_name [Symbol] The name of the attribute
86
+ # @param hint_text [String] The content of the hint. No hint will be injected if left +nil+
87
+ # @param width [Integer,String] sets the width of the input, can be +2+, +3+ +4+, +5+, +10+ or +20+ characters
88
+ # or +one-quarter+, +one-third+, +one-half+, +two-thirds+ or +full+ width of the container
89
+ # @param [Hash] label configures the associated label
90
+ # @option label text [String] the label text
91
+ # @option label size [String] the size of the label font, can be +xl+, +l+, +m+, +s+ or nil
92
+ # @option label tag [Symbol,String] the label's wrapper tag, intended to allow labels to act as page headings
93
+ # @option label hidden [Boolean] control the visability of the label. Hidden labels will stil be read by screenreaders
94
+ # @option args [Hash] args additional arguments are applied as attributes to +input+ element
95
+ # @param block [Block] arbitrary HTML that will be rendered between the hint and the input
96
+ # @return [ActiveSupport::SafeBuffer] HTML output
97
+ # @see https://design-system.service.gov.uk/components/text-input/ GOV.UK Text input
98
+ # @see https://design-system.service.gov.uk/patterns/passwords/ GOV.UK Password patterns
99
+ #
100
+ # @example A password field
101
+ # = f.govuk_password_field :password,
102
+ # label: { text: 'Enter your password' }
103
+ def govuk_password_field(attribute_name, hint_text: nil, label: {}, width: nil, **args, &block)
104
+ Elements::Inputs::Password.new(self, object_name, attribute_name, hint_text: hint_text, label: label, width: width, **args, &block).html
105
+ end
106
+
83
107
  # Generates a input of type +url+
84
108
  #
85
109
  # @param attribute_name [Symbol] The name of the attribute
@@ -0,0 +1,17 @@
1
+ module GOVUKDesignSystemFormBuilder
2
+ module Elements
3
+ module Inputs
4
+ class Password < Base
5
+ include Traits::Input
6
+ include Traits::Error
7
+ include Traits::Hint
8
+ include Traits::Label
9
+ include Traits::Supplemental
10
+
11
+ def builder_method
12
+ :password_field
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module GOVUKDesignSystemFormBuilder
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.1.2'.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: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Yates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-07 00:00:00.000000000 Z
11
+ date: 2020-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -300,6 +300,7 @@ files:
300
300
  - lib/govuk_design_system_formbuilder/elements/hint.rb
301
301
  - lib/govuk_design_system_formbuilder/elements/inputs/email.rb
302
302
  - lib/govuk_design_system_formbuilder/elements/inputs/number.rb
303
+ - lib/govuk_design_system_formbuilder/elements/inputs/password.rb
303
304
  - lib/govuk_design_system_formbuilder/elements/inputs/phone.rb
304
305
  - lib/govuk_design_system_formbuilder/elements/inputs/text.rb
305
306
  - lib/govuk_design_system_formbuilder/elements/inputs/url.rb