design_system 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +91 -0
- data/Rakefile +47 -0
- data/app/assets/config/design_system_manifest.js +0 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/_base.scss +3 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/all.scss +7 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/_index.scss +38 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/accordion/_accordion.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/accordion/_index.scss +368 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/back-link/_back-link.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/back-link/_index.scss +81 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/breadcrumbs/_breadcrumbs.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/breadcrumbs/_index.scss +132 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/button/_button.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/button/_index.scss +260 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/character-count/_character-count.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/character-count/_index.scss +42 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/checkboxes/_checkboxes.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/checkboxes/_index.scss +309 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/cookie-banner/_cookie-banner.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/cookie-banner/_index.scss +57 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/date-input/_date-input.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/date-input/_index.scss +26 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/details/_details.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/details/_index.scss +137 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/error-message/_error-message.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/error-message/_index.scss +12 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/error-summary/_error-summary.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/error-summary/_index.scss +54 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/exit-this-page/_exit-this-page.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/exit-this-page/_index.scss +90 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/fieldset/_fieldset.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/fieldset/_index.scss +67 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/file-upload/_file-upload.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/file-upload/_index.scss +216 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/footer/_footer.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/footer/_index.scss +192 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/header/_header.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/header/_index.scss +546 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/hint/_hint.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/hint/_index.scss +43 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/input/_index.scss +166 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/input/_input.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/inset-text/_index.scss +24 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/inset-text/_inset-text.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/label/_index.scss +44 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/label/_label.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/notification-banner/_index.scss +91 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/notification-banner/_notification-banner.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/pagination/_index.scss +226 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/pagination/_pagination.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/panel/_index.scss +56 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/panel/_panel.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/password-input/_index.scss +55 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/password-input/_password-input.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/phase-banner/_index.scss +34 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/phase-banner/_phase-banner.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/radios/_index.scss +326 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/radios/_radios.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/select/_index.scss +57 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/select/_select.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/service-navigation/_index.scss +252 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/service-navigation/_service-navigation.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/skip-link/_index.scss +50 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/skip-link/_skip-link.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/summary-list/_index.scss +267 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/summary-list/_summary-list.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/table/_index.scss +73 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/table/_table.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/tabs/_index.scss +132 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/tabs/_tabs.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/tag/_index.scss +95 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/tag/_tag.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/task-list/_index.scss +77 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/task-list/_task-list.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/textarea/_index.scss +48 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/textarea/_textarea.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/warning-text/_index.scss +64 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/warning-text/_warning-text.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_global-styles.scss +18 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_govuk-frontend-properties.scss +13 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_index.scss +6 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_links.scss +40 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_lists.scss +65 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_section-break.scss +49 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_typography.scss +187 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_clearfix.scss +15 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_colour.scss +165 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_device-pixels.scss +36 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_focused.scss +57 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_font-faces.scss +39 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_grid.scss +61 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_index.scss +12 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_links.scss +389 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_media-queries.scss +80 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_shape-arrow.scss +80 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_spacing.scss +171 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_typography.scss +286 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_visually-hidden.scss +86 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/index.scss +9 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_button-group.scss +78 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_form-group.scss +23 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_grid.scss +24 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_index.scss +6 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_main-wrapper.scss +53 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_template.scss +55 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_width-container.scss +75 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_all.scss +7 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_display.scss +24 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_index.scss +5 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_spacing.scss +84 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_text-align.scss +14 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_typography.scss +40 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_width.scss +46 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_assets.scss +82 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_colours-applied.scss +193 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_colours-organisations.scss +380 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_colours-palette.scss +35 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_global-styles.scss +13 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_index.scss +34 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_links.scss +47 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_measurements.scss +105 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_media-queries.scss +23 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_spacing.scss +76 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_typography-font.scss +50 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_typography-responsive.scss +315 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_warnings.scss +76 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_exports.scss +33 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_font-url.scss +26 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_image-url.scss +26 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_index.scss +6 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_px-to-em.scss +20 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_px-to-rem.scss +20 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_rebrand.scss +63 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/utilities/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/utilities/_clearfix.scss +5 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/utilities/_index.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/utilities/_visually-hidden.scss +9 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/vendor/_sass-mq.scss +347 -0
- data/app/assets/stylesheets/design_system/govuk.scss +7 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/_index.scss +38 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/action-link/_action-link.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/action-link/_index.scss +73 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/back-link/_back-link.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/back-link/_index.scss +66 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/breadcrumb/_breadcrumb.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/breadcrumb/_index.scss +138 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/button/_button.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/button/_index.scss +257 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/card/_card.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/card/_index.scss +321 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/character-count/_character-count.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/character-count/_index.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/checkboxes/_checkboxes.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/checkboxes/_index.scss +155 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/contents-list/_contents-list.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/contents-list/_index.scss +40 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/date-input/_date-input.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/date-input/_index.scss +29 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/details/_details.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/details/_index.scss +211 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/do-dont-list/_do-dont-list.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/do-dont-list/_index.scss +23 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-message/_error-message.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-message/_index.scss +17 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-summary/_error-summary.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-summary/_index.scss +72 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/fieldset/_fieldset.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/fieldset/_index.scss +65 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/footer/_footer.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/footer/_index.scss +87 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-base.scss +495 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-organisation.scss +126 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-service.scss +60 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-transactional.scss +61 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-white.scss +117 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_index.scss +5 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hero/_hero.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hero/_index.scss +187 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hint/_hint.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hint/_index.scss +51 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/images/_images.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/images/_index.scss +48 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/input/_index.scss +149 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/input/_input.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/inset-text/_index.scss +28 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/inset-text/_inset-text.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/label/_index.scss +53 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/label/_label.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/pagination/_index.scss +95 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/pagination/_pagination.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/panel/_index.scss +57 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/panel/_panel.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/radios/_index.scss +180 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/radios/_radios.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/select/_index.scss +44 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/select/_select.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/skip-link/_index.scss +34 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/skip-link/_skip-link.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/summary-list/_index.scss +183 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/summary-list/_summary-list.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tables/_index.scss +181 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tables/_tables.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tabs/_index.scss +120 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tabs/_tabs.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tag/_index.scss +92 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tag/_tag.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/task-list/_index.scss +101 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/task-list/_task-list.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/textarea/_index.scss +30 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/textarea/_textarea.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/warning-callout/_index.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/warning-callout/_warning-callout.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/_index.scss +11 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/all.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_forms.scss +16 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_index.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_links.scss +42 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_page.scss +43 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_table.scss +62 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/generic/_box-sizing.scss +26 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/generic/_font-face.scss +47 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/generic/_index.scss +6 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_form-group.scss +25 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_grid.scss +23 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_index.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_main-wrapper.scss +96 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_width-container.scss +63 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_breakpoints.scss +18 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_colours.scss +188 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_globals.scss +82 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_index.scss +10 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_spacing.scss +79 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_typography.scss +176 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_warnings.scss +82 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_icons.scss +105 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_index.scss +4 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_lists.scss +115 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_section-break.scss +71 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_typography.scss +297 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_exports.scss +47 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_focused.scss +86 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_functions.scss +45 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_grid.scss +138 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_ifff.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_index.scss +15 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_links.scss +184 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_mixins.scss +520 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_sass-mq.scss +79 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_shape-arrow.scss +91 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_spacing.scss +192 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_typography.scss +259 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_clearfix.scss +15 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_display.scss +15 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_float.scss +15 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_grid-widths.scss +97 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_index.scss +16 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_link-nowrap.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_list-border.scss +20 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_reading-width.scss +16 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_spacing.scss +88 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_text-align.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_typography.scss +72 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_visually-hidden.scss +20 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_widths.scss +62 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/vendor/sass-mq.scss +316 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/nhsuk.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk.scss +5 -0
- data/app/controllers/concerns/design_system/branded.rb +21 -0
- data/app/helpers/css_helper.rb +13 -0
- data/app/helpers/design_system_helper.rb +113 -0
- data/app/javascript/design_system/controllers/hello_world_controller.js +7 -0
- data/app/javascript/design_system/controllers/show_password_controller.js +40 -0
- data/app/javascript/design_system/index.js +11 -0
- data/app/views/govuk/_navigation.html.erb +14 -0
- data/app/views/layouts/_alert_and_notice.html.erb +7 -0
- data/app/views/layouts/govuk/application.html.erb +196 -0
- data/app/views/layouts/govuk/full_page.html.erb +2 -0
- data/app/views/layouts/govuk/left_panel.html.erb +2 -0
- data/app/views/layouts/nhsuk/application.html.erb +132 -0
- data/app/views/layouts/nhsuk/full_page.html.erb +2 -0
- data/app/views/layouts/nhsuk/left_panel.html.erb +2 -0
- data/app/views/nhsuk/_navigation.html.erb +25 -0
- data/config/importmap.rb +4 -0
- data/config/initializers/govuk_form_builder_overrides.rb +128 -0
- data/config/routes.rb +3 -0
- data/lib/design_system/all.rb +3 -0
- data/lib/design_system/components/summary_list.rb +53 -0
- data/lib/design_system/components/tab.rb +20 -0
- data/lib/design_system/components/table.rb +68 -0
- data/lib/design_system/engine.rb +30 -0
- data/lib/design_system/generic/builders/base.rb +18 -0
- data/lib/design_system/generic/builders/button.rb +35 -0
- data/lib/design_system/generic/builders/callout.rb +28 -0
- data/lib/design_system/generic/builders/concerns/brand_derivable.rb +14 -0
- data/lib/design_system/generic/builders/elements/breadcrumbs.rb +45 -0
- data/lib/design_system/generic/builders/elements/form.rb +23 -0
- data/lib/design_system/generic/builders/elements/headings.rb +31 -0
- data/lib/design_system/generic/builders/fixed_elements.rb +38 -0
- data/lib/design_system/generic/builders/heading.rb +38 -0
- data/lib/design_system/generic/builders/link.rb +37 -0
- data/lib/design_system/generic/builders/notification.rb +43 -0
- data/lib/design_system/generic/builders/pagination_renderer.rb +85 -0
- data/lib/design_system/generic/builders/panel.rb +18 -0
- data/lib/design_system/generic/builders/summary_list.rb +84 -0
- data/lib/design_system/generic/builders/tab.rb +17 -0
- data/lib/design_system/generic/builders/table.rb +76 -0
- data/lib/design_system/generic/form_builder.rb +54 -0
- data/lib/design_system/generic.rb +15 -0
- data/lib/design_system/govuk/builders/button.rb +57 -0
- data/lib/design_system/govuk/builders/callout.rb +26 -0
- data/lib/design_system/govuk/builders/elements/breadcrumbs.rb +33 -0
- data/lib/design_system/govuk/builders/elements/headings.rb +18 -0
- data/lib/design_system/govuk/builders/fixed_elements.rb +17 -0
- data/lib/design_system/govuk/builders/heading.rb +11 -0
- data/lib/design_system/govuk/builders/link.rb +23 -0
- data/lib/design_system/govuk/builders/notification.rb +11 -0
- data/lib/design_system/govuk/builders/pagination_renderer.rb +80 -0
- data/lib/design_system/govuk/builders/panel.rb +18 -0
- data/lib/design_system/govuk/builders/summary_list.rb +44 -0
- data/lib/design_system/govuk/builders/tab.rb +56 -0
- data/lib/design_system/govuk/builders/table.rb +79 -0
- data/lib/design_system/govuk/form_builder.rb +430 -0
- data/lib/design_system/govuk.rb +19 -0
- data/lib/design_system/nhsuk/builders/button.rb +11 -0
- data/lib/design_system/nhsuk/builders/callout.rb +11 -0
- data/lib/design_system/nhsuk/builders/elements/breadcrumbs.rb +47 -0
- data/lib/design_system/nhsuk/builders/fixed_elements.rb +15 -0
- data/lib/design_system/nhsuk/builders/heading.rb +11 -0
- data/lib/design_system/nhsuk/builders/link.rb +21 -0
- data/lib/design_system/nhsuk/builders/notification.rb +17 -0
- data/lib/design_system/nhsuk/builders/pagination_renderer.rb +16 -0
- data/lib/design_system/nhsuk/builders/panel.rb +11 -0
- data/lib/design_system/nhsuk/builders/summary_list.rb +34 -0
- data/lib/design_system/nhsuk/builders/tab.rb +11 -0
- data/lib/design_system/nhsuk/builders/table.rb +68 -0
- data/lib/design_system/nhsuk/form_builder.rb +83 -0
- data/lib/design_system/nhsuk.rb +18 -0
- data/lib/design_system/registry.rb +40 -0
- data/lib/design_system/version.rb +3 -0
- data/lib/design_system.rb +7 -0
- data/lib/tasks/design_system_tasks.rake +4 -0
- data/lib/tasks/govuk.rake +122 -0
- data/lib/tasks/nhsuk.rake +108 -0
- data/public/design_system/static/design_system-0.7.0/design_system.js +1309 -0
- data/public/design_system/static/govuk-frontend-5.11.1/fonts/bold-affa96571d-v2.woff +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/fonts/bold-b542beb274-v2.woff2 +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/fonts/light-94a07e06a1-v2.woff2 +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/fonts/light-f591b13f7d-v2.woff +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/govuk-frontend.min.js +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/govuk-frontend.min.js.map +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/favicon.ico +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/favicon.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-crest.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-icon-180.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-icon-192.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-icon-512.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-icon-mask.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-opengraph-image.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/manifest.json +39 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/favicon.ico +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/favicon.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-crest.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-icon-180.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-icon-192.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-icon-512.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-icon-mask.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-opengraph-image.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/manifest.json +39 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/apple-touch-icon-180x180.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/apple-touch-icon.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon-192x192.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon.ico +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/largetile-310x310.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/mediumtile-144x144.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/mediumtile-150x150.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/smalltile-70x70.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/widetile-310x150.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-arrow-left.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-arrow-right-circle.svg +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-arrow-right.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-chevron-left.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-chevron-right.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-close.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-cross.svg +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-emdash-small.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-emdash.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-minus.svg +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-plus.svg +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-search.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-tick.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/logos/logo-nhs.svg +5 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/logos/nhs-logo.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/logos/open-graph.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/nhsuk.js +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/nhsuk.min.js +1 -0
- data/public/design_system/static/stimulus-3.2.2/stimulus-loading.js +87 -0
- data/public/design_system/static/tailwind-4.1.6/index.js +8 -0
- metadata +517 -0
@@ -0,0 +1,128 @@
|
|
1
|
+
require 'govuk_design_system_formbuilder'
|
2
|
+
|
3
|
+
module GOVUKDesignSystemFormBuilder
|
4
|
+
class Base
|
5
|
+
# Builds the values used for HTML id attributes throughout the builder
|
6
|
+
# A monkey patch to build component identifiers in rails style (use underscores instead of dashes)
|
7
|
+
#
|
8
|
+
# @param id_type [String] a description of the id's type, eg +hint+, +error+
|
9
|
+
# @param delimiter [String] the characters used to 'split' the output
|
10
|
+
# @param replace [String] a placeholder for coping with govuk_design_system_formbuilder callers where it expects a replace argument
|
11
|
+
# @param attribute_name [String] overrides the object's +@attribute_name+
|
12
|
+
# @param include_value [Boolean] controls whether or not the value will form part
|
13
|
+
# of the final id
|
14
|
+
#
|
15
|
+
# @return [String] the id composed of object, attribute, value and type
|
16
|
+
#
|
17
|
+
# @example
|
18
|
+
# build_id('hint') #=> "person_name_hint"
|
19
|
+
def build_id(id_type, delimiter = '_', _replace = '_', attribute_name: nil, include_value: true)
|
20
|
+
attribute = attribute_name || @attribute_name
|
21
|
+
value = (include_value && @value) || nil
|
22
|
+
|
23
|
+
parts = [@object_name, attribute, value]
|
24
|
+
parts << id_type unless id_type.empty?
|
25
|
+
|
26
|
+
parts.compact.join(delimiter)
|
27
|
+
end
|
28
|
+
|
29
|
+
# @example
|
30
|
+
# field_id #=> "person_name"
|
31
|
+
# field_id(link_errors: true) #=> "person_name_error"
|
32
|
+
def field_id(link_errors: false)
|
33
|
+
if link_errors && has_errors?
|
34
|
+
build_id('error', include_value: false)
|
35
|
+
else
|
36
|
+
build_id('')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
module Elements
|
42
|
+
class ErrorSummary
|
43
|
+
def field_id(attribute)
|
44
|
+
if attribute.eql?(:base) && @link_base_errors_to.present?
|
45
|
+
build_id('', attribute_name: @link_base_errors_to)
|
46
|
+
else
|
47
|
+
build_id('error', attribute_name: attribute)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class Label
|
53
|
+
private
|
54
|
+
|
55
|
+
def retrieve_text(option_text, hidden)
|
56
|
+
text = [option_text, localised_text(:label), @attribute_name.capitalize].find(&:presence)
|
57
|
+
hidden_class = brand.in?(%w[nhsuk ndrsuk]) ? 'u-visually-hidden' : 'visually-hidden'
|
58
|
+
|
59
|
+
if hidden
|
60
|
+
tag.span(text, class: %(#{brand}-#{hidden_class}))
|
61
|
+
else
|
62
|
+
text
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class Legend
|
68
|
+
using PrefixableArray
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
def classes
|
73
|
+
hidden_class = brand.in?(%w[nhsuk ndrsuk]) ? 'u-visually-hidden' : 'visually-hidden'
|
74
|
+
build_classes(
|
75
|
+
%(fieldset__legend),
|
76
|
+
@size_class,
|
77
|
+
hidden_class => @hidden
|
78
|
+
).prefix(brand)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
module Traits
|
84
|
+
module Error
|
85
|
+
private
|
86
|
+
|
87
|
+
def error_element
|
88
|
+
# Check if @html_attributes is defined and contains the suppress_error key.
|
89
|
+
# This instance variable is typically set by other traits like Traits::Input or Traits::Field.
|
90
|
+
if instance_variable_defined?(:@html_attributes) &&
|
91
|
+
@html_attributes &&
|
92
|
+
@html_attributes.key?(:suppress_error) &&
|
93
|
+
@html_attributes[:suppress_error]
|
94
|
+
@error_element = NullErrorElement.new(*bound) # Suppress the error message
|
95
|
+
else
|
96
|
+
# The `bound` method (from Elements::Base) provides [@builder, @object_name, @attribute_name].
|
97
|
+
@error_element ||= GOVUKDesignSystemFormBuilder::Elements::ErrorMessage.new(*bound)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# Null Object for suppressed error messages
|
104
|
+
class NullErrorElement
|
105
|
+
# Takes the same arguments as the real ErrorMessage constructor for compatibility
|
106
|
+
def initialize(builder, object_name, attribute_name, **_kwargs)
|
107
|
+
# We don't need to store them for this null object
|
108
|
+
end
|
109
|
+
|
110
|
+
def html
|
111
|
+
ActiveSupport::SafeBuffer.new # Renders no HTML
|
112
|
+
end
|
113
|
+
|
114
|
+
def to_s
|
115
|
+
'' # Returns an empty string if the object itself is converted to a string
|
116
|
+
end
|
117
|
+
|
118
|
+
def error_id
|
119
|
+
nil # Important for aria-describedby, indicates no specific error ID
|
120
|
+
end
|
121
|
+
|
122
|
+
private
|
123
|
+
|
124
|
+
def has_errors?
|
125
|
+
false # So it doesn't try to render itself as if it has errors
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DesignSystem
|
4
|
+
module Components
|
5
|
+
class SummaryList
|
6
|
+
attr_accessor :rows
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@rows = []
|
10
|
+
end
|
11
|
+
|
12
|
+
# Add a new row to the summary list.
|
13
|
+
# Use this method to add rows containing single key-value pair
|
14
|
+
def add_row(*args, key: nil, value: nil, &block)
|
15
|
+
key, value = args if args.any?
|
16
|
+
|
17
|
+
row_builder = SummaryListRowBuilder.new
|
18
|
+
row_builder.add_key(key) if key
|
19
|
+
row_builder.add_value(value) if value
|
20
|
+
|
21
|
+
yield(row_builder) if block_given?
|
22
|
+
@rows << row_builder.row
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class SummaryListRowBuilder
|
27
|
+
attr_reader :row
|
28
|
+
|
29
|
+
def initialize
|
30
|
+
@row = {
|
31
|
+
key: {},
|
32
|
+
values: [],
|
33
|
+
actions: []
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Required element for a row in the summary list
|
38
|
+
def add_key(content, options = {})
|
39
|
+
@row[:key] = { content: content.to_s, options: }
|
40
|
+
end
|
41
|
+
|
42
|
+
# Use this method to add multiple values in a single row
|
43
|
+
def add_value(content, options = {})
|
44
|
+
@row[:values] << { content: content.to_s, options: }
|
45
|
+
end
|
46
|
+
|
47
|
+
# Use this method to add an action to a row and add link via options hash
|
48
|
+
def add_action(content, options = {})
|
49
|
+
@row[:actions] << { content: content.to_s, options: }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DesignSystem
|
4
|
+
module Components
|
5
|
+
# This class helps to design Tab component
|
6
|
+
class Tab
|
7
|
+
attr_accessor :tabs, :title
|
8
|
+
|
9
|
+
def initialize(view_context = nil)
|
10
|
+
@view_context = view_context
|
11
|
+
@tabs = []
|
12
|
+
end
|
13
|
+
|
14
|
+
def add_tab_panel(name, content, id = nil, selected: false, &block)
|
15
|
+
content ||= @view_context.capture(&block) if block_given?
|
16
|
+
@tabs << [name, content, id, selected]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DesignSystem
|
4
|
+
module Components
|
5
|
+
# This is the class to define table component structure
|
6
|
+
class Table
|
7
|
+
attr_accessor :caption, :columns, :rows
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@columns = []
|
11
|
+
@rows = []
|
12
|
+
end
|
13
|
+
|
14
|
+
def add_column(content, options = {})
|
15
|
+
@columns << { content:, options: }
|
16
|
+
end
|
17
|
+
|
18
|
+
def add_numeric_column(content, options = {})
|
19
|
+
default_options = { type: 'numeric' }
|
20
|
+
@columns << { content:, options: default_options.merge(options) }
|
21
|
+
end
|
22
|
+
|
23
|
+
def add_row(*cells, &block)
|
24
|
+
if block_given?
|
25
|
+
row_builder = TableRowBuilder.new(@columns)
|
26
|
+
block.call(row_builder)
|
27
|
+
@rows << row_builder.cells
|
28
|
+
else
|
29
|
+
row = cells.map.with_index do |content, i|
|
30
|
+
options = @columns[i][:options][:type] == 'numeric' ? { type: 'numeric' } : {}
|
31
|
+
{ content:, options: }
|
32
|
+
end
|
33
|
+
@rows << row
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# This class helps in building the row for the table <tr>
|
39
|
+
class TableRowBuilder
|
40
|
+
attr_reader :cells
|
41
|
+
|
42
|
+
def initialize(columns)
|
43
|
+
@cells = []
|
44
|
+
@columns = columns
|
45
|
+
end
|
46
|
+
|
47
|
+
def add_cell(content = nil, options = {}, &block)
|
48
|
+
if block_given?
|
49
|
+
options = content || {}
|
50
|
+
content = block
|
51
|
+
end
|
52
|
+
|
53
|
+
index = @cells.size
|
54
|
+
|
55
|
+
if index >= @columns.size
|
56
|
+
raise ArgumentError,
|
57
|
+
"Too many cells in row (expected at most #{@columns.size}, got #{index + 1})"
|
58
|
+
end
|
59
|
+
|
60
|
+
if @columns[index][:options][:type] == 'numeric'
|
61
|
+
default_options = { type: 'numeric' }
|
62
|
+
options = default_options.merge(options)
|
63
|
+
end
|
64
|
+
@cells << { content:, options: }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'action_dispatch/middleware/remote_ip'
|
2
|
+
require 'stimulus-rails'
|
3
|
+
|
4
|
+
module DesignSystem
|
5
|
+
# This is the main engine class for the design system.
|
6
|
+
class Engine < ::Rails::Engine
|
7
|
+
# Allow changes to the design system to be reloaded in development.
|
8
|
+
config.autoload_paths << File.expand_path('..', __dir__) if Rails.env.development?
|
9
|
+
|
10
|
+
initializer 'design_system.importmap', before: 'importmap' do |app|
|
11
|
+
app.config.importmap.paths << Engine.root.join('config/importmap.rb')
|
12
|
+
end
|
13
|
+
|
14
|
+
# Adding Rack::Static to serve up assets from the design_systems
|
15
|
+
initializer 'design_system.add_middleware' do |app|
|
16
|
+
app.middleware.insert_after(
|
17
|
+
::ActionDispatch::RemoteIp,
|
18
|
+
::Rack::Static,
|
19
|
+
urls: [
|
20
|
+
"/design_system/static/design_system-#{DesignSystem::VERSION}",
|
21
|
+
'/design_system/static/govuk-frontend-5.11.1',
|
22
|
+
'/design_system/static/nhsuk-frontend-9.6.4',
|
23
|
+
'/design_system/static/stimulus-3.2.2',
|
24
|
+
'/design_system/static/tailwind-4.1.6'
|
25
|
+
],
|
26
|
+
root: DesignSystem::Engine.root.join('public')
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DesignSystem
|
4
|
+
module Generic
|
5
|
+
module Builders
|
6
|
+
# This is the base class for design system builders.
|
7
|
+
class Base
|
8
|
+
include CssHelper
|
9
|
+
include DesignSystem::Generic::Builders::Concerns::BrandDerivable
|
10
|
+
delegate :button_tag, :capture, :content_for, :content_tag, :link_to, :link_to_unless_current, to: :@context
|
11
|
+
|
12
|
+
def initialize(context)
|
13
|
+
@context = context
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
|
5
|
+
module DesignSystem
|
6
|
+
module Generic
|
7
|
+
module Builders
|
8
|
+
# This class provides generic methods to display button on html.
|
9
|
+
class Button < Base
|
10
|
+
def render_button(content_or_options = nil, options = nil, &)
|
11
|
+
options = prep_button_options(content_or_options, options)
|
12
|
+
|
13
|
+
if block_given?
|
14
|
+
button_tag(options = nil, &)
|
15
|
+
else
|
16
|
+
button_tag(content_or_options, options)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def prep_button_options(content_or_options, options)
|
23
|
+
if content_or_options.is_a? Hash
|
24
|
+
options = content_or_options
|
25
|
+
else
|
26
|
+
options ||= {}
|
27
|
+
end
|
28
|
+
|
29
|
+
{ 'name' => 'button', 'type' => 'submit',
|
30
|
+
'data-module' => "#{brand}-button" }.merge!(options.stringify_keys)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DesignSystem
|
4
|
+
module Generic
|
5
|
+
module Builders
|
6
|
+
# This generates html for rendering warning callout to help users identify and understand warning content on the page, even if they do not read the whole page.
|
7
|
+
class Callout < Base
|
8
|
+
def render_callout(label, body)
|
9
|
+
safe_buffer = ActiveSupport::SafeBuffer.new
|
10
|
+
content_tag(:div, class: "#{brand}-warning-callout") do
|
11
|
+
safe_buffer.concat(render_label(label))
|
12
|
+
safe_buffer.concat(content_tag(:p, body))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def render_label(label)
|
19
|
+
content_tag(:h3, class: "#{brand}-warning-callout__label") do
|
20
|
+
content_tag(:span, role: 'text') do
|
21
|
+
content_tag(:span, 'Important: ', class: "#{brand}-u-visually-hidden") + label
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module DesignSystem
|
2
|
+
module Generic
|
3
|
+
module Builders
|
4
|
+
module Concerns
|
5
|
+
# Mixin module to make brand method available to builder classes
|
6
|
+
module BrandDerivable
|
7
|
+
def brand
|
8
|
+
self.class.name.split('::')[1].underscore
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module DesignSystem
|
2
|
+
module Generic
|
3
|
+
module Builders
|
4
|
+
module Elements
|
5
|
+
# This mixin module is used to provide breadcrumbs.
|
6
|
+
module Breadcrumbs
|
7
|
+
def breadcrumb(label, path)
|
8
|
+
@breadcrumbs ||= []
|
9
|
+
@breadcrumbs << { label:, path: }
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def content_for_breadcrumbs
|
15
|
+
content_for(:breadcrumbs) do
|
16
|
+
safe_buffer = ActiveSupport::SafeBuffer.new
|
17
|
+
|
18
|
+
@breadcrumbs.each do |breadcrumb|
|
19
|
+
safe_buffer.concat(render_breadcrumb(breadcrumb))
|
20
|
+
safe_buffer.concat(' > ') unless @breadcrumbs.last == breadcrumb
|
21
|
+
end
|
22
|
+
|
23
|
+
safe_buffer
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def home_path?(path)
|
28
|
+
root_hash = Rails.application.routes.recognize_path(@context.root_path)
|
29
|
+
path_hash = Rails.application.routes.recognize_path(path)
|
30
|
+
|
31
|
+
%i[controller action].each do |key|
|
32
|
+
return false if root_hash[key] != path_hash[key]
|
33
|
+
end
|
34
|
+
|
35
|
+
true
|
36
|
+
end
|
37
|
+
|
38
|
+
def render_breadcrumb(breadcrumb)
|
39
|
+
link_to_unless_current(breadcrumb[:label], breadcrumb[:path])
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module DesignSystem
|
2
|
+
module Generic
|
3
|
+
module Builders
|
4
|
+
module Elements
|
5
|
+
# This mixin module is used to provide a form.
|
6
|
+
module Form
|
7
|
+
def form(object)
|
8
|
+
@form_object = object
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def render_form
|
14
|
+
name = @form_object.class.name.underscore
|
15
|
+
|
16
|
+
options = { name.to_sym => @context.instance_variable_get(:"@#{name}") }
|
17
|
+
@context.render('form', options)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module DesignSystem
|
2
|
+
module Generic
|
3
|
+
module Builders
|
4
|
+
module Elements
|
5
|
+
# This mixin module is used to provide page headings.
|
6
|
+
module Headings
|
7
|
+
def main_heading(text, caption: nil)
|
8
|
+
@main_heading = text
|
9
|
+
@caption = caption
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def render_main_heading
|
15
|
+
safe_buffer = ActiveSupport::SafeBuffer.new
|
16
|
+
|
17
|
+
safe_buffer.concat(render_caption) if @caption
|
18
|
+
safe_buffer.concat(DesignSystem::Registry.builder(brand, 'heading', self).render_heading(@main_heading,
|
19
|
+
level: 1))
|
20
|
+
|
21
|
+
safe_buffer
|
22
|
+
end
|
23
|
+
|
24
|
+
def render_caption
|
25
|
+
content_tag(:span, @caption)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'elements/breadcrumbs'
|
5
|
+
require_relative 'elements/form'
|
6
|
+
require_relative 'elements/headings'
|
7
|
+
|
8
|
+
module DesignSystem
|
9
|
+
module Generic
|
10
|
+
module Builders
|
11
|
+
# This class is used to provide the generic fixed elements builder.
|
12
|
+
class FixedElements < Base
|
13
|
+
include Elements::Breadcrumbs
|
14
|
+
include Elements::Form
|
15
|
+
include Elements::Headings
|
16
|
+
|
17
|
+
def render
|
18
|
+
content_for_breadcrumbs if @breadcrumbs.present?
|
19
|
+
|
20
|
+
render_main_container do
|
21
|
+
safe_buffer = ActiveSupport::SafeBuffer.new
|
22
|
+
|
23
|
+
safe_buffer.concat(render_main_heading) if @main_heading
|
24
|
+
safe_buffer.concat(render_form) if @form_object
|
25
|
+
|
26
|
+
safe_buffer
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def render_main_container(&)
|
33
|
+
content_tag(:div, &)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DesignSystem
|
4
|
+
module Generic
|
5
|
+
module Builders
|
6
|
+
# This class provides generic methods to display headings in page content.
|
7
|
+
class Heading < Base
|
8
|
+
SIZE_MAPPING = {
|
9
|
+
1 => 'xl',
|
10
|
+
2 => 'l',
|
11
|
+
3 => 'm',
|
12
|
+
4 => 's',
|
13
|
+
5 => 'xs',
|
14
|
+
6 => 'xs'
|
15
|
+
}.freeze
|
16
|
+
|
17
|
+
def render_heading(text, level: 2, **options)
|
18
|
+
content_tag("h#{level}", text, class: classes(level), **options)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def classes(level)
|
24
|
+
level = level.to_i
|
25
|
+
validate_level(level)
|
26
|
+
|
27
|
+
"#{brand}-heading-#{SIZE_MAPPING[level]}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def validate_level(level)
|
31
|
+
return if level.between?(1, 6)
|
32
|
+
|
33
|
+
raise ArgumentError, "Invalid heading level #{level}. Must be an integer between 1 and 6."
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
|
5
|
+
module DesignSystem
|
6
|
+
module Generic
|
7
|
+
module Builders
|
8
|
+
# This class provides generic methods to display links on html, including button links.
|
9
|
+
class Link < Base
|
10
|
+
def render_link_to(name = nil, options = nil, html_options = nil, &)
|
11
|
+
options ||= {}
|
12
|
+
html_options ||= {}
|
13
|
+
|
14
|
+
if block_given?
|
15
|
+
type = options.delete(:type)
|
16
|
+
options[:class] = prep_link_classes(type)
|
17
|
+
else
|
18
|
+
type = html_options.delete(:type)
|
19
|
+
html_options[:class] = prep_link_classes(type)
|
20
|
+
end
|
21
|
+
|
22
|
+
link_to(name, options, html_options, &)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def prep_link_classes(type)
|
28
|
+
if type && button_type_class_hash[type].present?
|
29
|
+
button_type_class_hash[type]
|
30
|
+
else
|
31
|
+
"#{brand}-link"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DesignSystem
|
4
|
+
module Generic
|
5
|
+
module Builders
|
6
|
+
# This class provides generic methods to display notifications.
|
7
|
+
class Notification < Base
|
8
|
+
include ActionView::Helpers::SanitizeHelper
|
9
|
+
def render_alert(msg)
|
10
|
+
content_tag(:div, class: "#{brand}-error-summary", 'aria-labelledby': 'error-summary-title', role: 'alert',
|
11
|
+
tabindex: '-1') do
|
12
|
+
content_tag(:h2, sanitize(msg, tags: %w[b p br a], attributes: %w[href target]),
|
13
|
+
class: "#{brand}-error-summary__title", id: 'error-summary-title')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def render_notice(msg)
|
18
|
+
content_tag(:div, class: "#{brand}-notification-banner", role: 'region',
|
19
|
+
'aria-labelledby': "#{brand}-notification-banner-title",
|
20
|
+
'data-module': "#{brand}-notification-banner") do
|
21
|
+
banner_tile + banner_content(msg)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def banner_tile
|
28
|
+
content_tag(:div, class: "#{brand}-notification-banner__header") do
|
29
|
+
content_tag(:h2, 'Important', class: "#{brand}-notification-banner__title",
|
30
|
+
id: "#{brand}-notification-banner-title")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def banner_content(msg)
|
35
|
+
content_tag(:div, class: "#{brand}-notification-banner__content") do
|
36
|
+
content_tag(:p, sanitize(msg, tags: %w[b p br a], attributes: %w[href targ]),
|
37
|
+
class: "#{brand}-notification-banner__heading")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|