ccs-frontend_helpers 0.1.0.rc.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -5
  3. data/CHANGELOG.md +2 -4
  4. data/Gemfile +1 -15
  5. data/Gemfile.lock +80 -81
  6. data/ccs-frontend_helpers.gemspec +10 -0
  7. data/lib/ccs/frontend_helpers/ccs_frontend/dashboard_panels.rb +79 -0
  8. data/lib/ccs/frontend_helpers/ccs_frontend/footer.rb +119 -6
  9. data/lib/ccs/frontend_helpers/ccs_frontend/header.rb +183 -6
  10. data/lib/ccs/{components/ccs → frontend_helpers/ccs_frontend}/logo.rb +12 -10
  11. data/lib/ccs/frontend_helpers/ccs_frontend.rb +4 -2
  12. data/lib/ccs/frontend_helpers/govuk_frontend/accordion.rb +95 -8
  13. data/lib/ccs/frontend_helpers/govuk_frontend/back_link.rb +17 -6
  14. data/lib/ccs/frontend_helpers/govuk_frontend/breadcrumbs.rb +54 -6
  15. data/lib/ccs/frontend_helpers/govuk_frontend/button.rb +105 -6
  16. data/lib/ccs/frontend_helpers/govuk_frontend/cookie_banner.rb +114 -6
  17. data/lib/ccs/frontend_helpers/govuk_frontend/details.rb +23 -7
  18. data/lib/ccs/frontend_helpers/govuk_frontend/error_message.rb +32 -11
  19. data/lib/ccs/frontend_helpers/govuk_frontend/error_summary.rb +65 -13
  20. data/lib/ccs/frontend_helpers/govuk_frontend/field/character_count.rb +165 -0
  21. data/lib/ccs/frontend_helpers/govuk_frontend/field/checkboxes.rb +200 -0
  22. data/lib/ccs/frontend_helpers/govuk_frontend/field/date_input.rb +153 -0
  23. data/lib/ccs/frontend_helpers/govuk_frontend/field/file_upload.rb +83 -0
  24. data/lib/ccs/frontend_helpers/govuk_frontend/field/input.rb +153 -0
  25. data/lib/ccs/frontend_helpers/govuk_frontend/field/radios.rb +201 -0
  26. data/lib/ccs/frontend_helpers/govuk_frontend/field/select.rb +124 -0
  27. data/lib/ccs/frontend_helpers/govuk_frontend/field/textarea.rb +106 -0
  28. data/lib/ccs/frontend_helpers/govuk_frontend/field.rb +213 -0
  29. data/lib/ccs/frontend_helpers/govuk_frontend/fieldset.rb +48 -7
  30. data/lib/ccs/frontend_helpers/govuk_frontend/footer.rb +161 -6
  31. data/lib/ccs/frontend_helpers/govuk_frontend/form_group.rb +24 -13
  32. data/lib/ccs/frontend_helpers/govuk_frontend/header.rb +139 -6
  33. data/lib/ccs/frontend_helpers/govuk_frontend/hint.rb +17 -8
  34. data/lib/ccs/frontend_helpers/govuk_frontend/inset_text.rb +21 -7
  35. data/lib/ccs/frontend_helpers/govuk_frontend/label.rb +70 -7
  36. data/lib/ccs/frontend_helpers/govuk_frontend/notification_banner.rb +113 -7
  37. data/lib/ccs/frontend_helpers/govuk_frontend/pagination.rb +314 -6
  38. data/lib/ccs/frontend_helpers/govuk_frontend/panel.rb +28 -7
  39. data/lib/ccs/frontend_helpers/govuk_frontend/phase_banner.rb +27 -8
  40. data/lib/ccs/frontend_helpers/govuk_frontend/skip_link.rb +18 -6
  41. data/lib/ccs/frontend_helpers/govuk_frontend/step_by_step_navigation.rb +186 -7
  42. data/lib/ccs/frontend_helpers/govuk_frontend/summary_list.rb +204 -6
  43. data/lib/ccs/frontend_helpers/govuk_frontend/table.rb +100 -11
  44. data/lib/ccs/frontend_helpers/govuk_frontend/tabs.rb +73 -6
  45. data/lib/ccs/frontend_helpers/govuk_frontend/tag.rb +21 -7
  46. data/lib/ccs/frontend_helpers/govuk_frontend/warning_text.rb +30 -7
  47. data/lib/ccs/frontend_helpers/govuk_frontend.rb +19 -17
  48. data/lib/ccs/frontend_helpers/shared_methods.rb +27 -0
  49. data/lib/ccs/frontend_helpers/version.rb +1 -1
  50. metadata +142 -112
  51. data/.ruby-version +0 -1
  52. data/lib/ccs/components/base.rb +0 -64
  53. data/lib/ccs/components/ccs/dashboard_section/panel.rb +0 -57
  54. data/lib/ccs/components/ccs/dashboard_section.rb +0 -71
  55. data/lib/ccs/components/ccs/footer/link.rb +0 -55
  56. data/lib/ccs/components/ccs/footer/meta.rb +0 -59
  57. data/lib/ccs/components/ccs/footer/navigation.rb +0 -60
  58. data/lib/ccs/components/ccs/footer.rb +0 -95
  59. data/lib/ccs/components/ccs/header/link.rb +0 -60
  60. data/lib/ccs/components/ccs/header/navigation.rb +0 -98
  61. data/lib/ccs/components/ccs/header/service_authentication.rb +0 -53
  62. data/lib/ccs/components/ccs/header.rb +0 -110
  63. data/lib/ccs/components/govuk/accordion/section/content.rb +0 -53
  64. data/lib/ccs/components/govuk/accordion/section/header.rb +0 -57
  65. data/lib/ccs/components/govuk/accordion/section.rb +0 -61
  66. data/lib/ccs/components/govuk/accordion.rb +0 -58
  67. data/lib/ccs/components/govuk/back_link.rb +0 -51
  68. data/lib/ccs/components/govuk/breadcrumbs/link.rb +0 -57
  69. data/lib/ccs/components/govuk/breadcrumbs.rb +0 -55
  70. data/lib/ccs/components/govuk/button.rb +0 -107
  71. data/lib/ccs/components/govuk/cookie_banner/action.rb +0 -60
  72. data/lib/ccs/components/govuk/cookie_banner/message.rb +0 -80
  73. data/lib/ccs/components/govuk/cookie_banner.rb +0 -55
  74. data/lib/ccs/components/govuk/details.rb +0 -53
  75. data/lib/ccs/components/govuk/error_message.rb +0 -60
  76. data/lib/ccs/components/govuk/error_summary/item.rb +0 -54
  77. data/lib/ccs/components/govuk/error_summary.rb +0 -70
  78. data/lib/ccs/components/govuk/field/input/character_count.rb +0 -129
  79. data/lib/ccs/components/govuk/field/input/file_upload.rb +0 -44
  80. data/lib/ccs/components/govuk/field/input/select.rb +0 -82
  81. data/lib/ccs/components/govuk/field/input/text_input/fix.rb +0 -55
  82. data/lib/ccs/components/govuk/field/input/text_input.rb +0 -97
  83. data/lib/ccs/components/govuk/field/input/textarea.rb +0 -59
  84. data/lib/ccs/components/govuk/field/input.rb +0 -62
  85. data/lib/ccs/components/govuk/field/inputs/checkboxes.rb +0 -69
  86. data/lib/ccs/components/govuk/field/inputs/date_input/item.rb +0 -65
  87. data/lib/ccs/components/govuk/field/inputs/date_input.rb +0 -89
  88. data/lib/ccs/components/govuk/field/inputs/item/checkbox/form.rb +0 -47
  89. data/lib/ccs/components/govuk/field/inputs/item/checkbox/tag.rb +0 -43
  90. data/lib/ccs/components/govuk/field/inputs/item/checkbox.rb +0 -50
  91. data/lib/ccs/components/govuk/field/inputs/item/divider.rb +0 -50
  92. data/lib/ccs/components/govuk/field/inputs/item/radio/form.rb +0 -44
  93. data/lib/ccs/components/govuk/field/inputs/item/radio/tag.rb +0 -43
  94. data/lib/ccs/components/govuk/field/inputs/item/radio.rb +0 -50
  95. data/lib/ccs/components/govuk/field/inputs/item.rb +0 -111
  96. data/lib/ccs/components/govuk/field/inputs/radios.rb +0 -69
  97. data/lib/ccs/components/govuk/field/inputs.rb +0 -57
  98. data/lib/ccs/components/govuk/field.rb +0 -108
  99. data/lib/ccs/components/govuk/fieldset/legend.rb +0 -65
  100. data/lib/ccs/components/govuk/fieldset.rb +0 -54
  101. data/lib/ccs/components/govuk/footer/link.rb +0 -55
  102. data/lib/ccs/components/govuk/footer/meta.rb +0 -59
  103. data/lib/ccs/components/govuk/footer/navigation.rb +0 -60
  104. data/lib/ccs/components/govuk/footer.rb +0 -131
  105. data/lib/ccs/components/govuk/form_group.rb +0 -60
  106. data/lib/ccs/components/govuk/header/link.rb +0 -56
  107. data/lib/ccs/components/govuk/header/navigation.rb +0 -71
  108. data/lib/ccs/components/govuk/header.rb +0 -107
  109. data/lib/ccs/components/govuk/hint.rb +0 -49
  110. data/lib/ccs/components/govuk/inset_text.rb +0 -52
  111. data/lib/ccs/components/govuk/label.rb +0 -85
  112. data/lib/ccs/components/govuk/notification_banner.rb +0 -107
  113. data/lib/ccs/components/govuk/pagination/increment/next.rb +0 -44
  114. data/lib/ccs/components/govuk/pagination/increment/previous.rb +0 -43
  115. data/lib/ccs/components/govuk/pagination/increment.rb +0 -98
  116. data/lib/ccs/components/govuk/pagination/item/ellipsis.rb +0 -28
  117. data/lib/ccs/components/govuk/pagination/item/form.rb +0 -49
  118. data/lib/ccs/components/govuk/pagination/item/tag.rb +0 -47
  119. data/lib/ccs/components/govuk/pagination/item.rb +0 -64
  120. data/lib/ccs/components/govuk/pagination.rb +0 -96
  121. data/lib/ccs/components/govuk/panel.rb +0 -62
  122. data/lib/ccs/components/govuk/phase_banner.rb +0 -69
  123. data/lib/ccs/components/govuk/skip_link.rb +0 -51
  124. data/lib/ccs/components/govuk/step_by_step_navigation/section/content/list/item.rb +0 -53
  125. data/lib/ccs/components/govuk/step_by_step_navigation/section/content/list.rb +0 -50
  126. data/lib/ccs/components/govuk/step_by_step_navigation/section/content/paragraph.rb +0 -45
  127. data/lib/ccs/components/govuk/step_by_step_navigation/section/content.rb +0 -63
  128. data/lib/ccs/components/govuk/step_by_step_navigation/section/heading.rb +0 -69
  129. data/lib/ccs/components/govuk/step_by_step_navigation/section.rb +0 -56
  130. data/lib/ccs/components/govuk/step_by_step_navigation.rb +0 -59
  131. data/lib/ccs/components/govuk/summary_list/action/link.rb +0 -59
  132. data/lib/ccs/components/govuk/summary_list/card/actions.rb +0 -59
  133. data/lib/ccs/components/govuk/summary_list/card/title.rb +0 -51
  134. data/lib/ccs/components/govuk/summary_list/card.rb +0 -63
  135. data/lib/ccs/components/govuk/summary_list/row/actions.rb +0 -59
  136. data/lib/ccs/components/govuk/summary_list/row/key.rb +0 -47
  137. data/lib/ccs/components/govuk/summary_list/row/value.rb +0 -47
  138. data/lib/ccs/components/govuk/summary_list/row.rb +0 -67
  139. data/lib/ccs/components/govuk/summary_list.rb +0 -74
  140. data/lib/ccs/components/govuk/table/body/data_cell.rb +0 -53
  141. data/lib/ccs/components/govuk/table/body/head_cell.rb +0 -52
  142. data/lib/ccs/components/govuk/table/header/head_cell.rb +0 -54
  143. data/lib/ccs/components/govuk/table.rb +0 -111
  144. data/lib/ccs/components/govuk/tabs/panel.rb +0 -58
  145. data/lib/ccs/components/govuk/tabs/tab.rb +0 -56
  146. data/lib/ccs/components/govuk/tabs.rb +0 -66
  147. data/lib/ccs/components/govuk/tag.rb +0 -51
  148. data/lib/ccs/components/govuk/warning_text.rb +0 -61
  149. data/lib/ccs/frontend_helpers/ccs_frontend/dashboard_section.rb +0 -27
  150. data/lib/ccs/frontend_helpers/govuk_frontend/character_count.rb +0 -28
  151. data/lib/ccs/frontend_helpers/govuk_frontend/checkboxes.rb +0 -28
  152. data/lib/ccs/frontend_helpers/govuk_frontend/date_input.rb +0 -28
  153. data/lib/ccs/frontend_helpers/govuk_frontend/file_upload.rb +0 -28
  154. data/lib/ccs/frontend_helpers/govuk_frontend/input.rb +0 -28
  155. data/lib/ccs/frontend_helpers/govuk_frontend/radios.rb +0 -28
  156. data/lib/ccs/frontend_helpers/govuk_frontend/select.rb +0 -28
  157. data/lib/ccs/frontend_helpers/govuk_frontend/textarea.rb +0 -28
