govuk_design_system_formbuilder 1.1.1 → 1.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d08d8255b04e84a583124a0c184f7d0ec1a8205cc8ee9920ebe32e32878514c
|
4
|
+
data.tar.gz: 30b1cd1e04973288157c1f633d6eff728a1985455e7f88bd3ae383913be02e81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
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
|