@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
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// {{component_name}}
|
|
3
|
+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
4
|
+
.qld__body .qld__code {
|
|
5
|
+
display: block;
|
|
6
|
+
|
|
7
|
+
.qld__code-copy--button {
|
|
8
|
+
@include QLD-space(padding, 0.3125unit 0.8125unit);
|
|
9
|
+
min-width: initial;
|
|
10
|
+
position: relative;
|
|
11
|
+
|
|
12
|
+
&-text {
|
|
13
|
+
@include QLD-space('margin-left', .5unit);
|
|
14
|
+
|
|
15
|
+
@include QLD-media(sm, down) {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.clean {
|
|
21
|
+
display: flex;
|
|
22
|
+
|
|
23
|
+
i {
|
|
24
|
+
@include QLD-space('font-size', 1.25unit);
|
|
25
|
+
@include QLD-space('margin', 0.125unit);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dirty {
|
|
30
|
+
display: none;
|
|
31
|
+
|
|
32
|
+
i {
|
|
33
|
+
@include QLD-space('font-size', 1.5unit);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.copied {
|
|
38
|
+
background-color: var(--QLD-color-light-background__shade);
|
|
39
|
+
border-color: var(--QLD-color-light-background__shade);
|
|
40
|
+
color: var(--QLD-color-light-text);
|
|
41
|
+
|
|
42
|
+
i {
|
|
43
|
+
color: $QLD-color-success;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.clean {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.dirty {
|
|
51
|
+
display: flex;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:focus,
|
|
56
|
+
&:hover {
|
|
57
|
+
box-shadow: none;
|
|
58
|
+
text-decoration: none;
|
|
59
|
+
|
|
60
|
+
.qld__code-copy--button-text {
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include QLD-media(sm, down) {
|
|
65
|
+
.qld__code-tooltip {
|
|
66
|
+
display: block;
|
|
67
|
+
bottom: calc(100% + 8px);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.qld__code-header {
|
|
74
|
+
background-color: var(--QLD-color-dark-alt-background__shade);
|
|
75
|
+
border-radius: $QLD-border-radius-xs $QLD-border-radius-xs 0 0;
|
|
76
|
+
display: flex;
|
|
77
|
+
width: 100%;
|
|
78
|
+
justify-content: space-between;
|
|
79
|
+
@include QLD-space('padding', .75unit 1unit);
|
|
80
|
+
@include QLD-space('border-bottom', solid var(--QLD-color-dark-alt-border) 0.0625unit);
|
|
81
|
+
|
|
82
|
+
&-left {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
|
|
86
|
+
a {
|
|
87
|
+
display: inline-block;
|
|
88
|
+
border-radius: $QLD-border-radius-xs;
|
|
89
|
+
color: var(--QLD-color-dark-text);
|
|
90
|
+
@include QLD-space('margin-right', 1.25unit);
|
|
91
|
+
|
|
92
|
+
i {
|
|
93
|
+
color: var(--QLD-color-dark-alt-button);
|
|
94
|
+
@include QLD-space('font-size', 1.25unit);
|
|
95
|
+
@include QLD-space('margin-right', .5unit);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.qld__code-toggle {
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: flex-end;
|
|
104
|
+
position: relative;
|
|
105
|
+
width: 100%;
|
|
106
|
+
z-index: 1;
|
|
107
|
+
|
|
108
|
+
&.qld__body--alt {
|
|
109
|
+
background-color: var(--QLD-color-light-alt-background);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&.qld__body--dark {
|
|
113
|
+
background-color: var(--QLD-color-dark-background);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&.qld__body--dark-alt {
|
|
117
|
+
background-color: var(--QLD-color-dark-alt-background);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&-button {
|
|
121
|
+
background-color: var(--QLD-color-dark-alt-background__shade);
|
|
122
|
+
border: 0;
|
|
123
|
+
border-radius: $QLD-border-radius-xs $QLD-border-radius-xs 0 0;
|
|
124
|
+
color: var(--QLD-color-dark-text);
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
text-decoration: underline;
|
|
127
|
+
@include QLD-space('padding', .75unit 1unit);
|
|
128
|
+
|
|
129
|
+
i {
|
|
130
|
+
color: var(--QLD-color-dark-alt-button);
|
|
131
|
+
@include QLD-space('font-size', 1.25unit);
|
|
132
|
+
@include QLD-space('margin-left', .5unit);
|
|
133
|
+
transition: transform 0.25s ease-in;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&:focus,
|
|
137
|
+
&:hover {
|
|
138
|
+
text-decoration: none;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&:focus {
|
|
142
|
+
outline: 2px solid var(--QLD-color-light-focus);
|
|
143
|
+
outline-offset: 2px;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
+ .qld__code-header {
|
|
148
|
+
border-radius: $QLD-border-radius-xs 0 0 0;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.qld__code-preview {
|
|
153
|
+
position: relative;
|
|
154
|
+
|
|
155
|
+
&-body {
|
|
156
|
+
@include QLD-container-padding($QLD-grid-gutter-md, horizontal);
|
|
157
|
+
margin: 0;
|
|
158
|
+
|
|
159
|
+
@include QLD-media(md) {
|
|
160
|
+
@include QLD-container-padding($QLD-grid-gutter-lg, horizontal);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&-colours {
|
|
165
|
+
align-items: center;
|
|
166
|
+
background-color: var(--QLD-color-light-background__shade);
|
|
167
|
+
border-radius: 0 $QLD-border-radius-xs 0 0;
|
|
168
|
+
color: var(--QLD-color-light-text);
|
|
169
|
+
width: 100%;
|
|
170
|
+
@include QLD-space('padding', 1.0625unit 0.875unit);
|
|
171
|
+
|
|
172
|
+
@include QLD-media(md) {
|
|
173
|
+
display: flex;
|
|
174
|
+
@include QLD-space('padding', 1.0625unit 1unit);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&-label {
|
|
178
|
+
font-weight: 700;
|
|
179
|
+
@include QLD-space('padding-right', 0.75unit);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
ul {
|
|
183
|
+
display: flex;
|
|
184
|
+
flex-wrap: wrap;
|
|
185
|
+
list-style: none;
|
|
186
|
+
padding-left: 0;
|
|
187
|
+
@include QLD-space('margin-top', 0.625unit);
|
|
188
|
+
|
|
189
|
+
@include QLD-media(md) {
|
|
190
|
+
@include QLD-space('margin-top', 0);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
li {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
@include QLD-space('margin', 0.1875unit 1unit 0.1875unit 0);
|
|
197
|
+
|
|
198
|
+
label {
|
|
199
|
+
color: var(--QLD-color-light-text);
|
|
200
|
+
font-weight: 400;
|
|
201
|
+
@include QLD-space('margin', 0);
|
|
202
|
+
@include QLD-space('padding-left', 2.5unit);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&-tab {
|
|
209
|
+
background-color: var(--QLD-color-dark-alt-background__shade);
|
|
210
|
+
border-radius: $QLD-border-radius-xs $QLD-border-radius-xs 0 0;
|
|
211
|
+
bottom: 100%;
|
|
212
|
+
color: var(--QLD-color-dark-text);
|
|
213
|
+
font-weight: 700;
|
|
214
|
+
display: inline-block;
|
|
215
|
+
position: absolute;
|
|
216
|
+
@include QLD-space('font-size', 0.875unit);
|
|
217
|
+
@include QLD-space('line-height', 1unit);
|
|
218
|
+
@include QLD-space('padding', 0.25unit 1unit);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Single line type
|
|
223
|
+
&.singleline {
|
|
224
|
+
border-radius: $QLD-border-radius-xs;
|
|
225
|
+
display: flex;
|
|
226
|
+
width: 100%;
|
|
227
|
+
@include QLD-box-shadow(2);
|
|
228
|
+
|
|
229
|
+
code {
|
|
230
|
+
border-radius: $QLD-border-radius-xs 0 0 $QLD-border-radius-xs;
|
|
231
|
+
flex-grow: 1;
|
|
232
|
+
white-space: nowrap;
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
text-overflow: ellipsis;
|
|
235
|
+
@include QLD-space('padding', .625unit 1unit);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.qld__code-copy--button {
|
|
239
|
+
border-radius: 0 $QLD-border-radius-xs $QLD-border-radius-xs 0;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Multi line type
|
|
244
|
+
&.multiline {
|
|
245
|
+
display: flex;
|
|
246
|
+
flex-direction: column;
|
|
247
|
+
width: 100%;
|
|
248
|
+
@include QLD-space('max-width', 48unit);
|
|
249
|
+
|
|
250
|
+
&.with-preview {
|
|
251
|
+
background-color: var(--QLD-color-light-background);
|
|
252
|
+
border-radius: $QLD-border-radius-xs;
|
|
253
|
+
@include QLD-box-shadow(2);
|
|
254
|
+
@include QLD-space('margin-top', 1.5unit);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&:not(.with-preview) {
|
|
258
|
+
.qld__code-toggle-button,
|
|
259
|
+
.qld__code-header, code {
|
|
260
|
+
@include QLD-box-shadow(2);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
code {
|
|
265
|
+
border-radius: 0 0 $QLD-border-radius-xs $QLD-border-radius-xs;
|
|
266
|
+
overflow: hidden;
|
|
267
|
+
position: relative;
|
|
268
|
+
transition: max-height 0.5s ease-in-out;
|
|
269
|
+
@include QLD-space('padding', 1.25unit 1unit);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&.show_less {
|
|
273
|
+
code {
|
|
274
|
+
|
|
275
|
+
&:before {
|
|
276
|
+
background: linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0%, rgba(2, 42, 80, 0.2) 86.21%);
|
|
277
|
+
bottom: 0;
|
|
278
|
+
content: "";
|
|
279
|
+
left: 0;
|
|
280
|
+
position: absolute;
|
|
281
|
+
width: 100%;
|
|
282
|
+
@include QLD-space('height', 3.75unit);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.qld__code-toggle-button i {
|
|
287
|
+
transform: rotate(-180deg);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.qld__code--inline {
|
|
294
|
+
display: inline;
|
|
295
|
+
position: relative;
|
|
296
|
+
|
|
297
|
+
code {
|
|
298
|
+
border: 0;
|
|
299
|
+
border-radius: $QLD-border-radius-xs;
|
|
300
|
+
cursor: pointer;
|
|
301
|
+
display: inline-block;
|
|
302
|
+
text-align: left;
|
|
303
|
+
@include QLD-space('padding', .125unit .5unit);
|
|
304
|
+
|
|
305
|
+
&:focus,
|
|
306
|
+
&:hover {
|
|
307
|
+
background-color: var(--QLD-color-light-button__hover);
|
|
308
|
+
|
|
309
|
+
+ .qld__code-tooltip {
|
|
310
|
+
display: block;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
&:focus {
|
|
315
|
+
@include QLD-space('border', solid var(--QLD-color-light-focus) 0.125unit);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.qld__code-tooltip {
|
|
321
|
+
display: none;
|
|
322
|
+
background: var(--QLD-color-light-background);
|
|
323
|
+
border-radius: $QLD-border-radius-xs;
|
|
324
|
+
position: absolute;
|
|
325
|
+
bottom: calc(100% + 5px);
|
|
326
|
+
left: 50%;
|
|
327
|
+
transform: translateX(-50%);
|
|
328
|
+
z-index: 2;
|
|
329
|
+
@include QLD-space('padding', .25unit 1.5unit);
|
|
330
|
+
@include QLD-box-shadow(3);
|
|
331
|
+
|
|
332
|
+
&:before {
|
|
333
|
+
content: "";
|
|
334
|
+
width: 0;
|
|
335
|
+
height: 0;
|
|
336
|
+
border-style: solid;
|
|
337
|
+
border-width: 4px 4px 0 4px;
|
|
338
|
+
border-color: #ffffff transparent transparent transparent;
|
|
339
|
+
position: absolute;
|
|
340
|
+
bottom: -4px;
|
|
341
|
+
left: 50%;
|
|
342
|
+
transform: translateX(-50%);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
main .qld__body #content .qld__code .qld__code-preview-body.qld__body {
|
|
347
|
+
@include QLD-space('margin', 0);
|
|
348
|
+
@include QLD-space('padding-bottom', 1.5unit);
|
|
349
|
+
|
|
350
|
+
&.qld__body--alt,
|
|
351
|
+
&.qld__body--dark,
|
|
352
|
+
&.qld__body--dark-alt {
|
|
353
|
+
@include QLD-space('padding-bottom', 1.5unit);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{{#with component.data.metadata}}
|
|
2
|
+
{{#if code.value}}
|
|
3
|
+
{{#ifCond code_snippet_type.value '==' 'singleline'}}
|
|
4
|
+
<div class="qld__code singleline">
|
|
5
|
+
<code class="qld__code-body">{{code.value}}</code>
|
|
6
|
+
<button class="qld__btn qld__code-copy--button" type="button">
|
|
7
|
+
<div class="clean">
|
|
8
|
+
<i class="fa-light fa-copy"></i><span class="qld__code-copy--button-text">Copy</span>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="dirty">
|
|
11
|
+
<i class="fa-solid fa-circle-check"></i><span class="qld__code-copy--button-text">Copied</span>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="qld__code-tooltip">
|
|
14
|
+
<span class="clean">Copy</span>
|
|
15
|
+
<span class="dirty">Copied</span>
|
|
16
|
+
</div>
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
{{/ifCond}}
|
|
20
|
+
{{#ifCond code_snippet_type.value '==' 'multiline'}}
|
|
21
|
+
<div class="qld__code multiline {{#ifCond show_more_button.value '==' 'true'}}show_less{{/ifCond}} {{#ifCond show_preview.value '==' 'true'}}with-preview{{/ifCond}}">
|
|
22
|
+
{{#ifCond show_preview.value '==' 'true'}}
|
|
23
|
+
<div class="qld__code-preview">
|
|
24
|
+
<span class="qld__code-preview-tab">Example</span>
|
|
25
|
+
<div class="qld__code-preview-colours">
|
|
26
|
+
<span class="qld__code-preview-colours-label">Theme</span>
|
|
27
|
+
<ul>
|
|
28
|
+
<li>
|
|
29
|
+
<input type="radio" name="qld__code-preview-colours-{{../component.data.assetid}}" id="qld__code-preview-colours__default-{{../component.data.assetid}}" value="" checked>
|
|
30
|
+
<label for="qld__code-preview-colours__default-{{../component.data.assetid}}">Default</label>
|
|
31
|
+
</li>
|
|
32
|
+
<li>
|
|
33
|
+
<input type="radio" name="qld__code-preview-colours-{{../component.data.assetid}}" id="qld__code-preview-colours__alt-{{../component.data.assetid}}" value="qld__body--alt">
|
|
34
|
+
<label for="qld__code-preview-colours__alt-{{../component.data.assetid}}">Alt</label>
|
|
35
|
+
</li>
|
|
36
|
+
<li>
|
|
37
|
+
<input type="radio" name="qld__code-preview-colours-{{../component.data.assetid}}" id="qld__code-preview-colours__dark-{{../component.data.assetid}}" value="qld__body--dark">
|
|
38
|
+
<label for="qld__code-preview-colours__dark-{{../component.data.assetid}}">Dark</label>
|
|
39
|
+
</li>
|
|
40
|
+
<li>
|
|
41
|
+
<input type="radio" name="qld__code-preview-colours-{{../component.data.assetid}}" id="qld__code-preview-colours__dark-alt-{{../component.data.assetid}}" value="qld__body--dark-alt">
|
|
42
|
+
<label for="qld__code-preview-colours__dark-alt-{{../component.data.assetid}}"> Dark-alt</label>
|
|
43
|
+
</li>
|
|
44
|
+
</ul>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="qld__code-preview-body qld__body">
|
|
47
|
+
{{{code.value}}}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
{{/ifCond}}
|
|
51
|
+
{{#ifCond show_more_button.value '==' 'true'}}
|
|
52
|
+
<div class="qld__code-toggle">
|
|
53
|
+
<button class="qld__code-toggle-button" type="button">Show more<i class="fa-regular fa-chevron-up"></i></button>
|
|
54
|
+
</div>
|
|
55
|
+
{{/ifCond}}
|
|
56
|
+
<div class="qld__code-header">
|
|
57
|
+
<div class="qld__code-header-left">
|
|
58
|
+
{{#if github_link.value}}
|
|
59
|
+
<a href="{{github_link.value}}" target="_blank"><i class="fa-regular fa-arrow-up-right-from-square"></i> Github</a>
|
|
60
|
+
{{/if}}
|
|
61
|
+
{{#if figma_link.value}}
|
|
62
|
+
<a href="{{figma_link.value}}" target="_blank"><i class="fa-regular fa-arrow-up-right-from-square"></i> Figma</a>
|
|
63
|
+
{{/if}}
|
|
64
|
+
</div>
|
|
65
|
+
<div class="qld__code-header-right">
|
|
66
|
+
<button class="qld__btn qld__code-copy--button" type="button">
|
|
67
|
+
<div class="clean">
|
|
68
|
+
<i class="fa-light fa-copy"></i><span class="qld__code-copy--button-text">Copy</span>
|
|
69
|
+
</div>
|
|
70
|
+
<div class="dirty">
|
|
71
|
+
<i class="fa-solid fa-circle-check"></i><span class="qld__code-copy--button-text">Copied</span>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="qld__code-tooltip">
|
|
74
|
+
<span class="clean">Copy</span>
|
|
75
|
+
<span class="dirty">Copied</span>
|
|
76
|
+
</div>
|
|
77
|
+
</button>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
<code class="qld__code-body">{{code.value}}</code>
|
|
81
|
+
</div>
|
|
82
|
+
{{/ifCond}}
|
|
83
|
+
{{/if}}
|
|
84
|
+
{{/with}}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
/**
|
|
3
|
+
* @module code
|
|
4
|
+
*/
|
|
5
|
+
var code = {};
|
|
6
|
+
|
|
7
|
+
code.init = function() {
|
|
8
|
+
const codes = document.querySelectorAll('code')
|
|
9
|
+
const inlinecodes = document.querySelectorAll('code:not(.qld__code-body)')
|
|
10
|
+
const copyButtons = document.querySelectorAll('.qld__code-copy--button')
|
|
11
|
+
const showToggle = document.querySelectorAll('.qld__code-toggle-button')
|
|
12
|
+
const colorButtons = document.querySelectorAll('.qld__code-preview-colours input[type=radio]')
|
|
13
|
+
|
|
14
|
+
if (codes.length) {
|
|
15
|
+
codes.forEach(function(code) {
|
|
16
|
+
code.innerHTML = Prism.highlight(code.innerText, Prism.languages.html, 'html')
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (inlinecodes.length) {
|
|
21
|
+
inlinecodes.forEach(function(inlinecode){
|
|
22
|
+
const codeWrap = document.createElement("div");
|
|
23
|
+
codeWrap.classList.add('qld__code--inline');
|
|
24
|
+
|
|
25
|
+
inlinecode.replaceWith(codeWrap);
|
|
26
|
+
codeWrap.appendChild(inlinecode);
|
|
27
|
+
|
|
28
|
+
const tooltip = document.createElement("span");
|
|
29
|
+
const tooltipText = document.createTextNode("Copy");
|
|
30
|
+
tooltip.appendChild(tooltipText);
|
|
31
|
+
tooltip.classList.add('qld__code-tooltip');
|
|
32
|
+
inlinecode.after(tooltip);
|
|
33
|
+
inlinecode.setAttribute('tabindex', 0);
|
|
34
|
+
|
|
35
|
+
inlinecode.addEventListener('click', function () {
|
|
36
|
+
copyButtonAction(this);
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
inlinecode.addEventListener("keypress", function(event) {
|
|
40
|
+
if (event.key === "Enter") {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
copyButtonAction(this);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (copyButtons.length) {
|
|
49
|
+
copyButtons.forEach(function(copyButton){
|
|
50
|
+
copyButton.addEventListener('click', function () {
|
|
51
|
+
copyButtonAction(this);
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (showToggle.length) {
|
|
57
|
+
showToggle.forEach(function(showToggleButton){
|
|
58
|
+
const parent = showToggleButton.closest('.qld__code');
|
|
59
|
+
const target = parent.querySelector('code')
|
|
60
|
+
target.style.height = '120px'
|
|
61
|
+
|
|
62
|
+
showToggleButton.addEventListener('click', function () {
|
|
63
|
+
if (this.innerText.indexOf('more') > -1) {
|
|
64
|
+
this.innerHTML = 'Show less<i class="fa-regular fa-chevron-up"></i>'
|
|
65
|
+
} else {
|
|
66
|
+
this.innerHTML = 'Show more<i class="fa-regular fa-chevron-up"></i>'
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
QLD.animate.Toggle({
|
|
70
|
+
element: target,
|
|
71
|
+
property: 'height',
|
|
72
|
+
speed: 250,
|
|
73
|
+
closeSize: 120,
|
|
74
|
+
prefunction: function () {
|
|
75
|
+
parent.classList.toggle('show_less')
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (colorButtons.length) {
|
|
83
|
+
colorButtons.forEach(function(colorButton){
|
|
84
|
+
colorButton.addEventListener('change', function () {
|
|
85
|
+
const body = colorButton.closest('.qld__code').querySelector('.qld__code-preview-body')
|
|
86
|
+
body.classList.remove('qld__body--alt','qld__body--dark','qld__body--dark-alt')
|
|
87
|
+
if (this.value){
|
|
88
|
+
body.classList.add(this.value)
|
|
89
|
+
}
|
|
90
|
+
const toggle = colorButton.closest('.qld__code').querySelector('.qld__code-toggle')
|
|
91
|
+
if (typeof(toggle)!=='undefined'){
|
|
92
|
+
toggle.classList.remove('qld__body--alt','qld__body--dark','qld__body--dark-alt')
|
|
93
|
+
if (this.value){
|
|
94
|
+
toggle.classList.add(this.value)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function copyButtonAction(button) {
|
|
103
|
+
if (button.classList.contains('qld__code-copy--button')){
|
|
104
|
+
const parent = button.closest('.qld__code');
|
|
105
|
+
copyTextToClipboard(parent.querySelector('code').innerText)
|
|
106
|
+
button.classList.add('copied');
|
|
107
|
+
|
|
108
|
+
setTimeout(() => {
|
|
109
|
+
button.classList.remove('copied')
|
|
110
|
+
}, "1500")
|
|
111
|
+
} else {
|
|
112
|
+
copyTextToClipboard(button.innerText);
|
|
113
|
+
button.nextElementSibling.innerText = "Copied"
|
|
114
|
+
button.addEventListener('blur', function() {
|
|
115
|
+
button.nextElementSibling.innerText = "Copy"
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function fallbackCopyTextToClipboard(text) {
|
|
121
|
+
const textArea = document.createElement("textarea")
|
|
122
|
+
textArea.value = text;
|
|
123
|
+
|
|
124
|
+
// Avoid scrolling to bottom
|
|
125
|
+
textArea.style.top = "0"
|
|
126
|
+
textArea.style.left = "0"
|
|
127
|
+
textArea.style.position = "fixed"
|
|
128
|
+
|
|
129
|
+
document.body.appendChild(textArea)
|
|
130
|
+
textArea.focus()
|
|
131
|
+
textArea.select()
|
|
132
|
+
|
|
133
|
+
try {
|
|
134
|
+
const successful = document.execCommand('copy')
|
|
135
|
+
const msg = successful ? 'successful' : 'unsuccessful';
|
|
136
|
+
console.log('Fallback: Copying text command was ' + msg)
|
|
137
|
+
} catch (err) {
|
|
138
|
+
console.error('Fallback: Oops, unable to copy', err)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
document.body.removeChild(textArea)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function copyTextToClipboard(text) {
|
|
145
|
+
if (!navigator.clipboard) {
|
|
146
|
+
fallbackCopyTextToClipboard(text)
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
navigator.clipboard.writeText(text).then(function() {
|
|
150
|
+
console.log('Async: Copying to clipboard was successful!')
|
|
151
|
+
}, function(err) {
|
|
152
|
+
console.error('Async: Could not copy text: ', err)
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
QLD.code = code;
|
|
157
|
+
|
|
158
|
+
// Init In Page Nav on document load
|
|
159
|
+
document.addEventListener('DOMContentLoaded', QLD.code.init)
|
|
160
|
+
}());
|