@worksafevictoria/wcl7.5 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/.env +4 -0
- package/.eslintrc.cjs +10 -0
- package/.eslintrc.js +25 -0
- package/.husky/commit-msg +4 -0
- package/.prettierrc +5 -0
- package/.prettierrc.json +8 -0
- package/.storybook/main.js +18 -0
- package/.storybook/preview.js +34 -0
- package/LICENSE +21 -0
- package/README.md +159 -0
- package/babel.config.js +8 -0
- package/bin/clean.sh +52 -0
- package/bin/deploy.sh +25 -0
- package/ci/build/Build_Validation.md +35 -0
- package/ci/build/build_validation.yml +47 -0
- package/ci/release/Release_Beta.md +39 -0
- package/ci/release/Release_Master.md +29 -0
- package/ci/release/beta.yml +69 -0
- package/ci/release/master.yml +39 -0
- package/commitlint.config.js +1 -0
- package/index.html +13 -0
- package/jest.config.js +21 -0
- package/lib/detect-browser.js +33 -0
- package/lib/utility.js +59 -0
- package/lib/utility.test.js +15 -0
- package/package.json +93 -0
- package/public/favicon.ico +0 -0
- package/src/assets/base.css +86 -0
- package/src/assets/fonts/VIC-Bold.eot +0 -0
- package/src/assets/fonts/VIC-Bold.ttf +0 -0
- package/src/assets/fonts/VIC-Bold.woff +0 -0
- package/src/assets/fonts/VIC-Bold.woff2 +0 -0
- package/src/assets/fonts/VIC-BoldItalic.eot +0 -0
- package/src/assets/fonts/VIC-BoldItalic.ttf +0 -0
- package/src/assets/fonts/VIC-BoldItalic.woff +0 -0
- package/src/assets/fonts/VIC-BoldItalic.woff2 +0 -0
- package/src/assets/fonts/VIC-ExtraLight.eot +0 -0
- package/src/assets/fonts/VIC-ExtraLight.ttf +0 -0
- package/src/assets/fonts/VIC-ExtraLight.woff +0 -0
- package/src/assets/fonts/VIC-ExtraLight.woff2 +0 -0
- package/src/assets/fonts/VIC-ExtraLightItalic.eot +0 -0
- package/src/assets/fonts/VIC-ExtraLightItalic.ttf +0 -0
- package/src/assets/fonts/VIC-ExtraLightItalic.woff +0 -0
- package/src/assets/fonts/VIC-ExtraLightItalic.woff2 +0 -0
- package/src/assets/fonts/VIC-Italic.eot +0 -0
- package/src/assets/fonts/VIC-Italic.ttf +0 -0
- package/src/assets/fonts/VIC-Italic.woff +0 -0
- package/src/assets/fonts/VIC-Italic.woff2 +0 -0
- package/src/assets/fonts/VIC-Light.eot +0 -0
- package/src/assets/fonts/VIC-Light.ttf +0 -0
- package/src/assets/fonts/VIC-Light.woff +0 -0
- package/src/assets/fonts/VIC-Light.woff2 +0 -0
- package/src/assets/fonts/VIC-LightItalic.eot +0 -0
- package/src/assets/fonts/VIC-LightItalic.ttf +0 -0
- package/src/assets/fonts/VIC-LightItalic.woff +0 -0
- package/src/assets/fonts/VIC-LightItalic.woff2 +0 -0
- package/src/assets/fonts/VIC-Medium.eot +0 -0
- package/src/assets/fonts/VIC-Medium.ttf +0 -0
- package/src/assets/fonts/VIC-Medium.woff +0 -0
- package/src/assets/fonts/VIC-Medium.woff2 +0 -0
- package/src/assets/fonts/VIC-MediumItalic.eot +0 -0
- package/src/assets/fonts/VIC-MediumItalic.ttf +0 -0
- package/src/assets/fonts/VIC-MediumItalic.woff +0 -0
- package/src/assets/fonts/VIC-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/VIC-Regular.eot +0 -0
- package/src/assets/fonts/VIC-Regular.ttf +0 -0
- package/src/assets/fonts/VIC-Regular.woff +0 -0
- package/src/assets/fonts/VIC-Regular.woff2 +0 -0
- package/src/assets/fonts/VIC-SemiBold.eot +0 -0
- package/src/assets/fonts/VIC-SemiBold.ttf +0 -0
- package/src/assets/fonts/VIC-SemiBold.woff +0 -0
- package/src/assets/fonts/VIC-SemiBold.woff2 +0 -0
- package/src/assets/fonts/VIC-SemiBoldItalic.eot +0 -0
- package/src/assets/fonts/VIC-SemiBoldItalic.ttf +0 -0
- package/src/assets/fonts/VIC-SemiBoldItalic.woff +0 -0
- package/src/assets/fonts/VIC-SemiBoldItalic.woff2 +0 -0
- package/src/assets/icons/AppFooter/australian-aboriginal-flag.svg +7 -0
- package/src/assets/icons/AppFooter/facebook-ws-footer.svg +58 -0
- package/src/assets/icons/AppFooter/facebook-ww-footer.svg +59 -0
- package/src/assets/icons/AppFooter/instagram-ww-footer.svg +70 -0
- package/src/assets/icons/AppFooter/linkedin-ws-footer.svg +59 -0
- package/src/assets/icons/AppFooter/linkedin-ww-footer.svg +60 -0
- package/src/assets/icons/AppFooter/logo-workwell-reversed.svg +45 -0
- package/src/assets/icons/AppFooter/pride-flag.svg +12 -0
- package/src/assets/icons/AppFooter/torres-strait-islanders-flag.svg +9 -0
- package/src/assets/icons/AppFooter/twitter-ws-footer.svg +58 -0
- package/src/assets/icons/AppFooter/twitter-ww-footer.svg +59 -0
- package/src/assets/icons/AppFooter/worksafe-footer-logo.svg +9 -0
- package/src/assets/icons/AppFooter/youtube-ws-footer.svg +55 -0
- package/src/assets/icons/AppFooter/youtube-ww-footer.svg +56 -0
- package/src/assets/icons/AppHeader/chev-down-16.svg +17 -0
- package/src/assets/icons/AppHeader/chev-left-24px.svg +13 -0
- package/src/assets/icons/AppHeader/chev-right-16px.svg +25 -0
- package/src/assets/icons/AppHeader/chev-right-24px.svg +13 -0
- package/src/assets/icons/AppHeader/close-32px.svg +15 -0
- package/src/assets/icons/AppHeader/menu-32px.svg +20 -0
- package/src/assets/icons/AppHeader/search-32px.svg +19 -0
- package/src/assets/icons/Email-circle-black.svg +4 -0
- package/src/assets/icons/Info-circle-fill.svg +10 -0
- package/src/assets/icons/Phone-circle-black.svg +4 -0
- package/src/assets/icons/SocialShare/bookmark-white.svg +3 -0
- package/src/assets/icons/SocialShare/bookmark-ww-footer.svg +57 -0
- package/src/assets/icons/SocialShare/bookmark.svg +56 -0
- package/src/assets/icons/SocialShare/email-white.svg +3 -0
- package/src/assets/icons/SocialShare/facebook-white.svg +3 -0
- package/src/assets/icons/SocialShare/facebook-ws-footer.svg +58 -0
- package/src/assets/icons/SocialShare/facebook-ww-footer.svg +59 -0
- package/src/assets/icons/SocialShare/facebook.svg +1 -0
- package/src/assets/icons/SocialShare/office-file-pdf.svg +1 -0
- package/src/assets/icons/SocialShare/print.svg +3 -0
- package/src/assets/icons/SocialShare/twitter-white.svg +3 -0
- package/src/assets/icons/SocialShare/twitter-ws-footer.svg +58 -0
- package/src/assets/icons/SocialShare/twitter-ww-footer.svg +59 -0
- package/src/assets/icons/SocialShare/twitter.svg +1 -0
- package/src/assets/icons/Strip/AlertDismiss.svg +4 -0
- package/src/assets/icons/Strip/Arrow right.svg +4 -0
- package/src/assets/icons/Strip/Chevron right.svg +3 -0
- package/src/assets/icons/Strip/Dismiss.svg +4 -0
- package/src/assets/icons/Strip/Exclamation triangle fill.svg +8 -0
- package/src/assets/icons/Strip/Info circle fill.svg +15 -0
- package/src/assets/icons/Strip/Information.svg +15 -0
- package/src/assets/icons/Strip/Warning.svg +8 -0
- package/src/assets/icons/arrow-left.svg +9 -0
- package/src/assets/icons/arrow-right.svg +9 -0
- package/src/assets/icons/bookmark.svg +56 -0
- package/src/assets/icons/brand-VicStateGov-logo-reversed.svg +72 -0
- package/src/assets/icons/bullet-empty.svg +3 -0
- package/src/assets/icons/bullet.svg +3 -0
- package/src/assets/icons/caret-down.svg +1 -0
- package/src/assets/icons/caret-left.svg +9 -0
- package/src/assets/icons/caret-right.svg +9 -0
- package/src/assets/icons/caret-up.svg +1 -0
- package/src/assets/icons/chev-down-white.svg +3 -0
- package/src/assets/icons/chev-down.svg +3 -0
- package/src/assets/icons/chev-left.svg +3 -0
- package/src/assets/icons/chev-right.svg +3 -0
- package/src/assets/icons/chev-up.svg +3 -0
- package/src/assets/icons/clock.svg +3 -0
- package/src/assets/icons/close.svg +1 -0
- package/src/assets/icons/cross.svg +3 -0
- package/src/assets/icons/document.svg +1 -0
- package/src/assets/icons/earth.svg +1 -0
- package/src/assets/icons/email.svg +6 -0
- package/src/assets/icons/external-link-16px.svg +18 -0
- package/src/assets/icons/external-link.svg +4 -0
- package/src/assets/icons/icon-close.svg +15 -0
- package/src/assets/icons/instagram.svg +3 -0
- package/src/assets/icons/key.svg +3 -0
- package/src/assets/icons/location.svg +10 -0
- package/src/assets/icons/phone.svg +3 -0
- package/src/assets/icons/refresh.svg +3 -0
- package/src/assets/icons/right-arrow.svg +3 -0
- package/src/assets/icons/search.svg +5 -0
- package/src/assets/icons/tick.svg +3 -0
- package/src/assets/icons/video-play.svg +4 -0
- package/src/assets/images/hero-header-chevron.svg +9 -0
- package/src/assets/images/hero-header-mask.png +0 -0
- package/src/assets/images/hero-header-mask.svg +3 -0
- package/src/assets/logo.svg +1 -0
- package/src/assets/main.css +35 -0
- package/src/assets/styles/button.scss +206 -0
- package/src/assets/styles/focus.scss +4 -0
- package/src/assets/styles/generated-icons.scss +374 -0
- package/src/assets/styles/modal.scss +12 -0
- package/src/assets/styles/rtl.scss +8 -0
- package/src/assets/styles/storybook.scss +9 -0
- package/src/assets/styles/stylesheet.scss +7 -0
- package/src/assets/styles/webfonts.css +155 -0
- package/src/components/Common/CardGrid/cardgrid.stories.js +269 -0
- package/src/components/Common/CardGrid/index.vue +321 -0
- package/src/components/Common/CardGridItem/card-grid-item-caret.vue +164 -0
- package/src/components/Common/CardGridItem/card-grid-item-icon.vue +163 -0
- package/src/components/Common/CardGridItem/index.vue +848 -0
- package/src/components/Common/FilterButton/index.vue +93 -0
- package/src/components/Containers/Column/index.stories.js +35 -0
- package/src/components/Containers/Column/index.vue +14 -0
- package/src/components/Containers/Container/index.stories.js +13 -0
- package/src/components/Containers/Container/index.vue +15 -0
- package/src/components/Containers/HomepageHeader/index.stories.js +78 -0
- package/src/components/Containers/HomepageHeader/index.vue +186 -0
- package/src/components/Containers/Row/index.stories.js +12 -0
- package/src/components/Containers/Row/index.vue +14 -0
- package/src/components/Containers/SectionGroup/index.stories.js +148 -0
- package/src/components/Containers/SectionGroup/index.vue +310 -0
- package/src/components/Containers/Subheader/index.stories.js +74 -0
- package/src/components/Containers/Subheader/index.vue +149 -0
- package/src/components/Global/AlertStrip/index.stories.js +13 -0
- package/src/components/Global/AlertStrip/index.vue +145 -0
- package/src/components/Global/AlertStrip/styles.scss +78 -0
- package/src/components/Global/AppFooter/FooterSocialShare/index.vue +105 -0
- package/src/components/Global/AppFooter/FooterSocialShare/styles.scss +41 -0
- package/src/components/Global/AppFooter/index.stories.js +24 -0
- package/src/components/Global/AppFooter/index.vue +632 -0
- package/src/components/Global/AppFooter/storiesConst.js +110 -0
- package/src/components/Global/AppFooter/styles.scss +393 -0
- package/src/components/Global/AppHeader/ModalSearch/index.vue +66 -0
- package/src/components/Global/AppHeader/ModalSearch/styles.scss +43 -0
- package/src/components/Global/AppHeader/includes.scss +68 -0
- package/src/components/Global/AppHeader/index.stories.js +82 -0
- package/src/components/Global/AppHeader/index.vue +878 -0
- package/src/components/Global/AppHeader/mobile.scss +240 -0
- package/src/components/Global/AppHeader/styles.scss +371 -0
- package/src/components/Global/BackToTop/index.stories.js +18 -0
- package/src/components/Global/BackToTop/index.vue +67 -0
- package/src/components/Global/BackToTop/styles.scss +46 -0
- package/src/components/Global/ContrastMode/index.stories.js +39 -0
- package/src/components/Global/ContrastMode/index.vue +308 -0
- package/src/components/Global/Cookies/Constants.js +72 -0
- package/src/components/Global/Cookies/index.storieshide.js +45 -0
- package/src/components/Global/Cookies/index.vue +453 -0
- package/src/components/Global/Cookies/styles.scss +259 -0
- package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +196 -0
- package/src/components/Global/DirectoryFilters/index.vue +176 -0
- package/src/components/Global/GlobalNotice/index.vue +266 -0
- package/src/components/Global/HeroHeader/index.stories.js +93 -0
- package/src/components/Global/HeroHeader/index.vue +343 -0
- package/src/components/Global/HeroHeader/styles.scss +480 -0
- package/src/components/Global/ProgressBar/index.stories.js +51 -0
- package/src/components/Global/ProgressBar/index.vue +58 -0
- package/src/components/Global/ProgressBar/styles.scss +116 -0
- package/src/components/Global/SocialShare/index.stories.js +18 -0
- package/src/components/Global/SocialShare/index.vue +318 -0
- package/src/components/Global/Strip/index.stories.js +70 -0
- package/src/components/Global/Strip/index.vue +357 -0
- package/src/components/HelloWorld.vue +44 -0
- package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +232 -0
- package/src/components/Paragraphs/Accordion/StepperItem/index.vue +274 -0
- package/src/components/Paragraphs/Accordion/index.stories.js +84 -0
- package/src/components/Paragraphs/Accordion/index.vue +202 -0
- package/src/components/Paragraphs/Breakout/index.stories.js +39 -0
- package/src/components/Paragraphs/Breakout/index.vue +115 -0
- package/src/components/Paragraphs/BrowseContent/index.stories.js +220 -0
- package/src/components/Paragraphs/BrowseContent/index.vue +298 -0
- package/src/components/Paragraphs/BrowseContent/switcher.vue +63 -0
- package/src/components/Paragraphs/Calculator/CardContainer/index.vue +278 -0
- package/src/components/Paragraphs/Calculator/CardContainer/styles.scss +152 -0
- package/src/components/Paragraphs/Calculator/Constants.js +246 -0
- package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +124 -0
- package/src/components/Paragraphs/Calculator/RiskLevel/styles.scss +73 -0
- package/src/components/Paragraphs/Calculator/index.stories.js +27 -0
- package/src/components/Paragraphs/Calculator/index.vue +284 -0
- package/src/components/Paragraphs/Calculator/styles.scss +49 -0
- package/src/components/Paragraphs/Directory/Records/CJ/index.vue +59 -0
- package/src/components/Paragraphs/Directory/Records/ISP/distance.js +46 -0
- package/src/components/Paragraphs/Directory/Records/ISP/index.vue +88 -0
- package/src/components/Paragraphs/Directory/Records/PRS/index.vue +59 -0
- package/src/components/Paragraphs/Directory/Records/PRS/recordContent.vue +91 -0
- package/src/components/Paragraphs/Directory/Records/PRS/recordDetails.vue +49 -0
- package/src/components/Paragraphs/Directory/Records/index.vue +203 -0
- package/src/components/Paragraphs/Directory/Records/styles.scss +129 -0
- package/src/components/Paragraphs/Directory/constants.js +79 -0
- package/src/components/Paragraphs/Directory/index.vue +334 -0
- package/src/components/Paragraphs/ListGroup/Constants.js +72 -0
- package/src/components/Paragraphs/ListGroup/Link/list-link.stories.js +71 -0
- package/src/components/Paragraphs/ListGroup/index.vue +333 -0
- package/src/components/Paragraphs/ListGroup/list-group.stories.js +64 -0
- package/src/components/Paragraphs/ListGroup/navigation-card.stories.js +66 -0
- package/src/components/Paragraphs/MarketingBanner/index.stories.js +65 -0
- package/src/components/Paragraphs/MarketingBanner/index.vue +118 -0
- package/src/components/Paragraphs/MarketingBanner/styles.scss +87 -0
- package/src/components/Paragraphs/ProofPoints/index.stories.js +173 -0
- package/src/components/Paragraphs/ProofPoints/index.vue +64 -0
- package/src/components/Paragraphs/RelatedInformation/index.stories.js +32 -0
- package/src/components/Paragraphs/RelatedInformation/index.vue +62 -0
- package/src/components/Paragraphs/RelatedInformation/styles.scss +50 -0
- package/src/components/Paragraphs/RichText/index.stories.js +393 -0
- package/src/components/Paragraphs/RichText/index.vue +113 -0
- package/src/components/Paragraphs/RichText/scss/base.scss +355 -0
- package/src/components/Paragraphs/RichText/scss/definition-list.scss +35 -0
- package/src/components/Paragraphs/RichText/scss/styled-list.scss +152 -0
- package/src/components/Paragraphs/RichText/scss/table.scss +85 -0
- package/src/components/Paragraphs/ScrollSpy/index.stories.js +184 -0
- package/src/components/Paragraphs/ScrollSpy/index.vue +147 -0
- package/src/components/Paragraphs/SelectableCards/Control/index.stories.js +29 -0
- package/src/components/Paragraphs/SelectableCards/cardbody.vue +25 -0
- package/src/components/Paragraphs/SelectableCards/cardtop.vue +113 -0
- package/src/components/Paragraphs/SelectableCards/index.stories.js +27 -0
- package/src/components/Paragraphs/SelectableCards/index.vue +116 -0
- package/src/components/Paragraphs/Statistics/index.stories.js +106 -0
- package/src/components/Paragraphs/Statistics/index.vue +95 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/cake-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/commute-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/fire_extinguisher-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/free_breakfast-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/portrait-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/storefront-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/tag_faces-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/index.stories.js +36 -0
- package/src/components/Paragraphs/TabbedCards/index.vue +393 -0
- package/src/components/Paragraphs/Tabs/index.stories.js +60 -0
- package/src/components/Paragraphs/Tabs/index.vue +127 -0
- package/src/components/Paragraphs/Tabs/styles.scss +150 -0
- package/src/components/Paragraphs/TabulatedData/Constants.js +158 -0
- package/src/components/Paragraphs/TabulatedData/index.stories.js +39 -0
- package/src/components/Paragraphs/TabulatedData/index.vue +145 -0
- package/src/components/Paragraphs/TaskFinder/index.stories.js +45 -0
- package/src/components/Paragraphs/TaskFinder/index.vue +192 -0
- package/src/components/Paragraphs/TaskFinder/pdf/index.vue +109 -0
- package/src/components/Paragraphs/TaskFinder/task-finder-column.vue +146 -0
- package/src/components/Paragraphs/TextMedia/MediaTypes/Image/index.vue +24 -0
- package/src/components/Paragraphs/TextMedia/MediaTypes/Video/index.vue +29 -0
- package/src/components/Paragraphs/TextMedia/index.stories.js +94 -0
- package/src/components/Paragraphs/TextMedia/index.vue +150 -0
- package/src/components/Paragraphs/VideoGrid/index.stories.js +167 -0
- package/src/components/Paragraphs/VideoGrid/index.vue +124 -0
- package/src/components/Paragraphs/VideoPlayer/index.stories.js +95 -0
- package/src/components/Paragraphs/VideoPlayer/index.vue +110 -0
- package/src/components/Paragraphs/Webform/index.stories.js +70 -0
- package/src/components/Paragraphs/Webform/index.vue +103 -0
- package/src/components/SubComponents/Breadcrumb/constants.js +15 -0
- package/src/components/SubComponents/Breadcrumb/index.stories.js +22 -0
- package/src/components/SubComponents/Breadcrumb/index.vue +91 -0
- package/src/components/SubComponents/CardGroup/cardbody.vue +109 -0
- package/src/components/SubComponents/CardGroup/cardtop.vue +106 -0
- package/src/components/SubComponents/CardGroup/index.stories.js +145 -0
- package/src/components/SubComponents/CardGroup/index.vue +297 -0
- package/src/components/SubComponents/CtaButton/index.stories.js +357 -0
- package/src/components/SubComponents/CtaButton/index.vue +256 -0
- package/src/components/SubComponents/FormAddressPostcode/index.stories.js +43 -0
- package/src/components/SubComponents/FormAddressPostcode/index.vue +314 -0
- package/src/components/SubComponents/FormInstance/index.stories.js +8 -0
- package/src/components/SubComponents/FormInstance/index.vue +12 -0
- package/src/components/SubComponents/GoogleSearch/index.stories.js +8 -0
- package/src/components/SubComponents/GoogleSearch/index.vue +405 -0
- package/src/components/SubComponents/Icon/README.md +40 -0
- package/src/components/SubComponents/Icon/example.js +41 -0
- package/src/components/SubComponents/Icon/index.stories.js +84 -0
- package/src/components/SubComponents/Icon/index.vue +127 -0
- package/src/components/SubComponents/Icon/styles.scss +38 -0
- package/src/components/SubComponents/Loading/index.stories.js +9 -0
- package/src/components/SubComponents/Loading/index.vue +15 -0
- package/src/components/SubComponents/MediaPlayer/index.stories.js +58 -0
- package/src/components/SubComponents/MediaPlayer/index.vue +69 -0
- package/src/components/SubComponents/Pagination/index.stories.js +119 -0
- package/src/components/SubComponents/Pagination/index.vue +184 -0
- package/src/components/SubComponents/Pagination/pagination.js +58 -0
- package/src/components/SubComponents/ResourceGroup/List/index.stories.js +268 -0
- package/src/components/SubComponents/ResourceGroup/cardbody.vue +221 -0
- package/src/components/SubComponents/ResourceGroup/cardfooter.vue +61 -0
- package/src/components/SubComponents/ResourceGroup/cardtop.vue +94 -0
- package/src/components/SubComponents/ResourceGroup/index.stories.js +268 -0
- package/src/components/SubComponents/ResourceGroup/index.vue +575 -0
- package/src/components/SubComponents/ResourceGroup/styles.scss +317 -0
- package/src/components/SubComponents/ResourceGroup/switcher.vue +63 -0
- package/src/components/SubComponents/Search/SearchListing/index.vue +217 -0
- package/src/components/SubComponents/Search/index.stories.js +43 -0
- package/src/components/SubComponents/Search/index.vue +238 -0
- package/src/components/SubComponents/SingleImage/index.stories.js +60 -0
- package/src/components/SubComponents/SingleImage/index.vue +98 -0
- package/src/components/SubComponents/VideoThumbnail/index.stories.js +41 -0
- package/src/components/SubComponents/VideoThumbnail/index.vue +239 -0
- package/src/components/TheWelcome.vue +88 -0
- package/src/components/WelcomeItem.vue +87 -0
- package/src/components/icons/IconCommunity.vue +7 -0
- package/src/components/icons/IconDocumentation.vue +7 -0
- package/src/components/icons/IconEcosystem.vue +7 -0
- package/src/components/icons/IconSupport.vue +7 -0
- package/src/components/icons/IconTooling.vue +19 -0
- package/src/includes/scss/all.scss +2 -0
- package/src/includes/scss/mixins/all.scss +6 -0
- package/src/includes/scss/mixins/src/focus.scss +38 -0
- package/src/includes/scss/mixins/src/fp.scss +31 -0
- package/src/includes/scss/mixins/src/grid.scss +125 -0
- package/src/includes/scss/mixins/src/mq.scss +30 -0
- package/src/includes/scss/mixins/src/rtl.scss +8 -0
- package/src/includes/scss/mixins/src/units.scss +110 -0
- package/src/includes/scss/vars/all.scss +2 -0
- package/src/includes/scss/vars/src/breakpoints.scss +20 -0
- package/src/includes/scss/vars/src/colors.module.scss +53 -0
- package/src/includes/scss/vars/src/colors.scss +53 -0
- package/src/index.js +116 -0
- package/src/main.js +18 -0
- package/src/mock/accordion.js +104 -0
- package/src/mock/app-header.js +683 -0
- package/src/mock/control-selectable-cards.js +58 -0
- package/src/mock/jest.svgtransformer.js +7 -0
- package/src/mock/list-group.js +46 -0
- package/src/mock/proof-points.js +55 -0
- package/src/mock/related-info.js +44 -0
- package/src/mock/selectable-cards.js +48 -0
- package/src/mock/statistics.js +63 -0
- package/src/mock/styleMock.js +1 -0
- package/src/mock/tabbed-cards.js +197 -0
- package/src/mock/task-finder.js +68 -0
- package/src/mock/video-grid.js +409 -0
- package/src/mock/video-media.js +51 -0
- package/src/public/places/api/v1/geocode/json +69 -0
- package/src/public/places/api/v1/place/autocomplete/json +226 -0
- package/stylelint.config.js +63 -0
- package/vite.config.js +19 -0
- package/vitest.config.js +14 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="wcl-search">
|
|
3
|
+
<div class="gcse-search"></div>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
mounted() {
|
|
10
|
+
// console.log('Component mounted')
|
|
11
|
+
this.setupCustomeStyle()
|
|
12
|
+
|
|
13
|
+
// Introduce a delay before setting up addEventListener
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
this.setupCustomAttr()
|
|
16
|
+
this.handleSearchResultLinkTitle()
|
|
17
|
+
}, 2000) // Adjust the delay time as needed
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
beforeDestroy() {
|
|
21
|
+
// Remove event listeners before the component is destroyed
|
|
22
|
+
const targetNode = document.querySelector('input[name="search"]')
|
|
23
|
+
const buttonNode = document.querySelector('button.gsc-search-button')
|
|
24
|
+
|
|
25
|
+
if (targetNode) {
|
|
26
|
+
// Add keyup.enter event listener
|
|
27
|
+
targetNode.removeEventListener('keyup', this.handleKeyUp)
|
|
28
|
+
buttonNode.removeEventListener('click', this.handleKeyUp)
|
|
29
|
+
}
|
|
30
|
+
const paginationNodes = document.querySelectorAll('.gsc-cursor-page')
|
|
31
|
+
paginationNodes.forEach((paginationNode) => {
|
|
32
|
+
paginationNode.removeEventListener('click', this.handleSearchResultTitle)
|
|
33
|
+
})
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
methods: {
|
|
37
|
+
// Method to customize google search style
|
|
38
|
+
setupCustomeStyle() {
|
|
39
|
+
const script = document.createElement('script')
|
|
40
|
+
script.async = true
|
|
41
|
+
script.src = 'https://cse.google.com/cse.js?cx=53b1506aa03c64160'
|
|
42
|
+
document.head.appendChild(script)
|
|
43
|
+
|
|
44
|
+
// Create a new style element
|
|
45
|
+
const style = document.createElement('style')
|
|
46
|
+
style.id = 'searchStyle' // Assign an ID to the style element
|
|
47
|
+
// The CSS we are going to inject
|
|
48
|
+
const cssVar = 'table.gssb_c {display: none !important;}'
|
|
49
|
+
// Inject the style element into the head
|
|
50
|
+
document.head.appendChild(style)
|
|
51
|
+
// Set the text content of the style element to the CSS text
|
|
52
|
+
style.textContent = cssVar
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// Method to add google search input attributes
|
|
56
|
+
setupCustomAttr() {
|
|
57
|
+
console.log('setupCustomInputAttr ...')
|
|
58
|
+
|
|
59
|
+
const targetNode = document.querySelector('input[name="search"]')
|
|
60
|
+
const buttonNode = document.querySelector('button.gsc-search-button')
|
|
61
|
+
|
|
62
|
+
if (targetNode) {
|
|
63
|
+
// Add keyup.enter event listener
|
|
64
|
+
targetNode.addEventListener('keyup', this.handleKeyUp)
|
|
65
|
+
buttonNode.addEventListener('click', this.handleKeyUp)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
this.setupPaginationEvent()
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
setupPaginationEvent() {
|
|
72
|
+
console.log('setupPaginationEvent ....')
|
|
73
|
+
// Introduce a delay before setting up addEventListener on pagination
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
this.handleSearchResultLinkTitle()
|
|
76
|
+
const paginationNodes = document.querySelectorAll('.gsc-cursor-page')
|
|
77
|
+
console.log('paginationNodes length ..', paginationNodes.length)
|
|
78
|
+
|
|
79
|
+
if (paginationNodes && paginationNodes.length > 0) {
|
|
80
|
+
console.log('FOUND PAGINATION ....', paginationNodes)
|
|
81
|
+
|
|
82
|
+
// Loop through each element and add a click event listener
|
|
83
|
+
paginationNodes.forEach((paginationNode) => {
|
|
84
|
+
// Check if the click event listener has already been added
|
|
85
|
+
if (!paginationNode.clickEventListenerAdded) {
|
|
86
|
+
// Add a click event listener
|
|
87
|
+
paginationNode.addEventListener(
|
|
88
|
+
'click',
|
|
89
|
+
this.handleSearchResultTitle
|
|
90
|
+
)
|
|
91
|
+
// Mark that the click event listener has been added
|
|
92
|
+
paginationNode.clickEventListenerAdded = true
|
|
93
|
+
console.log('Adding a click event listener')
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
}, 2000) // Adjust the delay time as needed
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
// Method to trim text after '|'
|
|
101
|
+
handleSearchResultTitle() {
|
|
102
|
+
//alert('handleSearchResultTitle ....')
|
|
103
|
+
this.setupPaginationEvent()
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
handleSearchResultLinkTitle() {
|
|
107
|
+
//alert('handleSearchResultLinkTitle ....')
|
|
108
|
+
// Get all targetNodes with class "a.gs-title"
|
|
109
|
+
var targetNodes = document.querySelectorAll('a.gs-title')
|
|
110
|
+
console.log('search list title targetNodes :- ', targetNodes)
|
|
111
|
+
|
|
112
|
+
// Loop through each element and hide the text after the "|"
|
|
113
|
+
targetNodes.forEach(function(element) {
|
|
114
|
+
// Get the text content
|
|
115
|
+
var text = element.textContent || element.innerText
|
|
116
|
+
|
|
117
|
+
// Find the index of the "|" symbol
|
|
118
|
+
var pipeIndex = text.indexOf('|')
|
|
119
|
+
console.log('text :- ', text)
|
|
120
|
+
// If the "|" symbol is found, update the text content to display only the part before "|"
|
|
121
|
+
if (pipeIndex !== -1) {
|
|
122
|
+
element.textContent = text.substring(0, pipeIndex).trim()
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
handleKeyUp(event) {
|
|
128
|
+
if (event.key === 'Enter' || event.type === 'click') {
|
|
129
|
+
let keyword = event.key
|
|
130
|
+
? event.target.value
|
|
131
|
+
: document.querySelector('input[name="search"]').value
|
|
132
|
+
|
|
133
|
+
// console.log('Enter key pressed. Value:', keyword)
|
|
134
|
+
|
|
135
|
+
// Check if the URL does not contain "/search"
|
|
136
|
+
if (keyword && !window.location.href.includes('/search')) {
|
|
137
|
+
let origin = window.location.origin
|
|
138
|
+
let hash = window.location.hash
|
|
139
|
+
let pathname = 'search'
|
|
140
|
+
let URL = origin + '/' + pathname + hash
|
|
141
|
+
// console.log('URL does not contains "/search" ...', URL)
|
|
142
|
+
window.location.assign(URL)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
this.setupPaginationEvent
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
</script>
|
|
151
|
+
<style lang="scss" scoped>
|
|
152
|
+
@import '../../../includes/scss/all';
|
|
153
|
+
|
|
154
|
+
.wcl-search {
|
|
155
|
+
:deep(form.gsc-search-box) {
|
|
156
|
+
position: relative;
|
|
157
|
+
display: -ms-flexbox;
|
|
158
|
+
display: flex;
|
|
159
|
+
-ms-flex-wrap: wrap;
|
|
160
|
+
flex-wrap: wrap;
|
|
161
|
+
-ms-flex-align: stretch;
|
|
162
|
+
align-items: stretch;
|
|
163
|
+
width: 100%;
|
|
164
|
+
}
|
|
165
|
+
:deep(.gsib_a) {
|
|
166
|
+
padding: 0 !important;
|
|
167
|
+
height: 56px;
|
|
168
|
+
}
|
|
169
|
+
:deep(.gsib_b) {
|
|
170
|
+
position: absolute;
|
|
171
|
+
right: 5px;
|
|
172
|
+
top: 15px;
|
|
173
|
+
}
|
|
174
|
+
:deep(.gcsc-more-maybe-branding-root) {
|
|
175
|
+
display: none;
|
|
176
|
+
}
|
|
177
|
+
:deep(table.gsc-input) {
|
|
178
|
+
position: relative;
|
|
179
|
+
}
|
|
180
|
+
:deep(td.gsc-input) {
|
|
181
|
+
border: none;
|
|
182
|
+
padding: 0;
|
|
183
|
+
width: 100%;
|
|
184
|
+
}
|
|
185
|
+
:deep(.gsc-input-box) {
|
|
186
|
+
border: none;
|
|
187
|
+
}
|
|
188
|
+
:deep(input.gsc-input) {
|
|
189
|
+
border-radius: 8px 0px 0px 8px;
|
|
190
|
+
border: 1px solid $gray !important;
|
|
191
|
+
border-right: 0 !important;
|
|
192
|
+
background: none !important;
|
|
193
|
+
color: #495057;
|
|
194
|
+
height: 56px !important;
|
|
195
|
+
position: relative;
|
|
196
|
+
-ms-flex: 1 1 auto;
|
|
197
|
+
flex: 1 1 auto;
|
|
198
|
+
padding: 0.375rem 0.75rem !important;
|
|
199
|
+
|
|
200
|
+
@media screen and (max-width: 320px) {
|
|
201
|
+
width: 220px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&:focus {
|
|
205
|
+
box-shadow: none;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
:deep(.gsc-search-button) {
|
|
209
|
+
display: -ms-flexbox;
|
|
210
|
+
display: flex;
|
|
211
|
+
margin-left: 0px;
|
|
212
|
+
height: 56px;
|
|
213
|
+
margin-top: 0px;
|
|
214
|
+
}
|
|
215
|
+
:deep(button.gsc-search-button) {
|
|
216
|
+
background: $orange;
|
|
217
|
+
border: none;
|
|
218
|
+
border-radius: 0px 8px 8px 0px;
|
|
219
|
+
color: $black;
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
height: 56px !important;
|
|
223
|
+
font-size: 16px;
|
|
224
|
+
font-weight: 700;
|
|
225
|
+
padding-right: 32px;
|
|
226
|
+
padding-left: 32px;
|
|
227
|
+
|
|
228
|
+
&:before {
|
|
229
|
+
content: 'Search';
|
|
230
|
+
}
|
|
231
|
+
@media screen and (max-width: 767px) {
|
|
232
|
+
margin-top: 6px;
|
|
233
|
+
}
|
|
234
|
+
@media screen and (max-width: 320px) {
|
|
235
|
+
padding-right: 16px;
|
|
236
|
+
padding-left: 16px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
svg {
|
|
240
|
+
fill: black;
|
|
241
|
+
height: 18px;
|
|
242
|
+
width: 18px;
|
|
243
|
+
margin-left: 10px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
:focus {
|
|
247
|
+
box-shadow: 0px;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
:deep(.gsst_a .gscb_a) {
|
|
252
|
+
color: #191919;
|
|
253
|
+
}
|
|
254
|
+
:deep(.gsc-result-info) {
|
|
255
|
+
color: #191919;
|
|
256
|
+
font-size: 16px;
|
|
257
|
+
font-weight: 400;
|
|
258
|
+
}
|
|
259
|
+
:deep(.gsc-above-wrapper-area) {
|
|
260
|
+
padding: 20px 0;
|
|
261
|
+
border-bottom: none;
|
|
262
|
+
}
|
|
263
|
+
/* search list start */
|
|
264
|
+
:deep(.gsc-url-top) {
|
|
265
|
+
display: none;
|
|
266
|
+
}
|
|
267
|
+
:deep(.gsc-table-result) {
|
|
268
|
+
line-height: 1.6;
|
|
269
|
+
padding: 0 5px;
|
|
270
|
+
font-size: 16px;
|
|
271
|
+
font-weight: 400;
|
|
272
|
+
width: 80%;
|
|
273
|
+
b {
|
|
274
|
+
color: #191919;
|
|
275
|
+
font-size: 16px;
|
|
276
|
+
font-weight: normal;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
:deep(.gsc-resultsRoot.gsc-tabData) {
|
|
280
|
+
width: 100%;
|
|
281
|
+
margin-left: auto;
|
|
282
|
+
margin-right: auto;
|
|
283
|
+
padding-left: 15px;
|
|
284
|
+
padding-right: 15px;
|
|
285
|
+
|
|
286
|
+
&:hover {
|
|
287
|
+
border: none;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
:deep(.gs-bidi-start-align.gs-snippet) {
|
|
291
|
+
color: #191919 !important;
|
|
292
|
+
line-height: 24px;
|
|
293
|
+
}
|
|
294
|
+
:deep(.gsc-thumbnail-inside) {
|
|
295
|
+
position: relative;
|
|
296
|
+
padding: 0;
|
|
297
|
+
|
|
298
|
+
&::after {
|
|
299
|
+
content: ' ';
|
|
300
|
+
position: absolute;
|
|
301
|
+
height: 16px;
|
|
302
|
+
width: 11px;
|
|
303
|
+
top: 5px;
|
|
304
|
+
right: 16px;
|
|
305
|
+
background-repeat: no-repeat;
|
|
306
|
+
background-image: url(../../../assets/icons/chev-right.svg);
|
|
307
|
+
background-size: 100%;
|
|
308
|
+
}
|
|
309
|
+
div.gs-title {
|
|
310
|
+
width: 90%;
|
|
311
|
+
margin-bottom: 12px;
|
|
312
|
+
overflow: visible;
|
|
313
|
+
}
|
|
314
|
+
a.gs-title {
|
|
315
|
+
color: #191919 !important;
|
|
316
|
+
font-weight: 700;
|
|
317
|
+
line-height: 24px;
|
|
318
|
+
font-size: 20px;
|
|
319
|
+
border: 3px solid transparent;
|
|
320
|
+
padding-left: 5px;
|
|
321
|
+
padding-right: 5px;
|
|
322
|
+
text-decoration: underline;
|
|
323
|
+
|
|
324
|
+
&:hover {
|
|
325
|
+
border: 3px solid #da47ff;
|
|
326
|
+
color: #006bff !important;
|
|
327
|
+
b {
|
|
328
|
+
color: #006bff !important;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
b {
|
|
333
|
+
color: #191919 !important;
|
|
334
|
+
font-size: 20px;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
:deep(.gsc-orderby-label) {
|
|
339
|
+
font-size: 16px;
|
|
340
|
+
font-weight: 700;
|
|
341
|
+
color: #191919;
|
|
342
|
+
}
|
|
343
|
+
:deep(.gsc-selected-option-container) {
|
|
344
|
+
background-color: white;
|
|
345
|
+
border-radius: 10px;
|
|
346
|
+
margin-top: 0px;
|
|
347
|
+
padding-top: 6px;
|
|
348
|
+
margin-right: 0;
|
|
349
|
+
margin-left: 4px;
|
|
350
|
+
padding-left: 20px;
|
|
351
|
+
padding-bottom: 6px;
|
|
352
|
+
height: 40px;
|
|
353
|
+
.gsc-selected-option {
|
|
354
|
+
font-size: 16px;
|
|
355
|
+
font-weight: 400;
|
|
356
|
+
line-height: 24px;
|
|
357
|
+
margin-right: 20px;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
:deep(.gsc-control-cse .gsc-option-selector) {
|
|
361
|
+
margin-top: 0;
|
|
362
|
+
margin-right: 10px;
|
|
363
|
+
}
|
|
364
|
+
:deep(.gsc-expansionArea > .gsc-webResult.gsc-result) {
|
|
365
|
+
border: 0;
|
|
366
|
+
flex: 0 0 100%;
|
|
367
|
+
max-width: 100%;
|
|
368
|
+
padding: 0;
|
|
369
|
+
&:first-child {
|
|
370
|
+
border-top: 1px solid #bababa;
|
|
371
|
+
}
|
|
372
|
+
> div {
|
|
373
|
+
border-bottom: 1px solid #bababa;
|
|
374
|
+
padding: 32px 0;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
:deep(.gsc-results .gsc-cursor-box .gsc-cursor-current-page) {
|
|
379
|
+
background-color: lightgrey;
|
|
380
|
+
}
|
|
381
|
+
:deep(.gsc-results .gsc-cursor-box .gsc-cursor-page) {
|
|
382
|
+
border: 1px solid grey;
|
|
383
|
+
color: #333333;
|
|
384
|
+
padding: 10px 12px;
|
|
385
|
+
border-radius: 5px;
|
|
386
|
+
font-size: 16px;
|
|
387
|
+
font-weight: 400;
|
|
388
|
+
}
|
|
389
|
+
:deep(.gsc-results .gsc-cursor-box) {
|
|
390
|
+
margin-top: 50px;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* search list end */
|
|
394
|
+
@include mq('xs') {
|
|
395
|
+
.not-extra-small-screen {
|
|
396
|
+
display: none;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
@media screen and (max-width: 767px) {
|
|
401
|
+
:deep(.gssb_c) {
|
|
402
|
+
width: 85% !important;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Icon
|
|
2
|
+
|
|
3
|
+
This component is used to render SVG icons.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Import the Icon component, and give it the URL path to the SVG file. When webpack builds the app, it extracts all those SVG files and puts them in one spritesheet. `<icon>` components will get rendered as an `<svg>` tag with a `<use xlink:href="">` to reference the correct area of the spritesheet.
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<template>
|
|
11
|
+
<div id="app">
|
|
12
|
+
<icon width="100" height="100" :glyph="Logo"></icon>
|
|
13
|
+
<icon width="100" height="100" :glyph="Close"></icon>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import Icon from './components/Icon';
|
|
19
|
+
import Logo from './assets/logo.svg';
|
|
20
|
+
import Close from './assets/close.svg';
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'app',
|
|
24
|
+
components: {
|
|
25
|
+
Icon,
|
|
26
|
+
},
|
|
27
|
+
data () {
|
|
28
|
+
return { Logo, Close };
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Implementation
|
|
35
|
+
|
|
36
|
+
SVGs are rendered to the browser using a spritesheet, to save bandwidth, load times and caching. The npm package `svg-sprite-loader` is used by babel to pull SVG assets out of component folders, bundle them together and use the correct `<use xlink:href>` reference on the rendered `<svg>`.
|
|
37
|
+
|
|
38
|
+
Hat tip to [joanmira.com](http://joanmira.com/vuejs-first-impression-and-how-to-work-with-svgs/) (note: tutorial a bit out of date, requires webpack 2+ config instead of webpack 1) and [`svg-sprite-loader`](https://github.com/kisenka/svg-sprite-loader).
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const template = `
|
|
2
|
+
<icon
|
|
3
|
+
width="40"
|
|
4
|
+
height="40"
|
|
5
|
+
glyph="icon"
|
|
6
|
+
/>
|
|
7
|
+
`
|
|
8
|
+
|
|
9
|
+
import icon from '../../../assets/icons/success.svg'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
component: 'icon',
|
|
13
|
+
props: {
|
|
14
|
+
glyph: icon,
|
|
15
|
+
width: 40,
|
|
16
|
+
height: 40
|
|
17
|
+
},
|
|
18
|
+
layout: {
|
|
19
|
+
container: true,
|
|
20
|
+
row: true
|
|
21
|
+
},
|
|
22
|
+
snippet: `
|
|
23
|
+
// Example.vue
|
|
24
|
+
<template>
|
|
25
|
+
<div>${template}</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
import { Icon } from 'worksafe-component-library'
|
|
29
|
+
import icon from '../../../assets/icons/success.svg'
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
components: { Icon },
|
|
33
|
+
data () {
|
|
34
|
+
return {
|
|
35
|
+
icon
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
`
|
|
41
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Layout components for presentation
|
|
2
|
+
import Icon from './index.vue'
|
|
3
|
+
import svg from '../../../assets/icons/instagram.svg?raw'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'SubComponents/Icon',
|
|
7
|
+
components: Icon,
|
|
8
|
+
argTypes: {
|
|
9
|
+
bordered: {
|
|
10
|
+
control: 'boolean'
|
|
11
|
+
},
|
|
12
|
+
glyph: {
|
|
13
|
+
control: ['object', 'text'],
|
|
14
|
+
table: { disable: true }
|
|
15
|
+
},
|
|
16
|
+
height: {
|
|
17
|
+
control: ['number', 'text'],
|
|
18
|
+
table: { disable: true }
|
|
19
|
+
},
|
|
20
|
+
inverted: {
|
|
21
|
+
control: 'boolean'
|
|
22
|
+
},
|
|
23
|
+
width: {
|
|
24
|
+
control: ['number', 'text'],
|
|
25
|
+
table: { disable: true }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const generate = (args) => ({
|
|
31
|
+
components: { Icon },
|
|
32
|
+
setup () {
|
|
33
|
+
return { args }
|
|
34
|
+
},
|
|
35
|
+
template: `
|
|
36
|
+
<div style="margin-top:15px" :style="{background: !args.inverted ? 'white' : 'grey'}">
|
|
37
|
+
<icon v-bind="args" />
|
|
38
|
+
</div>`
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
export const RegularIcon = generate.bind({})
|
|
42
|
+
RegularIcon.args = {
|
|
43
|
+
glyph: svg,
|
|
44
|
+
bordered: false,
|
|
45
|
+
height: 30,
|
|
46
|
+
inverted: false,
|
|
47
|
+
width: 30
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const Bordered = generate.bind({})
|
|
51
|
+
Bordered.args = {
|
|
52
|
+
glyph: svg,
|
|
53
|
+
bordered: true,
|
|
54
|
+
height: 30,
|
|
55
|
+
inverted: false,
|
|
56
|
+
width: 30
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const LargeIcon = generate.bind({})
|
|
60
|
+
LargeIcon.args = {
|
|
61
|
+
glyph: svg,
|
|
62
|
+
width: 120,
|
|
63
|
+
height: 60,
|
|
64
|
+
bordered: false,
|
|
65
|
+
inverted: false
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const Inverted = generate.bind({})
|
|
69
|
+
Inverted.args = {
|
|
70
|
+
glyph: svg,
|
|
71
|
+
width: 120,
|
|
72
|
+
height: 60,
|
|
73
|
+
inverted: true,
|
|
74
|
+
bordered: false
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const Url = generate.bind({})
|
|
78
|
+
Url.args = {
|
|
79
|
+
glyph: 'https://content-staging-v2.api.worksafe.vic.gov.au/core/misc/menu-expanded.png',
|
|
80
|
+
width: 120,
|
|
81
|
+
height: 60,
|
|
82
|
+
bordered: false,
|
|
83
|
+
inverted: false
|
|
84
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span :class="bordered ? ' iconWrapper--bordered' : ''">
|
|
3
|
+
<svg
|
|
4
|
+
v-if="!isHtml"
|
|
5
|
+
class="icon"
|
|
6
|
+
focusable="false"
|
|
7
|
+
aria-hidden="true"
|
|
8
|
+
:class="
|
|
9
|
+
className +
|
|
10
|
+
(first ? ' icon_first' : '') +
|
|
11
|
+
(last ? ' icon_last' : '') +
|
|
12
|
+
(inverted ? ' icon--inverted' : '')
|
|
13
|
+
"
|
|
14
|
+
:width="width"
|
|
15
|
+
:height="height"
|
|
16
|
+
:viewBox="glyph.viewBox"
|
|
17
|
+
:alt="iconAlt"
|
|
18
|
+
>
|
|
19
|
+
<use :xlink:href="'#' + glyph.id" />
|
|
20
|
+
</svg>
|
|
21
|
+
<!-- eslint-disable vue/no-v-html -->
|
|
22
|
+
<span v-if="isHtml && renderedSVG" v-html="renderedSVG"> </span>
|
|
23
|
+
</span>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import { detectBrowser } from '../../../../lib/detect-browser'
|
|
28
|
+
// TODO: Add .visually-hidden label prop
|
|
29
|
+
export default {
|
|
30
|
+
name: 'Icon',
|
|
31
|
+
props: {
|
|
32
|
+
className: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: ''
|
|
35
|
+
},
|
|
36
|
+
glyph: {
|
|
37
|
+
type: [Object, String],
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
width: {
|
|
41
|
+
type: [Number, String],
|
|
42
|
+
default: 32
|
|
43
|
+
},
|
|
44
|
+
height: {
|
|
45
|
+
// height is required in IE
|
|
46
|
+
// undefined type added in case height was going to be handled explicitly, check JobsAtHomeDay for more details
|
|
47
|
+
type: [Number, String],
|
|
48
|
+
default: 32
|
|
49
|
+
},
|
|
50
|
+
first: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
last: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
inverted: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
bordered: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
},
|
|
66
|
+
iconAlt: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: ''
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
renderedSVG: undefined
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
computed: {
|
|
77
|
+
isHtml() {
|
|
78
|
+
return this.glyph && typeof this.glyph === 'string'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
mounted() {
|
|
82
|
+
this.renderedSVG = this.getSvg()
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
getSvg() {
|
|
86
|
+
if (this.glyph) {
|
|
87
|
+
let icon
|
|
88
|
+
const content = String(this.glyph)
|
|
89
|
+
const isSVGTag = content.includes('<svg')
|
|
90
|
+
if (!isSVGTag) {
|
|
91
|
+
icon = document.createElement('img')
|
|
92
|
+
icon.src = content
|
|
93
|
+
} else {
|
|
94
|
+
if (window && navigator && detectBrowser(navigator) === 'IE') {
|
|
95
|
+
return this.glyph
|
|
96
|
+
} else {
|
|
97
|
+
const temp = document.createElement('div')
|
|
98
|
+
temp.innerHTML = content
|
|
99
|
+
icon = temp.querySelector('svg')
|
|
100
|
+
icon.removeAttribute('width')
|
|
101
|
+
icon.removeAttribute('height')
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (this.iconAlt) {
|
|
105
|
+
icon.setAttribute('alt', this.iconAlt)
|
|
106
|
+
}
|
|
107
|
+
icon.setAttribute('width', this.width)
|
|
108
|
+
icon.setAttribute('height', this.height)
|
|
109
|
+
const customClass =
|
|
110
|
+
this.className +
|
|
111
|
+
(this.first ? ' icon_first' : '') +
|
|
112
|
+
(this.last ? ' icon_last' : '') +
|
|
113
|
+
(this.inverted ? ' icon--inverted' : '')
|
|
114
|
+
icon.setAttribute('class', 'icon ' + customClass)
|
|
115
|
+
icon.setAttribute('focusable', false)
|
|
116
|
+
icon.setAttribute('aria-hidden', true)
|
|
117
|
+
return icon.outerHTML
|
|
118
|
+
}
|
|
119
|
+
return null
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<style lang="scss">
|
|
126
|
+
@import './styles';
|
|
127
|
+
</style>
|