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
@@ -1,59 +1,61 @@
1
1
  require_relative '../base'
2
2
 
3
- module CCS::Components
4
- module GovUK
5
- # = GOV.UK Warning text
6
- #
7
- # This helper is used for generating the warning text component from the
8
- # {https://design-system.service.gov.uk/components/warning-text GDS - Components - Warning text}
9
- #
10
- # @!attribute [r] text
11
- # @return [String] Text for the warning text
12
-
13
- class WarningText < Base
14
- private
15
-
16
- attr_reader :text
17
-
18
- public
19
-
20
- # @param text [String] (nil) the text for the warning
21
- # If nil, then a block will be rendered
22
- # @param options [Hash] options that will be used in customising the HTML
3
+ module CCS
4
+ module Components
5
+ module GovUK
6
+ # = GOV.UK Warning text
23
7
  #
24
- # @option options [String] :classes additional CSS classes for the tag HTML
25
- # @option options [String] :icon_fallback_text the fallback text for the icon (default: +'Warning'+)
26
- # @option options [Hash] :attributes ({}) any additional attributes that will added as part of the HTML
8
+ # This helper is used for generating the warning text component from the
9
+ # {https://design-system.service.gov.uk/components/warning-text GDS - Components - Warning text}
10
+ #
11
+ # @!attribute [r] text
12
+ # @return [String] Text for the warning text
27
13
 
28
- def initialize(text: nil, **options)
29
- super(**options)
14
+ class WarningText < Base
15
+ private
30
16
 
31
- @text = text
32
- end
17
+ attr_reader :text
33
18
 
34
- # Generates the HTML for the GOV.UK Warning text component
35
- #
36
- # @yield HTML that will be used in the warning text. Ignored if text is passed.
37
- #
38
- # @return [ActiveSupport::SafeBuffer]
39
-
40
- def render
41
- tag.div(**options[:attributes]) do
42
- concat(tag.span('!', class: 'govuk-warning-text__icon'))
43
- concat(tag.strong(class: 'govuk-warning-text__text') do
44
- concat(tag.span(options[:icon_fallback_text] || 'Warning', class: 'govuk-warning-text__assistive'))
45
- if text
46
- concat(text)
47
- else
48
- yield
49
- end
50
- end)
19
+ public
20
+
21
+ # @param text [String] (nil) the text for the warning
22
+ # If nil, then a block will be rendered
23
+ # @param options [Hash] options that will be used in customising the HTML
24
+ #
25
+ # @option options [String] :classes additional CSS classes for the tag HTML
26
+ # @option options [String] :icon_fallback_text the fallback text for the icon (default: +'Warning'+)
27
+ # @option options [Hash] :attributes ({}) any additional attributes that will added as part of the HTML
28
+
29
+ def initialize(text: nil, **options)
30
+ super(**options)
31
+
32
+ @text = text
51
33
  end
52
- end
53
34
 
54
- # The default attributes for the warning text
35
+ # Generates the HTML for the GOV.UK Warning text component
36
+ #
37
+ # @yield HTML that will be used in the warning text. Ignored if text is passed.
38
+ #
39
+ # @return [ActiveSupport::SafeBuffer]
40
+
41
+ def render
42
+ tag.div(**options[:attributes]) do
43
+ concat(tag.span('!', class: 'govuk-warning-text__icon'))
44
+ concat(tag.strong(class: 'govuk-warning-text__text') do
45
+ concat(tag.span(options[:icon_fallback_text] || 'Warning', class: 'govuk-warning-text__assistive'))
46
+ if text
47
+ concat(text)
48
+ else
49
+ yield
50
+ end
51
+ end)
52
+ end
53
+ end
55
54
 
56
- DEFAULT_ATTRIBUTES = { class: 'govuk-warning-text' }.freeze
55
+ # The default attributes for the warning text
56
+
57
+ DEFAULT_ATTRIBUTES = { class: 'govuk-warning-text' }.freeze
58
+ end
57
59
  end
58
60
  end
59
61
  end
@@ -3,22 +3,24 @@
3
3
  require_relative '../../components/ccs/dashboard_section'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::CCSFrontend
