@qld-gov-au/qgds-bootstrap5 1.1.39 → 1.1.41
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/dist/assets/components/bs5/backToTop/backToTop.hbs +1 -1
- package/dist/assets/components/bs5/breadcrumbs/breadcrumbs.hbs +19 -15
- package/dist/assets/components/bs5/button/button.hbs +48 -30
- package/dist/assets/components/bs5/containerLayout/containerLayout.hbs +100 -0
- package/dist/assets/components/bs5/contentFooter/contentFooter.hbs +15 -4
- package/dist/assets/components/bs5/formcheck/formcheck.hbs +1 -1
- package/dist/assets/components/bs5/head/head.hbs +1 -1
- package/dist/assets/components/bs5/iconLink/iconLink.hbs +41 -0
- package/dist/assets/components/bs5/logo/logo.hbs +7 -0
- package/dist/assets/components/bs5/logo/logoCOALandscape.hbs +58 -0
- package/dist/assets/components/bs5/logo/logoCOALandscape2Lines.hbs +58 -0
- package/dist/assets/components/bs5/navbar/navbar.hbs +65 -245
- package/dist/assets/components/bs5/pageLayout/pageLayout.hbs +11 -10
- package/dist/assets/components/bs5/pageLayout/templates/contentPageWithForm.hbs +78 -0
- package/dist/assets/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +103 -0
- package/dist/assets/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +61 -0
- package/dist/assets/components/bs5/searchInput/searchInput.hbs +8 -10
- package/dist/assets/css/qld.bootstrap.css +1 -1
- package/dist/assets/css/qld.bootstrap.css.map +3 -3
- package/dist/assets/js/bootstrap.bundle.js +3 -6
- package/dist/assets/js/bootstrap.bundle.js.map +1 -1
- package/dist/assets/js/bootstrap.bundle.min.js +2 -2
- package/dist/assets/js/bootstrap.bundle.min.js.map +1 -1
- package/dist/assets/js/bootstrap.js +3 -6
- package/dist/assets/js/bootstrap.min.js +2 -2
- package/dist/assets/js/bootstrap.min.js.map +1 -1
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.helpers.bundle.js.map +3 -3
- package/dist/assets/js/handlebars.helpers.js +51 -40
- package/dist/assets/js/handlebars.init.min.js +698 -347
- package/dist/assets/js/handlebars.init.min.js.map +4 -4
- package/dist/assets/js/handlebars.partials.js +16 -0
- package/dist/assets/js/qld.bootstrap.min.js +9 -9
- package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
- package/dist/assets/node/handlebars.init.min.js +359 -72
- package/dist/assets/node/handlebars.init.min.js.map +3 -3
- package/dist/components/bs5/backToTop/backToTop.hbs +1 -1
- package/dist/components/bs5/breadcrumbs/breadcrumbs.hbs +19 -15
- package/dist/components/bs5/button/button.hbs +48 -30
- package/dist/components/bs5/containerLayout/containerLayout.hbs +100 -0
- package/dist/components/bs5/contentFooter/contentFooter.hbs +15 -4
- package/dist/components/bs5/formcheck/formcheck.hbs +1 -1
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/iconLink/iconLink.hbs +41 -0
- package/dist/components/bs5/logo/logo.hbs +7 -0
- package/dist/components/bs5/logo/logoCOALandscape.hbs +58 -0
- package/dist/components/bs5/logo/logoCOALandscape2Lines.hbs +58 -0
- package/dist/components/bs5/navbar/navbar.hbs +65 -245
- package/dist/components/bs5/pageLayout/pageLayout.hbs +11 -10
- package/dist/components/bs5/pageLayout/templates/contentPageWithForm.hbs +78 -0
- package/dist/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +103 -0
- package/dist/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +61 -0
- package/dist/components/bs5/searchInput/searchInput.hbs +8 -10
- package/dist/components/handlebars.helpers.js +51 -40
- package/dist/components/handlebars.partials.js +16 -0
- package/dist/package.json +2 -2
- package/dist/sample-data/breadcrumbs/breadcrumbs.data.json +113 -49
- package/dist/sample-data/button/button.data.json +10 -8
- package/dist/sample-data/contentFooter/contentFooter.data.json +9 -1
- package/dist/sample-data/formcheck/stories/checkbox/checkbox.data.json +51 -46
- package/dist/sample-data/formcheck/stories/radio/radio.data.json +51 -46
- package/dist/sample-data/iconLink/iconLink.data.json +77 -0
- package/dist/sample-data/logo/logo.data.json +6 -0
- package/dist/sample-data/navbar/navbar.data.json +191 -0
- package/dist/sample-data/searchInput/searchInput.data.json +2 -3
- package/dist/sample-data/tabs/tabs.data.json +45 -44
- package/package.json +2 -2
- package/src/components/bs5/backToTop/backToTop.hbs +1 -1
- package/src/components/bs5/banner/banner.scss +52 -46
- package/src/components/bs5/breadcrumbs/__snapshots__/breadcrumbs.test.js.snap +49 -0
- package/src/components/bs5/breadcrumbs/breadcrumbs.data.json +113 -49
- package/src/components/bs5/breadcrumbs/breadcrumbs.functions.js +169 -0
- package/src/components/bs5/breadcrumbs/breadcrumbs.hbs +19 -15
- package/src/components/bs5/breadcrumbs/breadcrumbs.scss +164 -43
- package/src/components/bs5/breadcrumbs/breadcrumbs.stories.js +16 -2
- package/src/components/bs5/breadcrumbs/breadcrumbs.test.js +136 -0
- package/src/components/bs5/button/button.data.json +10 -8
- package/src/components/bs5/button/button.hbs +48 -30
- package/src/components/bs5/button/button.scss +365 -244
- package/src/components/bs5/button/button.stories.js +116 -30
- package/src/components/bs5/containerLayout/containerLayout.hbs +100 -0
- package/src/components/bs5/containerLayout/containerLayout.stories.js +83 -0
- package/src/components/bs5/contentFooter/contentFooter.data.json +9 -1
- package/src/components/bs5/contentFooter/contentFooter.hbs +15 -4
- package/src/components/bs5/formcheck/formcheck.hbs +1 -1
- package/src/components/bs5/formcheck/formcheck.scss +161 -139
- package/src/components/bs5/formcheck/stories/checkbox/checkbox.data.json +51 -46
- package/src/components/bs5/formcheck/stories/radio/radio.data.json +51 -46
- package/src/components/bs5/iconLink/iconLink.data.json +77 -0
- package/src/components/bs5/iconLink/iconLink.hbs +41 -0
- package/src/components/bs5/iconLink/iconLink.js +20 -0
- package/src/components/bs5/iconLink/iconLink.mdx +16 -0
- package/src/components/bs5/iconLink/iconLink.scss +57 -0
- package/src/components/bs5/iconLink/iconLink.stories.js +127 -0
- package/src/components/bs5/icons/icons.scss +79 -72
- package/src/components/bs5/inpagenav/inpagenav.scss +37 -37
- package/src/components/bs5/logo/Logo.js +20 -0
- package/src/components/bs5/logo/Logo.mdx +10 -0
- package/src/components/bs5/logo/logo.data.json +6 -0
- package/src/components/bs5/logo/logo.hbs +7 -0
- package/src/components/bs5/logo/logo.stories.js +32 -0
- package/src/components/bs5/logo/logoCOALandscape.hbs +58 -0
- package/src/components/bs5/logo/logoCOALandscape2Lines.hbs +58 -0
- package/src/components/bs5/navbar/Navbar.js +2 -9
- package/src/components/bs5/navbar/navbar.data.json +191 -0
- package/src/components/bs5/navbar/navbar.functions.js +48 -196
- package/src/components/bs5/navbar/navbar.hbs +65 -245
- package/src/components/bs5/navbar/navbar.scss +585 -518
- package/src/components/bs5/navbar/navbar.stories.js +532 -0
- package/src/components/bs5/pageLayout/ContentPageWithForm.js +8 -0
- package/src/components/bs5/pageLayout/ContentPageWithSideNavigation.js +8 -0
- package/src/components/bs5/pageLayout/FullWidthLandingPage.js +8 -0
- package/src/components/bs5/pageLayout/pageLayout.hbs +11 -10
- package/src/components/bs5/pageLayout/pageLayout.stories.js +230 -6
- package/src/components/bs5/pageLayout/templates/contentPageWithForm.hbs +78 -0
- package/src/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +103 -0
- package/src/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +61 -0
- package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +9 -8
- package/src/components/bs5/searchInput/search.functions.js +94 -63
- package/src/components/bs5/searchInput/searchInput.data.json +2 -3
- package/src/components/bs5/searchInput/searchInput.hbs +8 -10
- package/src/components/bs5/searchInput/searchInput.scss +296 -255
- package/src/components/bs5/searchInput/searchInput.test.js +98 -89
- package/src/components/bs5/sidenav/sidenav.stories.js +17 -15
- package/src/components/bs5/tabs/tabs.data.json +45 -44
- package/src/components/bs5/tabs/tabs.scss +544 -500
- package/src/components/bs5/tabs/tabs.stories.js +81 -51
- package/src/components/common/footer/footer.scss +137 -140
- package/src/components/common/layout/container.scss +22 -0
- package/src/components/common/layout/content.scss +11 -4
- package/src/components/common/layout/grid.scss +26 -0
- package/src/css/main.scss +5 -4
- package/src/css/qld-variables.scss +102 -81
- package/src/js/handlebars.helpers.js +51 -40
- package/src/js/handlebars.partials.js +16 -0
- package/src/js/qld.bootstrap.js +17 -9
- package/src/components/bs5/backToTop/backToTop.scss +0 -9
- package/src/components/bs5/breadcrumbs/breadcrumb.functions.js +0 -95
- package/src/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.stories.js +0 -34
- package/src/components/bs5/contentFooterWrapper/contentFooterWrapper.stories.js +0 -36
- package/src/components/bs5/contentWrapper/contentWrapper.stories.js +0 -65
- package/src/components/bs5/fullPageWrapper/fullPage.stories.js +0 -63
- package/src/components/bs5/mainContainerWrapper/mainContainerWrapper.stories.js +0 -50
- package/src/components/bs5/navbar/_colours.scss +0 -85
- package/src/components/bs5/navbar/_icons.scss +0 -64
- package/src/components/bs5/sidenavWrapper/SidenavWrapper.mdx +0 -11
- package/src/components/bs5/sidenavWrapper/sidenavWrapper.stories.js +0 -65
- package/src/stories/integration/MainIntegration.js +0 -28
- package/src/stories/integration/MainIntegration.mdx +0 -10
- package/src/stories/integration/breadcrumb.data.json +0 -28
- package/src/stories/integration/content.data.json +0 -3
- package/src/stories/integration/contentFooter.data.json +0 -3
- package/src/stories/integration/footer.data.json +0 -111
- package/src/stories/integration/globalAlert.data.json +0 -10
- package/src/stories/integration/header.data.json +0 -173
- package/src/stories/integration/inpagenav.data.json +0 -26
- package/src/stories/integration/integration.stories.js +0 -147
- package/src/stories/integration/main.hbs +0 -13
- package/src/stories/integration/navigation.data.json +0 -22
- package/src/stories/integration/search.data.json +0 -20
- package/src/stories/integration/sidenav.data.json +0 -88
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
.qld-content {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
.qld-content-body {
|
|
2
|
+
.emphasis {
|
|
3
|
+
margin: 4rem -2rem;
|
|
4
|
+
padding: 4rem 2rem;
|
|
5
|
+
overflow: visible;
|
|
6
|
+
|
|
7
|
+
& p:last-child,
|
|
8
|
+
& ul:last-child,
|
|
9
|
+
& ol:last-child {
|
|
10
|
+
margin-bottom: 0;
|
|
5
11
|
}
|
|
12
|
+
}
|
|
6
13
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Modifies BS5's default container behaviours at different viewports
|
|
2
|
+
// Spec from QGDS UI-Kit spacing variables
|
|
3
|
+
:root {
|
|
4
|
+
--qld-container-padding-x-sm: 1rem;
|
|
5
|
+
--qld-container-padding-x-md: 2rem;
|
|
6
|
+
--qld-container-max-width: 86rem;
|
|
7
|
+
--qld-gap: 2rem;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.row,
|
|
11
|
+
.row-fluid {
|
|
12
|
+
--qld-gutter-x: 2rem;
|
|
13
|
+
--qld-gutter-y: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.container {
|
|
17
|
+
width: 100%;
|
|
18
|
+
max-width: var(--qld-container-max-width);
|
|
19
|
+
padding-left: var(--qld-container-padding-x-sm);
|
|
20
|
+
padding-right: var(--qld-container-padding-x-sm);
|
|
21
|
+
|
|
22
|
+
@include media-breakpoint-up(md) {
|
|
23
|
+
padding-left: var(--qld-container-padding-x-md);
|
|
24
|
+
padding-right: var(--qld-container-padding-x-md);
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/css/main.scss
CHANGED
|
@@ -91,9 +91,12 @@ $enable-dark-mode: true;
|
|
|
91
91
|
//8. QLD Design System typography (bootstrap overrides and custom). Please maintain naming consistency.
|
|
92
92
|
@import "./qld-type";
|
|
93
93
|
|
|
94
|
+
// Common Layout Blocks
|
|
95
|
+
@import "../components/common/layout/content";
|
|
96
|
+
@import "../components/common/layout/container";
|
|
97
|
+
|
|
94
98
|
// 9. QLD Design System components (bootstrap overrides and custom). Please maintain naming consistency.
|
|
95
99
|
@import "../components/bs5/accordion/accordion";
|
|
96
|
-
@import "../components/bs5/backToTop/backToTop";
|
|
97
100
|
@import "../components/bs5/banner/banner";
|
|
98
101
|
@import "../components/bs5/blockquote/blockquote";
|
|
99
102
|
@import "../components/bs5/breadcrumbs/breadcrumbs";
|
|
@@ -107,6 +110,7 @@ $enable-dark-mode: true;
|
|
|
107
110
|
@import "../components/bs5/formcheck/formcheck";
|
|
108
111
|
@import "../components/bs5/footer/footer";
|
|
109
112
|
@import "../components/bs5/globalAlert/globalAlert";
|
|
113
|
+
@import "../components/bs5/iconLink/iconLink";
|
|
110
114
|
@import "../components/bs5/header/header";
|
|
111
115
|
@import "../components/bs5/icons/icons";
|
|
112
116
|
@import "../components/bs5/inpageAlert/inpageAlert";
|
|
@@ -129,9 +133,6 @@ $enable-dark-mode: true;
|
|
|
129
133
|
@import "../components/bs5/typography/typography";
|
|
130
134
|
@import "../components/bs5/video/video";
|
|
131
135
|
|
|
132
|
-
// Common Layout Blocks, under review
|
|
133
|
-
@import "../components/common/layout/content";
|
|
134
|
-
|
|
135
136
|
// Themes
|
|
136
137
|
@import "qld-theme";
|
|
137
138
|
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
@import "@qld-gov-au/qgds-tokens/dist/scss/_map.scss";
|
|
11
11
|
|
|
12
12
|
//QLD Names Colours
|
|
13
|
-
$qld-dark-blue
|
|
14
|
-
$qld-sapphire-blue
|
|
15
|
-
$qld-light-blue
|
|
16
|
-
$qld-light-green
|
|
17
|
-
$qld-dark-green
|
|
18
|
-
$qld-golden-yellow
|
|
19
|
-
$qld-maroon-traditional
|
|
20
|
-
$qld-maroon-modern
|
|
13
|
+
$qld-dark-blue: $core-default-color-brand-primary-dark-blue;
|
|
14
|
+
$qld-sapphire-blue: $core-default-color-brand-primary-sapphire-blue;
|
|
15
|
+
$qld-light-blue: $core-default-color-brand-primary-light-blue;
|
|
16
|
+
$qld-light-green: $core-default-color-brand-primary-light-green;
|
|
17
|
+
$qld-dark-green: $core-default-color-brand-secondary-darkgreen;
|
|
18
|
+
$qld-golden-yellow: $core-default-color-brand-secondary-golden-yellow;
|
|
19
|
+
$qld-maroon-traditional: $core-default-color-brand-other-gov-maroon;
|
|
20
|
+
$qld-maroon-modern: $core-default-color-brand-other-modern-maroon;
|
|
21
21
|
$qld-dark-text: $color-default-color-dark-text-default;
|
|
22
22
|
$qld-dark-border: $color-default-color-dark-border-default;
|
|
23
23
|
$qld-dark-alt-border: $color-default-color-dark-border-alt;
|
|
@@ -26,7 +26,7 @@ $qld-general-info-alert: $core-default-color-status-info-lighter;
|
|
|
26
26
|
$qld-red-border: $core-default-color-status-error-darker;
|
|
27
27
|
$qld-blue-border: $color-default-color-light-border-light;
|
|
28
28
|
$qld-yellow-border: $core-default-color-status-caution-darker;
|
|
29
|
-
$qld-dark-blue-shade
|
|
29
|
+
$qld-dark-blue-shade: $color-default-color-dark-background-alt-shade;
|
|
30
30
|
$qld-light-background: $core-default-color-status-info-lightest;
|
|
31
31
|
$qld-light-background-shade: $color-default-color-light-background-light-shade;
|
|
32
32
|
$qld-light-border: $color-default-color-light-border-default;
|
|
@@ -43,27 +43,27 @@ $qld-link-underline-dark: $color-default-color-dark-underline-default;
|
|
|
43
43
|
$qld-link-underline-hover-dark: $color-default-color-dark-underline-default-hover;
|
|
44
44
|
$qld-link-underline-visited-dark: $color-default-color-dark-underline-visited;
|
|
45
45
|
$qld-link-underline-visited-hover-dark: $color-default-color-dark-underline-visited-hover;
|
|
46
|
-
///
|
|
46
|
+
///
|
|
47
47
|
$qld-link-visited: $color-default-color-light-underline-visited;
|
|
48
48
|
$qld-link-visited-dark: $color-default-color-dark-underline-visited;
|
|
49
|
-
$qld-text-darkest
|
|
50
|
-
$qld-dark-hover
|
|
49
|
+
$qld-text-darkest: $color-default-color-dark-link-on-action;
|
|
50
|
+
$qld-dark-hover: $color-default-color-dark-background-default-shade;
|
|
51
51
|
|
|
52
|
-
$qld-text-light-blue-dark
|
|
53
|
-
$qld-light-green-dark
|
|
54
|
-
$qld-dark-green-dark
|
|
55
|
-
$qld-light-yellow
|
|
56
|
-
$qld-button-dark-blue
|
|
52
|
+
$qld-text-light-blue-dark: $core-default-color-brand-primary-dark-blue;
|
|
53
|
+
$qld-light-green-dark: $core-default-color-brand-primary-light-green;
|
|
54
|
+
$qld-dark-green-dark: $color-default-color-dark-action-primary;
|
|
55
|
+
$qld-light-yellow: $core-default-color-status-caution-lightest;
|
|
56
|
+
$qld-button-dark-blue: $color-default-color-light-action-primary-hover;
|
|
57
57
|
|
|
58
58
|
//QGOV Brand Mapping - QLD.GOV.AU
|
|
59
|
-
$qld-brand-primary-dark
|
|
60
|
-
$qld-brand-primary
|
|
61
|
-
$qld-brand-primary-light
|
|
62
|
-
$qld-brand-secondary-dark
|
|
63
|
-
$qld-brand-secondary
|
|
64
|
-
$qld-brand-accent
|
|
65
|
-
|
|
66
|
-
// Resolves @qgds-tokens V1 gap between (_variables.scss and _map.scss).
|
|
59
|
+
$qld-brand-primary-dark: $qld-dark-blue;
|
|
60
|
+
$qld-brand-primary: $qld-sapphire-blue;
|
|
61
|
+
$qld-brand-primary-light: $qld-light-blue;
|
|
62
|
+
$qld-brand-secondary-dark: $qld-dark-green;
|
|
63
|
+
$qld-brand-secondary: $qld-light-green;
|
|
64
|
+
$qld-brand-accent: $qld-golden-yellow;
|
|
65
|
+
|
|
66
|
+
// Resolves @qgds-tokens V1 gap between (_variables.scss and _map.scss).
|
|
67
67
|
// Nuetrals were dropped from _variables.scss, but retained in _map.scss.
|
|
68
68
|
$core-default-color-neutral-black: #131212;
|
|
69
69
|
$core-default-color-neutral-darkest: #222020;
|
|
@@ -74,43 +74,40 @@ $core-default-color-neutral-lighter: #ebebeb;
|
|
|
74
74
|
$core-default-color-neutral-lightest: #f5f5f5;
|
|
75
75
|
$core-default-color-neutral-white: #ffffff;
|
|
76
76
|
|
|
77
|
-
|
|
78
77
|
//Greys
|
|
79
|
-
$qld-system-darkest
|
|
80
|
-
$qld-dark-grey
|
|
81
|
-
$qld-medium-grey
|
|
82
|
-
$qld-alt-grey
|
|
78
|
+
$qld-system-darkest: $core-default-color-neutral-darkest;
|
|
79
|
+
$qld-dark-grey: $core-default-color-neutral-darker;
|
|
80
|
+
$qld-medium-grey: $core-default-color-neutral-dark;
|
|
81
|
+
$qld-alt-grey: $core-default-color-neutral-light;
|
|
83
82
|
$qld-light-link: $color-default-color-light-link-default;
|
|
84
83
|
$qld-dark-link: $color-default-color-dark-link-default;
|
|
85
84
|
|
|
86
85
|
//Should be core color rather than second hand reference (no match)
|
|
87
86
|
$qld-soft-grey: $color-default-color-light-border-alt; //todo, replace soft-greys across the system with the below color
|
|
88
87
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
$qld-dark-grey-muted : $color-default-color-light-text-lighter;
|
|
92
|
-
$qld-text-grey : $color-default-color-light-text-default;
|
|
88
|
+
$qld-dark-grey-muted: $color-default-color-light-text-lighter;
|
|
89
|
+
$qld-text-grey: $color-default-color-light-text-default;
|
|
93
90
|
$qld-hint-text-color: $color-default-color-light-text-lighter;
|
|
94
91
|
$qld-hint-text-color-muted: $color-default-color-dark-text-lighter;
|
|
95
92
|
$qld-color-dark-button-hover: $core-default-color-brand-primary-light-green;
|
|
96
|
-
$qld-text-headings
|
|
97
|
-
$qld-grey
|
|
98
|
-
$qld-light-grey
|
|
99
|
-
$qld-light-grey-alt
|
|
100
|
-
$qld-extra-light-grey
|
|
101
|
-
$qld-white
|
|
102
|
-
$qld-white-underline
|
|
103
|
-
$qld-dark-underline
|
|
93
|
+
$qld-text-headings: $color-default-color-light-text-heading;
|
|
94
|
+
$qld-grey: $core-default-color-neutral-light;
|
|
95
|
+
$qld-light-grey: $core-default-color-neutral-lighter;
|
|
96
|
+
$qld-light-grey-alt: $color-default-color-light-background-alt;
|
|
97
|
+
$qld-extra-light-grey: $core-default-color-neutral-lightest;
|
|
98
|
+
$qld-white: $core-default-color-neutral-white;
|
|
99
|
+
$qld-white-underline: $core-default-color-status-underline-light;
|
|
100
|
+
$qld-dark-underline: $core-default-color-status-underline-dark;
|
|
104
101
|
$qld-maroon-traditional: $core-default-color-brand-other-gov-maroon;
|
|
105
|
-
$qld-maroon-modern
|
|
106
|
-
$qld-notify-warning
|
|
102
|
+
$qld-maroon-modern: $core-default-color-brand-other-modern-maroon;
|
|
103
|
+
$qld-notify-warning: $core-default-color-status-error-default;
|
|
107
104
|
$qld-notify-information: $core-default-color-status-info-default;
|
|
108
|
-
$qld-notify-success
|
|
109
|
-
$qld-notify-alert
|
|
110
|
-
$qld-syntax-values
|
|
111
|
-
$qld-syntax-elements
|
|
112
|
-
$qld-syntax-properties
|
|
113
|
-
$qld-syntax-comments
|
|
105
|
+
$qld-notify-success: $core-default-color-status-success-default;
|
|
106
|
+
$qld-notify-alert: $core-default-color-status-caution-default;
|
|
107
|
+
$qld-syntax-values: $core-default-color-brand-primary-light-green;
|
|
108
|
+
$qld-syntax-elements: $core-default-color-code-light-blue;
|
|
109
|
+
$qld-syntax-properties: $core-default-color-code-violet;
|
|
110
|
+
$qld-syntax-comments: $core-default-color-code-muted;
|
|
114
111
|
$qld-textbox-border-color: $color-default-color-light-action-primary-hover;
|
|
115
112
|
$qld-color-error-light: $core-default-color-status-error-lightest;
|
|
116
113
|
$qld-color-success-light: $core-default-color-status-success-lightest;
|
|
@@ -139,23 +136,23 @@ $qld-dark-action-secondary: $core-default-color-brand-secondary-golden-yellow;
|
|
|
139
136
|
$qld-dark-action-secondary-hover: $color-default-color-dark-action-secondary-hover;
|
|
140
137
|
$qld-dark-action-text: $color-default-color-dark-link-on-action;
|
|
141
138
|
|
|
142
|
-
$primary
|
|
143
|
-
$primary-dark
|
|
144
|
-
$secondary
|
|
145
|
-
$success
|
|
146
|
-
$info
|
|
147
|
-
$warning
|
|
148
|
-
$danger
|
|
149
|
-
$light
|
|
150
|
-
$dark
|
|
139
|
+
$primary: $qld-brand-primary;
|
|
140
|
+
$primary-dark: $qld-brand-primary-dark;
|
|
141
|
+
$secondary: $qld-dark-green;
|
|
142
|
+
$success: $qld-notify-success;
|
|
143
|
+
$info: $qld-notify-information;
|
|
144
|
+
$warning: $qld-notify-alert;
|
|
145
|
+
$danger: $qld-notify-warning;
|
|
146
|
+
$light: $qld-extra-light-grey;
|
|
147
|
+
$dark: $qld-dark-grey;
|
|
151
148
|
|
|
152
149
|
$qld-fluid-width-full: 100%;
|
|
153
150
|
$qld-fluid-width-3-quarters: 75%;
|
|
154
151
|
$qld-fluid-width-half: 48.5%;
|
|
155
152
|
$qld-fluid-width-1-quarter: 25%;
|
|
156
153
|
|
|
157
|
-
$color-default-color-dark-underline-default: #
|
|
158
|
-
$color-default-color-dark-underline-default-hover: #
|
|
154
|
+
$color-default-color-dark-underline-default: #ffffff;
|
|
155
|
+
$color-default-color-dark-underline-default-hover: #ffffff;
|
|
159
156
|
|
|
160
157
|
// Project-specific colors map for generating CSS custom properties only
|
|
161
158
|
// These will NOT create utility classes, only CSS variables on :root
|
|
@@ -247,7 +244,6 @@ $project-colors: (
|
|
|
247
244
|
"dark-alt-background": $qld-color-dark-alt-background,
|
|
248
245
|
"dark-alt-background-shade": $qld-color-dark-alt-background--shade,
|
|
249
246
|
|
|
250
|
-
|
|
251
247
|
//Text
|
|
252
248
|
"light-text-heading": $color-default-color-light-text-heading,
|
|
253
249
|
"light-text-text": $color-default-color-light-text-default,
|
|
@@ -256,7 +252,6 @@ $project-colors: (
|
|
|
256
252
|
"dark-text-text": $color-default-color-dark-text-default,
|
|
257
253
|
"dark-text-lighter": $color-default-color-dark-text-lighter,
|
|
258
254
|
|
|
259
|
-
|
|
260
255
|
// Desing Tokens V1 dependent variables
|
|
261
256
|
"light-accent": $color-default-color-light-accent-design-accent,
|
|
262
257
|
"dark-accent": $color-default-color-dark-accent-design-accent,
|
|
@@ -273,9 +268,11 @@ $project-colors: (
|
|
|
273
268
|
|
|
274
269
|
// Underlines
|
|
275
270
|
"light-underline-default": $color-default-color-light-underline-default,
|
|
276
|
-
"light-underline-default-hover":
|
|
271
|
+
"light-underline-default-hover":
|
|
272
|
+
$color-default-color-light-underline-default-hover,
|
|
277
273
|
"dark-underline-default": $color-default-color-dark-underline-default,
|
|
278
|
-
"dark-underline-default-hover":
|
|
274
|
+
"dark-underline-default-hover":
|
|
275
|
+
$color-default-color-dark-underline-default-hover,
|
|
279
276
|
);
|
|
280
277
|
|
|
281
278
|
$project-base-colors: (
|
|
@@ -302,7 +299,7 @@ $project-base-colors: (
|
|
|
302
299
|
"light-yellow": $qld-light-yellow,
|
|
303
300
|
"button-dark-blue": $qld-button-dark-blue,
|
|
304
301
|
"text-darkest": $qld-text-darkest,
|
|
305
|
-
"dark-hover"
|
|
302
|
+
"dark-hover": $qld-dark-hover
|
|
306
303
|
);
|
|
307
304
|
|
|
308
305
|
// Generate CSS custom properties for qld-tokens & project colours on :root to prevent utility class generation
|
|
@@ -319,37 +316,61 @@ $grid-breakpoints: (
|
|
|
319
316
|
sm: 400px,
|
|
320
317
|
md: 700px,
|
|
321
318
|
lg: 992px,
|
|
322
|
-
xl: 1312px
|
|
319
|
+
xl: 1312px,
|
|
323
320
|
);
|
|
324
321
|
|
|
325
322
|
// Map merge to include custom breakpoints
|
|
326
323
|
$breakpoints: map-merge($grid-breakpoints, ());
|
|
327
324
|
|
|
325
|
+
// Gutters inside rows (column gutters)
|
|
326
|
+
$grid-gutter-width: 2rem;
|
|
327
|
+
|
|
328
328
|
// Default border radius
|
|
329
329
|
$border-radius: 0.25rem;
|
|
330
330
|
$border-radius-sm: 0.25rem;
|
|
331
331
|
$border-radius-lg: 0.25rem;
|
|
332
332
|
|
|
333
333
|
// QGOV Borders
|
|
334
|
-
$qld-border-width-thin
|
|
335
|
-
$qld-border-width-default
|
|
336
|
-
$qld-border-width-medium
|
|
337
|
-
$qld-border-width-thick
|
|
338
|
-
$qld-border-width-extra-thick
|
|
334
|
+
$qld-border-width-thin: 1px;
|
|
335
|
+
$qld-border-width-default: 2px;
|
|
336
|
+
$qld-border-width-medium: 3px;
|
|
337
|
+
$qld-border-width-thick: 4px;
|
|
338
|
+
$qld-border-width-extra-thick: 8px;
|
|
339
339
|
|
|
340
340
|
// Extended spacers to procude 8px and 16px increments
|
|
341
341
|
// use px-16, py-sm-16, ml-40, mr-40, etc
|
|
342
342
|
$qld-custom-spacers: (
|
|
343
|
+
12: (
|
|
344
|
+
$spacer * 0.75,
|
|
345
|
+
),
|
|
343
346
|
16: $spacer,
|
|
344
|
-
20: (
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
347
|
+
20: (
|
|
348
|
+
$spacer * 1.25,
|
|
349
|
+
),
|
|
350
|
+
24: (
|
|
351
|
+
$spacer * 1.5,
|
|
352
|
+
),
|
|
353
|
+
32: (
|
|
354
|
+
$spacer * 2,
|
|
355
|
+
),
|
|
356
|
+
40: (
|
|
357
|
+
$spacer * 2.5,
|
|
358
|
+
),
|
|
359
|
+
48: (
|
|
360
|
+
$spacer * 3,
|
|
361
|
+
),
|
|
362
|
+
56: (
|
|
363
|
+
$spacer * 3.5,
|
|
364
|
+
),
|
|
365
|
+
64: (
|
|
366
|
+
$spacer * 4,
|
|
367
|
+
),
|
|
368
|
+
72: (
|
|
369
|
+
$spacer * 4.5,
|
|
370
|
+
),
|
|
371
|
+
80: (
|
|
372
|
+
$spacer * 5,
|
|
373
|
+
),
|
|
353
374
|
);
|
|
354
375
|
|
|
355
376
|
$spacers: map-merge($spacers, $qld-custom-spacers);
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
/* global Handlebars */
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param {
|
|
5
|
-
* @
|
|
4
|
+
*
|
|
5
|
+
* @param {*} v1 The left value
|
|
6
|
+
* @param { "==" | "===" | "!=" | "!==" | "<" | "<=" | ">" | ">=" | "&&" | "||" | "contains"} operator the operator to handle comparison
|
|
7
|
+
* @param {*} v2 The right value
|
|
8
|
+
* @param {Object} options handlebars-provided options object
|
|
9
|
+
* @returns {string} handlebars template block string
|
|
10
|
+
* @example
|
|
11
|
+
* {{#ifCond value1 "===" value2}}
|
|
12
|
+
* <!-- Content to render if condition is true -->
|
|
13
|
+
* <p>Value1 is strictly equal to Value2</p>
|
|
14
|
+
* {{else}}
|
|
15
|
+
* <!-- Content to render if condition is false -->
|
|
16
|
+
* <p>Value1 is not strictly equal to Value2</p>
|
|
17
|
+
* {{/ifCond}}
|
|
6
18
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// contains - if first object is in collection (second object) to return true
|
|
10
|
-
handlebars.registerHelper("contains", function (needle, haystack, options) {
|
|
11
|
-
needle = handlebars.escapeExpression(needle);
|
|
12
|
-
haystack = handlebars.escapeExpression(haystack);
|
|
13
|
-
return haystack.indexOf(needle) > -1
|
|
14
|
-
? options.fn(this)
|
|
15
|
-
: options.inverse(this);
|
|
16
|
-
});
|
|
17
|
-
// ifCond - checks conditions
|
|
18
|
-
handlebars.registerHelper("ifCond", function (v1, operator, v2, options) {
|
|
19
|
-
switch (operator) {
|
|
19
|
+
function ifCond(v1, operator, v2, options) {
|
|
20
|
+
switch (operator) {
|
|
20
21
|
case "==":
|
|
21
22
|
return v1 == v2 ? options.fn(this) : options.inverse(this);
|
|
22
23
|
case "===":
|
|
@@ -45,8 +46,26 @@ export default function handlebarsHelpers(handlebars) {
|
|
|
45
46
|
} else return options.inverse(this);
|
|
46
47
|
default:
|
|
47
48
|
return options.inverse(this);
|
|
48
|
-
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Registers Handlebars Helpers
|
|
53
|
+
* @param {Handlebars} handlebars Templating engine
|
|
54
|
+
* @returns {void} Result of the helper operation
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
export default function handlebarsHelpers(handlebars) {
|
|
58
|
+
// contains - if first object is in collection (second object) to return true
|
|
59
|
+
handlebars.registerHelper("contains", function (needle, haystack, options) {
|
|
60
|
+
needle = handlebars.escapeExpression(needle);
|
|
61
|
+
haystack = handlebars.escapeExpression(haystack);
|
|
62
|
+
return haystack.indexOf(needle) > -1
|
|
63
|
+
? options.fn(this)
|
|
64
|
+
: options.inverse(this);
|
|
49
65
|
});
|
|
66
|
+
|
|
67
|
+
handlebars.registerHelper("ifCond", ifCond);
|
|
68
|
+
|
|
50
69
|
// isType - Checks is expected type
|
|
51
70
|
handlebars.registerHelper("isType", function (value, expected, options) {
|
|
52
71
|
if (value === expected) {
|
|
@@ -101,12 +120,12 @@ export default function handlebarsHelpers(handlebars) {
|
|
|
101
120
|
var year = date.getFullYear();
|
|
102
121
|
// Format date based on the format string
|
|
103
122
|
switch (format) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
123
|
+
case "YYYY":
|
|
124
|
+
return `${year}`;
|
|
125
|
+
case "MMMM YYYY":
|
|
126
|
+
return `${month} ${year}`;
|
|
127
|
+
default:
|
|
128
|
+
return `${day} ${month} ${year}`;
|
|
110
129
|
}
|
|
111
130
|
},
|
|
112
131
|
);
|
|
@@ -198,27 +217,21 @@ export default function handlebarsHelpers(handlebars) {
|
|
|
198
217
|
return durationString;
|
|
199
218
|
});
|
|
200
219
|
|
|
201
|
-
// helper for extending components to set overridable data values
|
|
202
|
-
// if the value is not set in the component data.json, it will use the hds data value
|
|
203
|
-
handlebars.registerHelper('isdefined', function (value, defaultValue) {
|
|
204
|
-
return value !== undefined ? value : defaultValue;
|
|
205
|
-
});
|
|
206
|
-
|
|
207
220
|
/**
|
|
208
221
|
* Helper for extending components to set overridable data values
|
|
209
222
|
* If the value is not set in the component data.json, it will use the hds data value
|
|
210
|
-
*
|
|
223
|
+
*
|
|
211
224
|
* @param {string} value - The value to check if it is defined
|
|
212
225
|
* @param {string} defaultValue - The default value to return if value is not defined
|
|
213
226
|
* @returns {string} - The value if it is defined, otherwise the default value
|
|
214
227
|
*/
|
|
215
|
-
handlebars.registerHelper(
|
|
228
|
+
handlebars.registerHelper("isdefined", function (value, defaultValue) {
|
|
216
229
|
return value !== undefined && value !== "" ? value : defaultValue;
|
|
217
230
|
});
|
|
218
231
|
|
|
219
232
|
/**
|
|
220
233
|
* Used to get class names added to an element based on their boolean values in an array
|
|
221
|
-
*
|
|
234
|
+
*
|
|
222
235
|
* @param {string} names - Comma-separated list of class names to check for
|
|
223
236
|
* @param {array} array - Array of objects to check for true values
|
|
224
237
|
* @returns {string} - Space-separated list of class names that have true values
|
|
@@ -233,7 +246,7 @@ export default function handlebarsHelpers(handlebars) {
|
|
|
233
246
|
for (let i = 0; i < nameList.length; i++) {
|
|
234
247
|
let name = nameList[i];
|
|
235
248
|
// Check if any item in the array matches the name and is true
|
|
236
|
-
if(array){
|
|
249
|
+
if (array) {
|
|
237
250
|
for (let j = 0; j < array.length; j++) {
|
|
238
251
|
if (array[j][name] === true) {
|
|
239
252
|
matchedItems.push(name); // Add to matchedItems if found and true
|
|
@@ -251,19 +264,18 @@ export default function handlebarsHelpers(handlebars) {
|
|
|
251
264
|
}
|
|
252
265
|
});
|
|
253
266
|
|
|
254
|
-
|
|
255
267
|
handlebars.registerHelper("join", function (theArray, separator) {
|
|
256
268
|
// Handle if a separator is not provided
|
|
257
269
|
if (!separator || typeof separator !== "string") {
|
|
258
270
|
separator = " ";
|
|
259
271
|
}
|
|
260
|
-
|
|
272
|
+
|
|
261
273
|
// If theArray is not an array, return it as is, otherwise join it
|
|
262
274
|
return !Array.isArray(theArray) ? theArray : theArray.join(separator);
|
|
263
275
|
});
|
|
264
|
-
|
|
265
|
-
handlebars.registerHelper(
|
|
266
|
-
if (typeof text !==
|
|
276
|
+
|
|
277
|
+
handlebars.registerHelper("toCamelCase", function (text) {
|
|
278
|
+
if (typeof text !== "string") return text;
|
|
267
279
|
|
|
268
280
|
// Remove whitespace and convert to camelCase
|
|
269
281
|
return text
|
|
@@ -271,9 +283,8 @@ export default function handlebarsHelpers(handlebars) {
|
|
|
271
283
|
.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, (match, index) =>
|
|
272
284
|
index === 0 ? match.toLowerCase() : match.toUpperCase(),
|
|
273
285
|
)
|
|
274
|
-
.replace(/\s+/g,
|
|
286
|
+
.replace(/\s+/g, ""); // Remove all spaces
|
|
275
287
|
});
|
|
276
|
-
|
|
277
288
|
}
|
|
278
289
|
|
|
279
290
|
if (typeof Handlebars !== "undefined") {
|
|
@@ -11,6 +11,7 @@ import button from "../components/bs5/button/button.hbs?raw";
|
|
|
11
11
|
import callToAction from "../components/bs5/callToAction/callToAction.hbs?raw";
|
|
12
12
|
import callout from "../components/bs5/callout/callout.hbs?raw";
|
|
13
13
|
import card from "../components/bs5/card/card.hbs?raw";
|
|
14
|
+
import containerLayout from "../components/bs5/containerLayout/containerLayout.hbs?raw";
|
|
14
15
|
import contentFooter from "../components/bs5/contentFooter/contentFooter.hbs?raw";
|
|
15
16
|
import contentFooterWrapper from "../components/bs5/contentFooterWrapper/contentFooterWrapper.hbs?raw";
|
|
16
17
|
import contentWrapper from "../components/bs5/contentWrapper/contentWrapper.hbs?raw";
|
|
@@ -24,17 +25,24 @@ import fullPage from "../components/bs5/fullPageWrapper/fullPage.hbs?raw";
|
|
|
24
25
|
import globalAlert from "../components/bs5/globalAlert/globalAlert.hbs?raw";
|
|
25
26
|
import head from "../components/bs5/head/head.hbs?raw";
|
|
26
27
|
import header from "../components/bs5/header/header.hbs?raw";
|
|
28
|
+
import iconLink from "../components/bs5/iconLink/iconLink.hbs?raw";
|
|
27
29
|
import icon from "../components/bs5/icons/icon.hbs?raw";
|
|
28
30
|
import image from "../components/bs5/image/image.hbs?raw";
|
|
29
31
|
import inpageAlert from "../components/bs5/inpageAlert/inpageAlert.hbs?raw";
|
|
30
32
|
import inpagenav from "../components/bs5/inpagenav/inpagenav.hbs?raw";
|
|
31
33
|
import linkColumns from "../components/bs5/linkColumns/linkColumns.hbs?raw";
|
|
34
|
+
import logo from "../components/bs5/logo/logo.hbs?raw";
|
|
35
|
+
import logoCOALandscape from "../components/bs5/logo/logoCOALandscape.hbs?raw";
|
|
36
|
+
import logoCOALandscape2Lines from "../components/bs5/logo/logoCOALandscape2Lines.hbs?raw";
|
|
32
37
|
import mainContainerWrapper from "../components/bs5/mainContainerWrapper/mainContainerWrapper.hbs?raw";
|
|
33
38
|
import metaDcTerms from "../components/bs5/metaDcTerms/metaDcTerms.hbs?raw";
|
|
34
39
|
import metaOpenGraph from "../components/bs5/metaOpenGraph/metaOpenGraph.hbs?raw";
|
|
35
40
|
import modal from "../components/bs5/modal/modal.hbs?raw";
|
|
36
41
|
import navbar from "../components/bs5/navbar/navbar.hbs?raw";
|
|
37
42
|
import pageLayout from "../components/bs5/pageLayout/pageLayout.hbs?raw";
|
|
43
|
+
import contentPageWithForm from "../components/bs5/pageLayout/templates/contentPageWithForm.hbs?raw";
|
|
44
|
+
import contentPageWithSideNavigation from "../components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs?raw";
|
|
45
|
+
import fullWidthLandingPage from "../components/bs5/pageLayout/templates/fullWidthLandingPage.hbs?raw";
|
|
38
46
|
import pagination from "../components/bs5/pagination/pagination.hbs?raw";
|
|
39
47
|
import promotionalPanel from "../components/bs5/promotionalPanel/promotionalPanel.hbs?raw";
|
|
40
48
|
import quickexit from "../components/bs5/quickexit/quickexit.hbs?raw";
|
|
@@ -69,6 +77,7 @@ export default function handlebarsPartials(handlebars) {
|
|
|
69
77
|
handlebars.registerPartial("callToAction", callToAction);
|
|
70
78
|
handlebars.registerPartial("callout", callout);
|
|
71
79
|
handlebars.registerPartial("card", card);
|
|
80
|
+
handlebars.registerPartial("containerLayout", containerLayout);
|
|
72
81
|
handlebars.registerPartial("contentFooter", contentFooter);
|
|
73
82
|
handlebars.registerPartial("contentFooterWrapper", contentFooterWrapper);
|
|
74
83
|
handlebars.registerPartial("contentWrapper", contentWrapper);
|
|
@@ -82,17 +91,24 @@ export default function handlebarsPartials(handlebars) {
|
|
|
82
91
|
handlebars.registerPartial("globalAlert", globalAlert);
|
|
83
92
|
handlebars.registerPartial("head", head);
|
|
84
93
|
handlebars.registerPartial("header", header);
|
|
94
|
+
handlebars.registerPartial("iconLink", iconLink);
|
|
85
95
|
handlebars.registerPartial("icon", icon);
|
|
86
96
|
handlebars.registerPartial("image", image);
|
|
87
97
|
handlebars.registerPartial("inpageAlert", inpageAlert);
|
|
88
98
|
handlebars.registerPartial("inpagenav", inpagenav);
|
|
89
99
|
handlebars.registerPartial("linkColumns", linkColumns);
|
|
100
|
+
handlebars.registerPartial("logo", logo);
|
|
101
|
+
handlebars.registerPartial("logoCOALandscape", logoCOALandscape);
|
|
102
|
+
handlebars.registerPartial("logoCOALandscape2Lines", logoCOALandscape2Lines);
|
|
90
103
|
handlebars.registerPartial("mainContainerWrapper", mainContainerWrapper);
|
|
91
104
|
handlebars.registerPartial("metaDcTerms", metaDcTerms);
|
|
92
105
|
handlebars.registerPartial("metaOpenGraph", metaOpenGraph);
|
|
93
106
|
handlebars.registerPartial("modal", modal);
|
|
94
107
|
handlebars.registerPartial("navbar", navbar);
|
|
95
108
|
handlebars.registerPartial("pageLayout", pageLayout);
|
|
109
|
+
handlebars.registerPartial("contentPageWithForm", contentPageWithForm);
|
|
110
|
+
handlebars.registerPartial("contentPageWithSideNavigation", contentPageWithSideNavigation);
|
|
111
|
+
handlebars.registerPartial("fullWidthLandingPage", fullWidthLandingPage);
|
|
96
112
|
handlebars.registerPartial("pagination", pagination);
|
|
97
113
|
handlebars.registerPartial("promotionalPanel", promotionalPanel);
|
|
98
114
|
handlebars.registerPartial("quickexit", quickexit);
|
package/src/js/qld.bootstrap.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
videoTranscriptTitle,
|
|
9
9
|
} from "./../components/bs5/video/video.functions";
|
|
10
10
|
import { initializeNavbar } from "./../components/bs5/navbar/navbar.functions";
|
|
11
|
-
import { initBreadcrumb } from "./../components/bs5/breadcrumbs/
|
|
11
|
+
import { initBreadcrumb } from "./../components/bs5/breadcrumbs/breadcrumbs.functions";
|
|
12
12
|
import {
|
|
13
13
|
positionQuickExit,
|
|
14
14
|
initQuickexit,
|
|
@@ -69,18 +69,24 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
|
69
69
|
clearTimeout(timeout);
|
|
70
70
|
timeout = setTimeout(() => {
|
|
71
71
|
const value = e.target.value.trim();
|
|
72
|
-
showSuggestions(value, value ===
|
|
72
|
+
showSuggestions(value, value === "", form);
|
|
73
73
|
}, 300);
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
// Add focus event listener to the search input
|
|
77
77
|
searchInput.addEventListener("focus", function () {
|
|
78
78
|
const suggestions = form.querySelector(".suggestions");
|
|
79
|
-
const dynamicSuggestionsContainer = form.querySelector(
|
|
79
|
+
const dynamicSuggestionsContainer = form.querySelector(
|
|
80
|
+
".dynamic-suggestions",
|
|
81
|
+
);
|
|
80
82
|
|
|
81
83
|
if (this.value.trim() === "") {
|
|
82
84
|
showSuggestions("", true, form);
|
|
83
|
-
} else if (
|
|
85
|
+
} else if (
|
|
86
|
+
suggestions &&
|
|
87
|
+
dynamicSuggestionsContainer &&
|
|
88
|
+
dynamicSuggestionsContainer.innerHTML.trim() !== ""
|
|
89
|
+
) {
|
|
84
90
|
// Only show existing suggestions if there are actual dynamic suggestions populated
|
|
85
91
|
suggestions.classList.remove("d-none");
|
|
86
92
|
}
|
|
@@ -89,13 +95,15 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
|
89
95
|
const suggestions = form.querySelector(".suggestions");
|
|
90
96
|
// If there is no suggestions renderred, do not add event listener to the document
|
|
91
97
|
if (suggestions) {
|
|
92
|
-
|
|
93
98
|
// Helper function to determine if suggestions should be hidden on focus change
|
|
94
99
|
const shouldHideSuggestions = (newFocusTarget) => {
|
|
95
100
|
if (!newFocusTarget) return true;
|
|
96
101
|
|
|
97
|
-
const isFocusInsideInput =
|
|
98
|
-
|
|
102
|
+
const isFocusInsideInput =
|
|
103
|
+
searchInput.contains(newFocusTarget) ||
|
|
104
|
+
searchInput === newFocusTarget;
|
|
105
|
+
const isFocusInsideSuggestions =
|
|
106
|
+
suggestions.contains(newFocusTarget);
|
|
99
107
|
|
|
100
108
|
return !isFocusInsideInput && !isFocusInsideSuggestions;
|
|
101
109
|
};
|
|
@@ -110,10 +118,10 @@ window.addEventListener("DOMContentLoaded", () => {
|
|
|
110
118
|
};
|
|
111
119
|
|
|
112
120
|
// Attach focusout event listener to search input
|
|
113
|
-
searchInput.addEventListener(
|
|
121
|
+
searchInput.addEventListener("focusout", handleFocusOut);
|
|
114
122
|
|
|
115
123
|
// Attach focusout event listener to suggestions container
|
|
116
|
-
suggestions.addEventListener(
|
|
124
|
+
suggestions.addEventListener("focusout", handleFocusOut);
|
|
117
125
|
} else {
|
|
118
126
|
console.warn("Required suggestions elements not found.");
|
|
119
127
|
}
|