govuk_publishing_components 71.1.0 → 71.2.0

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +1 -1
  3. data/app/assets/stylesheets/component_guide/application.scss +22 -4
  4. data/app/assets/stylesheets/govuk_publishing_components/_base.scss +1 -2
  5. data/app/assets/stylesheets/govuk_publishing_components/all-components.scss +3 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +1 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_app-promo-banner.scss +1 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +25 -19
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_datetime-fields.scss +20 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +2 -5
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +9 -11
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +8 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +7 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +2 -5
  16. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +125 -2
  17. data/app/assets/stylesheets/govuk_publishing_components/lib/_brand-colours.scss +28 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/{components/mixins → mixins}/_index.scss +0 -1
  19. data/app/assets/stylesheets/govuk_publishing_components/specific-components.scss +2 -2
  20. data/app/models/govuk_publishing_components/component_doc.rb +16 -1
  21. data/app/views/govuk_publishing_components/component_guide/show.html.erb +11 -0
  22. data/app/views/govuk_publishing_components/components/_datetime_fields.html.erb +112 -0
  23. data/app/views/govuk_publishing_components/components/_details.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/docs/chart.yml +13 -2
  25. data/app/views/govuk_publishing_components/components/docs/datetime_fields.yml +74 -0
  26. data/config/locales/mfe.yml +258 -0
  27. data/lib/govuk_publishing_components/presenters/datetime_fields_helper.rb +68 -0
  28. data/lib/govuk_publishing_components/version.rb +1 -1
  29. data/lib/govuk_publishing_components.rb +1 -0
  30. metadata +2156 -2094
  31. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +0 -29
  32. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_colours.scss +0 -12
  33. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +0 -127
  34. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss +0 -7
  35. /data/app/assets/stylesheets/govuk_publishing_components/lib/{_print_support.scss → _print-support.scss} +0 -0
  36. /data/app/assets/stylesheets/govuk_publishing_components/{components/mixins → mixins}/_high-contrast-outline.scss +0 -0
