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

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 (32) hide show
  1. package/.storybook/main.js +46 -41
  2. package/.storybook/preview.js +96 -94
  3. package/dist/assets/components/bs5/callToAction/callToAction.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 +33 -0
  10. package/dist/assets/js/handlebars.init.min.js +42 -34
  11. package/dist/assets/js/handlebars.init.min.js.map +4 -4
  12. package/dist/assets/js/handlebars.partials.js +2 -0
  13. package/dist/assets/node/handlebars.init.min.js +29 -1
  14. package/dist/assets/node/handlebars.init.min.js.map +3 -3
  15. package/dist/components/bs5/callToAction/callToAction.hbs +9 -0
  16. package/dist/components/bs5/head/head.hbs +1 -1
  17. package/dist/components/handlebars.helpers.js +33 -0
  18. package/dist/components/handlebars.partials.js +2 -0
  19. package/dist/package.json +2 -2
  20. package/dist/sample-data/callToAction/callToAction.data.json +10 -0
  21. package/package.json +2 -2
  22. package/src/components/bs5/callToAction/callToAction.data.json +10 -0
  23. package/src/components/bs5/callToAction/callToAction.hbs +9 -0
  24. package/src/components/bs5/callToAction/callToAction.js +12 -0
  25. package/src/components/bs5/callToAction/callToAction.mdx +16 -0
  26. package/src/components/bs5/callToAction/callToAction.scss +93 -0
  27. package/src/components/bs5/callToAction/callToAction.stories.js +134 -0
  28. package/src/components/bs5/video/video.stories.js +23 -22
  29. package/src/css/main.scss +1 -0
  30. package/src/css/qld-print.scss +13 -0
  31. package/src/js/handlebars.helpers.js +33 -0
  32. package/src/js/handlebars.partials.js +2 -0
@@ -1,51 +1,56 @@
1
1
  /** @type { import('@storybook/html-vite').StorybookConfig } */
2
2
  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: [
11
- { from: '../dist', to: '/' },
12
- ], //Bring dist in statically instead of having it minified
13
- addons: [//Storybook addons
14
- //https://storybook.js.org/addons/
15
- "@storybook/addon-a11y", "@storybook/addon-themes", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/addon-links", "@chromatic-com/storybook"],
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
+ ],
16
22
 
17
- framework: {
18
- //Build the storybook with html-vite rendered - faster than webpack
19
- //https://www.npmjs.com/package/@storybook/html-vite
20
- name: "@storybook/html-vite",
21
- options: {},
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
+ },
23
29
 
24
- //Autodocs for each component
25
- //https://storybook.js.org/docs/writing-docs/autodocs
26
- docs: {
27
- defaultName: 'Overview'
28
- },
30
+ //Autodocs for each component
31
+ //https://storybook.js.org/docs/writing-docs/autodocs
32
+ docs: {
33
+ defaultName: 'Overview',
34
+ },
29
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
30
39
 
31
- //Each component's JS module, for example Alert.js, imports a HTML string to use for it's template.
32
- //We add a plugin to handle these .hbs extensions. (Or .mustache, .html etc)
33
- //https://storybook.js.org/docs/api/main-config-vite-final
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
+ // });
34
51
 
35
- viteFinal: async (config, {configType}) => {
36
- config.root = './dist'
37
- // config.plugins.push({
38
- // name: "html-transform",
39
- // transform(src, id) {
40
- // if (id.endsWith(".mustache") || id.endsWith(".html") || id.endsWith(".hbs")) {
41
- // // Transform your HTML files here (src is the file content as a string)
42
- // return src;
43
- // }
44
- // },
45
- // });
46
-
47
- return config;
48
- },
52
+ return config;
53
+ },
49
54
  };
50
55
 
51
56
  export default config;
@@ -1,107 +1,109 @@
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";
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
6
  import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
7
- import init from "../src/js/handlebars.init.js";
8
- import Handlebars from "handlebars";
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: { //QLD-media Breakpoints
28
- small: {name: "Small", styles: {width: "400px", height: "800px"}},
29
- medium: {name: "Medium", styles: {width: "700px", height: "800px"}},
30
- large: {name: "Large", styles: {width: "992px", height: "800px"}},
31
- xlarge: {name: "Extra Large", styles: {width: "1312px", height: "1000px"}},
32
- xxlarge: {name: "Extra Extra Large", styles: {width: "1599px", height: "1000px"}},
33
- navbreakpoint: {name: "Nave Breakpoint", styles: {width: "992px", height: "800px"}},
34
- ...INITIAL_VIEWPORTS
35
- },
36
- },
37
- hideNoControlsWarning: true,
38
- expanded: true,
39
- controls: {
40
- matchers: {
41
- color: /(background|color)$/i,
42
- date: /Date$/i,
43
- },
44
- },
45
- html: {
46
- highlighter: {
47
- wrapLines: false,
48
- },
49
- },
50
- docs: {
51
- source: {
52
- excludeDecorators: true,
53
- },
54
- },
55
- backgrounds: {
56
- //default: 'default',
57
- values: [
58
- allBackgrounds["default"],
59
- allBackgrounds["Light"],
60
- allBackgrounds["Light alternative"],
61
- allBackgrounds["Dark"],
62
- allBackgrounds["Dark alternative"],
63
- ],
64
- },
65
- options: {
66
- storySort: {
67
- method: 'alphabetical',
68
- // Set order of components in the Layout category
69
- order: ['*', ['Header', 'Footer', 'Breadcrumbs', 'Side navigation']],
70
- }
71
- },
72
- a11y: {
73
- // Optional configuration for the a11y addon
74
- config: {},
75
- options: {
76
- checks: { 'color-contrast': { options: { noScroll: true } } },
77
- restoreScroll: true,
78
- },
79
- },
80
- },
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
+ },
81
83
 
82
- decorators: [
83
- // data-bs-theme="dark" won't be used
84
- withThemeByClassName({
85
- themes: {
86
- "None": '',
87
- "Light": 'light',
88
- "Light alternative": 'alt',
89
- "Dark": 'dark',
90
- "Dark alternative": 'dark-alt',
91
- },
92
- defaultTheme: 'None',
93
- }),
94
- (Story) => {
95
- init(Handlebars);
96
- return `
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 `
97
99
 
98
100
  ${Story()}
99
101
 
100
102
  `;
101
- },
102
- ],
103
+ },
104
+ ],
103
105
 
104
- tags: ["autodocs"]
106
+ tags: ['autodocs'],
105
107
  };
106
108
 
107
109
  export default preview;
@@ -0,0 +1,9 @@
1
+ <a class="qld-cta-link {{getClassNames "small, view-all" class}}"
2
+ {{#if id}}id="{{id}}"{{/if}}
3
+ href="{{href}}"
4
+ target="{{target}}"
5
+ {{#if arialabel}}aria-label="{{arialabel}}"{{/if}}
6
+ >
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.20","branch":"HEAD","tag":"v1.1.20","commit":"b27a477e05c7f21407637ba309ea30e4480fa5f3","majorVersion":"v1"} -->
2
+ <!-- VERSION_DETAILS={"project_id":"@qld-gov-au/qgds-bootstrap5","version":"1.1.21","branch":"HEAD","tag":"v1.1.21","commit":"a3f1a8cf0304d6c7f562866d133b170b491e720c","majorVersion":"v1"} -->
3
3
 
4
4
  {{! Select environment, used verbatium if not using predefind key
5
5
  cdn := PROD|STAGING|BETA|TEST|DEV|???