@qld-gov-au/qgds-bootstrap5 1.0.7 → 1.0.9

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.
Files changed (70) hide show
  1. package/.storybook/preview.js +2 -1
  2. package/dist/assets/css/qld.bootstrap.css +1 -1
  3. package/dist/assets/css/qld.bootstrap.css.map +2 -2
  4. package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
  5. package/dist/assets/js/handlebars.helpers.bundle.js.map +3 -3
  6. package/dist/assets/js/handlebars.helpers.js +8 -1
  7. package/dist/assets/js/qld.bootstrap.min.js +16 -1
  8. package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
  9. package/dist/components/bs5/dateinput/dateinput.hbs +12 -12
  10. package/dist/components/bs5/header/header.hbs +131 -33
  11. package/dist/components/bs5/navbar/navbar.hbs +65 -3
  12. package/dist/components/bs5/select/select.hbs +3 -3
  13. package/dist/components/bs5/textarea/textarea.hbs +8 -8
  14. package/dist/components/bs5/textbox/textbox.hbs +7 -6
  15. package/dist/components/bs5/video/video.hbs +10 -11
  16. package/dist/components/handlebars.helpers.js +8 -1
  17. package/dist/components/handlebars.init.bundle.js +1 -1
  18. package/dist/components/handlebars.init.bundle.js.map +3 -3
  19. package/dist/sample-data/card/card.data.json +8 -2
  20. package/dist/sample-data/dateinput/dateinput.data.json +1 -0
  21. package/dist/sample-data/header/header.data.json +245 -31
  22. package/dist/sample-data/select/select.data.json +1 -0
  23. package/dist/sample-data/textarea/textarea.data.json +1 -0
  24. package/dist/sample-data/textbox/textbox.data.json +1 -0
  25. package/dist/sample-data/video/video.data.json +20 -11
  26. package/package.json +20 -20
  27. package/src/components/bs5/card/card--multi-action.stories.js +1 -0
  28. package/src/components/bs5/card/card.data.json +8 -2
  29. package/src/components/bs5/card/card.scss +34 -1
  30. package/src/components/bs5/dateinput/Dateinput.stories.js +2 -32
  31. package/src/components/bs5/dateinput/dateinput.data.json +1 -0
  32. package/src/components/bs5/dateinput/dateinput.hbs +12 -12
  33. package/src/components/bs5/header/_colours.scss +31 -15
  34. package/src/components/bs5/header/_icons.scss +1 -1
  35. package/src/components/bs5/header/_search.json +45 -0
  36. package/src/components/bs5/header/header.data.json +245 -31
  37. package/src/components/bs5/header/header.functions.js +143 -8
  38. package/src/components/bs5/header/header.hbs +131 -33
  39. package/src/components/bs5/header/header.scss +178 -35
  40. package/src/components/bs5/navbar/_colours.scss +19 -19
  41. package/src/components/bs5/navbar/navbar.functions.js +59 -52
  42. package/src/components/bs5/navbar/navbar.hbs +65 -3
  43. package/src/components/bs5/navbar/navbar.scss +73 -27
  44. package/src/components/bs5/select/Select.stories.js +4 -4
  45. package/src/components/bs5/select/select.data.json +1 -0
  46. package/src/components/bs5/select/select.hbs +3 -3
  47. package/src/components/bs5/textarea/Textarea.stories.js +2 -32
  48. package/src/components/bs5/textarea/textarea.data.json +1 -0
  49. package/src/components/bs5/textarea/textarea.hbs +8 -8
  50. package/src/components/bs5/textbox/Textbox.stories.js +2 -15
  51. package/src/components/bs5/textbox/textInput.scss +10 -2
  52. package/src/components/bs5/textbox/textbox.data.json +1 -0
  53. package/src/components/bs5/textbox/textbox.hbs +7 -6
  54. package/src/components/bs5/video/video.data.json +20 -11
  55. package/src/components/bs5/video/video.hbs +10 -11
  56. package/src/components/bs5/video/video.scss +42 -5
  57. package/src/components/bs5/video/video.stories.js +9 -0
  58. package/src/js/handlebars.helpers.js +8 -1
  59. package/src/main.js +26 -2
  60. package/dist/components/bs5/card/cardblock.hbs +0 -14
  61. package/dist/sample-data/card/cardblock.data.json +0 -33
  62. package/src/components/bs5/card/Cardblock.js +0 -14
  63. package/src/components/bs5/card/cardblock-hbs-backup.txt +0 -29
  64. package/src/components/bs5/card/cardblock.data.json +0 -33
  65. package/src/components/bs5/card/cardblock.hbs +0 -14
  66. package/src/components/bs5/card/cardblock.stories.js +0 -60
  67. package/src/stories/templates/ContentPage/ContentPage.mdx +0 -40
  68. package/src/stories/templates/ContentPage/ContentPage.stories.js +0 -36
  69. package/src/stories/templates/LandingPage/LandingPage.mdx +0 -20
  70. package/src/stories/templates/LandingPage/LandingPage.stories.js +0 -25
