ccs-frontend_helpers 0.1.0.rc.2 → 0.1.0.rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/Gemfile.lock +1 -1
  4. data/lib/ccs/components/ccs/dashboard_section/panel.rb +43 -41
  5. data/lib/ccs/components/ccs/dashboard_section.rb +50 -48
  6. data/lib/ccs/components/ccs/footer/link.rb +41 -39
  7. data/lib/ccs/components/ccs/footer/meta.rb +49 -48
  8. data/lib/ccs/components/ccs/footer/navigation.rb +51 -50
  9. data/lib/ccs/components/ccs/footer.rb +69 -67
  10. data/lib/ccs/components/ccs/header/link.rb +47 -45
  11. data/lib/ccs/components/ccs/header/navigation.rb +85 -84
  12. data/lib/ccs/components/ccs/header/service_authentication.rb +35 -34
  13. data/lib/ccs/components/ccs/header.rb +87 -85
  14. data/lib/ccs/components/ccs/logo.rb +36 -34
  15. data/lib/ccs/components/govuk/accordion/section/content.rb +42 -42
  16. data/lib/ccs/components/govuk/accordion/section/header.rb +48 -48
  17. data/lib/ccs/components/govuk/accordion/section.rb +49 -48
  18. data/lib/ccs/components/govuk/accordion.rb +43 -41
  19. data/lib/ccs/components/govuk/back_link.rb +39 -37
  20. data/lib/ccs/components/govuk/breadcrumbs/link.rb +42 -40
  21. data/lib/ccs/components/govuk/breadcrumbs.rb +40 -38
  22. data/lib/ccs/components/govuk/button.rb +83 -81
  23. data/lib/ccs/components/govuk/cookie_banner/action.rb +45 -43
  24. data/lib/ccs/components/govuk/cookie_banner/message.rb +57 -55
  25. data/lib/ccs/components/govuk/cookie_banner.rb +40 -38
  26. data/lib/ccs/components/govuk/details.rb +38 -36
  27. data/lib/ccs/components/govuk/error_message.rb +46 -44
  28. data/lib/ccs/components/govuk/error_summary/item.rb +41 -39
  29. data/lib/ccs/components/govuk/error_summary.rb +49 -47
  30. data/lib/ccs/components/govuk/field/input/character_count.rb +101 -99
  31. data/lib/ccs/components/govuk/field/input/file_upload.rb +29 -27
  32. data/lib/ccs/components/govuk/field/input/select.rb +61 -59
  33. data/lib/ccs/components/govuk/field/input/text_input/fix.rb +39 -37
  34. data/lib/ccs/components/govuk/field/input/text_input.rb +75 -73
  35. data/lib/ccs/components/govuk/field/input/textarea.rb +43 -41
  36. data/lib/ccs/components/govuk/field/input.rb +46 -44
  37. data/lib/ccs/components/govuk/field/inputs/checkboxes.rb +43 -41
  38. data/lib/ccs/components/govuk/field/inputs/date_input/item.rb +48 -46
  39. data/lib/ccs/components/govuk/field/inputs/date_input.rb +68 -66
  40. data/lib/ccs/components/govuk/field/inputs/item/checkbox/form.rb +29 -27
  41. data/lib/ccs/components/govuk/field/inputs/item/checkbox/tag.rb +26 -24
  42. data/lib/ccs/components/govuk/field/inputs/item/checkbox.rb +32 -30
  43. data/lib/ccs/components/govuk/field/inputs/item/divider.rb +39 -37
  44. data/lib/ccs/components/govuk/field/inputs/item/radio/form.rb +27 -25
  45. data/lib/ccs/components/govuk/field/inputs/item/radio/tag.rb +26 -24
  46. data/lib/ccs/components/govuk/field/inputs/item/radio.rb +32 -30
  47. data/lib/ccs/components/govuk/field/inputs/item.rb +100 -98
  48. data/lib/ccs/components/govuk/field/inputs/radios.rb +43 -41
  49. data/lib/ccs/components/govuk/field/inputs.rb +42 -40
  50. data/lib/ccs/components/govuk/field.rb +90 -88
  51. data/lib/ccs/components/govuk/fieldset/legend.rb +50 -48
  52. data/lib/ccs/components/govuk/fieldset.rb +40 -38
  53. data/lib/ccs/components/govuk/footer/link.rb +41 -39
  54. data/lib/ccs/components/govuk/footer/meta.rb +49 -48
  55. data/lib/ccs/components/govuk/footer/navigation.rb +51 -50
  56. data/lib/ccs/components/govuk/footer.rb +105 -103
  57. data/lib/ccs/components/govuk/form_group.rb +45 -43
  58. data/lib/ccs/components/govuk/header/link.rb +41 -39
  59. data/lib/ccs/components/govuk/header/navigation.rb +54 -53
  60. data/lib/ccs/components/govuk/header.rb +84 -82
  61. data/lib/ccs/components/govuk/hint.rb +33 -31
  62. data/lib/ccs/components/govuk/inset_text.rb +39 -37
  63. data/lib/ccs/components/govuk/label.rb +61 -59
  64. data/lib/ccs/components/govuk/notification_banner.rb +83 -81
  65. data/lib/ccs/components/govuk/pagination/increment/next.rb +29 -27
  66. data/lib/ccs/components/govuk/pagination/increment/previous.rb +28 -26
  67. data/lib/ccs/components/govuk/pagination/increment.rb +78 -76
  68. data/lib/ccs/components/govuk/pagination/item/ellipsis.rb +17 -15
  69. data/lib/ccs/components/govuk/pagination/item/form.rb +34 -32
  70. data/lib/ccs/components/govuk/pagination/item/tag.rb +33 -31
  71. data/lib/ccs/components/govuk/pagination/item.rb +47 -45
  72. data/lib/ccs/components/govuk/pagination.rb +69 -67
  73. data/lib/ccs/components/govuk/panel.rb +49 -47
  74. data/lib/ccs/components/govuk/phase_banner.rb +50 -48
  75. data/lib/ccs/components/govuk/skip_link.rb +39 -37
  76. data/lib/ccs/components/govuk/step_by_step_navigation/section/content/list/item.rb +40 -38
  77. data/lib/ccs/components/govuk/step_by_step_navigation/section/content/list.rb +30 -28
  78. data/lib/ccs/components/govuk/step_by_step_navigation/section/content/paragraph.rb +28 -26
  79. data/lib/ccs/components/govuk/step_by_step_navigation/section/content.rb +47 -45
  80. data/lib/ccs/components/govuk/step_by_step_navigation/section/heading.rb +49 -47
  81. data/lib/ccs/components/govuk/step_by_step_navigation/section.rb +44 -42
  82. data/lib/ccs/components/govuk/step_by_step_navigation.rb +41 -39
  83. data/lib/ccs/components/govuk/summary_list/action/link.rb +46 -44
  84. data/lib/ccs/components/govuk/summary_list/card/actions.rb +38 -36
  85. data/lib/ccs/components/govuk/summary_list/card/title.rb +37 -35
  86. data/lib/ccs/components/govuk/summary_list/card.rb +48 -46
  87. data/lib/ccs/components/govuk/summary_list/row/actions.rb +38 -36
  88. data/lib/ccs/components/govuk/summary_list/row/key.rb +30 -28
  89. data/lib/ccs/components/govuk/summary_list/row/value.rb +30 -28
  90. data/lib/ccs/components/govuk/summary_list/row.rb +47 -45
  91. data/lib/ccs/components/govuk/summary_list.rb +48 -46
  92. data/lib/ccs/components/govuk/table/body/data_cell.rb +38 -36
  93. data/lib/ccs/components/govuk/table/body/head_cell.rb +37 -35
  94. data/lib/ccs/components/govuk/table/header/head_cell.rb +39 -37
  95. data/lib/ccs/components/govuk/table.rb +83 -81
  96. data/lib/ccs/components/govuk/tabs/panel.rb +47 -45
  97. data/lib/ccs/components/govuk/tabs/tab.rb +42 -40
  98. data/lib/ccs/components/govuk/tabs.rb +48 -46
  99. data/lib/ccs/components/govuk/tag.rb +39 -37
  100. data/lib/ccs/components/govuk/warning_text.rb +49 -47
  101. data/lib/ccs/frontend_helpers/ccs_frontend/dashboard_section.rb +16 -14
  102. data/lib/ccs/frontend_helpers/ccs_frontend/footer.rb +17 -15
  103. data/lib/ccs/frontend_helpers/ccs_frontend/header.rb +17 -15
  104. data/lib/ccs/frontend_helpers/ccs_frontend.rb +1 -1
  105. data/lib/ccs/frontend_helpers/govuk_frontend/accordion.rb +17 -15
  106. data/lib/ccs/frontend_helpers/govuk_frontend/back_link.rb +17 -15
  107. data/lib/ccs/frontend_helpers/govuk_frontend/breadcrumbs.rb +17 -15
  108. data/lib/ccs/frontend_helpers/govuk_frontend/button.rb +17 -15
  109. data/lib/ccs/frontend_helpers/govuk_frontend/character_count.rb +17 -15
  110. data/lib/ccs/frontend_helpers/govuk_frontend/checkboxes.rb +17 -15
  111. data/lib/ccs/frontend_helpers/govuk_frontend/cookie_banner.rb +17 -15
  112. data/lib/ccs/frontend_helpers/govuk_frontend/date_input.rb +17 -15
  113. data/lib/ccs/frontend_helpers/govuk_frontend/details.rb +19 -17
  114. data/lib/ccs/frontend_helpers/govuk_frontend/error_message.rb +32 -30
  115. data/lib/ccs/frontend_helpers/govuk_frontend/error_summary.rb +38 -36
  116. data/lib/ccs/frontend_helpers/govuk_frontend/fieldset.rb +19 -17
  117. data/lib/ccs/frontend_helpers/govuk_frontend/file_upload.rb +17 -15
  118. data/lib/ccs/frontend_helpers/govuk_frontend/footer.rb +17 -15
  119. data/lib/ccs/frontend_helpers/govuk_frontend/form_group.rb +27 -25
  120. data/lib/ccs/frontend_helpers/govuk_frontend/header.rb +17 -15
  121. data/lib/ccs/frontend_helpers/govuk_frontend/hint.rb +18 -16
  122. data/lib/ccs/frontend_helpers/govuk_frontend/input.rb +17 -15
  123. data/lib/ccs/frontend_helpers/govuk_frontend/inset_text.rb +19 -17
  124. data/lib/ccs/frontend_helpers/govuk_frontend/label.rb +18 -16
  125. data/lib/ccs/frontend_helpers/govuk_frontend/notification_banner.rb +19 -17
  126. data/lib/ccs/frontend_helpers/govuk_frontend/pagination.rb +17 -15
  127. data/lib/ccs/frontend_helpers/govuk_frontend/panel.rb +19 -17
  128. data/lib/ccs/frontend_helpers/govuk_frontend/phase_banner.rb +19 -17
  129. data/lib/ccs/frontend_helpers/govuk_frontend/radios.rb +17 -15
  130. data/lib/ccs/frontend_helpers/govuk_frontend/select.rb +17 -15
  131. data/lib/ccs/frontend_helpers/govuk_frontend/skip_link.rb +17 -15
  132. data/lib/ccs/frontend_helpers/govuk_frontend/step_by_step_navigation.rb +24 -22
  133. data/lib/ccs/frontend_helpers/govuk_frontend/summary_list.rb +17 -15
  134. data/lib/ccs/frontend_helpers/govuk_frontend/table.rb +17 -15
  135. data/lib/ccs/frontend_helpers/govuk_frontend/tabs.rb +17 -15
  136. data/lib/ccs/frontend_helpers/govuk_frontend/tag.rb +17 -15
  137. data/lib/ccs/frontend_helpers/govuk_frontend/textarea.rb +17 -15
  138. data/lib/ccs/frontend_helpers/govuk_frontend/warning_text.rb +19 -17
  139. data/lib/ccs/frontend_helpers/version.rb +1 -1
  140. metadata +2 -2
