@qhealth-design-system/core 1.0.38
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/.babelrc +15 -0
- package/.browserslistrc +5 -0
- package/.editorconfig +19 -0
- package/.eslintignore +1 -0
- package/.eslintrc +25 -0
- package/.gitattributes +2 -0
- package/.github/workflows/release_package.yml +103 -0
- package/CHANGELOG.md +14 -0
- package/README.md +534 -0
- package/dist/api/service_finder/schemas.json +1 -0
- package/dist/component-abstract.html +884 -0
- package/dist/component-accordion.html +1157 -0
- package/dist/component-banner.html +928 -0
- package/dist/component-banner_advanced.html +1524 -0
- package/dist/component-banner_basic.html +1189 -0
- package/dist/component-banner_intermediate.html +1288 -0
- package/dist/component-body.html +919 -0
- package/dist/component-breadcrumbs.html +881 -0
- package/dist/component-btn.html +829 -0
- package/dist/component-callout.html +964 -0
- package/dist/component-card_feature.html +1805 -0
- package/dist/component-card_multi_action.html +1965 -0
- package/dist/component-card_no_action.html +1632 -0
- package/dist/component-card_single_action.html +1772 -0
- package/dist/component-code.html +928 -0
- package/dist/component-footer.html +1131 -0
- package/dist/component-forms.html +1297 -0
- package/dist/component-global-elements.html +1243 -0
- package/dist/component-global_alert.html +891 -0
- package/dist/component-header.html +1155 -0
- package/dist/component-in_page_navigation.html +920 -0
- package/dist/component-internal_navigation.html +1097 -0
- package/dist/component-left_hand_navigation.html +995 -0
- package/dist/component-main_navigation.html +999 -0
- package/dist/component-mega_main_navigation.html +1145 -0
- package/dist/component-multi_column.html +1116 -0
- package/dist/component-page_alert.html +911 -0
- package/dist/component-pagination.html +971 -0
- package/dist/component-tag_list.html +979 -0
- package/dist/component-updated_date.html +778 -0
- package/dist/component-widgets.html +851 -0
- package/dist/components/_global/import.xml +95 -0
- package/dist/components/_global/manifest.json +11 -0
- package/dist/components/_global/presentation.js +50 -0
- package/dist/components/_global/static.html +30 -0
- package/dist/components/_template/import.xml +299 -0
- package/dist/components/_template/manifest.json +40 -0
- package/dist/components/_template/presentation.js +12 -0
- package/dist/components/_template/static.html +4 -0
- package/dist/components/abstract/import.xml +231 -0
- package/dist/components/abstract/manifest.json +29 -0
- package/dist/components/abstract/presentation.js +33 -0
- package/dist/components/abstract/static.html +9 -0
- package/dist/components/accordion/import.xml +1929 -0
- package/dist/components/accordion/manifest.json +427 -0
- package/dist/components/accordion/presentation.js +112 -0
- package/dist/components/accordion/static.html +56 -0
- package/dist/components/banner/import.xml +95 -0
- package/dist/components/banner/manifest.json +11 -0
- package/dist/components/banner/presentation.js +138 -0
- package/dist/components/banner/static.html +39 -0
- package/dist/components/banner_advanced/import.xml +1969 -0
- package/dist/components/banner_advanced/manifest.json +1450 -0
- package/dist/components/banner_advanced/presentation.js +564 -0
- package/dist/components/banner_advanced/static.html +159 -0
- package/dist/components/banner_basic/import.xml +907 -0
- package/dist/components/banner_basic/manifest.json +151 -0
- package/dist/components/banner_basic/presentation.js +325 -0
- package/dist/components/banner_basic/static.html +86 -0
- package/dist/components/banner_intermediate/import.xml +1473 -0
- package/dist/components/banner_intermediate/manifest.json +248 -0
- package/dist/components/banner_intermediate/presentation.js +410 -0
- package/dist/components/banner_intermediate/static.html +102 -0
- package/dist/components/body/import.xml +343 -0
- package/dist/components/body/manifest.json +46 -0
- package/dist/components/body/presentation.js +37 -0
- package/dist/components/body/static.html +5 -0
- package/dist/components/breadcrumbs/import.xml +95 -0
- package/dist/components/breadcrumbs/manifest.json +9 -0
- package/dist/components/breadcrumbs/presentation.js +99 -0
- package/dist/components/breadcrumbs/static.html +21 -0
- package/dist/components/callout/import.xml +953 -0
- package/dist/components/callout/manifest.json +121 -0
- package/dist/components/callout/presentation.js +103 -0
- package/dist/components/callout/static.html +10 -0
- package/dist/components/card_feature/import.xml +2355 -0
- package/dist/components/card_feature/manifest.json +1390 -0
- package/dist/components/card_feature/presentation.js +365 -0
- package/dist/components/card_feature/static.html +80 -0
- package/dist/components/card_multi_action/import.xml +1539 -0
- package/dist/components/card_multi_action/manifest.json +1314 -0
- package/dist/components/card_multi_action/presentation.js +638 -0
- package/dist/components/card_multi_action/static.html +120 -0
- package/dist/components/card_no_action/import.xml +1449 -0
- package/dist/components/card_no_action/manifest.json +1264 -0
- package/dist/components/card_no_action/presentation.js +454 -0
- package/dist/components/card_no_action/static.html +94 -0
- package/dist/components/card_single_action/import.xml +1539 -0
- package/dist/components/card_single_action/manifest.json +1273 -0
- package/dist/components/card_single_action/presentation.js +498 -0
- package/dist/components/card_single_action/static.html +103 -0
- package/dist/components/code/import.xml +569 -0
- package/dist/components/code/manifest.json +112 -0
- package/dist/components/code/presentation.js +124 -0
- package/dist/components/code/static.html +15 -0
- package/dist/components/footer/import.xml +95 -0
- package/dist/components/footer/manifest.json +9 -0
- package/dist/components/footer/presentation.js +409 -0
- package/dist/components/footer/static.html +146 -0
- package/dist/components/global_alert/import.xml +95 -0
- package/dist/components/global_alert/manifest.json +9 -0
- package/dist/components/global_alert/presentation.js +81 -0
- package/dist/components/global_alert/static.html +26 -0
- package/dist/components/header/import.xml +95 -0
- package/dist/components/header/manifest.json +11 -0
- package/dist/components/header/presentation.js +190 -0
- package/dist/components/header/static.html +158 -0
- package/dist/components/horizontal_rule/import.xml +547 -0
- package/dist/components/horizontal_rule/manifest.json +69 -0
- package/dist/components/horizontal_rule/presentation.js +50 -0
- package/dist/components/horizontal_rule/static.html +4 -0
- package/dist/components/in_page_navigation/import.xml +253 -0
- package/dist/components/in_page_navigation/manifest.json +35 -0
- package/dist/components/in_page_navigation/presentation.js +14 -0
- package/dist/components/in_page_navigation/static.html +13 -0
- package/dist/components/internal_navigation/import.xml +95 -0
- package/dist/components/internal_navigation/manifest.json +11 -0
- package/dist/components/internal_navigation/presentation.js +165 -0
- package/dist/components/internal_navigation/static.html +130 -0
- package/dist/components/left_hand_navigation/import.xml +299 -0
- package/dist/components/left_hand_navigation/manifest.json +40 -0
- package/dist/components/left_hand_navigation/presentation.js +178 -0
- package/dist/components/left_hand_navigation/static.html +64 -0
- package/dist/components/main_navigation/import.xml +95 -0
- package/dist/components/main_navigation/manifest.json +11 -0
- package/dist/components/main_navigation/presentation.js +150 -0
- package/dist/components/main_navigation/static.html +80 -0
- package/dist/components/mega_main_navigation/import.xml +95 -0
- package/dist/components/mega_main_navigation/manifest.json +9 -0
- package/dist/components/mega_main_navigation/presentation.js +380 -0
- package/dist/components/mega_main_navigation/static.html +153 -0
- package/dist/components/multi_column/import.xml +1631 -0
- package/dist/components/multi_column/manifest.json +233 -0
- package/dist/components/multi_column/presentation.js +249 -0
- package/dist/components/multi_column/static.html +36 -0
- package/dist/components/page_alert/import.xml +479 -0
- package/dist/components/page_alert/manifest.json +63 -0
- package/dist/components/page_alert/presentation.js +67 -0
- package/dist/components/page_alert/static.html +8 -0
- package/dist/components/pagination/import.xml +95 -0
- package/dist/components/pagination/manifest.json +42 -0
- package/dist/components/pagination/presentation.js +84 -0
- package/dist/components/pagination/static.html +5 -0
- package/dist/components/updated_date/import.xml +95 -0
- package/dist/components/updated_date/manifest.json +9 -0
- package/dist/components/updated_date/presentation.js +34 -0
- package/dist/components/updated_date/static.html +6 -0
- package/dist/components/widgets/import.xml +95 -0
- package/dist/components/widgets/manifest.json +9 -0
- package/dist/components/widgets/presentation.js +40 -0
- package/dist/components/widgets/static.html +0 -0
- package/dist/components.html +790 -0
- package/dist/externals/componentPreview.js +101 -0
- package/dist/externals/dsComponentLoader.js +410 -0
- package/dist/externals/esri-leaflet-vector.js +5 -0
- package/dist/externals/esri-leaflet.js +12 -0
- package/dist/externals/fb-handlebars.min.js +29 -0
- package/dist/externals/fb-typeahead.bundle.min.js +6 -0
- package/dist/externals/funnelback.autocompletion-2.6.0.js +678 -0
- package/dist/externals/getPagination.js +62 -0
- package/dist/externals/handlebars.min-v4.7.6.js +29 -0
- package/dist/externals/leaflet.js +6 -0
- package/dist/externals/populateDatastoreSim.js +381 -0
- package/dist/externals/tinymce_classes.css +62 -0
- package/dist/home.html +694 -0
- package/dist/index.html +710 -0
- package/dist/inner-with-nav.html +1853 -0
- package/dist/inner.html +671 -0
- package/dist/js/helpers.js +892 -0
- package/dist/js/main.js +55 -0
- package/dist/js/main.js.map +1 -0
- package/dist/js/runtime.js +2 -0
- package/dist/js/runtime.js.map +1 -0
- package/dist/main.css +918 -0
- package/dist/main.css.map +1 -0
- package/dist/mysource_files/ajax-loader.gif +0 -0
- package/dist/mysource_files/favicons/favicon.ico +0 -0
- package/dist/mysource_files/img/100x100.jpg +0 -0
- package/dist/mysource_files/img/600x260.jpg +0 -0
- package/dist/mysource_files/img/Heart-Pattern-Dark.png +0 -0
- package/dist/mysource_files/img/Heart-Pattern.png +0 -0
- package/dist/mysource_files/img/banner-background--desktop.png +0 -0
- package/dist/mysource_files/img/banner-background--mobile.png +0 -0
- package/dist/mysource_files/img/banner-bg.png +0 -0
- package/dist/mysource_files/img/banner.png +0 -0
- package/dist/mysource_files/img/card--brand.png +0 -0
- package/dist/mysource_files/img/card--components.png +0 -0
- package/dist/mysource_files/img/card--content.png +0 -0
- package/dist/mysource_files/img/header-logo-agov.png +0 -0
- package/dist/mysource_files/img/header-logo-qgov--dark.svg +63 -0
- package/dist/mysource_files/img/header-logo-qgov--light.svg +56 -0
- package/dist/mysource_files/img/header-logo-qgov--pre-dark.svg +56 -0
- package/dist/mysource_files/img/header-search.svg +3 -0
- package/dist/mysource_files/img/layers-2x.png +0 -0
- package/dist/mysource_files/img/layers.png +0 -0
- package/dist/mysource_files/img/marker-icon.png +0 -0
- package/dist/mysource_files/img/svg-icons.svg +155 -0
- package/dist/mysource_files/img/video-play.svg +3 -0
- package/dist/mysource_files/slick.eot +0 -0
- package/dist/mysource_files/slick.svg +14 -0
- package/dist/mysource_files/slick.ttf +0 -0
- package/dist/mysource_files/slick.woff +0 -0
- package/package-lock.json +14276 -0
- package/package.json +79 -0
- package/scripts/add_component.sh +109 -0
- package/src/assets/favicons/favicon.ico +0 -0
- package/src/assets/img/100x100.jpg +0 -0
- package/src/assets/img/600x260.jpg +0 -0
- package/src/assets/img/Heart-Pattern-Dark.png +0 -0
- package/src/assets/img/Heart-Pattern.png +0 -0
- package/src/assets/img/banner-background--desktop.png +0 -0
- package/src/assets/img/banner-background--mobile.png +0 -0
- package/src/assets/img/banner-bg.png +0 -0
- package/src/assets/img/banner.png +0 -0
- package/src/assets/img/card--brand.png +0 -0
- package/src/assets/img/card--components.png +0 -0
- package/src/assets/img/card--content.png +0 -0
- package/src/assets/img/header-logo-agov.png +0 -0
- package/src/assets/img/header-logo-qgov--dark.svg +63 -0
- package/src/assets/img/header-logo-qgov--light.svg +56 -0
- package/src/assets/img/header-logo-qgov--pre-dark.svg +56 -0
- package/src/assets/img/header-search.svg +3 -0
- package/src/assets/img/layers-2x.png +0 -0
- package/src/assets/img/layers.png +0 -0
- package/src/assets/img/marker-icon.png +0 -0
- package/src/assets/img/svg-icons.svg +155 -0
- package/src/assets/img/video-play.svg +3 -0
- package/src/components/_global/css/admin/component.scss +71 -0
- package/src/components/_global/css/body/component.scss +897 -0
- package/src/components/_global/css/btn/component.scss +564 -0
- package/src/components/_global/css/cta_links/component.scss +121 -0
- package/src/components/_global/css/direction_links/component.scss +196 -0
- package/src/components/_global/css/example/component.scss +54 -0
- package/src/components/_global/css/forms/control_inputs/component.scss +349 -0
- package/src/components/_global/css/forms/general/component.scss +298 -0
- package/src/components/_global/css/forms/select/component.scss +230 -0
- package/src/components/_global/css/forms/text/component.scss +402 -0
- package/src/components/_global/css/global.scss +42 -0
- package/src/components/_global/css/grid-12/component.scss +331 -0
- package/src/components/_global/css/headings/component.scss +172 -0
- package/src/components/_global/css/icons/component.scss +29 -0
- package/src/components/_global/css/link_columns/component.scss +194 -0
- package/src/components/_global/css/link_list/component.scss +37 -0
- package/src/components/_global/css/modal/component.scss +182 -0
- package/src/components/_global/css/slick/component.scss +25 -0
- package/src/components/_global/css/table/component.scss +211 -0
- package/src/components/_global/css/tabs/component.scss +43 -0
- package/src/components/_global/css/tags/component.scss +272 -0
- package/src/components/_global/css/user_location/component.scss +38 -0
- package/src/components/_global/css/version/component.scss +47 -0
- package/src/components/_global/html/component.hbs +108 -0
- package/src/components/_global/html/ds_component.hbs +30 -0
- package/src/components/_global/html/head.html +63 -0
- package/src/components/_global/html/scripts.html +58 -0
- package/src/components/_global/js/_polyfills/global.js +18 -0
- package/src/components/_global/js/animate/global.js +324 -0
- package/src/components/_global/js/forms/global.js +182 -0
- package/src/components/_global/js/global.js +302 -0
- package/src/components/_global/js/manifest.json +11 -0
- package/src/components/_global/js/modal/global.js +236 -0
- package/src/components/_global/js/slick/global.js +153 -0
- package/src/components/_global/js/tabs/global.js +305 -0
- package/src/components/_global/js/user_location/global.js +116 -0
- package/src/components/_template/css/component.scss +22 -0
- package/src/components/_template/html/component-page.html +85 -0
- package/src/components/_template/html/component.hbs +4 -0
- package/src/components/_template/js/global.js +6 -0
- package/src/components/_template/js/manifest.json +40 -0
- package/src/components/abstract/css/component.scss +91 -0
- package/src/components/abstract/html/component.hbs +9 -0
- package/src/components/abstract/js/manifest.json +29 -0
- package/src/components/accordion/css/component.scss +329 -0
- package/src/components/accordion/html/accordion-group.html +157 -0
- package/src/components/accordion/html/component.hbs +46 -0
- package/src/components/accordion/html/default.html +92 -0
- package/src/components/accordion/js/global.js +413 -0
- package/src/components/accordion/js/manifest.json +427 -0
- package/src/components/banner/css/component.scss +664 -0
- package/src/components/banner/html/component.hbs +52 -0
- package/src/components/banner/js/manifest.json +11 -0
- package/src/components/banner_advanced/css/component.scss +7 -0
- package/src/components/banner_advanced/html/component.hbs +213 -0
- package/src/components/banner_advanced/js/global.js +6 -0
- package/src/components/banner_advanced/js/manifest.json +1450 -0
- package/src/components/banner_basic/css/component.scss +52 -0
- package/src/components/banner_basic/html/component.hbs +130 -0
- package/src/components/banner_basic/js/global.js +6 -0
- package/src/components/banner_basic/js/manifest.json +151 -0
- package/src/components/banner_intermediate/css/component.scss +276 -0
- package/src/components/banner_intermediate/html/component.hbs +165 -0
- package/src/components/banner_intermediate/js/global.js +6 -0
- package/src/components/banner_intermediate/js/manifest.json +248 -0
- package/src/components/body/css/component.scss +16 -0
- package/src/components/body/html/component.hbs +5 -0
- package/src/components/body/js/manifest.json +46 -0
- package/src/components/breadcrumbs/css/component.scss +236 -0
- package/src/components/breadcrumbs/html/component.hbs +29 -0
- package/src/components/breadcrumbs/js/manifest.json +9 -0
- package/src/components/callout/css/component.scss +146 -0
- package/src/components/callout/html/component.hbs +28 -0
- package/src/components/callout/js/manifest.json +121 -0
- package/src/components/card_feature/css/component.scss +224 -0
- package/src/components/card_feature/html/component.hbs +129 -0
- package/src/components/card_feature/js/manifest.json +1390 -0
- package/src/components/card_multi_action/css/component.scss +229 -0
- package/src/components/card_multi_action/html/component.hbs +192 -0
- package/src/components/card_multi_action/js/manifest.json +1314 -0
- package/src/components/card_no_action/css/component.scss +551 -0
- package/src/components/card_no_action/html/component.hbs +127 -0
- package/src/components/card_no_action/js/global.js +6 -0
- package/src/components/card_no_action/js/manifest.json +1264 -0
- package/src/components/card_single_action/css/component.scss +164 -0
- package/src/components/card_single_action/html/component.hbs +161 -0
- package/src/components/card_single_action/js/manifest.json +1273 -0
- package/src/components/code/css/component.scss +355 -0
- package/src/components/code/html/component.hbs +84 -0
- package/src/components/code/js/global.js +160 -0
- package/src/components/code/js/manifest.json +112 -0
- package/src/components/footer/css/component.scss +437 -0
- package/src/components/footer/html/component.hbs +177 -0
- package/src/components/footer/js/manifest.json +9 -0
- package/src/components/global_alert/css/component.scss +169 -0
- package/src/components/global_alert/html/component.hbs +38 -0
- package/src/components/global_alert/js/global.js +39 -0
- package/src/components/global_alert/js/manifest.json +9 -0
- package/src/components/header/css/component.scss +697 -0
- package/src/components/header/html/component.hbs +186 -0
- package/src/components/header/js/global.js +188 -0
- package/src/components/header/js/manifest.json +11 -0
- package/src/components/horizontal_rule/css/component.scss +37 -0
- package/src/components/horizontal_rule/html/component.hbs +6 -0
- package/src/components/horizontal_rule/js/manifest.json +69 -0
- package/src/components/in_page_navigation/css/component.scss +54 -0
- package/src/components/in_page_navigation/html/component.hbs +17 -0
- package/src/components/in_page_navigation/js/global.js +51 -0
- package/src/components/in_page_navigation/js/manifest.json +35 -0
- package/src/components/internal_navigation/css/component.scss +437 -0
- package/src/components/internal_navigation/html/component.hbs +57 -0
- package/src/components/internal_navigation/js/manifest.json +11 -0
- package/src/components/left_hand_navigation/css/component.scss +280 -0
- package/src/components/left_hand_navigation/html/component.hbs +77 -0
- package/src/components/left_hand_navigation/js/global.js +36 -0
- package/src/components/left_hand_navigation/js/manifest.json +40 -0
- package/src/components/main_navigation/css/component.scss +706 -0
- package/src/components/main_navigation/html/component.hbs +87 -0
- package/src/components/main_navigation/js/global.js +373 -0
- package/src/components/main_navigation/js/manifest.json +11 -0
- package/src/components/mega_main_navigation/css/component.scss +535 -0
- package/src/components/mega_main_navigation/html/component.hbs +157 -0
- package/src/components/mega_main_navigation/js/global.js +170 -0
- package/src/components/mega_main_navigation/js/manifest.json +9 -0
- package/src/components/multi_column/css/component.scss +11 -0
- package/src/components/multi_column/html/component.hbs +98 -0
- package/src/components/multi_column/js/manifest.json +233 -0
- package/src/components/page_alert/css/component.scss +132 -0
- package/src/components/page_alert/html/component.hbs +26 -0
- package/src/components/page_alert/js/manifest.json +63 -0
- package/src/components/pagination/css/component.scss +196 -0
- package/src/components/pagination/html/component.hbs +41 -0
- package/src/components/pagination/html/default.html +30 -0
- package/src/components/pagination/js/manifest.json +42 -0
- package/src/components/search_box/css/component.scss +48 -0
- package/src/components/search_box/html/component.html +11 -0
- package/src/components/search_box/js/manifest.json +73 -0
- package/src/components/updated_date/css/component.scss +0 -0
- package/src/components/updated_date/html/component.hbs +31 -0
- package/src/components/updated_date/js/manifest.json +9 -0
- package/src/components/widgets/css/component.scss +82 -0
- package/src/components/widgets/html/component.hbs +19 -0
- package/src/components/widgets/html/default.html +4 -0
- package/src/components/widgets/js/current.json +483 -0
- package/src/components/widgets/js/manifest.json +9 -0
- package/src/components/widgets/js/site.json +358 -0
- package/src/data/current.json +522 -0
- package/src/data/current_admin.json +305 -0
- package/src/data/model_component.js +14 -0
- package/src/data/site.json +762 -0
- package/src/externals/componentPreview.js +101 -0
- package/src/externals/dsComponentLoader.js +410 -0
- package/src/externals/esri-leaflet-vector.js +5 -0
- package/src/externals/esri-leaflet.js +12 -0
- package/src/externals/fb-handlebars.min.js +29 -0
- package/src/externals/fb-typeahead.bundle.min.js +6 -0
- package/src/externals/funnelback.autocompletion-2.6.0.js +678 -0
- package/src/externals/getPagination.js +62 -0
- package/src/externals/handlebars.min-v4.7.6.js +29 -0
- package/src/externals/leaflet.js +6 -0
- package/src/externals/populateDatastoreSim.js +381 -0
- package/src/externals/tinymce_classes.css +62 -0
- package/src/helpers/Handlebars/appendIf.js +6 -0
- package/src/helpers/Handlebars/arrayLength.js +3 -0
- package/src/helpers/Handlebars/arrayWith.js +13 -0
- package/src/helpers/Handlebars/capitaliseFirst.js +8 -0
- package/src/helpers/Handlebars/charMax.js +8 -0
- package/src/helpers/Handlebars/checkIf.js +20 -0
- package/src/helpers/Handlebars/columnWidth.js +39 -0
- package/src/helpers/Handlebars/contains.js +7 -0
- package/src/helpers/Handlebars/createMap.js +19 -0
- package/src/helpers/Handlebars/dsMapFromID.js +8 -0
- package/src/helpers/Handlebars/dsMapFromProp.js +8 -0
- package/src/helpers/Handlebars/eachByName.js +18 -0
- package/src/helpers/Handlebars/eachDS.js +7 -0
- package/src/helpers/Handlebars/eachFrom.js +13 -0
- package/src/helpers/Handlebars/eachUpTo.js +8 -0
- package/src/helpers/Handlebars/eachWhen.js +33 -0
- package/src/helpers/Handlebars/formatDate.js +62 -0
- package/src/helpers/Handlebars/generateDates.js +74 -0
- package/src/helpers/Handlebars/getDistance.js +40 -0
- package/src/helpers/Handlebars/getObject.js +3 -0
- package/src/helpers/Handlebars/getParamaterByName.js +11 -0
- package/src/helpers/Handlebars/getPossibleValues.js +13 -0
- package/src/helpers/Handlebars/getProp.js +3 -0
- package/src/helpers/Handlebars/getTags.js +20 -0
- package/src/helpers/Handlebars/getTitle.js +4 -0
- package/src/helpers/Handlebars/ifAny.js +9 -0
- package/src/helpers/Handlebars/ifArray.js +3 -0
- package/src/helpers/Handlebars/ifCond.js +31 -0
- package/src/helpers/Handlebars/ifEqualsOrChained.js +12 -0
- package/src/helpers/Handlebars/ifProp.js +3 -0
- package/src/helpers/Handlebars/if_eq.js +9 -0
- package/src/helpers/Handlebars/inArray.js +8 -0
- package/src/helpers/Handlebars/isPage.js +7 -0
- package/src/helpers/Handlebars/itemAt.js +11 -0
- package/src/helpers/Handlebars/jsonParse.js +8 -0
- package/src/helpers/Handlebars/jsonStringify.js +3 -0
- package/src/helpers/Handlebars/listAZ.js +51 -0
- package/src/helpers/Handlebars/listAZOptions.js +34 -0
- package/src/helpers/Handlebars/listByClosest.js +60 -0
- package/src/helpers/Handlebars/listByClosestWithOffset.js +63 -0
- package/src/helpers/Handlebars/math.js +11 -0
- package/src/helpers/Handlebars/newLineToBreak.js +6 -0
- package/src/helpers/Handlebars/nonBreakingSpaces.js +6 -0
- package/src/helpers/Handlebars/objectFromSelect.js +21 -0
- package/src/helpers/Handlebars/partialReplace.js +9 -0
- package/src/helpers/Handlebars/printAccordion.js +24 -0
- package/src/helpers/Handlebars/replace.js +8 -0
- package/src/helpers/Handlebars/replaceMany.js +5 -0
- package/src/helpers/Handlebars/sizeFormat.js +11 -0
- package/src/helpers/Handlebars/split.js +6 -0
- package/src/helpers/Handlebars/toUpperCase.js +7 -0
- package/src/helpers/Handlebars/urldecode.js +3 -0
- package/src/helpers/Handlebars/urlencode.js +3 -0
- package/src/helpers/Handlebars/withinObject.js +13 -0
- package/src/html/component-abstract.html +86 -0
- package/src/html/component-accordion.html +87 -0
- package/src/html/component-banner.html +84 -0
- package/src/html/component-banner_advanced.html +97 -0
- package/src/html/component-banner_basic.html +163 -0
- package/src/html/component-banner_intermediate.html +91 -0
- package/src/html/component-body.html +116 -0
- package/src/html/component-breadcrumbs.html +88 -0
- package/src/html/component-btn.html +117 -0
- package/src/html/component-callout.html +86 -0
- package/src/html/component-card_feature.html +631 -0
- package/src/html/component-card_multi_action.html +793 -0
- package/src/html/component-card_no_action.html +521 -0
- package/src/html/component-card_single_action.html +631 -0
- package/src/html/component-code.html +84 -0
- package/src/html/component-footer.html +87 -0
- package/src/html/component-forms.html +585 -0
- package/src/html/component-global-elements.html +531 -0
- package/src/html/component-global_alert.html +87 -0
- package/src/html/component-header.html +88 -0
- package/src/html/component-in_page_navigation.html +109 -0
- package/src/html/component-internal_navigation.html +87 -0
- package/src/html/component-left_hand_navigation.html +85 -0
- package/src/html/component-main_navigation.html +87 -0
- package/src/html/component-mega_main_navigation.html +88 -0
- package/src/html/component-multi_column.html +86 -0
- package/src/html/component-page_alert.html +86 -0
- package/src/html/component-pagination.html +86 -0
- package/src/html/component-tag_list.html +340 -0
- package/src/html/component-updated_date.html +88 -0
- package/src/html/component-widgets.html +90 -0
- package/src/html/components.html +136 -0
- package/src/html/home.html +126 -0
- package/src/html/index.html +142 -0
- package/src/html/inner-with-nav.html +1126 -0
- package/src/html/inner.html +107 -0
- package/src/index.js +12 -0
- package/src/styles/global.scss +120 -0
- package/src/styles/imports/figma.scss +0 -0
- package/src/styles/imports/functions.scss +519 -0
- package/src/styles/imports/mixins.scss +658 -0
- package/src/styles/imports/placeholders.scss +68 -0
- package/src/styles/imports/utilities.scss +185 -0
- package/src/styles/imports/variables.scss +484 -0
- package/src/styles/postcss.config.js +4 -0
- package/webpack/JsonMergePlugin.js +35 -0
- package/webpack/PrecompilePlugin.js +369 -0
- package/webpack/webpack.common.js +151 -0
- package/webpack/webpack.dev.js +54 -0
- package/webpack/webpack.prod.js +70 -0
package/README.md
ADDED
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
# Queensland Design System
|
|
2
|
+
## This is a [stage] version and is not production ready
|
|
3
|
+
|
|
4
|
+
If you are using assets from this Repo, please send an email to [development team email] so we can add you to our change management communications list
|
|
5
|
+
(see example here: GitHub - qld-gov-au/qg-web-template: https://qld-gov-au.github.io/qg-web-template/?path=/docs/welcome--page)
|
|
6
|
+
|
|
7
|
+
An attached MIT (basic) licence with “THIS REPOSITORY (SOFTWARE) IS PROVIDED AS IS WITHOUT WARRANTY” - not currently used but I think we should move towards having appropriate license files
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
This boilerplate is the frontend starting point for design cutups and front end component development for the Queensland Design System.
|
|
12
|
+
|
|
13
|
+
## Table of Contents
|
|
14
|
+
#### [Getting Started](#getting-started-1)
|
|
15
|
+
- [Inclusions](#inclusions)
|
|
16
|
+
- [Requirements](#requirements)
|
|
17
|
+
- [Local Development](#local-development)
|
|
18
|
+
- [Building for production](#building-for-production)
|
|
19
|
+
|
|
20
|
+
#### [Component Development](#component-development-1)
|
|
21
|
+
- [Creating a new component](#creating-a-new-component)
|
|
22
|
+
- [Component data](#component-data-manifestjson)
|
|
23
|
+
- [Handlebars template](#handlebars-template-componenthbs)
|
|
24
|
+
- [Styling a component](#styling-a-component-componentscss)
|
|
25
|
+
- [Component JavaScript](#component-javascript-globaljs)
|
|
26
|
+
- [Updating / Previewing a component](#updating--previewing-a-component)
|
|
27
|
+
- [Build / Commit / Push](#build--commit--push)
|
|
28
|
+
- [Importing into Matrix](#importing-into-matrix)
|
|
29
|
+
|
|
30
|
+
#### [Advanced Features](#advanced-features-1)
|
|
31
|
+
- [Figma colour sync](#figma-colour-sync)
|
|
32
|
+
|
|
33
|
+
#### [General Boilerplate Features](#general-boilerplate-features-1)
|
|
34
|
+
- [Working in HTML Files](#working-in-html-files)
|
|
35
|
+
- [Working in SCSS Files](#working-in-scss-files)
|
|
36
|
+
- [Working in JS Files](#working-in-js-files)
|
|
37
|
+
|
|
38
|
+
## Getting Started
|
|
39
|
+
|
|
40
|
+
### Inclusions
|
|
41
|
+
When you first clone down the Design System, you automatically get the following:
|
|
42
|
+
- Sass compilation + Post CSS autoprefixer
|
|
43
|
+
- Templated components with HandlebarsJS
|
|
44
|
+
- Babel ES6 conversion
|
|
45
|
+
- ESLint
|
|
46
|
+
- Hot-reload HTML, CSS and JS
|
|
47
|
+
|
|
48
|
+
### Requirements
|
|
49
|
+
- Node 12.6.0
|
|
50
|
+
- NPM 6.9.0
|
|
51
|
+
|
|
52
|
+
### Local Development
|
|
53
|
+
|
|
54
|
+
First, install all the required packages:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
npm install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
To preview the Design System on your local machine, run the following command:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
npm run serve
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This will serve the website into memory in your browser, and will also automatically reload the page after any code changes are saved.
|
|
67
|
+
|
|
68
|
+
### Building for production
|
|
69
|
+
|
|
70
|
+
There are two commands you can run when compiling your code for production environments:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
npm run build
|
|
74
|
+
```
|
|
75
|
+
```
|
|
76
|
+
npm run build-min
|
|
77
|
+
```
|
|
78
|
+
Both of these commands will run through the configurations set up in `webpack.prod.js` to compile all of your HTML, CSS, and JavaScript for use on a production system.
|
|
79
|
+
|
|
80
|
+
Instead of just serving the site into memory in your browser with `npm run serve`, this will actually build your files into the /dist directory.
|
|
81
|
+
|
|
82
|
+
## Component development
|
|
83
|
+
### Creating a new component
|
|
84
|
+
All existing components are located in src/components, and you can find the base component template in src/components/_template. Run the command `npm run add-component` and follow the prompts to create a new component from this template.
|
|
85
|
+
|
|
86
|
+
**Please note:** If you've still got `npm run serve` running in another console window, you'll need to restart that process for Webpack to recognise it.
|
|
87
|
+
|
|
88
|
+
Each new component will include the following files, which will require updating:
|
|
89
|
+
* js/manifest.json - Define the data structure for your component (see below)
|
|
90
|
+
* html/component.hbs - Define the structure of your component using HandlebarsJS templating
|
|
91
|
+
* css/component.scss - Style your component using SASS
|
|
92
|
+
* js/global.js - Frontend JavaScript for your component (eg. toggling of accordions)
|
|
93
|
+
|
|
94
|
+
At the same time, the script will also automatically create a corresponding component HTML page at src/html/component-\[component-name\], which will allow you to preview the component via `npm run serve`.
|
|
95
|
+
|
|
96
|
+
For more details on each of these, see the sections below.
|
|
97
|
+
|
|
98
|
+
### Component data (manifest.json)
|
|
99
|
+
Step 1 after creating your new component is to define its data structure via its *manifest.json* file.
|
|
100
|
+
|
|
101
|
+
Use the **component** object to define some global properties (Eg. name, description, version etc.).
|
|
102
|
+
|
|
103
|
+
Then, use the **metadata** object inside the **data** object to define each of the various editable fields. For each field, ensure to define the type (eg. *metadata_field_text*) and a default value (see below for examples). Also note that the field name (ie. the object key) must be in 'snake_case' (ie. lowercase with underscores).
|
|
104
|
+
|
|
105
|
+
Here is an example from the existing **Banner Home** component:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
{
|
|
109
|
+
"component": {
|
|
110
|
+
"name": "Banner Home",
|
|
111
|
+
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
112
|
+
"version": "0",
|
|
113
|
+
"status": "Released",
|
|
114
|
+
"data": {
|
|
115
|
+
"metadata": {
|
|
116
|
+
"heading": {
|
|
117
|
+
"type": "metadata_field_text",
|
|
118
|
+
"description": "",
|
|
119
|
+
"friendly_name": "Heading",
|
|
120
|
+
"value": "Heading",
|
|
121
|
+
"required": false,
|
|
122
|
+
"editable": true
|
|
123
|
+
},
|
|
124
|
+
"background_image": {
|
|
125
|
+
"type": "metadata_field_related_asset",
|
|
126
|
+
"description": "",
|
|
127
|
+
"friendly_name": "Background Image (Default/Responsive)",
|
|
128
|
+
"value": "/mysource_files/banner-bg.png",
|
|
129
|
+
"required": false,
|
|
130
|
+
"editable": true
|
|
131
|
+
},
|
|
132
|
+
// More fields go here
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
You can also use the manifest file to configure certain fields for conditional display in the Matrix editing interface. These rules can be defined for each metadata field under the **display_if** property.
|
|
141
|
+
|
|
142
|
+
Below is an example showing the *background_image_alignment* field in the Banner Advanced component. In this particular case, if *background_type* is equal to 'image' OR 'image-multi', then we show the *background_image_alignment* field. Have a look at that component for more examples.
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
"background_image_alignment": {
|
|
147
|
+
"type": "metadata_field_select",
|
|
148
|
+
"description": "",
|
|
149
|
+
"friendly_name": "Background alignment",
|
|
150
|
+
"value": "center",
|
|
151
|
+
"options": {
|
|
152
|
+
"left": "Left",
|
|
153
|
+
"right": "Right",
|
|
154
|
+
"center": "Center"
|
|
155
|
+
},
|
|
156
|
+
"required": false,
|
|
157
|
+
"editable": true,
|
|
158
|
+
"display_if": {
|
|
159
|
+
"show": true,
|
|
160
|
+
"operator": "OR",
|
|
161
|
+
"rules": [{
|
|
162
|
+
"field": "background_type",
|
|
163
|
+
"operator": "equals",
|
|
164
|
+
"value": "image"
|
|
165
|
+
}, {
|
|
166
|
+
"field": "background_type",
|
|
167
|
+
"operator": "equals",
|
|
168
|
+
"value": "image-multi"
|
|
169
|
+
}]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
There are also two optional arrays available inside the component object (**children** and **assets**) that can be used for a component that lists multiple items (Eg. Cards or Tags).
|
|
176
|
+
|
|
177
|
+
To populate the **children** array, you need to create a field named **root_node** within the **metadata** object. In Matrix, the template will look for a field with this exact name. If it exists, it will automatically populate the **children** array with a JSON blob containing the ***%asset_data%*** of each ***child asset*** under that root_node.
|
|
178
|
+
|
|
179
|
+
See the Cards component for an example of this (example manifest.json below).
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
{
|
|
184
|
+
"component": {
|
|
185
|
+
"name": "Cards",
|
|
186
|
+
"description": "The card component is used to provide a brief summary of content or a task, often with a link to more detail. Cards are frequently displayed alongside other cards to group related content or tasks.",
|
|
187
|
+
"version": "1.0",
|
|
188
|
+
"status": "Released",
|
|
189
|
+
"data": {
|
|
190
|
+
"metadata": {
|
|
191
|
+
|
|
192
|
+
//... Other component metadata
|
|
193
|
+
|
|
194
|
+
"root_node": {
|
|
195
|
+
"type": "metadata_field_related_asset",
|
|
196
|
+
"description": "",
|
|
197
|
+
"friendly_name": "Parent asset",
|
|
198
|
+
"value": "",
|
|
199
|
+
"required": false,
|
|
200
|
+
"editable": true
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
// Automatically populated by children of the 'root_node'
|
|
206
|
+
"children": [{
|
|
207
|
+
"assetid": "22724",
|
|
208
|
+
"type_code": "page_redirect",
|
|
209
|
+
"version": "0.0.1",
|
|
210
|
+
"name": "Brand",
|
|
211
|
+
"short_name": "Brand",
|
|
212
|
+
"status": "2",
|
|
213
|
+
"languages": "en",
|
|
214
|
+
"charset": "utf-8",
|
|
215
|
+
"created": "2021-07-19 10:06:21",
|
|
216
|
+
"created_userid": "312",
|
|
217
|
+
"updated": "2021-07-19 10:16:04",
|
|
218
|
+
"updated_userid": "312",
|
|
219
|
+
"published": "Never",
|
|
220
|
+
"published_userid": "",
|
|
221
|
+
"status_changed": "2021-07-19 10:06:21",
|
|
222
|
+
"status_changed_userid": "312",
|
|
223
|
+
"thumbnail": "/mysource_files/card--brand.png",
|
|
224
|
+
"attributes": {
|
|
225
|
+
"short_name": {
|
|
226
|
+
"attrid": "2069",
|
|
227
|
+
"type": "text",
|
|
228
|
+
"value": "Brand",
|
|
229
|
+
"is_contextable": true,
|
|
230
|
+
"use_default": true
|
|
231
|
+
},
|
|
232
|
+
// ... All other attributes
|
|
233
|
+
},
|
|
234
|
+
"metadata": {
|
|
235
|
+
"description": {
|
|
236
|
+
"value": "",
|
|
237
|
+
"fieldid": "22261",
|
|
238
|
+
"type": "metadata_field_text",
|
|
239
|
+
"is_contextable": true,
|
|
240
|
+
"default_value": false,
|
|
241
|
+
"use_default": true
|
|
242
|
+
},
|
|
243
|
+
// ... All other metadata
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
// ... All other child assets
|
|
248
|
+
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
The second array available is the **assets** array. Instead of picking a parent node, this one is controlled by a related metadata field named **asset_select**. In Matrix, the template will look for a field with this exact name. If it exists, it will automatically populate the **assets** array with a JSON blob containing the ***%asset_data%*** of each selected asset in the **asset_select** field.
|
|
256
|
+
|
|
257
|
+
See the Tags List Linked component for an example of this (example manifest.json below).
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
{
|
|
261
|
+
"component": {
|
|
262
|
+
"name": "Tag List Linked",
|
|
263
|
+
"description": "Tags are a means of classifying content, typically using keywords or labels. They are added to a web page, an asset or other content to help users search for and find related content quickly and easily.",
|
|
264
|
+
"version": "0",
|
|
265
|
+
"status": "In Development",
|
|
266
|
+
"data": {
|
|
267
|
+
"metadata": {
|
|
268
|
+
|
|
269
|
+
// ... Other component metadata
|
|
270
|
+
|
|
271
|
+
"asset_select": {
|
|
272
|
+
"type": "metadata_field_related_asset",
|
|
273
|
+
"description": "",
|
|
274
|
+
"friendly_name": "Assets to link to",
|
|
275
|
+
"value": "1; 2; 3",
|
|
276
|
+
"required": false,
|
|
277
|
+
"editable": true
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
// Automatically populated by assets selected in 'asset_select'
|
|
283
|
+
"assets": [{
|
|
284
|
+
"assetid": "22724",
|
|
285
|
+
"type_code": "page_redirect",
|
|
286
|
+
"version": "0.0.1",
|
|
287
|
+
"name": "Brand",
|
|
288
|
+
"short_name": "Brand",
|
|
289
|
+
"status": "2",
|
|
290
|
+
"languages": "en",
|
|
291
|
+
"charset": "utf-8",
|
|
292
|
+
"created": "2021-07-19 10:06:21",
|
|
293
|
+
"created_userid": "312",
|
|
294
|
+
"updated": "2021-07-19 10:16:04",
|
|
295
|
+
"updated_userid": "312",
|
|
296
|
+
"published": "Never",
|
|
297
|
+
"published_userid": "",
|
|
298
|
+
"status_changed": "2021-07-19 10:06:21",
|
|
299
|
+
"status_changed_userid": "312",
|
|
300
|
+
"thumbnail": "23802",
|
|
301
|
+
"attributes": {
|
|
302
|
+
"short_name": {
|
|
303
|
+
"attrid": "2069",
|
|
304
|
+
"type": "text",
|
|
305
|
+
"value": "Brand",
|
|
306
|
+
"is_contextable": true,
|
|
307
|
+
"use_default": true
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
// ... All other attributes
|
|
311
|
+
},
|
|
312
|
+
"metadata": {
|
|
313
|
+
"description": {
|
|
314
|
+
"value": "",
|
|
315
|
+
"fieldid": "22261",
|
|
316
|
+
"type": "metadata_field_text",
|
|
317
|
+
"is_contextable": true,
|
|
318
|
+
"default_value": false,
|
|
319
|
+
"use_default": true
|
|
320
|
+
},
|
|
321
|
+
|
|
322
|
+
// ... All other metadata
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
|
|
326
|
+
// ... All other selected assets
|
|
327
|
+
|
|
328
|
+
}]
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Handlebars template (component.hbs)
|
|
335
|
+
Use this file to define the overall template structure of your component using [HandlebarsJS](https://handlebarsjs.com/guide/).
|
|
336
|
+
|
|
337
|
+
Every component will have access to the **data** object defined in your *manifest.json* file, as well as global data values from **site** and **current** (ie. the current page). See examples of these at *src/data/site.json* and *src/data/current.json* respectively.
|
|
338
|
+
|
|
339
|
+
Here is an example from the existing **Accordion** component:
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
{{#ifCond globals.current.data.metadata.pageType.value '==' 'landing'}}
|
|
343
|
+
<section class="qld__body">
|
|
344
|
+
<div class="container-fluid">
|
|
345
|
+
{{/ifCond}}
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
{{#if data.heading.value}}
|
|
349
|
+
<h2>{{data.heading.value}}</h2>
|
|
350
|
+
{{/if}}
|
|
351
|
+
|
|
352
|
+
{{#if data.intro.value}}
|
|
353
|
+
{{{data.intro.value}}}
|
|
354
|
+
{{/if}}
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
<ul class="qld__accordion-group">
|
|
358
|
+
{{#each data}}
|
|
359
|
+
{{#ifCond this.type '==' 'metadata_field_wysiwyg'}}
|
|
360
|
+
{{#ifCond @key '!=' 'intro'}}
|
|
361
|
+
{{#ifCond this.value '!=' ''}}
|
|
362
|
+
<li>
|
|
363
|
+
<section class="qld__accordion">
|
|
364
|
+
<button class="qld__accordion__title js-qld__accordion qld__accordion--closed" aria-controls="accordion-group-{{../containerId}}-{{this.fieldid}}" aria-expanded="false" >
|
|
365
|
+
{{#getTitle ../data @key}}{{/getTitle}}
|
|
366
|
+
</button>
|
|
367
|
+
|
|
368
|
+
<div class="qld__accordion__body qld__accordion--closed" id="accordion-group-{{../containerId}}-{{this.fieldid}}">
|
|
369
|
+
<div class="qld__accordion__body-wrapper">
|
|
370
|
+
{{{this.value}}}
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
</section>
|
|
374
|
+
</li>
|
|
375
|
+
{{/ifCond}}
|
|
376
|
+
{{/ifCond}}
|
|
377
|
+
{{/ifCond}}
|
|
378
|
+
{{/each}}
|
|
379
|
+
</ul>
|
|
380
|
+
|
|
381
|
+
{{#ifCond globals.current.data.metadata.pageType.value '==' 'landing'}}
|
|
382
|
+
</div>
|
|
383
|
+
</section>
|
|
384
|
+
{{/ifCond}}
|
|
385
|
+
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
This example contains instances of both the **data** object, as well as the **globals** object. For example, we access the *pageType* value from the current page to determine whether to add some additional wrapping markup.
|
|
389
|
+
|
|
390
|
+
There are also some examples of custom [Handlebars Helpers](https://handlebarsjs.com/guide/#custom-helpers) being used (Eg. *ifCond* and *getTitle*). Each helper is defined in its own JS file under *src/helpers/Handlebars*. You can add your own helpers by creating additional JS files (one per helper) in this directory, and following the same code structure.
|
|
391
|
+
|
|
392
|
+
For example:
|
|
393
|
+
|
|
394
|
+
```
|
|
395
|
+
module.exports = function (params) {
|
|
396
|
+
// Helper function goes here
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### Styling a component (component.scss)
|
|
403
|
+
Use SASS to style your component, and follow the BEM methodology when naming your classes (Eg. `.qld__accordion--light`). To maintain consistency, look at existing components if you are unsure.
|
|
404
|
+
|
|
405
|
+
Also take care to follow a 'mobile-first' approach with your SCSS code, where styling at larger breakpoints (see *src/styles/imports/variables.scss* for breakpoint definitions) can be implemented with one of the following mixins:
|
|
406
|
+
|
|
407
|
+
```
|
|
408
|
+
// >sm breakpoint
|
|
409
|
+
@include QH-media( sm ) {}
|
|
410
|
+
|
|
411
|
+
// >md breakpoint
|
|
412
|
+
@include QH-media( md ) {}
|
|
413
|
+
|
|
414
|
+
// >lg breakpoint
|
|
415
|
+
@include QH-media( lg ) {}
|
|
416
|
+
|
|
417
|
+
// >xl breakpoint
|
|
418
|
+
@include QH-media( xl ) {}
|
|
419
|
+
|
|
420
|
+
// >xxl breakpoint
|
|
421
|
+
@include QH-media( xxl ) {}
|
|
422
|
+
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
These should be implemented inline for each class separately (see *banner* component for a good example)
|
|
426
|
+
|
|
427
|
+
### Component JavaScript (global.js)
|
|
428
|
+
This is where you should add any client side JavaScript (eg. toggling of Accordions). Ensure that all functions are documented in [Jsdoc](https://devhints.io/jsdoc) format.
|
|
429
|
+
|
|
430
|
+
### Updating / Previewing a component
|
|
431
|
+
To test any updates to a component, you can view it locally using `npm run serve`. A corresponding component page will be automatically created at src/html/component-\[component-name\], so that you can easily preview your component, and test the output with different input data.
|
|
432
|
+
|
|
433
|
+
### Build / Commit / Push
|
|
434
|
+
Once you are ready to push up any local changes to a component, you should run the `npm run build` script before you commit. This generates the compiled Handlebars template, as well as an import.xml file that can be used to automatically create all of the assets required in Matrix for your component.
|
|
435
|
+
|
|
436
|
+
### Importing into Matrix
|
|
437
|
+
To import your finished component, go to the Matrix Admin interface and in the 'Tools' menu select 'Import assets from XML'. Choose the 'import.xml' file generated for your component on build, and select the 'Components' folder in the 'Import Assets Under' field.
|
|
438
|
+
|
|
439
|
+
After successful import, you should have a new Content Template in Matrix with a Metadata Schema that matches your *manifest.json* file.
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
## Advanced Features
|
|
443
|
+
### Figma colour sync
|
|
444
|
+
|
|
445
|
+
The Figma script pulls in all colour variables from the Figma file via the API which can be at '.figma.js'.
|
|
446
|
+
|
|
447
|
+
By default the script points the design system file which can be updated to pull in new designs colour matrix.
|
|
448
|
+
|
|
449
|
+
To pull in a new colour matrix you will need to update line 6 with the new path.
|
|
450
|
+
```
|
|
451
|
+
/qKsxl3ogIlBp7dafgxXuCA
|
|
452
|
+
```
|
|
453
|
+
The new path can be found in the url of the figma file, simply copy the figma file id '/file/<figma-file-id>'.
|
|
454
|
+
e.g
|
|
455
|
+
```
|
|
456
|
+
https://www.figma.com/file/**qKsxl3ogIlBp7dafgxXuCA**/QLDH-DDS?node-id=5990%3A97450&viewport=241%2C48%2C0.5
|
|
457
|
+
```
|
|
458
|
+
Once the path has been updated and save you can now run the script with:
|
|
459
|
+
```
|
|
460
|
+
npm run get-figma
|
|
461
|
+
```
|
|
462
|
+
This will hit the figma API via a get request, process the values and save the new SASS varibles in:
|
|
463
|
+
```
|
|
464
|
+
/src/styles/imports/figma.scss
|
|
465
|
+
```
|
|
466
|
+
The figma variables can now be used by running either of the local or production scripts.
|
|
467
|
+
|
|
468
|
+
## General Boilerplate Features
|
|
469
|
+
This section contains some general tips for writing code using this boilerplate
|
|
470
|
+
### Working in HTML files
|
|
471
|
+
#### Including images
|
|
472
|
+
- Your files live in:
|
|
473
|
+
- src/files/my-awesome-file.png
|
|
474
|
+
- And you're wanting to include an image in:
|
|
475
|
+
- src/modules/header/html/index.html
|
|
476
|
+
- Use either reference:
|
|
477
|
+
- Relative path: `<img src="../../../files/my-awesome-file.png" alt="My awesome file" >`
|
|
478
|
+
- Absolute path: `<img src="~src/files/my-awesome-file.png" alt="My awesome file" >`
|
|
479
|
+
|
|
480
|
+
#### Including HTML modules
|
|
481
|
+
- Your awesome menu lives in:
|
|
482
|
+
- src/modules/header-menu/html/index.html
|
|
483
|
+
- And you want to include it in:
|
|
484
|
+
- src/modules/header/html/index.html
|
|
485
|
+
- Use either reference:
|
|
486
|
+
- Relative path: `${require('../../header-menu/html/index.html')}`
|
|
487
|
+
- Absolute path: `${require('src/header-menu/html/index.html')}`
|
|
488
|
+
|
|
489
|
+
### Working in SCSS files
|
|
490
|
+
#### Including fonts
|
|
491
|
+
- Your fonts live in:
|
|
492
|
+
- src/styles/imports/fonts/my-awesome-font.woff
|
|
493
|
+
- And you want to include it in your main CSS:
|
|
494
|
+
- src/styles/global.scss
|
|
495
|
+
- Use either reference:
|
|
496
|
+
- Relative path: `url('./imports/fonts/my-awesome-font.woff') format('woff')`
|
|
497
|
+
- Absolute path: `url('~src/imports/fonts/my-awesome-font.woff') format('woff')`
|
|
498
|
+
|
|
499
|
+
#### Including images
|
|
500
|
+
- Your files live in:
|
|
501
|
+
- src/files/icon.png
|
|
502
|
+
- And you're wanting to include an image in:
|
|
503
|
+
- src/modules/header/css/global.scss
|
|
504
|
+
- Use either reference:
|
|
505
|
+
- Relative path: `background-image: url('../files/icon.png')`;
|
|
506
|
+
- Absolute path: `background-image: url('~src/files/icon.png')`;
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
### Working in JS files
|
|
510
|
+
#### Including images
|
|
511
|
+
- Your files live in:
|
|
512
|
+
- src/files/icon.png
|
|
513
|
+
- And you're wanting to include an image in:
|
|
514
|
+
- src/modules/header/js/global.js
|
|
515
|
+
- Use either reference:
|
|
516
|
+
- Relative path: `const icon = require('../../../files/icon.png');`
|
|
517
|
+
- Absolute path: `const icon = require('src/files/icon.png');`
|
|
518
|
+
|
|
519
|
+
#### Including JSON
|
|
520
|
+
You may want to reference an external JSON file that does not need to be a part of the webpack build process. For instance, mock data returned from funnelback autocomplete. The /externals directory allows you to pop in files to ensure that they will be included in the /dist directory
|
|
521
|
+
|
|
522
|
+
- Your file lives in:
|
|
523
|
+
- `src/externals/data.json`
|
|
524
|
+
- You can reference it by its relative path ie.
|
|
525
|
+
- `fetch('./externals/data.json').then(function(response){...do stuff})`
|
|
526
|
+
- Or its absolute path ie.
|
|
527
|
+
- `fetch('~src/externals/data.json').then(function(response){...do stuff})`
|
|
528
|
+
- File will be moved into the dist directory `dist/externals/data.json`
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
#### Maven
|
|
532
|
+
- To build and test all: ```mvn install```
|
|
533
|
+
- To build js docs ```mvn com.github.eirslett:frontend-maven-plugin:npm@jsdoc```
|
|
534
|
+
- To run webpack serve ```mvn com.github.eirslett:frontend-maven-plugin:npm@serve```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|