@@ -5,6 +5,10 @@ import defaultdata from './video.data.json';
5
5
  // include accordion for transcript
6
6
  import { Accordion } from "../accordion/Accordion.js";
7
7
 
8
+ /**
9
+ * Set default arguments for the Video component,
10
+ * which is based on YouTube arguments.
11
+ */
8
12
  export default {
9
13
  tags: ["autodocs"],
10
14
  title: "Components/Video",
@@ -46,6 +50,11 @@ export default {
46
50
  "Half page": "col-6",
47
51
  },
48
52
  },
53
+ urlParams: {
54
+ control: {
55
+ type: "object",
56
+ },
57
+ },
49
58
  },
50
59
 
51
60
  /**
@@ -1,7 +1,7 @@
1
1
  /* global Handlebars */
2
2
 
3
3
  /**
4
- * Registers Handlebars Helper for 'contains', 'ifCond', 'isMultipleOfThree' and 'isEndOfRow'
4
+ * Registers Handlebars Helper for 'contains', 'ifCond', 'isType', 'isMultipleOfThree' and 'isEndOfRow'
5
5
  * @param {module} Handlebars Templating engine
6
6
  * @returns {void} Result of the helper operation
7
7
  */
@@ -53,6 +53,13 @@ export default function handlebarsHelpers(Handlebars) {
53
53
  Handlebars.registerHelper('isEndOfRow', function(index) {
54
54
  return ((index + 1) % 3 === 0); // Since index is zero-based, add 1 to check if it's the end of a row.
55
55
  });
56
+ Handlebars.registerHelper('isType', function (value, expected, options) {
57
+ if (value === expected) {
58
+ return options.fn(this); // Render the block if condition is true
59
+ } else {
60
+ return options.inverse(this); // Render the else block if present
61
+ }
62
+ });
56
63
  }
57
64
 
