@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,40 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* CivicTheme Content Link component.
|
|
5
|
+
*
|
|
6
|
+
* Props:
|
|
7
|
+
* - theme: [string] Theme variation (light or dark).
|
|
8
|
+
* - text: [string] Link text.
|
|
9
|
+
* - url: [string] Link URL.
|
|
10
|
+
* - title: [string] Link title.
|
|
11
|
+
* - is_new_window: [boolean] Whether to open in a new window.
|
|
12
|
+
* - is_external: [boolean] Whether the link is external.
|
|
13
|
+
* - modifier_class: [string] Additional CSS classes.
|
|
14
|
+
* - attributes: [Drupal\Core\Template\Attribute] Additional HTML attributes.
|
|
15
|
+
*/
|
|
16
|
+
#}
|
|
17
|
+
|
|
18
|
+
{% set external_class = is_external ? 'ct-content-link--external' : '' %}
|
|
19
|
+
{% set theme_class = 'ct-theme-%s'|format(theme|default('light')) %}
|
|
20
|
+
{% set modifier_class = '%s %s %s'|format(theme_class, external_class, modifier_class|default('')) %}
|
|
21
|
+
|
|
22
|
+
{% if text is not empty %}
|
|
23
|
+
{% set link_content %}
|
|
24
|
+
{%- include '@base/text-icon/text-icon.twig' with {
|
|
25
|
+
text: text,
|
|
26
|
+
is_new_window: is_new_window,
|
|
27
|
+
is_external: is_external,
|
|
28
|
+
} only -%}
|
|
29
|
+
{% endset %}
|
|
30
|
+
|
|
31
|
+
<a
|
|
32
|
+
class="ct-content-link {{ modifier_class -}}"
|
|
33
|
+
{% if url is not empty %}href="{{ url }}"{% endif %}
|
|
34
|
+
{% if title is not empty %}title="{{ title }}"{% endif %}
|
|
35
|
+
{% if is_new_window %}target="_blank" aria-label="Opens in a new tab"{% endif %}
|
|
36
|
+
{% if attributes is defined and attributes is not null %}{{- attributes -}}{% endif %}
|
|
37
|
+
>
|
|
38
|
+
{{- link_content -}}
|
|
39
|
+
</a>
|
|
40
|
+
{% endif %}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Field Description Component does not render when content is empty 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
</div>
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
exports[`Field Description Component renders with additional attributes and classes 1`] = `
|
|
12
|
+
<div>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
class="ct-field-description ct-theme-light ct-field-description--regular custom-modifier"
|
|
18
|
+
data-test="true"
|
|
19
|
+
>
|
|
20
|
+
This is a description
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
exports[`Field Description Component renders with custom theme and size 1`] = `
|
|
26
|
+
<div>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
<div
|
|
31
|
+
class="ct-field-description ct-theme-dark ct-field-description--large "
|
|
32
|
+
>
|
|
33
|
+
This is a description
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
exports[`Field Description Component renders with default values 1`] = `
|
|
39
|
+
<div>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<div
|
|
44
|
+
class="ct-field-description ct-theme-light ct-field-description--regular "
|
|
45
|
+
>
|
|
46
|
+
This is a description
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CivicTheme Field Description component styles.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
.ct-field-description {
|
|
6
|
+
$root: &;
|
|
7
|
+
|
|
8
|
+
display: block;
|
|
9
|
+
margin-bottom: ct-spacing();
|
|
10
|
+
|
|
11
|
+
@include ct-typography('text-regular');
|
|
12
|
+
|
|
13
|
+
&--large {
|
|
14
|
+
@include ct-typography('text-large');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@include ct-component-theme($root) using($root, $theme) {
|
|
18
|
+
@include ct-component-property($root, $theme, color);
|
|
19
|
+
|
|
20
|
+
a:not(.ct-link.ct-theme-light):not(.ct-link.ct-theme-dark) {
|
|
21
|
+
color: inherit;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CivicTheme Field Description component stories.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import Component from './field-description.twig';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Atoms/Form Controls/Field Description',
|
|
9
|
+
component: Component,
|
|
10
|
+
argTypes: {
|
|
11
|
+
theme: {
|
|
12
|
+
control: { type: 'radio' },
|
|
13
|
+
options: ['light', 'dark'],
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
control: { type: 'radio' },
|
|
17
|
+
options: ['large', 'regular'],
|
|
18
|
+
},
|
|
19
|
+
content: {
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
},
|
|
22
|
+
modifier_class: {
|
|
23
|
+
control: { type: 'text' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
export const FieldDescription = {
|
|
31
|
+
parameters: {
|
|
32
|
+
layout: 'centered',
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
theme: 'light',
|
|
36
|
+
size: 'regular',
|
|
37
|
+
content: 'Field message content sample.',
|
|
38
|
+
modifier_class: '',
|
|
39
|
+
attributes: null,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import DrupalAttribute from 'drupal-attribute';
|
|
2
|
+
|
|
3
|
+
const template = 'components/01-atoms/field-description/field-description.twig';
|
|
4
|
+
|
|
5
|
+
describe('Field Description Component', () => {
|
|
6
|
+
test('renders with default values', async () => {
|
|
7
|
+
const c = await dom(template, {
|
|
8
|
+
content: 'This is a description',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
expect(c.querySelectorAll('.ct-field-description.ct-theme-light.ct-field-description--regular')).toHaveLength(1);
|
|
12
|
+
expect(c.querySelector('.ct-field-description').textContent.trim()).toEqual('This is a description');
|
|
13
|
+
|
|
14
|
+
assertUniqueCssClasses(c);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('renders with custom theme and size', async () => {
|
|
18
|
+
const c = await dom(template, {
|
|
19
|
+
content: 'This is a description',
|
|
20
|
+
theme: 'dark',
|
|
21
|
+
size: 'large',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
expect(c.querySelectorAll('.ct-field-description.ct-theme-dark.ct-field-description--large')).toHaveLength(1);
|
|
25
|
+
expect(c.querySelector('.ct-field-description').textContent.trim()).toEqual('This is a description');
|
|
26
|
+
|
|
27
|
+
assertUniqueCssClasses(c);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('renders with additional attributes and classes', async () => {
|
|
31
|
+
const c = await dom(template, {
|
|
32
|
+
content: 'This is a description',
|
|
33
|
+
attributes: new DrupalAttribute().setAttribute('data-test', 'true'),
|
|
34
|
+
modifier_class: 'custom-modifier',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
expect(c.querySelectorAll('.ct-field-description.ct-theme-light.ct-field-description--regular.custom-modifier')).toHaveLength(1);
|
|
38
|
+
expect(c.querySelector('.ct-field-description').getAttribute('data-test')).toEqual('true');
|
|
39
|
+
expect(c.querySelector('.ct-field-description').textContent.trim()).toEqual('This is a description');
|
|
40
|
+
|
|
41
|
+
assertUniqueCssClasses(c);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('does not render when content is empty', async () => {
|
|
45
|
+
const c = await dom(template, {
|
|
46
|
+
content: '',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
expect(c.querySelectorAll('.ct-field-description')).toHaveLength(0);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* CivicTheme Field Description component.
|
|
5
|
+
*
|
|
6
|
+
* Props:
|
|
7
|
+
* - theme: [string] Theme variation (light or dark).
|
|
8
|
+
* - content: [string] The description's content.
|
|
9
|
+
* - size: [string] Description size (large, regular).
|
|
10
|
+
* - modifier_class: [string] Additional CSS classes.
|
|
11
|
+
* - attributes: [Drupal\Core\Template\Attribute] Additional HTML attributes.
|
|
12
|
+
*/
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
{% set size = size in ['large', 'regular'] ? size : 'regular' %}
|
|
16
|
+
{% set size_class = 'ct-field-description--%s'|format(size) %}
|
|
17
|
+
{% set theme_class = 'ct-theme-%s'|format(theme|default('light')) %}
|
|
18
|
+
{% set modifier_class = '%s %s %s'|format(theme_class, size_class, modifier_class|default('')) %}
|
|
19
|
+
|
|
20
|
+
{% if content is not empty -%}
|
|
21
|
+
<div class="ct-field-description {{ modifier_class -}}" {% if attributes is defined and attributes is not null %}{{- attributes -}}{% endif %}>
|
|
22
|
+
{{- content -}}
|
|
23
|
+
</div>
|
|
24
|
+
{%- endif %}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Field Message Component does not render when content is empty 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
</div>
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
exports[`Field Message Component renders with additional attributes and classes 1`] = `
|
|
12
|
+
<div>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
class="ct-field-message ct-theme-light ct-field-message--information custom-modifier"
|
|
18
|
+
data-test="true"
|
|
19
|
+
>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<svg
|
|
23
|
+
aria-hidden="true"
|
|
24
|
+
class="ct-icon ct-icon--size-regular ct-field-message__icon"
|
|
25
|
+
height="24"
|
|
26
|
+
role="img"
|
|
27
|
+
viewBox="0 0 24 24"
|
|
28
|
+
width="24"
|
|
29
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
+
>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<path
|
|
34
|
+
d="M12 11C11.7348 11 11.4804 11.1054 11.2929 11.2929C11.1054 11.4804 11 11.7348 11 12V16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16V12C13 11.7348 12.8946 11.4804 12.7071 11.2929C12.5196 11.1054 12.2652 11 12 11ZM12.38 7.08C12.1365 6.97998 11.8635 6.97998 11.62 7.08C11.4973 7.12759 11.3851 7.19896 11.29 7.29C11.2017 7.3872 11.1306 7.49882 11.08 7.62C11.024 7.73868 10.9966 7.86882 11 8C10.9992 8.13161 11.0245 8.26207 11.0742 8.38391C11.124 8.50574 11.1973 8.61656 11.29 8.71C11.3872 8.79833 11.4988 8.86936 11.62 8.92C11.7715 8.98224 11.936 9.00632 12.099 8.99011C12.2619 8.97391 12.4184 8.91792 12.5547 8.82707C12.691 8.73622 12.8029 8.61328 12.8805 8.46907C12.9582 8.32486 12.9992 8.16378 13 8C12.9963 7.73523 12.8927 7.48163 12.71 7.29C12.6149 7.19896 12.5028 7.12759 12.38 7.08ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z"
|
|
35
|
+
/>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</svg>
|
|
39
|
+
|
|
40
|
+
This is a message
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`Field Message Component renders with custom theme and type 1`] = `
|
|
46
|
+
<div>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<div
|
|
51
|
+
class="ct-field-message ct-theme-dark ct-field-message--error "
|
|
52
|
+
>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<svg
|
|
56
|
+
aria-hidden="true"
|
|
57
|
+
class="ct-icon ct-icon--size-regular ct-field-message__icon"
|
|
58
|
+
height="24"
|
|
59
|
+
role="img"
|
|
60
|
+
viewBox="0 0 24 24"
|
|
61
|
+
width="24"
|
|
62
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
63
|
+
>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
<path
|
|
67
|
+
d="M15.7098 8.28996C15.6169 8.19623 15.5063 8.12183 15.3844 8.07107C15.2626 8.0203 15.1318 7.99416 14.9998 7.99416C14.8678 7.99416 14.7371 8.0203 14.6153 8.07107C14.4934 8.12183 14.3828 8.19623 14.2898 8.28996L11.9998 10.59L9.70984 8.28996C9.52153 8.10165 9.26614 7.99587 8.99984 7.99587C8.73353 7.99587 8.47814 8.10165 8.28983 8.28996C8.10153 8.47826 7.99574 8.73366 7.99574 8.99996C7.99574 9.26626 8.10153 9.52165 8.28983 9.70996L10.5898 12L8.28983 14.29C8.19611 14.3829 8.12171 14.4935 8.07094 14.6154C8.02017 14.7372 7.99404 14.8679 7.99404 15C7.99404 15.132 8.02017 15.2627 8.07094 15.3845C8.12171 15.5064 8.19611 15.617 8.28983 15.71C8.3828 15.8037 8.4934 15.8781 8.61526 15.9288C8.73712 15.9796 8.86782 16.0058 8.99984 16.0058C9.13185 16.0058 9.26255 15.9796 9.38441 15.9288C9.50627 15.8781 9.61687 15.8037 9.70984 15.71L11.9998 13.41L14.2898 15.71C14.3828 15.8037 14.4934 15.8781 14.6153 15.9288C14.7371 15.9796 14.8678 16.0058 14.9998 16.0058C15.1318 16.0058 15.2626 15.9796 15.3844 15.9288C15.5063 15.8781 15.6169 15.8037 15.7098 15.71C15.8036 15.617 15.878 15.5064 15.9287 15.3845C15.9795 15.2627 16.0056 15.132 16.0056 15C16.0056 14.8679 15.9795 14.7372 15.9287 14.6154C15.878 14.4935 15.8036 14.3829 15.7098 14.29L13.4098 12L15.7098 9.70996C15.8036 9.61699 15.878 9.50639 15.9287 9.38453C15.9795 9.26267 16.0056 9.13197 16.0056 8.99996C16.0056 8.86795 15.9795 8.73724 15.9287 8.61538C15.878 8.49352 15.8036 8.38292 15.7098 8.28996ZM19.0698 4.92996C18.1474 3.97486 17.0439 3.21303 15.8239 2.68894C14.6038 2.16485 13.2916 1.88899 11.9638 1.87745C10.6361 1.86591 9.31926 2.11893 8.09029 2.62174C6.86133 3.12455 5.74481 3.86708 4.80589 4.80601C3.86696 5.74493 3.12443 6.86145 2.62162 8.09042C2.11881 9.31938 1.86579 10.6362 1.87733 11.964C1.88887 13.2918 2.16473 14.604 2.68882 15.824C3.21291 17.044 3.97473 18.1475 4.92984 19.07C5.8523 20.0251 6.95575 20.7869 8.17579 21.311C9.39583 21.8351 10.708 22.1109 12.0358 22.1225C13.3636 22.134 14.6804 21.881 15.9094 21.3782C17.1383 20.8754 18.2549 20.1328 19.1938 19.1939C20.1327 18.255 20.8752 17.1385 21.3781 15.9095C21.8809 14.6805 22.1339 13.3637 22.1223 12.0359C22.1108 10.7082 21.8349 9.39595 21.3109 8.17591C20.7868 6.95587 20.0249 5.85243 19.0698 4.92996ZM17.6598 17.66C16.3519 18.9694 14.6304 19.7848 12.7886 19.9673C10.9469 20.1497 9.09884 19.688 7.55936 18.6607C6.01987 17.6334 4.88419 16.1042 4.34581 14.3334C3.80742 12.5627 3.89964 10.6601 4.60675 8.94974C5.31386 7.23938 6.59211 5.82711 8.22373 4.95352C9.85534 4.07993 11.7394 3.79909 13.5548 4.15883C15.3703 4.51857 17.0049 5.49665 18.1801 6.92642C19.3553 8.35619 19.9984 10.1492 19.9998 12C20.0034 13.0512 19.7984 14.0928 19.3968 15.0643C18.9951 16.0359 18.4047 16.9181 17.6598 17.66Z"
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
</svg>
|
|
72
|
+
|
|
73
|
+
This is an error message
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
exports[`Field Message Component renders with default values 1`] = `
|
|
79
|
+
<div>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
<div
|
|
84
|
+
class="ct-field-message ct-theme-light ct-field-message--information "
|
|
85
|
+
>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
<svg
|
|
89
|
+
aria-hidden="true"
|
|
90
|
+
class="ct-icon ct-icon--size-regular ct-field-message__icon"
|
|
91
|
+
height="24"
|
|
92
|
+
role="img"
|
|
93
|
+
viewBox="0 0 24 24"
|
|
94
|
+
width="24"
|
|
95
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
96
|
+
>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<path
|
|
100
|
+
d="M12 11C11.7348 11 11.4804 11.1054 11.2929 11.2929C11.1054 11.4804 11 11.7348 11 12V16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16V12C13 11.7348 12.8946 11.4804 12.7071 11.2929C12.5196 11.1054 12.2652 11 12 11ZM12.38 7.08C12.1365 6.97998 11.8635 6.97998 11.62 7.08C11.4973 7.12759 11.3851 7.19896 11.29 7.29C11.2017 7.3872 11.1306 7.49882 11.08 7.62C11.024 7.73868 10.9966 7.86882 11 8C10.9992 8.13161 11.0245 8.26207 11.0742 8.38391C11.124 8.50574 11.1973 8.61656 11.29 8.71C11.3872 8.79833 11.4988 8.86936 11.62 8.92C11.7715 8.98224 11.936 9.00632 12.099 8.99011C12.2619 8.97391 12.4184 8.91792 12.5547 8.82707C12.691 8.73622 12.8029 8.61328 12.8805 8.46907C12.9582 8.32486 12.9992 8.16378 13 8C12.9963 7.73523 12.8927 7.48163 12.71 7.29C12.6149 7.19896 12.5028 7.12759 12.38 7.08ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z"
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
</svg>
|
|
105
|
+
|
|
106
|
+
This is a message
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
exports[`Field Message Component renders with icons 1`] = `
|
|
112
|
+
<div>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
<div
|
|
117
|
+
class="ct-field-message ct-theme-light ct-field-message--warning "
|
|
118
|
+
>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
<svg
|
|
122
|
+
aria-hidden="true"
|
|
123
|
+
class="ct-icon ct-icon--size-regular ct-field-message__icon"
|
|
124
|
+
height="24"
|
|
125
|
+
role="img"
|
|
126
|
+
viewBox="0 0 24 24"
|
|
127
|
+
width="24"
|
|
128
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
129
|
+
>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<path
|
|
133
|
+
d="M12 7C11.7348 7 11.4804 7.10536 11.2929 7.29289C11.1054 7.48043 11 7.73478 11 8V12C11 12.2652 11.1054 12.5196 11.2929 12.7071C11.4804 12.8946 11.7348 13 12 13C12.2652 13 12.5196 12.8946 12.7071 12.7071C12.8946 12.5196 13 12.2652 13 12V8C13 7.73478 12.8946 7.48043 12.7071 7.29289C12.5196 7.10536 12.2652 7 12 7ZM12.92 15.62C12.8981 15.5563 12.8679 15.4957 12.83 15.44L12.71 15.29C12.5694 15.1512 12.3908 15.0572 12.1968 15.0199C12.0028 14.9825 11.8021 15.0034 11.62 15.08C11.4988 15.1306 11.3872 15.2017 11.29 15.29C11.1973 15.3834 11.124 15.4943 11.0742 15.6161C11.0245 15.7379 10.9992 15.8684 11 16C11.0016 16.1307 11.0288 16.2598 11.08 16.38C11.1249 16.5041 11.1966 16.6168 11.2899 16.7101C11.3832 16.8034 11.4959 16.8751 11.62 16.92C11.7397 16.9729 11.8691 17.0002 12 17.0002C12.1309 17.0002 12.2603 16.9729 12.38 16.92C12.5041 16.8751 12.6168 16.8034 12.7101 16.7101C12.8034 16.6168 12.8751 16.5041 12.92 16.38C12.9712 16.2598 12.9984 16.1307 13 16C13.0049 15.9334 13.0049 15.8666 13 15.8C12.9828 15.7362 12.9558 15.6755 12.92 15.62ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z"
|
|
134
|
+
/>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
</svg>
|
|
138
|
+
|
|
139
|
+
This is a warning message
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
`;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CivicTheme Field Message component styles.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
@use 'sass:map';
|
|
6
|
+
@use 'sass:math';
|
|
7
|
+
|
|
8
|
+
//
|
|
9
|
+
// Mixins.
|
|
10
|
+
//
|
|
11
|
+
|
|
12
|
+
.ct-field-message {
|
|
13
|
+
$root: &;
|
|
14
|
+
$_padding: ct-spacing();
|
|
15
|
+
|
|
16
|
+
display: block;
|
|
17
|
+
border-radius: var(--ct-field-message-border-radius);
|
|
18
|
+
padding: $_padding;
|
|
19
|
+
border-width: ct-particle(0.125);
|
|
20
|
+
border-style: solid;
|
|
21
|
+
|
|
22
|
+
@include ct-typography('text-regular');
|
|
23
|
+
|
|
24
|
+
#{$root}__icon {
|
|
25
|
+
vertical-align: top;
|
|
26
|
+
|
|
27
|
+
@include ct-icon-align-with-text('text-regular');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
$map: (
|
|
31
|
+
'information': (
|
|
32
|
+
'light': (
|
|
33
|
+
'color': var(--ct-field-message-light-information-color),
|
|
34
|
+
'background-color': var(--ct-field-message-light-information-background-color),
|
|
35
|
+
'border-color': var(--ct-field-message-light-information-border-color),
|
|
36
|
+
'icon-color': var(--ct-field-message-light-information-icon-color),
|
|
37
|
+
),
|
|
38
|
+
'dark': (
|
|
39
|
+
'color': var(--ct-field-message-dark-information-color),
|
|
40
|
+
'background-color': var(--ct-field-message-dark-information-background-color),
|
|
41
|
+
'border-color': var(--ct-field-message-dark-information-border-color),
|
|
42
|
+
'icon-color': var(--ct-field-message-dark-information-icon-color),
|
|
43
|
+
)
|
|
44
|
+
),
|
|
45
|
+
'warning': (
|
|
46
|
+
'light': (
|
|
47
|
+
'color': var(--ct-field-message-light-warning-color),
|
|
48
|
+
'background-color': var(--ct-field-message-light-warning-background-color),
|
|
49
|
+
'border-color': var(--ct-field-message-light-warning-border-color),
|
|
50
|
+
'icon-color': var(--ct-field-message-light-warning-icon-color),
|
|
51
|
+
),
|
|
52
|
+
'dark': (
|
|
53
|
+
'color': var(--ct-field-message-dark-warning-color),
|
|
54
|
+
'background-color': var(--ct-field-message-dark-warning-background-color),
|
|
55
|
+
'border-color': var(--ct-field-message-dark-warning-border-color),
|
|
56
|
+
'icon-color': var(--ct-field-message-dark-warning-icon-color),
|
|
57
|
+
)
|
|
58
|
+
),
|
|
59
|
+
'error': (
|
|
60
|
+
'light': (
|
|
61
|
+
'color': var(--ct-field-message-light-error-color),
|
|
62
|
+
'background-color': var(--ct-field-message-light-error-background-color),
|
|
63
|
+
'border-color': var(--ct-field-message-light-error-border-color),
|
|
64
|
+
'icon-color': var(--ct-field-message-light-error-icon-color),
|
|
65
|
+
),
|
|
66
|
+
'dark': (
|
|
67
|
+
'color': var(--ct-field-message-dark-error-color),
|
|
68
|
+
'background-color': var(--ct-field-message-dark-error-background-color),
|
|
69
|
+
'border-color': var(--ct-field-message-dark-error-border-color),
|
|
70
|
+
'icon-color': var(--ct-field-message-dark-error-icon-color),
|
|
71
|
+
)
|
|
72
|
+
),
|
|
73
|
+
'success': (
|
|
74
|
+
'light': (
|
|
75
|
+
'color': var(--ct-field-message-light-success-color),
|
|
76
|
+
'background-color': var(--ct-field-message-light-success-background-color),
|
|
77
|
+
'border-color': var(--ct-field-message-light-success-border-color),
|
|
78
|
+
'icon-color': var(--ct-field-message-light-success-icon-color),
|
|
79
|
+
),
|
|
80
|
+
'dark': (
|
|
81
|
+
'color': var(--ct-field-message-dark-success-color),
|
|
82
|
+
'background-color': var(--ct-field-message-dark-success-background-color),
|
|
83
|
+
'border-color': var(--ct-field-message-dark-success-border-color),
|
|
84
|
+
'icon-color': var(--ct-field-message-dark-success-icon-color),
|
|
85
|
+
)
|
|
86
|
+
),
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
@each $type, $type-map in $map {
|
|
90
|
+
&#{$root}--#{$type} {
|
|
91
|
+
@each $theme, $values in $type-map {
|
|
92
|
+
&.ct-theme-#{$theme} {
|
|
93
|
+
background-color: map.get($values, 'background-color');
|
|
94
|
+
color: map.get($values, 'color');
|
|
95
|
+
border-color: map.get($values, 'border-color');
|
|
96
|
+
|
|
97
|
+
#{$root}__icon {
|
|
98
|
+
color: map.get($values, 'icon-color');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
a:not(.ct-link.ct-theme-light):not(.ct-link.ct-theme-dark) {
|
|
102
|
+
color: inherit;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CivicTheme Field Message component stories.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import Component from './field-message.twig';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Atoms/Form Controls/Field Message',
|
|
9
|
+
component: Component,
|
|
10
|
+
argTypes: {
|
|
11
|
+
theme: {
|
|
12
|
+
control: { type: 'radio' },
|
|
13
|
+
options: ['light', 'dark'],
|
|
14
|
+
},
|
|
15
|
+
type: {
|
|
16
|
+
control: { type: 'radio' },
|
|
17
|
+
options: ['error', 'information', 'warning', 'success'],
|
|
18
|
+
},
|
|
19
|
+
content: {
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
},
|
|
22
|
+
modifier_class: {
|
|
23
|
+
control: { type: 'text' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
export const FieldMessage = {
|
|
31
|
+
parameters: {
|
|
32
|
+
layout: 'centered',
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
theme: 'light',
|
|
36
|
+
type: 'error',
|
|
37
|
+
content: 'Field message content sample.',
|
|
38
|
+
modifier_class: '',
|
|
39
|
+
attributes: null,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import DrupalAttribute from 'drupal-attribute';
|
|
2
|
+
|
|
3
|
+
const template = 'components/01-atoms/field-message/field-message.twig';
|
|
4
|
+
|
|
5
|
+
describe('Field Message Component', () => {
|
|
6
|
+
test('renders with default values', async () => {
|
|
7
|
+
const c = await dom(template, {
|
|
8
|
+
content: 'This is a message',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
expect(c.querySelectorAll('.ct-field-message.ct-theme-light.ct-field-message--information')).toHaveLength(1);
|
|
12
|
+
expect(c.querySelector('.ct-field-message').textContent.trim()).toEqual('This is a message');
|
|
13
|
+
|
|
14
|
+
assertUniqueCssClasses(c);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('renders with custom theme and type', async () => {
|
|
18
|
+
const c = await dom(template, {
|
|
19
|
+
content: 'This is an error message',
|
|
20
|
+
theme: 'dark',
|
|
21
|
+
type: 'error',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
expect(c.querySelectorAll('.ct-field-message.ct-theme-dark.ct-field-message--error')).toHaveLength(1);
|
|
25
|
+
expect(c.querySelector('.ct-field-message').textContent.trim()).toEqual('This is an error message');
|
|
26
|
+
|
|
27
|
+
assertUniqueCssClasses(c);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('renders with additional attributes and classes', async () => {
|
|
31
|
+
const c = await dom(template, {
|
|
32
|
+
content: 'This is a message',
|
|
33
|
+
attributes: new DrupalAttribute().setAttribute('data-test', 'true'),
|
|
34
|
+
modifier_class: 'custom-modifier',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
expect(c.querySelectorAll('.ct-field-message.ct-theme-light.ct-field-message--information.custom-modifier')).toHaveLength(1);
|
|
38
|
+
expect(c.querySelector('.ct-field-message').getAttribute('data-test')).toEqual('true');
|
|
39
|
+
expect(c.querySelector('.ct-field-message').textContent.trim()).toEqual('This is a message');
|
|
40
|
+
|
|
41
|
+
assertUniqueCssClasses(c);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('does not render when content is empty', async () => {
|
|
45
|
+
const c = await dom(template, {
|
|
46
|
+
content: '',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
expect(c.querySelectorAll('.ct-field-message')).toHaveLength(0);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('renders with icons', async () => {
|
|
53
|
+
const c = await dom(template, {
|
|
54
|
+
content: 'This is a warning message',
|
|
55
|
+
type: 'warning',
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
expect(c.querySelectorAll('.ct-field-message.ct-theme-light.ct-field-message--warning')).toHaveLength(1);
|
|
59
|
+
expect(c.querySelector('.ct-field-message').textContent.trim()).toEqual('This is a warning message');
|
|
60
|
+
expect(c.querySelectorAll('.ct-field-message__icon')).toHaveLength(1);
|
|
61
|
+
|
|
62
|
+
assertUniqueCssClasses(c);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* CivicTheme Field Message component.
|
|
5
|
+
*
|
|
6
|
+
* Props:
|
|
7
|
+
* - theme: [string] Theme variation (light or dark).
|
|
8
|
+
* - content: [string] The message content.
|
|
9
|
+
* - type: [string] Message type (error, information, warning, success).
|
|
10
|
+
* - modifier_class: [string] Additional CSS classes.
|
|
11
|
+
* - attributes: [Drupal\Core\Template\Attribute] Additional HTML attributes.
|
|
12
|
+
*/
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
{% set theme_class = 'ct-theme-%s'|format(theme|default('light')) %}
|
|
16
|
+
{% set type = type in ['error', 'information', 'warning', 'success'] ? type : 'information' %}
|
|
17
|
+
{% set type_class = 'ct-field-message--%s'|format(type|default('information')) %}
|
|
18
|
+
{% set modifier_class = '%s %s %s'|format(theme_class, type_class, modifier_class|default('')) %}
|
|
19
|
+
{% set icons = {
|
|
20
|
+
information: 'information-mark',
|
|
21
|
+
warning: 'exclamation-mark-3',
|
|
22
|
+
error: 'close-outline',
|
|
23
|
+
success: 'approve',
|
|
24
|
+
} %}
|
|
25
|
+
|
|
26
|
+
{% if content is not empty -%}
|
|
27
|
+
<div class="ct-field-message {{ modifier_class -}}" {% if attributes is defined and attributes is not null %}{{- attributes -}}{% endif %}>
|
|
28
|
+
{% if icons[type] is defined %}
|
|
29
|
+
{% include '@base/icon/icon.twig' with {
|
|
30
|
+
symbol: icons[type],
|
|
31
|
+
size: 'regular',
|
|
32
|
+
modifier_class: 'ct-field-message__icon',
|
|
33
|
+
} only %}
|
|
34
|
+
{% endif %}
|
|
35
|
+
{{- content -}}
|
|
36
|
+
</div>
|
|
37
|
+
{%- endif %}
|