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,1309 @@
|
|
1
|
+
// node_modules/@hotwired/stimulus/dist/stimulus.js
|
2
|
+
function camelize(value) {
|
3
|
+
return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());
|
4
|
+
}
|
5
|
+
function namespaceCamelize(value) {
|
6
|
+
return camelize(value.replace(/--/g, "-").replace(/__/g, "_"));
|
7
|
+
}
|
8
|
+
function capitalize(value) {
|
9
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
10
|
+
}
|
11
|
+
function dasherize(value) {
|
12
|
+
return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);
|
13
|
+
}
|
14
|
+
function isSomething(object) {
|
15
|
+
return object !== null && object !== void 0;
|
16
|
+
}
|
17
|
+
function hasProperty(object, property) {
|
18
|
+
return Object.prototype.hasOwnProperty.call(object, property);
|
19
|
+
}
|
20
|
+
function readInheritableStaticArrayValues(constructor, propertyName) {
|
21
|
+
const ancestors = getAncestorsForConstructor(constructor);
|
22
|
+
return Array.from(ancestors.reduce((values, constructor2) => {
|
23
|
+
getOwnStaticArrayValues(constructor2, propertyName).forEach((name) => values.add(name));
|
24
|
+
return values;
|
25
|
+
}, /* @__PURE__ */ new Set()));
|
26
|
+
}
|
27
|
+
function readInheritableStaticObjectPairs(constructor, propertyName) {
|
28
|
+
const ancestors = getAncestorsForConstructor(constructor);
|
29
|
+
return ancestors.reduce((pairs, constructor2) => {
|
30
|
+
pairs.push(...getOwnStaticObjectPairs(constructor2, propertyName));
|
31
|
+
return pairs;
|
32
|
+
}, []);
|
33
|
+
}
|
34
|
+
function getAncestorsForConstructor(constructor) {
|
35
|
+
const ancestors = [];
|
36
|
+
while (constructor) {
|
37
|
+
ancestors.push(constructor);
|
38
|
+
constructor = Object.getPrototypeOf(constructor);
|
39
|
+
}
|
40
|
+
return ancestors.reverse();
|
41
|
+
}
|
42
|
+
function getOwnStaticArrayValues(constructor, propertyName) {
|
43
|
+
const definition = constructor[propertyName];
|
44
|
+
return Array.isArray(definition) ? definition : [];
|
45
|
+
}
|
46
|
+
function getOwnStaticObjectPairs(constructor, propertyName) {
|
47
|
+
const definition = constructor[propertyName];
|
48
|
+
return definition ? Object.keys(definition).map((key) => [key, definition[key]]) : [];
|
49
|
+
}
|
50
|
+
var getOwnKeys = (() => {
|
51
|
+
if (typeof Object.getOwnPropertySymbols == "function") {
|
52
|
+
return (object) => [...Object.getOwnPropertyNames(object), ...Object.getOwnPropertySymbols(object)];
|
53
|
+
} else {
|
54
|
+
return Object.getOwnPropertyNames;
|
55
|
+
}
|
56
|
+
})();
|
57
|
+
var extend = (() => {
|
58
|
+
function extendWithReflect(constructor) {
|
59
|
+
function extended() {
|
60
|
+
return Reflect.construct(constructor, arguments, new.target);
|
61
|
+
}
|
62
|
+
extended.prototype = Object.create(constructor.prototype, {
|
63
|
+
constructor: { value: extended }
|
64
|
+
});
|
65
|
+
Reflect.setPrototypeOf(extended, constructor);
|
66
|
+
return extended;
|
67
|
+
}
|
68
|
+
function testReflectExtension() {
|
69
|
+
const a = function() {
|
70
|
+
this.a.call(this);
|
71
|
+
};
|
72
|
+
const b = extendWithReflect(a);
|
73
|
+
b.prototype.a = function() {
|
74
|
+
};
|
75
|
+
return new b();
|
76
|
+
}
|
77
|
+
try {
|
78
|
+
testReflectExtension();
|
79
|
+
return extendWithReflect;
|
80
|
+
} catch (error) {
|
81
|
+
return (constructor) => class extended extends constructor {
|
82
|
+
};
|
83
|
+
}
|
84
|
+
})();
|
85
|
+
var defaultSchema = {
|
86
|
+
controllerAttribute: "data-controller",
|
87
|
+
actionAttribute: "data-action",
|
88
|
+
targetAttribute: "data-target",
|
89
|
+
targetAttributeForScope: (identifier) => `data-${identifier}-target`,
|
90
|
+
outletAttributeForScope: (identifier, outlet) => `data-${identifier}-${outlet}-outlet`,
|
91
|
+
keyMappings: Object.assign(Object.assign({ enter: "Enter", tab: "Tab", esc: "Escape", space: " ", up: "ArrowUp", down: "ArrowDown", left: "ArrowLeft", right: "ArrowRight", home: "Home", end: "End", page_up: "PageUp", page_down: "PageDown" }, objectFromEntries("abcdefghijklmnopqrstuvwxyz".split("").map((c) => [c, c]))), objectFromEntries("0123456789".split("").map((n) => [n, n])))
|
92
|
+
};
|
93
|
+
function objectFromEntries(array) {
|
94
|
+
return array.reduce((memo, [k, v]) => Object.assign(Object.assign({}, memo), { [k]: v }), {});
|
95
|
+
}
|
96
|
+
function ClassPropertiesBlessing(constructor) {
|
97
|
+
const classes = readInheritableStaticArrayValues(constructor, "classes");
|
98
|
+
return classes.reduce((properties, classDefinition) => {
|
99
|
+
return Object.assign(properties, propertiesForClassDefinition(classDefinition));
|
100
|
+
}, {});
|
101
|
+
}
|
102
|
+
function propertiesForClassDefinition(key) {
|
103
|
+
return {
|
104
|
+
[`${key}Class`]: {
|
105
|
+
get() {
|
106
|
+
const { classes } = this;
|
107
|
+
if (classes.has(key)) {
|
108
|
+
return classes.get(key);
|
109
|
+
} else {
|
110
|
+
const attribute = classes.getAttributeName(key);
|
111
|
+
throw new Error(`Missing attribute "${attribute}"`);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
},
|
115
|
+
[`${key}Classes`]: {
|
116
|
+
get() {
|
117
|
+
return this.classes.getAll(key);
|
118
|
+
}
|
119
|
+
},
|
120
|
+
[`has${capitalize(key)}Class`]: {
|
121
|
+
get() {
|
122
|
+
return this.classes.has(key);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
};
|
126
|
+
}
|
127
|
+
function OutletPropertiesBlessing(constructor) {
|
128
|
+
const outlets = readInheritableStaticArrayValues(constructor, "outlets");
|
129
|
+
return outlets.reduce((properties, outletDefinition) => {
|
130
|
+
return Object.assign(properties, propertiesForOutletDefinition(outletDefinition));
|
131
|
+
}, {});
|
132
|
+
}
|
133
|
+
function getOutletController(controller, element, identifier) {
|
134
|
+
return controller.application.getControllerForElementAndIdentifier(element, identifier);
|
135
|
+
}
|
136
|
+
function getControllerAndEnsureConnectedScope(controller, element, outletName) {
|
137
|
+
let outletController = getOutletController(controller, element, outletName);
|
138
|
+
if (outletController)
|
139
|
+
return outletController;
|
140
|
+
controller.application.router.proposeToConnectScopeForElementAndIdentifier(element, outletName);
|
141
|
+
outletController = getOutletController(controller, element, outletName);
|
142
|
+
if (outletController)
|
143
|
+
return outletController;
|
144
|
+
}
|
145
|
+
function propertiesForOutletDefinition(name) {
|
146
|
+
const camelizedName = namespaceCamelize(name);
|
147
|
+
return {
|
148
|
+
[`${camelizedName}Outlet`]: {
|
149
|
+
get() {
|
150
|
+
const outletElement = this.outlets.find(name);
|
151
|
+
const selector = this.outlets.getSelectorForOutletName(name);
|
152
|
+
if (outletElement) {
|
153
|
+
const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);
|
154
|
+
if (outletController)
|
155
|
+
return outletController;
|
156
|
+
throw new Error(`The provided outlet element is missing an outlet controller "${name}" instance for host controller "${this.identifier}"`);
|
157
|
+
}
|
158
|
+
throw new Error(`Missing outlet element "${name}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${selector}".`);
|
159
|
+
}
|
160
|
+
},
|
161
|
+
[`${camelizedName}Outlets`]: {
|
162
|
+
get() {
|
163
|
+
const outlets = this.outlets.findAll(name);
|
164
|
+
if (outlets.length > 0) {
|
165
|
+
return outlets.map((outletElement) => {
|
166
|
+
const outletController = getControllerAndEnsureConnectedScope(this, outletElement, name);
|
167
|
+
if (outletController)
|
168
|
+
return outletController;
|
169
|
+
console.warn(`The provided outlet element is missing an outlet controller "${name}" instance for host controller "${this.identifier}"`, outletElement);
|
170
|
+
}).filter((controller) => controller);
|
171
|
+
}
|
172
|
+
return [];
|
173
|
+
}
|
174
|
+
},
|
175
|
+
[`${camelizedName}OutletElement`]: {
|
176
|
+
get() {
|
177
|
+
const outletElement = this.outlets.find(name);
|
178
|
+
const selector = this.outlets.getSelectorForOutletName(name);
|
179
|
+
if (outletElement) {
|
180
|
+
return outletElement;
|
181
|
+
} else {
|
182
|
+
throw new Error(`Missing outlet element "${name}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${selector}".`);
|
183
|
+
}
|
184
|
+
}
|
185
|
+
},
|
186
|
+
[`${camelizedName}OutletElements`]: {
|
187
|
+
get() {
|
188
|
+
return this.outlets.findAll(name);
|
189
|
+
}
|
190
|
+
},
|
191
|
+
[`has${capitalize(camelizedName)}Outlet`]: {
|
192
|
+
get() {
|
193
|
+
return this.outlets.has(name);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
};
|
197
|
+
}
|
198
|
+
function TargetPropertiesBlessing(constructor) {
|
199
|
+
const targets = readInheritableStaticArrayValues(constructor, "targets");
|
200
|
+
return targets.reduce((properties, targetDefinition) => {
|
201
|
+
return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));
|
202
|
+
}, {});
|
203
|
+
}
|
204
|
+
function propertiesForTargetDefinition(name) {
|
205
|
+
return {
|
206
|
+
[`${name}Target`]: {
|
207
|
+
get() {
|
208
|
+
const target = this.targets.find(name);
|
209
|
+
if (target) {
|
210
|
+
return target;
|
211
|
+
} else {
|
212
|
+
throw new Error(`Missing target element "${name}" for "${this.identifier}" controller`);
|
213
|
+
}
|
214
|
+
}
|
215
|
+
},
|
216
|
+
[`${name}Targets`]: {
|
217
|
+
get() {
|
218
|
+
return this.targets.findAll(name);
|
219
|
+
}
|
220
|
+
},
|
221
|
+
[`has${capitalize(name)}Target`]: {
|
222
|
+
get() {
|
223
|
+
return this.targets.has(name);
|
224
|
+
}
|
225
|
+
}
|
226
|
+
};
|
227
|
+
}
|
228
|
+
function ValuePropertiesBlessing(constructor) {
|
229
|
+
const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, "values");
|
230
|
+
const propertyDescriptorMap = {
|
231
|
+
valueDescriptorMap: {
|
232
|
+
get() {
|
233
|
+
return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {
|
234
|
+
const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair, this.identifier);
|
235
|
+
const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);
|
236
|
+
return Object.assign(result, { [attributeName]: valueDescriptor });
|
237
|
+
}, {});
|
238
|
+
}
|
239
|
+
}
|
240
|
+
};
|
241
|
+
return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {
|
242
|
+
return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));
|
243
|
+
}, propertyDescriptorMap);
|
244
|
+
}
|
245
|
+
function propertiesForValueDefinitionPair(valueDefinitionPair, controller) {
|
246
|
+
const definition = parseValueDefinitionPair(valueDefinitionPair, controller);
|
247
|
+
const { key, name, reader: read, writer: write } = definition;
|
248
|
+
return {
|
249
|
+
[name]: {
|
250
|
+
get() {
|
251
|
+
const value = this.data.get(key);
|
252
|
+
if (value !== null) {
|
253
|
+
return read(value);
|
254
|
+
} else {
|
255
|
+
return definition.defaultValue;
|
256
|
+
}
|
257
|
+
},
|
258
|
+
set(value) {
|
259
|
+
if (value === void 0) {
|
260
|
+
this.data.delete(key);
|
261
|
+
} else {
|
262
|
+
this.data.set(key, write(value));
|
263
|
+
}
|
264
|
+
}
|
265
|
+
},
|
266
|
+
[`has${capitalize(name)}`]: {
|
267
|
+
get() {
|
268
|
+
return this.data.has(key) || definition.hasCustomDefaultValue;
|
269
|
+
}
|
270
|
+
}
|
271
|
+
};
|
272
|
+
}
|
273
|
+
function parseValueDefinitionPair([token, typeDefinition], controller) {
|
274
|
+
return valueDescriptorForTokenAndTypeDefinition({
|
275
|
+
controller,
|
276
|
+
token,
|
277
|
+
typeDefinition
|
278
|
+
});
|
279
|
+
}
|
280
|
+
function parseValueTypeConstant(constant) {
|
281
|
+
switch (constant) {
|
282
|
+
case Array:
|
283
|
+
return "array";
|
284
|
+
case Boolean:
|
285
|
+
return "boolean";
|
286
|
+
case Number:
|
287
|
+
return "number";
|
288
|
+
case Object:
|
289
|
+
return "object";
|
290
|
+
case String:
|
291
|
+
return "string";
|
292
|
+
}
|
293
|
+
}
|
294
|
+
function parseValueTypeDefault(defaultValue) {
|
295
|
+
switch (typeof defaultValue) {
|
296
|
+
case "boolean":
|
297
|
+
return "boolean";
|
298
|
+
case "number":
|
299
|
+
return "number";
|
300
|
+
case "string":
|
301
|
+
return "string";
|
302
|
+
}
|
303
|
+
if (Array.isArray(defaultValue))
|
304
|
+
return "array";
|
305
|
+
if (Object.prototype.toString.call(defaultValue) === "[object Object]")
|
306
|
+
return "object";
|
307
|
+
}
|
308
|
+
function parseValueTypeObject(payload) {
|
309
|
+
const { controller, token, typeObject } = payload;
|
310
|
+
const hasType = isSomething(typeObject.type);
|
311
|
+
const hasDefault = isSomething(typeObject.default);
|
312
|
+
const fullObject = hasType && hasDefault;
|
313
|
+
const onlyType = hasType && !hasDefault;
|
314
|
+
const onlyDefault = !hasType && hasDefault;
|
315
|
+
const typeFromObject = parseValueTypeConstant(typeObject.type);
|
316
|
+
const typeFromDefaultValue = parseValueTypeDefault(payload.typeObject.default);
|
317
|
+
if (onlyType)
|
318
|
+
return typeFromObject;
|
319
|
+
if (onlyDefault)
|
320
|
+
return typeFromDefaultValue;
|
321
|
+
if (typeFromObject !== typeFromDefaultValue) {
|
322
|
+
const propertyPath = controller ? `${controller}.${token}` : token;
|
323
|
+
throw new Error(`The specified default value for the Stimulus Value "${propertyPath}" must match the defined type "${typeFromObject}". The provided default value of "${typeObject.default}" is of type "${typeFromDefaultValue}".`);
|
324
|
+
}
|
325
|
+
if (fullObject)
|
326
|
+
return typeFromObject;
|
327
|
+
}
|
328
|
+
function parseValueTypeDefinition(payload) {
|
329
|
+
const { controller, token, typeDefinition } = payload;
|
330
|
+
const typeObject = { controller, token, typeObject: typeDefinition };
|
331
|
+
const typeFromObject = parseValueTypeObject(typeObject);
|
332
|
+
const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);
|
333
|
+
const typeFromConstant = parseValueTypeConstant(typeDefinition);
|
334
|
+
const type = typeFromObject || typeFromDefaultValue || typeFromConstant;
|
335
|
+
if (type)
|
336
|
+
return type;
|
337
|
+
const propertyPath = controller ? `${controller}.${typeDefinition}` : token;
|
338
|
+
throw new Error(`Unknown value type "${propertyPath}" for "${token}" value`);
|
339
|
+
}
|
340
|
+
function defaultValueForDefinition(typeDefinition) {
|
341
|
+
const constant = parseValueTypeConstant(typeDefinition);
|
342
|
+
if (constant)
|
343
|
+
return defaultValuesByType[constant];
|
344
|
+
const hasDefault = hasProperty(typeDefinition, "default");
|
345
|
+
const hasType = hasProperty(typeDefinition, "type");
|
346
|
+
const typeObject = typeDefinition;
|
347
|
+
if (hasDefault)
|
348
|
+
return typeObject.default;
|
349
|
+
if (hasType) {
|
350
|
+
const { type } = typeObject;
|
351
|
+
const constantFromType = parseValueTypeConstant(type);
|
352
|
+
if (constantFromType)
|
353
|
+
return defaultValuesByType[constantFromType];
|
354
|
+
}
|
355
|
+
return typeDefinition;
|
356
|
+
}
|
357
|
+
function valueDescriptorForTokenAndTypeDefinition(payload) {
|
358
|
+
const { token, typeDefinition } = payload;
|
359
|
+
const key = `${dasherize(token)}-value`;
|
360
|
+
const type = parseValueTypeDefinition(payload);
|
361
|
+
return {
|
362
|
+
type,
|
363
|
+
key,
|
364
|
+
name: camelize(key),
|
365
|
+
get defaultValue() {
|
366
|
+
return defaultValueForDefinition(typeDefinition);
|
367
|
+
},
|
368
|
+
get hasCustomDefaultValue() {
|
369
|
+
return parseValueTypeDefault(typeDefinition) !== void 0;
|
370
|
+
},
|
371
|
+
reader: readers[type],
|
372
|
+
writer: writers[type] || writers.default
|
373
|
+
};
|
374
|
+
}
|
375
|
+
var defaultValuesByType = {
|
376
|
+
get array() {
|
377
|
+
return [];
|
378
|
+
},
|
379
|
+
boolean: false,
|
380
|
+
number: 0,
|
381
|
+
get object() {
|
382
|
+
return {};
|
383
|
+
},
|
384
|
+
string: ""
|
385
|
+
};
|
386
|
+
var readers = {
|
387
|
+
array(value) {
|
388
|
+
const array = JSON.parse(value);
|
389
|
+
if (!Array.isArray(array)) {
|
390
|
+
throw new TypeError(`expected value of type "array" but instead got value "${value}" of type "${parseValueTypeDefault(array)}"`);
|
391
|
+
}
|
392
|
+
return array;
|
393
|
+
},
|
394
|
+
boolean(value) {
|
395
|
+
return !(value == "0" || String(value).toLowerCase() == "false");
|
396
|
+
},
|
397
|
+
number(value) {
|
398
|
+
return Number(value.replace(/_/g, ""));
|
399
|
+
},
|
400
|
+
object(value) {
|
401
|
+
const object = JSON.parse(value);
|
402
|
+
if (object === null || typeof object != "object" || Array.isArray(object)) {
|
403
|
+
throw new TypeError(`expected value of type "object" but instead got value "${value}" of type "${parseValueTypeDefault(object)}"`);
|
404
|
+
}
|
405
|
+
return object;
|
406
|
+
},
|
407
|
+
string(value) {
|
408
|
+
return value;
|
409
|
+
}
|
410
|
+
};
|
411
|
+
var writers = {
|
412
|
+
default: writeString,
|
413
|
+
array: writeJSON,
|
414
|
+
object: writeJSON
|
415
|
+
};
|
416
|
+
function writeJSON(value) {
|
417
|
+
return JSON.stringify(value);
|
418
|
+
}
|
419
|
+
function writeString(value) {
|
420
|
+
return `${value}`;
|
421
|
+
}
|
422
|
+
var Controller = class {
|
423
|
+
constructor(context) {
|
424
|
+
this.context = context;
|
425
|
+
}
|
426
|
+
static get shouldLoad() {
|
427
|
+
return true;
|
428
|
+
}
|
429
|
+
static afterLoad(_identifier, _application) {
|
430
|
+
return;
|
431
|
+
}
|
432
|
+
get application() {
|
433
|
+
return this.context.application;
|
434
|
+
}
|
435
|
+
get scope() {
|
436
|
+
return this.context.scope;
|
437
|
+
}
|
438
|
+
get element() {
|
439
|
+
return this.scope.element;
|
440
|
+
}
|
441
|
+
get identifier() {
|
442
|
+
return this.scope.identifier;
|
443
|
+
}
|
444
|
+
get targets() {
|
445
|
+
return this.scope.targets;
|
446
|
+
}
|
447
|
+
get outlets() {
|
448
|
+
return this.scope.outlets;
|
449
|
+
}
|
450
|
+
get classes() {
|
451
|
+
return this.scope.classes;
|
452
|
+
}
|
453
|
+
get data() {
|
454
|
+
return this.scope.data;
|
455
|
+
}
|
456
|
+
initialize() {
|
457
|
+
}
|
458
|
+
connect() {
|
459
|
+
}
|
460
|
+
disconnect() {
|
461
|
+
}
|
462
|
+
dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true } = {}) {
|
463
|
+
const type = prefix ? `${prefix}:${eventName}` : eventName;
|
464
|
+
const event = new CustomEvent(type, { detail, bubbles, cancelable });
|
465
|
+
target.dispatchEvent(event);
|
466
|
+
return event;
|
467
|
+
}
|
468
|
+
};
|
469
|
+
Controller.blessings = [
|
470
|
+
ClassPropertiesBlessing,
|
471
|
+
TargetPropertiesBlessing,
|
472
|
+
ValuePropertiesBlessing,
|
473
|
+
OutletPropertiesBlessing
|
474
|
+
];
|
475
|
+
Controller.targets = [];
|
476
|
+
Controller.outlets = [];
|
477
|
+
Controller.values = {};
|
478
|
+
|
479
|
+
// app/javascript/design_system/controllers/hello_world_controller.js
|
480
|
+
var hello_world_controller_default = class extends Controller {
|
481
|
+
connect() {
|
482
|
+
console.log("Hello from the Design System!");
|
483
|
+
}
|
484
|
+
};
|
485
|
+
|
486
|
+
// app/javascript/design_system/controllers/show_password_controller.js
|
487
|
+
var show_password_controller_default = class extends Controller {
|
488
|
+
static targets = ["password", "button"];
|
489
|
+
static values = {
|
490
|
+
showText: String,
|
491
|
+
hideText: String
|
492
|
+
};
|
493
|
+
showPasswordSvg = `
|
494
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="password-field__icon">
|
495
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" />
|
496
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
497
|
+
</svg>
|
498
|
+
`;
|
499
|
+
hidePasswordSvg = `
|
500
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="password-field__icon">
|
501
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88" />
|
502
|
+
</svg>
|
503
|
+
`;
|
504
|
+
toggle() {
|
505
|
+
if (this.passwordTarget.type === "password") {
|
506
|
+
this.passwordTarget.type = "text";
|
507
|
+
if (this.hideTextValue) {
|
508
|
+
this.buttonTarget.textContent = this.hideTextValue;
|
509
|
+
} else {
|
510
|
+
this.buttonTarget.innerHTML = this.hidePasswordSvg;
|
511
|
+
}
|
512
|
+
} else {
|
513
|
+
this.passwordTarget.type = "password";
|
514
|
+
if (this.showTextValue) {
|
515
|
+
this.buttonTarget.textContent = this.showTextValue;
|
516
|
+
} else {
|
517
|
+
this.buttonTarget.innerHTML = this.showPasswordSvg;
|
518
|
+
}
|
519
|
+
}
|
520
|
+
}
|
521
|
+
};
|
522
|
+
|
523
|
+
// node_modules/date-fns/constants.js
|
524
|
+
var daysInYear = 365.2425;
|
525
|
+
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
|
526
|
+
var minTime = -maxTime;
|
527
|
+
var minutesInMonth = 43200;
|
528
|
+
var minutesInDay = 1440;
|
529
|
+
var secondsInHour = 3600;
|
530
|
+
var secondsInDay = secondsInHour * 24;
|
531
|
+
var secondsInWeek = secondsInDay * 7;
|
532
|
+
var secondsInYear = secondsInDay * daysInYear;
|
533
|
+
var secondsInMonth = secondsInYear / 12;
|
534
|
+
var secondsInQuarter = secondsInMonth * 3;
|
535
|
+
var constructFromSymbol = Symbol.for("constructDateFrom");
|
536
|
+
|
537
|
+
// node_modules/date-fns/constructFrom.js
|
538
|
+
function constructFrom(date, value) {
|
539
|
+
if (typeof date === "function") return date(value);
|
540
|
+
if (date && typeof date === "object" && constructFromSymbol in date)
|
541
|
+
return date[constructFromSymbol](value);
|
542
|
+
if (date instanceof Date) return new date.constructor(value);
|
543
|
+
return new Date(value);
|
544
|
+
}
|
545
|
+
|
546
|
+
// node_modules/date-fns/toDate.js
|
547
|
+
function toDate(argument, context) {
|
548
|
+
return constructFrom(context || argument, argument);
|
549
|
+
}
|
550
|
+
|
551
|
+
// node_modules/date-fns/_lib/defaultOptions.js
|
552
|
+
var defaultOptions = {};
|
553
|
+
function getDefaultOptions() {
|
554
|
+
return defaultOptions;
|
555
|
+
}
|
556
|
+
|
557
|
+
// node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
|
558
|
+
function getTimezoneOffsetInMilliseconds(date) {
|
559
|
+
const _date = toDate(date);
|
560
|
+
const utcDate = new Date(
|
561
|
+
Date.UTC(
|
562
|
+
_date.getFullYear(),
|
563
|
+
_date.getMonth(),
|
564
|
+
_date.getDate(),
|
565
|
+
_date.getHours(),
|
566
|
+
_date.getMinutes(),
|
567
|
+
_date.getSeconds(),
|
568
|
+
_date.getMilliseconds()
|
569
|
+
)
|
570
|
+
);
|
571
|
+
utcDate.setUTCFullYear(_date.getFullYear());
|
572
|
+
return +date - +utcDate;
|
573
|
+
}
|
574
|
+
|
575
|
+
// node_modules/date-fns/_lib/normalizeDates.js
|
576
|
+
function normalizeDates(context, ...dates) {
|
577
|
+
const normalize = constructFrom.bind(
|
578
|
+
null,
|
579
|
+
context || dates.find((date) => typeof date === "object")
|
580
|
+
);
|
581
|
+
return dates.map(normalize);
|
582
|
+
}
|
583
|
+
|
584
|
+
// node_modules/date-fns/compareAsc.js
|
585
|
+
function compareAsc(dateLeft, dateRight) {
|
586
|
+
const diff = +toDate(dateLeft) - +toDate(dateRight);
|
587
|
+
if (diff < 0) return -1;
|
588
|
+
else if (diff > 0) return 1;
|
589
|
+
return diff;
|
590
|
+
}
|
591
|
+
|
592
|
+
// node_modules/date-fns/constructNow.js
|
593
|
+
function constructNow(date) {
|
594
|
+
return constructFrom(date, Date.now());
|
595
|
+
}
|
596
|
+
|
597
|
+
// node_modules/date-fns/differenceInCalendarMonths.js
|
598
|
+
function differenceInCalendarMonths(laterDate, earlierDate, options) {
|
599
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
600
|
+
options?.in,
|
601
|
+
laterDate,
|
602
|
+
earlierDate
|
603
|
+
);
|
604
|
+
const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
|
605
|
+
const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
|
606
|
+
return yearsDiff * 12 + monthsDiff;
|
607
|
+
}
|
608
|
+
|
609
|
+
// node_modules/date-fns/_lib/getRoundingMethod.js
|
610
|
+
function getRoundingMethod(method) {
|
611
|
+
return (number) => {
|
612
|
+
const round = method ? Math[method] : Math.trunc;
|
613
|
+
const result = round(number);
|
614
|
+
return result === 0 ? 0 : result;
|
615
|
+
};
|
616
|
+
}
|
617
|
+
|
618
|
+
// node_modules/date-fns/differenceInMilliseconds.js
|
619
|
+
function differenceInMilliseconds(laterDate, earlierDate) {
|
620
|
+
return +toDate(laterDate) - +toDate(earlierDate);
|
621
|
+
}
|
622
|
+
|
623
|
+
// node_modules/date-fns/endOfDay.js
|
624
|
+
function endOfDay(date, options) {
|
625
|
+
const _date = toDate(date, options?.in);
|
626
|
+
_date.setHours(23, 59, 59, 999);
|
627
|
+
return _date;
|
628
|
+
}
|
629
|
+
|
630
|
+
// node_modules/date-fns/endOfMonth.js
|
631
|
+
function endOfMonth(date, options) {
|
632
|
+
const _date = toDate(date, options?.in);
|
633
|
+
const month = _date.getMonth();
|
634
|
+
_date.setFullYear(_date.getFullYear(), month + 1, 0);
|
635
|
+
_date.setHours(23, 59, 59, 999);
|
636
|
+
return _date;
|
637
|
+
}
|
638
|
+
|
639
|
+
// node_modules/date-fns/isLastDayOfMonth.js
|
640
|
+
function isLastDayOfMonth(date, options) {
|
641
|
+
const _date = toDate(date, options?.in);
|
642
|
+
return +endOfDay(_date, options) === +endOfMonth(_date, options);
|
643
|
+
}
|
644
|
+
|
645
|
+
// node_modules/date-fns/differenceInMonths.js
|
646
|
+
function differenceInMonths(laterDate, earlierDate, options) {
|
647
|
+
const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(
|
648
|
+
options?.in,
|
649
|
+
laterDate,
|
650
|
+
laterDate,
|
651
|
+
earlierDate
|
652
|
+
);
|
653
|
+
const sign = compareAsc(workingLaterDate, earlierDate_);
|
654
|
+
const difference = Math.abs(
|
655
|
+
differenceInCalendarMonths(workingLaterDate, earlierDate_)
|
656
|
+
);
|
657
|
+
if (difference < 1) return 0;
|
658
|
+
if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
|
659
|
+
workingLaterDate.setDate(30);
|
660
|
+
workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);
|
661
|
+
let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;
|
662
|
+
if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) {
|
663
|
+
isLastMonthNotFull = false;
|
664
|
+
}
|
665
|
+
const result = sign * (difference - +isLastMonthNotFull);
|
666
|
+
return result === 0 ? 0 : result;
|
667
|
+
}
|
668
|
+
|
669
|
+
// node_modules/date-fns/differenceInSeconds.js
|
670
|
+
function differenceInSeconds(laterDate, earlierDate, options) {
|
671
|
+
const diff = differenceInMilliseconds(laterDate, earlierDate) / 1e3;
|
672
|
+
return getRoundingMethod(options?.roundingMethod)(diff);
|
673
|
+
}
|
674
|
+
|
675
|
+
// node_modules/date-fns/locale/en-US/_lib/formatDistance.js
|
676
|
+
var formatDistanceLocale = {
|
677
|
+
lessThanXSeconds: {
|
678
|
+
one: "less than a second",
|
679
|
+
other: "less than {{count}} seconds"
|
680
|
+
},
|
681
|
+
xSeconds: {
|
682
|
+
one: "1 second",
|
683
|
+
other: "{{count}} seconds"
|
684
|
+
},
|
685
|
+
halfAMinute: "half a minute",
|
686
|
+
lessThanXMinutes: {
|
687
|
+
one: "less than a minute",
|
688
|
+
other: "less than {{count}} minutes"
|
689
|
+
},
|
690
|
+
xMinutes: {
|
691
|
+
one: "1 minute",
|
692
|
+
other: "{{count}} minutes"
|
693
|
+
},
|
694
|
+
aboutXHours: {
|
695
|
+
one: "about 1 hour",
|
696
|
+
other: "about {{count}} hours"
|
697
|
+
},
|
698
|
+
xHours: {
|
699
|
+
one: "1 hour",
|
700
|
+
other: "{{count}} hours"
|
701
|
+
},
|
702
|
+
xDays: {
|
703
|
+
one: "1 day",
|
704
|
+
other: "{{count}} days"
|
705
|
+
},
|
706
|
+
aboutXWeeks: {
|
707
|
+
one: "about 1 week",
|
708
|
+
other: "about {{count}} weeks"
|
709
|
+
},
|
710
|
+
xWeeks: {
|
711
|
+
one: "1 week",
|
712
|
+
other: "{{count}} weeks"
|
713
|
+
},
|
714
|
+
aboutXMonths: {
|
715
|
+
one: "about 1 month",
|
716
|
+
other: "about {{count}} months"
|
717
|
+
},
|
718
|
+
xMonths: {
|
719
|
+
one: "1 month",
|
720
|
+
other: "{{count}} months"
|
721
|
+
},
|
722
|
+
aboutXYears: {
|
723
|
+
one: "about 1 year",
|
724
|
+
other: "about {{count}} years"
|
725
|
+
},
|
726
|
+
xYears: {
|
727
|
+
one: "1 year",
|
728
|
+
other: "{{count}} years"
|
729
|
+
},
|
730
|
+
overXYears: {
|
731
|
+
one: "over 1 year",
|
732
|
+
other: "over {{count}} years"
|
733
|
+
},
|
734
|
+
almostXYears: {
|
735
|
+
one: "almost 1 year",
|
736
|
+
other: "almost {{count}} years"
|
737
|
+
}
|
738
|
+
};
|
739
|
+
var formatDistance = (token, count, options) => {
|
740
|
+
let result;
|
741
|
+
const tokenValue = formatDistanceLocale[token];
|
742
|
+
if (typeof tokenValue === "string") {
|
743
|
+
result = tokenValue;
|
744
|
+
} else if (count === 1) {
|
745
|
+
result = tokenValue.one;
|
746
|
+
} else {
|
747
|
+
result = tokenValue.other.replace("{{count}}", count.toString());
|
748
|
+
}
|
749
|
+
if (options?.addSuffix) {
|
750
|
+
if (options.comparison && options.comparison > 0) {
|
751
|
+
return "in " + result;
|
752
|
+
} else {
|
753
|
+
return result + " ago";
|
754
|
+
}
|
755
|
+
}
|
756
|
+
return result;
|
757
|
+
};
|
758
|
+
|
759
|
+
// node_modules/date-fns/locale/_lib/buildFormatLongFn.js
|
760
|
+
function buildFormatLongFn(args) {
|
761
|
+
return (options = {}) => {
|
762
|
+
const width = options.width ? String(options.width) : args.defaultWidth;
|
763
|
+
const format = args.formats[width] || args.formats[args.defaultWidth];
|
764
|
+
return format;
|
765
|
+
};
|
766
|
+
}
|
767
|
+
|
768
|
+
// node_modules/date-fns/locale/en-US/_lib/formatLong.js
|
769
|
+
var dateFormats = {
|
770
|
+
full: "EEEE, MMMM do, y",
|
771
|
+
long: "MMMM do, y",
|
772
|
+
medium: "MMM d, y",
|
773
|
+
short: "MM/dd/yyyy"
|
774
|
+
};
|
775
|
+
var timeFormats = {
|
776
|
+
full: "h:mm:ss a zzzz",
|
777
|
+
long: "h:mm:ss a z",
|
778
|
+
medium: "h:mm:ss a",
|
779
|
+
short: "h:mm a"
|
780
|
+
};
|
781
|
+
var dateTimeFormats = {
|
782
|
+
full: "{{date}} 'at' {{time}}",
|
783
|
+
long: "{{date}} 'at' {{time}}",
|
784
|
+
medium: "{{date}}, {{time}}",
|
785
|
+
short: "{{date}}, {{time}}"
|
786
|
+
};
|
787
|
+
var formatLong = {
|
788
|
+
date: buildFormatLongFn({
|
789
|
+
formats: dateFormats,
|
790
|
+
defaultWidth: "full"
|
791
|
+
}),
|
792
|
+
time: buildFormatLongFn({
|
793
|
+
formats: timeFormats,
|
794
|
+
defaultWidth: "full"
|
795
|
+
}),
|
796
|
+
dateTime: buildFormatLongFn({
|
797
|
+
formats: dateTimeFormats,
|
798
|
+
defaultWidth: "full"
|
799
|
+
})
|
800
|
+
};
|
801
|
+
|
802
|
+
// node_modules/date-fns/locale/en-US/_lib/formatRelative.js
|
803
|
+
var formatRelativeLocale = {
|
804
|
+
lastWeek: "'last' eeee 'at' p",
|
805
|
+
yesterday: "'yesterday at' p",
|
806
|
+
today: "'today at' p",
|
807
|
+
tomorrow: "'tomorrow at' p",
|
808
|
+
nextWeek: "eeee 'at' p",
|
809
|
+
other: "P"
|
810
|
+
};
|
811
|
+
var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
812
|
+
|
813
|
+
// node_modules/date-fns/locale/_lib/buildLocalizeFn.js
|
814
|
+
function buildLocalizeFn(args) {
|
815
|
+
return (value, options) => {
|
816
|
+
const context = options?.context ? String(options.context) : "standalone";
|
817
|
+
let valuesArray;
|
818
|
+
if (context === "formatting" && args.formattingValues) {
|
819
|
+
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
820
|
+
const width = options?.width ? String(options.width) : defaultWidth;
|
821
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
822
|
+
} else {
|
823
|
+
const defaultWidth = args.defaultWidth;
|
824
|
+
const width = options?.width ? String(options.width) : args.defaultWidth;
|
825
|
+
valuesArray = args.values[width] || args.values[defaultWidth];
|
826
|
+
}
|
827
|
+
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
828
|
+
return valuesArray[index];
|
829
|
+
};
|
830
|
+
}
|
831
|
+
|
832
|
+
// node_modules/date-fns/locale/en-US/_lib/localize.js
|
833
|
+
var eraValues = {
|
834
|
+
narrow: ["B", "A"],
|
835
|
+
abbreviated: ["BC", "AD"],
|
836
|
+
wide: ["Before Christ", "Anno Domini"]
|
837
|
+
};
|
838
|
+
var quarterValues = {
|
839
|
+
narrow: ["1", "2", "3", "4"],
|
840
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
841
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
842
|
+
};
|
843
|
+
var monthValues = {
|
844
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
845
|
+
abbreviated: [
|
846
|
+
"Jan",
|
847
|
+
"Feb",
|
848
|
+
"Mar",
|
849
|
+
"Apr",
|
850
|
+
"May",
|
851
|
+
"Jun",
|
852
|
+
"Jul",
|
853
|
+
"Aug",
|
854
|
+
"Sep",
|
855
|
+
"Oct",
|
856
|
+
"Nov",
|
857
|
+
"Dec"
|
858
|
+
],
|
859
|
+
wide: [
|
860
|
+
"January",
|
861
|
+
"February",
|
862
|
+
"March",
|
863
|
+
"April",
|
864
|
+
"May",
|
865
|
+
"June",
|
866
|
+
"July",
|
867
|
+
"August",
|
868
|
+
"September",
|
869
|
+
"October",
|
870
|
+
"November",
|
871
|
+
"December"
|
872
|
+
]
|
873
|
+
};
|
874
|
+
var dayValues = {
|
875
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
876
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
877
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
878
|
+
wide: [
|
879
|
+
"Sunday",
|
880
|
+
"Monday",
|
881
|
+
"Tuesday",
|
882
|
+
"Wednesday",
|
883
|
+
"Thursday",
|
884
|
+
"Friday",
|
885
|
+
"Saturday"
|
886
|
+
]
|
887
|
+
};
|
888
|
+
var dayPeriodValues = {
|
889
|
+
narrow: {
|
890
|
+
am: "a",
|
891
|
+
pm: "p",
|
892
|
+
midnight: "mi",
|
893
|
+
noon: "n",
|
894
|
+
morning: "morning",
|
895
|
+
afternoon: "afternoon",
|
896
|
+
evening: "evening",
|
897
|
+
night: "night"
|
898
|
+
},
|
899
|
+
abbreviated: {
|
900
|
+
am: "AM",
|
901
|
+
pm: "PM",
|
902
|
+
midnight: "midnight",
|
903
|
+
noon: "noon",
|
904
|
+
morning: "morning",
|
905
|
+
afternoon: "afternoon",
|
906
|
+
evening: "evening",
|
907
|
+
night: "night"
|
908
|
+
},
|
909
|
+
wide: {
|
910
|
+
am: "a.m.",
|
911
|
+
pm: "p.m.",
|
912
|
+
midnight: "midnight",
|
913
|
+
noon: "noon",
|
914
|
+
morning: "morning",
|
915
|
+
afternoon: "afternoon",
|
916
|
+
evening: "evening",
|
917
|
+
night: "night"
|
918
|
+
}
|
919
|
+
};
|
920
|
+
var formattingDayPeriodValues = {
|
921
|
+
narrow: {
|
922
|
+
am: "a",
|
923
|
+
pm: "p",
|
924
|
+
midnight: "mi",
|
925
|
+
noon: "n",
|
926
|
+
morning: "in the morning",
|
927
|
+
afternoon: "in the afternoon",
|
928
|
+
evening: "in the evening",
|
929
|
+
night: "at night"
|
930
|
+
},
|
931
|
+
abbreviated: {
|
932
|
+
am: "AM",
|
933
|
+
pm: "PM",
|
934
|
+
midnight: "midnight",
|
935
|
+
noon: "noon",
|
936
|
+
morning: "in the morning",
|
937
|
+
afternoon: "in the afternoon",
|
938
|
+
evening: "in the evening",
|
939
|
+
night: "at night"
|
940
|
+
},
|
941
|
+
wide: {
|
942
|
+
am: "a.m.",
|
943
|
+
pm: "p.m.",
|
944
|
+
midnight: "midnight",
|
945
|
+
noon: "noon",
|
946
|
+
morning: "in the morning",
|
947
|
+
afternoon: "in the afternoon",
|
948
|
+
evening: "in the evening",
|
949
|
+
night: "at night"
|
950
|
+
}
|
951
|
+
};
|
952
|
+
var ordinalNumber = (dirtyNumber, _options) => {
|
953
|
+
const number = Number(dirtyNumber);
|
954
|
+
const rem100 = number % 100;
|
955
|
+
if (rem100 > 20 || rem100 < 10) {
|
956
|
+
switch (rem100 % 10) {
|
957
|
+
case 1:
|
958
|
+
return number + "st";
|
959
|
+
case 2:
|
960
|
+
return number + "nd";
|
961
|
+
case 3:
|
962
|
+
return number + "rd";
|
963
|
+
}
|
964
|
+
}
|
965
|
+
return number + "th";
|
966
|
+
};
|
967
|
+
var localize = {
|
968
|
+
ordinalNumber,
|
969
|
+
era: buildLocalizeFn({
|
970
|
+
values: eraValues,
|
971
|
+
defaultWidth: "wide"
|
972
|
+
}),
|
973
|
+
quarter: buildLocalizeFn({
|
974
|
+
values: quarterValues,
|
975
|
+
defaultWidth: "wide",
|
976
|
+
argumentCallback: (quarter) => quarter - 1
|
977
|
+
}),
|
978
|
+
month: buildLocalizeFn({
|
979
|
+
values: monthValues,
|
980
|
+
defaultWidth: "wide"
|
981
|
+
}),
|
982
|
+
day: buildLocalizeFn({
|
983
|
+
values: dayValues,
|
984
|
+
defaultWidth: "wide"
|
985
|
+
}),
|
986
|
+
dayPeriod: buildLocalizeFn({
|
987
|
+
values: dayPeriodValues,
|
988
|
+
defaultWidth: "wide",
|
989
|
+
formattingValues: formattingDayPeriodValues,
|
990
|
+
defaultFormattingWidth: "wide"
|
991
|
+
})
|
992
|
+
};
|
993
|
+
|
994
|
+
// node_modules/date-fns/locale/_lib/buildMatchFn.js
|
995
|
+
function buildMatchFn(args) {
|
996
|
+
return (string, options = {}) => {
|
997
|
+
const width = options.width;
|
998
|
+
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
999
|
+
const matchResult = string.match(matchPattern);
|
1000
|
+
if (!matchResult) {
|
1001
|
+
return null;
|
1002
|
+
}
|
1003
|
+
const matchedString = matchResult[0];
|
1004
|
+
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
1005
|
+
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
1006
|
+
// [TODO] -- I challenge you to fix the type
|
1007
|
+
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
1008
|
+
);
|
1009
|
+
let value;
|
1010
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
1011
|
+
value = options.valueCallback ? (
|
1012
|
+
// [TODO] -- I challenge you to fix the type
|
1013
|
+
options.valueCallback(value)
|
1014
|
+
) : value;
|
1015
|
+
const rest = string.slice(matchedString.length);
|
1016
|
+
return { value, rest };
|
1017
|
+
};
|
1018
|
+
}
|
1019
|
+
function findKey(object, predicate) {
|
1020
|
+
for (const key in object) {
|
1021
|
+
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
1022
|
+
return key;
|
1023
|
+
}
|
1024
|
+
}
|
1025
|
+
return void 0;
|
1026
|
+
}
|
1027
|
+
function findIndex(array, predicate) {
|
1028
|
+
for (let key = 0; key < array.length; key++) {
|
1029
|
+
if (predicate(array[key])) {
|
1030
|
+
return key;
|
1031
|
+
}
|
1032
|
+
}
|
1033
|
+
return void 0;
|
1034
|
+
}
|
1035
|
+
|
1036
|
+
// node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
|
1037
|
+
function buildMatchPatternFn(args) {
|
1038
|
+
return (string, options = {}) => {
|
1039
|
+
const matchResult = string.match(args.matchPattern);
|
1040
|
+
if (!matchResult) return null;
|
1041
|
+
const matchedString = matchResult[0];
|
1042
|
+
const parseResult = string.match(args.parsePattern);
|
1043
|
+
if (!parseResult) return null;
|
1044
|
+
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
1045
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
1046
|
+
const rest = string.slice(matchedString.length);
|
1047
|
+
return { value, rest };
|
1048
|
+
};
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
// node_modules/date-fns/locale/en-US/_lib/match.js
|
1052
|
+
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
1053
|
+
var parseOrdinalNumberPattern = /\d+/i;
|
1054
|
+
var matchEraPatterns = {
|
1055
|
+
narrow: /^(b|a)/i,
|
1056
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
1057
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
1058
|
+
};
|
1059
|
+
var parseEraPatterns = {
|
1060
|
+
any: [/^b/i, /^(a|c)/i]
|
1061
|
+
};
|
1062
|
+
var matchQuarterPatterns = {
|
1063
|
+
narrow: /^[1234]/i,
|
1064
|
+
abbreviated: /^q[1234]/i,
|
1065
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
1066
|
+
};
|
1067
|
+
var parseQuarterPatterns = {
|
1068
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
1069
|
+
};
|
1070
|
+
var matchMonthPatterns = {
|
1071
|
+
narrow: /^[jfmasond]/i,
|
1072
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
1073
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
1074
|
+
};
|
1075
|
+
var parseMonthPatterns = {
|
1076
|
+
narrow: [
|
1077
|
+
/^j/i,
|
1078
|
+
/^f/i,
|
1079
|
+
/^m/i,
|
1080
|
+
/^a/i,
|
1081
|
+
/^m/i,
|
1082
|
+
/^j/i,
|
1083
|
+
/^j/i,
|
1084
|
+
/^a/i,
|
1085
|
+
/^s/i,
|
1086
|
+
/^o/i,
|
1087
|
+
/^n/i,
|
1088
|
+
/^d/i
|
1089
|
+
],
|
1090
|
+
any: [
|
1091
|
+
/^ja/i,
|
1092
|
+
/^f/i,
|
1093
|
+
/^mar/i,
|
1094
|
+
/^ap/i,
|
1095
|
+
/^may/i,
|
1096
|
+
/^jun/i,
|
1097
|
+
/^jul/i,
|
1098
|
+
/^au/i,
|
1099
|
+
/^s/i,
|
1100
|
+
/^o/i,
|
1101
|
+
/^n/i,
|
1102
|
+
/^d/i
|
1103
|
+
]
|
1104
|
+
};
|
1105
|
+
var matchDayPatterns = {
|
1106
|
+
narrow: /^[smtwf]/i,
|
1107
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
1108
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
1109
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
1110
|
+
};
|
1111
|
+
var parseDayPatterns = {
|
1112
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
1113
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
1114
|
+
};
|
1115
|
+
var matchDayPeriodPatterns = {
|
1116
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
1117
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
1118
|
+
};
|
1119
|
+
var parseDayPeriodPatterns = {
|
1120
|
+
any: {
|
1121
|
+
am: /^a/i,
|
1122
|
+
pm: /^p/i,
|
1123
|
+
midnight: /^mi/i,
|
1124
|
+
noon: /^no/i,
|
1125
|
+
morning: /morning/i,
|
1126
|
+
afternoon: /afternoon/i,
|
1127
|
+
evening: /evening/i,
|
1128
|
+
night: /night/i
|
1129
|
+
}
|
1130
|
+
};
|
1131
|
+
var match = {
|
1132
|
+
ordinalNumber: buildMatchPatternFn({
|
1133
|
+
matchPattern: matchOrdinalNumberPattern,
|
1134
|
+
parsePattern: parseOrdinalNumberPattern,
|
1135
|
+
valueCallback: (value) => parseInt(value, 10)
|
1136
|
+
}),
|
1137
|
+
era: buildMatchFn({
|
1138
|
+
matchPatterns: matchEraPatterns,
|
1139
|
+
defaultMatchWidth: "wide",
|
1140
|
+
parsePatterns: parseEraPatterns,
|
1141
|
+
defaultParseWidth: "any"
|
1142
|
+
}),
|
1143
|
+
quarter: buildMatchFn({
|
1144
|
+
matchPatterns: matchQuarterPatterns,
|
1145
|
+
defaultMatchWidth: "wide",
|
1146
|
+
parsePatterns: parseQuarterPatterns,
|
1147
|
+
defaultParseWidth: "any",
|
1148
|
+
valueCallback: (index) => index + 1
|
1149
|
+
}),
|
1150
|
+
month: buildMatchFn({
|
1151
|
+
matchPatterns: matchMonthPatterns,
|
1152
|
+
defaultMatchWidth: "wide",
|
1153
|
+
parsePatterns: parseMonthPatterns,
|
1154
|
+
defaultParseWidth: "any"
|
1155
|
+
}),
|
1156
|
+
day: buildMatchFn({
|
1157
|
+
matchPatterns: matchDayPatterns,
|
1158
|
+
defaultMatchWidth: "wide",
|
1159
|
+
parsePatterns: parseDayPatterns,
|
1160
|
+
defaultParseWidth: "any"
|
1161
|
+
}),
|
1162
|
+
dayPeriod: buildMatchFn({
|
1163
|
+
matchPatterns: matchDayPeriodPatterns,
|
1164
|
+
defaultMatchWidth: "any",
|
1165
|
+
parsePatterns: parseDayPeriodPatterns,
|
1166
|
+
defaultParseWidth: "any"
|
1167
|
+
})
|
1168
|
+
};
|
1169
|
+
|
1170
|
+
// node_modules/date-fns/locale/en-US.js
|
1171
|
+
var enUS = {
|
1172
|
+
code: "en-US",
|
1173
|
+
formatDistance,
|
1174
|
+
formatLong,
|
1175
|
+
formatRelative,
|
1176
|
+
localize,
|
1177
|
+
match,
|
1178
|
+
options: {
|
1179
|
+
weekStartsOn: 0,
|
1180
|
+
firstWeekContainsDate: 1
|
1181
|
+
}
|
1182
|
+
};
|
1183
|
+
|
1184
|
+
// node_modules/date-fns/formatDistance.js
|
1185
|
+
function formatDistance2(laterDate, earlierDate, options) {
|
1186
|
+
const defaultOptions2 = getDefaultOptions();
|
1187
|
+
const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
|
1188
|
+
const minutesInAlmostTwoDays = 2520;
|
1189
|
+
const comparison = compareAsc(laterDate, earlierDate);
|
1190
|
+
if (isNaN(comparison)) throw new RangeError("Invalid time value");
|
1191
|
+
const localizeOptions = Object.assign({}, options, {
|
1192
|
+
addSuffix: options?.addSuffix,
|
1193
|
+
comparison
|
1194
|
+
});
|
1195
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
1196
|
+
options?.in,
|
1197
|
+
...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]
|
1198
|
+
);
|
1199
|
+
const seconds = differenceInSeconds(earlierDate_, laterDate_);
|
1200
|
+
const offsetInSeconds = (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1e3;
|
1201
|
+
const minutes = Math.round((seconds - offsetInSeconds) / 60);
|
1202
|
+
let months;
|
1203
|
+
if (minutes < 2) {
|
1204
|
+
if (options?.includeSeconds) {
|
1205
|
+
if (seconds < 5) {
|
1206
|
+
return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
|
1207
|
+
} else if (seconds < 10) {
|
1208
|
+
return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
|
1209
|
+
} else if (seconds < 20) {
|
1210
|
+
return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
|
1211
|
+
} else if (seconds < 40) {
|
1212
|
+
return locale.formatDistance("halfAMinute", 0, localizeOptions);
|
1213
|
+
} else if (seconds < 60) {
|
1214
|
+
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
|
1215
|
+
} else {
|
1216
|
+
return locale.formatDistance("xMinutes", 1, localizeOptions);
|
1217
|
+
}
|
1218
|
+
} else {
|
1219
|
+
if (minutes === 0) {
|
1220
|
+
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
|
1221
|
+
} else {
|
1222
|
+
return locale.formatDistance("xMinutes", minutes, localizeOptions);
|
1223
|
+
}
|
1224
|
+
}
|
1225
|
+
} else if (minutes < 45) {
|
1226
|
+
return locale.formatDistance("xMinutes", minutes, localizeOptions);
|
1227
|
+
} else if (minutes < 90) {
|
1228
|
+
return locale.formatDistance("aboutXHours", 1, localizeOptions);
|
1229
|
+
} else if (minutes < minutesInDay) {
|
1230
|
+
const hours = Math.round(minutes / 60);
|
1231
|
+
return locale.formatDistance("aboutXHours", hours, localizeOptions);
|
1232
|
+
} else if (minutes < minutesInAlmostTwoDays) {
|
1233
|
+
return locale.formatDistance("xDays", 1, localizeOptions);
|
1234
|
+
} else if (minutes < minutesInMonth) {
|
1235
|
+
const days = Math.round(minutes / minutesInDay);
|
1236
|
+
return locale.formatDistance("xDays", days, localizeOptions);
|
1237
|
+
} else if (minutes < minutesInMonth * 2) {
|
1238
|
+
months = Math.round(minutes / minutesInMonth);
|
1239
|
+
return locale.formatDistance("aboutXMonths", months, localizeOptions);
|
1240
|
+
}
|
1241
|
+
months = differenceInMonths(earlierDate_, laterDate_);
|
1242
|
+
if (months < 12) {
|
1243
|
+
const nearestMonth = Math.round(minutes / minutesInMonth);
|
1244
|
+
return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
|
1245
|
+
} else {
|
1246
|
+
const monthsSinceStartOfYear = months % 12;
|
1247
|
+
const years = Math.trunc(months / 12);
|
1248
|
+
if (monthsSinceStartOfYear < 3) {
|
1249
|
+
return locale.formatDistance("aboutXYears", years, localizeOptions);
|
1250
|
+
} else if (monthsSinceStartOfYear < 9) {
|
1251
|
+
return locale.formatDistance("overXYears", years, localizeOptions);
|
1252
|
+
} else {
|
1253
|
+
return locale.formatDistance("almostXYears", years + 1, localizeOptions);
|
1254
|
+
}
|
1255
|
+
}
|
1256
|
+
}
|
1257
|
+
|
1258
|
+
// node_modules/date-fns/formatDistanceToNow.js
|
1259
|
+
function formatDistanceToNow(date, options) {
|
1260
|
+
return formatDistance2(date, constructNow(date), options);
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
// node_modules/@stimulus-components/timeago/dist/stimulus-timeago.mjs
|
1264
|
+
var _Timeago = class _Timeago2 extends Controller {
|
1265
|
+
initialize() {
|
1266
|
+
this.isValid = true;
|
1267
|
+
}
|
1268
|
+
connect() {
|
1269
|
+
this.load(), this.hasRefreshIntervalValue && this.isValid && this.startRefreshing();
|
1270
|
+
}
|
1271
|
+
disconnect() {
|
1272
|
+
this.stopRefreshing();
|
1273
|
+
}
|
1274
|
+
load() {
|
1275
|
+
const datetime = this.datetimeValue, date = Date.parse(datetime), options = {
|
1276
|
+
includeSeconds: this.includeSecondsValue,
|
1277
|
+
addSuffix: this.addSuffixValue,
|
1278
|
+
locale: this.locale
|
1279
|
+
};
|
1280
|
+
Number.isNaN(date) && (this.isValid = false, console.error(
|
1281
|
+
`[@stimulus-components/timeago] Value given in 'data-timeago-datetime' is not a valid date (${datetime}). Please provide a ISO 8601 compatible datetime string. Displaying given value instead.`
|
1282
|
+
)), this.element.dateTime = datetime, this.element.innerHTML = this.isValid ? formatDistanceToNow(date, options) : datetime;
|
1283
|
+
}
|
1284
|
+
startRefreshing() {
|
1285
|
+
this.refreshTimer = setInterval(() => {
|
1286
|
+
this.load();
|
1287
|
+
}, this.refreshIntervalValue);
|
1288
|
+
}
|
1289
|
+
stopRefreshing() {
|
1290
|
+
this.refreshTimer && clearInterval(this.refreshTimer);
|
1291
|
+
}
|
1292
|
+
};
|
1293
|
+
_Timeago.values = {
|
1294
|
+
datetime: String,
|
1295
|
+
refreshInterval: Number,
|
1296
|
+
includeSeconds: Boolean,
|
1297
|
+
addSuffix: Boolean
|
1298
|
+
};
|
1299
|
+
var Timeago = _Timeago;
|
1300
|
+
|
1301
|
+
// app/javascript/design_system/index.js
|
1302
|
+
var registerControllers = (application) => {
|
1303
|
+
application.register("ds--hello-world", hello_world_controller_default);
|
1304
|
+
application.register("ds--show-password", show_password_controller_default);
|
1305
|
+
application.register("timeago", Timeago);
|
1306
|
+
};
|
1307
|
+
export {
|
1308
|
+
registerControllers
|
1309
|
+
};
|