@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,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Visibility component.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
@each $breakpoint, $value in $ct-breakpoints {
|
|
6
|
+
@if $breakpoint == $ct-visibility-lowest-breakpoint {
|
|
7
|
+
.show-#{$breakpoint} {
|
|
8
|
+
display: block !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.show-#{$breakpoint}-table {
|
|
12
|
+
display: table !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.hide-#{$breakpoint} {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
@else {
|
|
20
|
+
@include ct-breakpoint($breakpoint) {
|
|
21
|
+
.show-#{$breakpoint} {
|
|
22
|
+
display: block !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.show-#{$breakpoint}-table {
|
|
26
|
+
display: table !important;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.show-#{$breakpoint}-flex {
|
|
30
|
+
display: flex !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.hide-#{$breakpoint} {
|
|
34
|
+
display: none !important;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ct-visually-hidden {
|
|
41
|
+
@include ct-visually-hidden();
|
|
42
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Component from './welcome.stories.twig';
|
|
2
|
+
import Constants from '../../../dist/constants.json';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Welcome',
|
|
6
|
+
component: Component,
|
|
7
|
+
argTypes: {
|
|
8
|
+
logos: {
|
|
9
|
+
table: {
|
|
10
|
+
disable: true,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
export const Welcome = {
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: 'fullscreen',
|
|
21
|
+
html: {
|
|
22
|
+
disable: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
args: {
|
|
26
|
+
logos: {
|
|
27
|
+
primary: {
|
|
28
|
+
mobile: {
|
|
29
|
+
url: Constants.LOGOS.light.civictheme.mobile,
|
|
30
|
+
},
|
|
31
|
+
desktop: {
|
|
32
|
+
url: Constants.LOGOS.light.civictheme.desktop,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.story-welcome {
|
|
2
|
+
height: 100vh;
|
|
3
|
+
width: 100%;
|
|
4
|
+
margin: 0;
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
// CivicTheme's own brand color.
|
|
10
|
+
background-color: #003f56;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.story-welcome__inner {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
|
|
18
|
+
.ct-logo {
|
|
19
|
+
margin-bottom: 2em;
|
|
20
|
+
|
|
21
|
+
.ct-logo__image {
|
|
22
|
+
max-height: 5em;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ct-paragraph {
|
|
27
|
+
margin-top: 2em;
|
|
28
|
+
max-width: 50em;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* Welcome story template.
|
|
5
|
+
*/
|
|
6
|
+
#}
|
|
7
|
+
|
|
8
|
+
<div class="story-welcome">
|
|
9
|
+
<div class="story-welcome__inner">
|
|
10
|
+
{% include '@molecules/logo/logo.twig' with {
|
|
11
|
+
theme: 'light',
|
|
12
|
+
logos: logos,
|
|
13
|
+
} only %}
|
|
14
|
+
{% set heading_content %}
|
|
15
|
+
A design system by
|
|
16
|
+
{% include '@atoms/content-link/content-link.twig' with {
|
|
17
|
+
theme: 'dark',
|
|
18
|
+
text: 'Salsa Digital',
|
|
19
|
+
url: 'https://salsa.digital/',
|
|
20
|
+
} only %}
|
|
21
|
+
{% endset %}
|
|
22
|
+
{% include '@atoms/heading/heading.twig' with {
|
|
23
|
+
theme: 'dark',
|
|
24
|
+
content: heading_content,
|
|
25
|
+
level: 4,
|
|
26
|
+
modifier_class: 'ct-text-align-center',
|
|
27
|
+
} only %}
|
|
28
|
+
|
|
29
|
+
{% include '@atoms/paragraph/paragraph.twig' with {
|
|
30
|
+
theme: 'dark',
|
|
31
|
+
content: 'Welcome to the CivicTheme design system, an open-source, atomic design-based, true design system developed to help you build websites quickly and efficiently.',
|
|
32
|
+
modifier_class: 'ct-text-align-center',
|
|
33
|
+
} only %}
|
|
34
|
+
|
|
35
|
+
{% include '@atoms/paragraph/paragraph.twig' with {
|
|
36
|
+
theme: 'dark',
|
|
37
|
+
content: 'CivicTheme provides an atomic design, component-based framework to build and easily manage website assets and components.',
|
|
38
|
+
modifier_class: 'ct-text-align-center',
|
|
39
|
+
} only %}
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Button Component renders as a link with optional attributes 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<a
|
|
9
|
+
class="ct-button ct-theme-dark ct-button--link ct-button--regular custom-class"
|
|
10
|
+
data-component-name="button"
|
|
11
|
+
data-test="true"
|
|
12
|
+
href="https://example.com"
|
|
13
|
+
role="button"
|
|
14
|
+
target="_blank"
|
|
15
|
+
>
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<svg
|
|
19
|
+
aria-hidden="true"
|
|
20
|
+
class="ct-icon ct-button__icon"
|
|
21
|
+
height="24"
|
|
22
|
+
role="img"
|
|
23
|
+
viewBox="0 0 24 24"
|
|
24
|
+
width="24"
|
|
25
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
+
>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
<path
|
|
30
|
+
d="M19.4097 13C19.1897 13 18.9597 12.93 18.7397 12.88C18.2945 12.7805 17.8568 12.6501 17.4297 12.49C16.9658 12.3212 16.4558 12.33 15.998 12.5146C15.5402 12.6992 15.1668 13.0466 14.9497 13.49L14.7297 13.95C13.7585 13.3992 12.8613 12.7271 12.0597 11.95C11.2825 11.1484 10.6105 10.2512 10.0597 9.28L10.5197 9.07C10.963 8.85292 11.3105 8.47953 11.4951 8.02169C11.6797 7.56385 11.6885 7.05391 11.5197 6.59C11.3609 6.15903 11.2306 5.71808 11.1297 5.27C11.0797 5.05 11.0397 4.82 11.0097 4.6C10.8882 3.89562 10.5193 3.25774 9.96931 2.80124C9.4193 2.34474 8.72438 2.09961 8.00968 2.11H4.99968C4.57693 2.10945 4.15883 2.19825 3.7728 2.37058C3.38677 2.54292 3.04152 2.7949 2.75968 3.11C2.472 3.43365 2.2578 3.81575 2.13179 4.23004C2.00577 4.64432 1.97094 5.08098 2.02968 5.51C2.57327 9.67214 4.47489 13.5387 7.43968 16.51C10.411 19.4748 14.2775 21.3764 18.4397 21.92C18.5695 21.9299 18.6999 21.9299 18.8297 21.92C19.5671 21.9211 20.2791 21.6505 20.8297 21.16C21.1448 20.8782 21.3968 20.5329 21.5691 20.1469C21.7414 19.7609 21.8302 19.3428 21.8297 18.92V15.92C21.8243 15.229 21.5805 14.5611 21.1396 14.0291C20.6987 13.4971 20.0876 13.1336 19.4097 13ZM19.8997 19C19.8994 19.1395 19.8698 19.2775 19.813 19.4049C19.7562 19.5324 19.6733 19.6465 19.5697 19.74C19.4601 19.8399 19.3297 19.9141 19.1878 19.9573C19.046 20.0006 18.8963 20.0117 18.7497 19.99C15.018 19.5026 11.5499 17.802 8.87968 15.15C6.20716 12.4775 4.49171 8.99737 3.99968 5.25C3.97796 5.10333 3.98912 4.95367 4.03236 4.81185C4.0756 4.67003 4.14983 4.5396 4.24968 4.43C4.3443 4.32515 4.46006 4.24154 4.58933 4.18466C4.7186 4.12778 4.85846 4.09892 4.99968 4.1H7.99968C8.23085 4.09435 8.45682 4.16898 8.63915 4.3112C8.82147 4.45341 8.94888 4.65442 8.99968 4.88C8.99968 5.15 9.08968 5.43 9.14968 5.7C9.26526 6.22386 9.419 6.73857 9.60968 7.24L8.20968 7.9C7.96905 8.01046 7.78204 8.21185 7.68968 8.46C7.58967 8.70346 7.58967 8.97654 7.68968 9.22C9.12888 12.3028 11.6069 14.7808 14.6897 16.22C14.9331 16.32 15.2062 16.32 15.4497 16.22C15.6978 16.1276 15.8992 15.9406 16.0097 15.7L16.6397 14.3C17.1556 14.4881 17.6834 14.6418 18.2197 14.76C18.4797 14.82 18.7597 14.87 19.0297 14.91C19.2553 14.9608 19.4563 15.0882 19.5985 15.2705C19.7407 15.4529 19.8153 15.6788 19.8097 15.91L19.8997 19ZM13.9997 2C13.7697 2 13.5297 2 13.2997 2C13.0345 2.02254 12.7891 2.14952 12.6175 2.353C12.4459 2.55647 12.3621 2.81978 12.3847 3.085C12.4072 3.35022 12.5342 3.59562 12.7377 3.76721C12.9412 3.93881 13.2045 4.02254 13.4697 4H13.9997C15.591 4 17.1171 4.63214 18.2423 5.75736C19.3675 6.88258 19.9997 8.4087 19.9997 10C19.9997 10.18 19.9997 10.35 19.9997 10.53C19.9775 10.7938 20.0609 11.0556 20.2314 11.2581C20.402 11.4606 20.6459 11.5871 20.9097 11.61H20.9897C21.24 11.611 21.4816 11.5181 21.6668 11.3496C21.8519 11.1811 21.9672 10.9493 21.9897 10.7C21.9897 10.47 21.9897 10.23 21.9897 10C21.9897 7.88 21.1482 5.84668 19.6501 4.34668C18.1519 2.84667 16.1197 2.00265 13.9997 2ZM15.9997 10C15.9997 10.2652 16.105 10.5196 16.2926 10.7071C16.4801 10.8946 16.7345 11 16.9997 11C17.2649 11 17.5193 10.8946 17.7068 10.7071C17.8943 10.5196 17.9997 10.2652 17.9997 10C17.9997 8.93913 17.5783 7.92172 16.8281 7.17157C16.078 6.42143 15.0605 6 13.9997 6C13.7345 6 13.4801 6.10536 13.2926 6.29289C13.105 6.48043 12.9997 6.73478 12.9997 7C12.9997 7.26522 13.105 7.51957 13.2926 7.70711C13.4801 7.89464 13.7345 8 13.9997 8C14.5301 8 15.0388 8.21071 15.4139 8.58579C15.789 8.96086 15.9997 9.46957 15.9997 10Z"
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
</svg>
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
<span
|
|
38
|
+
class="ct-text-icon__text"
|
|
39
|
+
>
|
|
40
|
+
Click me
|
|
41
|
+
</span>
|
|
42
|
+
|
|
43
|
+
<span
|
|
44
|
+
class="ct-visually-hidden"
|
|
45
|
+
>
|
|
46
|
+
(Opens in a new tab/window)
|
|
47
|
+
</span>
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
exports[`Button Component renders as a link with optional attributes, is external 1`] = `
|
|
55
|
+
<div>
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
<a
|
|
60
|
+
class="ct-button ct-theme-dark ct-button--link ct-button--regular ct-button--external custom-class"
|
|
61
|
+
data-component-name="button"
|
|
62
|
+
data-test="true"
|
|
63
|
+
href="https://example.com"
|
|
64
|
+
role="button"
|
|
65
|
+
target="_blank"
|
|
66
|
+
>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
<svg
|
|
70
|
+
aria-hidden="true"
|
|
71
|
+
class="ct-icon ct-button__icon"
|
|
72
|
+
height="24"
|
|
73
|
+
role="img"
|
|
74
|
+
viewBox="0 0 24 24"
|
|
75
|
+
width="24"
|
|
76
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
77
|
+
>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
<path
|
|
81
|
+
d="M19.4097 13C19.1897 13 18.9597 12.93 18.7397 12.88C18.2945 12.7805 17.8568 12.6501 17.4297 12.49C16.9658 12.3212 16.4558 12.33 15.998 12.5146C15.5402 12.6992 15.1668 13.0466 14.9497 13.49L14.7297 13.95C13.7585 13.3992 12.8613 12.7271 12.0597 11.95C11.2825 11.1484 10.6105 10.2512 10.0597 9.28L10.5197 9.07C10.963 8.85292 11.3105 8.47953 11.4951 8.02169C11.6797 7.56385 11.6885 7.05391 11.5197 6.59C11.3609 6.15903 11.2306 5.71808 11.1297 5.27C11.0797 5.05 11.0397 4.82 11.0097 4.6C10.8882 3.89562 10.5193 3.25774 9.96931 2.80124C9.4193 2.34474 8.72438 2.09961 8.00968 2.11H4.99968C4.57693 2.10945 4.15883 2.19825 3.7728 2.37058C3.38677 2.54292 3.04152 2.7949 2.75968 3.11C2.472 3.43365 2.2578 3.81575 2.13179 4.23004C2.00577 4.64432 1.97094 5.08098 2.02968 5.51C2.57327 9.67214 4.47489 13.5387 7.43968 16.51C10.411 19.4748 14.2775 21.3764 18.4397 21.92C18.5695 21.9299 18.6999 21.9299 18.8297 21.92C19.5671 21.9211 20.2791 21.6505 20.8297 21.16C21.1448 20.8782 21.3968 20.5329 21.5691 20.1469C21.7414 19.7609 21.8302 19.3428 21.8297 18.92V15.92C21.8243 15.229 21.5805 14.5611 21.1396 14.0291C20.6987 13.4971 20.0876 13.1336 19.4097 13ZM19.8997 19C19.8994 19.1395 19.8698 19.2775 19.813 19.4049C19.7562 19.5324 19.6733 19.6465 19.5697 19.74C19.4601 19.8399 19.3297 19.9141 19.1878 19.9573C19.046 20.0006 18.8963 20.0117 18.7497 19.99C15.018 19.5026 11.5499 17.802 8.87968 15.15C6.20716 12.4775 4.49171 8.99737 3.99968 5.25C3.97796 5.10333 3.98912 4.95367 4.03236 4.81185C4.0756 4.67003 4.14983 4.5396 4.24968 4.43C4.3443 4.32515 4.46006 4.24154 4.58933 4.18466C4.7186 4.12778 4.85846 4.09892 4.99968 4.1H7.99968C8.23085 4.09435 8.45682 4.16898 8.63915 4.3112C8.82147 4.45341 8.94888 4.65442 8.99968 4.88C8.99968 5.15 9.08968 5.43 9.14968 5.7C9.26526 6.22386 9.419 6.73857 9.60968 7.24L8.20968 7.9C7.96905 8.01046 7.78204 8.21185 7.68968 8.46C7.58967 8.70346 7.58967 8.97654 7.68968 9.22C9.12888 12.3028 11.6069 14.7808 14.6897 16.22C14.9331 16.32 15.2062 16.32 15.4497 16.22C15.6978 16.1276 15.8992 15.9406 16.0097 15.7L16.6397 14.3C17.1556 14.4881 17.6834 14.6418 18.2197 14.76C18.4797 14.82 18.7597 14.87 19.0297 14.91C19.2553 14.9608 19.4563 15.0882 19.5985 15.2705C19.7407 15.4529 19.8153 15.6788 19.8097 15.91L19.8997 19ZM13.9997 2C13.7697 2 13.5297 2 13.2997 2C13.0345 2.02254 12.7891 2.14952 12.6175 2.353C12.4459 2.55647 12.3621 2.81978 12.3847 3.085C12.4072 3.35022 12.5342 3.59562 12.7377 3.76721C12.9412 3.93881 13.2045 4.02254 13.4697 4H13.9997C15.591 4 17.1171 4.63214 18.2423 5.75736C19.3675 6.88258 19.9997 8.4087 19.9997 10C19.9997 10.18 19.9997 10.35 19.9997 10.53C19.9775 10.7938 20.0609 11.0556 20.2314 11.2581C20.402 11.4606 20.6459 11.5871 20.9097 11.61H20.9897C21.24 11.611 21.4816 11.5181 21.6668 11.3496C21.8519 11.1811 21.9672 10.9493 21.9897 10.7C21.9897 10.47 21.9897 10.23 21.9897 10C21.9897 7.88 21.1482 5.84668 19.6501 4.34668C18.1519 2.84667 16.1197 2.00265 13.9997 2ZM15.9997 10C15.9997 10.2652 16.105 10.5196 16.2926 10.7071C16.4801 10.8946 16.7345 11 16.9997 11C17.2649 11 17.5193 10.8946 17.7068 10.7071C17.8943 10.5196 17.9997 10.2652 17.9997 10C17.9997 8.93913 17.5783 7.92172 16.8281 7.17157C16.078 6.42143 15.0605 6 13.9997 6C13.7345 6 13.4801 6.10536 13.2926 6.29289C13.105 6.48043 12.9997 6.73478 12.9997 7C12.9997 7.26522 13.105 7.51957 13.2926 7.70711C13.4801 7.89464 13.7345 8 13.9997 8C14.5301 8 15.0388 8.21071 15.4139 8.58579C15.789 8.96086 15.9997 9.46957 15.9997 10Z"
|
|
82
|
+
/>
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</svg>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
<span
|
|
89
|
+
class="ct-text-icon__text"
|
|
90
|
+
>
|
|
91
|
+
Click
|
|
92
|
+
</span>
|
|
93
|
+
<span
|
|
94
|
+
class="ct-text-icon__group"
|
|
95
|
+
>
|
|
96
|
+
<span
|
|
97
|
+
class="ct-text-icon__text"
|
|
98
|
+
>
|
|
99
|
+
me
|
|
100
|
+
</span>
|
|
101
|
+
|
|
102
|
+
<svg
|
|
103
|
+
aria-hidden="true"
|
|
104
|
+
class="ct-icon"
|
|
105
|
+
height="24"
|
|
106
|
+
role="img"
|
|
107
|
+
viewBox="0 0 24 24"
|
|
108
|
+
width="24"
|
|
109
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
110
|
+
>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
<path
|
|
114
|
+
d="M17.9199 6.62C17.8185 6.37565 17.6243 6.18147 17.3799 6.08C17.2597 6.02876 17.1306 6.00158 16.9999 6H6.99994C6.73472 6 6.48037 6.10536 6.29283 6.29289C6.1053 6.48043 5.99994 6.73478 5.99994 7C5.99994 7.26522 6.1053 7.51957 6.29283 7.70711C6.48037 7.89464 6.73472 8 6.99994 8H14.5899L6.28994 16.29C6.19621 16.383 6.12182 16.4936 6.07105 16.6154C6.02028 16.7373 5.99414 16.868 5.99414 17C5.99414 17.132 6.02028 17.2627 6.07105 17.3846C6.12182 17.5064 6.19621 17.617 6.28994 17.71C6.3829 17.8037 6.4935 17.8781 6.61536 17.9289C6.73722 17.9797 6.86793 18.0058 6.99994 18.0058C7.13195 18.0058 7.26266 17.9797 7.38452 17.9289C7.50638 17.8781 7.61698 17.8037 7.70994 17.71L15.9999 9.41V17C15.9999 17.2652 16.1053 17.5196 16.2928 17.7071C16.4804 17.8946 16.7347 18 16.9999 18C17.2652 18 17.5195 17.8946 17.707 17.7071C17.8946 17.5196 17.9999 17.2652 17.9999 17V7C17.9984 6.86932 17.9712 6.74022 17.9199 6.62Z"
|
|
115
|
+
/>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
</svg>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</span>
|
|
122
|
+
<span
|
|
123
|
+
class="ct-visually-hidden"
|
|
124
|
+
>
|
|
125
|
+
(Opens in a new tab/window)
|
|
126
|
+
</span>
|
|
127
|
+
</a>
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
</div>
|
|
131
|
+
`;
|
|
132
|
+
|
|
133
|
+
exports[`Button Component renders as a reset button 1`] = `
|
|
134
|
+
<div>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<input
|
|
139
|
+
class="ct-button ct-theme-light ct-button--reset ct-button--regular "
|
|
140
|
+
data-component-name="button"
|
|
141
|
+
type="reset"
|
|
142
|
+
value="Reset"
|
|
143
|
+
/>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
</div>
|
|
147
|
+
`;
|
|
148
|
+
|
|
149
|
+
exports[`Button Component renders as a submit button 1`] = `
|
|
150
|
+
<div>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
<input
|
|
155
|
+
class="ct-button ct-theme-light ct-button--submit ct-button--regular "
|
|
156
|
+
data-component-name="button"
|
|
157
|
+
type="submit"
|
|
158
|
+
value="Submit"
|
|
159
|
+
/>
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
</div>
|
|
163
|
+
`;
|
|
164
|
+
|
|
165
|
+
exports[`Button Component renders with disabled state 1`] = `
|
|
166
|
+
<div>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
<button
|
|
171
|
+
aria-disabled="true"
|
|
172
|
+
class="ct-button ct-theme-light ct-button--button ct-button--regular "
|
|
173
|
+
data-component-name="button"
|
|
174
|
+
disabled="disabled"
|
|
175
|
+
>
|
|
176
|
+
<span
|
|
177
|
+
class="ct-text-icon__text"
|
|
178
|
+
>
|
|
179
|
+
Click me
|
|
180
|
+
</span>
|
|
181
|
+
</button>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
</div>
|
|
185
|
+
`;
|
|
186
|
+
|
|
187
|
+
exports[`Button Component renders with required attributes 1`] = `
|
|
188
|
+
<div>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
<button
|
|
193
|
+
class="ct-button ct-theme-light ct-button--button ct-button--regular "
|
|
194
|
+
data-component-name="button"
|
|
195
|
+
>
|
|
196
|
+
<span
|
|
197
|
+
class="ct-text-icon__text"
|
|
198
|
+
>
|
|
199
|
+
Click me
|
|
200
|
+
</span>
|
|
201
|
+
</button>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
</div>
|
|
205
|
+
`;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CivicTheme Button component.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
function CivicThemeButton(el) {
|
|
6
|
+
if (el.getAttribute('data-button') === 'true') {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
this.el = el;
|
|
11
|
+
this.el.setAttribute('data-button', 'true');
|
|
12
|
+
this.dismissButton = this.el.querySelector('[data-button-dismiss]');
|
|
13
|
+
this.keyboardFocused = false;
|
|
14
|
+
|
|
15
|
+
this.el.addEventListener('click', this.clickEvent.bind(this));
|
|
16
|
+
this.el.addEventListener('focusin', this.focusinEvent.bind(this));
|
|
17
|
+
this.el.addEventListener('focusout', this.focusoutEvent.bind(this));
|
|
18
|
+
|
|
19
|
+
document.addEventListener('mousedown', this.mousedownEvent.bind(this));
|
|
20
|
+
document.addEventListener('keydown', this.keydownEvent.bind(this));
|
|
21
|
+
|
|
22
|
+
if (this.dismissButton) {
|
|
23
|
+
this.dismissButton.addEventListener('click', this.dismissClickEvent.bind(this));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Click event handler.
|
|
29
|
+
*/
|
|
30
|
+
CivicThemeButton.prototype.clickEvent = function (e) {
|
|
31
|
+
if (/input/i.test(e.target.tagName)) {
|
|
32
|
+
let isChecked = false;
|
|
33
|
+
const input = e.target;
|
|
34
|
+
if (input.getAttribute('type') === 'checkbox') {
|
|
35
|
+
isChecked = input.getAttribute('checked');
|
|
36
|
+
} else if (input.getAttribute('type') === 'radio') {
|
|
37
|
+
// "Uncheck" all but current radio in this group.
|
|
38
|
+
const name = input.getAttribute('name');
|
|
39
|
+
const radios = document.querySelectorAll(`input[type=radio][name="${name}"]`);
|
|
40
|
+
for (const i in radios) {
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(radios, i) && radios[i] !== input) {
|
|
42
|
+
this.setChecked(radios[i], false);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.setChecked(input, !isChecked);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Keydown event handler.
|
|
54
|
+
*/
|
|
55
|
+
CivicThemeButton.prototype.keydownEvent = function (e) {
|
|
56
|
+
if (e.key && (e.key === 'Tab' || e.key.indexOf('Arrow') === 0)) {
|
|
57
|
+
this.keyboardFocused = true;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Keydown event handler.
|
|
63
|
+
*/
|
|
64
|
+
CivicThemeButton.prototype.mousedownEvent = function () {
|
|
65
|
+
this.keyboardFocused = false;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Set the checked value.
|
|
70
|
+
*/
|
|
71
|
+
CivicThemeButton.prototype.setChecked = function (input, check) {
|
|
72
|
+
const button = this.findButton(input);
|
|
73
|
+
if (button && !button.hasAttribute('disabled')) {
|
|
74
|
+
if (check) {
|
|
75
|
+
input.setAttribute('checked', 'checked');
|
|
76
|
+
button.classList.add('active');
|
|
77
|
+
} else {
|
|
78
|
+
input.removeAttribute('checked');
|
|
79
|
+
button.classList.remove('active');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Focusin event handler.
|
|
86
|
+
*/
|
|
87
|
+
CivicThemeButton.prototype.focusinEvent = function (e) {
|
|
88
|
+
const button = this.findButton(e.target);
|
|
89
|
+
if (button && !button.hasAttribute('disabled') && this.keyboardFocused) {
|
|
90
|
+
button.classList.add('focus');
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Focusout event handler.
|
|
96
|
+
*/
|
|
97
|
+
CivicThemeButton.prototype.focusoutEvent = function (e) {
|
|
98
|
+
const button = this.findButton(e.target);
|
|
99
|
+
if (button) {
|
|
100
|
+
button.classList.remove('focus');
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Click event handler for dismiss button.
|
|
106
|
+
*/
|
|
107
|
+
CivicThemeButton.prototype.dismissClickEvent = function (e) {
|
|
108
|
+
const button = this.findButton(e.target);
|
|
109
|
+
if (button) {
|
|
110
|
+
button.remove();
|
|
111
|
+
this.el.dispatchEvent(new CustomEvent('ct.button.dismiss', { bubbles: true }));
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Find button element.
|
|
117
|
+
*/
|
|
118
|
+
CivicThemeButton.prototype.findButton = function (el) {
|
|
119
|
+
if (el.classList.contains('ct-button')) {
|
|
120
|
+
return el;
|
|
121
|
+
}
|
|
122
|
+
return el.closest('.ct-button');
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
document.querySelectorAll('.ct-button').forEach((el) => {
|
|
126
|
+
new CivicThemeButton(el);
|
|
127
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CivicTheme Button component styles.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
.ct-button {
|
|
6
|
+
$root: &;
|
|
7
|
+
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
border: var(--ct-button-border-width) solid transparent;
|
|
10
|
+
border-radius: var(--ct-button-border-radius);
|
|
11
|
+
appearance: button;
|
|
12
|
+
|
|
13
|
+
@include ct-button-size('regular');
|
|
14
|
+
|
|
15
|
+
&--primary {
|
|
16
|
+
@include ct-button-type('primary');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&--secondary {
|
|
20
|
+
@include ct-button-type('secondary');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Type.
|
|
24
|
+
&--tertiary {
|
|
25
|
+
@include ct-button-type('tertiary');
|
|
26
|
+
|
|
27
|
+
&:focus-visible,
|
|
28
|
+
&:hover,
|
|
29
|
+
&:active {
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&--large {
|
|
34
|
+
@include ct-button-size('large', false);
|
|
35
|
+
|
|
36
|
+
&__dismiss {
|
|
37
|
+
margin-left: ct-spacing(3);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--regular {
|
|
42
|
+
@include ct-button-size('regular', false);
|
|
43
|
+
|
|
44
|
+
&__dismiss {
|
|
45
|
+
margin-left: ct-spacing(3);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&--small {
|
|
50
|
+
@include ct-button-size('small', false);
|
|
51
|
+
|
|
52
|
+
&__dismiss {
|
|
53
|
+
margin-left: ct-spacing(2);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Size.
|
|
59
|
+
&--large {
|
|
60
|
+
@include ct-button-size('large');
|
|
61
|
+
|
|
62
|
+
&#{$root}--tertiary {
|
|
63
|
+
padding: 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&--regular {
|
|
68
|
+
@include ct-button-size('regular');
|
|
69
|
+
|
|
70
|
+
&#{$root}--tertiary {
|
|
71
|
+
padding: 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&--small {
|
|
76
|
+
@include ct-button-size('small');
|
|
77
|
+
|
|
78
|
+
&#{$root}--tertiary {
|
|
79
|
+
padding: 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CivicTheme Button component stories.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import Component from './button.twig';
|
|
6
|
+
import Constants from '../../../dist/constants.json';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Atoms/Form Controls/Button',
|
|
10
|
+
component: Component,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
theme: {
|
|
16
|
+
control: { type: 'radio' },
|
|
17
|
+
options: ['light', 'dark'],
|
|
18
|
+
},
|
|
19
|
+
text: {
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
},
|
|
22
|
+
type: {
|
|
23
|
+
control: { type: 'radio' },
|
|
24
|
+
options: ['primary', 'secondary', 'tertiary'],
|
|
25
|
+
},
|
|
26
|
+
kind: {
|
|
27
|
+
control: { type: 'radio' },
|
|
28
|
+
options: ['button', 'link', 'reset', 'submit'],
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
control: { type: 'radio' },
|
|
32
|
+
options: ['large', 'regular', 'small'],
|
|
33
|
+
},
|
|
34
|
+
icon: {
|
|
35
|
+
control: { type: 'select' },
|
|
36
|
+
options: Constants.ICONS,
|
|
37
|
+
},
|
|
38
|
+
icon_placement: {
|
|
39
|
+
control: { type: 'radio' },
|
|
40
|
+
options: ['before', 'after'],
|
|
41
|
+
},
|
|
42
|
+
icon_group_disabled: {
|
|
43
|
+
control: { type: 'boolean' },
|
|
44
|
+
},
|
|
45
|
+
icon_single_only: {
|
|
46
|
+
control: { type: 'boolean' },
|
|
47
|
+
},
|
|
48
|
+
url: {
|
|
49
|
+
control: { type: 'text' },
|
|
50
|
+
},
|
|
51
|
+
is_new_window: {
|
|
52
|
+
control: { type: 'boolean' },
|
|
53
|
+
},
|
|
54
|
+
is_disabled: {
|
|
55
|
+
control: { type: 'boolean' },
|
|
56
|
+
},
|
|
57
|
+
is_external: {
|
|
58
|
+
control: { type: 'boolean' },
|
|
59
|
+
},
|
|
60
|
+
modifier_class: {
|
|
61
|
+
control: { type: 'text' },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default meta;
|
|
67
|
+
|
|
68
|
+
export const Button = {
|
|
69
|
+
args: {
|
|
70
|
+
theme: 'light',
|
|
71
|
+
type: 'primary',
|
|
72
|
+
kind: 'button',
|
|
73
|
+
size: 'regular',
|
|
74
|
+
icon: '',
|
|
75
|
+
icon_placement: 'after',
|
|
76
|
+
icon_group_disabled: false,
|
|
77
|
+
icon_single_only: false,
|
|
78
|
+
text: 'My title',
|
|
79
|
+
url: '',
|
|
80
|
+
is_new_window: false,
|
|
81
|
+
is_external: false,
|
|
82
|
+
is_disabled: false,
|
|
83
|
+
attributes: null,
|
|
84
|
+
modifier_class: '',
|
|
85
|
+
},
|
|
86
|
+
};
|