@qld-gov-au/qgds-bootstrap5 2.1.9 → 2.1.11

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 (182) hide show
  1. package/.esbuild/plugins/qgds-plugin-story-list-builder.js +112 -0
  2. package/.storybook/DocumentationTemplate.mdx +47 -0
  3. package/.storybook/addons/qgds-multi-code-panels/components/Panel.tsx +231 -0
  4. package/.storybook/addons/qgds-multi-code-panels/constants.js +8 -0
  5. package/.storybook/addons/qgds-multi-code-panels/manager.tsx +15 -0
  6. package/.storybook/addons/qgds-multi-code-panels/preset.js +12 -0
  7. package/.storybook/codeRefsDecorator.js +87 -0
  8. package/.storybook/customMDXComponents.jsx +284 -0
  9. package/.storybook/main.mjs +16 -11
  10. package/.storybook/manager.js +2 -2
  11. package/.storybook/preview.js +39 -1
  12. package/dist/assets/components/bs5/directionLinks/directionLinks.hbs +0 -1
  13. package/dist/assets/components/bs5/head/head.hbs +1 -1
  14. package/dist/assets/components/bs5/pagination/pagination.hbs +0 -7
  15. package/dist/assets/css/qld.bootstrap.css +2 -2
  16. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  17. package/dist/assets/css/qld.bootstrap.legacy.css +2 -2
  18. package/dist/assets/css/qld.bootstrap.legacy.css.map +3 -3
  19. package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
  20. package/dist/assets/js/handlebars.helpers.bundle.js.map +2 -2
  21. package/dist/assets/js/handlebars.init.min.js +3 -11
  22. package/dist/assets/js/handlebars.init.min.js.map +2 -2
  23. package/dist/assets/js/handlebars.partials.js +3 -11
  24. package/dist/assets/js/handlebars.partials.js.map +2 -2
  25. package/dist/assets/js/qld.bootstrap.min.js +1 -1
  26. package/dist/assets/node/handlebars.init.min.js +2 -10
  27. package/dist/assets/node/handlebars.init.min.js.map +2 -2
  28. package/dist/components/bs5/directionLinks/directionLinks.hbs +0 -1
  29. package/dist/components/bs5/head/head.hbs +1 -1
  30. package/dist/components/bs5/pagination/pagination.hbs +0 -7
  31. package/dist/package.json +8 -7
  32. package/dist/sample-data/sidenav/sidenav.data.json +1 -7
  33. package/esbuild.js +2 -0
  34. package/package.json +8 -7
  35. package/src/components/bs5/accordion/accordion.stories.js +6 -13
  36. package/src/components/bs5/accordion/metadata.json +15 -0
  37. package/src/components/bs5/backToTop/backToTop.stories.js +10 -14
  38. package/src/components/bs5/backToTop/manifest.json +15 -0
  39. package/src/components/bs5/backToTop/metadata.json +15 -0
  40. package/src/components/bs5/banner/banner.stories.js +16 -1
  41. package/src/components/bs5/banner/metadata.json +16 -0
  42. package/src/components/bs5/blockquote/blockquote.stories.js +20 -11
  43. package/src/components/bs5/blockquote/metadata.json +15 -0
  44. package/src/components/bs5/breadcrumbs/breadcrumbs.stories.js +6 -4
  45. package/src/components/bs5/breadcrumbs/metadata.json +16 -0
  46. package/src/components/bs5/button/button.stories.js +13 -5
  47. package/src/components/bs5/button/metadata.json +15 -0
  48. package/src/components/bs5/callToAction/callToAction.stories.js +6 -5
  49. package/src/components/bs5/callToAction/metadata.json +15 -0
  50. package/src/components/bs5/callout/callout.stories.js +6 -5
  51. package/src/components/bs5/callout/metadata.json +16 -0
  52. package/src/components/bs5/card/card--icon-list-footer.stories.js +4 -4
  53. package/src/components/bs5/card/card--multi-action.stories.js +6 -0
  54. package/src/components/bs5/card/card--no-action.stories.js +7 -0
  55. package/src/components/bs5/card/card--single-action.stories.js +7 -0
  56. package/src/components/bs5/card/metadata.json +15 -0
  57. package/src/components/bs5/containerLayout/containerLayout.stories.js +6 -0
  58. package/src/components/bs5/containerLayout/metadata.json +1 -0
  59. package/src/components/bs5/contentFooter/contentFooter.stories.js +26 -20
  60. package/src/components/bs5/contentFooter/metadata.json +15 -0
  61. package/src/components/bs5/correctincorrect/correctincorrect.stories.js +53 -38
  62. package/src/components/bs5/correctincorrect/metadata.json +14 -0
  63. package/src/components/bs5/dateinput/Dateinput.stories.js +6 -0
  64. package/src/components/bs5/dateinput/metadata.json +14 -0
  65. package/src/components/bs5/directionLinks/directionLinks.hbs +0 -1
  66. package/src/components/bs5/directionLinks/directionLinks.stories.js +4 -4
  67. package/src/components/bs5/directionLinks/metadata.json +16 -0
  68. package/src/components/bs5/footer/footer.stories.js +7 -1
  69. package/src/components/bs5/footer/metadata.json +15 -0
  70. package/src/components/bs5/formcheck/metadata.json +15 -0
  71. package/src/components/bs5/formcheck/stories/checkbox/checkbox.stories.js +5 -1
  72. package/src/components/bs5/formcheck/stories/radio/radio.stories.js +12 -1
  73. package/src/components/bs5/globalAlert/globalAlert.stories.js +9 -0
  74. package/src/components/bs5/globalAlert/metadata.json +15 -0
  75. package/src/components/bs5/head/head.stories.js +33 -14
  76. package/src/components/bs5/header/header.stories.js +10 -0
  77. package/src/components/bs5/header/metadata.json +15 -0
  78. package/src/components/bs5/icons/icons.stories.js +5 -0
  79. package/src/components/bs5/icons/metadata.json +15 -0
  80. package/src/components/bs5/image/image.stories.js +9 -0
  81. package/src/components/bs5/image/metadata.json +15 -0
  82. package/src/components/bs5/inpageAlert/inpageAlert.stories.js +9 -2
  83. package/src/components/bs5/inpageAlert/metadata.json +15 -0
  84. package/src/components/bs5/inpagenav/inpagenav.stories.js +8 -1
  85. package/src/components/bs5/inpagenav/metadata.json +15 -0
  86. package/src/components/bs5/link/link.stories.js +5 -5
  87. package/src/components/bs5/link/metadata.json +15 -0
  88. package/src/components/bs5/linkColumns/linkColumns.stories.js +4 -4
  89. package/src/components/bs5/linkColumns/metadata.json +15 -0
  90. package/src/components/bs5/logo/logo.stories.js +40 -5
  91. package/src/components/bs5/logo/metadata.json +16 -0
  92. package/src/components/bs5/metaDcTerms/metaDcTerms.stories.js +14 -9
  93. package/src/components/bs5/metaOpenGraph/metaOpenGraph.stories.js +14 -9
  94. package/src/components/bs5/modal/metadata.json +15 -0
  95. package/src/components/bs5/modal/modal.stories.js +64 -60
  96. package/src/components/bs5/navbar/metadata.json +15 -0
  97. package/src/components/bs5/navbar/navbar.stories.js +9 -4
  98. package/src/components/bs5/pageLayout/metadata.json +1 -0
  99. package/src/components/bs5/pageLayout/pageLayout.stories.js +1 -0
  100. package/src/components/bs5/pagination/metadata.json +15 -0
  101. package/src/components/bs5/pagination/pagination.hbs +0 -7
  102. package/src/components/bs5/pagination/pagination.stories.js +5 -0
  103. package/src/components/bs5/promotionalPanel/metadata.json +15 -0
  104. package/src/components/bs5/promotionalPanel/promotionalPanel.stories.js +4 -4
  105. package/src/components/bs5/quickexit/metadata.json +15 -0
  106. package/src/components/bs5/quickexit/quickexit.stories.js +7 -0
  107. package/src/components/bs5/searchInput/metadata.json +15 -0
  108. package/src/components/bs5/searchInput/searchInput.stories.js +5 -0
  109. package/src/components/bs5/select/Select.stories.js +8 -1
  110. package/src/components/bs5/select/metadata.json +15 -0
  111. package/src/components/bs5/sidenav/metadata.json +15 -0
  112. package/src/components/bs5/sidenav/sidenav.data.json +1 -7
  113. package/src/components/bs5/sidenav/sidenav.scss +5 -6
  114. package/src/components/bs5/sidenav/sidenav.stories.js +5 -0
  115. package/src/components/bs5/skiplinks/skipLinks.stories.js +5 -0
  116. package/src/components/bs5/spinner/Spinner.stories.js +8 -0
  117. package/src/components/bs5/spinner/metadata.json +15 -0
  118. package/src/components/bs5/table/metadata.json +15 -0
  119. package/src/components/bs5/table/table.stories.js +139 -61
  120. package/src/components/bs5/tabs/metadata.json +15 -0
  121. package/src/components/bs5/tabs/tabs.stories.js +8 -0
  122. package/src/components/bs5/tag/metadata.json +15 -0
  123. package/src/components/bs5/tag/tag--large.stories.js +7 -0
  124. package/src/components/bs5/tag/tag--standard.stories.js +12 -5
  125. package/src/components/bs5/tag/tag--status.stories.js +4 -0
  126. package/src/components/bs5/tag/tag.stories.js +10 -0
  127. package/src/components/bs5/textarea/Textarea.stories.js +8 -1
  128. package/src/components/bs5/textarea/metadata.json +15 -0
  129. package/src/components/bs5/textbox/Textbox.stories.js +11 -1
  130. package/src/components/bs5/textbox/metadata.json +15 -0
  131. package/src/components/bs5/typography/metadata.json +1 -0
  132. package/src/components/bs5/typography/typography.stories.js +4 -0
  133. package/src/components/bs5/video/metadata.json +15 -0
  134. package/src/components/bs5/video/video.stories.js +5 -5
  135. package/src/components/common/focus-styles/focusStyles.stories.js +13 -9
  136. package/src/js/QGDSComponent.js +0 -1
  137. package/src/js/handlebars.helpers.js +1 -0
  138. package/src/stories/Introduction/development.mdx +136 -0
  139. package/src/stories/Introduction/how-to-use.mdx +272 -0
  140. package/src/stories/Introduction.mdx +95 -13
  141. package/src/{components/bs5/accordion/Accordion.mdx → stories/archive/__Accordion.mdx} +3 -3
  142. package/src/stories/archive/__Blockquote.mdx +13 -0
  143. package/src/stories/archive/__BlockquoteCanvas.mdx +47 -0
  144. package/src/stories/archive/__backToTop.orig.mdx +13 -0
  145. package/src/stories/archive/__blockquote.stories.bak.js +132 -0
  146. package/src/stories/component-list.json +627 -0
  147. package/src/templates/data/component.metadata.template.json +15 -0
  148. package/src/templates/index.html +40 -37
  149. /package/src/{components/bs5/banner/Banner.mdx → stories/archive/__Banner.mdx} +0 -0
  150. /package/src/{components/bs5/blockquote/Blockquote.mdx → stories/archive/__Blockquote.bak.mdx} +0 -0
  151. /package/src/{components/bs5/breadcrumbs/Breadcrumbs.mdx → stories/archive/__Breadcrumbs.mdx} +0 -0
  152. /package/src/{components/bs5/button/Button.mdx → stories/archive/__Button.mdx} +0 -0
  153. /package/src/{components/bs5/callout/Callout.mdx → stories/archive/__Callout.mdx} +0 -0
  154. /package/src/{components/bs5/card/Card.mdx → stories/archive/__Card.mdx} +0 -0
  155. /package/src/{components/bs5/formcheck/stories/checkbox/Checkbox.mdx → stories/archive/__Checkbox.mdx} +0 -0
  156. /package/src/{components/bs5/dateinput/Dateinput.mdx → stories/archive/__Dateinput.mdx} +0 -0
  157. /package/src/{components/bs5/directionLinks/DirectionLinks.mdx → stories/archive/__DirectionLinks.mdx} +0 -0
  158. /package/src/{components/bs5/footer/Footer.mdx → stories/archive/__Footer.mdx} +0 -0
  159. /package/src/{components/bs5/globalAlert/GlobalAlert.mdx → stories/archive/__GlobalAlert.mdx} +0 -0
  160. /package/src/{components/bs5/header/Header.mdx → stories/archive/__Header.mdx} +0 -0
  161. /package/src/{components/bs5/image/Image.mdx → stories/archive/__Image.mdx} +0 -0
  162. /package/src/{components/bs5/inpageAlert/InpageAlert.mdx → stories/archive/__InpageAlert.mdx} +0 -0
  163. /package/src/{components/bs5/inpagenav/Inpagenav.mdx → stories/archive/__Inpagenav.mdx} +0 -0
  164. /package/src/{components/bs5/logo/Logo.mdx → stories/archive/__Logo.mdx} +0 -0
  165. /package/src/{components/bs5/modal/Modal.mdx → stories/archive/__Modal.mdx} +0 -0
  166. /package/src/{components/bs5/pagination/Pagination.mdx → stories/archive/__Pagination.mdx} +0 -0
  167. /package/src/{components/bs5/promotionalPanel/PromotionalPanel.mdx → stories/archive/__PromotionalPanel.mdx} +0 -0
  168. /package/src/{components/bs5/formcheck/stories/radio/Radio.mdx → stories/archive/__Radio.mdx} +0 -0
  169. /package/src/{components/bs5/searchInput/SearchInput.mdx → stories/archive/__SearchInput.mdx} +0 -0
  170. /package/src/{components/bs5/sidenav/Sidenav.mdx → stories/archive/__Sidenav.mdx} +0 -0
  171. /package/src/{components/bs5/skiplinks/SkipLinks.mdx → stories/archive/__SkipLinks.mdx} +0 -0
  172. /package/src/{components/bs5/table/Table.mdx → stories/archive/__Table.mdx} +0 -0
  173. /package/src/{components/bs5/tabs/Tabs.mdx → stories/archive/__Tabs.mdx} +0 -0
  174. /package/src/{components/bs5/tag/Tag.mdx → stories/archive/__Tag.mdx} +0 -0
  175. /package/src/{components/bs5/typography/Typography.mdx → stories/archive/__Typography.mdx} +0 -0
  176. /package/src/{components/bs5/video/Video.mdx → stories/archive/__Video.mdx} +0 -0
  177. /package/src/{components/bs5/backToTop/backToTop.mdx → stories/archive/__backToTop.mdx} +0 -0
  178. /package/src/{components/bs5/callToAction/callToAction.mdx → stories/archive/__callToAction.mdx} +0 -0
  179. /package/src/{components/bs5/accordion/mdx/_designResources.mdx → stories/archive/__designResources.mdx} +0 -0
  180. /package/src/{components/bs5/link/link.mdx → stories/archive/__link.mdx} +0 -0
  181. /package/src/{components/bs5/linkColumns/linkColumns.mdx → stories/archive/__linkColumns.mdx} +0 -0
  182. /package/src/{components/bs5/accordion/mdx/_usageInstructions.mdx → stories/archive/__usageInstructions.mdx} +0 -0
