@qld-gov-au/qgds-bootstrap5 1.0.21 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.esbuild/helpers/listFilesHbs.js +54 -0
- package/.esbuild/helpers/logger.js +1 -0
- package/.esbuild/plugins/qgds-plugin-build-log.js +22 -14
- package/.esbuild/plugins/qgds-plugin-copy-assets.js +18 -19
- package/.esbuild/plugins/qgds-plugin-handlebar-partial-builder.js +2 -2
- package/.esbuild/plugins/qgds-plugin-version.js +44 -15
- package/dist/README.md +128 -0
- package/dist/assets/components/bs5/accordion/accordion.hbs +28 -0
- package/dist/assets/components/bs5/banner/banner.hbs +29 -0
- package/dist/assets/components/bs5/blockquote/blockquote.hbs +13 -0
- package/dist/assets/components/bs5/breadcrumbs/breadcrumbs.hbs +16 -0
- package/dist/assets/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.hbs +11 -0
- package/dist/assets/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.test.hbs +7 -0
- package/dist/assets/components/bs5/button/button.hbs +31 -0
- package/dist/assets/components/bs5/callout/callout.hbs +8 -0
- package/dist/assets/components/bs5/card/card.hbs +66 -0
- package/dist/assets/components/bs5/contentFooter/contentFooter.hbs +4 -0
- package/dist/assets/components/bs5/contentFooterWrapper/contentFooterWrapper.hbs +5 -0
- package/dist/assets/components/bs5/contentFooterWrapper/contentFooterWrapper.test.hbs +13 -0
- package/dist/assets/components/bs5/contentWrapper/contentWrapper.hbs +5 -0
- package/dist/assets/components/bs5/contentWrapper/contentWrapper.test.hbs +12 -0
- package/dist/assets/components/bs5/correctincorrect/correctincorrect.hbs +0 -0
- package/dist/assets/components/bs5/dateinput/dateinput.hbs +64 -0
- package/dist/assets/components/bs5/footer/footer.hbs +351 -0
- package/dist/assets/components/bs5/footer/footerForgov.hbs +267 -0
- package/dist/assets/components/bs5/formcheck/formcheck.hbs +23 -0
- package/dist/assets/components/bs5/fullPageWrapper/fullPage.hbs +16 -0
- package/dist/assets/components/bs5/fullPageWrapper/fullPage.test.hbs +4 -0
- package/dist/assets/components/bs5/globalAlert/globalAlert.hbs +24 -0
- package/dist/assets/components/bs5/head/head.hbs +11 -0
- package/dist/{components/handlebars.init.min.js → assets/components/bs5/header/header.hbs} +2 -1741
- package/dist/assets/components/bs5/inpageAlert/inpageAlert.hbs +6 -0
- package/dist/assets/components/bs5/inpagenav/inpagenav.hbs +15 -0
- package/dist/assets/components/bs5/mainContainerWrapper/mainContainerWrapper.hbs +28 -0
- package/dist/assets/components/bs5/mainContainerWrapper/mainContainerWrapper.test.hbs +6 -0
- package/dist/assets/components/bs5/metaDcTerms/metaDcTerms.hbs +19 -0
- package/dist/assets/components/bs5/metaOpenGraph/metaOpenGraph.hbs +18 -0
- package/dist/assets/components/bs5/modal/modal.hbs +38 -0
- package/dist/assets/components/bs5/navbar/navbar.hbs +251 -0
- package/dist/assets/components/bs5/pagination/pagination.hbs +43 -0
- package/dist/assets/components/bs5/quickexit/quickexit.hbs +40 -0
- package/dist/assets/components/bs5/searchInput/searchInput.hbs +47 -0
- package/dist/assets/components/bs5/select/select.hbs +34 -0
- package/dist/assets/components/bs5/sidenav/sidenav.hbs +66 -0
- package/dist/assets/components/bs5/sidenavWrapper/sidenavWrapper.hbs +4 -0
- package/dist/assets/components/bs5/sidenavWrapper/sidenavWrapper.test.hbs +15 -0
- package/dist/assets/components/bs5/spinner/spinner.hbs +8 -0
- package/dist/assets/components/bs5/table/table.hbs +49 -0
- package/dist/assets/components/bs5/tag/tag.hbs +10 -0
- package/dist/assets/components/bs5/textarea/textarea.hbs +32 -0
- package/dist/assets/components/bs5/textbox/textbox.hbs +32 -0
- package/dist/assets/components/bs5/typography/typography.hbs +1 -0
- package/dist/assets/components/bs5/video/video.hbs +52 -0
- package/dist/assets/css/qld.bootstrap.css +1 -1
- package/dist/assets/css/qld.bootstrap.css.map +2 -2
- package/dist/assets/js/bootstrap.js +6314 -0
- package/dist/assets/js/bootstrap.min.js +7 -11
- package/dist/assets/js/bootstrap.min.js.map +1 -7
- package/dist/assets/js/handlebars.init.cjs +6 -0
- package/dist/assets/js/handlebars.init.js +34 -0
- package/dist/assets/js/handlebars.init.min.js +6 -4
- package/dist/assets/js/handlebars.init.min.js.map +2 -2
- package/dist/assets/js/handlebars.partials.js +96 -0
- package/dist/assets/js/qld.bootstrap.min.js +5 -5
- package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
- package/dist/assets/node/handlebars.init.min.js +709 -0
- package/dist/{components → assets/node}/handlebars.init.min.js.map +4 -4
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/metaDcTerms/metaDcTerms.hbs +2 -0
- package/dist/components/handlebars.init.cjs +6 -0
- package/dist/components/handlebars.partials.js +40 -40
- package/dist/package.json +108 -0
- package/esbuild.js +33 -11
- package/package.json +23 -14
- package/pom.xml +10 -0
- package/src/components/bs5/inpagenav/inpagenav.scss +1 -0
- package/src/components/bs5/inpagenav/inpagenav.stories.js +1 -1
- package/src/components/bs5/metaDcTerms/metaDcTerms.hbs +2 -0
- package/src/components/bs5/navbar/navbar.functions.js +1 -1
- package/src/components/bs5/sidenav/sidenav.scss +28 -3
- package/src/components/bs5/typography/typography.stories.js +1 -1
- package/src/js/handlebars.init.cjs +6 -0
- package/src/js/handlebars.partials.js +40 -40
- package/src/js/qld.bootstrap.js +138 -0
- package/src/scss/qld-type.scss +1 -6
- package/.esbuild/helpers/listfiles.js +0 -16
- package/dist/assets/img/100x100.jpg +0 -0
- package/dist/assets/img/600x260.jpg +0 -0
- package/dist/assets/img/Heart-Pattern-Dark.png +0 -0
- package/dist/assets/img/Heart-Pattern.png +0 -0
- package/dist/assets/img/_coa_header-logo-qgov--stacked.svg +0 -171
- package/dist/assets/img/_coa_header-logo-qgov-masterbrand.svg +0 -56
- package/dist/assets/img/_coa_preheader-logo-qgov.svg +0 -56
- package/dist/assets/img/banner-background--mobile.png +0 -0
- package/dist/assets/img/banner-background-alt--desktop.jpg +0 -0
- package/dist/assets/img/banner-background-dark--desktop.jpg +0 -0
- package/dist/assets/img/banner-background-dark-alt--desktop.jpg +0 -0
- package/dist/assets/img/banner-background-default--desktop.jpg +0 -0
- package/dist/assets/img/banner-bg.png +0 -0
- package/dist/assets/img/banner-example-3-to-2.jpg +0 -0
- package/dist/assets/img/banner-texture-tile-dark.png +0 -0
- package/dist/assets/img/banner-texture-tile-light.png +0 -0
- package/dist/assets/img/banner.png +0 -0
- package/dist/assets/img/card--brand.png +0 -0
- package/dist/assets/img/card--components.png +0 -0
- package/dist/assets/img/card--content.png +0 -0
- package/dist/assets/img/colour-photo-example.jpg +0 -0
- package/dist/assets/img/demo-image-unsplash-motorbike.jpg +0 -0
- package/dist/assets/img/ds-example-image-1.jpg +0 -0
- package/dist/assets/img/ds-example-image-2.jpg +0 -0
- package/dist/assets/img/ds-example-image-3.jpg +0 -0
- package/dist/assets/img/endorsed.svg +0 -145
- package/dist/assets/img/header-search.svg +0 -3
- package/dist/assets/img/health-icon-sprite.svg +0 -156
- package/dist/assets/img/icon-exclamation.svg +0 -6
- package/dist/assets/img/icon-home.svg +0 -4
- package/dist/assets/img/icon-nav-chevron.svg +0 -3
- package/dist/assets/img/icon-right-arrow.svg +0 -4
- package/dist/assets/img/icon-search.svg +0 -6
- package/dist/assets/img/image-placeholder.png +0 -0
- package/dist/assets/img/layers-2x.png +0 -0
- package/dist/assets/img/layers.png +0 -0
- package/dist/assets/img/marker-icon.png +0 -0
- package/dist/assets/img/sample-header-pic.jpg +0 -0
- package/dist/assets/img/svg-icons.svg +0 -155
- package/dist/assets/img/video-play.svg +0 -3
- package/src/main.js +0 -138
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
export const listFilesHbs = (dir, filelist = []) => {
|
|
5
|
+
fs.readdirSync(dir, { withFileTypes: true }).forEach((file) => {
|
|
6
|
+
const dirFile = path.join(dir, file.name);
|
|
7
|
+
if (file.isDirectory()) {
|
|
8
|
+
filelist = listFilesHbs(dirFile, filelist);
|
|
9
|
+
} else if (file.name.endsWith(".hbs")) {
|
|
10
|
+
filelist.push(dirFile);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return filelist;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const listFilesJS = (dir, filelist = []) => {
|
|
17
|
+
fs.readdirSync(dir, { withFileTypes: true }).forEach((file) => {
|
|
18
|
+
const dirFile = path.join(dir, file.name);
|
|
19
|
+
if (file.isDirectory()) {
|
|
20
|
+
filelist = listFilesJS(dirFile, filelist);
|
|
21
|
+
} else if (file.name.endsWith(".js")) {
|
|
22
|
+
filelist.push(dirFile);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return filelist;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const listFilesCSS = (dir, filelist = []) => {
|
|
29
|
+
fs.readdirSync(dir, { withFileTypes: true }).forEach((file) => {
|
|
30
|
+
const dirFile = path.join(dir, file.name);
|
|
31
|
+
if (file.isDirectory()) {
|
|
32
|
+
filelist = listFilesCSS(dirFile, filelist);
|
|
33
|
+
} else if (file.name.endsWith(".css")) {
|
|
34
|
+
filelist.push(dirFile);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return filelist;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
export const listFiles = (dir, filelist = []) => {
|
|
42
|
+
fs.readdirSync(dir, { withFileTypes: true }).forEach((file) => {
|
|
43
|
+
const dirFile = path.join(dir, file.name);
|
|
44
|
+
if (file.isDirectory()) {
|
|
45
|
+
filelist = listFiles(dirFile, filelist);
|
|
46
|
+
} else {
|
|
47
|
+
filelist.push(dirFile);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return filelist;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export default listFilesHbs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* global process */
|
|
2
2
|
import log from "../helpers/logger.js";
|
|
3
|
-
import
|
|
3
|
+
import listFilesHbs, {listFilesCSS, listFilesJS} from "../helpers/listFilesHbs.js";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export default function buildlog() {
|
|
@@ -16,25 +16,33 @@ export default function buildlog() {
|
|
|
16
16
|
build.onEnd((result) => {
|
|
17
17
|
console.log("BUNDLING:");
|
|
18
18
|
build.initialOptions.entryPoints.forEach((entry) => {
|
|
19
|
-
log("cyan", entry.in);
|
|
19
|
+
log("cyan", `${entry.in} -> ${entry.out}`);
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
console.log(`\n`);
|
|
23
|
-
console.log("CREATED:");
|
|
24
|
-
log("magenta", `CSS\t\t./dist/assets/css/qld.bootstrap.css`);
|
|
25
|
-
log("blue", "JS\t\t./dist/assets/js/bootstrap.min.js");
|
|
26
|
-
log("blue", `JS\t\t./dist/assets/js/qld.bootstrap.min.js`);
|
|
27
|
-
|
|
28
|
-
//List new components
|
|
29
21
|
const root = process.cwd();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
|
|
23
|
+
log( "black", "\n");
|
|
24
|
+
log( "black", "CREATED:");
|
|
25
|
+
|
|
26
|
+
listFilesCSS(root + "/dist/").forEach((file) => {
|
|
27
|
+
let newfile = file.replace(root, "");
|
|
28
|
+
log("magenta", `CSS:\t\t.${newfile}`);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
listFilesJS(root + "/dist/").forEach((file) => {
|
|
33
|
+
let newfile = file.replace(root, "");
|
|
34
|
+
log("blue", `JS:\t\t.${newfile}`);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
//List new assets
|
|
39
|
+
|
|
40
|
+
listFilesHbs(root + "/dist/").forEach((file) => {
|
|
34
41
|
let newfile = file.replace(root, "");
|
|
35
42
|
log("cyan", `Template:\t.${newfile}`);
|
|
36
43
|
});
|
|
37
44
|
|
|
45
|
+
|
|
38
46
|
});
|
|
39
47
|
|
|
40
48
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -6,27 +6,26 @@ export default function copyPlugin() {
|
|
|
6
6
|
return copy({
|
|
7
7
|
resolveFrom: "cwd",
|
|
8
8
|
verbose: false,
|
|
9
|
-
watch:
|
|
9
|
+
watch: true,
|
|
10
10
|
assets: [
|
|
11
|
-
{
|
|
12
|
-
{
|
|
13
|
-
|
|
14
|
-
to: ["./dist/components/bs5/"],
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
from: ["./src/components/bs5/**/*.data.json"],
|
|
18
|
-
to: ["./dist/sample-data/"],
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
from: ["./src/js/handlebars.helpers.js"],
|
|
22
|
-
to: ["./dist/assets/js/handlebars.helpers.js"],
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
from: ["./src/js/handlebars.*"],
|
|
26
|
-
to: ["./dist/components/"],
|
|
27
|
-
},
|
|
11
|
+
{from: ["./node_modules/bootstrap/dist/js/bootstrap.bundle.js"], to: ["./dist/assets/js/bootstrap.js"]},
|
|
12
|
+
{from: ["./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"], to: ["./dist/assets/js/bootstrap.min.js"]},
|
|
13
|
+
{from: ["./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map"], to: ["./dist/assets/js/bootstrap.min.js.map"]},
|
|
28
14
|
|
|
29
|
-
{
|
|
15
|
+
{from: ["./src/components/bs5/**/*.hbs"], to: ["./dist/assets/components/bs5/"],},
|
|
16
|
+
{from: ["./src/js/handlebars.*"], to: ["./dist/assets/js/"],},
|
|
17
|
+
{from: ["./src/img/*"], to: ["./dist/assets/img"]},
|
|
18
|
+
// Sample data
|
|
19
|
+
{from: ["./src/components/bs5/**/*.data.json"], to: ["./dist/sample-data/"],},
|
|
20
|
+
|
|
21
|
+
// dist/components will be going away please use dist/assets/components
|
|
22
|
+
{from: ["./src/js/handlebars.*"], to: ["./dist/components/"],},
|
|
23
|
+
{from: ["./src/components/bs5/**/*.hbs"], to: ["./dist/components/bs5/"],},
|
|
24
|
+
|
|
25
|
+
//Copy info files for reference
|
|
26
|
+
{from: ["./src/templates/compiled/*.html"], to: ["./dist/"]},
|
|
27
|
+
{from: ["./package.json"], to: ["./dist/package.json"]},
|
|
28
|
+
{from: ["./README.md"], to: ["./dist/README.md"]},
|
|
30
29
|
],
|
|
31
30
|
});
|
|
32
31
|
|
|
@@ -58,7 +58,7 @@ export default function QGDSupdateHandlebarsPartialsPlugin() {
|
|
|
58
58
|
const componentPath = path.relative(path.dirname(PARTIALS_JS_FILE), file).replace(/\\/g, '/');
|
|
59
59
|
|
|
60
60
|
importLines += `import ${importName} from "${componentPath}?raw";\n`;
|
|
61
|
-
registerLines += `
|
|
61
|
+
registerLines += ` handlebars.registerPartial("${componentName}", ${importName});\n`;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
if (duplicateFound) {
|
|
@@ -84,7 +84,7 @@ if(typeof(Handlebars) !== 'undefined') {
|
|
|
84
84
|
`;
|
|
85
85
|
|
|
86
86
|
fs.writeFileSync(PARTIALS_JS_FILE, newContent);
|
|
87
|
-
console.log(
|
|
87
|
+
//console.log(`${PARTIALS_JS_FILE} has been updated.`);
|
|
88
88
|
});
|
|
89
89
|
},
|
|
90
90
|
}
|
|
@@ -2,28 +2,49 @@ import { promises as fs } from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { execSync } from 'child_process';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
|
-
import listFiles from "../helpers/
|
|
6
|
-
import log from "../helpers/logger.js";
|
|
5
|
+
import listFilesHbs, {listFiles, listFilesJS} from "../helpers/listFilesHbs.js";
|
|
7
6
|
|
|
8
7
|
// Helper function to get git information
|
|
9
8
|
const getGitInfo = () => {
|
|
10
|
-
const getGitBranch = () =>
|
|
9
|
+
const getGitBranch = () => {
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
return execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
|
|
13
|
+
} catch {
|
|
14
|
+
return ``;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
11
17
|
const getGitTag = () => {
|
|
18
|
+
|
|
12
19
|
try {
|
|
13
20
|
return execSync('git describe --tags --exact-match 2>/dev/null').toString().trim();
|
|
14
21
|
} catch {
|
|
15
|
-
return
|
|
22
|
+
return ``;
|
|
16
23
|
}
|
|
17
24
|
};
|
|
18
|
-
const getGitCommit = () =>
|
|
19
|
-
const getGitCommitDate = () => execSync('git log -1 --format=%cI').toString().trim();
|
|
25
|
+
const getGitCommit = () => {
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
try {
|
|
28
|
+
return execSync('git rev-parse HEAD').toString().trim();
|
|
29
|
+
} catch {
|
|
30
|
+
return ``;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const getGitCommitDate = () => {
|
|
34
|
+
try {
|
|
35
|
+
execSync('git log -1 --format=%cI').toString().trim();
|
|
36
|
+
} catch {
|
|
37
|
+
return ``;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var output = {
|
|
22
42
|
branch: getGitBranch(),
|
|
23
43
|
tag: getGitTag(),
|
|
24
44
|
commit: getGitCommit(),
|
|
25
45
|
datetime: getGitCommitDate(),
|
|
26
46
|
};
|
|
47
|
+
return output
|
|
27
48
|
};
|
|
28
49
|
|
|
29
50
|
// Function to extract major version prefix from a tag
|
|
@@ -56,26 +77,32 @@ const versionPlugin = () => ({
|
|
|
56
77
|
let versionDetails;
|
|
57
78
|
build.onStart(async () => {
|
|
58
79
|
const packageInfo = await getPackageJson();
|
|
59
|
-
|
|
80
|
+
var majorVersion = extractMajorVersion('v' + packageInfo.version)
|
|
81
|
+
var gitInfo = getGitInfo();
|
|
82
|
+
|
|
60
83
|
versionDetails = {
|
|
61
84
|
...packageInfo,
|
|
62
85
|
...gitInfo,
|
|
63
|
-
majorVersion:
|
|
86
|
+
majorVersion: majorVersion,
|
|
64
87
|
};
|
|
65
|
-
|
|
88
|
+
//log( "green", `Version details collected: ${JSON.stringify(versionDetails)}`);
|
|
89
|
+
//log( "black", "");
|
|
66
90
|
});
|
|
67
91
|
|
|
92
|
+
|
|
93
|
+
|
|
68
94
|
// Replace placeholders in HTML, Mustache, and Handlebars files
|
|
69
95
|
build.onEnd(async (result) => {
|
|
70
|
-
|
|
96
|
+
//log( "green", 'version update starting...');
|
|
71
97
|
|
|
72
98
|
//List new components
|
|
73
99
|
const root = process.cwd();
|
|
74
|
-
const relativePath = "/dist
|
|
100
|
+
const relativePath = "/dist";
|
|
75
101
|
|
|
76
102
|
const newTemplateFiles = listFiles(root + relativePath);
|
|
103
|
+
//console.log(newTemplateFiles)
|
|
77
104
|
for (const file of newTemplateFiles) {
|
|
78
|
-
if (/\.(html|
|
|
105
|
+
if (/\.(js|html|hbs)$/.test(file)) {
|
|
79
106
|
// const outputPath = path.resolve(process.cwd(), file);
|
|
80
107
|
let source = await fs.readFile(file, 'utf8');
|
|
81
108
|
let newSource = source.replace(/###VERSION###/g, JSON.stringify(versionDetails));
|
|
@@ -85,12 +112,14 @@ const versionPlugin = () => ({
|
|
|
85
112
|
|
|
86
113
|
// Check if the content has changed
|
|
87
114
|
if (source !== newSource) {
|
|
88
|
-
|
|
115
|
+
//console.log(`Placeholder replaced in: ${file}, ${newSource}`);
|
|
116
|
+
//console.log(`Placeholder replaced in: ${file}`);
|
|
89
117
|
await fs.writeFile(file, newSource);
|
|
90
118
|
}
|
|
91
119
|
}
|
|
92
120
|
}
|
|
93
|
-
|
|
121
|
+
|
|
122
|
+
//log( "green", 'version update Completed');
|
|
94
123
|
|
|
95
124
|
});
|
|
96
125
|
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Queensland Government Design System - Bootstrap 5 - Edition
|
|
2
|
+
A Queensland Online - Design System development space
|
|
3
|
+
|
|
4
|
+
Please see [For Gov - Queensland Government Design System](https://www.forgov.qld.gov.au/information-and-communication-technology/communication-and-publishing/website-and-digital-publishing/website-standards-guidelines-and-templates/queensland-government-design-system) for more details.
|
|
5
|
+
|
|
6
|
+
This is a BS5 flavour based on [QGDS Figma Design](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?m=auto&node-id=6902-69802&t=q6FMpeH4XPs1hjP1-1). <br/>
|
|
7
|
+
Qld Health edition can be found at [design-system.health.qld.gov.au](https://www.design-system.health.qld.gov.au/).
|
|
8
|
+
|
|
9
|
+
This includes:
|
|
10
|
+
- Public NPM Release packages:
|
|
11
|
+
- https://www.npmjs.com/package/@qld-gov-au/qgds-bootstrap5
|
|
12
|
+
- https://github.com/qld-gov-au/qgds-bootstrap5/pkgs/npm/qgds-bootstrap5
|
|
13
|
+
- Squiz Git bridge dist/binary repo: https://github.com/qld-gov-au/qgds-bootstrap5-release
|
|
14
|
+
- Git CDN repo: https://github.com/qld-gov-au/qgds-bootstrap5-cdn
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Technical overview
|
|
18
|
+
|
|
19
|
+
- ES6 Javascript
|
|
20
|
+
- ESbuild for bundling, minification and transpiling
|
|
21
|
+
- Storybook for component development and documentation
|
|
22
|
+
- Mustache JS / Handlebars JS for component and HTML templating
|
|
23
|
+
- Figma for design and prototyping
|
|
24
|
+
- CSS/SCSS, extending Bootstrap 5.3 core components with custom CSS properties
|
|
25
|
+
- NPM for package management
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## Documentation
|
|
29
|
+
|
|
30
|
+
- Storybook examples available at [https://qld-gov-au.github.io/qgds-bootstrap5/](https://qld-gov-au.github.io/qgds-bootstrap5/)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## Development Getting started
|
|
34
|
+
|
|
35
|
+
### Personal Development
|
|
36
|
+
This repo is designed to allow easy forking. <br/>
|
|
37
|
+
Do enable GitHub Actions post forking and GitHub pages via GitHub actions <br/>
|
|
38
|
+
Also do configure your own personal chromatic to ease development in providing delta change diff-ing.
|
|
39
|
+
|
|
40
|
+
We welcome external contributors, so don't be afraid to raise PR's back to this repo for inclusion into core deployment + cdn repo.
|
|
41
|
+
|
|
42
|
+
### GitHub Actions
|
|
43
|
+
This repo includes many workflows to reduce developer overheads. This includes but not limited to:
|
|
44
|
+
* CICD on all commit's and PR's
|
|
45
|
+
* GitHub io static document deployment based on develop/main
|
|
46
|
+
* Dependabot auto patching + storybook upgrade feature
|
|
47
|
+
* One click npm versioning publish (patch, minor, major) **
|
|
48
|
+
* Auto generate release notes based on PR's created (On version Tag)
|
|
49
|
+
* Npm js package publish (On version Tag) ***
|
|
50
|
+
* GitHub package Publish (On version Tag) ****
|
|
51
|
+
|
|
52
|
+
** Must configure GitHub service account ssh private key loaded into GitHub actions secret ``DEPLOY_KEY``<br/>
|
|
53
|
+
*** Must have npm js token loaded into GitHub actions secrets ``NPM_TOKEN`` to allow publishing.<br/>
|
|
54
|
+
**** Switch's @qld-gov-au with forked username (lowercase) and publish to your account see .github/workflows/githubPackage.yml step ``Update package scope, export package name``.
|
|
55
|
+
|
|
56
|
+
### Quick build
|
|
57
|
+
If you hava java and maven installed. This will pull in a local node/npm version and run through the full lifecycle build.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
git clone https://github.com/qld-gov-au/qgds-bootstrap5
|
|
61
|
+
cd qgds-bootstrap5
|
|
62
|
+
mvn install
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Standard build
|
|
66
|
+
1. Download
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git clone https://github.com/qld-gov-au/qgds-bootstrap5
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
2. Setup
|
|
73
|
+
|
|
74
|
+
Prerequisites
|
|
75
|
+
- Node 18.17.1+
|
|
76
|
+
- NPM 10.2.5+
|
|
77
|
+
|
|
78
|
+
3. Install dependencies
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm install
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
4. Build the Design System CSS, Components and templates
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run build
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
6. Start Watch and Storybook for component development
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm run dev-storybook
|
|
94
|
+
```
|
|
95
|
+
Alt:
|
|
96
|
+
```bash
|
|
97
|
+
npm run watch
|
|
98
|
+
npm run storybook
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
7. Lint
|
|
102
|
+
```bash
|
|
103
|
+
npm run lint
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
* Static view, start a local server from /dist folder
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm run serve
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
* Next steps
|
|
113
|
+
|
|
114
|
+
- HTML templating using drop in components
|
|
115
|
+
|
|
116
|
+
If you wish to use the includes handle bars, please ensure
|
|
117
|
+
"handlebars": "4.7.8" + is loaded prior to running handlebars.helpers.bundle.js
|
|
118
|
+
- Dev build and testing branching
|
|
119
|
+
|
|
120
|
+
### IDE Development suggestions
|
|
121
|
+
|
|
122
|
+
We recommend using VSCode as the IDE for development with the following plugins:
|
|
123
|
+
|
|
124
|
+
- Prettier
|
|
125
|
+
- ESLint
|
|
126
|
+
- Mustache JS or Handlebars JS template support
|
|
127
|
+
|
|
128
|
+
Webstorm also works.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- QGDS Component: Accordion -->
|
|
2
|
+
<div class="accordion-group">
|
|
3
|
+
|
|
4
|
+
{{#if toggleAll}}
|
|
5
|
+
<div class="accordion-toggle">
|
|
6
|
+
<button class="accordion-toggle-btn accordion-toggle-btn--closed" type="button">Open all</button>
|
|
7
|
+
</div>
|
|
8
|
+
{{/if}}
|
|
9
|
+
<div class="accordion" id="{{groupid}}">
|
|
10
|
+
{{#each accordionItems }}
|
|
11
|
+
<div class="accordion-item">
|
|
12
|
+
<h2 class="accordion-header" id="heading-{{id}}">
|
|
13
|
+
<button class="accordion-button {{#unless expanded}}collapsed{{/unless}}" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-{{id}}" aria-expanded="{{expanded}}" aria-controls="collapse-{{id}}">
|
|
14
|
+
{{title}}
|
|
15
|
+
</button>
|
|
16
|
+
</h2>
|
|
17
|
+
|
|
18
|
+
<div id="collapse-{{id}}" class="accordion-collapse collapse {{#if expanded}}show{{/if}}" aria-labelledby="heading-{{id}}">
|
|
19
|
+
<div class="accordion-body">
|
|
20
|
+
{{{content}}}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
{{/each }}
|
|
25
|
+
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!-- QGDS Partial: banner -->
|
|
2
|
+
|
|
3
|
+
<div class="container-fluid qld-banner {{variantClass}}">
|
|
4
|
+
|
|
5
|
+
<div class="container">
|
|
6
|
+
<div class="row">
|
|
7
|
+
|
|
8
|
+
<div class="col-12 col-md-7">
|
|
9
|
+
|
|
10
|
+
{{{breadcrumbs}}}
|
|
11
|
+
|
|
12
|
+
<h1 class="banner-title">{{{title}}}</h1>
|
|
13
|
+
<p class="banner-lead">{{{content}}}</p>
|
|
14
|
+
|
|
15
|
+
{{#if ctabuttons}}
|
|
16
|
+
<div class="banner-cta btn-toolbar">
|
|
17
|
+
{{#each ctabuttons}}
|
|
18
|
+
<a href="{{link}}" class="btn {{class}}" target="{{target}}">{{label}}</a>
|
|
19
|
+
{{/each}}
|
|
20
|
+
</div>
|
|
21
|
+
{{/if}}
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="banner-image {{image.classes}}" style="--banner-background-img:url({{image.url}})"></div>
|
|
28
|
+
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<nav aria-label="breadcrumb">
|
|
2
|
+
<ol class="breadcrumb">
|
|
3
|
+
{{#each breadcrumbs}}
|
|
4
|
+
{{! print all breadcrumbs except the current page as links}}
|
|
5
|
+
{{#unless @last}}
|
|
6
|
+
<li class="breadcrumb-item">
|
|
7
|
+
<a href="{{link}}">{{linktext}}</a>
|
|
8
|
+
</li>
|
|
9
|
+
{{/unless}}
|
|
10
|
+
{{! print the current page as plain text}}
|
|
11
|
+
{{#if @last}}
|
|
12
|
+
<li class="breadcrumb-item active" aria-current="page" data-href="{{link}}">{{linktext}}</li>
|
|
13
|
+
{{/if}}
|
|
14
|
+
{{/each}}
|
|
15
|
+
</ol>
|
|
16
|
+
</nav>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{{#unless islink}}
|
|
2
|
+
<button class="btn {{variantClass}}" onclick="{{{onclick}}}" {{#if isdisabled}}disabled{{/if}} {{#if arialabel}}aria-label="{{arialabel}}"{{/if}} {{{dataatts}}}>
|
|
3
|
+
{{#if iconClass}}
|
|
4
|
+
{{#ifCond iconPosition '==' 'leading'}}
|
|
5
|
+
<span class="btn-icon {{iconClass}}"></span>
|
|
6
|
+
{{/ifCond}}
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{label}}
|
|
9
|
+
{{#if iconClass}}
|
|
10
|
+
{{#ifCond iconPosition '==' 'trailing'}}
|
|
11
|
+
<span class="btn-icon {{iconClass}}"></span>
|
|
12
|
+
{{/ifCond}}
|
|
13
|
+
{{/if}}
|
|
14
|
+
</button>
|
|
15
|
+
|
|
16
|
+
{{else}}
|
|
17
|
+
|
|
18
|
+
<a class="btn {{variantClass}} {{#if isdisabled}} disabled {{/if}}" {{#if isdisabled}} aria-disabled="true" {{/if}} href="{{href}}" target="{{target}}" {{#if arialabel}}aria-label="{{arialabel}}"{{/if}} {{{dataatts}}}>
|
|
19
|
+
{{#if iconClass}}
|
|
20
|
+
{{#ifCond iconPosition '==' 'leading'}}
|
|
21
|
+
<span class="btn-icon {{iconClass}}"></span>
|
|
22
|
+
{{~/ifCond~}}
|
|
23
|
+
{{~/if~}}
|
|
24
|
+
{{~label~}}
|
|
25
|
+
{{#if iconClass}}
|
|
26
|
+
{{#ifCond iconPosition '==' 'trailing'}}
|
|
27
|
+
<span class="btn-icon {{iconClass}}"></span>
|
|
28
|
+
{{/ifCond}}
|
|
29
|
+
{{/if}}
|
|
30
|
+
</a>
|
|
31
|
+
{{/unless }}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<!-- QGDS Partial: card -->
|
|
2
|
+
|
|
3
|
+
<div class="col{{#if feature}}-md-12 col-lg-12{{/if}}">
|
|
4
|
+
|
|
5
|
+
<div class="card card-{{variantClass}} {{variantClass}} {{iconPosition}} card-{{action}}-action{{#if arrow}} card-arrow{{/if}}{{#if equalHeight}} h-100{{/if}}{{#if feature}} card-feature card-feature-{{featureImagePosition}}{{/if}}{{#if video}} card-video{{/if}}">
|
|
6
|
+
|
|
7
|
+
{{#if image}}
|
|
8
|
+
<div class="card-img ratio ratio-16x9">
|
|
9
|
+
<div class="{{#if feature}}card-img-{{featureImagePosition}}{{else}}card-img-top{{/if}}"
|
|
10
|
+
style="--card-image:url({{image}})" alt="{{imageAlt}}"></div>
|
|
11
|
+
|
|
12
|
+
{{#if video}}
|
|
13
|
+
<div class="video-overlay">
|
|
14
|
+
<div class="video-nav">
|
|
15
|
+
<div class="video-watch"><span class="icon"></span><span>Watch</span></div>
|
|
16
|
+
|
|
17
|
+
{{#if videoDuration}}
|
|
18
|
+
<div title="Video duration" class="video-duration"><span class="icon"></span><span>{{videoDuration}}</span></div>
|
|
19
|
+
{{/if}}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
{{/if}}
|
|
23
|
+
</div>
|
|
24
|
+
{{/if}}
|
|
25
|
+
|
|
26
|
+
{{#if iconClasses}}
|
|
27
|
+
<div class="card-icon {{iconPosition}} {{iconClasses}}"></div>
|
|
28
|
+
{{/if}}
|
|
29
|
+
|
|
30
|
+
{{#if feature}}<div class="card-inner">{{/if}}
|
|
31
|
+
|
|
32
|
+
<div class="card-body">
|
|
33
|
+
{{#if date}}
|
|
34
|
+
<div class="card-date">{{date}}</div>
|
|
35
|
+
{{/if}}
|
|
36
|
+
|
|
37
|
+
<h3 class="card-title">
|
|
38
|
+
{{#if link}}
|
|
39
|
+
<a href="{{link}}" {{#ifCond action '===' 'single'}}class="stretched-link"{{/ifCond}}>{{title}}</a>
|
|
40
|
+
{{else}}
|
|
41
|
+
{{ title }}
|
|
42
|
+
{{/if }}
|
|
43
|
+
</h3>
|
|
44
|
+
|
|
45
|
+
{{#if description}}
|
|
46
|
+
<p class="card-text">
|
|
47
|
+
{{{description}}}
|
|
48
|
+
</p>
|
|
49
|
+
{{/if}}
|
|
50
|
+
|
|
51
|
+
{{#if arrow}}
|
|
52
|
+
<div class="card-icon icon-arrow"></div>
|
|
53
|
+
{{/if}}
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
{{#if footer}}
|
|
57
|
+
<div class="card-footer">
|
|
58
|
+
{{{footer}}}
|
|
59
|
+
</div>
|
|
60
|
+
{{/if }}
|
|
61
|
+
|
|
62
|
+
{{#if feature}}</div>{{/if}}
|
|
63
|
+
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
</div>
|