@qld-gov-au/qgds-bootstrap5 1.1.27 → 1.1.29

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 (78) hide show
  1. package/.storybook/main.js +69 -51
  2. package/.storybook/preview.js +106 -97
  3. package/dist/assets/components/bs5/banner/banner.hbs +62 -19
  4. package/dist/assets/components/bs5/head/head.hbs +1 -1
  5. package/dist/assets/components/bs5/promotionalPanel/promotionalPanel.hbs +52 -0
  6. package/dist/assets/css/qld.bootstrap.css +1 -1
  7. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  8. package/dist/assets/img/banner-desktop-dark-alt.jpg +0 -0
  9. package/dist/assets/img/banner-desktop-dark.jpg +0 -0
  10. package/dist/assets/img/banner-desktop-default.jpg +0 -0
  11. package/dist/assets/img/banner-desktop-light-alt.jpg +0 -0
  12. package/dist/assets/img/banner-desktop-light.jpg +0 -0
  13. package/dist/assets/img/banner-mobile-pattern.png +0 -0
  14. package/dist/assets/img/banner-texture-tile-dark-alt.png +0 -0
  15. package/dist/assets/img/banner-texture-tile-dark.png +0 -0
  16. package/dist/assets/img/banner-texture-tile-default.png +0 -0
  17. package/dist/assets/img/banner-texture-tile-light-alt.png +0 -0
  18. package/dist/assets/img/banner-texture-tile-light.png +0 -0
  19. package/dist/assets/js/handlebars.helpers.bundle.js.map +2 -2
  20. package/dist/assets/js/handlebars.helpers.js +61 -44
  21. package/dist/assets/js/handlebars.init.min.js +135 -41
  22. package/dist/assets/js/handlebars.init.min.js.map +4 -4
  23. package/dist/assets/js/handlebars.partials.js +2 -0
  24. package/dist/assets/js/qld.bootstrap.min.js +1 -1
  25. package/dist/assets/js/qld.bootstrap.min.js.map +2 -2
  26. package/dist/assets/node/handlebars.init.min.js +102 -25
  27. package/dist/assets/node/handlebars.init.min.js.map +3 -3
  28. package/dist/components/bs5/banner/banner.hbs +62 -19
  29. package/dist/components/bs5/head/head.hbs +1 -1
  30. package/dist/components/bs5/promotionalPanel/promotionalPanel.hbs +52 -0
  31. package/dist/components/handlebars.helpers.js +61 -44
  32. package/dist/components/handlebars.partials.js +2 -0
  33. package/dist/package.json +6 -6
  34. package/dist/sample-data/banner/banner.data.json +11 -19
  35. package/dist/sample-data/breadcrumbs/breadcrumbs.data.json +5 -1
  36. package/dist/sample-data/promotionalPanel/promotionalPanel.data.json +48 -0
  37. package/dist/sample-data/tabs/tabs.data.json +1 -1
  38. package/package.json +6 -6
  39. package/src/components/bs5/banner/Banner.mdx +3 -2
  40. package/src/components/bs5/banner/banner.data.json +11 -19
  41. package/src/components/bs5/banner/banner.grid.md +25 -0
  42. package/src/components/bs5/banner/banner.hbs +62 -19
  43. package/src/components/bs5/banner/banner.scss +516 -101
  44. package/src/components/bs5/banner/banner.stories.js +402 -88
  45. package/src/components/bs5/breadcrumbs/breadcrumb.functions.js +24 -24
  46. package/src/components/bs5/breadcrumbs/breadcrumbs.data.json +5 -1
  47. package/src/components/bs5/breadcrumbs/breadcrumbs.scss +86 -86
  48. package/src/components/bs5/breadcrumbs/breadcrumbs.stories.js +46 -19
  49. package/src/components/bs5/button/button.scss +52 -21
  50. package/src/components/bs5/card/card.scss +434 -378
  51. package/src/components/bs5/navbar/navbar.functions.js +1 -1
  52. package/src/components/bs5/promotionalPanel/PromotionalPanel.mdx +16 -0
  53. package/src/components/bs5/promotionalPanel/promotionalPanel.data.json +48 -0
  54. package/src/components/bs5/promotionalPanel/promotionalPanel.hbs +52 -0
  55. package/src/components/bs5/promotionalPanel/promotionalPanel.js +21 -0
  56. package/src/components/bs5/promotionalPanel/promotionalPanel.scss +320 -0
  57. package/src/components/bs5/promotionalPanel/promotionalPanel.stories.js +123 -0
  58. package/src/components/bs5/tabs/tabs.data.json +1 -1
  59. package/src/components/bs5/tabs/tabs.scss +2 -3
  60. package/src/components/bs5/textbox/textInput.scss +189 -186
  61. package/src/css/main.scss +1 -0
  62. package/src/css/qld-type.scss +16 -9
  63. package/src/css/qld-variables.scss +45 -8
  64. package/src/img/banner-desktop-dark-alt.jpg +0 -0
  65. package/src/img/banner-desktop-dark.jpg +0 -0
  66. package/src/img/banner-desktop-default.jpg +0 -0
  67. package/src/img/banner-desktop-light-alt.jpg +0 -0
  68. package/src/img/banner-desktop-light.jpg +0 -0
  69. package/src/img/banner-mobile-pattern.png +0 -0
  70. package/src/img/banner-texture-tile-dark-alt.png +0 -0
  71. package/src/img/banner-texture-tile-dark.png +0 -0
  72. package/src/img/banner-texture-tile-default.png +0 -0
  73. package/src/img/banner-texture-tile-light-alt.png +0 -0
  74. package/src/img/banner-texture-tile-light.png +0 -0
  75. package/src/js/handlebars.helpers.js +61 -44
  76. package/src/js/handlebars.partials.js +2 -0
  77. package/vite.config.js +7 -3
  78. package/src/components/bs5/banner/manifest.json +0 -0
