@qld-gov-au/qgds-bootstrap5 1.1.21 → 1.1.23

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 (46) hide show
  1. package/dist/assets/components/bs5/backToTop/backToTop.hbs +14 -0
  2. package/dist/assets/components/bs5/button/button.hbs +38 -27
  3. package/dist/assets/components/bs5/directionLinks/directionLinks.hbs +9 -0
  4. package/dist/assets/components/bs5/head/head.hbs +1 -1
  5. package/dist/assets/css/qld.bootstrap.css +1 -1
  6. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  7. package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
  8. package/dist/assets/js/handlebars.helpers.bundle.js.map +3 -3
  9. package/dist/assets/js/handlebars.helpers.js +7 -0
  10. package/dist/assets/js/handlebars.init.min.js +98 -66
  11. package/dist/assets/js/handlebars.init.min.js.map +4 -4
  12. package/dist/assets/js/handlebars.partials.js +4 -0
  13. package/dist/assets/js/qld.bootstrap.min.js +2 -2
  14. package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
  15. package/dist/assets/node/handlebars.init.min.js +63 -29
  16. package/dist/assets/node/handlebars.init.min.js.map +3 -3
  17. package/dist/components/bs5/backToTop/backToTop.hbs +14 -0
  18. package/dist/components/bs5/button/button.hbs +38 -27
  19. package/dist/components/bs5/directionLinks/directionLinks.hbs +9 -0
  20. package/dist/components/bs5/head/head.hbs +1 -1
  21. package/dist/components/handlebars.helpers.js +7 -0
  22. package/dist/components/handlebars.partials.js +4 -0
  23. package/dist/package.json +7 -7
  24. package/dist/sample-data/backToTop/backToTop.data.json +10 -0
  25. package/dist/sample-data/directionLinks/directionLinks.data.json +7 -0
  26. package/package.json +7 -7
  27. package/src/components/bs5/backToTop/backToTop.data.json +10 -0
  28. package/src/components/bs5/backToTop/backToTop.functions.js +23 -0
  29. package/src/components/bs5/backToTop/backToTop.hbs +14 -0
  30. package/src/components/bs5/backToTop/backToTop.js +10 -0
  31. package/src/components/bs5/backToTop/backToTop.mdx +15 -0
  32. package/src/components/bs5/backToTop/backToTop.scss +101 -0
  33. package/src/components/bs5/backToTop/backToTop.stories.js +37 -0
  34. package/src/components/bs5/button/button.hbs +38 -27
  35. package/src/components/bs5/directionLinks/DirectionLinks.mdx +15 -0
  36. package/src/components/bs5/directionLinks/directionLinks.data.json +7 -0
  37. package/src/components/bs5/directionLinks/directionLinks.hbs +9 -0
  38. package/src/components/bs5/directionLinks/directionLinks.js +11 -0
  39. package/src/components/bs5/directionLinks/directionLinks.scss +116 -0
  40. package/src/components/bs5/directionLinks/directionLinks.stories.js +157 -0
  41. package/src/css/main.scss +2 -0
  42. package/src/css/qld-type.scss +67 -40
  43. package/src/css/qld-variables.scss +15 -3
  44. package/src/js/handlebars.helpers.js +7 -0
  45. package/src/js/handlebars.partials.js +4 -0
  46. package/src/js/qld.bootstrap.js +2 -0
