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
@@ -3,25 +3,27 @@
|
|
3
3
|
require_relative '../../components/govuk/panel'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the panel component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/panel GDS - Components - Panel}
|
11
|
-
|
12
|
-
module Panel
|
13
|
-
# Generates the HTML for the GOV.UK Panel component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::Panel#initialize)
|
16
|
-
#
|
17
|
-
# @option (see CCS::Components::GovUK::Panel#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Panel
|
18
9
|
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
|
10
|
+
# This helper is used for generating the panel component from the
|
11
|
+
# {https://design-system.service.gov.uk/components/panel GDS - Components - Panel}
|
12
|
+
|
13
|
+
module Panel
|
14
|
+
# Generates the HTML for the GOV.UK Panel component
|
15
|
+
#
|
16
|
+
# @param (see CCS::Components::GovUK::Panel#initialize)
|
17
|
+
#
|
18
|
+
# @option (see CCS::Components::GovUK::Panel#initialize)
|
19
|
+
#
|
20
|
+
# @yield (see CCS::Components::GovUK::Panel#render)
|
21
|
+
#
|
22
|
+
# @return (see CCS::Components::GovUK::Panel#render)
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
def govuk_panel(title_text, panel_text = nil, **options, &block)
|
25
|
+
Components::GovUK::Panel.new(context: self, title_text: title_text, panel_text: panel_text, **options).render(&block)
|
26
|
+
end
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
@@ -3,25 +3,27 @@
|
|
3
3
|
require_relative '../../components/govuk/phase_banner'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the phase banner component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/phase-banner GDS - Components - Phase banner}
|
11
|
-
|
12
|
-
module PhaseBanner
|
13
|
-
# Generates the HTML for the GOV.UK Phase banner component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::PhaseBanner#initialize)
|
16
|
-
#
|
17
|
-
# @option (see CCS::Components::GovUK::PhaseBanner#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Phase banner
|
18
9
|
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
|
10
|
+
# This helper is used for generating the phase banner component from the
|
11
|
+
# {https://design-system.service.gov.uk/components/phase-banner GDS - Components - Phase banner}
|
12
|
+
|
13
|
+
module PhaseBanner
|
14
|
+
# Generates the HTML for the GOV.UK Phase banner component
|
15
|
+
#
|
16
|
+
# @param (see CCS::Components::GovUK::PhaseBanner#initialize)
|
17
|
+
#
|
18
|
+
# @option (see CCS::Components::GovUK::PhaseBanner#initialize)
|
19
|
+
#
|
20
|
+
# @yield (see CCS::Components::GovUK::PhaseBanner#render)
|
21
|
+
#
|
22
|
+
# @return (see CCS::Components::GovUK::PhaseBanner#render)
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
def govuk_phase_banner(tag_options, text = nil, **options, &block)
|
25
|
+
Components::GovUK::PhaseBanner.new(context: self, tag_options: tag_options, text: text, **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/inputs/radios'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the radios component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/radios GDS - Components - Radios}
|
11
|
-
|
12
|
-
module Radios
|
13
|
-
# Generates the HTML for the GOV.UK Radios component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::Inputs::Radios#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Radios
|
16
9
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
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)
|
20
21
|
|
21
|
-
|
22
|
-
|
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
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -3,23 +3,25 @@
|
|
3
3
|
require_relative '../../components/govuk/field/input/select'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the select component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/select GDS - Components - Select}
|
11
|
-
|
12
|
-
module Select
|
13
|
-
# Generates the HTML for the GOV.UK Select component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::Input::Select#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Select
|
16
9
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
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)
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def govuk_select(attribute, items, **options)
|
23
|
+
Components::GovUK::Field::Input::Select.new(context: self, attribute: attribute, items: items, **options).render
|
24
|
+
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -3,23 +3,25 @@
|
|
3
3
|
require_relative '../../components/govuk/skip_link'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the skip link component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/skip-link GDS - Components - Skip link}
|
11
|
-
|
12
|
-
module SkipLink
|
13
|
-
# Generates the HTML for the GOV.UK Skip link component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::SkipLink#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Skip Link
|
16
9
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
10
|
+
# This helper is used for generating the skip link component from the
|
11
|
+
# {https://design-system.service.gov.uk/components/skip-link GDS - Components - Skip link}
|
12
|
+
|
13
|
+
module SkipLink
|
14
|
+
# Generates the HTML for the GOV.UK Skip link component
|
15
|
+
#
|
16
|
+
# @param (see CCS::Components::GovUK::SkipLink#initialize)
|
17
|
+
#
|
18
|
+
# @option (see CCS::Components::GovUK::SkipLink#initialize)
|
19
|
+
#
|
20
|
+
# @return (see CCS::Components::GovUK::SkipLink#render)
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def govuk_skip_link(text, href = nil, **options)
|
23
|
+
Components::GovUK::SkipLink.new(context: self, text: text, href: href, **options).render
|
24
|
+
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -3,31 +3,33 @@
|
|
3
3
|
require_relative '../../components/govuk/step_by_step_navigation'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the Step by step navigation component from the
|
10
|
-
# {https://design-system.service.gov.uk/patterns/step-by-step-navigation/ GDS - Pages - Step by step navigation}
|
11
|
-
#
|
12
|
-
# To use this component you need the following from {https://github.com/alphagov/govuk_publishing_components GOV.UK Publishing Components}.
|
13
|
-
# For the SCSS components you should add:
|
14
|
-
# - {https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss _step-by-step-nav.scss}
|
15
|
-
# - {https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss _step-by-step-nav-related.scss}
|
16
|
-
# - {https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss _step-by-step-nav-header.scss}
|
17
|
-
# For the JavaScript you should add:
|
18
|
-
# - {https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js step-by-step-nav.js}
|
19
|
-
|
20
|
-
module StepByStepNavigation
|
21
|
-
# Generates the HTML for the GOV.UK Step by step navigation component
|
22
|
-
#
|
23
|
-
# @param (see CCS::Components::GovUK::StepByStepNavigation#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Step by step navigation
|
24
9
|
#
|
25
|
-
#
|
10
|
+
# This helper is used for generating the Step by step navigation component from the
|
11
|
+
# {https://design-system.service.gov.uk/patterns/step-by-step-navigation/ GDS - Pages - Step by step navigation}
|
26
12
|
#
|
27
|
-
#
|
13
|
+
# To use this component you need the following from {https://github.com/alphagov/govuk_publishing_components GOV.UK Publishing Components}.
|
14
|
+
# For the SCSS components you should add:
|
15
|
+
# - {https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss _step-by-step-nav.scss}
|
16
|
+
# - {https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss _step-by-step-nav-related.scss}
|
17
|
+
# - {https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss _step-by-step-nav-header.scss}
|
18
|
+
# For the JavaScript you should add:
|
19
|
+
# - {https://github.com/alphagov/govuk_publishing_components/blob/main/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js step-by-step-nav.js}
|
20
|
+
|
21
|
+
module StepByStepNavigation
|
22
|
+
# Generates the HTML for the GOV.UK Step by step navigation component
|
23
|
+
#
|
24
|
+
# @param (see CCS::Components::GovUK::StepByStepNavigation#initialize)
|
25
|
+
#
|
26
|
+
# @option (see CCS::Components::GovUK::StepByStepNavigation#initialize)
|
27
|
+
#
|
28
|
+
# @return (see CCS::Components::GovUK::StepByStepNavigation#render)
|
28
29
|
|
29
|
-
|
30
|
-
|
30
|
+
def govuk_step_by_step_navigation(step_by_step_navigation_sections, **options)
|
31
|
+
Components::GovUK::StepByStepNavigation.new(context: self, step_by_step_navigation_sections: step_by_step_navigation_sections, **options).render
|
32
|
+
end
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
@@ -3,23 +3,25 @@
|
|
3
3
|
require_relative '../../components/govuk/summary_list'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the summary list component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/summary-list GDS - Components - Summary list}
|
11
|
-
|
12
|
-
module SummaryList
|
13
|
-
# Generates the HTML for the GOV.UK Summary list component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::SummaryList#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Summary list
|
16
9
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
10
|
+
# This helper is used for generating the summary list component from the
|
11
|
+
# {https://design-system.service.gov.uk/components/summary-list GDS - Components - Summary list}
|
12
|
+
|
13
|
+
module SummaryList
|
14
|
+
# Generates the HTML for the GOV.UK Summary list component
|
15
|
+
#
|
16
|
+
# @param (see CCS::Components::GovUK::SummaryList#initialize)
|
17
|
+
#
|
18
|
+
# @option (see CCS::Components::GovUK::SummaryList#initialize)
|
19
|
+
#
|
20
|
+
# @return (see CCS::Components::GovUK::SummaryList#render)
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def govuk_summary_list(summary_list_items, **options)
|
23
|
+
Components::GovUK::SummaryList.new(context: self, summary_list_items: summary_list_items, **options).render
|
24
|
+
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -3,23 +3,25 @@
|
|
3
3
|
require_relative '../../components/govuk/table'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the table component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/table GDS - Components - Table}
|
11
|
-
|
12
|
-
module Table
|
13
|
-
# Generates the HTML for the GOV.UK Table component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::Table#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Table
|
16
9
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
10
|
+
# This helper is used for generating the table component from the
|
11
|
+
# {https://design-system.service.gov.uk/components/table GDS - Components - Table}
|
12
|
+
|
13
|
+
module Table
|
14
|
+
# Generates the HTML for the GOV.UK Table component
|
15
|
+
#
|
16
|
+
# @param (see CCS::Components::GovUK::Table#initialize)
|
17
|
+
#
|
18
|
+
# @option (see CCS::Components::GovUK::Table#initialize)
|
19
|
+
#
|
20
|
+
# @return (see CCS::Components::GovUK::Table#render)
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def govuk_table(rows, head_cells = nil, **options)
|
23
|
+
Components::GovUK::Table.new(context: self, rows: rows, head_cells: head_cells, **options).render
|
24
|
+
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -3,23 +3,25 @@
|
|
3
3
|
require_relative '../../components/govuk/tabs'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the tabs component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/tabs GDS - Components - Tabs}
|
11
|
-
|
12
|
-
module Tabs
|
13
|
-
# Generates the HTML for the GOV.UK Tabs component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::Tabs#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Tabs
|
16
9
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
10
|
+
# This helper is used for generating the tabs component from the
|
11
|
+
# {https://design-system.service.gov.uk/components/tabs GDS - Components - Tabs}
|
12
|
+
|
13
|
+
module Tabs
|
14
|
+
# Generates the HTML for the GOV.UK Tabs component
|
15
|
+
#
|
16
|
+
# @param (see CCS::Components::GovUK::Tabs#initialize)
|
17
|
+
#
|
18
|
+
# @option (see CCS::Components::GovUK::Tabs#initialize)
|
19
|
+
#
|
20
|
+
# @return (see CCS::Components::GovUK::Tabs#render)
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def govuk_tabs(items, title = nil, **options)
|
23
|
+
Components::GovUK::Tabs.new(context: self, items: items, title: title, **options).render
|
24
|
+
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -3,23 +3,25 @@
|
|
3
3
|
require_relative '../../components/govuk/tag'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the tag component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/tag GDS - Components - Tag}
|
11
|
-
|
12
|
-
module Tag
|
13
|
-
# Generates the HTML for the GOV.UK Back link component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::Tag#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Tag
|
16
9
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
10
|
+
# This helper is used for generating the tag component from the
|
11
|
+
# {https://design-system.service.gov.uk/components/tag GDS - Components - Tag}
|
12
|
+
|
13
|
+
module Tag
|
14
|
+
# Generates the HTML for the GOV.UK Back link component
|
15
|
+
#
|
16
|
+
# @param (see CCS::Components::GovUK::Tag#initialize)
|
17
|
+
#
|
18
|
+
# @option (see CCS::Components::GovUK::Tag#initialize)
|
19
|
+
#
|
20
|
+
# @return (see CCS::Components::GovUK::Tag#render)
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def govuk_tag(text, colour = nil, **options)
|
23
|
+
Components::GovUK::Tag.new(context: self, text: text, colour: colour, **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/textarea'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the textarea component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/textarea GDS - Components - Textarea}
|
11
|
-
|
12
|
-
module Textarea
|
13
|
-
# Generates the HTML for the GOV.UK Textarea component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::Input::Textarea#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Textarea
|
16
9
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
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)
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
def govuk_textarea(attribute, **options)
|
23
|
+
Components::GovUK::Field::Input::Textarea.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/warning_text'
|
4
4
|
|
5
5
|
module CCS
|
6
|
-
module FrontendHelpers
|
7
|
-
|
8
|
-
|
9
|
-
# This helper is used for generating the warning text component from the
|
10
|
-
# {https://design-system.service.gov.uk/components/warning-text GDS - Components - Warning text}
|
11
|
-
|
12
|
-
module WarningText
|
13
|
-
# Generates the HTML for the GOV.UK Warning text component
|
14
|
-
#
|
15
|
-
# @param (see CCS::Components::GovUK::WarningText#initialize)
|
16
|
-
#
|
17
|
-
# @option (see CCS::Components::GovUK::WarningText#initialize)
|
6
|
+
module FrontendHelpers
|
7
|
+
module GovUKFrontend
|
8
|
+
# = GOV.UK Warning text
|
18
9
|
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
|
10
|
+
# This helper is used for generating the warning text component from the
|
11
|
+
# {https://design-system.service.gov.uk/components/warning-text GDS - Components - Warning text}
|
12
|
+
|
13
|
+
module WarningText
|
14
|
+
# Generates the HTML for the GOV.UK Warning text component
|
15
|
+
#
|
16
|
+
# @param (see CCS::Components::GovUK::WarningText#initialize)
|
17
|
+
#
|
18
|
+
# @option (see CCS::Components::GovUK::WarningText#initialize)
|
19
|
+
#
|
20
|
+
# @yield (see CCS::Components::GovUK::WarningText#render)
|
21
|
+
#
|
22
|
+
# @return (see CCS::Components::GovUK::WarningText#render)
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
def govuk_warning_text(text = nil, **options, &block)
|
25
|
+
Components::GovUK::WarningText.new(context: self, text: text, **options).render(&block)
|
26
|
+
end
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ccs-frontend_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.rc.
|
4
|
+
version: 0.1.0.rc.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tim-s-ccs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|