@@ -0,0 +1,112 @@
1
+ <%
2
+ date_heading ||= "Date"
3
+ time_heading ||= "Time"
4
+
5
+ error_items_date ||= nil
6
+ error_items ||= nil
7
+ error_items_time ||= nil
8
+
9
+ datetime_fields_helper = GovukPublishingComponents::Presenters::DatetimeFieldsHelper.new(local_assigns)
10
+
11
+ error_id = datetime_fields_helper.error_id()
12
+
13
+ heading_level ||= nil
14
+ heading_size ||= nil
15
+
16
+ date_hint ||= nil
17
+ time_hint ||= nil
18
+
19
+ year ||= nil
20
+ month ||= nil
21
+ day ||= nil
22
+
23
+ hour ||= {}
24
+ hour_name = hour[:name] || "hour"
25
+ hour_id = (hour && hour[:id].present?) ? hour[:id] : "select-hour-#{SecureRandom.hex(4)}"
26
+
27
+ minute ||= {}
28
+ minute_name = minute[:name] || "minute"
29
+ minute_id = (minute && minute[:id].present?) ? minute[:id] : "select-minute-#{SecureRandom.hex(4)}"
30
+
31
+ component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
32
+ component_helper.add_class("gem-c-datetime-fields govuk-form-group")
33
+ component_helper.add_class("govuk-form-group--error") if error_items.present?
34
+
35
+ time_group_classes = %w[govuk-form-group]
36
+ time_group_classes << "govuk-form-group--error" if error_items_time.present?
37
+
38
+ time_select_classes = %w[govuk-select gem-c-datetime-fields__date-time-input]
39
+ time_select_classes << "govuk-select--error" if (@error_items.present? || error_items_time.present?)
40
+ %>
41
+
42
+ <%= tag.div(**component_helper.all_attributes) do %>
43
+ <% if error_items %>
44
+ <%= render "govuk_publishing_components/components/error_message", {
45
+ id: error_id,
46
+ items: error_items,
47
+ } %>
48
+ <% end %>
49
+
50
+ <%= render "govuk_publishing_components/components/date_input", {
51
+ hint: date_hint,
52
+ error_items: error_items_date,
53
+ error_id: error_items.present? ? error_id : nil,
54
+ items: datetime_fields_helper.date_input_items(day, month, year),
55
+ legend_text: date_heading,
56
+ legend_heading_level: heading_level,
57
+ legend_size: heading_size,
58
+ data_attributes: {
59
+ ga4_form_section: date_heading,
60
+ },
61
+ } %>
62
+
63
+ <%= tag.div class: time_group_classes do %>
64
+ <%= render "govuk_publishing_components/components/fieldset", {
65
+ legend_text: time_heading,
66
+ heading_level: heading_level,
67
+ heading_size: heading_size,
68
+ classes: "govuk-date-input",
69
+ data_attributes: {
70
+ ga4_form_section: time_heading,
71
+ },
72
+ } do %>
73
+ <% if time_hint %>
74
+ <%= render "govuk_publishing_components/components/hint", {
75
+ text: time_hint,
76
+ id: "time-hint-#{SecureRandom.hex(4)}",
77
+ } %>
78
+ <% end %>
79
+
80
+ <% if error_items_time %>
81
+ <%= render "govuk_publishing_components/components/error_message", {
82
+ id: error_id,
83
+ items: error_items_time,
84
+ } %>
85
+ <% end %>
86
+
87
+ <div class="gem-c-datetime-fields__date-time-wrapper">
88
+ <div class="gem-c-datetime-fields__date-time">
89
+ <%= render "govuk_publishing_components/components/select", {
90
+ id: hour_id,
91
+ label: "Hour",
92
+ name: hour_name,
93
+ error_id: error_id,
94
+ options: datetime_fields_helper.hour_options(hour),
95
+ } %>
96
+ </div>
97
+
98
+ <p class="govuk-body gem-c-datetime-fields__time-separator">:</p>
99
+
100
+ <div class="gem-c-datetime-fields__date-time">
101
+ <%= render "govuk_publishing_components/components/select", {
102
+ id: minute_id,
103
+ label: "Minute",
104
+ name: minute_name,
105
+ error_id: error_id,
106
+ options: datetime_fields_helper.minute_options(minute),
107
+ } %>
108
+ </div>
109
+ </div>
110
+ <% end %>
111
+ <% end %>
112
+ <% end %>
@@ -17,7 +17,7 @@
17
17
  section: title,
18
18
  index_section: @ga4[:index_section],
19
19
  }
20
- ga4_event.merge!(ga4_attributes)
20
+ ga4_event.merge!(ga4_attributes.symbolize_keys)
21
21
  end
22
22
 
23
23
  summary_aria_attributes ||= {}
@@ -7,8 +7,19 @@ body: |
7
7
  accessibility_criteria: |
8
8
  Charts must:
9
9
 
10
- - use line colours with a contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
11
- - contain a `heading` and `description` so that skip links and semantics are accurate
10
+ - use colours with a contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
11
+ - use colours with an adjacent colour ratio of 3:1 to meet WCAG AA
12
+ - provide an alternative way of interpreting the data, so it can be understood without relying on visual interpretation alone (e.g. a table)
13
+ - contain a heading and description which should explain:
14
+ - the highest and lowest values
15
+ - overall trends or changes
16
+ - significant differences between categories
17
+ - notable peaks, drops or exceptions
18
+ - the period, group or category to which those findings relate
19
+ - have axes, units, legends and data labels with meaningful accessible names or text equivalents
20
+ - have an appropriate table caption or heading
21
+ - not use colour as the sole method of distinguishing data series
22
+ - remain usable when text is resized and the page is zoomed to 200% and 400%
12
23
  shared_accessibility_criteria:
13
24
  - link
14
25
  uses_component_wrapper_helper: true
