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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Gemfile.lock +1 -1
- data/lib/ccs/components/ccs/dashboard_section/panel.rb +43 -41
- data/lib/ccs/components/ccs/dashboard_section.rb +50 -48
- data/lib/ccs/components/ccs/footer/link.rb +41 -39
- data/lib/ccs/components/ccs/footer/meta.rb +49 -48
- data/lib/ccs/components/ccs/footer/navigation.rb +51 -50
- data/lib/ccs/components/ccs/footer.rb +69 -67
- data/lib/ccs/components/ccs/header/link.rb +47 -45
- data/lib/ccs/components/ccs/header/navigation.rb +85 -84
- data/lib/ccs/components/ccs/header/service_authentication.rb +35 -34
- data/lib/ccs/components/ccs/header.rb +87 -85
- data/lib/ccs/components/ccs/logo.rb +36 -34
- data/lib/ccs/components/govuk/accordion/section/content.rb +42 -42
- data/lib/ccs/components/govuk/accordion/section/header.rb +48 -48
- data/lib/ccs/components/govuk/accordion/section.rb +49 -48
- data/lib/ccs/components/govuk/accordion.rb +43 -41
- data/lib/ccs/components/govuk/back_link.rb +39 -37
- data/lib/ccs/components/govuk/breadcrumbs/link.rb +42 -40
- data/lib/ccs/components/govuk/breadcrumbs.rb +40 -38
- data/lib/ccs/components/govuk/button.rb +83 -81
- data/lib/ccs/components/govuk/cookie_banner/action.rb +45 -43
- data/lib/ccs/components/govuk/cookie_banner/message.rb +57 -55
- data/lib/ccs/components/govuk/cookie_banner.rb +40 -38
- data/lib/ccs/components/govuk/details.rb +38 -36
- data/lib/ccs/components/govuk/error_message.rb +46 -44
- data/lib/ccs/components/govuk/error_summary/item.rb +41 -39
- data/lib/ccs/components/govuk/error_summary.rb +49 -47
- data/lib/ccs/components/govuk/field/input/character_count.rb +101 -99
- data/lib/ccs/components/govuk/field/input/file_upload.rb +29 -27
- data/lib/ccs/components/govuk/field/input/select.rb +61 -59
- data/lib/ccs/components/govuk/field/input/text_input/fix.rb +39 -37
- data/lib/ccs/components/govuk/field/input/text_input.rb +75 -73
- data/lib/ccs/components/govuk/field/input/textarea.rb +43 -41
- data/lib/ccs/components/govuk/field/input.rb +46 -44
- data/lib/ccs/components/govuk/field/inputs/checkboxes.rb +43 -41
- data/lib/ccs/components/govuk/field/inputs/date_input/item.rb +48 -46
- data/lib/ccs/components/govuk/field/inputs/date_input.rb +68 -66
- data/lib/ccs/components/govuk/field/inputs/item/checkbox/form.rb +29 -27
- data/lib/ccs/components/govuk/field/inputs/item/checkbox/tag.rb +26 -24
- data/lib/ccs/components/govuk/field/inputs/item/checkbox.rb +32 -30
- data/lib/ccs/components/govuk/field/inputs/item/divider.rb +39 -37
- data/lib/ccs/components/govuk/field/inputs/item/radio/form.rb +27 -25
- data/lib/ccs/components/govuk/field/inputs/item/radio/tag.rb +26 -24
- data/lib/ccs/components/govuk/field/inputs/item/radio.rb +32 -30
- data/lib/ccs/components/govuk/field/inputs/item.rb +100 -98
- data/lib/ccs/components/govuk/field/inputs/radios.rb +43 -41
- data/lib/ccs/components/govuk/field/inputs.rb +42 -40
- data/lib/ccs/components/govuk/field.rb +90 -88
- data/lib/ccs/components/govuk/fieldset/legend.rb +50 -48
- data/lib/ccs/components/govuk/fieldset.rb +40 -38
- data/lib/ccs/components/govuk/footer/link.rb +41 -39
- data/lib/ccs/components/govuk/footer/meta.rb +49 -48
- data/lib/ccs/components/govuk/footer/navigation.rb +51 -50
- data/lib/ccs/components/govuk/footer.rb +105 -103
- data/lib/ccs/components/govuk/form_group.rb +45 -43
- data/lib/ccs/components/govuk/header/link.rb +41 -39
- data/lib/ccs/components/govuk/header/navigation.rb +54 -53
- data/lib/ccs/components/govuk/header.rb +84 -82
- data/lib/ccs/components/govuk/hint.rb +33 -31
- data/lib/ccs/components/govuk/inset_text.rb +39 -37
- data/lib/ccs/components/govuk/label.rb +61 -59
- data/lib/ccs/components/govuk/notification_banner.rb +83 -81
- data/lib/ccs/components/govuk/pagination/increment/next.rb +29 -27
- data/lib/ccs/components/govuk/pagination/increment/previous.rb +28 -26
- data/lib/ccs/components/govuk/pagination/increment.rb +78 -76
- data/lib/ccs/components/govuk/pagination/item/ellipsis.rb +17 -15
- data/lib/ccs/components/govuk/pagination/item/form.rb +34 -32
- data/lib/ccs/components/govuk/pagination/item/tag.rb +33 -31
- data/lib/ccs/components/govuk/pagination/item.rb +47 -45
- data/lib/ccs/components/govuk/pagination.rb +69 -67
- data/lib/ccs/components/govuk/panel.rb +49 -47
- data/lib/ccs/components/govuk/phase_banner.rb +50 -48
- data/lib/ccs/components/govuk/skip_link.rb +39 -37
- data/lib/ccs/components/govuk/step_by_step_navigation/section/content/list/item.rb +40 -38
- data/lib/ccs/components/govuk/step_by_step_navigation/section/content/list.rb +30 -28
- data/lib/ccs/components/govuk/step_by_step_navigation/section/content/paragraph.rb +28 -26
- data/lib/ccs/components/govuk/step_by_step_navigation/section/content.rb +47 -45
- data/lib/ccs/components/govuk/step_by_step_navigation/section/heading.rb +49 -47
- data/lib/ccs/components/govuk/step_by_step_navigation/section.rb +44 -42
- data/lib/ccs/components/govuk/step_by_step_navigation.rb +41 -39
- data/lib/ccs/components/govuk/summary_list/action/link.rb +46 -44
- data/lib/ccs/components/govuk/summary_list/card/actions.rb +38 -36
- data/lib/ccs/components/govuk/summary_list/card/title.rb +37 -35
- data/lib/ccs/components/govuk/summary_list/card.rb +48 -46
- data/lib/ccs/components/govuk/summary_list/row/actions.rb +38 -36
- data/lib/ccs/components/govuk/summary_list/row/key.rb +30 -28
- data/lib/ccs/components/govuk/summary_list/row/value.rb +30 -28
- data/lib/ccs/components/govuk/summary_list/row.rb +47 -45
- data/lib/ccs/components/govuk/summary_list.rb +48 -46
- data/lib/ccs/components/govuk/table/body/data_cell.rb +38 -36
- data/lib/ccs/components/govuk/table/body/head_cell.rb +37 -35
- data/lib/ccs/components/govuk/table/header/head_cell.rb +39 -37
- data/lib/ccs/components/govuk/table.rb +83 -81
- data/lib/ccs/components/govuk/tabs/panel.rb +47 -45
- data/lib/ccs/components/govuk/tabs/tab.rb +42 -40
- data/lib/ccs/components/govuk/tabs.rb +48 -46
- data/lib/ccs/components/govuk/tag.rb +39 -37
- data/lib/ccs/components/govuk/warning_text.rb +49 -47
- data/lib/ccs/frontend_helpers/ccs_frontend/dashboard_section.rb +16 -14
- data/lib/ccs/frontend_helpers/ccs_frontend/footer.rb +17 -15
- data/lib/ccs/frontend_helpers/ccs_frontend/header.rb +17 -15
- data/lib/ccs/frontend_helpers/ccs_frontend.rb +1 -1
- data/lib/ccs/frontend_helpers/govuk_frontend/accordion.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/back_link.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/breadcrumbs.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/button.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/character_count.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/checkboxes.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/cookie_banner.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/date_input.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/details.rb +19 -17
- data/lib/ccs/frontend_helpers/govuk_frontend/error_message.rb +32 -30
- data/lib/ccs/frontend_helpers/govuk_frontend/error_summary.rb +38 -36
- data/lib/ccs/frontend_helpers/govuk_frontend/fieldset.rb +19 -17
- data/lib/ccs/frontend_helpers/govuk_frontend/file_upload.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/footer.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/form_group.rb +27 -25
- data/lib/ccs/frontend_helpers/govuk_frontend/header.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/hint.rb +18 -16
- data/lib/ccs/frontend_helpers/govuk_frontend/input.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/inset_text.rb +19 -17
- data/lib/ccs/frontend_helpers/govuk_frontend/label.rb +18 -16
- data/lib/ccs/frontend_helpers/govuk_frontend/notification_banner.rb +19 -17
- data/lib/ccs/frontend_helpers/govuk_frontend/pagination.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/panel.rb +19 -17
- data/lib/ccs/frontend_helpers/govuk_frontend/phase_banner.rb +19 -17
- data/lib/ccs/frontend_helpers/govuk_frontend/radios.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/select.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/skip_link.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/step_by_step_navigation.rb +24 -22
- data/lib/ccs/frontend_helpers/govuk_frontend/summary_list.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/table.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/tabs.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/tag.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/textarea.rb +17 -15
- data/lib/ccs/frontend_helpers/govuk_frontend/warning_text.rb +19 -17
- data/lib/ccs/frontend_helpers/version.rb +1 -1
- metadata +2 -2
@@ -1,59 +1,61 @@
|
|
1
1
|
require_relative '../base'
|
2
2
|
|
3
|
-
module CCS
|
4
|
-
module
|
5
|
-
|
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
|
-
#
|
25
|
-
#
|
26
|
-
#
|
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
|
-
|
29
|
-
|
14
|
+
class WarningText < Base
|
15
|
+
private
|
30
16
|
|
31
|
-
|
32
|
-
end
|
17
|
+
attr_reader :text
|
33
18
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
-
|
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
|
-
|
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
|
7
|
-
|
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
|
-
#
|
17
|
-
|
18
|
-
|
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
|
-
|
21
|
-
|
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
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
@@ -3,23 +3,25 @@
|
|
3
3
|
require_relative '../../components/govuk/accordion'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
7
|
-
|
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
|
-
#
|
18
|
-
#
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
7
|
-
|
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
|
-
#
|
20
|
-
#
|
21
|
-
|
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
|
-
|
24
|
-
|
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
|