@@ -1,56 +0,0 @@
1
- require_relative '../../base'
2
-
3
- module CCS
4
- module Components
5
- module GovUK
6
- class Tabs < Base
7
- # = GOV.UK Tabs tab
8
- #
9
- # The individual tab
10
- #
11
- # @!attribute [r] index
12
- # @return [Integer] The index of the tab
13
- # @!attribute [r] label
14
- # @return [String] Text for the tab
15
- # @!attribute [r] href
16
- # @return [String] The href for the tab panel
17
-
18
- class Tab < Base
19
- private
20
-
21
- attr_reader :index, :label, :href
22
-
23
- public
24
-
25
- # @param index [Integer] the index of the tab
26
- # @param id_prefix [Integer] prefix used for the id of a panel if no id is specified
27
- # @param label [String] the text for the tab
28
- # @param panel [Hash] used to find the id of the panel. See {Components::GovUK::Tabs::Panel#initialize Panel#initialize} for more details
29
- # @param options [Hash] options that will be used in customising the HTML
30
- #
31
- # @option options [Hash] :attributes any additional attributes that will added as part of the HTML
32
-
33
- def initialize(index:, id_prefix:, label:, panel:, **options)
34
- super(**options)
35
-
36
- @options[:attributes][:class] = 'govuk-tabs__tab'
37
-
38
- @index = index
39
- @label = label
40
- @href = "##{panel.dig(:attributes, :id) || "#{id_prefix}-#{index}"}"
41
- end
42
-
43
- # Generates the HTML for the GOV.UK Tabs tab
44
- #
45
- # @return [ActiveSupport::SafeBuffer]
46
-
47
- def render
48
- tag.li(class: "govuk-tabs__list-item #{'govuk-tabs__list-item--selected' if index == 1}".rstrip) do
49
- link_to(label, href, **options[:attributes])
50
- end
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,66 +0,0 @@
1
- require_relative '../base'
2
- require_relative 'tabs/tab'
3
- require_relative 'tabs/panel'
4
-
5
- module CCS
6
- module Components
7
- module GovUK
8
- # = GOV.UK Tabs
9
- #
10
- # This is used to generate the tabs component from the
11
- # {https://design-system.service.gov.uk/components/tabs GDS - Components - Tabs}
12
- #
13
- # @!attribute [r] title
14
- # @return [String] Title for the tabs table of contents
15
- # @!attribute [r] tabs
16
- # @return [Array<Tabs::Tab>] an array of initialised tabs
17
- # @!attribute [r] panels
18
- # @return [Array<Tabs::Panel>] an array of initialised panel
19
-
20
- class Tabs < Base
21
- private
22
-
23
- attr_reader :title, :tabs, :panels
24
-
25
- public
26
-
27
- # @param items [Array<Hash>] array of the tab items.
28
- # See {Components::GovUK::Tabs::Tab#initialize Tab#initialize}
29
- # and {Components::GovUK::Tabs::Panel#initialize Panel#initialize} for details of the items in the array.
30
- # @param title [NilClass,String] title for the tabs table of contents
31
- # @param id_prefix [String] prefix id for each tab item if no id is specified on each item
32
- # @param options [Hash] options that will be used in customising the HTML
33
- #
34
- # @option options [String] :classes additional CSS classes for the tabs HTML
35
- # @option options [Hash] :attributes ({}) any additional attributes that will be added as part of the HTML
36
-
37
- def initialize(items:, title: nil, id_prefix: nil, **options)
38
- super(**options)
39
-
40
- @title = title || 'Contents'
41
- id_prefix ||= sanitize_to_id(@title.downcase)
42
- @tabs = items.map.with_index(1) { |item, index| Tab.new(index: index, id_prefix: id_prefix, context: @context, **item) }
43
- @panels = items.map.with_index(1) { |item, index| Panel.new(index: index, id_prefix: id_prefix, context: @context, **item[:panel]) }
44
- end
45
-
46
- # Generates the HTML for the GOV.UK Tabs component
47
- #
48
- # @return [ActiveSupport::SafeBuffer]
49
-
50
- def render
51
- tag.div(**options[:attributes]) do
52
- concat(tag.h2(title, class: 'govuk-tabs__title'))
53
- concat(tag.ul(class: 'govuk-tabs__list') do
54
- @tabs.each { |tab| concat(tab.render) }
55
- end)
56
- @panels.each { |panel| concat(panel.render) }
57
- end
58
- end
59
-
60
- # The default attributes for the tabs
61
-
62
- DEFAULT_ATTRIBUTES = { class: 'govuk-tabs', data: { module: 'govuk-tabs' } }.freeze
63
- end
64
- end
65
- end
66
- end
@@ -1,51 +0,0 @@
1
- require_relative '../base'
2
-
3
- module CCS
4
- module Components
5
- module GovUK
6
- # = GOV.UK Tag
7
- #
8
- # This is used to generate the tag component from the
9
- # {https://design-system.service.gov.uk/components/tag GDS - Components - Tag}
10
- #
11
- # @!attribute [r] text
12
- # @return [String] Text for the tag
13
-
14
- class Tag < Base
15
- private
16
-
17
- attr_reader :text
18
-
19
- public
20
-
21
- # @param text [String] the text for the tag
22
- # @param colour [String] optional colour for the tag,
23
- # see {https://design-system.service.gov.uk/components/tag/#additional-colours Tag - Additional colours}
24
- # for available colours in GOV.UK Frontend
25
- # @param options [Hash] options that will be used in customising the HTML
26
- #
27
- # @option options [String] :classes additional CSS classes for the tag HTML
28
- # @option options [Hash] :attributes ({}) any additional attributes that will added as part of the HTML
29
-
30
- def initialize(text:, colour: nil, **options)
31
- super(**options)
32
- @options[:attributes][:class][..8] = "govuk-tag govuk-tag--#{colour}" if colour
33
-
34
- @text = text
35
- end
36
-
37
- # Generates the HTML for the GOV.UK Tag component
38
- #
39
- # @return [ActiveSupport::SafeBuffer]
40
-
41
- def render
42
- tag.strong(text, **options[:attributes])
43
- end
44
-
45
- # The default attributes for the tag
46
-
47
- DEFAULT_ATTRIBUTES = { class: 'govuk-tag' }.freeze
48
- end
49
- end
50
- end
51
- end
@@ -1,61 +0,0 @@
1
- require_relative '../base'
2
-
3
- module CCS
4
- module Components
5
- module GovUK
6
- # = GOV.UK Warning text
7
- #
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
13
-
14
- class WarningText < Base
15
- private
16
-
17
- attr_reader :text
18
-
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
33
- end
34
-
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', aria: { hidden: true }))
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
54
-
55
- # The default attributes for the warning text
56
-
57
- DEFAULT_ATTRIBUTES = { class: 'govuk-warning-text' }.freeze
58
- end
59
- end
60
- end
61
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../components/ccs/dashboard_section'
4
-
5
- module CCS
6
- module FrontendHelpers
7
- module CCSFrontend
8
- # = CCS Dashboard Section
9
- #
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)
20
-
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
24
- end
25
- end
26
- end
27
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../components/govuk/field/input/character_count'
4
-
5
- module CCS
6
- module FrontendHelpers
7
- module GovUKFrontend
8
- # = GOV.UK Character count
9
- #
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)
21
-
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
25
- end
26
- end
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../components/govuk/field/inputs/checkboxes'
4
-
5
- module CCS
6
- module FrontendHelpers
7
- module GovUKFrontend
8
- # = GOV.UK Checkboxes
9
- #
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)
21
-
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
25
- end
26
- end
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../components/govuk/field/inputs/date_input'
4
-
5
- module CCS
6
- module FrontendHelpers
7
- module GovUKFrontend
8
- # = GOV.UK Date Input
9
- #
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)
21
-
22
- def govuk_date_input(attribute, **options)
23
- Components::GovUK::Field::Inputs::DateInput.new(context: self, attribute: attribute, **options).render
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../components/govuk/field/input/file_upload'
4
-
5
- module CCS
6
- module FrontendHelpers
7
- module GovUKFrontend
8
- # = GOV.UK File Upload
9
- #
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)
21
-
22
- def govuk_file_upload(attribute, **options)
23
- Components::GovUK::Field::Input::FileUpload.new(context: self, attribute: attribute, **options).render
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../components/govuk/field/input/text_input'
4
-
5
- module CCS
6
- module FrontendHelpers
7
- module GovUKFrontend
8
- # = GOV.UK Input
9
- #
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)
21
-
22
- def govuk_input(attribute, **options)
23
- Components::GovUK::Field::Input::TextInput.new(context: self, attribute: attribute, **options).render
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../components/govuk/field/inputs/radios'
4
-
5
- module CCS
6
- module FrontendHelpers
7
- module GovUKFrontend
8
- # = GOV.UK Radios
9
- #
10
- # This helper is used for generating the radios component from the
11
- # {https://design-system.service.gov.uk/components/radios GDS - Components - Radios}
12
-
13
- module Radios
14
- # Generates the HTML for the GOV.UK Radios component
15
- #
16
- # @param (see CCS::Components::GovUK::Inputs::Radios#initialize)
17
- #
18
- # @option (see CCS::Components::GovUK::Inputs::Radios#initialize)
19
- #
20
- # @return (see CCS::Components::GovUK::Inputs::Radios#render)
21
-
22
- def govuk_radios(attribute, radio_items, **options)
23
- Components::GovUK::Field::Inputs::Radios.new(context: self, attribute: attribute, radio_items: radio_items, **options).render
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../components/govuk/field/input/select'
4
-
5
- module CCS
6
- module FrontendHelpers
7
- module GovUKFrontend
8
- # = GOV.UK Select
9
- #
10
- # This helper is used for generating the select component from the
11
- # {https://design-system.service.gov.uk/components/select GDS - Components - Select}
12
-
13
- module Select
14
- # Generates the HTML for the GOV.UK Select component
15
- #
16
- # @param (see CCS::Components::GovUK::Input::Select#initialize)
17
- #
18
- # @option (see CCS::Components::GovUK::Input::Select#initialize)
19
- #
20
- # @return (see CCS::Components::GovUK::Input::Select#render)
21
-
22
- def govuk_select(attribute, items, **options)
23
- Components::GovUK::Field::Input::Select.new(context: self, attribute: attribute, items: items, **options).render
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative '../../components/govuk/field/input/textarea'
4
-
5
- module CCS
6
- module FrontendHelpers
7
- module GovUKFrontend
8
- # = GOV.UK Textarea
9
- #
10
- # This helper is used for generating the textarea component from the
11
- # {https://design-system.service.gov.uk/components/textarea GDS - Components - Textarea}
12
-
13
- module Textarea
14
- # Generates the HTML for the GOV.UK Textarea component
15
- #
16
- # @param (see CCS::Components::GovUK::Input::Textarea#initialize)
17
- #
18
- # @option (see CCS::Components::GovUK::Input::Textarea#initialize)
19
- #
20
- # @return (see CCS::Components::GovUK::Input::Textarea#render)
21
-
22
- def govuk_textarea(attribute, **options)
23
- Components::GovUK::Field::Input::Textarea.new(context: self, attribute: attribute, **options).render
24
- end
25
- end
26
- end
27
- end
28
- end