@@ -0,0 +1,74 @@
1
+ name: Datetime fields (experimental)
2
+ description: Use the datetime fields component to help users enter a datetime for a specific event.
3
+ body: |
4
+ This differs from the [Form date input](/component-guide/date_input) component in a few notable ways. It builds upon that component by adding time fields. Times are chosen using select elements.
5
+
6
+ accessibility_criteria: |
7
+ Inputs in the component must:
8
+
9
+ * accept focus
10
+ * be focusable with a keyboard
11
+ * be usable with a keyboard
12
+ * be usable with touch
13
+ * indicate when they have focus
14
+ * be recognisable as form input elements
15
+ * have correctly associated labels
16
+
17
+ govuk_frontend_components:
18
+ - date-input
19
+ uses_component_wrapper_helper: true
20
+ examples:
21
+ default:
22
+ data: {}
23
+ with_custom_field_names_and_ids:
24
+ data:
25
+ year:
26
+ name: year_field_name
27
+ id: year_id
28
+ month:
29
+ name: month_field_name
30
+ id: month_id
31
+ day:
32
+ name: day_field_name
33
+ id: day_id
34
+ hour:
35
+ name: hour_field_name
36
+ id: hour_id
37
+ minute:
38
+ name: minute_field_name
39
+ id: minute_id
40
+ with_custom_heading_options:
41
+ data:
42
+ heading_level: 2
43
+ heading_size: l
44
+ date_heading: "The date"
45
+ time_heading: "The time"
46
+ with_hint_text:
47
+ data:
48
+ date_hint: For example, 01 August 2022
49
+ time_hint: For example, 09:30 or 19:30
50
+ with_values:
51
+ data:
52
+ year:
53
+ value: 2022
54
+ month:
55
+ value: 1
56
+ day:
57
+ value: 2
58
+ hour:
59
+ value: 9
60
+ minute:
61
+ value: 30
62
+ with_error_items:
63
+ data:
64
+ error_items:
65
+ - text: Descriptive error 1
66
+ - text: Descriptive error 2
67
+ with_separate_date_time_error_items:
68
+ data:
69
+ error_items_date:
70
+ - text: Descriptive date error 1
71
+ - text: Descriptive date error 2
72
+ error_items_time:
73
+ - text: Descriptive time error 1
74
+ - text: Descriptive time error 2
@@ -0,0 +1,258 @@
1
+ ---
2
+ mfe:
3
+ common:
4
+ hide: Maske
5
+ show: Montre
6
+ toggle_less: Montre mwins
7
+ toggle_less_html: Montre mwins <span class='govuk-visually-hidden'>%{visually_hidden_text}</span>
8
+ toggle_more: '%{show} %{number} plis'
9
+ toggle_more_html: "%{show} %{number} plis <span class='govuk-visually-hidden'>%{visually_hidden_text}</span>"
10
+ translations: Tradiksion
11
+ components:
12
+ accordion:
13
+ hide_all: Maske tou seksion
14
+ show_all: Montre tou seksion
15
+ this_section_visually_hidden: " sa seksion-la"
16
+ app_promo_banner:
17
+ aria_label:
18
+ body_text:
19
+ close:
20
+ title_text:
21
+ view:
22
+ article_schema:
23
+ scoped_search_description: Rod dan %{title}
24
+ attachment:
25
+ page:
26
+ one: 1 paz
27
+ other: '%{count} paz'
28
+ opendocument_html: Sa fisie-la dan format <a href='https://www.gov.uk/guidance/using-open-document-formats-odf-in-your-organisation' target=%{target} class='govuk-link'>"OpenDocument"</a>
29
+ order_a_copy: Komann enn exanpler
30
+ preview_aria_label: Konsilte %{title} online
31
+ preview_link: Konsilte online
32
+ reference: 'Ref: %{reference}'
33
+ request_format_cta: Demann enn format aksesib
34
+ request_format_details_html: Si ou servi asistans teknolozik (kouma enn lekter lekran) ek bizin enn version sa dokiman-la dan enn format plis aksesib, avoy enn email lor <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Dir nou ki format ou pe bizin. Li pou ed nou kone ki teknolozi asistans ou pe servi.
35
+ request_format_text: Sa fisie -la kapav pa adapte pou bann itilizater ki servi teknolozi asistans
36
+ back_link:
37
+ back: Retour
38
+ back_to_top_link:
39
+ contents: Konteni
40
+ character_count:
41
+ body: Ou kapav met ziska %{number} %{type}
42
+ type:
43
+ characters: karakter
44
+ words: bann mo
45
+ chart:
46
+ accessibility_heading: Tablo linformasion pou "%{heading}"
47
+ accessibility_html: Sa grafik-la li enn reprezantasion viziel bann linformasion ki disponib dan tablo
48
+ accessibility_link: Pas ziska "%{heading}" tablo linformasion
49
+ source:
50
+ table_dropdown: Afis bann linformasion dan enn tablo
51
+ checkboxes:
52
+ or: ouswa
53
+ contents_list:
54
+ contents: Konteni
55
+ contextual_sidebar:
56
+ pretitle: Egalman inklir dan
57
+ cookie_banner:
58
+ buttons:
59
+ accept_cookies: Aksepte bann cookies siplemanter
60
+ reject_cookies: Refiz bann cookies siplemanter
61
+ view_cookies: Afis bann cookies
62
+ confirmation_message:
63
+ accepted: Ou finn aksepte bann cookies siplemanter
64
+ html: Ou kapav %{link} a ninport ki moman
65
+ link: Sanz paramet ou bann cookies
66
+ rejected: Ou finn refiz bann cookies siplemanter
67
+ hide: Maske sa mesaz-la
68
+ text:
69
+ - Nou itiliz sertin cookies esansiel pou fonksionnman sa sitweb-la
70
+ - Nou swete itiliz bann cookies siplemanter pou konpran kouma ou servi GOV.UK; rapel ou bann paramet ek amelior
71
+ servis piblik
72
+ - Nou ousi itiliz cookies depoze par lezot sitweb pou propoz konteni depi zot servis
73
+ title: Cookies lor GOV.UK
74
+ devolved_nations:
75
+ applies_to: Aplikab a
76
+ aria_label:
77
+ england:
78
+ end: " ek Langleter"
79
+ middle: Langleter
80
+ start: Langleter
81
+ northern_ireland:
82
+ end: " ek Irland-di-Nor"
83
+ middle: Irland-di-Nor
84
+ start: Irland-di-Nor
85
+ scotland:
86
+ end: " ek Lekos"
87
+ middle: Lekos
88
+ start: Lekos
89
+ type:
90
+ consultation: Konsiltasion pou %{nation}
91
+ detailed_guide: Gid pou %{nation}
92
+ guidance: Gid pou %{nation}
93
+ publication: Piblikasion pou %{nation}
94
+ wales:
95
+ end: " ek Wales"
96
+ middle: Wales
97
+ start: Wales
98
+ feedback:
99
+ close:
100
+ dont_include_personal_info: Napa kominik okenn informasion personel ouswa finansie kouma ou Nimero Lasirans
101
+ Nasional ouswa ou kordone ou kart kredi
102
+ email_address: Ladres email
103
+ help_us_improve_govuk: Ed nou amelior GOV.UK
104
+ is_not_useful: sa paz-la pa itil
105
+ is_this_page_useful: Eski sa paz-la itil?
106
+ is_useful: Sa paz-la itil
107
+ maybe: Petet
108
+ more_about_visit: Pou ed nou amelior GOV.UK, nou anvi konn inpe plis lor ou vizit zordi
109
+ 'no': Non
110
+ send: Avoye
111
+ send_me_survey: Avoy mwa sondaz-la
112
+ something_wrong: Signal enn problem konsernan sa paz-la
113
+ thank_you_for_feedback: Mersi pou ou feedback
114
+ what_doing: Ki ou ti pe rod fer?
115
+ what_wrong: Ki problem ou finn rankontre?
116
+ 'yes': Wi
117
+ figure:
118
+ image_credit:
119
+ intervention:
120
+ accessible_link_text_suffix: " (ouver dan enn nouvo tab)"
121
+ layout_footer:
122
+ copyright_html: <a class="govuk-footer__link govuk-footer__copyright-logo" href="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/">© Crown copyright</a>
123
+ licence_html: Tou konteni disponib anba <a class="govuk-footer__link" href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" rel="license">"Open Government Licence v3.0"</a>, sof indikasion kontrer
124
+ navigation_links:
125
+ support_links: Lien asistans
126
+ layout_for_public:
127
+ account_layout:
128
+ feedback:
129
+ banners:
130
+ phase_banner_html: Se enn nouvo servis. Ou <a class="govuk-link" href="https://signin.account.gov.uk/contact-us?supportType=PUBLIC">feedback</a> pou ed nou amelior li.
131
+ navigation:
132
+ menu_bar:
133
+ account:
134
+ link_text: Ou GOV.UK One Login
135
+ manage:
136
+ link_text: Paramet
137
+ layout_header:
138
+ menu: Meni
139
+ top_level: Navigasion prinsipal
140
+ layout_super_navigation_header:
141
+ logo_link_title: Al lor paz-dakey GOV.UK
142
+ menu_toggle_label:
143
+ hide: Maske %{label} meni
144
+ show: Montre %{label} meni
145
+ navigation_link:
146
+ href: "/browse"
147
+ label: Meni
148
+ navigation_links_columns:
149
+ navigation_menu_heading: Meni navigasion
150
+ navigation_search_subheading: Resers
151
+ search_text: Fer resers lor GOV.UK
152
+ metadata:
153
+ and: ek
154
+ from: Depi
155
+ hidden_heading:
156
+ hide_all_updates:
157
+ history: Listwar
158
+ last_updated: Dernie miz-a-zour
159
+ part_of: Inklir dan
160
+ published: Pibliye
161
+ see_all_updates: Get tou bann miz-a-zour
162
+ show_all_updates:
163
+ modal_dialogue:
164
+ close_modal: Ferm bwat dialog modal
165
+ notice:
166
+ banner_title: Inportan
167
+ option_select:
168
+ found_multiple: Bann opsion trouve
169
+ found_single: Opsion trouve
170
+ selected: Seleksione
171
+ organisation_schema:
172
+ all_content_search_description: Dekouver tou konteni depi %{organisation}
173
+ password_input:
174
+ button: Montre
175
+ button_aria_hide_label: Maske mo-de-pas
176
+ button_aria_label: Montre mo-de-pas
177
+ button_hide: Maske
178
+ error_text_prefix: Erer
179
+ label: Mo-de-pas
180
+ password_hidden_announcement: Ou mo-de-pas maske
181
+ password_shown_announcement: Ou mo-de-pas vizib
182
+ pagination:
183
+ next: Prosin
184
+ pagination: Pazinasion
185
+ previous: Presedan
186
+ print_link:
187
+ text: Imprim sa paz-la
188
+ radio:
189
+ or: ouswa
190
+ related_footer_navigation:
191
+ collections: Bann koleksion
192
+ policies: Bann politik
193
+ statistical_data_sets: Lansanb bann done statistik
194
+ topical_events: Bann evennman aktialite
195
+ related_navigation:
196
+ collections: Koleksion
197
+ external_links: Ayer lor internet
198
+ policies: Politik
199
+ publishers: Pibliye par
200
+ related_contacts: Lezot kontak
201
+ related_content: Konteni asosie
202
+ related_external_links: Ayer lor internet
203
+ related_guides: Gid detaye
204
+ statistical_data_sets: Lansanb bann done statistik
205
+ toggle_visually_hidden_text:
206
+ collections:
207
+ related_external_links:
208
+ related_guides:
209
+ related_items:
210
+ statistical_data_sets:
211
+ topical_events:
212
+ topics:
213
+ world_locations:
214
+ topical_events: Evennman aktialite
215
+ topics: Explor sa tem-la
216
+ ukraine:
217
+ links:
218
+ title: Invazion Ukraine
219
+ world_locations: Lokalizasion mondial
220
+ search_box:
221
+ input_title: Resers
222
+ label: Fer resers lor GOV.UK
223
+ search_button: Resers
224
+ service_navigation:
225
+ menu_toggle:
226
+ share_links:
227
+ all_opens_in_new_tab: Bann lien swivan ouver dan enn nouvo tab
228
+ opens_in_new_tab: (ouver dan enn nouvo tab)
229
+ single_page_notification_button:
230
+ subscribe_text: Resevwar bann email konsernan sa paz-la
231
+ unsubscribe_text: Aret resevwar bann email konsernan sa paz-la
232
+ skip_link:
233
+ text: Al direkteman lor konteni prinsipal
234
+ step_by_step_nav:
235
+ hide: Maske
236
+ hide_all: Maske tou bann letap
237
+ show: Montre
238
+ show_all: Montre tou bann letap
239
+ step_by_step_nav_related:
240
+ part_of: Enn parti depi
241
+ this_page_is:
242
+ this_page_is_part_of_html:
243
+ subscription_links:
244
+ email_signup_link_text: Resevwar bann email
245
+ feed_link_label: Kopie-kol sa URL-la dan ou feed reader
246
+ feed_link_text: Abonn avek feed
247
+ subscriptions: Abonnman
248
+ success_alert:
249
+ success: Reisi
250
+ summary_list:
251
+ delete: Delete
252
+ edit: Sanze
253
+ table:
254
+ filter_count: Rezilta pou term-la ki finn mete
255
+ filter_label: Filtre
256
+ filter_message: Okenn rezilta korespondan
257
+ tabs:
258
+ contents: Konteni
@@ -0,0 +1,68 @@
1
+ module GovukPublishingComponents
2
+ module Presenters
3
+ class DatetimeFieldsHelper
4
+ attr_reader :error_items, :error_items_time
5
+
6
+ def initialize(local_assigns)
7
+ @error_items = local_assigns[:error_items]
8
+ @error_items_time = local_assigns[:error_items_time]
9
+ end
10
+
11
+ def error_id
12
+ return "error-#{SecureRandom.hex(4)}" if @error_items
13
+
14
+ "error-time-#{SecureRandom.hex(4)}" if @error_items_time
15
+ end
16
+
17
+ def date_input_items(day, month, year)
18
+ [
19
+ {
20
+ label: "Day",
21
+ name: day ? day[:name] : "day",
22
+ width: 2,
23
+ id: day ? day[:id] : nil,
24
+ value: day ? day[:value] : nil,
25
+ },
26
+ {
27
+ label: "Month",
28
+ name: month ? month[:name] : "month",
29
+ width: 2,
30
+ id: month ? month[:id] : nil,
31
+ value: month ? month[:value] : nil,
32
+ },
33
+ {
34
+ label: "Year",
35
+ name: year ? year[:name] : "year",
36
+ width: 4,
37
+ id: year ? year[:id] : nil,
38
+ value: year ? year[:value] : nil,
39
+ },
40
+ ]
41
+ end
42
+
43
+ def hour_options(hour)
44
+ hour_value = hour && hour[:value].present? ? hour[:value] : ""
45
+ hours = (0..23).to_a
46
+ hour_options = [{ text: "", value: "" }]
47
+
48
+ hours.each do |hour|
49
+ hour_options << { text: hour.to_s.rjust(2, "0"), value: hour.to_s.rjust(2, "0"), selected: hour == hour_value }
50
+ end
51
+
52
+ hour_options
53
+ end
54
+
55
+ def minute_options(minute)
56
+ minute_value = minute && minute[:value].present? ? minute[:value] : ""
57
+ minutes = (0..59).to_a
58
+ minute_options = [{ text: "", value: "" }]
59
+
60
+ minutes.each do |minute|
61
+ minute_options << { text: minute.to_s.rjust(2, "0"), value: minute.to_s.rjust(2, "0"), selected: minute == minute_value }
62
+ end
63
+
64
+ minute_options
65
+ end
66
+ end
67
+ end
68
+ end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "71.1.0".freeze
2
+ VERSION = "71.2.0".freeze
3
3
  end
@@ -16,6 +16,7 @@ require "govuk_publishing_components/presenters/breadcrumb_selector"
16
16
  require "govuk_publishing_components/presenters/button_helper"
17
17
  require "govuk_publishing_components/presenters/chart_helper"
18
18
  require "govuk_publishing_components/presenters/contextual_navigation"
19
+ require "govuk_publishing_components/presenters/datetime_fields_helper"
19
20
  require "govuk_publishing_components/presenters/devolved_nations_helper"
20
21
  require "govuk_publishing_components/presenters/emergency_banner_helper"
21
22
  require "govuk_publishing_components/presenters/layout_footer_helper"