@@ -0,0 +1,136 @@
1
+ import { Meta } from "@storybook/addon-docs/blocks";
2
+
3
+ <Meta title="Introduction/Development" />
4
+
5
+ # QGDS Bootstrap 5 project development
6
+
7
+ Follow this guide to set up a local development environment for the QGDS Bootstrap 5 project.
8
+
9
+ Alternatively, you can fork the repository to create your own version for personal use, customisation or contribution.
10
+
11
+ ## Technical summary
12
+
13
+ **Build and development:**
14
+
15
+ - ESbuild - Fast bundling, minification, and transpilation
16
+ - Storybook - Component development, testing, and documentation
17
+ - Vitest - Unit testing framework
18
+
19
+ **Prerequisites:**
20
+
21
+ - Node v22+
22
+ - NPM 10.9.3+
23
+ - Java 11+ (Optional, for Maven builds)
24
+
25
+ ## Installation
26
+
27
+ **Quick build (Maven):**
28
+
29
+ If you have Java and Maven installed, this will pull in a local node/npm version and run through the full lifecycle build.
30
+
31
+ ```bash
32
+ git clone https://github.com/qld-gov-au/qgds-bootstrap5
33
+ cd qgds-bootstrap5
34
+ mvn install
35
+ ```
36
+
37
+ **Standard build (Node/NPM):**
38
+
39
+ Download and install dependencies:
40
+
41
+ ```bash
42
+ git clone https://github.com/qld-gov-au/qgds-bootstrap5
43
+ npm install
44
+ ```
45
+
46
+ Build the Design System CSS, Components and templates (output to `dist/`):
47
+
48
+ ```bash
49
+ npm run build
50
+ ```
51
+
52
+ **Preview components **
53
+
54
+ Preview components and documentation locally with Storybook:
55
+
56
+ ```bash
57
+ npm run storybook
58
+ ```
59
+
60
+ ## Linting
61
+
62
+ ```bash
63
+ npm run lint
64
+ ```
65
+
66
+ ## Husky
67
+
68
+ Husky is used to manage Git hooks for pre-commit and pre-push actions.
69
+
70
+ The following hooks are configured:
71
+
72
+ - **Pre-commit Hook:** Runs linting and unit tests before allowing a commit. This ensures code quality and prevents committing code that fails tests or does not adhere to coding standards.
73
+ - **Pre-push Hook:** Executes unit tests before pushing code to a remote repository. This helps catch issues early and maintains the integrity of the codebase.
74
+
75
+ ## Theming
76
+
77
+ -- todo
78
+
79
+ ## Unit Tests
80
+
81
+ In addition to manual testing via storybook, unit tests may be created and run via <code>vitest</code>.
82
+
83
+ ```bash
84
+ npm run test
85
+ ```
86
+
87
+ or use the browser based ui
88
+
89
+ ```bash
90
+ npm run test:ui
91
+ ```
92
+
93
+ See src/components/bs5/accordion/accordion.test.js for example unit test including snapshot and interaction tests with JSDOM.
94
+
95
+ ## Github Actions
96
+
97
+ This repo includes many workflows to reduce developer overheads. This includes but not limited to:
98
+
99
+ - CICD on all commit's and PR's
100
+ - GitHub io static document deployment based on develop/main
101
+ - Dependabot auto patching + storybook upgrade feature
102
+ - One click npm versioning publish (patch, minor, major) \*\*
103
+ - Auto generate release notes based on PR's created (On version Tag)
104
+ - Npm js package publish (On version Tag) \*\*\*
105
+ - GitHub package Publish (On version Tag) \*\*\*\*
106
+
107
+ Must configure GitHub service account ssh private key loaded into GitHub actions secret DEPLOY_KEY
108
+
109
+ - Must have npm js token loaded into GitHub actions secrets NPM_TOKEN to allow publishing.
110
+ \*\*\*\* 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.
111
+
112
+ ## Contributing
113
+
114
+ This repository is designed to be easily forked for personal development or contribution.
115
+
116
+ **After forking:**
117
+
118
+ - Enable GitHub Actions in your repository settings
119
+ - Configure GitHub Pages to deploy via GitHub Actions
120
+ - Set up your own Chromatic account for visual regression testing and change diffing
121
+
122
+ **External Contributions:**
123
+
124
+ We welcome contributions from the community! Feel free to submit pull requests with improvements, bug fixes, or new features. Your contributions may be included in the core library and CDN distribution.
125
+
126
+ ## IDE Recommendations
127
+
128
+ We recommend using VSCode as the IDE for development with the following plugins:
129
+
130
+ - Prettier
131
+ - ESLint
132
+ - Mustache JS or Handlebars JS template support
133
+
134
+ Webstorm also works.
135
+
136
+ ---
@@ -0,0 +1,272 @@
1
+ import { Meta } from "@storybook/addon-docs/blocks";
2
+
3
+ <Meta title="Introduction/How to use" />
4
+
5
+ # How to use QGDS Bootstrap 5
6
+
7
+ The Queensland Government Design System (QGDS) Bootstrap 5 library provides reusable UI components built on Bootstrap 5 for Queensland Government websites and applications.
8
+
9
+ Review the [Introduction](./?path=/docs/welcome--overview) page for an overview of the QGDS Bootstrap 5 Storybook and available components.
10
+
11
+ ---
12
+
13
+ ## Technical summary
14
+
15
+ **Core Technologies:**
16
+
17
+ - JavaScript (ES6+) - Modern JavaScript for component logic
18
+ - CSS/SCSS - Extends Bootstrap 5.3 with custom CSS properties and design tokens
19
+ - Handlebars - Template engine for component rendering (client and server-side)
20
+
21
+ **Distribution:**
22
+
23
+ - NPM - Package distribution for Node.js projects
24
+ - CDN - Direct browser integration via static hosting
25
+
26
+ **Design:**
27
+
28
+ - Figma - Design system and UI Kit source
29
+
30
+ ---
31
+
32
+ ## Prerequisites
33
+
34
+ Before installing QGDS Bootstrap 5, you'll need:
35
+
36
+ - **Node.js** 22+ or higher (for npm-based projects)
37
+ - **NPM v10.9.3** or higher (for npm-based projects)
38
+ - **Handlebars** 4.7.8 or higher
39
+ - **Bootstrap 5.3** (automatically included with QGDS)
40
+
41
+ ---
42
+
43
+ ## Resources
44
+
45
+ The QGDS Bootstrap 5 project compiles and distributes the following critical resources for client-side rendering.
46
+
47
+ The resources are available via CDN, as tagged Github releases, or via our project NPM package:
48
+
49
+ ### CDN
50
+ [https://static.qgov.net.au/qgds-bootstrap5/v2/v2.x.x-latest/assets/css/qld.bootstrap.css](https://static.qgov.net.au/qgds-bootstrap5/v2/v2.x.x-latest/assets/css/qld.bootstrap.css) (Global Stylesheet)
51
+ [https://static.qgov.net.au/qgds-bootstrap5/v2/v2.x.x-latest/assets/js/handlebars.init.min.js](https://static.qgov.net.au/qgds-bootstrap5/v2/v2.x.x-latest/assets/js/handlebars.init.min.js) (Components - _Handlebars templates_)
52
+ [https://static.qgov.net.au/qgds-bootstrap5/v2/v2.x.x-latest/assets/js/qld.bootstrap.min.js](https://static.qgov.net.au/qgds-bootstrap5/v2/v2.x.x-latest/assets/js/qld.bootstrap.min.js) (Global JS)
53
+
54
+ **Environment-specific CDNs:**
55
+ - Production: https://static.qgov.net.au/qgds-bootstrap5/...
56
+ - Staging: https://staging-static.qgov.net.au/qgds-bootstrap5/...
57
+ - Development: https://dev-static.qgov.net.au/qgds-bootstrap5/...
58
+
59
+ **Versioning:**
60
+ - Use v2.x.x-latest for automatic minor/patch updates
61
+ - Use specific versions (e.g., v2.1.8) for production stability
62
+
63
+ ### NPM Package
64
+
65
+ The library is available as an NPM package for Node.js projects:
66
+ [https://www.npmjs.com/package/@qld-gov-au/qgds-bootstrap5](https://www.npmjs.com/package/@qld-gov-au/qgds-bootstrap5)
67
+
68
+
69
+ ### Github Tagged Releases
70
+ Compiled CSS, JS and sample component data are also available via our Github release repository:
71
+ [https://github.com/qld-gov-au/qgds-bootstrap5-release](https://github.com/qld-gov-au/qgds-bootstrap5-release)
72
+
73
+ ---
74
+
75
+ ## How to use
76
+
77
+ QGDS Bootstrap 5 supports both server-side and client-side integration. All components are registered as Handlebars.js partials and can be invoked using the `{{> partialName}}` syntax. These partials accept data objects or inline properties for flexible rendering. Refer to the examples below for implementation-specific code snippets.
78
+
79
+
80
+ ### Server side
81
+ Use this approach for server-side rendering with Node.js, Next.js, Vue JS, etc.
82
+
83
+ Install QGDS Bootstrap 5 and Handlebars via NPM:
84
+
85
+ ```bash
86
+ npm install @qld-gov-au/qgds-bootstrap5 handlebars
87
+ ```
88
+
89
+ Example usage:
90
+
91
+ ```javascript
92
+ //index.js
93
+ import Handlebars from "handlebars";
94
+ import QGDSBundle from "@qld-gov-au/qgds-bootstrap5/handlebarsInit";
95
+
96
+ // Initialize QGDS (registers all component partials and helpers)
97
+ QGDSBundle.init(Handlebars);
98
+
99
+ // Component data (typically from your API or CMS)
100
+ const componentData = {
101
+ title: "Service update",
102
+ content:
103
+ "Our online services will be unavailable for maintenance from 2-4 AM AEST.",
104
+ variant: "warning",
105
+ dismissible: true,
106
+ };
107
+
108
+ // Render the component
109
+ const html = Handlebars.compile("{{> callout}}")(componentData);
110
+
111
+ // Use composed markup in your application
112
+ console.log(html);
113
+ ```
114
+
115
+ Run in console:
116
+ ```bash
117
+ node index.js
118
+ ```
119
+
120
+ ### Client side
121
+
122
+ QGDS Bootstrap 5 components can also be rendered directly in the browser. Use a CDN to load required QGDS resources, and include Handlebars runtime.
123
+
124
+ Components can be rendered by compiling Handlebars partials with data objects.
125
+
126
+ ```html
127
+ <html lang="en">
128
+ <head>
129
+ <meta charset="UTF-8" />
130
+ <title>QGDS Example</title>
131
+
132
+ <!-- QGDS Stylesheet -->
133
+ <link
134
+ rel="stylesheet"
135
+ href="https://static.qgov.net.au/qgds-bootstrap5/v2/v2.x.x-latest/assets/css/qld.bootstrap.css"
136
+ />
137
+ </head>
138
+ <body>
139
+
140
+ <div id="app" class="container">
141
+ </div>
142
+
143
+ <!-- Required JavaScript including Handlebars runtime and QGDS scripts -->
144
+ <script src="https://cdn.jsdelivr.net/npm/handlebars@4.7.8/dist/handlebars.min.js"></script>
145
+ <script src="https://static.qgov.net.au/qgds-bootstrap5/v2/v2.x.x-latest/assets/js/handlebars.init.min.js"></script>
146
+ <script src="https://static.qgov.net.au/qgds-bootstrap5/v2/v2.x.x-latest/assets/js/qld.bootstrap.min.js"></script>
147
+
148
+ <script>
149
+ // Setup an component instance using a Handlebars partial
150
+ const calloutTemplate = Handlebars.compile("{{> callout}}");
151
+
152
+ // Setup component data
153
+ // Refer to QGDS Bootstrap 5 release repository for example data structures
154
+ // https://github.com/qld-gov-au/qgds-bootstrap5-release/tree/develop/sample-data
155
+ const calloutData = {
156
+ title: "Welcome to QGDS",
157
+ content: "Get started with Queensland Government Design System",
158
+ variant: "info",
159
+ };
160
+
161
+ document.getElementById("app").innerHTML = calloutTemplate(calloutData);
162
+ </script>
163
+ </body>
164
+ </html>
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Working with component data
170
+
171
+ QGDS components are compiled by pairing a Handlebars JS template with a JSON data object.
172
+
173
+ Some of these data objects can be complex, containing nested structures for lists, buttons, links, and other sub-components.
174
+
175
+ The Handlebars JS library provides flexibility in how you pass data to component partials. You can use either:
176
+
177
+ 1. Define data for a component, then pass it to the partial
178
+
179
+ ```javascript
180
+ const mydata = {
181
+ title: "This is a callout title",
182
+ content: "This is a callout description",
183
+ };
184
+ const html = Handlebars.compile("{{> callout}}")(mydata);
185
+ ```
186
+
187
+ 2. Pass an object directly as the data argument
188
+ ```javascript
189
+ const html = Handlebars.compile("{{> callout}}")({
190
+ title: "This is a callout title",
191
+ content: "This is a callout description",
192
+ });
193
+ ```
194
+
195
+ 3. Use a partial with inline properties
196
+ ```javascript
197
+ const html = Handlebars.compile(
198
+ "{{> callout title='Click Me' content='This is a callout description'}}",
199
+ )();
200
+ ```
201
+
202
+ ### Sample data
203
+
204
+ Each of our component stories include code references that show example data, partials markup, and guidance on how to use them..
205
+
206
+ Our Bootstrap 5 release repository also includes sample JSON data files for each component.
207
+ [QGDS Bootstrap 5 Release Repository - Sample Data](https://github.com/qld-gov-au/qgds-bootstrap5-release/tree/develop/sample-data)
208
+
209
+
210
+ ## Code references
211
+
212
+ Browse the component library using the sidebar. Each component page in Storybook includes:
213
+
214
+ - Examples - Interactive component demos with different variants
215
+ - Controls - Adjustable properties to preview changes
216
+ - Code References - View JSON data, Handlebars templates, and rendered HTML
217
+ - Open any story
218
+ - Press Cmd+A (Mac) or Ctrl+A (Windows) to open the Actions panel
219
+ - Click the Code References tab
220
+
221
+ ---
222
+
223
+ ## Accessibility
224
+
225
+ This project is committed to providing accessible and inclusive components for all users.
226
+
227
+ **Standards Compliance:**
228
+
229
+ - All components are tested against [WCAG 2.1 Level AA](https://www.w3.org/WAI/WCAG21/quickref/) standards
230
+ - Follows [Queensland Government digital accessibility requirements](https://www.qld.gov.au/web-accessibility)
231
+ - Ensures equal access to information, services, and opportunities
232
+
233
+ **Reporting Issues:**
234
+
235
+ If you encounter accessibility barriers or have suggestions for improvement:
236
+
237
+ - [Open an issue on GitHub](https://github.com/qld-gov-au/qgds-bootstrap5/issues)
238
+ - Contact the QGDS team via the [Design System website](https://designsystem.qld.gov.au)
239
+
240
+ ---
241
+
242
+ ## Additional Resources
243
+
244
+ Package Repositories
245
+
246
+ - [QGDS Bootstrap 5 on npm](https://www.npmjs.com/@qld-gov-au/qgds-bootstrap5)
247
+ - [Source code (GitHub)](https://github.com/qld-gov-au/qgds-bootstrap5)
248
+ - [Release repository (GitHub)](https://github.com/qld-gov-au/qgds-bootstrap5-release)
249
+
250
+ Documentation
251
+
252
+ - [Storybook component library](https://qld-gov-au.github.io/qgds-bootstrap5)
253
+ - [Design System website](https://designsystem.qld.gov.au)
254
+
255
+ Design Resources
256
+
257
+ - [QGDS UI Kit (Figma)](https://www.figma.com/community/file/1577907940583715898)
258
+
259
+ Related Libraries
260
+
261
+ - [QGDS Design Tokens](https://www.npmjs.com/@qld-gov-au/qgds-tokens)
262
+ - [QGDS Design Tokens repository](https://github.com/qld-gov-au/qgds-tokens)
263
+ - [QGDS Design System Queensland Health (Vanilla)](https://github.com/Qld-Health-Online-Team/design-system)
264
+
265
+ ---
266
+
267
+ ## Support
268
+
269
+ For questions, issues, or contributions:
270
+
271
+ - Open an issue on GitHub
272
+ - Reach out to the QGDS team via the [Design System website](https://designsystem.qld.gov.au)
@@ -1,23 +1,105 @@
1
1
  import { Meta, Markdown } from "@storybook/addon-docs/blocks";
2
-
3
- import Readme from "../../README.md?raw";
2
+ import componentList from "./component-list.json";
4
3
 
5
4
  <Meta title="Welcome" />
6
5
 
7
- [//]: # "# Welcome to QGDS QOL BS MVP Storybook"
8
- [//]: #
9
- [//]: # "Welcome to Queensland Government Design System Qld Online Mvp Storybook, this documentation is mainly for development and testing purposes."
10
- [//]: # "For user orientated documentation, please visit https://www.forgov.qld.gov.au/swe."
6
+ <style>{`
7
+ .component-grid {
8
+ display: grid;
9
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
10
+ gap: 1.5rem;
11
+ margin: 2rem 0;
12
+ }
13
+ .component-card {
14
+ border: 1px solid #ddd;
15
+ border-radius: 4px;
16
+ padding: 1.25rem;
17
+ background: #fff;
18
+ transition: box-shadow 0.2s, transform 0.2s;
19
+ text-decoration: none;
20
+ color: inherit;
21
+ display: block;
22
+ }
23
+ .component-card:hover {
24
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
25
+ transform: translateY(-2px);
26
+ text-decoration: none;
27
+ }
28
+ .component-card-title {
29
+ font-size: 1.125rem;
30
+ font-weight: 600;
31
+ margin: 0 0 0.5rem 0;
32
+ color: #003865;
33
+ }
34
+ .component-card-scope {
35
+ display: inline-block;
36
+ font-size: 0.75rem;
37
+ padding: 0.25rem 0.5rem;
38
+ background: #f5f5f5;
39
+ border-radius: 3px;
40
+ margin-bottom: 0.5rem;
41
+ }
42
+ .component-card-description {
43
+ font-size: 0.875rem;
44
+ color: #666;
45
+ margin: 0;
46
+ }
47
+ .category-section {
48
+ margin-bottom: 3rem;
49
+ }
50
+ .category-title {
51
+ font-size: 1.5rem;
52
+ font-weight: 700;
53
+ margin-bottom: 1rem;
54
+ color: #003865;
55
+ }
56
+ `}
57
+ </style>
58
+
59
+
60
+ ## Welcome to the QGDS Bootstrap 5 library
61
+
62
+ This Storybook serves as the interactive documentation for the Bootstrap 5 implementation of the Queensland Government Design System (QGDS).
63
+
64
+ Whether you are starting a new project or updating an existing application, this library provides a robust, accessible, and compliant foundation for building digital services that look and feel like Queensland Government.
65
+
66
+ ## How to navigate this Storybook
67
+
68
+ Use the sidebar to explore components organised by category.
69
+
70
+ Find component variations and other information on each Overview tab.
71
+
72
+ In each individual story, open the Actions panel to explore adjustable properties (Controls) and example code (Code references)
73
+
74
+ ## Components
75
+
76
+ The following core components are available in this library. Additional layout and utility components can be found in the sidebar.
77
+
78
+ <div className="component-grid">
79
+ {componentList.map(component => (
80
+ <a
81
+ key={component.id}
82
+ href={`/?path=${component.storyPath}`}
83
+ className="component-card"
84
+ >
85
+ <div className="component-card-title">{component.title}</div>
86
+ </a>
87
+ ))}
88
+ </div>
11
89
 
12
- <Markdown>{Readme}</Markdown>
13
90
 
14
- ---
91
+ ## [How to use](?path=/docs/introduction-how-to-use--overview)
92
+ > Use this guide to implement the QGDS Bootstrap 5 edition in your web page or application.
15
93
 
16
- ## Component Badges
94
+ ## [Project development](?path=/docs/introduction-development---overview)
95
+ > Use this guide if working on or contributing to the QGDS Bootstrap 5 source code itself. It outlines the architecture, build processes, Github setup and repository forking.
17
96
 
18
- Components are labelled as:
19
97
 
20
- - **Core** Essential, broadly applicable components that serve as the single source of truth for the Queensland Government design system.
21
- - **Extended** Specialised components for needs not covered by the core set.
98
+ ## The QGDS Ecosystem
99
+ This library is part of a coordinated suite of tools designed to ensure visual and functional consistency across all Queensland Government digital touchpoints:
22
100
 
23
- Further information is available in the [QGDS UI Kit](https://www.figma.com/design/qKsxl3ogIlBp7dafgxXuCA/QGDS-UI-kit?node-id=8701-244248&m=dev).
101
+ - [Figma UI Kit](https://www.figma.com/community/file/978450410021220739): The design source of truth and visual specification for all components.
102
+ - [QGDS Website](https://www.designsystem.qld.gov.au): The central hgub for Design System and component guidance and documentation.
103
+ - Design Tokens: The foundational variables (colors, spacing, typography) that power our styles.
104
+ - QGDS Web Components: A framework-agnostic implementation of Design System by the Queensland Government.
105
+ - Vanilla Component Library: An independent framework-agnostic implementation of Design System by Queensland Health.
@@ -17,13 +17,13 @@ import UsageInstructions from "./mdx/_usageInstructions.mdx";
17
17
  <StorybookDocsTabs
18
18
  tabs={[
19
19
  {
20
- label: "Code",
20
+ label: "HTML",
21
21
  id: "code-doc",
22
22
  heading: "Component code",
23
23
  content: <Source language="html" id="accordion-default" />,
24
24
  },
25
25
  {
26
- label: "JSON",
26
+ label: "Component Data",
27
27
  id: "json-doc",
28
28
  heading: "Example Component data",
29
29
  content: (
@@ -31,7 +31,7 @@ import UsageInstructions from "./mdx/_usageInstructions.mdx";
31
31
  ),
32
32
  },
33
33
  {
34
- label: "Design Resources",
34
+ label: "UI kit",
35
35
  id: "design-resources-doc",
36
36
  content: <DesignResources />,
37
37
  },
@@ -0,0 +1,13 @@
1
+ import { Canvas, Meta, Story } from "@storybook/addon-docs/blocks";
2
+ import * as BlockquoteStories from "./blockquote.stories";
3
+
4
+ <Meta of={BlockquoteStories} />
5
+
6
+ # Blockquote
7
+
8
+ <Canvas of={BlockquoteStories.Default} />
9
+
10
+ ## Design resources
11
+
12
+ - [Master component file (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=11056-321340&mode=design&t=YLfxdziHdqD2Ty0o-0)
13
+ - [Design System website](https://www.designsystem.qld.gov.au/components/callouts#section__quote-example)
@@ -0,0 +1,47 @@
1
+ import { Meta, Story, Canvas, Source } from '@storybook/addon-docs/blocks';
2
+ import * as BlockquoteStories from './blockquote.stories';
3
+
4
+ <Meta of={BlockquoteStories} />
5
+
6
+ <Canvas
7
+ additionalActions={[
8
+ {
9
+ title: 'JSON',
10
+ onClick: () => {
11
+
12
+ const sourceToggleButton = document.querySelector('.docblock-code-toggle'); //Usually the hide/show code button
13
+
14
+ const sourcePanelContainer = document.querySelector('pre.prismjs');
15
+ if(sourcePanelContainer){
16
+ sourcePanelContainer.innerHTML = JSON.stringify(BlockquoteStories.Default.args, null, 2);
17
+ sourcePanelContainer.className = 'language-json';
18
+ }
19
+ },
20
+ },
21
+ {
22
+ title: 'Template',
23
+ onClick: () => {
24
+ // Show the Handlebars template
25
+ const template = '{{> blockquote}}'; // You can get this dynamically
26
+ console.log('Template:', template);
27
+
28
+ const sourceElement = document.querySelector('[data-docs-source] pre code');
29
+ if (sourceElement) {
30
+ sourceElement.textContent = template;
31
+ sourceElement.className = 'language-handlebars';
32
+ }
33
+ },
34
+ },
35
+ {
36
+ title: 'Show HTML',
37
+ onClick: () => {
38
+ // Reset to default HTML view
39
+ // This would restore the original source code
40
+ window.location.reload(); // Simple reset, or implement proper restoration
41
+ },
42
+ }
43
+
44
+ ]}
45
+ of={BlockquoteStories.Default}
46
+
47
+ />
@@ -0,0 +1,13 @@
1
+ import { Canvas, Meta, Story } from "@storybook/addon-docs/blocks";
2
+ import * as BackToTopStories from "./backToTop.stories";
3
+
4
+ <Meta of={BackToTopStories} />
5
+
6
+ # Back to Top
7
+
8
+ <Canvas of={BackToTopStories.Default} />
9
+
10
+ ## Design resources
11
+
12
+ - [Master component file (Figma)]()
13
+ - [Design System website](https://www.designsystem.qld.gov.au/components/back-to-top)