@@ -1,56 +1,74 @@
1
1
  /** @type { import('@storybook/html-vite').StorybookConfig } */
2
+
3
+ import path from "path";
4
+ import fs from "fs";
5
+
2
6
  const config = {
3
- stories: [
4
- '../src/stories/Introduction.mdx',
5
- // Include all stories found under the src/components directory ( For example: alert/alert.stories.js )
6
- // Exlude any stories starting with an underscore ( For example: _exludeme.stories.js )
7
- '../src/**/!(*_)*.mdx',
8
- '../src/**/!(*_)*.stories.js',
9
- ],
10
- staticDirs: [{ from: '../dist', to: '/' }], //Bring dist in statically instead of having it minified
11
- addons: [
12
- //Storybook addons
13
- //https://storybook.js.org/addons/
14
- '@storybook/addon-a11y',
15
- '@storybook/addon-themes',
16
- '@storybook/addon-essentials',
17
- '@storybook/addon-interactions',
18
- '@storybook/addon-links',
19
- '@chromatic-com/storybook',
20
- 'storybook-addon-deep-controls',
21
- ],
22
-
23
- framework: {
24
- //Build the storybook with html-vite rendered - faster than webpack
25
- //https://www.npmjs.com/package/@storybook/html-vite
26
- name: '@storybook/html-vite',
27
- options: {},
28
- },
29
-
30
- //Autodocs for each component
31
- //https://storybook.js.org/docs/writing-docs/autodocs
32
- docs: {
33
- defaultName: 'Overview',
34
- },
35
-
36
- //Each component's JS module, for example Alert.js, imports a HTML string to use for it's template.
37
- //We add a plugin to handle these .hbs extensions. (Or .mustache, .html etc)
38
- //https://storybook.js.org/docs/api/main-config-vite-final
39
-
40
- viteFinal: async (config, { configType }) => {
41
- config.root = './dist';
42
- // config.plugins.push({
43
- // name: "html-transform",
44
- // transform(src, id) {
45
- // if (id.endsWith(".mustache") || id.endsWith(".html") || id.endsWith(".hbs")) {
46
- // // Transform your HTML files here (src is the file content as a string)
47
- // return src;
48
- // }
49
- // },
50
- // });
51
-
52
- return config;
53
- },
7
+ stories: [
8
+ "../src/stories/Introduction.mdx",
9
+ // Include all stories found under the src/components directory ( For example: alert/alert.stories.js )
10
+ // Exlude any stories starting with an underscore ( For example: _exludeme.stories.js )
11
+ "../src/**/!(*_)*.mdx",
12
+ "../src/**/!(*_)*.stories.js",
13
+ ],
14
+ staticDirs: [{ from: "../dist", to: "/" }], //Bring dist in statically instead of having it minified
15
+ addons: [
16
+ //Storybook addons
17
+ //https://storybook.js.org/addons/
18
+ "@storybook/addon-a11y",
19
+ "@storybook/addon-themes",
20
+ "@storybook/addon-essentials",
21
+ "@storybook/addon-interactions",
22
+ "@storybook/addon-links",
23
+ "@chromatic-com/storybook",
24
+ "storybook-addon-deep-controls",
25
+ ],
26
+
27
+ framework: {
28
+ //Build the storybook with html-vite rendered - faster than webpack
29
+ //https://www.npmjs.com/package/@storybook/html-vite
30
+ name: "@storybook/html-vite",
31
+ options: {},
32
+ },
33
+
34
+ //Autodocs for each component
35
+ //https://storybook.js.org/docs/writing-docs/autodocs
36
+ docs: {
37
+ defaultName: "Overview",
38
+ },
39
+
40
+ //Each component's JS module, for example Alert.js, imports a HTML string to use for it's template.
41
+ //We add a plugin to handle these .hbs extensions. (Or .mustache, .html etc)
42
+ //https://storybook.js.org/docs/api/main-config-vite-final
43
+ //Each component's JS module, for example Alert.js, imports a HTML string to use for it's template.
44
+ //We add a plugin to handle these .hbs extensions. (Or .mustache, .html etc)
45
+ //https://storybook.js.org/docs/api/main-config-vite-final
46
+
47
+ viteFinal: async (config, { configType }) => {
48
+ config.root = "./dist";
49
+ // config.plugins.push({
50
+ // name: "html-transform",
51
+ // transform(src, id) {
52
+ // if (id.endsWith(".mustache") || id.endsWith(".html") || id.endsWith(".hbs")) {
53
+ // // Transform your HTML files here (src is the file content as a string)
54
+ // return src;
55
+ // }
56
+ // },
57
+ // });
58
+
59
+ config.server = {
60
+ ...config.server,
61
+ fs: {
62
+ allow: [
63
+ // Allow access to assets
64
+ path.resolve(__dirname, "../src/assets"),
65
+ path.resolve(__dirname, "../src/img"),
66
+ ],
67
+ },
68
+ };
69
+
70
+ return config;
71
+ },
54
72
  };