@@ -3,41 +3,43 @@
3
3
  require_relative '../../components/govuk/back_link'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Error Message
8
- #
9
- # This helper is used for generating the error message component from the
10
- # {https://design-system.service.gov.uk/components/error-message GDS - Components - Error message}
11
-
12
- module ErrorMessage
13
- # Generates the HTML for the GOV.UK Error message component
14
- #
15
- # @param (see CCS::Components::GovUK::ErrorMessage#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Error Message
16
9
  #
17
- # @option (see CCS::Components::GovUK::ErrorMessage#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::ErrorMessage#render)
10
+ # This helper is used for generating the error message component from the
11
+ # {https://design-system.service.gov.uk/components/error-message GDS - Components - Error message}
20
12
 
21
- def govuk_error_message(error_message, attribute, **options)
22
- Components::GovUK::ErrorMessage.new(context: self, message: error_message, attribute: attribute, **options).render
23
- end
13
+ module ErrorMessage
14
+ # Generates the HTML for the GOV.UK Error message component
15
+ #
16
+ # @param (see CCS::Components::GovUK::ErrorMessage#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::ErrorMessage#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::ErrorMessage#render)
24
21
 
25
- # Generates the HTML for the GOV.UK Error message component using the error messages in an ActiveModel
26
- #
27
- # @param model [ActiveModel] model that will be used to find the error message
28
- # @param attribute [String, Symbol] the attribute that has an error
29
- # @param options [Hash] options that will be used in customising the HTML
30
- #
31
- # @option (see CCS::Components::GovUK::ErrorMessage#initialize)
32
- #
33
- # @return [NilClass, ActiveSupport::SafeBuffer] if the error message is not on the model it will return nil,
34
- # otherwise it returns the error message HTML
22
+ def govuk_error_message(error_message, attribute, **options)
23
+ Components::GovUK::ErrorMessage.new(context: self, message: error_message, attribute: attribute, **options).render
24
+ end
25
+
26
+ # Generates the HTML for the GOV.UK Error message component using the error messages in an ActiveModel
27
+ #
28
+ # @param model [ActiveModel] model that will be used to find the error message
29
+ # @param attribute [String, Symbol] the attribute that has an error
30
+ # @param options [Hash] options that will be used in customising the HTML
31
+ #
32
+ # @option (see CCS::Components::GovUK::ErrorMessage#initialize)
33
+ #
34
+ # @return [NilClass, ActiveSupport::SafeBuffer] if the error message is not on the model it will return nil,
35
+ # otherwise it returns the error message HTML
35
36
 
