govuk_elements_rails 3.1.0 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -7
- data/vendor/assets/stylesheets/elements/_elements-typography.scss +2 -1
- data/vendor/assets/stylesheets/elements/_layout.scss +4 -2
- data/vendor/assets/stylesheets/elements/_tables.scss +1 -1
- data/vendor/assets/stylesheets/elements/forms/_form-multiple-choice.scss +6 -0
- metadata +7 -9
- data/vendor/assets/javascripts/details.polyfill.js +0 -217
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fe448dff48a121e14b22cae56969c1ddf6a9608
|
4
|
+
data.tar.gz: d0c986e531c847009d9c26e278c0b6b2c3820d5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8949b9bff5367d93db1385a3899e36218ba9cc7f56aa2e948d4acf6bb273018e29eb0ae58444c105ebc2c6aca760565e49ef543078d933eb514a6b93b49a8552
|
7
|
+
data.tar.gz: 23906c51650e39fa1ed82cd7f0f8dcda267460789f6360019093abde781a8e32e59eef2a0770ffc43d885b6172933f35ec293a617e75efa6ac361df383210479
|
data/README.md
CHANGED
@@ -183,7 +183,7 @@ To add a javascript file to gem, create new symlink to `govuk_elements` file, li
|
|
183
183
|
```sh
|
184
184
|
cd vendor/assets/javascripts/
|
185
185
|
ls -l
|
186
|
-
ln -s ../../../govuk_elements/
|
186
|
+
ln -s ../../../govuk_elements/assets/javascripts/govuk/details.polyfill.js .
|
187
187
|
ls -l
|
188
188
|
cd ../../..
|
189
189
|
git add vendor/javascripts/details.polyfill.js
|
@@ -200,11 +200,6 @@ rake gem
|
|
200
200
|
If you're happy all's ok, you can create a branch and commit:
|
201
201
|
|
202
202
|
```sh
|
203
|
-
cd govuk_elements
|
204
|
-
tag_sha=`git rev-parse HEAD`
|
205
|
-
echo $tag_sha
|
206
|
-
cd ..
|
207
|
-
|
208
203
|
branch_name="update-$latest_tag"
|
209
204
|
echo $branch_name
|
210
205
|
git branch $branch_name
|
@@ -216,7 +211,7 @@ git add govuk_elements
|
|
216
211
|
|
217
212
|
commit_msg="Upgrade to govuk_elements $latest_tag"
|
218
213
|
commit_msg2="See govuk_elements $latest_tag changelog for details:"
|
219
|
-
commit_msg3="https://github.com/alphagov/govuk_elements/blob/$
|
214
|
+
commit_msg3="https://github.com/alphagov/govuk_elements/blob/$latest_tag/packages/govuk-elements-sass/CHANGELOG.md"
|
220
215
|
|
221
216
|
echo $commit_msg
|
222
217
|
echo $commit_msg2
|
@@ -201,10 +201,12 @@ p,
|
|
201
201
|
&:link,
|
202
202
|
&:visited,
|
203
203
|
&:hover,
|
204
|
+
a#{&}:focus,
|
204
205
|
&:active {
|
205
206
|
color: $black;
|
206
207
|
}
|
207
208
|
|
209
|
+
|
208
210
|
text-decoration: none;
|
209
211
|
border-bottom: 1px solid $black;
|
210
212
|
|
@@ -234,7 +236,6 @@ p,
|
|
234
236
|
}
|
235
237
|
|
236
238
|
}
|
237
|
-
|
238
239
|
// Code styles
|
239
240
|
.code {
|
240
241
|
color: $text-colour;
|
@@ -14,8 +14,10 @@
|
|
14
14
|
@include media(desktop) {
|
15
15
|
padding-bottom: $gutter * 3;
|
16
16
|
}
|
17
|
-
|
18
|
-
//
|
17
|
+
|
18
|
+
// DEPRECATED: Tabindex on #content
|
19
|
+
// https://github.com/alphagov/govuk_elements/pull/534
|
20
|
+
// We no longer recommend using tabindex on #content
|
19
21
|
outline: none;
|
20
22
|
}
|
21
23
|
|
@@ -88,6 +88,7 @@
|
|
88
88
|
border: solid;
|
89
89
|
border-width: 0 0 5px 5px;
|
90
90
|
background: transparent;
|
91
|
+
border-top-color: transparent;
|
91
92
|
width: 17px;
|
92
93
|
height: 7px;
|
93
94
|
position: absolute;
|
@@ -116,8 +117,13 @@
|
|
116
117
|
}
|
117
118
|
|
118
119
|
// Disabled state
|
120
|
+
input:disabled {
|
121
|
+
cursor: default;
|
122
|
+
}
|
123
|
+
|
119
124
|
input:disabled + label {
|
120
125
|
@include opacity(0.5);
|
126
|
+
cursor: default;
|
121
127
|
}
|
122
128
|
|
123
129
|
&:last-child,
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_elements_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Government Digital Service
|
7
|
+
- GOV.UK Design System Team (Government Digital Service)
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2017-
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
@@ -54,10 +53,10 @@ dependencies:
|
|
54
53
|
- !ruby/object:Gem::Version
|
55
54
|
version: 6.0.2
|
56
55
|
description: |-
|
57
|
-
A gem wrapper around govuk_elements v3.1.
|
58
|
-
that pulls stylesheet and javascript files into a Rails app. Changelog: https://github.com/alphagov/govuk_elements/blob/
|
56
|
+
A gem wrapper around govuk_elements v3.1.2
|
57
|
+
that pulls stylesheet and javascript files into a Rails app. Changelog: https://github.com/alphagov/govuk_elements/blob/85644af5e31e9a28be3c8325978c258334a47764
|
59
58
|
/CHANGELOG.md
|
60
|
-
email:
|
59
|
+
email: design-system-developers@digital.cabinet-office.gov.uk
|
61
60
|
executables: []
|
62
61
|
extensions: []
|
63
62
|
extra_rdoc_files:
|
@@ -67,7 +66,6 @@ files:
|
|
67
66
|
- README.md
|
68
67
|
- lib/govuk_elements_rails.rb
|
69
68
|
- lib/govuk_elements_rails/engine.rb
|
70
|
-
- vendor/assets/javascripts/details.polyfill.js
|
71
69
|
- vendor/assets/stylesheets/_govuk-elements.scss
|
72
70
|
- vendor/assets/stylesheets/elements/_breadcrumbs.scss
|
73
71
|
- vendor/assets/stylesheets/elements/_buttons.scss
|
@@ -110,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
108
|
version: '0'
|
111
109
|
requirements: []
|
112
110
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.6.
|
111
|
+
rubygems_version: 2.6.12
|
114
112
|
signing_key:
|
115
113
|
specification_version: 4
|
116
114
|
summary: A gem wrapper around http://github.com/alphagov/govuk_elements that pulls
|
@@ -1,217 +0,0 @@
|
|
1
|
-
// <details> polyfill
|
2
|
-
// http://caniuse.com/#feat=details
|
3
|
-
|
4
|
-
// FF Support for HTML5's <details> and <summary>
|
5
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=591737
|
6
|
-
|
7
|
-
// http://www.sitepoint.com/fixing-the-details-element/
|
8
|
-
|
9
|
-
;(function () {
|
10
|
-
'use strict'
|
11
|
-
|
12
|
-
var NATIVE_DETAILS = typeof document.createElement('details').open === 'boolean'
|
13
|
-
var KEY_ENTER = 13
|
14
|
-
var KEY_SPACE = 32
|
15
|
-
|
16
|
-
// Add event construct for modern browsers or IE
|
17
|
-
// which fires the callback with a pre-converted target reference
|
18
|
-
function addEvent (node, type, callback) {
|
19
|
-
if (node.addEventListener) {
|
20
|
-
node.addEventListener(type, function (e) {
|
21
|
-
callback(e, e.target)
|
22
|
-
}, false)
|
23
|
-
} else if (node.attachEvent) {
|
24
|
-
node.attachEvent('on' + type, function (e) {
|
25
|
-
callback(e, e.srcElement)
|
26
|
-
})
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
// Cross-browser character code / key pressed
|
31
|
-
function charCode (e) {
|
32
|
-
return (typeof e.which === 'number') ? e.which : e.keyCode
|
33
|
-
}
|
34
|
-
|
35
|
-
// Cross-browser preventing default action
|
36
|
-
function preventDefault (e) {
|
37
|
-
if (e.preventDefault) {
|
38
|
-
e.preventDefault()
|
39
|
-
} else {
|
40
|
-
e.returnValue = false
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
// Handle cross-modal click events
|
45
|
-
function addClickEvent (node, callback) {
|
46
|
-
addEvent(node, 'keypress', function (e, target) {
|
47
|
-
// When the key gets pressed - check if it is enter or space
|
48
|
-
if (charCode(e) === KEY_ENTER || charCode(e) === KEY_SPACE) {
|
49
|
-
if (target.nodeName.toLowerCase() === 'summary') {
|
50
|
-
// Prevent space from scrolling the page
|
51
|
-
// and enter from submitting a form
|
52
|
-
preventDefault(e)
|
53
|
-
// Click to let the click event do all the necessary action
|
54
|
-
if (target.click) {
|
55
|
-
target.click()
|
56
|
-
} else {
|
57
|
-
// except Safari 5.1 and under don't support .click() here
|
58
|
-
callback(e, target)
|
59
|
-
}
|
60
|
-
}
|
61
|
-
}
|
62
|
-
})
|
63
|
-
|
64
|
-
// Prevent keyup to prevent clicking twice in Firefox when using space key
|
65
|
-
addEvent(node, 'keyup', function (e, target) {
|
66
|
-
if (charCode(e) === KEY_SPACE) {
|
67
|
-
if (target.nodeName === 'SUMMARY') {
|
68
|
-
preventDefault(e)
|
69
|
-
}
|
70
|
-
}
|
71
|
-
})
|
72
|
-
|
73
|
-
addEvent(node, 'click', function (e, target) {
|
74
|
-
callback(e, target)
|
75
|
-
})
|
76
|
-
}
|
77
|
-
|
78
|
-
// Get the nearest ancestor element of a node that matches a given tag name
|
79
|
-
function getAncestor (node, match) {
|
80
|
-
do {
|
81
|
-
if (!node || node.nodeName.toLowerCase() === match) {
|
82
|
-
break
|
83
|
-
}
|
84
|
-
node = node.parentNode
|
85
|
-
} while (node)
|
86
|
-
|
87
|
-
return node
|
88
|
-
}
|
89
|
-
|
90
|
-
// Create a started flag so we can prevent the initialisation
|
91
|
-
// function firing from both DOMContentLoaded and window.onload
|
92
|
-
var started = false
|
93
|
-
|
94
|
-
// Initialisation function
|
95
|
-
function addDetailsPolyfill (list) {
|
96
|
-
// If this has already happened, just return
|
97
|
-
// else set the flag so it doesn't happen again
|
98
|
-
if (started) {
|
99
|
-
return
|
100
|
-
}
|
101
|
-
started = true
|
102
|
-
|
103
|
-
// Get the collection of details elements, but if that's empty
|
104
|
-
// then we don't need to bother with the rest of the scripting
|
105
|
-
if ((list = document.getElementsByTagName('details')).length === 0) {
|
106
|
-
return
|
107
|
-
}
|
108
|
-
|
109
|
-
// else iterate through them to apply their initial state
|
110
|
-
var n = list.length
|
111
|
-
var i = 0
|
112
|
-
for (i; i < n; i++) {
|
113
|
-
var details = list[i]
|
114
|
-
|
115
|
-
// Save shortcuts to the inner summary and content elements
|
116
|
-
details.__summary = details.getElementsByTagName('summary').item(0)
|
117
|
-
details.__content = details.getElementsByTagName('div').item(0)
|
118
|
-
|
119
|
-
// If the content doesn't have an ID, assign it one now
|
120
|
-
// which we'll need for the summary's aria-controls assignment
|
121
|
-
if (!details.__content.id) {
|
122
|
-
details.__content.id = 'details-content-' + i
|
123
|
-
}
|
124
|
-
|
125
|
-
// Add ARIA role="group" to details
|
126
|
-
details.setAttribute('role', 'group')
|
127
|
-
|
128
|
-
// Add role=button to summary
|
129
|
-
details.__summary.setAttribute('role', 'button')
|
130
|
-
|
131
|
-
// Add aria-controls
|
132
|
-
details.__summary.setAttribute('aria-controls', details.__content.id)
|
133
|
-
|
134
|
-
// Set tabIndex so the summary is keyboard accessible for non-native elements
|
135
|
-
// http://www.saliences.com/browserBugs/tabIndex.html
|
136
|
-
if (!NATIVE_DETAILS) {
|
137
|
-
details.__summary.tabIndex = 0
|
138
|
-
}
|
139
|
-
|
140
|
-
// Detect initial open state
|
141
|
-
var openAttr = details.getAttribute('open') !== null
|
142
|
-
if (openAttr === true) {
|
143
|
-
details.__summary.setAttribute('aria-expanded', 'true')
|
144
|
-
details.__content.setAttribute('aria-hidden', 'false')
|
145
|
-
} else {
|
146
|
-
details.__summary.setAttribute('aria-expanded', 'false')
|
147
|
-
details.__content.setAttribute('aria-hidden', 'true')
|
148
|
-
if (!NATIVE_DETAILS) {
|
149
|
-
details.__content.style.display = 'none'
|
150
|
-
}
|
151
|
-
}
|
152
|
-
|
153
|
-
// Create a circular reference from the summary back to its
|
154
|
-
// parent details element, for convenience in the click handler
|
155
|
-
details.__summary.__details = details
|
156
|
-
|
157
|
-
// If this is not a native implementation, create an arrow
|
158
|
-
// inside the summary
|
159
|
-
if (!NATIVE_DETAILS) {
|
160
|
-
var twisty = document.createElement('i')
|
161
|
-
|
162
|
-
if (openAttr === true) {
|
163
|
-
twisty.className = 'arrow arrow-open'
|
164
|
-
twisty.appendChild(document.createTextNode('\u25bc'))
|
165
|
-
} else {
|
166
|
-
twisty.className = 'arrow arrow-closed'
|
167
|
-
twisty.appendChild(document.createTextNode('\u25ba'))
|
168
|
-
}
|
169
|
-
|
170
|
-
details.__summary.__twisty = details.__summary.insertBefore(twisty, details.__summary.firstChild)
|
171
|
-
details.__summary.__twisty.setAttribute('aria-hidden', 'true')
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
// Define a statechange function that updates aria-expanded and style.display
|
176
|
-
// Also update the arrow position
|
177
|
-
function statechange (summary) {
|
178
|
-
var expanded = summary.__details.__summary.getAttribute('aria-expanded') === 'true'
|
179
|
-
var hidden = summary.__details.__content.getAttribute('aria-hidden') === 'true'
|
180
|
-
|
181
|
-
summary.__details.__summary.setAttribute('aria-expanded', (expanded ? 'false' : 'true'))
|
182
|
-
summary.__details.__content.setAttribute('aria-hidden', (hidden ? 'false' : 'true'))
|
183
|
-
|
184
|
-
if (!NATIVE_DETAILS) {
|
185
|
-
summary.__details.__content.style.display = (expanded ? 'none' : '')
|
186
|
-
|
187
|
-
var hasOpenAttr = summary.__details.getAttribute('open') !== null
|
188
|
-
if (!hasOpenAttr) {
|
189
|
-
summary.__details.setAttribute('open', 'open')
|
190
|
-
} else {
|
191
|
-
summary.__details.removeAttribute('open')
|
192
|
-
}
|
193
|
-
}
|
194
|
-
|
195
|
-
if (summary.__twisty) {
|
196
|
-
summary.__twisty.firstChild.nodeValue = (expanded ? '\u25ba' : '\u25bc')
|
197
|
-
summary.__twisty.setAttribute('class', (expanded ? 'arrow arrow-closed' : 'arrow arrow-open'))
|
198
|
-
}
|
199
|
-
|
200
|
-
return true
|
201
|
-
}
|
202
|
-
|
203
|
-
// Bind a click event to handle summary elements
|
204
|
-
addClickEvent(document, function (e, summary) {
|
205
|
-
if (!(summary = getAncestor(summary, 'summary'))) {
|
206
|
-
return true
|
207
|
-
}
|
208
|
-
return statechange(summary)
|
209
|
-
})
|
210
|
-
}
|
211
|
-
|
212
|
-
// Bind two load events for modern and older browsers
|
213
|
-
// If the first one fires it will set a flag to block the second one
|
214
|
-
// but if it's not supported then the second one will fire
|
215
|
-
addEvent(document, 'DOMContentLoaded', addDetailsPolyfill)
|
216
|
-
addEvent(window, 'load', addDetailsPolyfill)
|
217
|
-
})()
|