7
- # = CCS Dashboard Section
8
- #
9
- # This helper is used for generating the dashboard section component
10
-
11
- module DashboardSection
12
- # Generates the HTML for the CCS Dashboard Section component
13
- #
14
- # @param (see CCS::Components::CCS::DashboardSection#initialize)
6
+ module FrontendHelpers
7
+ module CCSFrontend
8
+ # = CCS Dashboard Section
15
9
  #
16
- # @option (see CCS::Components::CCS::DashboardSection#initialize)
17
- #
18
- # @return (see CCS::Components::CCS::DashboardSection#render)
10
+ # This helper is used for generating the dashboard section component
11
+
12
+ module DashboardSection
13
+ # Generates the HTML for the CCS Dashboard Section component
14
+ #
15
+ # @param (see CCS::Components::CCS::DashboardSection#initialize)
16
+ #
17
+ # @option (see CCS::Components::CCS::DashboardSection#initialize)
18
+ #
19
+ # @return (see CCS::Components::CCS::DashboardSection#render)
19
20
 
20
- def ccs_dashboard_section(dashboard_section_panels, title_text = nil, **options)
21
- Components::CCS::DashboardSection.new(context: self, dashboard_section_panels: dashboard_section_panels, title_text: title_text, **options).render
21
+ def ccs_dashboard_section(dashboard_section_panels, title_text = nil, **options)
22
+ Components::CCS::DashboardSection.new(context: self, dashboard_section_panels: dashboard_section_panels, title_text: title_text, **options).render
23
+ end
22
24
  end
23
25
  end
24
26
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/ccs/footer'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::CCSFrontend
7
- # = CCS Footer
8
- #
9
- # This helper is used for generating the footer component from the
10
- # {https://github.com/tim-s-ccs/ts-ccs-frontend/tree/main/src/ccs/components/footer CCS - Components - Footer}
11
-
12
- module Footer
13
- # Generates the HTML for the CCS Footer component
14
- #
15
- # @param (see CCS::Components::CCS::Footer#initialize)
6
+ module FrontendHelpers
7
+ module CCSFrontend
8
+ # = CCS Footer
16
9
  #
17
- # @option (see CCS::Components::CCS::Footer#initialize)
18
- #
19
- # @return (see CCS::Components::CCS::Footer#render)
10
+ # This helper is used for generating the footer component from the
11
+ # {https://github.com/tim-s-ccs/ts-ccs-frontend/tree/main/src/ccs/components/footer CCS - Components - Footer}
12
+
13
+ module Footer
14
+ # Generates the HTML for the CCS Footer component
15
+ #
16
+ # @param (see CCS::Components::CCS::Footer#initialize)
17
+ #
18
+ # @option (see CCS::Components::CCS::Footer#initialize)
19
+ #
20
+ # @return (see CCS::Components::CCS::Footer#render)
20
21
 