36
- def govuk_error_message_with_model(model, attribute, **options)
37
- error_message = model.errors[attribute].first
38
- return unless error_message
37
+ def govuk_error_message_with_model(model, attribute, **options)
38
+ error_message = model.errors[attribute].first
39
+ return unless error_message
39
40
 
40
- Components::GovUK::ErrorMessage.new(context: self, message: error_message, attribute: attribute, **options).render
41
+ Components::GovUK::ErrorMessage.new(context: self, message: error_message, attribute: attribute, **options).render
42
+ end
41
43
  end
42
44
  end
43
45
  end
@@ -3,43 +3,45 @@
3
3
  require_relative '../../components/govuk/error_summary'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Error Summary
8
- #
9
- # This helper is used for generating the error summary component from the
10
- # {https://design-system.service.gov.uk/components/error-summary GDS - Components - Error summary}
11
-
12
- module ErrorSummary
13
- # Generates the HTML for the GOV.UK Error summary component
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Error Summary
14
9
  #
15
- # @param (see CCS::Components::GovUK::ErrorSummary#initialize)
16
- #
17
- # @option (see CCS::Components::GovUK::ErrorSummary#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::ErrorSummary#render)
20
-
21
- def govuk_error_summary(title, error_summary_items, description = nil, **options)
22
- Components::GovUK::ErrorSummary.new(context: self, title: title, error_summary_items: error_summary_items, description: description, **options).render
23
- end
24
-
25
- # Generates the HTML for the GOV.UK Error summary component using the error messages in an ActiveModel
26
- #
27
- # @param model [ActiveModel] model that will be used to find the error messages to list
28
- # @param title [String] text to use for the heading of the error summary block
29
- # @param description [String] (nil) optional text to use for the description of the errors
30
- # @param options [Hash] options that will be used in customising the HTML
31
- #
32
- # @option (see CCS::Components::GovUK::ErrorSummary#initialize)
33
- #
34
- # @return [NilClass, ActiveSupport::SafeBuffer] if error messages are not on the model it will return nil,
35
- # otherwise it returns the error summary HTML.
36
-
37
- def govuk_error_summary_with_model(model, title, description = nil, **options)
38
- return if model.errors.blank?
39
-
40
- error_summary_items = model.errors.map { |error| { text: error.message, href: "##{error.attribute}-error" } }
41
-
42
- Components::GovUK::ErrorSummary.new(context: self, title: title, error_summary_items: error_summary_items, description: description, **options).render
10
+ # This helper is used for generating the error summary component from the
11
+ # {https://design-system.service.gov.uk/components/error-summary GDS - Components - Error summary}
12
+
13
+ module ErrorSummary
14
+ # Generates the HTML for the GOV.UK Error summary component
15
+ #
16
+ # @param (see CCS::Components::GovUK::ErrorSummary#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::ErrorSummary#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::ErrorSummary#render)
21
+
22
+ def govuk_error_summary(title, error_summary_items, description = nil, **options)
23
+ Components::GovUK::ErrorSummary.new(context: self, title: title, error_summary_items: error_summary_items, description: description, **options).render
24
+ end
25
+
26
+ # Generates the HTML for the GOV.UK Error summary component using the error messages in an ActiveModel
27
+ #
28
+ # @param model [ActiveModel] model that will be used to find the error messages to list
29
+ # @param title [String] text to use for the heading of the error summary block
30
+ # @param description [String] (nil) optional text to use for the description of the errors
31
+ # @param options [Hash] options that will be used in customising the HTML
32
+ #
33
+ # @option (see CCS::Components::GovUK::ErrorSummary#initialize)
34
+ #
35
+ # @return [NilClass, ActiveSupport::SafeBuffer] if error messages are not on the model it will return nil,
36
+ # otherwise it returns the error summary HTML.
37
+
38
+ def govuk_error_summary_with_model(model, title, description = nil, **options)
39
+ return if model.errors.blank?
40
+
41
+ error_summary_items = model.errors.map { |error| { text: error.message, href: "##{error.attribute}-error" } }
42
+
43
+ Components::GovUK::ErrorSummary.new(context: self, title: title, error_summary_items: error_summary_items, description: description, **options).render
44
+ end
43
45
  end
