@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,254 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Table mixins.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
@mixin ct-table() {
|
|
6
|
+
$root: &;
|
|
7
|
+
|
|
8
|
+
width: 100%;
|
|
9
|
+
border-collapse: collapse;
|
|
10
|
+
border: 0;
|
|
11
|
+
border-spacing: 0;
|
|
12
|
+
text-align: left;
|
|
13
|
+
vertical-align: middle;
|
|
14
|
+
|
|
15
|
+
@include ct-typography('text-regular');
|
|
16
|
+
|
|
17
|
+
thead,
|
|
18
|
+
tfoot {
|
|
19
|
+
@include ct-typography('label-regular');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
tr {
|
|
23
|
+
th,
|
|
24
|
+
td {
|
|
25
|
+
padding: ct-spacing(1.5) ct-spacing(3);
|
|
26
|
+
vertical-align: var(--ct-table-cell-vertical-align);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
caption {
|
|
31
|
+
text-align: left;
|
|
32
|
+
padding: ct-spacing(1.5) 0;
|
|
33
|
+
|
|
34
|
+
@include ct-typography('label-large');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&#{$root}--caption-after {
|
|
38
|
+
caption-side: bottom;
|
|
39
|
+
|
|
40
|
+
caption {
|
|
41
|
+
@include ct-typography('text-small');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:not(.ct-table--data) {
|
|
46
|
+
@include ct-table-responsive();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@mixin ct-table-responsive() {
|
|
51
|
+
$root: &;
|
|
52
|
+
|
|
53
|
+
@include ct-breakpoint-upto($ct-table-breakpoint) {
|
|
54
|
+
thead,
|
|
55
|
+
tfoot {
|
|
56
|
+
@include ct-visually-hidden();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
tbody {
|
|
60
|
+
tr {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
width: 100%;
|
|
64
|
+
|
|
65
|
+
td {
|
|
66
|
+
border: 0;
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-wrap: nowrap;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
justify-content: stretch;
|
|
71
|
+
|
|
72
|
+
&:first-of-type::after {
|
|
73
|
+
visibility: hidden;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&::after {
|
|
77
|
+
content: '';
|
|
78
|
+
width: calc(100% - 30px);
|
|
79
|
+
display: block;
|
|
80
|
+
margin: 0 auto;
|
|
81
|
+
height: ct-particle(0.125);
|
|
82
|
+
position: absolute;
|
|
83
|
+
left: 0;
|
|
84
|
+
right: 0;
|
|
85
|
+
top: -6px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&::before {
|
|
89
|
+
content: attr(data-title);
|
|
90
|
+
display: table-cell;
|
|
91
|
+
height: 100%;
|
|
92
|
+
width: 30%;
|
|
93
|
+
max-width: ct-spacing(12);
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
vertical-align: middle;
|
|
96
|
+
padding-right: ct-spacing(2);
|
|
97
|
+
|
|
98
|
+
@include ct-typography('label-regular');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
tr {
|
|
105
|
+
th,
|
|
106
|
+
td {
|
|
107
|
+
padding: ct-spacing(1.5) ct-spacing();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@mixin ct-table-light() {
|
|
114
|
+
color: var(--ct-table-light-color);
|
|
115
|
+
background-color: var(--ct-table-light-background-color);
|
|
116
|
+
|
|
117
|
+
thead {
|
|
118
|
+
color: var(--ct-table-light-header-color);
|
|
119
|
+
|
|
120
|
+
@include ct-breakpoint($ct-table-breakpoint) {
|
|
121
|
+
border-bottom: solid ct-particle(0.125) var(--ct-table-light-header-border-color);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
tr {
|
|
125
|
+
&:last-child {
|
|
126
|
+
border-bottom: solid ct-particle(0.25) var(--ct-table-light-header-border-color);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
tfoot {
|
|
132
|
+
color: var(--ct-table-light-footer-color);
|
|
133
|
+
|
|
134
|
+
@include ct-breakpoint($ct-table-breakpoint) {
|
|
135
|
+
border-top: solid ct-particle(0.125) var(--ct-table-light-footer-border-color);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
tr {
|
|
139
|
+
&:last-child {
|
|
140
|
+
border-top: solid ct-particle(0.25) var(--ct-table-light-footer-border-color);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
tbody {
|
|
146
|
+
tr {
|
|
147
|
+
border-bottom: solid ct-particle(0.125) var(--ct-table-light-border-color);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
caption {
|
|
152
|
+
color: var(--ct-table-light-caption-color);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&.ct-table--data {
|
|
156
|
+
border-top: solid ct-particle(0.125) var(--ct-table-light-footer-border-color);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&.ct-table--striped {
|
|
160
|
+
tbody {
|
|
161
|
+
tr:nth-child(odd) {
|
|
162
|
+
background: var(--ct-table-light-row-odd-background-color);
|
|
163
|
+
|
|
164
|
+
td {
|
|
165
|
+
color: var(--ct-table-light-row-odd-color);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
tr:nth-child(even) {
|
|
170
|
+
background: var(--ct-table-light-row-even-background-color);
|
|
171
|
+
|
|
172
|
+
td {
|
|
173
|
+
color: var(--ct-table-light-row-even-color);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@mixin ct-table-dark() {
|
|
181
|
+
color: var(--ct-table-dark-color);
|
|
182
|
+
background-color: var(--ct-table-dark-background-color);
|
|
183
|
+
|
|
184
|
+
thead {
|
|
185
|
+
color: var(--ct-table-dark-header-color);
|
|
186
|
+
|
|
187
|
+
@include ct-breakpoint($ct-table-breakpoint) {
|
|
188
|
+
border-bottom: solid ct-particle(0.125) var(--ct-table-dark-header-border-color);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
tr {
|
|
192
|
+
&:last-child {
|
|
193
|
+
border-bottom: solid ct-particle(0.25) var(--ct-table-dark-header-border-color);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
tfoot {
|
|
199
|
+
color: var(--ct-table-dark-footer-color);
|
|
200
|
+
|
|
201
|
+
@include ct-breakpoint($ct-table-breakpoint) {
|
|
202
|
+
border-top: solid ct-particle(0.125) var(--ct-table-dark-footer-border-color);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
tr {
|
|
206
|
+
&:last-child {
|
|
207
|
+
border-top: solid ct-particle(0.25) var(--ct-table-dark-footer-border-color);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
tbody {
|
|
213
|
+
tr {
|
|
214
|
+
border-bottom: solid ct-particle(0.125) var(--ct-table-dark-border-color);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
caption {
|
|
219
|
+
color: var(--ct-table-dark-caption-color);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&.ct-table--data {
|
|
223
|
+
border-top: solid ct-particle(0.125) var(--ct-table-dark-footer-border-color);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&.ct-table--striped {
|
|
227
|
+
tbody {
|
|
228
|
+
tr:nth-child(odd) {
|
|
229
|
+
background: var(--ct-table-dark-row-odd-background-color);
|
|
230
|
+
|
|
231
|
+
td {
|
|
232
|
+
color: var(--ct-table-dark-row-odd-color);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
tr:nth-child(even) {
|
|
237
|
+
background: var(--ct-table-dark-row-even-background-color);
|
|
238
|
+
|
|
239
|
+
td {
|
|
240
|
+
color: var(--ct-table-dark-row-even-color);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@mixin ct-table-theme($theme) {
|
|
248
|
+
@if $theme == 'light' {
|
|
249
|
+
@include ct-table-light();
|
|
250
|
+
}
|
|
251
|
+
@else {
|
|
252
|
+
@include ct-table-dark();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Typography mixins.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
@use 'sass:map';
|
|
6
|
+
@use 'sass:list';
|
|
7
|
+
|
|
8
|
+
//
|
|
9
|
+
// Print typography rules based on the pre-defined typography preset.
|
|
10
|
+
//
|
|
11
|
+
// @code
|
|
12
|
+
//
|
|
13
|
+
// @include ct-typography('heading-1');
|
|
14
|
+
//
|
|
15
|
+
// @endcode
|
|
16
|
+
//
|
|
17
|
+
@mixin ct-typography($name) {
|
|
18
|
+
@if type-of($name) != string {
|
|
19
|
+
@error 'Only scalar names can be used as a typography preset.';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@include _ct-typography-print-ruleset($name);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//
|
|
26
|
+
// Get typography rules based on the pre-defined typography preset.
|
|
27
|
+
//
|
|
28
|
+
// Similar to ct-typography(), but returns the value instead of printing it.
|
|
29
|
+
//
|
|
30
|
+
@function ct-typography-rule($name, $rule-name, $breakpoint, $default: 'none') {
|
|
31
|
+
@if type-of($name) != string {
|
|
32
|
+
@error 'Only scalar names can be used as a typography preset.';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
$value: _ct-typography-get-ruleset-rule($name, $rule-name, $breakpoint);
|
|
36
|
+
|
|
37
|
+
@if $value == null {
|
|
38
|
+
$value: $default;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@return $value;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//
|
|
45
|
+
// Include font size, height, weight and family for one-to-many breakpoints.
|
|
46
|
+
//
|
|
47
|
+
// Do not use directly.
|
|
48
|
+
// Use @include ct-typography() mixin instead.
|
|
49
|
+
//
|
|
50
|
+
@mixin _ct-typography-print-ruleset($name) {
|
|
51
|
+
font-size: var(#{'--ct-typography-' + $name + '-font-size'});
|
|
52
|
+
line-height: var(#{'--ct-typography-' + $name + '-line-height'});
|
|
53
|
+
font-family: var(#{'--ct-typography-' + $name + '-font-name'});
|
|
54
|
+
font-weight: var(#{'--ct-typography-' + $name + '-font-weight'});
|
|
55
|
+
letter-spacing: var(#{'--ct-typography-' + $name + '-letter-spacing'});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//
|
|
59
|
+
// Include font size, height, weight and family for one-to-many breakpoints.
|
|
60
|
+
//
|
|
61
|
+
// Do not use directly.
|
|
62
|
+
// Use @include ct-typography-rule() function instead.
|
|
63
|
+
//
|
|
64
|
+
// stylelint-disable-next-line scss/at-function-pattern
|
|
65
|
+
@function _ct-typography-get-ruleset-rule($ruleset, $rule-name: false, $rule-breakpoint: false) {
|
|
66
|
+
$all-typographies: _ct-typography-all();
|
|
67
|
+
|
|
68
|
+
// Ruleset is a name of the preset - retrieve preset as a ruleset.
|
|
69
|
+
@if type-of($ruleset) == string {
|
|
70
|
+
@if map.get($all-typographies, $ruleset) == null {
|
|
71
|
+
@error '"#{$ruleset}" is not an available typography preset.';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
$ruleset: map.get($all-typographies, $ruleset);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Ruleset is a list of rules - extract rules.
|
|
78
|
+
@if type-of($ruleset) == list {
|
|
79
|
+
$ruleset: _ct-typography-extract-rules($ruleset);
|
|
80
|
+
|
|
81
|
+
@if $rule-name {
|
|
82
|
+
@return map.get($ruleset, $rule-name);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Ruleset is a full ruleset definition - print all rules with breakpoints.
|
|
87
|
+
@else if type-of($ruleset) == map {
|
|
88
|
+
$breakpoints: map.keys($ruleset);
|
|
89
|
+
|
|
90
|
+
@if $rule-name == false and $rule-breakpoint == false {
|
|
91
|
+
@return $ruleset;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@each $breakpoint in $breakpoints {
|
|
95
|
+
$breakpoint-ruleset: _ct-typography-extract-rules(map.get($ruleset, $breakpoint));
|
|
96
|
+
|
|
97
|
+
// Return requested rule if it matches the breakpoint.
|
|
98
|
+
@if $rule-name and $rule-breakpoint and $breakpoint == $rule-breakpoint {
|
|
99
|
+
@return map.get($breakpoint-ruleset, $rule-name);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@error 'Requested typography rule or breakpoint not found.';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//
|
|
108
|
+
// Print css variables for typography rules.
|
|
109
|
+
//
|
|
110
|
+
// Do not use directly.
|
|
111
|
+
//
|
|
112
|
+
@mixin _ct-typography-print-css-variables($name, $map) {
|
|
113
|
+
--ct-typography-#{$name}-font-size: #{map.get($map, 'font-size')};
|
|
114
|
+
--ct-typography-#{$name}-line-height: #{map.get($map, 'line-height')};
|
|
115
|
+
|
|
116
|
+
@if map.get($map, 'font-name') {
|
|
117
|
+
--ct-typography-#{$name}-font-name: #{map.get($map, 'font-name')};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@if map.get($map, 'font-weight') {
|
|
121
|
+
--ct-typography-#{$name}-font-weight: #{map.get($map, 'font-weight')};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@if map.get($map, 'letter-spacing') {
|
|
125
|
+
--ct-typography-#{$name}-letter-spacing: #{map.get($map, 'letter-spacing')};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
//
|
|
130
|
+
// Normalize typography rules and return as a map.
|
|
131
|
+
//
|
|
132
|
+
// Do not use directly.
|
|
133
|
+
//
|
|
134
|
+
// stylelint-disable-next-line scss/at-function-pattern
|
|
135
|
+
@function _ct-typography-extract-rules($rules) {
|
|
136
|
+
$font-size: list.nth($rules, 1);
|
|
137
|
+
$line-height: list.nth($rules, 2);
|
|
138
|
+
$font-weight: false;
|
|
139
|
+
$font-name: false;
|
|
140
|
+
$letter-spacing: false;
|
|
141
|
+
|
|
142
|
+
@if length($rules) >= 3 {
|
|
143
|
+
$font-weight: list.nth($rules, 3);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@if length($rules) >= 4 {
|
|
147
|
+
$font-name: list.nth($rules, 4);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@if length($rules) >= 5 {
|
|
151
|
+
$letter-spacing: list.nth($rules, 5);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@if $font-name {
|
|
155
|
+
$font-name: ct-font($font-name);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@if $font-weight {
|
|
159
|
+
// Try to get the weight value from the pre-defined weights or default
|
|
160
|
+
// to the provided value.
|
|
161
|
+
$font-weight-value: map.get(_ct-font-weights-all(), $font-weight);
|
|
162
|
+
|
|
163
|
+
@if $font-weight-value != null {
|
|
164
|
+
$font-weight: $font-weight-value;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
$map: (
|
|
169
|
+
'font-size': rem($font-size),
|
|
170
|
+
'line-height': rem($line-height),
|
|
171
|
+
'font-weight': $font-weight,
|
|
172
|
+
'font-name': $font-name,
|
|
173
|
+
'letter-spacing': $letter-spacing,
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
@return $map;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
//
|
|
180
|
+
// Compile all typographies into a single map.
|
|
181
|
+
//
|
|
182
|
+
// Do not use directly.
|
|
183
|
+
// Use @include ct-typography() mixin instead.
|
|
184
|
+
//
|
|
185
|
+
// stylelint-disable-next-line scss/at-function-pattern
|
|
186
|
+
@function _ct-typography-all() {
|
|
187
|
+
@return map.merge($ct-typography-default, $ct-typography);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@mixin ct-font-size-inherit() {
|
|
191
|
+
font-size: inherit;
|
|
192
|
+
line-height: inherit;
|
|
193
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Visibility mixins.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
//
|
|
6
|
+
// Make element visually hidden but readable by screen readers.
|
|
7
|
+
//
|
|
8
|
+
@mixin ct-visually-hidden() {
|
|
9
|
+
position: absolute !important;
|
|
10
|
+
clip: rect(ct-particle(0.125), ct-particle(0.125), ct-particle(0.125), ct-particle(0.125));
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
height: 1px !important;
|
|
13
|
+
width: 1px !important;
|
|
14
|
+
word-wrap: normal;
|
|
15
|
+
|
|
16
|
+
&.ct-focusable {
|
|
17
|
+
&:active,
|
|
18
|
+
&:focus-visible,
|
|
19
|
+
&:hover {
|
|
20
|
+
position: static !important;
|
|
21
|
+
overflow: visible;
|
|
22
|
+
clip: auto;
|
|
23
|
+
width: auto !important;
|
|
24
|
+
height: auto !important;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file
|
|
3
|
+
* Platform utility.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
function CivicThemePlatform(el) {
|
|
7
|
+
function iOS() {
|
|
8
|
+
return [
|
|
9
|
+
'iPad Simulator',
|
|
10
|
+
'iPhone Simulator',
|
|
11
|
+
'iPod Simulator',
|
|
12
|
+
'iPad',
|
|
13
|
+
'iPhone',
|
|
14
|
+
'iPod',
|
|
15
|
+
].includes(navigator.platform)
|
|
16
|
+
// iPad on iOS 13 detection
|
|
17
|
+
|| (navigator.userAgent.includes('Mac') && 'ontouchend' in document);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (iOS()) {
|
|
21
|
+
el.dataset.platform = 'ios';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
document.querySelectorAll('[data-platform]').forEach((el) => {
|
|
26
|
+
new CivicThemePlatform(el);
|
|
27
|
+
});
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file
|
|
3
|
+
* Responsive component.
|
|
4
|
+
*
|
|
5
|
+
* Emits a 'ct-responsive' event on breakpoint change allowing
|
|
6
|
+
* components to delay initialisation by providing 'data-responsive' attribute
|
|
7
|
+
* with an operator and breakpoint name.
|
|
8
|
+
*
|
|
9
|
+
* For example: a component with `data-responsive=">=m"` attribute will
|
|
10
|
+
* delay its initialisation to happen only when current screen size is equal
|
|
11
|
+
* or more than medium ('m') breakpoint.
|
|
12
|
+
*/
|
|
13
|
+
function CivicThemeResponsive() {
|
|
14
|
+
const queries = this.getMediaQueries();
|
|
15
|
+
for (const breakpoint in queries) {
|
|
16
|
+
const query = queries[breakpoint];
|
|
17
|
+
// Store matched media queries in global scope as this component is a
|
|
18
|
+
// singleton.
|
|
19
|
+
window.civicthemeResponsive = window.civicthemeResponsive || {};
|
|
20
|
+
// Only proceed if this query was not processed previously.
|
|
21
|
+
if (!(query in window.civicthemeResponsive)) {
|
|
22
|
+
window.civicthemeResponsive[query] = window.matchMedia(query);
|
|
23
|
+
// Support for Safari 13.
|
|
24
|
+
const hasEventListener = (window.civicthemeResponsive[query].addEventListener !== undefined);
|
|
25
|
+
if (hasEventListener) {
|
|
26
|
+
window.civicthemeResponsive[query]
|
|
27
|
+
.addEventListener('change', this.mediaQueryChange.bind(this, breakpoint));
|
|
28
|
+
} else {
|
|
29
|
+
window.civicthemeResponsive[query]
|
|
30
|
+
.addListener(this.mediaQueryChange.bind(this, breakpoint));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Call event handler on init.
|
|
34
|
+
this.mediaQueryChange(breakpoint, { matches: window.civicthemeResponsive[query].matches });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Breakpoints map.
|
|
40
|
+
*/
|
|
41
|
+
CivicThemeResponsive.prototype.breakpoints = {
|
|
42
|
+
xxs: '0px',
|
|
43
|
+
xs: '368px',
|
|
44
|
+
s: '576px',
|
|
45
|
+
m: '768px',
|
|
46
|
+
l: '992px',
|
|
47
|
+
xl: '1280px',
|
|
48
|
+
xxl: '1440px',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get an object of media queries.
|
|
53
|
+
*
|
|
54
|
+
* @return object
|
|
55
|
+
* Keys are breakpoint names, and values a media queries.
|
|
56
|
+
*/
|
|
57
|
+
CivicThemeResponsive.prototype.getMediaQueries = function () {
|
|
58
|
+
const queries = {};
|
|
59
|
+
|
|
60
|
+
const firstBp = Object.keys(this.breakpoints)[0];
|
|
61
|
+
let lastBp = firstBp;
|
|
62
|
+
for (const breakpoint in this.breakpoints) {
|
|
63
|
+
if (breakpoint === firstBp) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const min = this.breakpoints[lastBp];
|
|
67
|
+
const max = `${Math.max(parseFloat(this.breakpoints[breakpoint]) - 0.02, 0)}px`;
|
|
68
|
+
if (lastBp === firstBp) {
|
|
69
|
+
queries[lastBp] = `screen and (max-width: ${max})`;
|
|
70
|
+
} else {
|
|
71
|
+
queries[lastBp] = `screen and (min-width: ${min}) and (max-width: ${max})`;
|
|
72
|
+
}
|
|
73
|
+
lastBp = breakpoint;
|
|
74
|
+
}
|
|
75
|
+
queries[lastBp] = `screen and (min-width: ${this.breakpoints[lastBp]})`;
|
|
76
|
+
|
|
77
|
+
return queries;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Event handler for the media query change event.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} breakpoint
|
|
84
|
+
* The breakpoint name for which this event was fired.
|
|
85
|
+
* @param {Event} evt
|
|
86
|
+
* The media query change event.
|
|
87
|
+
*/
|
|
88
|
+
CivicThemeResponsive.prototype.mediaQueryChange = function (breakpoint, evt) {
|
|
89
|
+
if (!evt.matches) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
// Fire a custom event that other components can subscribe to.
|
|
93
|
+
window.dispatchEvent(new CustomEvent('ct-responsive', {
|
|
94
|
+
bubbles: true,
|
|
95
|
+
detail: {
|
|
96
|
+
breakpoint,
|
|
97
|
+
evaluate: CivicThemeResponsive.prototype.evaluate,
|
|
98
|
+
},
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Evaluate breakpoint expression and attach or detach component.
|
|
104
|
+
*
|
|
105
|
+
* @param {string} breakpointExpr
|
|
106
|
+
* The breakpoint expression.
|
|
107
|
+
* @param {object} func
|
|
108
|
+
* Function or class constructor.
|
|
109
|
+
* @param {object} el
|
|
110
|
+
* Element to be passed to the constructor.
|
|
111
|
+
*
|
|
112
|
+
* @return {*}
|
|
113
|
+
* Attached object or false if expression did not match.
|
|
114
|
+
*/
|
|
115
|
+
CivicThemeResponsive.prototype.evaluate = function (breakpointExpr, func, el) {
|
|
116
|
+
if (CivicThemeResponsive.prototype.matchExpr(breakpointExpr, this.breakpoint)) {
|
|
117
|
+
// eslint-disable-next-line new-cap
|
|
118
|
+
return new func(el);
|
|
119
|
+
}
|
|
120
|
+
if (typeof func.prototype.destroy !== 'undefined') {
|
|
121
|
+
func.prototype.destroy(el);
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Match breakpoint expression to the passed breakpoint.
|
|
129
|
+
*
|
|
130
|
+
* Used by the listeners to decide when to respond to a query.
|
|
131
|
+
*
|
|
132
|
+
* @param {string} breakpointExpr
|
|
133
|
+
* The breakpoint expression. E.g. '>=m', '<s' etc.
|
|
134
|
+
* Supported operators are: <, >, =, >=, <=, <>. Defaults to '>='.
|
|
135
|
+
* Breakpoint names are matched to the
|
|
136
|
+
* CivicThemeResponsive.prototype.breakpoints.
|
|
137
|
+
*
|
|
138
|
+
* @param {string} breakpoint
|
|
139
|
+
* Currently active breakpoint.
|
|
140
|
+
*
|
|
141
|
+
* @return {boolean}
|
|
142
|
+
* True if expression matches current breakppint, false otherwise.
|
|
143
|
+
*/
|
|
144
|
+
CivicThemeResponsive.prototype.matchExpr = function (breakpointExpr, breakpoint) {
|
|
145
|
+
const names = Object.keys(CivicThemeResponsive.prototype.breakpoints);
|
|
146
|
+
// Parse breakpoint expression into name and operator.
|
|
147
|
+
const regex = `^(<|>|=|>=|<=|<>)?(${names.join('|')})$`;
|
|
148
|
+
const matches = breakpointExpr.match(new RegExp(regex, 'i'));
|
|
149
|
+
|
|
150
|
+
// If not matched (malformed expression) or not exactly expected number of
|
|
151
|
+
// matches - consider as a non-match.
|
|
152
|
+
if (!matches || matches.length < 2 || matches.length > 3) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Can be with or without an operator, i.e. '>=m' or 'm'.
|
|
157
|
+
const parsedOperator = matches[1] || '>=';
|
|
158
|
+
const parsedBreakpoint = matches[2];
|
|
159
|
+
|
|
160
|
+
const compFunctions = {
|
|
161
|
+
'>': (parsed, current) => names.indexOf(current) > names.indexOf(parsed),
|
|
162
|
+
'>=': (parsed, current) => names.indexOf(current) >= names.indexOf(parsed),
|
|
163
|
+
'<': (parsed, current) => names.indexOf(current) < names.indexOf(parsed),
|
|
164
|
+
'<=': (parsed, current) => names.indexOf(current) <= names.indexOf(parsed),
|
|
165
|
+
'<>': (parsed, current) => names.indexOf(current) !== names.indexOf(parsed),
|
|
166
|
+
'=': (parsed, current) => names.indexOf(current) === names.indexOf(parsed),
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
return compFunctions[parsedOperator](parsedBreakpoint, breakpoint);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
if (document.querySelectorAll('[data-responsive]').length) {
|
|
173
|
+
// CivicThemeResponsive needs to run after all ct-responisve
|
|
174
|
+
// event listeners have been added.
|
|
175
|
+
// Delay the execution until after other components have been initialized.
|
|
176
|
+
// Using setTimeout as an interim solution because:
|
|
177
|
+
// - DOMContentLoad won't work on prod-site due to being double wrapped in a
|
|
178
|
+
// DOMLoad event.
|
|
179
|
+
// - window 'load' event won't work on storybook as it's not called per
|
|
180
|
+
// component page change.
|
|
181
|
+
setTimeout(() => {
|
|
182
|
+
// Init if there is at least a single component with data-responsive
|
|
183
|
+
// attribute on the page.
|
|
184
|
+
new CivicThemeResponsive();
|
|
185
|
+
}, 10);
|
|
186
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Component from './responsive.stories.twig';
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Base/Utilities/Responsive',
|
|
5
|
+
component: Component,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default meta;
|
|
9
|
+
|
|
10
|
+
export const Responsive = {
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
html: {
|
|
14
|
+
disable: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|