21
- def ccs_footer(**options)
22
- Components::CCS::Footer.new(context: self, **options).render
22
+ def ccs_footer(**options)
23
+ Components::CCS::Footer.new(context: self, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/ccs/header'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::CCSFrontend
7
- # = CCS Header
8
- #
9
- # This helper is used for generating the header component from the
10
- # {https://github.com/tim-s-ccs/ts-ccs-frontend/tree/main/src/ccs/components/header CCS - Components - Header}
11
-
12
- module Header
13
- # Generates the HTML for the CCS Header component
14
- #
15
- # @param (see CCS::Components::CCS::Header#initialize)
6
+ module FrontendHelpers
7
+ module CCSFrontend
8
+ # = CCS Header
16
9
  #
17
- # @option (see CCS::Components::CCS::Header#initialize)
18
- #
19
- # @return (see CCS::Components::CCS::Header#render)
10
+ # This helper is used for generating the header component from the
11
+ # {https://github.com/tim-s-ccs/ts-ccs-frontend/tree/main/src/ccs/components/header CCS - Components - Header}
12
+
13
+ module Header
14
+ # Generates the HTML for the CCS Header component
15
+ #
16
+ # @param (see CCS::Components::CCS::Header#initialize)
17
+ #
18
+ # @option (see CCS::Components::CCS::Header#initialize)
19
+ #
20
+ # @return (see CCS::Components::CCS::Header#render)
20
21
 
21
- def ccs_header(**options)
22
- Components::CCS::Header.new(context: self, **options).render
22
+ def ccs_header(**options)
23
+ Components::CCS::Header.new(context: self, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'ccs_frontend/dashboard_section'
3
4
  require_relative 'ccs_frontend/footer'
4
5
  require_relative 'ccs_frontend/header'
5
- require_relative 'ccs_frontend/dashboard_section'
6
6
 
7
7
  module CCS
8
8
  module FrontendHelpers
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/accordion'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Accordion
8
- #
9
- # This helper is used for generating the accordion component from the
10
- # {https://design-system.service.gov.uk/components/accordion GDS - Components - Accordion}
11
-
12
- module Accordion
13
- # Generates the HTML for the GOV.UK Accordion component
14
- #
15
- # @param (see CCS::Components::GovUK::Accordion#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Accordion
16
9
  #
17
- # @option (see CCS::Components::GovUK::Accordion#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Accordion#render)
10
+ # This helper is used for generating the accordion component from the
11
+ # {https://design-system.service.gov.uk/components/accordion GDS - Components - Accordion}
12
+
13
+ module Accordion
14
+ # Generates the HTML for the GOV.UK Accordion component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Accordion#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Accordion#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Accordion#render)
20
21
 
21
- def govuk_accordion(accordion_id, accordion_sections, **options)
22
- Components::GovUK::Accordion.new(context: self, accordion_id: accordion_id, accordion_sections: accordion_sections, **options).render
22
+ def govuk_accordion(accordion_id, accordion_sections, **options)
23
+ Components::GovUK::Accordion.new(context: self, accordion_id: accordion_id, accordion_sections: accordion_sections, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/back_link'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Back Link
8
- #
9
- # This helper is used for generating the back link component from the
10
- # {https://design-system.service.gov.uk/components/back-link GDS - Components - Back link}
11
-
12
- module BackLink
13
- # Generates the HTML for the GOV.UK Back link component
14
- #
15
- # @param (see CCS::Components::GovUK::BackLink#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Back Link
16
9
  #
17
- # @option (see CCS::Components::GovUK::BackLink#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::BackLink#render)
10
+ # This helper is used for generating the back link component from the
11
+ # {https://design-system.service.gov.uk/components/back-link GDS - Components - Back link}
12
+
13
+ module BackLink
14
+ # Generates the HTML for the GOV.UK Back link component
15
+ #
16
+ # @param (see CCS::Components::GovUK::BackLink#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::BackLink#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::BackLink#render)
20
21
 
21
- def govuk_back_link(text, href, **options)
22
- Components::GovUK::BackLink.new(context: self, text: text, href: href, **options).render
22
+ def govuk_back_link(text, href, **options)
23
+ Components::GovUK::BackLink.new(context: self, text: text, href: href, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/breadcrumbs'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Breadcrumbs
8
- #
9
- # This helper is used for generating the breadcrumbs component from the
10
- # {https://design-system.service.gov.uk/components/breadcrumbs GDS - Components - Breadcrumbs}
11
-
12
- module Breadcrumbs
13
- # Generates the HTML for the GOV.UK breadcrumbs component
14
- #
15
- # @param (see CCS::Components::GovUK::Breadcrumbs#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Breadcrumbs
16
9
  #
17
- # @option (see CCS::Components::GovUK::Breadcrumbs#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Breadcrumbs#render)
10
+ # This helper is used for generating the breadcrumbs component from the
11
+ # {https://design-system.service.gov.uk/components/breadcrumbs GDS - Components - Breadcrumbs}
12
+
13
+ module Breadcrumbs
14
+ # Generates the HTML for the GOV.UK breadcrumbs component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Breadcrumbs#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Breadcrumbs#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Breadcrumbs#render)
20
21
 
21
- def govuk_breadcrumbs(breadcrumb_links, **options)
22
- Components::GovUK::Breadcrumbs.new(context: self, breadcrumb_links: breadcrumb_links, **options).render
22
+ def govuk_breadcrumbs(breadcrumb_links, **options)
23
+ Components::GovUK::Breadcrumbs.new(context: self, breadcrumb_links: breadcrumb_links, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/button'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Button
8
- #
9
- # This helper is used for generating the button component from the
10
- # {https://design-system.service.gov.uk/components/button GDS - Components - Button}
11
-
12
- module Button
13
- # Generates the HTML for the GOV.UK button component
14
- #
15
- # @param (see CCS::Components::GovUK::Button#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Button
16
9
  #
17
- # @option (see CCS::Components::GovUK::Button#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Button#render)
10
+ # This helper is used for generating the button component from the
11
+ # {https://design-system.service.gov.uk/components/button GDS - Components - Button}
12
+
13
+ module Button
14
+ # Generates the HTML for the GOV.UK button component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Button#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Button#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Button#render)
20
21
 
21
- def govuk_button(text, **options)
22
- Components::GovUK::Button.new(context: self, text: text, **options).render
22
+ def govuk_button(text, **options)
23
+ Components::GovUK::Button.new(context: self, text: text, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/field/input/character_count'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Character count
8
- #
9
- # This helper is used for generating the character count component from the
10
- # {https://design-system.service.gov.uk/components/character-count GDS - Components - Character count}
11
-
12
- module CharacterCount
13
- # Generates the HTML for the GOV.UK Character count component
14
- #
15
- # @param (see CCS::Components::GovUK::Input::CharacterCount#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Character count
16
9
  #
17
- # @option (see CCS::Components::GovUK::Input::CharacterCount#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Input::CharacterCount#render)
10
+ # This helper is used for generating the character count component from the
11
+ # {https://design-system.service.gov.uk/components/character-count GDS - Components - Character count}
12
+
13
+ module CharacterCount
14
+ # Generates the HTML for the GOV.UK Character count component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Input::CharacterCount#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Input::CharacterCount#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Input::CharacterCount#render)
20
21
 
21
- def govuk_character_count(attribute, character_count_options, **options)
22
- Components::GovUK::Field::Input::CharacterCount.new(context: self, attribute: attribute, character_count_options: character_count_options, **options).render
22
+ def govuk_character_count(attribute, character_count_options, **options)
23
+ Components::GovUK::Field::Input::CharacterCount.new(context: self, attribute: attribute, character_count_options: character_count_options, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/field/inputs/checkboxes'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Checkboxes
8
- #
9
- # This helper is used for generating the checkboxes component from the
10
- # {https://design-system.service.gov.uk/components/checkboxes GDS - Components - Checkboxes}
11
-
12
- module Checkboxes
13
- # Generates the HTML for the GOV.UK Checkboxes component
14
- #
15
- # @param (see CCS::Components::GovUK::Inputs::Checkboxes#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Checkboxes
16
9
  #
17
- # @option (see CCS::Components::GovUK::Inputs::Checkboxes#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Inputs::Checkboxes#render)
10
+ # This helper is used for generating the checkboxes component from the
11
+ # {https://design-system.service.gov.uk/components/checkboxes GDS - Components - Checkboxes}
12
+
13
+ module Checkboxes
14
+ # Generates the HTML for the GOV.UK Checkboxes component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Inputs::Checkboxes#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Inputs::Checkboxes#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Inputs::Checkboxes#render)
20
21
 
21
- def govuk_checkboxes(attribute, checkbox_items, **options)
22
- Components::GovUK::Field::Inputs::Checkboxes.new(context: self, attribute: attribute, checkbox_items: checkbox_items, **options).render
22
+ def govuk_checkboxes(attribute, checkbox_items, **options)
23
+ Components::GovUK::Field::Inputs::Checkboxes.new(context: self, attribute: attribute, checkbox_items: checkbox_items, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/cookie_banner'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Cookie Banner
8
- #
9
- # This helper is used for generating the cookie banner component from the
10
- # {https://design-system.service.gov.uk/components/cookie-banner GDS - Components - Cookie banner}
11
-
12
- module CookieBanner
13
- # Generates the HTML for the GOV.UK Cookie banner component
14
- #
15
- # @param (see CCS::Components::GovUK::CookieBanner#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Cookie Banner
16
9
  #
17
- # @option (see CCS::Components::GovUK::CookieBanner#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::CookieBanner#render)
10
+ # This helper is used for generating the cookie banner component from the
11
+ # {https://design-system.service.gov.uk/components/cookie-banner GDS - Components - Cookie banner}
12
+
13
+ module CookieBanner
14
+ # Generates the HTML for the GOV.UK Cookie banner component
15
+ #
16
+ # @param (see CCS::Components::GovUK::CookieBanner#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::CookieBanner#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::CookieBanner#render)
20
21
 
21
- def govuk_cookie_banner(messages, **options)
22
- Components::GovUK::CookieBanner.new(context: self, messages: messages, **options).render
22
+ def govuk_cookie_banner(messages, **options)
23
+ Components::GovUK::CookieBanner.new(context: self, messages: messages, **options).render
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -3,23 +3,25 @@
3
3
  require_relative '../../components/govuk/field/inputs/date_input'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Date Input
8
- #
9
- # This helper is used for generating the date input component from the
10
- # {https://design-system.service.gov.uk/components/date-input GDS - Components - Date Input}
11
-
12
- module DateInput
13
- # Generates the HTML for the GOV.UK Date Input component
14
- #
15
- # @param (see CCS::Components::GovUK::Inputs::DateInput#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Date Input
16
9
  #
17
- # @option (see CCS::Components::GovUK::Inputs::DateInput#initialize)
18
- #
19
- # @return (see CCS::Components::GovUK::Inputs::DateInput#render)
10
+ # This helper is used for generating the date input component from the
11
+ # {https://design-system.service.gov.uk/components/date-input GDS - Components - Date Input}
12
+
13
+ module DateInput
14
+ # Generates the HTML for the GOV.UK Date Input component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Inputs::DateInput#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Inputs::DateInput#initialize)
19
+ #
20
+ # @return (see CCS::Components::GovUK::Inputs::DateInput#render)
20
21
 
21
- def govuk_date_input(attribute, **options)
22
- Components::GovUK::Field::Inputs::DateInput.new(context: self, attribute: attribute, **options).render
22
+ def govuk_date_input(attribute, **options)
23
+ Components::GovUK::Field::Inputs::DateInput.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/details'
4
4
 
5
5
  module CCS
6
- module FrontendHelpers::GovUKFrontend
7
- # = GOV.UK Details
8
- #
9
- # This helper is used for generating the details component from the
10
- # {https://design-system.service.gov.uk/components/details GDS - Components - Details}
11
-
12
- module Details
13
- # Generates the HTML for the GOV.UK Details component
14
- #
15
- # @param (see CCS::Components::GovUK::Details#initialize)
16
- #
17
- # @option (see CCS::Components::GovUK::Details#initialize)
6
+ module FrontendHelpers
7
+ module GovUKFrontend
8
+ # = GOV.UK Details
18
9
  #
19
- # @yield (see CCS::Components::GovUK::Details#render)
20
- #
21
- # @return (see CCS::Components::GovUK::Details#render)
10
+ # This helper is used for generating the details component from the
11
+ # {https://design-system.service.gov.uk/components/details GDS - Components - Details}
12
+
13
+ module Details
14
+ # Generates the HTML for the GOV.UK Details component
15
+ #
16
+ # @param (see CCS::Components::GovUK::Details#initialize)
17
+ #
18
+ # @option (see CCS::Components::GovUK::Details#initialize)
19
+ #
20
+ # @yield (see CCS::Components::GovUK::Details#render)
21
+ #
22
+ # @return (see CCS::Components::GovUK::Details#render)
22
23
 
23
- def govuk_details(summary_text, **options, &block)
24
- Components::GovUK::Details.new(context: self, summary_text: summary_text, **options).render(&block)
24
+ def govuk_details(summary_text, **options, &block)
25
+ Components::GovUK::Details.new(context: self, summary_text: summary_text, **options).render(&block)
26
+ end
25
27
  end
26
28
  end
27
29
  end