44
46
  end
45
47
  end
@@ -3,25 +3,27 @@
3
3
  require_relative '../../components/govuk/fieldset'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Fieldset
8
- #
9
- # This helper is used for generating the fieldset component from the
10
- # {https://design-system.service.gov.uk/components/fieldset GDS - Components - Fieldset}
11
-
12
- module Fieldset
13
- # Generates the HTML for the GOV.UK Fieldset component
14
- #
15
- # @param (see CCS::Components::GovUK::Fieldset#initialize)
16
- #
17
- # @option (see CCS::Components::GovUK::Fieldset#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Fieldset
18
9
  #
19
- # @yield (see CCS::Components::GovUK::Fieldset#render)
20
- #
21
- # @return (see CCS::Components::GovUK::Fieldset#render)
10
+ # This helper is used for generating the fieldset component from the
11
+ # {https://design-system.service.gov.uk/components/fieldset GDS - Components - Fieldset}
12
+
13
+ module Fieldset
14
+ # Generates the HTML for the GOV.UK Fieldset component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Fieldset#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Fieldset#initialize)
19
+ #
20
+ # @yield (see CCS::Components::GovUK::Fieldset#render)
21
+ #
22
+ # @return (see CCS::Components::GovUK::Fieldset#render)
22
23
 
23
- def govuk_fieldset(**options, &block)
24
- Components::GovUK::Fieldset.new(context: self, **options).render(&block)
24
+ def govuk_fieldset(**options, &block)
25
+ Components::GovUK::Fieldset.new(context: self, **options).render(&block)
26
+ end
25
27
  end