55
73
 
56
74
  export default config;
@@ -1,109 +1,118 @@
1
- import '../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js';
2
- import '../src/js/qld.bootstrap.js';
3
- import '../src/css/main.scss';
4
- import { withThemeByClassName } from '@storybook/addon-themes';
5
- import { allBackgrounds } from './modes.js';
6
- import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
7
- import init from '../src/js/handlebars.init.js';
8
- import Handlebars from 'handlebars';
1
+ import "../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js";
2
+ import "../src/js/qld.bootstrap.js";
3
+ import "../src/css/main.scss";
4
+ import { withThemeByClassName } from "@storybook/addon-themes";
5
+ import { allBackgrounds } from "./modes.js";
6
+ import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
7
+ import init from "../src/js/handlebars.init.js";
8
+ import Handlebars from "handlebars";
9
9
 
10
10
  /** @type { import('@storybook/html-vite').Preview } */
11
11
  const preview = {
12
- parameters: {
13
- //actions: { argTypesRegex: "^on[A-Z].*" },
14
- chromatic: {
15
- //🔶 Test each story for ArticleCard in two modes
16
- modes: {
17
- // Light: allModes["Light"],
18
- // "Light alternative": allModes["Light alternative"],
19
- // Dark: allModes["Dark"],
20
- // "Dark alternative": allModes["Dark alternative"],
21
- //mobile: allModes["mobile"],
22
- //desktop: allModes["desktop"],
23
- //"1200px": {viewport: 1200}, //original non-modes based baseline
24
- },
25
- },
26
- viewport: {
27
- viewports: {
28
- //QLD-media Breakpoints
29
- small: { name: 'Small', styles: { width: '400px', height: '800px' } },
30
- medium: { name: 'Medium', styles: { width: '700px', height: '800px' } },
31
- large: { name: 'Large', styles: { width: '992px', height: '800px' } },
32
- xlarge: { name: 'Extra Large', styles: { width: '1312px', height: '1000px' } },
33
- xxlarge: { name: 'Extra Extra Large', styles: { width: '1599px', height: '1000px' } },
34
- navbreakpoint: { name: 'Nave Breakpoint', styles: { width: '992px', height: '800px' } },
35
- ...INITIAL_VIEWPORTS,
36
- },
37
- },
38
- hideNoControlsWarning: true,
39
- expanded: true,
40
- controls: {
41
- matchers: {
42
- color: /(background|color)$/i,
43
- date: /Date$/i,
44
- },
45
- },
46
- deepControls: { enabled: true },
47
- html: {
48
- highlighter: {
49
- wrapLines: false,
50
- },
51
- },
52
- docs: {
53
- source: {
54
- excludeDecorators: true,
55
- },
56
- },
57
- backgrounds: {
58
- //default: 'default',
59
- values: [
60
- allBackgrounds['default'],
61
- allBackgrounds['Light'],
62
- allBackgrounds['Light alternative'],
63
- allBackgrounds['Dark'],
64
- allBackgrounds['Dark alternative'],
65
- ],
66
- },
67
- options: {
68
- storySort: {
69
- method: 'alphabetical',
70
- // Set order of components in the Layout category
71
- order: ['*', ['Header', 'Footer', 'Breadcrumbs', 'Side navigation']],
72
- },
73
- },
74
- a11y: {
75
- // Optional configuration for the a11y addon
76
- config: {},
77
- options: {
78
- checks: { 'color-contrast': { options: { noScroll: true } } },
79
- restoreScroll: true,
80
- },
81
- },
82
- },
12
+ parameters: {
13
+ //actions: { argTypesRegex: "^on[A-Z].*" },
14
+ chromatic: {
15
+ //🔶 Test each story for ArticleCard in two modes
16
+ modes: {
17
+ // Light: allModes["Light"],
18
+ // "Light alternative": allModes["Light alternative"],
19
+ // Dark: allModes["Dark"],
20
+ // "Dark alternative": allModes["Dark alternative"],
21
+ //mobile: allModes["mobile"],
22
+ //desktop: allModes["desktop"],
23
+ //"1200px": {viewport: 1200}, //original non-modes based baseline
24
+ },
25
+ },
26
+ viewport: {
27
+ viewports: {
28
+ //QLD-media Breakpoints
29
+ small: { name: "Small", styles: { width: "400px", height: "800px" } },
30
+ medium: { name: "Medium", styles: { width: "700px", height: "800px" } },
31
+ large: { name: "Large", styles: { width: "992px", height: "800px" } },
32
+ xlarge: {
33
+ name: "Extra Large",
34
+ styles: { width: "1312px", height: "1000px" },
35
+ },
36
+ xxlarge: {
37
+ name: "Extra Extra Large",
38
+ styles: { width: "1599px", height: "1000px" },
39
+ },
40
+ navbreakpoint: {
41
+ name: "Nave Breakpoint",
42
+ styles: { width: "992px", height: "800px" },
43
+ },
44
+ ...INITIAL_VIEWPORTS,
45
+ },
46
+ },
47
+ hideNoControlsWarning: true,
48
+ expanded: true,
49
+ controls: {
50
+ matchers: {
51
+ color: /(background|color)$/i,
52
+ date: /Date$/i,
53
+ },
54
+ },
55
+ deepControls: { enabled: true },
56
+ html: {
57
+ highlighter: {
58
+ wrapLines: false,
59
+ },
60
+ },
61
+ docs: {
62
+ source: {
63
+ excludeDecorators: true,
64
+ },
65
+ },
66
+ backgrounds: {
67
+ //default: 'default',
68
+ values: [
69
+ allBackgrounds["default"],
70
+ allBackgrounds["Light"],
71
+ allBackgrounds["Light alternative"],
72
+ allBackgrounds["Dark"],
73
+ allBackgrounds["Dark alternative"],
74
+ ],
75
+ },
76
+ options: {
77
+ storySort: {
78
+ method: "alphabetical",
79
+ // Set order of components in the Layout category
80
+ order: ["*", ["Header", "Footer", "Breadcrumbs", "Side navigation"]],
81
+ },
82
+ },
83
+ a11y: {
84
+ // Optional configuration for the a11y addon
85
+ config: {},
86
+ options: {
87
+ checks: { "color-contrast": { options: { noScroll: true } } },
88
+ restoreScroll: true,
89
+ },
90
+ },
91
+ },
83
92
 
84
- decorators: [
85
- // data-bs-theme="dark" won't be used
86
- withThemeByClassName({
87
- themes: {
88
- None: '',
89
- Light: 'light',
90
- 'Light alternative': 'alt',
91
- Dark: 'dark',
92
- 'Dark alternative': 'dark-alt',
93
- },
94
- defaultTheme: 'None',
95
- }),
96
- (Story) => {
97
- init(Handlebars);
98
- return `
93
+ decorators: [
94
+ // data-bs-theme="dark" won't be used
95
+ withThemeByClassName({
96
+ themes: {
97
+ None: "",
98
+ Light: "light",
99
+ "Light alternative": "alt",
100
+ Dark: "dark",
101
+ "Dark alternative": "dark-alt",
102
+ },
103
+ defaultTheme: "None",
104
+ }),
105
+ (Story) => {
106
+ init(Handlebars);
107
+ return `
99
108
 
100
109
  ${Story()}
101
110
 
102
111
  `;
103
- },
104
- ],
112
+ },
113
+ ],
105
114
 
106
- tags: ['autodocs'],
115
+ tags: ["autodocs"],
107
116
  };
108
117
 
109
118
  export default preview;
@@ -1,29 +1,72 @@
1
- <!-- QGDS Partial: banner -->
1
+ <!-- QGDS Banner Component -->
2
+ <div class="qld-banner qld-banner-grid {{ bannerType }} {{ variantClass }} {{ backgroundType }}" role="banner">
3
+ <div class="container-fluid">
4
+ <div class="banner-inner">
2
5
 
3
- <div class="container-fluid qld-banner {{variantClass}}">
6
+ <div class="banner-breadcrumbs">
7
+ {{> breadcrumbs breadcrumbs }}
8
+ </div>
9
+
10
+ <div class="banner-content">
4
11
 
5
- <div class="container">
6
- <div class="row">
7
-
8
- <div class="col-12 col-md-7">
12
+ {{#if title}}
9
13
 
10
- {{{breadcrumbs}}}
14
+ {{!-- titleClasses accepts a "title-block" class --}}
15
+ <h1 class="banner-title-wrap {{ join titleClasses }}">
16
+ <span class="banner-title">{{~title~}}</span>
17
+ {{#if subtitle }}
18
+ <span class="banner-subtitle">{{~subtitle~}}</span>
19
+ {{/if}}
20
+ </h1>
21
+ {{/if}}
11
22
 
12
- <h1 class="banner-title">{{{title}}}</h1>
13
- <p class="banner-lead">{{{content}}}</p>
14
23
 
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}}
24
+ {{#if abstract}}
25
+ <div class="banner-abstract">
26
+ {{abstract}}
27
+ </div>
28
+ {{/if}}
22
29
 
30
+ {{!-- CTA Buttons block. Pass an array of button data objects --}}
31
+ {{#if buttons}}
32
+ <div class="banner-cta" role="group" aria-label="Available options">
33
+ <div class="cta-buttons">
34
+ {{#each buttons}}
35
+ {{> button this }}
36
+ {{/each}}
23
37
  </div>
38
+ </div>
39
+ {{/if}}
40
+
41
+ {{!-- CTA Cards block. Pass an array of card data objects --}}
42
+ {{#if cards}}
43
+ <div class="banner-cta" role="group" aria-label="Available options">
44
+ <div class="cta-cards">
45
+ {{#each cards }}
46
+ {{> card this }}
47
+ {{/each }}
48
+ </div>
49
+ </div>
50
+ {{/if}}
51
+
52
+ {{!-- ~A generic content block for edge cases. Allows any HTML via content variable~ --}}
53
+ {{#if content}}
54
+ <div class="banner-extra">
55
+ {{{ sanitise content }}}
56
+ </div>
57
+ {{/if}}
58
+
24
59
  </div>
25
- </div>
60
+ {{!-- End banner content --}}
26
61
 
27
- <div class="banner-image {{image.classes}}" style="--banner-background-img:url({{image.url}})"></div>
62
+ {{#if image }}
63
+ <div class="banner-image {{ join image.classes }}">
64
+ <div class="banner-image-inner" style="background-image:url({{image.url}})" role="img"
65
+ aria-label="{{ image.alt }}"></div>
66
+ </div>
67
+ {{/if}}
28
68
 
29
- </div>
69
+ </div>
70
+
71
+ </div>
72
+ </div>
@@ -1,5 +1,5 @@
1
1
 
2
- <!-- VERSION_DETAILS={"project_id":"@qld-gov-au/qgds-bootstrap5","version":"1.1.27","branch":"HEAD","tag":"v1.1.27","commit":"d01a4424bef0f0bf5aa086623640ca63e663d51f","majorVersion":"v1"} -->
2
+ <!-- VERSION_DETAILS={"project_id":"@qld-gov-au/qgds-bootstrap5","version":"1.1.29","branch":"HEAD","tag":"v1.1.29","commit":"f2f3e090dd7e555afd45234038e59cecd493a149","majorVersion":"v1"} -->
3
3
 
4
4
  {{! Select environment, used verbatium if not using predefind key
5
5
  cdn := PROD|STAGING|BETA|TEST|DEV|???
@@ -0,0 +1,52 @@
1
+ <section class="qld-promo-panel {{#ifCond type '==' 'indent-text'}}indent{{/ifCond}} {{#ifCond type '==' 'indent-img'}}indent{{/ifCond}} {{type}}">
2
+ <div class="row {{#ifCond type '==' 'promo'}}bg-img{{else}}{{variantClass}}{{/ifCond}} {{contentAlignment}}"
3
+ {{#ifCond type '==' 'promo'}}
4
+ style="background-image: url({{promoImage}});"
5
+ {{/ifCond}}>
6
+ <div class="image-panel">
7
+ <div class="promo-panel-image"
8
+ {{#ifCond type '!=' 'promo'}}
9
+ style="background-image: url({{promoImage}})"
10
+ {{/ifCond}}>
11
+ </div>
12
+ </div>
13
+ <div class="content-panel {{variantClass}}">
14
+ {{#if icon}}
15
+ <div class="icon-container">
16
+ <div class="icon-body">
17
+ <i class="qld-icon {{icon}}"></i>
18
+ </div>
19
+ </div>
20
+ {{/if}}
21
+ <div class="main">
22
+ {{#if title}}
23
+ <h2>{{~{title}~}}</h2>
24
+ {{/if}}
25
+ {{#if abstract}}
26
+ <div class="promo-abstract">
27
+ {{~{abstract}~}}
28
+ </div>
29
+ {{/if}}
30
+ {{#if body}}
31
+ {{~{body}~}}
32
+ {{/if}}
33
+ </div>
34
+ {{#if cta.items}}
35
+ <ul class="cta-container">
36
+ {{#each cta.items}}
37
+ <li>
38
+ {{> callToAction label=value href=url target=target class=class arialabel=value id=id}}
39
+ </li>
40
+ {{/each}}
41
+ </ul>
42
+ {{/if}}
43
+ {{#if btn.items}}
44
+ <ul class="btn-container">
45
+ {{#each btn.items}}
46
+ <li>{{> button islink=islink variantClass=variantClass label=label href=href target=target dataatts="data-type='class'"}}</li>
47
+ {{/each}}
48
+ </ul>
49
+ {{/if}}
50
+ </div>
51
+ </div>
52
+ </section>