@dta-au/civictheme-twig 1.13.1
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.
- package/assets/backgrounds/civictheme_background_1.png +0 -0
- package/assets/backgrounds/civictheme_background_2.png +0 -0
- package/assets/backgrounds/civictheme_background_3.png +0 -0
- package/assets/backgrounds/civictheme_background_4.png +0 -0
- package/assets/backgrounds/civictheme_background_5.png +0 -0
- package/assets/backgrounds/civictheme_background_6.png +0 -0
- package/assets/backgrounds/civictheme_background_7.png +0 -0
- package/assets/fonts/.gitkeep +0 -0
- package/assets/icons/account.svg +3 -0
- package/assets/icons/approve.svg +3 -0
- package/assets/icons/bars.svg +3 -0
- package/assets/icons/bullet.svg +3 -0
- package/assets/icons/calendar-1.svg +3 -0
- package/assets/icons/calendar-2.svg +3 -0
- package/assets/icons/call.svg +3 -0
- package/assets/icons/cancel.svg +3 -0
- package/assets/icons/checked.svg +4 -0
- package/assets/icons/close-outline.svg +3 -0
- package/assets/icons/close.svg +3 -0
- package/assets/icons/document.svg +4 -0
- package/assets/icons/down-arrow-1.svg +3 -0
- package/assets/icons/down-arrow-2.svg +3 -0
- package/assets/icons/download-file.svg +3 -0
- package/assets/icons/download.svg +3 -0
- package/assets/icons/exclamation-mark-1.svg +3 -0
- package/assets/icons/exclamation-mark-2.svg +3 -0
- package/assets/icons/exclamation-mark-3.svg +3 -0
- package/assets/icons/eye.svg +3 -0
- package/assets/icons/facebook.svg +3 -0
- package/assets/icons/help.svg +3 -0
- package/assets/icons/image.svg +5 -0
- package/assets/icons/information-mark.svg +3 -0
- package/assets/icons/instagram.svg +3 -0
- package/assets/icons/layer.svg +4 -0
- package/assets/icons/layers.svg +4 -0
- package/assets/icons/left-arrow-outline.svg +3 -0
- package/assets/icons/left-arrow.svg +3 -0
- package/assets/icons/linkedin.svg +3 -0
- package/assets/icons/lock-file.svg +4 -0
- package/assets/icons/lock-gallery.svg +4 -0
- package/assets/icons/magnifier.svg +3 -0
- package/assets/icons/map.svg +3 -0
- package/assets/icons/megaphone.svg +3 -0
- package/assets/icons/message.svg +3 -0
- package/assets/icons/mobile.svg +4 -0
- package/assets/icons/mortarboard.svg +3 -0
- package/assets/icons/newspaper.svg +3 -0
- package/assets/icons/open-source.svg +3 -0
- package/assets/icons/pdf-file.svg +4 -0
- package/assets/icons/progress.svg +3 -0
- package/assets/icons/right-arrow-1.svg +3 -0
- package/assets/icons/right-arrow-2.svg +3 -0
- package/assets/icons/select-box.svg +4 -0
- package/assets/icons/share.svg +3 -0
- package/assets/icons/square.svg +3 -0
- package/assets/icons/to-do.svg +3 -0
- package/assets/icons/twitter.svg +3 -0
- package/assets/icons/up-arrow.svg +3 -0
- package/assets/icons/upper-arrow.svg +3 -0
- package/assets/icons/upper-right-arrow.svg +3 -0
- package/assets/icons/users.svg +4 -0
- package/assets/icons/watch.svg +3 -0
- package/assets/icons/water-drop.svg +4 -0
- package/assets/icons/web.svg +4 -0
- package/assets/icons/word-file.svg +4 -0
- package/assets/icons/x.svg +3 -0
- package/assets/icons/youtube.svg +3 -0
- package/assets/logos/logo_custom_light_desktop_civictheme.svg +32 -0
- package/assets/logos/logo_custom_light_mobile_civictheme.svg +32 -0
- package/assets/logos/logo_primary_dark_desktop.png +0 -0
- package/assets/logos/logo_primary_dark_mobile.png +0 -0
- package/assets/logos/logo_primary_light_desktop.png +0 -0
- package/assets/logos/logo_primary_light_mobile.png +0 -0
- package/assets/logos/logo_secondary_dark_desktop.png +0 -0
- package/assets/logos/logo_secondary_dark_mobile.png +0 -0
- package/assets/logos/logo_secondary_light_desktop.png +0 -0
- package/assets/logos/logo_secondary_light_mobile.png +0 -0
- package/components/00-base/_variables.base.scss +482 -0
- package/components/00-base/_variables.components.scss +1315 -0
- package/components/00-base/about-civictheme/about-civictheme.stories.js +37 -0
- package/components/00-base/about-civictheme/about-civictheme.stories.scss +37 -0
- package/components/00-base/about-civictheme/about-civictheme.stories.twig +219 -0
- package/components/00-base/background/background.scss +12 -0
- package/components/00-base/background/background.stories.js +33 -0
- package/components/00-base/background/background.stories.scss +16 -0
- package/components/00-base/background/background.stories.twig +6 -0
- package/components/00-base/background/background.utils.js +23 -0
- package/components/00-base/collapsible/collapsible.js +452 -0
- package/components/00-base/collapsible/collapsible.scss +80 -0
- package/components/00-base/collapsible/collapsible.stories.js +17 -0
- package/components/00-base/collapsible/collapsible.stories.scss +38 -0
- package/components/00-base/collapsible/collapsible.stories.twig +497 -0
- package/components/00-base/collapsible/collapsible.test.js +186 -0
- package/components/00-base/colors/colors.stories.js +142 -0
- package/components/00-base/colors/colors.stories.scss +78 -0
- package/components/00-base/colors/colors.stories.twig +42 -0
- package/components/00-base/datetime/__snapshots__/datetime.test.js.snap +114 -0
- package/components/00-base/datetime/datetime.stories.js +47 -0
- package/components/00-base/datetime/datetime.test.js +75 -0
- package/components/00-base/datetime/datetime.twig +24 -0
- package/components/00-base/debug/_index.scss +24 -0
- package/components/00-base/elevation/elevation.stories.js +14 -0
- package/components/00-base/elevation/elevation.stories.scss +21 -0
- package/components/00-base/elevation/elevation.stories.twig +8 -0
- package/components/00-base/flex/_index.scss +37 -0
- package/components/00-base/flyout/flyout.js +207 -0
- package/components/00-base/flyout/flyout.scss +47 -0
- package/components/00-base/flyout/flyout.stories.js +34 -0
- package/components/00-base/flyout/flyout.stories.scss +38 -0
- package/components/00-base/flyout/flyout.stories.twig +101 -0
- package/components/00-base/fonts/_index.scss +15 -0
- package/components/00-base/fonts/fonts.stories.js +40 -0
- package/components/00-base/fonts/fonts.stories.scss +28 -0
- package/components/00-base/fonts/fonts.stories.twig +15 -0
- package/components/00-base/grid/__snapshots__/grid.test.js.snap +2113 -0
- package/components/00-base/grid/grid.scss +164 -0
- package/components/00-base/grid/grid.stories.js +570 -0
- package/components/00-base/grid/grid.stories.scss +184 -0
- package/components/00-base/grid/grid.test.js +386 -0
- package/components/00-base/grid/grid.twig +96 -0
- package/components/00-base/icon/__snapshots__/icon.test.js.snap +76 -0
- package/components/00-base/icon/icon.scss +21 -0
- package/components/00-base/icon/icon.stories.js +46 -0
- package/components/00-base/icon/icon.test.js +53 -0
- package/components/00-base/icon/icon.twig +35 -0
- package/components/00-base/icon/icon.utils.js +35 -0
- package/components/00-base/item-list/__snapshots__/item-list.test.js.snap +255 -0
- package/components/00-base/item-list/item-list.scss +66 -0
- package/components/00-base/item-list/item-list.stories.js +49 -0
- package/components/00-base/item-list/item-list.test.js +96 -0
- package/components/00-base/item-list/item-list.twig +35 -0
- package/components/00-base/layout/__snapshots__/layout.test.js.snap +520 -0
- package/components/00-base/layout/layout.js +97 -0
- package/components/00-base/layout/layout.scss +329 -0
- package/components/00-base/layout/layout.stories.data.js +22 -0
- package/components/00-base/layout/layout.stories.js +120 -0
- package/components/00-base/layout/layout.stories.scss +55 -0
- package/components/00-base/layout/layout.test.js +166 -0
- package/components/00-base/layout/layout.twig +115 -0
- package/components/00-base/menu/__snapshots__/menu.test.js.snap +1028 -0
- package/components/00-base/menu/menu.stories.js +107 -0
- package/components/00-base/menu/menu.stories.scss +11 -0
- package/components/00-base/menu/menu.test.js +231 -0
- package/components/00-base/menu/menu.twig +133 -0
- package/components/00-base/mixins/_background.scss +11 -0
- package/components/00-base/mixins/_breakpoint.scss +75 -0
- package/components/00-base/mixins/_button.scss +312 -0
- package/components/00-base/mixins/_color.scss +137 -0
- package/components/00-base/mixins/_component.scss +39 -0
- package/components/00-base/mixins/_content-link.scss +58 -0
- package/components/00-base/mixins/_content.scss +369 -0
- package/components/00-base/mixins/_cssgrid.scss +106 -0
- package/components/00-base/mixins/_debug.scss +29 -0
- package/components/00-base/mixins/_deprecations.scss +21 -0
- package/components/00-base/mixins/_disabled.scss +11 -0
- package/components/00-base/mixins/_elevation.scss +37 -0
- package/components/00-base/mixins/_font.scss +140 -0
- package/components/00-base/mixins/_form.scss +30 -0
- package/components/00-base/mixins/_generator.scss +35 -0
- package/components/00-base/mixins/_grid.scss +223 -0
- package/components/00-base/mixins/_highlight.scss +84 -0
- package/components/00-base/mixins/_icon.scss +118 -0
- package/components/00-base/mixins/_image.scss +149 -0
- package/components/00-base/mixins/_index.scss +25 -0
- package/components/00-base/mixins/_link.scss +163 -0
- package/components/00-base/mixins/_map.scss +90 -0
- package/components/00-base/mixins/_message.scss +11 -0
- package/components/00-base/mixins/_outline.scss +32 -0
- package/components/00-base/mixins/_particle.scss +40 -0
- package/components/00-base/mixins/_print.scss +26 -0
- package/components/00-base/mixins/_rem.scss +20 -0
- package/components/00-base/mixins/_reset.scss +85 -0
- package/components/00-base/mixins/_spacing.scss +57 -0
- package/components/00-base/mixins/_string.scss +76 -0
- package/components/00-base/mixins/_table.scss +254 -0
- package/components/00-base/mixins/_typography.scss +193 -0
- package/components/00-base/mixins/_visibility.scss +27 -0
- package/components/00-base/platform/platform.js +27 -0
- package/components/00-base/responsive/responsive.js +186 -0
- package/components/00-base/responsive/responsive.stories.js +17 -0
- package/components/00-base/responsive/responsive.stories.twig +121 -0
- package/components/00-base/scrollspy/scrollspy.js +36 -0
- package/components/00-base/scrollspy/scrollspy.scss +11 -0
- package/components/00-base/scrollspy/scrollspy.stories.js +18 -0
- package/components/00-base/scrollspy/scrollspy.stories.scss +51 -0
- package/components/00-base/scrollspy/scrollspy.stories.twig +9 -0
- package/components/00-base/skip-to-target/skip-to-target.js +27 -0
- package/components/00-base/spacing/spacing.scss +29 -0
- package/components/00-base/spacing/spacing.stories.js +16 -0
- package/components/00-base/spacing/spacing.stories.scss +51 -0
- package/components/00-base/spacing/spacing.stories.twig +64 -0
- package/components/00-base/storybook/storybook.container.utils.stories.scss +105 -0
- package/components/00-base/storybook/storybook.docs.utils.js +37 -0
- package/components/00-base/storybook/storybook.docs.utils.stories.scss +70 -0
- package/components/00-base/storybook/storybook.generators.utils.js +19 -0
- package/components/00-base/storybook/storybook.layout.utils.stories.scss +90 -0
- package/components/00-base/storybook/storybook.placeholder.utils.stories.scss +75 -0
- package/components/00-base/storybook/storybook.stories.scss +8 -0
- package/components/00-base/text-icon/text-icon.scss +9 -0
- package/components/00-base/text-icon/text-icon.stories.js +57 -0
- package/components/00-base/text-icon/text-icon.twig +81 -0
- package/components/00-base/typography/typography.scss +81 -0
- package/components/00-base/typography/typography.stories.js +17 -0
- package/components/00-base/typography/typography.stories.twig +228 -0
- package/components/00-base/variables.scss +41 -0
- package/components/00-base/visibility/_index.scss +42 -0
- package/components/00-base/welcome/welcome.stories.js +37 -0
- package/components/00-base/welcome/welcome.stories.scss +30 -0
- package/components/00-base/welcome/welcome.stories.twig +41 -0
- package/components/01-atoms/button/__snapshots__/button.test.js.snap +205 -0
- package/components/01-atoms/button/button.js +127 -0
- package/components/01-atoms/button/button.scss +82 -0
- package/components/01-atoms/button/button.stories.js +86 -0
- package/components/01-atoms/button/button.test.js +103 -0
- package/components/01-atoms/button/button.twig +82 -0
- package/components/01-atoms/checkbox/__snapshots__/checkbox.test.js.snap +65 -0
- package/components/01-atoms/checkbox/checkbox.scss +176 -0
- package/components/01-atoms/checkbox/checkbox.stories.js +63 -0
- package/components/01-atoms/checkbox/checkbox.test.js +67 -0
- package/components/01-atoms/checkbox/checkbox.twig +47 -0
- package/components/01-atoms/chip/__snapshots__/chip.test.js.snap +90 -0
- package/components/01-atoms/chip/chip.event.stories.js +25 -0
- package/components/01-atoms/chip/chip.js +104 -0
- package/components/01-atoms/chip/chip.scss +144 -0
- package/components/01-atoms/chip/chip.stories.js +74 -0
- package/components/01-atoms/chip/chip.test.js +53 -0
- package/components/01-atoms/chip/chip.twig +73 -0
- package/components/01-atoms/content-link/__snapshots__/content-link.test.js.snap +91 -0
- package/components/01-atoms/content-link/content-link.scss +16 -0
- package/components/01-atoms/content-link/content-link.stories.js +50 -0
- package/components/01-atoms/content-link/content-link.test.js +50 -0
- package/components/01-atoms/content-link/content-link.twig +40 -0
- package/components/01-atoms/field-description/__snapshots__/field-description.test.js.snap +49 -0
- package/components/01-atoms/field-description/field-description.scss +24 -0
- package/components/01-atoms/field-description/field-description.stories.js +41 -0
- package/components/01-atoms/field-description/field-description.test.js +51 -0
- package/components/01-atoms/field-description/field-description.twig +24 -0
- package/components/01-atoms/field-message/__snapshots__/field-message.test.js.snap +142 -0
- package/components/01-atoms/field-message/field-message.scss +108 -0
- package/components/01-atoms/field-message/field-message.stories.js +41 -0
- package/components/01-atoms/field-message/field-message.test.js +64 -0
- package/components/01-atoms/field-message/field-message.twig +37 -0
- package/components/01-atoms/fieldset/__snapshots__/fieldset.test.js.snap +358 -0
- package/components/01-atoms/fieldset/fieldset.scss +44 -0
- package/components/01-atoms/fieldset/fieldset.stories.js +79 -0
- package/components/01-atoms/fieldset/fieldset.test.js +102 -0
- package/components/01-atoms/fieldset/fieldset.twig +91 -0
- package/components/01-atoms/heading/__snapshots__/heading.test.js.snap +43 -0
- package/components/01-atoms/heading/heading.scss +13 -0
- package/components/01-atoms/heading/heading.stories.js +41 -0
- package/components/01-atoms/heading/heading.test.js +42 -0
- package/components/01-atoms/heading/heading.twig +24 -0
- package/components/01-atoms/iframe/__snapshots__/iframe.test.js.snap +34 -0
- package/components/01-atoms/iframe/iframe.scss +29 -0
- package/components/01-atoms/iframe/iframe.stories.js +53 -0
- package/components/01-atoms/iframe/iframe.test.js +37 -0
- package/components/01-atoms/iframe/iframe.twig +29 -0
- package/components/01-atoms/image/__snapshots__/image.test.js.snap +45 -0
- package/components/01-atoms/image/image.stories.js +48 -0
- package/components/01-atoms/image/image.test.js +45 -0
- package/components/01-atoms/image/image.twig +31 -0
- package/components/01-atoms/input/__snapshots__/input.test.js.snap +64 -0
- package/components/01-atoms/input/input.scss +112 -0
- package/components/01-atoms/input/input.stories.js +81 -0
- package/components/01-atoms/input/input.test.js +71 -0
- package/components/01-atoms/input/input.twig +38 -0
- package/components/01-atoms/label/__snapshots__/label.test.js.snap +69 -0
- package/components/01-atoms/label/label.scss +34 -0
- package/components/01-atoms/label/label.stories.js +65 -0
- package/components/01-atoms/label/label.test.js +76 -0
- package/components/01-atoms/label/label.twig +35 -0
- package/components/01-atoms/link/__snapshots__/link.test.js.snap +138 -0
- package/components/01-atoms/link/link.scss +53 -0
- package/components/01-atoms/link/link.stories.js +82 -0
- package/components/01-atoms/link/link.test.js +84 -0
- package/components/01-atoms/link/link.twig +62 -0
- package/components/01-atoms/paragraph/__snapshots__/paragraph.test.js.snap +36 -0
- package/components/01-atoms/paragraph/paragraph.scss +31 -0
- package/components/01-atoms/paragraph/paragraph.stories.js +45 -0
- package/components/01-atoms/paragraph/paragraph.test.js +40 -0
- package/components/01-atoms/paragraph/paragraph.twig +25 -0
- package/components/01-atoms/popover/__snapshots__/popover.test.js.snap +129 -0
- package/components/01-atoms/popover/popover.scss +44 -0
- package/components/01-atoms/popover/popover.stories.js +52 -0
- package/components/01-atoms/popover/popover.test.js +57 -0
- package/components/01-atoms/popover/popover.twig +69 -0
- package/components/01-atoms/radio/__snapshots__/radio.test.js.snap +83 -0
- package/components/01-atoms/radio/radio.scss +176 -0
- package/components/01-atoms/radio/radio.stories.js +64 -0
- package/components/01-atoms/radio/radio.test.js +76 -0
- package/components/01-atoms/radio/radio.twig +47 -0
- package/components/01-atoms/select/__snapshots__/select.test.js.snap +165 -0
- package/components/01-atoms/select/select.scss +105 -0
- package/components/01-atoms/select/select.stories.js +81 -0
- package/components/01-atoms/select/select.test.js +117 -0
- package/components/01-atoms/select/select.twig +63 -0
- package/components/01-atoms/table/__snapshots__/table.test.js.snap +206 -0
- package/components/01-atoms/table/table.js +79 -0
- package/components/01-atoms/table/table.scss +18 -0
- package/components/01-atoms/table/table.stories.js +129 -0
- package/components/01-atoms/table/table.test.js +60 -0
- package/components/01-atoms/table/table.twig +104 -0
- package/components/01-atoms/tag/__snapshots__/tag.test.js.snap +97 -0
- package/components/01-atoms/tag/tag.scss +63 -0
- package/components/01-atoms/tag/tag.stories.js +55 -0
- package/components/01-atoms/tag/tag.test.js +49 -0
- package/components/01-atoms/tag/tag.twig +74 -0
- package/components/01-atoms/textarea/__snapshots__/textarea.test.js.snap +64 -0
- package/components/01-atoms/textarea/textarea.scss +72 -0
- package/components/01-atoms/textarea/textarea.stories.js +64 -0
- package/components/01-atoms/textarea/textarea.test.js +68 -0
- package/components/01-atoms/textarea/textarea.twig +37 -0
- package/components/01-atoms/textfield/__snapshots__/textfield.test.js.snap +63 -0
- package/components/01-atoms/textfield/textfield.scss +70 -0
- package/components/01-atoms/textfield/textfield.stories.js +60 -0
- package/components/01-atoms/textfield/textfield.test.js +64 -0
- package/components/01-atoms/textfield/textfield.twig +37 -0
- package/components/01-atoms/video/__snapshots__/video.test.js.snap +75 -0
- package/components/01-atoms/video/video.stories.js +69 -0
- package/components/01-atoms/video/video.test.js +57 -0
- package/components/01-atoms/video/video.twig +59 -0
- package/components/02-molecules/accordion/__snapshots__/accordion.test.js.snap +651 -0
- package/components/02-molecules/accordion/accordion.scss +109 -0
- package/components/02-molecules/accordion/accordion.stories.js +73 -0
- package/components/02-molecules/accordion/accordion.test.js +84 -0
- package/components/02-molecules/accordion/accordion.twig +86 -0
- package/components/02-molecules/attachment/__snapshots__/attachment.test.js.snap +694 -0
- package/components/02-molecules/attachment/attachment.scss +54 -0
- package/components/02-molecules/attachment/attachment.stories.js +125 -0
- package/components/02-molecules/attachment/attachment.test.js +84 -0
- package/components/02-molecules/attachment/attachment.twig +139 -0
- package/components/02-molecules/back-to-top/__snapshots__/back-to-top.test.js.snap +172 -0
- package/components/02-molecules/back-to-top/back-to-top.scss +39 -0
- package/components/02-molecules/back-to-top/back-to-top.stories.js +26 -0
- package/components/02-molecules/back-to-top/back-to-top.stories.scss +20 -0
- package/components/02-molecules/back-to-top/back-to-top.stories.twig +6 -0
- package/components/02-molecules/back-to-top/back-to-top.test.js +31 -0
- package/components/02-molecules/back-to-top/back-to-top.twig +32 -0
- package/components/02-molecules/basic-content/__snapshots__/basic-content.test.js.snap +110 -0
- package/components/02-molecules/basic-content/basic-content.scss +39 -0
- package/components/02-molecules/basic-content/basic-content.stories.data.js +157 -0
- package/components/02-molecules/basic-content/basic-content.stories.js +56 -0
- package/components/02-molecules/basic-content/basic-content.test.js +59 -0
- package/components/02-molecules/basic-content/basic-content.twig +42 -0
- package/components/02-molecules/breadcrumb/__snapshots__/breadcrumb.test.js.snap +553 -0
- package/components/02-molecules/breadcrumb/breadcrumb.scss +23 -0
- package/components/02-molecules/breadcrumb/breadcrumb.stories.js +53 -0
- package/components/02-molecules/breadcrumb/breadcrumb.test.js +82 -0
- package/components/02-molecules/breadcrumb/breadcrumb.twig +85 -0
- package/components/02-molecules/callout/__snapshots__/callout.test.js.snap +384 -0
- package/components/02-molecules/callout/callout.scss +35 -0
- package/components/02-molecules/callout/callout.stories.js +70 -0
- package/components/02-molecules/callout/callout.test.js +73 -0
- package/components/02-molecules/callout/callout.twig +108 -0
- package/components/02-molecules/event-card/__snapshots__/event-card.test.js.snap +382 -0
- package/components/02-molecules/event-card/event-card.scss +153 -0
- package/components/02-molecules/event-card/event-card.stories.data.js +31 -0
- package/components/02-molecules/event-card/event-card.stories.js +68 -0
- package/components/02-molecules/event-card/event-card.test.js +74 -0
- package/components/02-molecules/event-card/event-card.twig +195 -0
- package/components/02-molecules/fast-fact-card/__snapshots__/fast-fact-card.test.js.snap +186 -0
- package/components/02-molecules/fast-fact-card/fast-fact-card.scss +104 -0
- package/components/02-molecules/fast-fact-card/fast-fact-card.stories.data.js +18 -0
- package/components/02-molecules/fast-fact-card/fast-fact-card.stories.js +44 -0
- package/components/02-molecules/fast-fact-card/fast-fact-card.test.js +90 -0
- package/components/02-molecules/fast-fact-card/fast-fact-card.twig +74 -0
- package/components/02-molecules/field/__snapshots__/field.test.js.snap +1526 -0
- package/components/02-molecules/field/field.scss +92 -0
- package/components/02-molecules/field/field.stories.data.js +52 -0
- package/components/02-molecules/field/field.stories.js +117 -0
- package/components/02-molecules/field/field.test.js +530 -0
- package/components/02-molecules/field/field.twig +206 -0
- package/components/02-molecules/figure/__snapshots__/figure.test.js.snap +104 -0
- package/components/02-molecules/figure/figure.scss +27 -0
- package/components/02-molecules/figure/figure.stories.js +52 -0
- package/components/02-molecules/figure/figure.test.js +60 -0
- package/components/02-molecules/figure/figure.twig +43 -0
- package/components/02-molecules/group-filter/__snapshots__/group-filter.test.js.snap +1466 -0
- package/components/02-molecules/group-filter/group-filter.js +33 -0
- package/components/02-molecules/group-filter/group-filter.scss +111 -0
- package/components/02-molecules/group-filter/group-filter.stories.data.js +83 -0
- package/components/02-molecules/group-filter/group-filter.stories.js +81 -0
- package/components/02-molecules/group-filter/group-filter.test.js +104 -0
- package/components/02-molecules/group-filter/group-filter.twig +192 -0
- package/components/02-molecules/inline-filter/inline-filter.scss +58 -0
- package/components/02-molecules/inline-filter/inline-filter.stories.data.js +24 -0
- package/components/02-molecules/inline-filter/inline-filter.stories.js +52 -0
- package/components/02-molecules/inline-filter/inline-filter.twig +48 -0
- package/components/02-molecules/logo/__snapshots__/logo.test.js.snap +191 -0
- package/components/02-molecules/logo/logo.scss +60 -0
- package/components/02-molecules/logo/logo.stories.data.js +34 -0
- package/components/02-molecules/logo/logo.stories.js +56 -0
- package/components/02-molecules/logo/logo.test.js +111 -0
- package/components/02-molecules/logo/logo.twig +71 -0
- package/components/02-molecules/logo/logo.utils.js +57 -0
- package/components/02-molecules/map/__snapshots__/map.test.js.snap +310 -0
- package/components/02-molecules/map/map.scss +35 -0
- package/components/02-molecules/map/map.stories.js +65 -0
- package/components/02-molecules/map/map.test.js +78 -0
- package/components/02-molecules/map/map.twig +86 -0
- package/components/02-molecules/navigation-card/__snapshots__/navigation-card.test.js.snap +507 -0
- package/components/02-molecules/navigation-card/navigation-card.scss +164 -0
- package/components/02-molecules/navigation-card/navigation-card.stories.data.js +26 -0
- package/components/02-molecules/navigation-card/navigation-card.stories.js +64 -0
- package/components/02-molecules/navigation-card/navigation-card.test.js +146 -0
- package/components/02-molecules/navigation-card/navigation-card.twig +165 -0
- package/components/02-molecules/next-step/__snapshots__/next-step.test.js.snap +331 -0
- package/components/02-molecules/next-step/next-step.scss +46 -0
- package/components/02-molecules/next-step/next-step.stories.js +61 -0
- package/components/02-molecules/next-step/next-step.test.js +74 -0
- package/components/02-molecules/next-step/next-step.twig +104 -0
- package/components/02-molecules/pagination/__snapshots__/pagination.test.js.snap +863 -0
- package/components/02-molecules/pagination/pagination.scss +103 -0
- package/components/02-molecules/pagination/pagination.stories.data.js +55 -0
- package/components/02-molecules/pagination/pagination.stories.js +56 -0
- package/components/02-molecules/pagination/pagination.test.js +121 -0
- package/components/02-molecules/pagination/pagination.twig +177 -0
- package/components/02-molecules/promo-card/__snapshots__/promo-card.test.js.snap +407 -0
- package/components/02-molecules/promo-card/promo-card.scss +149 -0
- package/components/02-molecules/promo-card/promo-card.stories.data.js +32 -0
- package/components/02-molecules/promo-card/promo-card.stories.js +62 -0
- package/components/02-molecules/promo-card/promo-card.test.js +98 -0
- package/components/02-molecules/promo-card/promo-card.twig +198 -0
- package/components/02-molecules/publication-card/__snapshots__/publication-card.test.js.snap +342 -0
- package/components/02-molecules/publication-card/publication-card.scss +148 -0
- package/components/02-molecules/publication-card/publication-card.stories.js +83 -0
- package/components/02-molecules/publication-card/publication-card.test.js +113 -0
- package/components/02-molecules/publication-card/publication-card.twig +162 -0
- package/components/02-molecules/search/__snapshots__/search.test.js.snap +161 -0
- package/components/02-molecules/search/search.scss +74 -0
- package/components/02-molecules/search/search.stories.js +40 -0
- package/components/02-molecules/search/search.test.js +58 -0
- package/components/02-molecules/search/search.twig +33 -0
- package/components/02-molecules/service-card/__snapshots__/service-card.test.js.snap +324 -0
- package/components/02-molecules/service-card/service-card.scss +42 -0
- package/components/02-molecules/service-card/service-card.stories.js +65 -0
- package/components/02-molecules/service-card/service-card.test.js +91 -0
- package/components/02-molecules/service-card/service-card.twig +89 -0
- package/components/02-molecules/single-filter/__snapshots__/single-filter.test.js.snap +694 -0
- package/components/02-molecules/single-filter/single-filter.js +33 -0
- package/components/02-molecules/single-filter/single-filter.scss +70 -0
- package/components/02-molecules/single-filter/single-filter.stories.data.js +35 -0
- package/components/02-molecules/single-filter/single-filter.stories.js +53 -0
- package/components/02-molecules/single-filter/single-filter.test.js +102 -0
- package/components/02-molecules/single-filter/single-filter.twig +139 -0
- package/components/02-molecules/snippet/__snapshots__/snippet.test.js.snap +367 -0
- package/components/02-molecules/snippet/snippet.scss +60 -0
- package/components/02-molecules/snippet/snippet.stories.data.js +20 -0
- package/components/02-molecules/snippet/snippet.stories.js +50 -0
- package/components/02-molecules/snippet/snippet.test.js +108 -0
- package/components/02-molecules/snippet/snippet.twig +109 -0
- package/components/02-molecules/social-links/__snapshots__/social-links.test.js.snap +311 -0
- package/components/02-molecules/social-links/social-links.scss +23 -0
- package/components/02-molecules/social-links/social-links.stories.js +77 -0
- package/components/02-molecules/social-links/social-links.test.js +82 -0
- package/components/02-molecules/social-links/social-links.twig +58 -0
- package/components/02-molecules/subject-card/__snapshots__/subject-card.test.js.snap +219 -0
- package/components/02-molecules/subject-card/subject-card.scss +112 -0
- package/components/02-molecules/subject-card/subject-card.stories.js +58 -0
- package/components/02-molecules/subject-card/subject-card.test.js +102 -0
- package/components/02-molecules/subject-card/subject-card.twig +81 -0
- package/components/02-molecules/table-of-contents/table-of-contents.js +152 -0
- package/components/02-molecules/table-of-contents/table-of-contents.scss +115 -0
- package/components/02-molecules/table-of-contents/table-of-contents.stories.js +88 -0
- package/components/02-molecules/table-of-contents/table-of-contents.twig +63 -0
- package/components/02-molecules/tabs/__snapshots__/tabs.test.js.snap +346 -0
- package/components/02-molecules/tabs/tabs.js +75 -0
- package/components/02-molecules/tabs/tabs.scss +66 -0
- package/components/02-molecules/tabs/tabs.stories.js +80 -0
- package/components/02-molecules/tabs/tabs.test.js +75 -0
- package/components/02-molecules/tabs/tabs.twig +81 -0
- package/components/02-molecules/tag-list/__snapshots__/tag-list.test.js.snap +255 -0
- package/components/02-molecules/tag-list/tag-list.stories.js +53 -0
- package/components/02-molecules/tag-list/tag-list.test.js +64 -0
- package/components/02-molecules/tag-list/tag-list.twig +68 -0
- package/components/02-molecules/tooltip/__snapshots__/tooltip.test.js.snap +321 -0
- package/components/02-molecules/tooltip/tooltip.js +143 -0
- package/components/02-molecules/tooltip/tooltip.scss +165 -0
- package/components/02-molecules/tooltip/tooltip.stories.js +59 -0
- package/components/02-molecules/tooltip/tooltip.test.js +59 -0
- package/components/02-molecules/tooltip/tooltip.twig +48 -0
- package/components/02-molecules/video-player/__snapshots__/video-player.test.js.snap +244 -0
- package/components/02-molecules/video-player/video-player.scss +75 -0
- package/components/02-molecules/video-player/video-player.stories.js +180 -0
- package/components/02-molecules/video-player/video-player.test.js +81 -0
- package/components/02-molecules/video-player/video-player.twig +130 -0
- package/components/03-organisms/alert/__snapshots__/alert.test.js.snap +356 -0
- package/components/03-organisms/alert/alert.js +268 -0
- package/components/03-organisms/alert/alert.scss +90 -0
- package/components/03-organisms/alert/alert.stories.js +104 -0
- package/components/03-organisms/alert/alert.test.js +59 -0
- package/components/03-organisms/alert/alert.twig +76 -0
- package/components/03-organisms/banner/__snapshots__/banner.test.js.snap +621 -0
- package/components/03-organisms/banner/banner.scss +118 -0
- package/components/03-organisms/banner/banner.stories.data.js +88 -0
- package/components/03-organisms/banner/banner.stories.js +87 -0
- package/components/03-organisms/banner/banner.test.js +94 -0
- package/components/03-organisms/banner/banner.twig +218 -0
- package/components/03-organisms/campaign/__snapshots__/campaign.test.js.snap +489 -0
- package/components/03-organisms/campaign/campaign.scss +64 -0
- package/components/03-organisms/campaign/campaign.stories.js +92 -0
- package/components/03-organisms/campaign/campaign.test.js +81 -0
- package/components/03-organisms/campaign/campaign.twig +152 -0
- package/components/03-organisms/footer/__snapshots__/footer.test.js.snap +354 -0
- package/components/03-organisms/footer/footer.scss +114 -0
- package/components/03-organisms/footer/footer.stories.data.js +42 -0
- package/components/03-organisms/footer/footer.stories.js +75 -0
- package/components/03-organisms/footer/footer.test.js +85 -0
- package/components/03-organisms/footer/footer.twig +157 -0
- package/components/03-organisms/header/__snapshots__/header.test.js.snap +411 -0
- package/components/03-organisms/header/header.scss +59 -0
- package/components/03-organisms/header/header.stories.data.js +132 -0
- package/components/03-organisms/header/header.stories.js +78 -0
- package/components/03-organisms/header/header.test.js +72 -0
- package/components/03-organisms/header/header.twig +141 -0
- package/components/03-organisms/list/__snapshots__/list.test.js.snap +454 -0
- package/components/03-organisms/list/list.scss +83 -0
- package/components/03-organisms/list/list.stories.data.js +98 -0
- package/components/03-organisms/list/list.stories.js +223 -0
- package/components/03-organisms/list/list.test.js +93 -0
- package/components/03-organisms/list/list.twig +263 -0
- package/components/03-organisms/message/__snapshots__/message.test.js.snap +517 -0
- package/components/03-organisms/message/message.scss +69 -0
- package/components/03-organisms/message/message.stories.js +58 -0
- package/components/03-organisms/message/message.test.js +158 -0
- package/components/03-organisms/message/message.twig +69 -0
- package/components/03-organisms/mobile-navigation/__snapshots__/mobile-navigation.test.js.snap +928 -0
- package/components/03-organisms/mobile-navigation/mobile-navigation-close.twig +31 -0
- package/components/03-organisms/mobile-navigation/mobile-navigation-menu.twig +138 -0
- package/components/03-organisms/mobile-navigation/mobile-navigation-trigger.twig +28 -0
- package/components/03-organisms/mobile-navigation/mobile-navigation.scss +236 -0
- package/components/03-organisms/mobile-navigation/mobile-navigation.stories.js +123 -0
- package/components/03-organisms/mobile-navigation/mobile-navigation.stories.scss +21 -0
- package/components/03-organisms/mobile-navigation/mobile-navigation.test.js +143 -0
- package/components/03-organisms/mobile-navigation/mobile-navigation.twig +86 -0
- package/components/03-organisms/navigation/__snapshots__/navigation.test.js.snap +561 -0
- package/components/03-organisms/navigation/navigation.scss +433 -0
- package/components/03-organisms/navigation/navigation.stories.data.js +60 -0
- package/components/03-organisms/navigation/navigation.stories.js +58 -0
- package/components/03-organisms/navigation/navigation.test.js +122 -0
- package/components/03-organisms/navigation/navigation.twig +106 -0
- package/components/03-organisms/promo/__snapshots__/promo.test.js.snap +415 -0
- package/components/03-organisms/promo/promo.scss +65 -0
- package/components/03-organisms/promo/promo.stories.js +70 -0
- package/components/03-organisms/promo/promo.test.js +125 -0
- package/components/03-organisms/promo/promo.twig +113 -0
- package/components/03-organisms/side-navigation/__snapshots__/side-navigation.test.js.snap +393 -0
- package/components/03-organisms/side-navigation/side-navigation.scss +215 -0
- package/components/03-organisms/side-navigation/side-navigation.stories.data.js +54 -0
- package/components/03-organisms/side-navigation/side-navigation.stories.js +39 -0
- package/components/03-organisms/side-navigation/side-navigation.test.js +87 -0
- package/components/03-organisms/side-navigation/side-navigation.twig +54 -0
- package/components/03-organisms/skip-link/__snapshots__/skip-link.test.js.snap +94 -0
- package/components/03-organisms/skip-link/skip-link.scss +28 -0
- package/components/03-organisms/skip-link/skip-link.stories.js +42 -0
- package/components/03-organisms/skip-link/skip-link.test.js +48 -0
- package/components/03-organisms/skip-link/skip-link.twig +31 -0
- package/components/03-organisms/slider/__snapshots__/slide.test.js.snap +265 -0
- package/components/03-organisms/slider/__snapshots__/slider.test.js.snap +638 -0
- package/components/03-organisms/slider/slide.test.js +55 -0
- package/components/03-organisms/slider/slide.twig +168 -0
- package/components/03-organisms/slider/slider.js +159 -0
- package/components/03-organisms/slider/slider.scss +158 -0
- package/components/03-organisms/slider/slider.stories.js +90 -0
- package/components/03-organisms/slider/slider.test.js +84 -0
- package/components/03-organisms/slider/slider.twig +116 -0
- package/components/03-organisms/webform/__snapshots__/webform.test.js.snap +145 -0
- package/components/03-organisms/webform/webform.js +36 -0
- package/components/03-organisms/webform/webform.scss +17 -0
- package/components/03-organisms/webform/webform.stories.js +45 -0
- package/components/03-organisms/webform/webform.test.js +63 -0
- package/components/03-organisms/webform/webform.twig +33 -0
- package/components/04-templates/event/.gitkeep +0 -0
- package/components/04-templates/page/__snapshots__/page.test.js.snap +1503 -0
- package/components/04-templates/page/page.scss +11 -0
- package/components/04-templates/page/page.stories.data.js +166 -0
- package/components/04-templates/page/page.stories.js +163 -0
- package/components/04-templates/page/page.test.js +170 -0
- package/components/04-templates/page/page.twig +138 -0
- package/components/style.css_variables.scss +129 -0
- package/components/style.scss +13 -0
- package/components/style.stories.scss +15 -0
- package/components/variables.base.scss +33 -0
- package/components/variables.components.scss +6 -0
- package/dist/assets/backgrounds/civictheme_background_1.png +0 -0
- package/dist/assets/backgrounds/civictheme_background_2.png +0 -0
- package/dist/assets/backgrounds/civictheme_background_3.png +0 -0
- package/dist/assets/backgrounds/civictheme_background_4.png +0 -0
- package/dist/assets/backgrounds/civictheme_background_5.png +0 -0
- package/dist/assets/backgrounds/civictheme_background_6.png +0 -0
- package/dist/assets/backgrounds/civictheme_background_7.png +0 -0
- package/dist/assets/icons/account.svg +3 -0
- package/dist/assets/icons/approve.svg +3 -0
- package/dist/assets/icons/bars.svg +3 -0
- package/dist/assets/icons/bullet.svg +3 -0
- package/dist/assets/icons/calendar-1.svg +3 -0
- package/dist/assets/icons/calendar-2.svg +3 -0
- package/dist/assets/icons/call.svg +3 -0
- package/dist/assets/icons/cancel.svg +3 -0
- package/dist/assets/icons/checked.svg +4 -0
- package/dist/assets/icons/close-outline.svg +3 -0
- package/dist/assets/icons/close.svg +3 -0
- package/dist/assets/icons/document.svg +4 -0
- package/dist/assets/icons/down-arrow-1.svg +3 -0
- package/dist/assets/icons/down-arrow-2.svg +3 -0
- package/dist/assets/icons/download-file.svg +3 -0
- package/dist/assets/icons/download.svg +3 -0
- package/dist/assets/icons/exclamation-mark-1.svg +3 -0
- package/dist/assets/icons/exclamation-mark-2.svg +3 -0
- package/dist/assets/icons/exclamation-mark-3.svg +3 -0
- package/dist/assets/icons/eye.svg +3 -0
- package/dist/assets/icons/facebook.svg +3 -0
- package/dist/assets/icons/help.svg +3 -0
- package/dist/assets/icons/image.svg +5 -0
- package/dist/assets/icons/information-mark.svg +3 -0
- package/dist/assets/icons/instagram.svg +3 -0
- package/dist/assets/icons/layer.svg +4 -0
- package/dist/assets/icons/layers.svg +4 -0
- package/dist/assets/icons/left-arrow-outline.svg +3 -0
- package/dist/assets/icons/left-arrow.svg +3 -0
- package/dist/assets/icons/linkedin.svg +3 -0
- package/dist/assets/icons/lock-file.svg +4 -0
- package/dist/assets/icons/lock-gallery.svg +4 -0
- package/dist/assets/icons/magnifier.svg +3 -0
- package/dist/assets/icons/map.svg +3 -0
- package/dist/assets/icons/megaphone.svg +3 -0
- package/dist/assets/icons/message.svg +3 -0
- package/dist/assets/icons/mobile.svg +4 -0
- package/dist/assets/icons/mortarboard.svg +3 -0
- package/dist/assets/icons/newspaper.svg +3 -0
- package/dist/assets/icons/open-source.svg +3 -0
- package/dist/assets/icons/pdf-file.svg +4 -0
- package/dist/assets/icons/progress.svg +3 -0
- package/dist/assets/icons/right-arrow-1.svg +3 -0
- package/dist/assets/icons/right-arrow-2.svg +3 -0
- package/dist/assets/icons/select-box.svg +4 -0
- package/dist/assets/icons/share.svg +3 -0
- package/dist/assets/icons/square.svg +3 -0
- package/dist/assets/icons/to-do.svg +3 -0
- package/dist/assets/icons/twitter.svg +3 -0
- package/dist/assets/icons/up-arrow.svg +3 -0
- package/dist/assets/icons/upper-arrow.svg +3 -0
- package/dist/assets/icons/upper-right-arrow.svg +3 -0
- package/dist/assets/icons/users.svg +4 -0
- package/dist/assets/icons/watch.svg +3 -0
- package/dist/assets/icons/water-drop.svg +4 -0
- package/dist/assets/icons/web.svg +4 -0
- package/dist/assets/icons/word-file.svg +4 -0
- package/dist/assets/icons/x.svg +3 -0
- package/dist/assets/icons/youtube.svg +3 -0
- package/dist/assets/logos/logo_custom_light_desktop_civictheme.svg +32 -0
- package/dist/assets/logos/logo_custom_light_mobile_civictheme.svg +32 -0
- package/dist/assets/logos/logo_primary_dark_desktop.png +0 -0
- package/dist/assets/logos/logo_primary_dark_mobile.png +0 -0
- package/dist/assets/logos/logo_primary_light_desktop.png +0 -0
- package/dist/assets/logos/logo_primary_light_mobile.png +0 -0
- package/dist/assets/logos/logo_secondary_dark_desktop.png +0 -0
- package/dist/assets/logos/logo_secondary_dark_mobile.png +0 -0
- package/dist/assets/logos/logo_secondary_light_desktop.png +0 -0
- package/dist/assets/logos/logo_secondary_light_mobile.png +0 -0
- package/dist/civictheme.css +12303 -0
- package/dist/civictheme.stories.css +2807 -0
- package/dist/civictheme.storybook.css +12303 -0
- package/dist/civictheme.storybook.js +4122 -0
- package/dist/civictheme.variables.css +1148 -0
- package/dist/constants.json +1562 -0
- package/package.json +80 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CivicTheme Attachment component styles.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
.ct-attachment {
|
|
6
|
+
$root: &;
|
|
7
|
+
|
|
8
|
+
&#{$root}--with-background {
|
|
9
|
+
@include ct-breakpoint(m) {
|
|
10
|
+
padding-left: var(--ct-attachment-space-horizontal);
|
|
11
|
+
padding-right: var(--ct-attachment-space-horizontal);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#{$root}__wrapper {
|
|
16
|
+
border: solid ct-particle(0.125);
|
|
17
|
+
border-radius: var(--ct-attachment-border-radius);
|
|
18
|
+
padding: ct-spacing(3);
|
|
19
|
+
|
|
20
|
+
@include ct-breakpoint(m) {
|
|
21
|
+
padding: ct-spacing(4);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#{$root}__title {
|
|
26
|
+
margin-bottom: ct-spacing(2);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#{$root}__content {
|
|
30
|
+
margin-bottom: ct-spacing(2);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#{$root}__links .ct-item-list__item {
|
|
34
|
+
display: flex;
|
|
35
|
+
gap: 0 ct-spacing();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#{$root}__links__link__extension {
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include ct-component-theme($root) using($root, $theme) {
|
|
43
|
+
@include ct-component-property($root, $theme, color);
|
|
44
|
+
|
|
45
|
+
&#{$root}--with-background {
|
|
46
|
+
@include ct-component-property($root, $theme, wrapper, background-color);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
#{$root}__wrapper {
|
|
50
|
+
@include ct-component-property($root, $theme, border-color);
|
|
51
|
+
@include ct-component-property($root, $theme, background-color);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CivicTheme Attachment component stories.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import Component from './attachment.twig';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Molecules/Attachment',
|
|
9
|
+
component: Component,
|
|
10
|
+
argTypes: {
|
|
11
|
+
theme: {
|
|
12
|
+
control: { type: 'radio' },
|
|
13
|
+
options: ['light', 'dark'],
|
|
14
|
+
},
|
|
15
|
+
title: {
|
|
16
|
+
control: { type: 'text' },
|
|
17
|
+
},
|
|
18
|
+
content: {
|
|
19
|
+
control: { type: 'text' },
|
|
20
|
+
},
|
|
21
|
+
files: {
|
|
22
|
+
control: { type: 'object' },
|
|
23
|
+
},
|
|
24
|
+
with_background: {
|
|
25
|
+
control: { type: 'boolean' },
|
|
26
|
+
},
|
|
27
|
+
vertical_spacing: {
|
|
28
|
+
control: { type: 'radio' },
|
|
29
|
+
options: ['none', 'top', 'bottom', 'both'],
|
|
30
|
+
},
|
|
31
|
+
content_top: {
|
|
32
|
+
control: { type: 'text' },
|
|
33
|
+
},
|
|
34
|
+
content_bottom: {
|
|
35
|
+
control: { type: 'text' },
|
|
36
|
+
},
|
|
37
|
+
modifier_class: {
|
|
38
|
+
control: { type: 'text' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default meta;
|
|
44
|
+
|
|
45
|
+
export const Attachment = {
|
|
46
|
+
parameters: {
|
|
47
|
+
layout: 'padded',
|
|
48
|
+
},
|
|
49
|
+
args: {
|
|
50
|
+
theme: 'light',
|
|
51
|
+
title: 'Attachments',
|
|
52
|
+
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
|
|
53
|
+
files: [
|
|
54
|
+
{
|
|
55
|
+
url: 'https://example.com/document.doc',
|
|
56
|
+
name: 'Document.doc',
|
|
57
|
+
ext: 'doc',
|
|
58
|
+
size: '42.88 KB',
|
|
59
|
+
created: '2022-01-01',
|
|
60
|
+
changed: '2022-01-01',
|
|
61
|
+
icon: 'word-file',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
url: 'https://example.com/document.docx',
|
|
65
|
+
name: 'Document.docx',
|
|
66
|
+
ext: 'docx',
|
|
67
|
+
size: '32.48 KB',
|
|
68
|
+
created: '2022-01-01',
|
|
69
|
+
changed: '2022-01-01',
|
|
70
|
+
icon: 'word-file',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
url: 'https://example.com/document.pdf',
|
|
74
|
+
name: 'Document.pdf',
|
|
75
|
+
ext: 'pdf',
|
|
76
|
+
size: '42.82 KB',
|
|
77
|
+
created: '2022-01-01',
|
|
78
|
+
changed: '2022-01-01',
|
|
79
|
+
icon: 'pdf-file',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
url: 'https://example.com/document.ppt',
|
|
83
|
+
name: 'Document.ppt',
|
|
84
|
+
ext: 'ppt',
|
|
85
|
+
size: '12.88 KB',
|
|
86
|
+
created: '2022-01-01',
|
|
87
|
+
changed: '2022-01-01',
|
|
88
|
+
icon: 'download-file',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
url: 'https://example.com/document.xlsx',
|
|
92
|
+
name: 'Document.xlsx',
|
|
93
|
+
ext: 'xlsx',
|
|
94
|
+
size: '34.45 KB',
|
|
95
|
+
created: '2022-01-01',
|
|
96
|
+
changed: '2022-01-01',
|
|
97
|
+
icon: 'download-file',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
url: 'https://example.com/document.xls',
|
|
101
|
+
name: 'Document.xls',
|
|
102
|
+
ext: 'xls',
|
|
103
|
+
size: '65.67 KB',
|
|
104
|
+
created: '2022-01-01',
|
|
105
|
+
changed: '2022-01-01',
|
|
106
|
+
icon: 'download-file',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
url: 'https://example.com/document',
|
|
110
|
+
name: 'Document',
|
|
111
|
+
ext: null,
|
|
112
|
+
size: null,
|
|
113
|
+
created: '2022-01-01',
|
|
114
|
+
changed: '2022-01-01',
|
|
115
|
+
icon: 'download-file',
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
with_background: false,
|
|
119
|
+
vertical_spacing: 'none',
|
|
120
|
+
content_top: '',
|
|
121
|
+
content_bottom: '',
|
|
122
|
+
modifier_class: '',
|
|
123
|
+
attributes: null,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import DrupalAttribute from 'drupal-attribute';
|
|
2
|
+
|
|
3
|
+
const template = 'components/02-molecules/attachment/attachment.twig';
|
|
4
|
+
|
|
5
|
+
describe('Attachment Component', () => {
|
|
6
|
+
test('renders with required attributes', async () => {
|
|
7
|
+
const c = await dom(template, {
|
|
8
|
+
files: [
|
|
9
|
+
{ name: 'File 1', ext: 'pdf', url: 'https://example.com/file1.pdf', size: '1MB', created: '2023-01-01', changed: '2023-01-02', icon: 'pdf-file' },
|
|
10
|
+
{ name: 'File 2', ext: 'docx', url: 'https://example.com/file2.docx', size: '2MB', created: '2023-01-03', changed: '2023-01-04', icon: 'word-file' },
|
|
11
|
+
],
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
expect(c.querySelectorAll('.ct-attachment')).toHaveLength(1);
|
|
15
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')).toHaveLength(2);
|
|
16
|
+
expect(c.querySelector('.ct-attachment__links__link').textContent.trim()).toContain('File 1');
|
|
17
|
+
expect(c.querySelector('.ct-attachment__links__link__changed').textContent.trim()).toContain('LAST UPDATED: 2023-01-02');
|
|
18
|
+
|
|
19
|
+
assertUniqueCssClasses(c);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('renders with optional attributes', async () => {
|
|
23
|
+
const c = await dom(template, {
|
|
24
|
+
content_top: 'Top content',
|
|
25
|
+
title: 'Attachment Title',
|
|
26
|
+
content: 'Attachment content',
|
|
27
|
+
files: [
|
|
28
|
+
{ name: 'File 1', ext: 'pdf', url: 'https://example.com/file1.pdf', size: '1MB', created: '2023-01-01', changed: '2023-01-02', icon: 'pdf-file' },
|
|
29
|
+
],
|
|
30
|
+
content_bottom: 'Bottom content',
|
|
31
|
+
theme: 'dark',
|
|
32
|
+
vertical_spacing: 'both',
|
|
33
|
+
with_background: true,
|
|
34
|
+
attributes: new DrupalAttribute().setAttribute('data-test', 'true'),
|
|
35
|
+
modifier_class: 'custom-class',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
expect(c.querySelectorAll('.ct-attachment.custom-class.ct-theme-dark.ct-attachment--with-background.ct-vertical-spacing-inset--both')).toHaveLength(1);
|
|
39
|
+
expect(c.querySelector('.ct-attachment__content-top').textContent.trim()).toEqual('Top content');
|
|
40
|
+
expect(c.querySelector('.ct-attachment__title').textContent.trim()).toEqual('Attachment Title');
|
|
41
|
+
expect(c.querySelector('.ct-attachment__content').textContent.trim()).toEqual('Attachment content');
|
|
42
|
+
expect(c.querySelector('.ct-attachment__content-bottom').textContent.trim()).toEqual('Bottom content');
|
|
43
|
+
expect(c.querySelector('.ct-attachment').getAttribute('data-test')).toEqual('true');
|
|
44
|
+
expect(c.querySelector('.ct-attachment__links__link').textContent.trim()).toContain('File 1');
|
|
45
|
+
|
|
46
|
+
assertUniqueCssClasses(c);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('does not render when files are empty', async () => {
|
|
50
|
+
const c = await dom(template, {
|
|
51
|
+
files: [],
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
expect(c.querySelectorAll('.ct-attachment')).toHaveLength(0);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('renders with multiple files and attributes', async () => {
|
|
58
|
+
const c = await dom(template, {
|
|
59
|
+
files: [
|
|
60
|
+
{ name: 'File 1', ext: 'pdf', url: 'https://example.com/file1.pdf', size: '1MB', created: '2023-01-01', changed: '2023-01-02', icon: 'pdf-file' },
|
|
61
|
+
{ name: 'File 2', ext: 'docx', url: 'https://example.com/file2.docx', size: '2MB', created: '2023-01-03', changed: '2023-01-04', icon: 'word-file' },
|
|
62
|
+
{ name: 'File without extension', url: 'https://example.com/file3' },
|
|
63
|
+
{ name: 'File with only extension', ext: 'txt', url: 'https://example.com/file4.txt' },
|
|
64
|
+
{ name: 'File with only size', url: 'https://example.com/file5', size: '500KB' },
|
|
65
|
+
],
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')).toHaveLength(5);
|
|
69
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')[0].textContent.trim()).toContain('File 1');
|
|
70
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')[1].textContent.trim()).toContain('File 2');
|
|
71
|
+
expect(c.querySelectorAll('.ct-attachment__links__link__changed')[0].textContent.trim()).toContain('LAST UPDATED: 2023-01-02');
|
|
72
|
+
expect(c.querySelectorAll('.ct-attachment__links__link__changed')[1].textContent.trim()).toContain('LAST UPDATED: 2023-01-04');
|
|
73
|
+
|
|
74
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')[2].textContent.trim()).toBe('File without extension');
|
|
75
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')[2].textContent.trim()).not.toContain('docx');
|
|
76
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')[2].textContent.trim()).not.toContain('2MB');
|
|
77
|
+
|
|
78
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')[3].textContent.trim()).toContain('File with only extension');
|
|
79
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')[3].textContent.trim()).toContain('(txt)');
|
|
80
|
+
|
|
81
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')[4].textContent.trim()).toContain('File with only size');
|
|
82
|
+
expect(c.querySelectorAll('.ct-attachment__links__link')[4].textContent.trim()).toContain('(500KB)');
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* CivicTheme Attachment component.
|
|
5
|
+
*
|
|
6
|
+
* Props:
|
|
7
|
+
* - theme: [string] Theme variation (light or dark).
|
|
8
|
+
* - title: [string] Attachment title.
|
|
9
|
+
* - content: [string] Attachment content.
|
|
10
|
+
* - files: [array] File attachments:
|
|
11
|
+
* Each item contains:
|
|
12
|
+
* - name: [string] File name (as it appears to the user).
|
|
13
|
+
* - ext: [string] File extension.
|
|
14
|
+
* - url: [string] File URL.
|
|
15
|
+
* - size: [string] File size (as it appears to the user).
|
|
16
|
+
* - created: [string] File created date.
|
|
17
|
+
* - changed: [string] File modified date.
|
|
18
|
+
* - icon: [string] File type icon name.
|
|
19
|
+
* - vertical_spacing: [string] Vertical spacing position (top, bottom, both).
|
|
20
|
+
* - with_background: [boolean] Whether to display with a background.
|
|
21
|
+
* - modifier_class: [string] Additional CSS classes.
|
|
22
|
+
* - attributes: [Drupal\Core\Template\Attribute] Additional HTML attributes.
|
|
23
|
+
*
|
|
24
|
+
* Slots:
|
|
25
|
+
* - content_top: Top content area content.
|
|
26
|
+
* - content_bottom: Bottom content area content.
|
|
27
|
+
*
|
|
28
|
+
* Blocks:
|
|
29
|
+
* - content_top_block
|
|
30
|
+
* - content_block
|
|
31
|
+
* - links_block
|
|
32
|
+
* - content_bottom_block
|
|
33
|
+
*/
|
|
34
|
+
#}
|
|
35
|
+
|
|
36
|
+
{% set with_background_class = with_background ? 'ct-attachment--with-background' : '' %}
|
|
37
|
+
{% set vertical_spacing_class = vertical_spacing in ['top', 'bottom', 'both'] ? 'ct-vertical-spacing-inset--%s'|format(vertical_spacing) : '' %}
|
|
38
|
+
{% set theme_class = 'ct-theme-%s'|format(theme|default('light')) %}
|
|
39
|
+
{% set modifier_class = '%s %s %s %s'|format(theme_class, vertical_spacing_class, with_background_class, modifier_class|default('')) %}
|
|
40
|
+
|
|
41
|
+
{% if files is not empty %}
|
|
42
|
+
<div class="ct-attachment {{ modifier_class -}}" {% if attributes is defined and attributes is not null %}{{- attributes -}}{% endif %}>
|
|
43
|
+
<div class="container">
|
|
44
|
+
<div class="row">
|
|
45
|
+
<div class="col-xxs-12">
|
|
46
|
+
<div class="ct-attachment__wrapper">
|
|
47
|
+
{% block content_top_block %}
|
|
48
|
+
{% if content_top is not empty %}
|
|
49
|
+
<div class="ct-attachment__content-top">
|
|
50
|
+
{{- content_top -}}
|
|
51
|
+
</div>
|
|
52
|
+
{% endif %}
|
|
53
|
+
{% endblock %}
|
|
54
|
+
|
|
55
|
+
{% block content_block %}
|
|
56
|
+
{% if title is not empty or content is not empty %}
|
|
57
|
+
<div class="ct-attachment__inner">
|
|
58
|
+
{% if title is not empty %}
|
|
59
|
+
{% include '@atoms/heading/heading.twig' with {
|
|
60
|
+
theme: theme,
|
|
61
|
+
content: title,
|
|
62
|
+
level: 4,
|
|
63
|
+
modifier_class: 'ct-attachment__title',
|
|
64
|
+
} only %}
|
|
65
|
+
{% endif %}
|
|
66
|
+
|
|
67
|
+
{% if content is not empty %}
|
|
68
|
+
{% include '@atoms/paragraph/paragraph.twig' with {
|
|
69
|
+
theme: theme,
|
|
70
|
+
content: content,
|
|
71
|
+
size: 'small',
|
|
72
|
+
modifier_class: 'ct-attachment__content',
|
|
73
|
+
} only %}
|
|
74
|
+
{% endif %}
|
|
75
|
+
</div>
|
|
76
|
+
{% endif %}
|
|
77
|
+
{% endblock %}
|
|
78
|
+
|
|
79
|
+
{% block links_block %}
|
|
80
|
+
{% set link_items = [] %}
|
|
81
|
+
{% for file in files %}
|
|
82
|
+
{%- set link %}
|
|
83
|
+
{% include '@base/icon/icon.twig' with {
|
|
84
|
+
symbol: file.icon ? file.icon : 'download-file',
|
|
85
|
+
size: 'large',
|
|
86
|
+
modifier_class: 'ct-attachment__links__link__icon',
|
|
87
|
+
} only %}
|
|
88
|
+
|
|
89
|
+
<div class="ct-attachment__links__link__wrapper">
|
|
90
|
+
{% set link_text %}
|
|
91
|
+
{{ file.name }}
|
|
92
|
+
{% if file.ext is not empty and file.size is not empty %}
|
|
93
|
+
<span class="ct-attachment__links__link__extension">({{ file.ext }}, {{ file.size }})</span>
|
|
94
|
+
{% elseif file.ext is not empty or file.size is not empty %}
|
|
95
|
+
<span class="ct-attachment__links__link__extension">({{ file.ext|default(file.size) }})</span>
|
|
96
|
+
{% endif %}
|
|
97
|
+
{% endset %}
|
|
98
|
+
|
|
99
|
+
{% include '@atoms/link/link.twig' with {
|
|
100
|
+
theme: theme,
|
|
101
|
+
text: link_text,
|
|
102
|
+
title: 'Download %s'|format(file.name),
|
|
103
|
+
url: file.url,
|
|
104
|
+
modifier_class: 'ct-attachment__links__link',
|
|
105
|
+
} only %}
|
|
106
|
+
|
|
107
|
+
{% if file.changed is not empty %}
|
|
108
|
+
{% include '@atoms/paragraph/paragraph.twig' with {
|
|
109
|
+
theme: theme,
|
|
110
|
+
content: 'LAST UPDATED: ' ~ file.changed,
|
|
111
|
+
size: 'small',
|
|
112
|
+
modifier_class: 'ct-attachment__links__link__changed',
|
|
113
|
+
} only %}
|
|
114
|
+
{% endif %}
|
|
115
|
+
</div>
|
|
116
|
+
{% endset -%}
|
|
117
|
+
{% set link_items = link_items|merge([link]) %}
|
|
118
|
+
{% endfor %}
|
|
119
|
+
|
|
120
|
+
{% include '@base/item-list/item-list.twig' with {
|
|
121
|
+
items: link_items,
|
|
122
|
+
direction: 'vertical',
|
|
123
|
+
modifier_class: 'ct-attachment__links',
|
|
124
|
+
} only %}
|
|
125
|
+
{% endblock %}
|
|
126
|
+
|
|
127
|
+
{% block content_bottom_block %}
|
|
128
|
+
{% if content_bottom is not empty %}
|
|
129
|
+
<div class="ct-attachment__content-bottom">
|
|
130
|
+
{{- content_bottom -}}
|
|
131
|
+
</div>
|
|
132
|
+
{% endif %}
|
|
133
|
+
{% endblock %}
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
{% endif %}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Back to Top Component button contains correct icon 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ct-back-to-top "
|
|
7
|
+
data-component-name="back-to-top"
|
|
8
|
+
data-scrollspy=""
|
|
9
|
+
data-scrollspy-offset="400"
|
|
10
|
+
>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<a
|
|
16
|
+
_keys="data-skip-to-target"
|
|
17
|
+
class="ct-button ct-theme-light ct-button--link ct-button--regular ct-back-to-top__button"
|
|
18
|
+
data-component-name="button"
|
|
19
|
+
data-skip-to-target=""
|
|
20
|
+
href="#top"
|
|
21
|
+
role="button"
|
|
22
|
+
>
|
|
23
|
+
<span
|
|
24
|
+
class="ct-text-icon__text"
|
|
25
|
+
>
|
|
26
|
+
<span
|
|
27
|
+
class="ct-visually-hidden"
|
|
28
|
+
>
|
|
29
|
+
Return focus to the top of the page
|
|
30
|
+
</span>
|
|
31
|
+
<svg
|
|
32
|
+
aria-hidden="true"
|
|
33
|
+
class="ct-icon"
|
|
34
|
+
height="24"
|
|
35
|
+
role="img"
|
|
36
|
+
viewBox="0 0 24 24"
|
|
37
|
+
width="24"
|
|
38
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
39
|
+
>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<path
|
|
43
|
+
d="M17.7102 11.29L12.7102 6.29C12.6151 6.19896 12.5029 6.1276 12.3802 6.08C12.1367 5.97999 11.8636 5.97999 11.6202 6.08C11.4974 6.1276 11.3853 6.19896 11.2902 6.29L6.29019 11.29C6.19695 11.3832 6.12299 11.4939 6.07253 11.6158C6.02207 11.7376 5.99609 11.8681 5.99609 12C5.99609 12.2663 6.10188 12.5217 6.29019 12.71C6.47849 12.8983 6.73388 13.0041 7.00019 13.0041C7.26649 13.0041 7.52188 12.8983 7.71019 12.71L11.0002 9.41V17C11.0002 17.2652 11.1055 17.5196 11.2931 17.7071C11.4806 17.8946 11.735 18 12.0002 18C12.2654 18 12.5198 17.8946 12.7073 17.7071C12.8948 17.5196 13.0002 17.2652 13.0002 17V9.41L16.2902 12.71C16.3831 12.8037 16.4937 12.8781 16.6156 12.9289C16.7375 12.9797 16.8682 13.0058 17.0002 13.0058C17.1322 13.0058 17.2629 12.9797 17.3848 12.9289C17.5066 12.8781 17.6172 12.8037 17.7102 12.71C17.8039 12.617 17.8783 12.5064 17.9291 12.3846C17.9798 12.2627 18.006 12.132 18.006 12C18.006 11.868 17.9798 11.7373 17.9291 11.6154C17.8783 11.4936 17.8039 11.383 17.7102 11.29Z"
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
</svg>
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
</span>
|
|
51
|
+
</a>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
exports[`Back to Top Component renders button with correct attributes 1`] = `
|
|
61
|
+
<div>
|
|
62
|
+
<div
|
|
63
|
+
class="ct-back-to-top "
|
|
64
|
+
data-component-name="back-to-top"
|
|
65
|
+
data-scrollspy=""
|
|
66
|
+
data-scrollspy-offset="400"
|
|
67
|
+
>
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<a
|
|
73
|
+
_keys="data-skip-to-target"
|
|
74
|
+
class="ct-button ct-theme-light ct-button--link ct-button--regular ct-back-to-top__button"
|
|
75
|
+
data-component-name="button"
|
|
76
|
+
data-skip-to-target=""
|
|
77
|
+
href="#top"
|
|
78
|
+
role="button"
|
|
79
|
+
>
|
|
80
|
+
<span
|
|
81
|
+
class="ct-text-icon__text"
|
|
82
|
+
>
|
|
83
|
+
<span
|
|
84
|
+
class="ct-visually-hidden"
|
|
85
|
+
>
|
|
86
|
+
Return focus to the top of the page
|
|
87
|
+
</span>
|
|
88
|
+
<svg
|
|
89
|
+
aria-hidden="true"
|
|
90
|
+
class="ct-icon"
|
|
91
|
+
height="24"
|
|
92
|
+
role="img"
|
|
93
|
+
viewBox="0 0 24 24"
|
|
94
|
+
width="24"
|
|
95
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
96
|
+
>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<path
|
|
100
|
+
d="M17.7102 11.29L12.7102 6.29C12.6151 6.19896 12.5029 6.1276 12.3802 6.08C12.1367 5.97999 11.8636 5.97999 11.6202 6.08C11.4974 6.1276 11.3853 6.19896 11.2902 6.29L6.29019 11.29C6.19695 11.3832 6.12299 11.4939 6.07253 11.6158C6.02207 11.7376 5.99609 11.8681 5.99609 12C5.99609 12.2663 6.10188 12.5217 6.29019 12.71C6.47849 12.8983 6.73388 13.0041 7.00019 13.0041C7.26649 13.0041 7.52188 12.8983 7.71019 12.71L11.0002 9.41V17C11.0002 17.2652 11.1055 17.5196 11.2931 17.7071C11.4806 17.8946 11.735 18 12.0002 18C12.2654 18 12.5198 17.8946 12.7073 17.7071C12.8948 17.5196 13.0002 17.2652 13.0002 17V9.41L16.2902 12.71C16.3831 12.8037 16.4937 12.8781 16.6156 12.9289C16.7375 12.9797 16.8682 13.0058 17.0002 13.0058C17.1322 13.0058 17.2629 12.9797 17.3848 12.9289C17.5066 12.8781 17.6172 12.8037 17.7102 12.71C17.8039 12.617 17.8783 12.5064 17.9291 12.3846C17.9798 12.2627 18.006 12.132 18.006 12C18.006 11.868 17.9798 11.7373 17.9291 11.6154C17.8783 11.4936 17.8039 11.383 17.7102 11.29Z"
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
</svg>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
</span>
|
|
108
|
+
</a>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
</div>
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
exports[`Back to Top Component renders correctly 1`] = `
|
|
118
|
+
<div>
|
|
119
|
+
<div
|
|
120
|
+
class="ct-back-to-top "
|
|
121
|
+
data-component-name="back-to-top"
|
|
122
|
+
data-scrollspy=""
|
|
123
|
+
data-scrollspy-offset="400"
|
|
124
|
+
>
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
<a
|
|
130
|
+
_keys="data-skip-to-target"
|
|
131
|
+
class="ct-button ct-theme-light ct-button--link ct-button--regular ct-back-to-top__button"
|
|
132
|
+
data-component-name="button"
|
|
133
|
+
data-skip-to-target=""
|
|
134
|
+
href="#top"
|
|
135
|
+
role="button"
|
|
136
|
+
>
|
|
137
|
+
<span
|
|
138
|
+
class="ct-text-icon__text"
|
|
139
|
+
>
|
|
140
|
+
<span
|
|
141
|
+
class="ct-visually-hidden"
|
|
142
|
+
>
|
|
143
|
+
Return focus to the top of the page
|
|
144
|
+
</span>
|
|
145
|
+
<svg
|
|
146
|
+
aria-hidden="true"
|
|
147
|
+
class="ct-icon"
|
|
148
|
+
height="24"
|
|
149
|
+
role="img"
|
|
150
|
+
viewBox="0 0 24 24"
|
|
151
|
+
width="24"
|
|
152
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
153
|
+
>
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<path
|
|
157
|
+
d="M17.7102 11.29L12.7102 6.29C12.6151 6.19896 12.5029 6.1276 12.3802 6.08C12.1367 5.97999 11.8636 5.97999 11.6202 6.08C11.4974 6.1276 11.3853 6.19896 11.2902 6.29L6.29019 11.29C6.19695 11.3832 6.12299 11.4939 6.07253 11.6158C6.02207 11.7376 5.99609 11.8681 5.99609 12C5.99609 12.2663 6.10188 12.5217 6.29019 12.71C6.47849 12.8983 6.73388 13.0041 7.00019 13.0041C7.26649 13.0041 7.52188 12.8983 7.71019 12.71L11.0002 9.41V17C11.0002 17.2652 11.1055 17.5196 11.2931 17.7071C11.4806 17.8946 11.735 18 12.0002 18C12.2654 18 12.5198 17.8946 12.7073 17.7071C12.8948 17.5196 13.0002 17.2652 13.0002 17V9.41L16.2902 12.71C16.3831 12.8037 16.4937 12.8781 16.6156 12.9289C16.7375 12.9797 16.8682 13.0058 17.0002 13.0058C17.1322 13.0058 17.2629 12.9797 17.3848 12.9289C17.5066 12.8781 17.6172 12.8037 17.7102 12.71C17.8039 12.617 17.8783 12.5064 17.9291 12.3846C17.9798 12.2627 18.006 12.132 18.006 12C18.006 11.868 17.9798 11.7373 17.9291 11.6154C17.8783 11.4936 17.8039 11.383 17.7102 11.29Z"
|
|
158
|
+
/>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
</svg>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
</span>
|
|
165
|
+
</a>
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
</div>
|
|
172
|
+
`;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CivicTheme Back to Top component styles.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
.ct-back-to-top {
|
|
6
|
+
$root: &;
|
|
7
|
+
|
|
8
|
+
@include ct-print-hide();
|
|
9
|
+
|
|
10
|
+
& {
|
|
11
|
+
position: fixed;
|
|
12
|
+
right: var(--ct-back-to-top-space-right);
|
|
13
|
+
bottom: var(--ct-back-to-top-space-bottom);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#{$root}__button {
|
|
17
|
+
&,
|
|
18
|
+
&:focus-visible,
|
|
19
|
+
&:active,
|
|
20
|
+
&:visited,
|
|
21
|
+
&:hover {
|
|
22
|
+
display: inline-block;
|
|
23
|
+
border-radius: ct-particle(12);
|
|
24
|
+
padding: ct-spacing();
|
|
25
|
+
background-color: var(--ct-back-to-top-background-color);
|
|
26
|
+
border-color: var(--ct-back-to-top-border-color);
|
|
27
|
+
color: var(--ct-back-to-top-color);
|
|
28
|
+
line-height: 0;
|
|
29
|
+
outline-color: var(--ct-back-to-top-outline-color);
|
|
30
|
+
outline-offset: var(--ct-button-outline-offset);
|
|
31
|
+
outline-width: var(--ct-button-outline-width);
|
|
32
|
+
appearance: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:focus-visible {
|
|
36
|
+
outline-style: solid;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CivicTheme Back to Top component stories.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import Component from './back-to-top.stories.twig';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Molecules/Back To Top',
|
|
9
|
+
component: Component,
|
|
10
|
+
argTypes: {
|
|
11
|
+
modifier_class: {
|
|
12
|
+
control: { type: 'text' },
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
export const BackToTop = {
|
|
20
|
+
parameters: {
|
|
21
|
+
layout: 'fullscreen',
|
|
22
|
+
storyDocs: 'Back To Top button appears when the bottom of the red rectangle reaches the top of the page.',
|
|
23
|
+
storyDocsSize: 'medium',
|
|
24
|
+
},
|
|
25
|
+
args: {},
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CivicTheme Back to Top component story styles.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
.story-container__page-content {
|
|
6
|
+
&.story-ct-back-to-top {
|
|
7
|
+
height: 2000px;
|
|
8
|
+
|
|
9
|
+
&::before {
|
|
10
|
+
box-shadow: 0 0 ct-particle(0.125) ct-particle(0.125) #f00 inset;
|
|
11
|
+
height: 400px;
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
display: block;
|
|
17
|
+
content: '';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|