26
28
  end
27
29
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/field/input/file_upload'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK File Upload
8
- #
9
- # This helper is used for generating the file upload component from the
10
- # {https://design-system.service.gov.uk/components/file-upload GDS - Components - File Upload}
11
-
12
- module FileUpload
13
- # Generates the HTML for the GOV.UK File Upload component
14
- #
15
- # @param (see CCS::Components::GovUK::Input::FileUpload#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK File Upload
16
9
  #
17
- # @option (see CCS::Components::GovUK::Input::FileUpload#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Input::FileUpload#render)
10
+ # This helper is used for generating the file upload component from the
11
+ # {https://design-system.service.gov.uk/components/file-upload GDS - Components - File Upload}
12
+
13
+ module FileUpload
14
+ # Generates the HTML for the GOV.UK File Upload component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Input::FileUpload#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Input::FileUpload#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Input::FileUpload#render)
20
21
 
21
- def govuk_file_upload(attribute, **options)
22
- Components::GovUK::Field::Input::FileUpload.new(context: self, attribute: attribute, **options).render
22
+ def govuk_file_upload(attribute, **options)
23
+ Components::GovUK::Field::Input::FileUpload.new(context: self, attribute: attribute, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/footer'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Footer
8
- #
9
- # This helper is used for generating the footer component from the
10
- # {https://design-system.service.gov.uk/components/footer GDS - Components - Footer}
11
-
12
- module Footer
13
- # Generates the HTML for the GOV.UK Footer component
14
- #
15
- # @param (see CCS::Components::GovUK::Footer#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Footer
16
9
  #
17
- # @option (see CCS::Components::GovUK::Footer#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Footer#render)
10
+ # This helper is used for generating the footer component from the
11
+ # {https://design-system.service.gov.uk/components/footer GDS - Components - Footer}
12
+
13
+ module Footer
14
+ # Generates the HTML for the GOV.UK Footer component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Footer#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Footer#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Footer#render)
20
21
 
21
- def govuk_footer(**options)
22
- Components::GovUK::Footer.new(context: self, **options).render
22
+ def govuk_footer(**options)
23
+ Components::GovUK::Footer.new(context: self, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,34 +3,36 @@
3
3
  require_relative '../../components/govuk/form_group'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK FormGroup
8
- #
9
- # This helper is used for generating the form group component from the Government Design Systems
10
-
11
- module FormGroup
12
- # Generates the HTML for the GOV.UK Warning text component
13
- #
14
- # @param (see CCS::Components::GovUK::FormGroup#initialize)
15
- #
16
- # @option options [String] :classes additional CSS classes for the form group HTML
17
- # @option options [ActiveModel] :model (nil) model that will be used to find an error message
18
- # @option options [Hash] :attributes ({}) any additional attributes that will added as part of the HTML
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK FormGroup
19
9
  #
20
- # @yield (see CCS::Components::GovUK::FormGroup#render)
21
- #
22
- # @yieldparam (see CCS::Components::GovUK::FormGroup#render)
23
- #
24
- # @return (see CCS::Components::GovUK::FormGroup#render)
10
+ # This helper is used for generating the form group component from the Government Design Systems
11
+
12
+ module FormGroup
13
+ # Generates the HTML for the GOV.UK Warning text component
14
+ #
15
+ # @param (see CCS::Components::GovUK::FormGroup#initialize)
16
+ #
17
+ # @option options [String] :classes additional CSS classes for the form group HTML
18
+ # @option options [ActiveModel] :model (nil) model that will be used to find an error message
19
+ # @option options [Hash] :attributes ({}) any additional attributes that will added as part of the HTML
20
+ #
21
+ # @yield (see CCS::Components::GovUK::FormGroup#render)
22
+ #
23
+ # @yieldparam (see CCS::Components::GovUK::FormGroup#render)
24
+ #
25
+ # @return (see CCS::Components::GovUK::FormGroup#render)
25
26
 
26
- def govuk_form_group(attribute, **options, &block)
27
- error_message = if options[:model]
28
- model.errors[attribute].first
29
- else
30
- options[:error_message]
31
- end
27
+ def govuk_form_group(attribute, **options, &block)
28
+ error_message = if options[:model]
29
+ model.errors[attribute].first
30
+ else
31
+ options[:error_message]
32
+ end
32
33
 
33
- Components::GovUK::FormGroup.new(context: self, attribute: attribute, error_message: error_message, **options).render(&block)
34
+ Components::GovUK::FormGroup.new(context: self, attribute: attribute, error_message: error_message, **options).render(&block)
35
+ end
34
36
  end
35
37
  end
36
38
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/header'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Header
8
- #
9
- # This helper is used for generating the header component from the
10
- # {https://design-system.service.gov.uk/components/header GDS - Components - Header}
11
-
12
- module Header
13
- # Generates the HTML for the GOV.UK Header component
14
- #
15
- # @param (see CCS::Components::GovUK::Header#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Header
16
9
  #
17
- # @option (see CCS::Components::GovUK::Header#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Header#render)
10
+ # This helper is used for generating the header component from the
11
+ # {https://design-system.service.gov.uk/components/header GDS - Components - Header}
12
+
13
+ module Header
14
+ # Generates the HTML for the GOV.UK Header component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Header#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Header#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Header#render)
20
21
 
21
- def govuk_header(**options)
22
- Components::GovUK::Header.new(context: self, **options).render
22
+ def govuk_header(**options)
23
+ Components::GovUK::Header.new(context: self, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,24 +3,26 @@
3
3
  require_relative '../../components/govuk/hint'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Hint
8
- #
9
- # This helper is used for generating the hint text component from the Government Design Systems
10
-
11
- module Hint
12
- # Generates the HTML for the GOV.UK Hint component
13
- #
14
- # @param (see CCS::Components::GovUK::Hint#initialize)
15
- #
16
- # @option (see CCS::Components::GovUK::Hint#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Hint
17
9
  #
18
- # @yield (see CCS::Components::GovUK::Hint#render)
19
- #
20
- # @return (see CCS::Components::GovUK::Hint#render)
10
+ # This helper is used for generating the hint text component from the Government Design Systems
11
+
12
+ module Hint
13
+ # Generates the HTML for the GOV.UK Hint component
14
+ #
15
+ # @param (see CCS::Components::GovUK::Hint#initialize)
16
+ #
17
+ # @option (see CCS::Components::GovUK::Hint#initialize)
18
+ #
19
+ # @yield (see CCS::Components::GovUK::Hint#render)
20
+ #
21
+ # @return (see CCS::Components::GovUK::Hint#render)
21
22
 
22
- def govuk_hint(text = nil, **options, &block)
23
- Components::GovUK::Hint.new(context: self, text: text, **options).render(&block)
23
+ def govuk_hint(text = nil, **options, &block)
24
+ Components::GovUK::Hint.new(context: self, text: text, **options).render(&block)
25
+ end
24
26
  end
25
27
  end
26
28
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/field/input/text_input'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Input
8
- #
9
- # This helper is used for generating the input component from the
10
- # {https://design-system.service.gov.uk/components/text-input GDS - Components - Text Input}
11
-
12
- module Input
13
- # Generates the HTML for the GOV.UK Text Input component
14
- #
15
- # @param (see CCS::Components::GovUK::Input::TextInput#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Input
16
9
  #
17
- # @option (see CCS::Components::GovUK::Input::TextInput#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Input::TextInput#render)
10
+ # This helper is used for generating the input component from the
11
+ # {https://design-system.service.gov.uk/components/text-input GDS - Components - Text Input}
12
+
13
+ module Input
14
+ # Generates the HTML for the GOV.UK Text Input component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Input::TextInput#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Input::TextInput#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Input::TextInput#render)
20
21
 
21
- def govuk_input(attribute, **options)
22
- Components::GovUK::Field::Input::TextInput.new(context: self, attribute: attribute, **options).render
22
+ def govuk_input(attribute, **options)
23
+ Components::GovUK::Field::Input::TextInput.new(context: self, attribute: attribute, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,25 +3,27 @@
3
3
  require_relative '../../components/govuk/inset_text'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Inset Text
8
- #
9
- # This helper is used for generating the inset text component from the
10
- # {https://design-system.service.gov.uk/components/inset-text GDS - Components - Inset text}
11
-
12
- module InsetText
13
- # Generates the HTML for the GOV.UK Inset text component
14
- #
15
- # @param (see CCS::Components::GovUK::InsetText#initialize)
16
- #
17
- # @option (see CCS::Components::GovUK::InsetText#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Inset Text
18
9
  #
19
- # @yield (see CCS::Components::GovUK::InsetText#render)
20
- #
21
- # @return (see CCS::Components::GovUK::InsetText#render)
10
+ # This helper is used for generating the inset text component from the
11
+ # {https://design-system.service.gov.uk/components/inset-text GDS - Components - Inset text}
12
+
13
+ module InsetText
14
+ # Generates the HTML for the GOV.UK Inset text component
15
+ #
16
+ # @param (see CCS::Components::GovUK::InsetText#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::InsetText#initialize)
19
+ #
20
+ # @yield (see CCS::Components::GovUK::InsetText#render)
21
+ #
22
+ # @return (see CCS::Components::GovUK::InsetText#render)
22
23
 
23
- def govuk_inset_text(text = nil, **options, &block)
24
- Components::GovUK::InsetText.new(context: self, text: text, **options).render(&block)
24
+ def govuk_inset_text(text = nil, **options, &block)
25
+ Components::GovUK::InsetText.new(context: self, text: text, **options).render(&block)
26
+ end
25
27
  end
26
28
  end
27
29
  end
@@ -3,24 +3,26 @@
3
3
  require_relative '../../components/govuk/label'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK label
8
- #
9
- # This helper is used for generating the label component from the Government Design Systems
10
-
11
- module Label
12
- # Generates the HTML for the GOV.UK label component
13
- #
14
- # @param (see CCS::Components::GovUK::Label#initialize)
15
- #
16
- # @option (see CCS::Components::GovUK::Label#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK label
17
9
  #
18
- # @yield (see CCS::Components::GovUK::Label#render)
19
- #
20
- # @return (see CCS::Components::GovUK::Label#render)
10
+ # This helper is used for generating the label component from the Government Design Systems
11
+
12
+ module Label
13
+ # Generates the HTML for the GOV.UK label component
14
+ #
15
+ # @param (see CCS::Components::GovUK::Label#initialize)
16
+ #
17
+ # @option (see CCS::Components::GovUK::Label#initialize)
18
+ #
19
+ # @yield (see CCS::Components::GovUK::Label#render)
20
+ #
21
+ # @return (see CCS::Components::GovUK::Label#render)
21
22
 
22
- def govuk_label(attribute, text = nil, **options, &block)
23
- Components::GovUK::Label.new(context: self, attribute: attribute, text: text, **options).render(&block)
23
+ def govuk_label(attribute, text = nil, **options, &block)
24
+ Components::GovUK::Label.new(context: self, attribute: attribute, text: text, **options).render(&block)
25
+ end
24
26
  end
25
27
  end
26
28
  end
@@ -3,25 +3,27 @@
3
3
  require_relative '../../components/govuk/notification_banner'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Notification Banner
8
- #
9
- # This helper is used for generating the notification banner component from the
10
- # {https://design-system.service.gov.uk/components/notification-banner GDS - Components - Notification banner}
11
-
12
- module NotificationBanner
13
- # Generates the HTML for the GOV.UK Notification banner component
14
- #
15
- # @param (see CCS::Components::GovUK::NotificationBanner#initialize)
16
- #
17
- # @option (see CCS::Components::GovUK::NotificationBanner#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Notification Banner
18
9
  #
19
- # @yield (see CCS::Components::GovUK::NotificationBanner#render)
20
- #
21
- # @return (see CCS::Components::GovUK::NotificationBanner#render)
10
+ # This helper is used for generating the notification banner component from the
11
+ # {https://design-system.service.gov.uk/components/notification-banner GDS - Components - Notification banner}
12
+
13
+ module NotificationBanner
14
+ # Generates the HTML for the GOV.UK Notification banner component
15
+ #
16
+ # @param (see CCS::Components::GovUK::NotificationBanner#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::NotificationBanner#initialize)
19
+ #
20
+ # @yield (see CCS::Components::GovUK::NotificationBanner#render)
21
+ #
22
+ # @return (see CCS::Components::GovUK::NotificationBanner#render)
22
23
 
23
- def govuk_notification_banner(text = nil, success_banner = nil, **options, &block)
24
- Components::GovUK::NotificationBanner.new(context: self, text: text, success_banner: success_banner, **options).render(&block)
24
+ def govuk_notification_banner(text = nil, success_banner = nil, **options, &block)
25
+ Components::GovUK::NotificationBanner.new(context: self, text: text, success_banner: success_banner, **options).render(&block)
26
+ end
25
27
  end
26
28
  end
27
29
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/pagination'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Pagination
8
- #
9
- # This helper is used for generating the pagination component from the
10
- # {https://design-system.service.gov.uk/components/pagination GDS - Components - Pagination}
11
-
12
- module Pagination
13
- # Generates the HTML for the GOV.UK Pagination component
14
- #
15
- # @param (see CCS::Components::GovUK::Pagination#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Pagination
16
9
  #
17
- # @option (see CCS::Components::GovUK::Pagination#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Pagination#render)
10
+ # This helper is used for generating the pagination component from the
11
+ # {https://design-system.service.gov.uk/components/pagination GDS - Components - Pagination}
12
+
13
+ module Pagination
14
+ # Generates the HTML for the GOV.UK Pagination component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Pagination#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Pagination#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Pagination#render)
20
21
 
21
- def govuk_pagination(**options)
22
- Components::GovUK::Pagination.new(context: self, **options).render
22
+ def govuk_pagination(**options)
23
+ Components::GovUK::Pagination.new(context: self, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end