58
65
  if(typeof(Handlebars) !== 'undefined') {
package/src/main.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
 
12
12
  import { initializeNavbar } from './components/bs5/navbar/navbar.functions';
13
13
  import { positionQuickExit, initQuickexit } from './components/bs5/quickexit/quickexit.functions';
14
- import { toggleSearch } from './components/bs5/header/header.functions';
14
+ import { toggleSearch, showSuggestions } from './components/bs5/header/header.functions';
15
15
 
16
16
  window.addEventListener('scroll', positionQuickExit, true);
17
17
  window.addEventListener('resize', positionQuickExit, true);
@@ -21,11 +21,35 @@ window.addEventListener('keydown', initQuickexit, true);
21
21
  window.addEventListener("DOMContentLoaded", () => {
22
22
  (() => {
23
23
 
24
- //Header
24
+ //Header search
25
25
  let headerSearchButton = document.querySelector('.qld__main-nav__toggle-search');
26
26
  if(headerSearchButton) {
27
27
  document.querySelector('.qld__main-nav__toggle-search').addEventListener('click', toggleSearch);
28
28
  }
29
+
30
+ const searchInput = document.getElementById('search-input');
31
+ if (searchInput) {
32
+ searchInput.addEventListener('keyup', function() {
33
+ showSuggestions(this.value);
34
+ });
35
+
36
+ searchInput.addEventListener('focus', function() {
37
+ showSuggestions('', true);
38
+ });
39
+
40
+ searchInput.addEventListener('click', function() {
41
+ if (this.value === '') {
42
+ showSuggestions('', true);
43
+ }
44
+ });
45
+
46
+ // Close suggestions when clicking outside
47
+ document.addEventListener('click', function(event) {
48
+ if (!searchInput.contains(event.target) && !document.getElementById('suggestions').contains(event.target)) {
49
+ document.getElementById('suggestions').style.display = 'none';
50
+ }
51
+ });
52
+ }
29
53
 
30
54
  // Navbar
31
55
  initializeNavbar();
@@ -1,14 +0,0 @@
1
- <div class="row row-cols-1 row-cols-md-3 g-4">
2
-
3
- {{#each cards}}
4
- <div class="col">
5
- <div class="card h-100">
6
- <img src="{{image}}" class="card-img-top" alt="{{alt}}">
7
- <div class="card-body">
8
- <h5 class="card-title">{{#if islink}} <a href="{{link}}"> {{title}} </a> {{else}} {{title}}{{/if}} </h5>
9
- <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
10
- </div>
11
- </div>
12
- </div>
13
- {{/each}}
14
- </div>
@@ -1,33 +0,0 @@
1
- {
2
- "cards": [
3
- {
4
- "title": "An article title",
5
- "description": "This is a wider card with supporting text below as a natural lead-in to additional content.",
6
- "image": "src/assets/img/ds-example-image-1.jpg",
7
- "alt": "A photo of cliffs by the ocean with trees in the foreground",
8
- "link": "https://web.dev",
9
- "target": "_blank",
10
- "footer": false,
11
- "feature": true,
12
- "withdate": false,
13
- "date": "00.00.0000",
14
- "classes": ""
15
- },
16
- {
17
- "title": "A longer article title",
18
- "description": "This is a wider card with supporting text below as a natural lead-in to additional content.",
19
- "image": "assets/img/ds-example-image-2.jpg",
20
- "alt": "A photo of wheat in a field lit by soft sunlight",
21
- "link": "https://web.dev",
22
- "footer": false
23
- },
24
- {
25
- "title": "A topic headline",
26
- "description": "This is a supporting text below.",
27
- "image": "assets/img/ds-example-image-3.jpg",
28
- "alt": "A photo of the base of Uluru at sunset",
29
- "link": "https://web.dev",
30
- "footer": false
31
- }
32
- ]
33
- }
@@ -1,14 +0,0 @@
1
- import Component from '../../../js/QGDSComponent.js'
2
- import template from "./cardblock.hbs?raw";
3
- // import Card from "./Card.js"
4
-
5
- export class Cardblock {
6
-
7
- // Use the global Component class to create a new instance of the Callout component.
8
- // A data object, containing the mustache placeholder replacement strings, should be provided as an argument.
9
-
10
- constructor( data = {} ) {
11
- return new Component(template, data);
12
- }
13
-
14
- }
@@ -1,29 +0,0 @@
1
- <div class="row row-cols-1 row-cols-md-3 g-2">
2
-
3
- {{#each cards }}
4
- <div class="col">
5
- <p>Testing</p>
6
- <div class="card h-100">
7
- <img src="{{image}}" class="card-img-top" alt="{{alt}}" />
8
- <div class="card-body">
9
- <h3 class="card-title">
10
- {{#if link}}
11
- <a href="{{link}}">{{title}}</a>
12
- {{title}}
13
- {{/if}}
14
- </h3>
15
-
16
- <p class="card-text">
17
- {{description}}
18
- </p>
19
- </div>
20
-
21
- {{#if footer}}
22
- <div class="card-footer">{{footer}}</div>
23
- {{/if }}
24
-
25
- </div>
26
- </div>
27
- {{/each }}
28
-
29
- </div>
@@ -1,33 +0,0 @@
1
- {
2
- "cards": [
3
- {
4
- "title": "An article title",
5
- "description": "This is a wider card with supporting text below as a natural lead-in to additional content.",
6
- "image": "src/assets/img/ds-example-image-1.jpg",
7
- "alt": "A photo of cliffs by the ocean with trees in the foreground",
8
- "link": "https://web.dev",
9
- "target": "_blank",
10
- "footer": false,
11
- "feature": true,
12
- "withdate": false,
13
- "date": "00.00.0000",
14
- "classes": ""
15
- },
16
- {
17
- "title": "A longer article title",
18
- "description": "This is a wider card with supporting text below as a natural lead-in to additional content.",
19
- "image": "assets/img/ds-example-image-2.jpg",
20
- "alt": "A photo of wheat in a field lit by soft sunlight",
21
- "link": "https://web.dev",
22
- "footer": false
23
- },
24
- {
25
- "title": "A topic headline",
26
- "description": "This is a supporting text below.",
27
- "image": "assets/img/ds-example-image-3.jpg",
28
- "alt": "A photo of the base of Uluru at sunset",
29
- "link": "https://web.dev",
30
- "footer": false
31
- }
32
- ]
33
- }
@@ -1,14 +0,0 @@
1
- <div class="row row-cols-1 row-cols-md-3 g-4">
2
-
3
- {{#each cards}}
4
- <div class="col">
5
- <div class="card h-100">
6
- <img src="{{image}}" class="card-img-top" alt="{{alt}}">
7
- <div class="card-body">
8
- <h5 class="card-title">{{#if islink}} <a href="{{link}}"> {{title}} </a> {{else}} {{title}}{{/if}} </h5>
9
- <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
10
- </div>
11
- </div>
12
- </div>
13
- {{/each}}
14
- </div>
@@ -1,60 +0,0 @@
1
- // Blockquote.stories.js
2
- import { Cardblock } from './Cardblock.js';
3
- // import { Card } from './Card.js';
4
- import defaultdata from './cardblock.data.json';
5
-
6
- export default {
7
-
8
- tags: ['autodocs'],
9
- title: 'Components/Cardblock',
10
- render: (args) => new Cardblock(args).html,
11
-
12
- argTypes: {
13
- title: { // this object is configuring the field objects
14
- name: 'Title', // name of the field
15
- },
16
- description: {
17
- name: "Blank",
18
- description: "Bblank",
19
- control: {
20
- type: "select",
21
- },
22
- table: { // refers to the whole table in the storybook properties section
23
- disable: true, // completely removes this field
24
- },
25
- },
26
- // image: "assets/img/ds-example-image-1.jpg",
27
- // alt: "A photo of cliffs by the ocean with trees in the foreground",
28
- // link: "https://web.dev",
29
- // footer: false,
30
- classes: {
31
- name: "Classes",
32
- description: `Settable classes for the component`,
33
- control: {
34
- type: "radio",
35
- //tell it what options to show
36
- labels: {
37
- "": "Default",
38
- "card-alternative": "Alternative",
39
- "card-primary": "Dark",
40
- "card-primary--dark": "Dark alternative",
41
- },
42
- },
43
- options: [
44
- "", //default, we don't need additional classes
45
- "card-alternative",
46
- "card-primary",
47
- "card-primary--dark",
48
- ],
49
- },
50
- },
51
- };
52
-
53
- export const Default = {
54
- args: defaultdata,
55
- parameters: {
56
- backgrounds: { // from .storybook > preview.js
57
- default: "dark",
58
- },
59
- },
60
- };
@@ -1,40 +0,0 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks";
2
- import * as ContentPageStories from './ContentPage.stories';
3
-
4
- import { getCanvasMobileProps } from "../../helpers";
5
-
6
- <Meta of={ContentPageStories} />
7
-
8
- # Content Page
9
-
10
- ## Default
11
-
12
- <Canvas sourceState="close">
13
- <Story of={ContentPageStories.Default} />
14
- </Canvas>
15
-
16
- [//]: # ()
17
- [//]: # (## No aside)
18
-
19
- [//]: # ()
20
- [//]: # (<Canvas sourceState="close">)
21
-
22
- [//]: # ( <Story of={ContentPageStories.NoAside} />)
23
-
24
- [//]: # (</Canvas>)
25
-
26
- [//]: # ()
27
- [//]: # (## Without location)
28
-
29
- [//]: # ()
30
- [//]: # (<Canvas sourceState="close">)
31
-
32
- [//]: # ( <Story of={ContentPageStories.WithoutLocation} />)
33
-
34
- [//]: # (</Canvas>)
35
-
36
- ## Mobile
37
-
38
- <Canvas withSource="none" >
39
- <Story of={ContentPageStories.Mobile} />
40
- </Canvas>
@@ -1,36 +0,0 @@
1
- import {
2
- getStoryMobileParameters,
3
- getStoryMobileHeight,
4
- } from '../../helpers';
5
-
6
- //import DefaultTemplate from '../../../templates/page/contentpage.html';
7
- // import NoAsideTemplate from '../../../template-pages/content-page-no-asides.html';
8
- // import WithoutLocationTemplate from '../../../template-pages/content-page-without-location.html';
9
-
10
- export default {
11
- title: 'Templates/ContentPage',
12
- };
13
-
14
- export const Default = {
15
- render: () => { return `
16
- comingsoon
17
- ` }, //DefaultTemplate,
18
- };
19
-
20
- // export const NoAside = {
21
- // render: () => NoAsideTemplate,
22
- // name: 'NoAside',
23
- // };
24
- //
25
- // export const WithoutLocation = {
26
- // render: () => WithoutLocationTemplate,
27
- // name: 'WithoutLocation',
28
- // };
29
-
30
- export const Mobile = {
31
- render: () => { return `
32
- comingsoon
33
- ` }, //DefaultTemplate,
34
- parameters: getStoryMobileParameters(),
35
- height: getStoryMobileHeight(),
36
- };
@@ -1,20 +0,0 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks";
2
- import * as LandingPageStories from './LandingPage.stories';
3
-
4
-
5
-
6
- <Meta of={LandingPageStories} />
7
-
8
- # Landing Page
9
-
10
- ## Default
11
-
12
- <Canvas sourceState="close">
13
- <Story of={LandingPageStories.Default} />
14
- </Canvas>
15
-
16
- ## Mobile
17
-
18
- <Canvas withSource="none">
19
- <Story of={LandingPageStories.Mobile} />
20
- </Canvas>
@@ -1,25 +0,0 @@
1
- import {
2
- getStoryMobileParameters,
3
- getStoryMobileHeight,
4
- } from '../../helpers';
5
-
6
- //import DefaultTemplate from '../../../templates/page/landingpage.html';
7
-
8
-
9
- export default {
10
- title: 'Templates/ApplicationPage',
11
- };
12
-
13
- export const Default = {
14
- render: () => { return `
15
- comingsoon
16
- `}, // DefaultTemplate,
17
- };
18
-
19
- export const Mobile = {
20
- render: () => { return `
21
- comingsoon
22
- `}, // DefaultTemplate,
23
- parameters: getStoryMobileParameters(),
24
- height: getStoryMobileHeight(),
25
- };