@@ -0,0 +1,14 @@
1
+ {{#unless hide_back_to_top}}
2
+ <div class="qld__widgets" data-min-page-height="{{isdefined min_page_height 0}}">
3
+ {{> button
4
+ variantClass=(isdefined button.variantClass "back-to-top")
5
+ islink=(isdefined button.islink true)
6
+ isdisabled=(isdefined button.isdisabled false)
7
+ iconClass=(isdefined button.iconClass "")
8
+ iconPosition=(isdefined button.iconPosition "trailing")
9
+ label=(isdefined button.label "Back to top")
10
+ href=(isdefined button.href "#")
11
+ target=(isdefined button.target "_self")
12
+ }}
13
+ </div>
14
+ {{/unless}}
@@ -1,31 +1,42 @@
1
+ {{!-- Button icon partial --}}
2
+ {{#*inline "buttonIcon"~}}
3
+ <span class="btn-icon {{iconClass}} {{iconPosition}}"></span>
4
+ {{~/inline}}
5
+
1
6
  {{#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>
7
+
8
+ <button class="btn {{variantClass}} {{label}}" onclick="{{{onclick}}}" {{#if isdisabled}}disabled{{/if}} {{#if arialabel}}aria-label="{{arialabel}}"{{/if}} {{{dataatts}}}>
9
+ {{#if iconClass~}}
10
+ {{#ifCond iconPosition '==' 'leading'}}
11
+ {{~>buttonIcon~}}
12
+ {{/ifCond}}
13
+ {{/if}}
14
+
15
+ {{~label~}}
16
+
17
+ {{#if iconClass~}}
18
+ {{#ifCond iconPosition '==' 'trailing'}}
19
+ {{>buttonIcon~}}
20
+ {{/ifCond}}
21
+ {{/if}}
22
+ </button>
15
23
 
16
24
  {{else}}
17
25
 
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 }}
26
+ <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}}}>
27
+ {{#if iconClass~}}
28
+ {{#ifCond iconPosition '==' 'leading'}}
29
+ {{~> buttonIcon~}}
30
+ {{/ifCond}}
31
+ {{/if}}
32
+
33
+ {{~label~}}
34
+
35
+ {{#if iconClass~}}
36
+ {{#ifCond iconPosition '==' 'trailing'}}
37
+ {{~> buttonIcon~}}
38
+ {{/ifCond}}
39
+ {{/if}}
40
+ </a>
41
+
42
+ {{/unless}}
@@ -0,0 +1,9 @@
1
+ {{! valid class values are: up, down, left, right}}
2
+ <a class="qld-dir-link {{class}}"
3
+ {{~#if id}} id="{{id}}" {{/if~}}
4
+ href="{{href}}"
5
+ {{~#if target}} target="{{target}}"{{/if~}}
6
+ {{~#if arialabel}} aria-label="{{arialabel}}" {{/if~}}>
7
+ {{{label}}}
8
+ <span class="icon" aria-hidden="true"></span>
9
+ </a>
@@ -1,5 +1,5 @@
1
1
 
2
- <!-- VERSION_DETAILS={"project_id":"@qld-gov-au/qgds-bootstrap5","version":"1.1.21","branch":"HEAD","tag":"v1.1.21","commit":"a3f1a8cf0304d6c7f562866d133b170b491e720c","majorVersion":"v1"} -->
2
+ <!-- VERSION_DETAILS={"project_id":"@qld-gov-au/qgds-bootstrap5","version":"1.1.23","branch":"HEAD","tag":"v1.1.23","commit":"7368a2c584a90cba60069072b6d04939847510fa","majorVersion":"v1"} -->
3
3
 
4
4
  {{! Select environment, used verbatium if not using predefind key
5
5
  cdn := PROD|STAGING|BETA|TEST|DEV|???
@@ -182,6 +182,12 @@ export default function handlebarsHelpers(handlebars) {
182
182
  return durationString;
183
183
  });
184
184
 
185
+ // helper for extending components to set overridable data values
186
+ // if the value is not set in the component data.json, it will use the hds data value
187
+ handlebars.registerHelper('isdefined', function (value, defaultValue) {
188
+ return value !== undefined ? value : defaultValue;
189
+ });
190
+
185
191
  /**
186
192
  * Used to get class names added to an element based on their boolean values in an array
187
193
  * @param {string} names - Comma-separated list of class names to check for
@@ -214,6 +220,7 @@ export default function handlebarsHelpers(handlebars) {
214
220
  }
215
221
  });
216
222
 
223
+
217
224
  }
218
225
 
219
226
  if(typeof(Handlebars) !== 'undefined') {
@@ -2,6 +2,7 @@
2
2
  /** THIS IS A GENERATED FILE **/
3
3
 
4
4
  import accordion from "../components/bs5/accordion/accordion.hbs?raw";
5
+ import backToTop from "../components/bs5/backToTop/backToTop.hbs?raw";
5
6
  import banner from "../components/bs5/banner/banner.hbs?raw";
6
7
  import blockquote from "../components/bs5/blockquote/blockquote.hbs?raw";
7
8
  import breadcrumbs from "../components/bs5/breadcrumbs/breadcrumbs.hbs?raw";
@@ -15,6 +16,7 @@ import contentFooterWrapper from "../components/bs5/contentFooterWrapper/content
15
16
  import contentWrapper from "../components/bs5/contentWrapper/contentWrapper.hbs?raw";
16
17
  import correctincorrect from "../components/bs5/correctincorrect/correctincorrect.hbs?raw";
17
18
  import dateinput from "../components/bs5/dateinput/dateinput.hbs?raw";
19
+ import directionLinks from "../components/bs5/directionLinks/directionLinks.hbs?raw";
18
20
  import footer from "../components/bs5/footer/footer.hbs?raw";
19
21
  import footerForgov from "../components/bs5/footer/footerForgov.hbs?raw";
20
22
  import formcheck from "../components/bs5/formcheck/formcheck.hbs?raw";
@@ -51,6 +53,7 @@ import video from "../components/bs5/video/video.hbs?raw";
51
53
  */
52
54
  export default function handlebarsPartials(handlebars) {
53
55
  handlebars.registerPartial("accordion", accordion);
56
+ handlebars.registerPartial("backToTop", backToTop);
54
57
  handlebars.registerPartial("banner", banner);
55
58
  handlebars.registerPartial("blockquote", blockquote);
56
59
  handlebars.registerPartial("breadcrumbs", breadcrumbs);
@@ -64,6 +67,7 @@ export default function handlebarsPartials(handlebars) {
64
67
  handlebars.registerPartial("contentWrapper", contentWrapper);
65
68
  handlebars.registerPartial("correctincorrect", correctincorrect);
66
69
  handlebars.registerPartial("dateinput", dateinput);
70
+ handlebars.registerPartial("directionLinks", directionLinks);
67
71
  handlebars.registerPartial("footer", footer);
68
72
  handlebars.registerPartial("footerForgov", footerForgov);
69
73
  handlebars.registerPartial("formcheck", formcheck);
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qld-gov-au/qgds-bootstrap5",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "@fortawesome/fontawesome-free": "^6.6.0",
45
45
  "bootstrap": "^5.3.1",
46
- "material-symbols": "^0.28.1"
46
+ "material-symbols": "^0.29.3"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@chromatic-com/storybook": "^3.2.2",
@@ -61,12 +61,12 @@
61
61
  "@storybook/test": "^8.4.2",
62
62
  "@storybook/theming": "^8.4.2",
63
63
  "@stylistic/eslint-plugin-js": "2.1.0",
64
- "@vitejs/plugin-vue": "5.2.1",
64
+ "@vitejs/plugin-vue": "5.2.3",
65
65
  "autoprefixer": "^10.4.20",
66
66
  "chai": "^5.2.0",
67
67
  "chalk": "^5.3.0",
68
68
  "chromatic": "^11.5.5",
69
- "esbuild": "0.25.0",
69
+ "esbuild": "0.25.2",
70
70
  "esbuild-plugin-copy": "^2.1.1",
71
71
  "esbuild-plugin-eslint": "^0.3.7",
72
72
  "esbuild-plugin-handlebars": "1.0.3",
@@ -77,12 +77,12 @@
77
77
  "handlebars": "4.7.8",
78
78
  "http-server": "^14.1.1",
79
79
  "minimist": "^1.2.8",
80
- "mocha": "^10.7.3",
81
- "npm-run-all2": "^6.2.3",
80
+ "mocha": "^11.1.0",
81
+ "npm-run-all2": "^7.0.2",
82
82
  "onchange": "^7.1.0",
83
83
  "portfinder": "^1.0.32",
84
84
  "postcss": "^8.4.47",
85
- "prettier": "3.3.3",
85
+ "prettier": "3.5.3",
86
86
  "raw-loader": "^4.0.2",
87
87
  "rimraf": "^6.0.1",
88
88
  "run-parallel": "^1.2.0",
@@ -0,0 +1,10 @@
1
+ {
2
+ "hide_back_to_top": false,
3
+ "min_page_height": 0,
4
+ "button": {
5
+ "label": "Back to top",
6
+ "islink": true,
7
+ "iconClass": "btn-icon",
8
+ "iconPosition": "trailing"
9
+ }
10
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "id": "",
3
+ "label": "Up",
4
+ "href": "#",
5
+ "target": "_blank",
6
+ "class": "up"
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qld-gov-au/qgds-bootstrap5",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "@fortawesome/fontawesome-free": "^6.6.0",
45
45
  "bootstrap": "^5.3.1",
46
- "material-symbols": "^0.28.1"
46
+ "material-symbols": "^0.29.3"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@chromatic-com/storybook": "^3.2.2",
@@ -61,12 +61,12 @@
61
61
  "@storybook/test": "^8.4.2",
62
62
  "@storybook/theming": "^8.4.2",
63
63
  "@stylistic/eslint-plugin-js": "2.1.0",
64
- "@vitejs/plugin-vue": "5.2.1",
64
+ "@vitejs/plugin-vue": "5.2.3",
65
65
  "autoprefixer": "^10.4.20",
66
66
  "chai": "^5.2.0",
67
67
  "chalk": "^5.3.0",
68
68
  "chromatic": "^11.5.5",
69
- "esbuild": "0.25.0",
69
+ "esbuild": "0.25.2",
70
70
  "esbuild-plugin-copy": "^2.1.1",
71
71
  "esbuild-plugin-eslint": "^0.3.7",
72
72
  "esbuild-plugin-handlebars": "1.0.3",
@@ -77,12 +77,12 @@
77
77
  "handlebars": "4.7.8",
78
78
  "http-server": "^14.1.1",
79
79
  "minimist": "^1.2.8",
80
- "mocha": "^10.7.3",
81
- "npm-run-all2": "^6.2.3",
80
+ "mocha": "^11.1.0",
81
+ "npm-run-all2": "^7.0.2",
82
82
  "onchange": "^7.1.0",
83
83
  "portfinder": "^1.0.32",
84
84
  "postcss": "^8.4.47",
85
- "prettier": "3.3.3",
85
+ "prettier": "3.5.3",
86
86
  "raw-loader": "^4.0.2",
87
87
  "rimraf": "^6.0.1",
88
88
  "run-parallel": "^1.2.0",
@@ -0,0 +1,10 @@
1
+ {
2
+ "hide_back_to_top": false,
3
+ "min_page_height": 0,
4
+ "button": {
5
+ "label": "Back to top",
6
+ "islink": true,
7
+ "iconClass": "btn-icon",
8
+ "iconPosition": "trailing"
9
+ }
10
+ }
@@ -0,0 +1,23 @@
1
+ export function backToTop() {
2
+ let hasBackToTop = document.getElementsByClassName("back-to-top");
3
+
4
+ if (hasBackToTop.length > 0) {
5
+ let backToTop = document.querySelector(".back-to-top");
6
+
7
+ let parentValue = backToTop.closest(".qld__widgets");
8
+ let minHightValue = parentValue.getAttribute("data-min-page-height");
9
+ let minScreenHight = parseInt(window.innerHeight * minHightValue);
10
+ let backToTopPos = backToTop.getBoundingClientRect().top;
11
+
12
+ if (backToTopPos <= minScreenHight) {
13
+ backToTop.classList.add("hide");
14
+ } else {
15
+ backToTop.classList.remove("hide");
16
+ backToTop.onclick = function () {
17
+ document.body.scrollTop = 0; // For Safari
18
+ document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
19
+ event.preventDefault();
20
+ }
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,14 @@
1
+ {{#unless hide_back_to_top}}
2
+ <div class="qld__widgets" data-min-page-height="{{isdefined min_page_height 0}}">
3
+ {{> button
4
+ variantClass=(isdefined button.variantClass "back-to-top")
5
+ islink=(isdefined button.islink true)
6
+ isdisabled=(isdefined button.isdisabled false)
7
+ iconClass=(isdefined button.iconClass "")
8
+ iconPosition=(isdefined button.iconPosition "trailing")
9
+ label=(isdefined button.label "Back to top")
10
+ href=(isdefined button.href "#")
11
+ target=(isdefined button.target "_self")
12
+ }}
13
+ </div>
14
+ {{/unless}}
@@ -0,0 +1,10 @@
1
+ import Component from "../../../js/QGDSComponent.js";
2
+ import template from "./backToTop.hbs?raw";
3
+
4
+ export class BackToTop {
5
+ // Instantiate Back to Top component, passing data for template rendering.
6
+
7
+ constructor(data = {}) {
8
+ return new Component(template, data);
9
+ }
10
+ }
@@ -0,0 +1,15 @@
1
+ import { Canvas, Meta, Story } from "@storybook/blocks"
2
+ import * as BackToTopStories from "./backToTop.stories"
3
+
4
+ <Meta of={BackToTopStories} />
5
+
6
+ # Back to Top
7
+ <Canvas>
8
+ <Story of={BackToTopStories.Default} />
9
+ </Canvas>
10
+
11
+ ## Design resources
12
+
13
+ - [Component library (Figma)](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=23167-395564&t=Hc9l3zmwhJe3tqyn-0)
14
+ - [Master component file (Figma)](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=11056-321317&p=f&t=k3rhuWqQX2wN7QZo-0)
15
+ - [Design System website](https://www.designsystem.qld.gov.au/components/back-to-top)
@@ -0,0 +1,101 @@
1
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------
2
+ // Widgets
3
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------
4
+
5
+ .qld__widgets {
6
+ display: flex;
7
+ align-items: baseline;
8
+ flex-direction: row;
9
+ position: relative;
10
+ z-index: 1;
11
+
12
+ &.fixed {
13
+ position: fixed;
14
+ bottom: 0.75rem;
15
+ right: 0.75rem;
16
+ z-index: 10;
17
+ }
18
+ }
19
+
20
+ .qld__widgets+.qld__footer {
21
+ @include media-breakpoint-up(xl) {
22
+ padding-block-end: 4rem;
23
+ }
24
+ }
25
+
26
+ a.back-to-top,
27
+ a.btn.back-to-top {
28
+ --qld-btn-color: var(--#{$prefix}light-action-primary);
29
+ --qld-btn-active-color: var(--#{$prefix}light-action-primary);
30
+ --qld-btn-bg: var(--#{$prefix}neutral-lightest);
31
+ --qld-btn-hover-bg: var(--#{$prefix}neutral-light);
32
+ --btn-border: 0px;
33
+ --btn-border-colour: var(--qld-btn-bg);
34
+
35
+ text-decoration: underline;
36
+ text-decoration-color: transparent;
37
+
38
+ //Icon
39
+ --btn-icon-color: var(--#{$prefix}light-action-secondary);
40
+ --btn-icon: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.0518 8.1205L6.63557 16.4361C6.44609 16.6153 6.22435 16.7076 5.97036 16.7128C5.71637 16.7183 5.49185 16.6234 5.2968 16.4282C5.1015 16.233 5.00259 16.0122 5.00006 15.7658C4.99728 15.5194 5.0948 15.2985 5.29263 15.1033L15.1755 5.35051C15.2995 5.22843 15.4286 5.13943 15.563 5.08351C15.6976 5.02784 15.8454 5 16.0066 5C16.168 5 16.3155 5.02784 16.449 5.08351C16.5826 5.13943 16.7114 5.22843 16.8353 5.35051L26.7183 15.1033C26.9012 15.2838 26.995 15.5003 26.9998 15.7527C27.0046 16.0053 26.9108 16.2305 26.7183 16.4282C26.5176 16.6234 26.2919 16.7211 26.0409 16.7211C25.7899 16.7211 25.5687 16.6234 25.3772 16.4282L16.9591 8.1205V26.0589C16.9591 26.3303 16.8687 26.555 16.6881 26.733C16.5077 26.911 16.2802 27 16.0054 27C15.7305 27 15.5028 26.911 15.3224 26.733C15.142 26.555 15.0518 26.3303 15.0518 26.0589V8.1205Z' fill='%23131212'/%3E%3C/svg%3E%0A");
41
+
42
+ margin-block-start: 0.5rem;
43
+ margin-inline-start: auto;
44
+ background-color: var(--qld-btn-bg);
45
+ border: var(--btn-border) solid var(--btn-border-colour);
46
+ padding-block: calc(0.75rem - var(--btn-border));
47
+ padding-inline: 1rem;
48
+ border-radius: 0.25rem;
49
+
50
+ transition: all 0.15s ease-in-out;
51
+
52
+ .btn-icon {
53
+ width: 1.5rem;
54
+ height: 1.5rem;
55
+ display: inline-block;
56
+ vertical-align: middle;
57
+ background-color: var(--btn-icon-color);
58
+ mask-image: var(--btn-icon);
59
+ mask-size: contain;
60
+ mask-position: center;
61
+ margin: 0;
62
+
63
+ &.leading {
64
+ margin-right: 0.5rem;
65
+ }
66
+
67
+ &.trailing {
68
+ margin-left: 0.5rem;
69
+ }
70
+ }
71
+
72
+ &:hover,
73
+ &:focus {
74
+ box-shadow: 0px 1px 2px rgba(0, 0, 0, .2), 0px 1px 3px 1px rgba(0, 0, 0, .1);
75
+ --btn-icon-color: var(--#{$prefix}light-action-secondary-hover);
76
+ }
77
+
78
+ &:visited {
79
+ color: var(--qld-btn-color);
80
+ }
81
+
82
+ &:hover,
83
+ &:focus,
84
+ &:active {
85
+ text-decoration-color: var(--qld-btn-color);
86
+ background-color: var(--qld-btn-hover-bg);
87
+ border-color: var(--btn-border-colour);
88
+ }
89
+
90
+ &.hide {
91
+ display: none;
92
+ width: 0;
93
+ height: 0;
94
+ }
95
+ }
96
+
97
+ @media print {
98
+ .qld__widgets {
99
+ display: none !important;
100
+ }
101
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @file bactToTop.stories.js
3
+ * @description Storybook configuration file for the BackToTop component.
4
+ * @module backToTop.stories
5
+ */
6
+
7
+ import { BackToTop } from "./backToTop.js";
8
+ import defaultdata from "./backToTop.data.json";
9
+
10
+ export default {
11
+ tags: ["autodocs"],
12
+ title: "3. Components/Back to Top",
13
+ render: (args) => new BackToTop(args).html,
14
+ args: defaultdata,
15
+
16
+ /**
17
+ * Additional parameters for the story.
18
+ *
19
+ * @type {Object}
20
+ * @property {Object} design - Configuration for the design parameter.
21
+ * @property {string} design.name - Name of the design parameter.
22
+ * @property {string} design.type - Type of the design parameter.
23
+ * @property {string} design.url - URL of the design parameter.
24
+ */
25
+ parameters: {
26
+ design: {
27
+ name: "QGDS Figma Reference",
28
+ type: "figma",
29
+ url: "https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=23167-395564&t=VORt8BOjhLPGSoci-0",
30
+ },
31
+ },
32
+ };
33
+
34
+ /**
35
+ * Default backToTop story
36
+ */
37
+ export const Default = {};
@@ -1,31 +1,42 @@
1
+ {{!-- Button icon partial --}}
2
+ {{#*inline "buttonIcon"~}}
3
+ <span class="btn-icon {{iconClass}} {{iconPosition}}"></span>
4
+ {{~/inline}}
5
+
1
6
  {{#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>
7
+
8
+ <button class="btn {{variantClass}} {{label}}" onclick="{{{onclick}}}" {{#if isdisabled}}disabled{{/if}} {{#if arialabel}}aria-label="{{arialabel}}"{{/if}} {{{dataatts}}}>
9
+ {{#if iconClass~}}
10
+ {{#ifCond iconPosition '==' 'leading'}}
11
+ {{~>buttonIcon~}}
12
+ {{/ifCond}}
13
+ {{/if}}
14
+
15
+ {{~label~}}
16
+
17
+ {{#if iconClass~}}
18
+ {{#ifCond iconPosition '==' 'trailing'}}
19
+ {{>buttonIcon~}}
20
+ {{/ifCond}}
21
+ {{/if}}
22
+ </button>
15
23
 
16
24
  {{else}}
17
25
 
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 }}
26
+ <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}}}>
27
+ {{#if iconClass~}}
28
+ {{#ifCond iconPosition '==' 'leading'}}
29
+ {{~> buttonIcon~}}
30
+ {{/ifCond}}
31
+ {{/if}}
32
+
33
+ {{~label~}}
34
+
35
+ {{#if iconClass~}}
36
+ {{#ifCond iconPosition '==' 'trailing'}}
37
+ {{~> buttonIcon~}}
38
+ {{/ifCond}}
39
+ {{/if}}
40
+ </a>
41
+
42
+ {{/unless}}
@@ -0,0 +1,15 @@
1
+ import { Canvas, Meta, Story } from "@storybook/blocks"
2
+ import * as DirectionLinksStories from "./directionLinks.stories"
3
+
4
+ <Meta of={DirectionLinksStories} />
5
+
6
+ # DirectionLinks
7
+ <Canvas>
8
+ <Story of={DirectionLinksStories.Default} />
9
+ </Canvas>
10
+
11
+ ## Design resources
12
+
13
+ - [Component library (Figma)](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=23167-395560&t=7cFV6FheiSfxWCL8-0)
14
+ - [Master component file (Figma)](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=11056-321363&p=f&t=cQBFbBP6J97taQCN-0)
15
+ - [Design System website](https://www.designsystem.qld.gov.au/components/direction-links)
@@ -0,0 +1,7 @@
1
+ {
2
+ "id": "",
3
+ "label": "Up",
4
+ "href": "#",
5
+ "target": "_blank",
6
+ "class": "up"
7
+ }
@@ -0,0 +1,9 @@
1
+ {{! valid class values are: up, down, left, right}}
2
+ <a class="qld-dir-link {{class}}"
3
+ {{~#if id}} id="{{id}}" {{/if~}}
4
+ href="{{href}}"
5
+ {{~#if target}} target="{{target}}"{{/if~}}
6
+ {{~#if arialabel}} aria-label="{{arialabel}}" {{/if~}}>
7
+ {{{label}}}
8
+ <span class="icon" aria-hidden="true"></span>
9
+ </a>
@@ -0,0 +1,11 @@
1
+ import Component from "../../../js/QGDSComponent.js";
2
+ import template from "./directionLinks.hbs?raw";
3
+
4
+ export class DirectionLinks {
5
+ // Use the global Component class to create a new instance of the Accordion component.
6
+ // A data object, containing the Handlebars placeholder replacement strings, should be provided as an argument.
7
+
8
+ constructor(data = {}) {
9
+ return new Component(template, data);
10
+ }
11
+ }