@qld-gov-au/qgds-bootstrap5 1.0.13 → 1.0.14
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.
- package/.storybook/main.js +1 -1
- package/.storybook/preview.js +8 -0
- package/README.md +96 -46
- package/dist/assets/css/qld.bootstrap.css +1 -1
- package/dist/assets/css/qld.bootstrap.css.map +3 -3
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.helpers.bundle.js.map +3 -3
- package/dist/assets/js/handlebars.helpers.js +4 -8
- package/dist/assets/js/qld.bootstrap.min.js +9 -9
- package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
- package/dist/components/bs5/breadcrumbs/breadcrumbs.hbs +1 -1
- package/dist/components/bs5/button/button.hbs +30 -9
- package/dist/components/bs5/header/header.hbs +15 -17
- package/dist/components/bs5/navbar/navbar.hbs +1 -1
- package/dist/components/bs5/quickexit/quickexit.hbs +28 -20
- package/dist/components/bs5/searchInput/searchInput.hbs +9 -3
- package/dist/components/handlebars.helpers.js +4 -8
- package/dist/components/handlebars.init.bundle.js +1 -1
- package/dist/components/handlebars.init.bundle.js.map +3 -3
- package/dist/sample-data/button/button.data.json +2 -1
- package/dist/sample-data/header/header.data.json +134 -75
- package/dist/sample-data/navbar/navbar.data.json +8 -8
- package/dist/sample-data/quickexit/quickexit.data.json +8 -1
- package/dist/sample-data/searchInput/searchInput.data.json +10 -1
- package/package.json +20 -19
- package/src/components/bs5/breadcrumbs/breadcrumb.functions.js +71 -32
- package/src/components/bs5/breadcrumbs/breadcrumbs.hbs +1 -1
- package/src/components/bs5/button/button.data.json +2 -1
- package/src/components/bs5/button/button.hbs +30 -9
- package/src/components/bs5/button/button.scss +87 -44
- package/src/components/bs5/button/button.stories.js +121 -27
- package/src/components/bs5/callout/callout.scss +1 -1
- package/src/components/bs5/header/_colours.scss +0 -52
- package/src/components/bs5/header/header.data.json +134 -75
- package/src/components/bs5/header/header.functions.js +1 -180
- package/src/components/bs5/header/header.hbs +15 -17
- package/src/components/bs5/header/header.scss +7 -156
- package/src/components/bs5/header/header.stories.js +10 -50
- package/src/components/bs5/modal/modal.scss +54 -35
- package/src/components/bs5/modal/modal.stories.js +2 -2
- package/src/components/bs5/navbar/_colours.scss +46 -82
- package/src/components/bs5/navbar/navbar.data.json +8 -8
- package/src/components/bs5/navbar/navbar.hbs +1 -1
- package/src/components/bs5/navbar/navbar.scss +15 -6
- package/src/components/bs5/quickexit/_colours.scss +28 -0
- package/src/components/bs5/quickexit/quickexit.data.json +8 -1
- package/src/components/bs5/quickexit/quickexit.hbs +28 -20
- package/src/components/bs5/quickexit/quickexit.scss +236 -156
- package/src/components/bs5/quickexit/quickexit.stories.js +35 -13
- package/src/components/bs5/searchInput/_colours.scss +63 -0
- package/src/components/bs5/searchInput/search.functions.js +170 -0
- package/src/components/bs5/searchInput/searchInput.data.json +10 -1
- package/src/components/bs5/searchInput/searchInput.hbs +9 -3
- package/src/components/bs5/searchInput/searchInput.scss +122 -21
- package/src/components/bs5/searchInput/searchInput.stories.js +1 -1
- package/src/components/bs5/tag/tag.scss +4 -2
- package/src/js/handlebars.helpers.js +4 -8
- package/src/main.js +24 -7
- package/src/main.scss +6 -3
- package/src/scss/qld-print.scss +365 -0
- package/src/scss/qld-variables.scss +87 -101
- package/src/components/common/header/Header.js +0 -11
- package/src/components/common/header/header.html +0 -259
- package/src/components/common/header/header.scss +0 -118
- /package/src/components/bs5/{header/_search.json → searchInput/search.json} +0 -0
|
@@ -1,11 +1,32 @@
|
|
|
1
|
-
{{#unless islink}}
|
|
2
|
-
<button class="btn {{variantClass}}" onclick="{{{onclick}}}" {{#if isdisabled}}disabled{{/if}} {{#if arialabel}}aria-label="{{arialabel}}"{{/if}} {{{dataatts}}}>
|
|
3
|
-
{{#if iconClass}}<span class="btn-icon {{iconClass}}"></span>{{/if}}{{label}}
|
|
4
|
-
</button>
|
|
5
1
|
|
|
6
|
-
{{
|
|
2
|
+
{{#unless islink}}
|
|
3
|
+
<button class="btn {{variantClass}}" onclick="{{{onclick}}}" {{#if isdisabled}}disabled{{/if}} {{#if arialabel}}aria-label="{{arialabel}}"{{/if}} {{{dataatts}}}>
|
|
4
|
+
{{#if iconClass}}
|
|
5
|
+
{{#ifCond iconPosition '==' 'leading'}}
|
|
6
|
+
<span class="btn-icon {{iconClass}}"></span>
|
|
7
|
+
{{/ifCond}}
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{label}}
|
|
10
|
+
{{#if iconClass}}
|
|
11
|
+
{{#ifCond iconPosition '==' 'trailing'}}
|
|
12
|
+
<span class="btn-icon {{iconClass}}"></span>
|
|
13
|
+
{{/ifCond}}
|
|
14
|
+
{{/if}}
|
|
15
|
+
</button>
|
|
7
16
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
{{
|
|
17
|
+
{{else}}
|
|
18
|
+
|
|
19
|
+
<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}}}>
|
|
20
|
+
{{#if iconClass}}
|
|
21
|
+
{{#ifCond iconPosition '==' 'leading'}}
|
|
22
|
+
<span class="btn-icon {{iconClass}}"></span>
|
|
23
|
+
{{/ifCond}}
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{label}}
|
|
26
|
+
{{#if iconClass}}
|
|
27
|
+
{{#ifCond iconPosition '==' 'trailing'}}
|
|
28
|
+
<span class="btn-icon {{iconClass}}"></span>
|
|
29
|
+
{{/ifCond}}
|
|
30
|
+
{{/if}}
|
|
31
|
+
</a>
|
|
32
|
+
{{/unless }}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
// QGDS QOL Button
|
|
2
|
+
// extends https://getbootstrap.com/docs/5.3/components/buttons/#variables
|
|
3
|
+
|
|
1
4
|
.btn {
|
|
2
|
-
--#{$prefix}btn-padding-x:
|
|
5
|
+
--#{$prefix}btn-padding-x: 1.5rem;
|
|
3
6
|
--#{$prefix}btn-padding-y: 0.75rem;
|
|
4
7
|
--#{$prefix}btn-font-family: #{$font-family-sans-serif};
|
|
5
8
|
--#{$prefix}btn-border-width: 3px;
|
|
@@ -8,50 +11,60 @@
|
|
|
8
11
|
--#{$prefix}btn-focus-box-shadow: 0 1px 2px 0 rgba(0,0,0, 0.2);
|
|
9
12
|
--#{$prefix}btn-disabled-opacity: 0.5;
|
|
10
13
|
|
|
14
|
+
//Primary button variant
|
|
11
15
|
&-primary {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
--#{$prefix}btn-bg: var(--#{$prefix}sapphire-blue);
|
|
17
|
+
--#{$prefix}btn-hover-bg: var(--#{$prefix}button-dark-blue);
|
|
18
|
+
--#{$prefix}btn-active-bg: var(--#{$prefix}extra-light-grey);
|
|
19
|
+
--#{$prefix}btn-active-color: var(--#{$prefix}light-text-heading);
|
|
20
|
+
--#{$prefix}btn-disabled-bg: var(--#{$prefix}grey);
|
|
21
|
+
--#{$prefix}btn-disabled-color: var(--#{$prefix}dark-grey-muted);
|
|
22
|
+
--#{$prefix}btn-disabled-opacity: 1;
|
|
23
|
+
--#{$prefix}btn-disabled-border-color: transparent;
|
|
20
24
|
}
|
|
25
|
+
|
|
26
|
+
//Secondary button variant
|
|
21
27
|
&-secondary,
|
|
22
28
|
&-outline-secondary {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
--#{$prefix}btn-bg: transparent;
|
|
30
|
+
--#{$prefix}btn-color: var(--#{$prefix}sapphire-blue);
|
|
31
|
+
--#{$prefix}btn-border-color: var(--#{$prefix}dark-green);
|
|
32
|
+
--#{$prefix}btn-hover-color: var(--#{$prefix}sapphire-blue);
|
|
33
|
+
--#{$prefix}btn-hover-bg: transparent;
|
|
34
|
+
--#{$prefix}btn-hover-border-color: var(--#{$prefix}alt-button-hover);
|
|
35
|
+
--#{$prefix}btn-active-color: var(--#{$prefix}light-text-heading);
|
|
36
|
+
--#{$prefix}btn-active-bg: var(--#{$prefix}extra-light-grey);
|
|
37
|
+
--#{$prefix}btn-active-border-color: var(--#{$prefix}extra-light-grey);
|
|
38
|
+
--#{$prefix}btn-active-shadow: none;
|
|
39
|
+
--#{$prefix}btn-disabled-bg: transparent;
|
|
40
|
+
--#{$prefix}btn-disabled-color: var(--#{$prefix}dark-grey-muted);
|
|
41
|
+
--#{$prefix}btn-disabled-opacity: 1;
|
|
42
|
+
--#{$prefix}btn-disabled-border-color: var(--#{$prefix}grey);
|
|
43
|
+
--#{$prefix}gradient: none;
|
|
38
44
|
}
|
|
45
|
+
|
|
46
|
+
//Tertiary button variant
|
|
39
47
|
&-tertiary {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
--#{$prefix}btn-color: #{$primary};
|
|
49
|
+
--#{$prefix}btn-border-color: transparent;
|
|
50
|
+
--#{$prefix}btn-hover-color: #{$primary};
|
|
51
|
+
--#{$prefix}btn-hover-bg: var(--#{$prefix}extra-light-grey);
|
|
52
|
+
--#{$prefix}btn-hover-border-color: transparent;
|
|
53
|
+
--#{$prefix}btn-active-color: var(--#{$prefix}light-text-heading);
|
|
54
|
+
--#{$prefix}btn-active-bg: transparent;
|
|
55
|
+
--#{$prefix}btn-active-shadow: none;
|
|
56
|
+
--#{$prefix}btn-disabled-bg: transparent;
|
|
57
|
+
--#{$prefix}btn-disabled-color: var(--#{$prefix}dark-grey-muted);
|
|
58
|
+
--#{$prefix}btn-disabled-opacity: 1;
|
|
59
|
+
--#{$prefix}btn-disabled-border-color: transparent;
|
|
60
|
+
--#{$prefix}gradient: none;
|
|
53
61
|
}
|
|
54
|
-
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.dark .btn,
|
|
65
|
+
.dark-alt .btn {
|
|
66
|
+
|
|
67
|
+
//Primary button variant (dark mode)
|
|
55
68
|
&-primary {
|
|
56
69
|
--#{$prefix}btn-bg: var(--#{$prefix}dark-green-dark);
|
|
57
70
|
--#{$prefix}btn-border-color: var(--#{$prefix}dark-green-dark);
|
|
@@ -64,7 +77,9 @@
|
|
|
64
77
|
--#{$prefix}btn-disabled-bg: rgba(224, 224, 224, 0.1);
|
|
65
78
|
--#{$prefix}btn-disabled-color: var(--#{$prefix}text-light-blue-dark);
|
|
66
79
|
--#{$prefix}btn-disabled-border-color: transparent;
|
|
67
|
-
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//Secondary button variant (dark mode)
|
|
68
83
|
&-secondary,
|
|
69
84
|
&-outline-secondary {
|
|
70
85
|
--#{$prefix}btn-border-color: var(--#{$prefix}golden-yellow);
|
|
@@ -78,6 +93,8 @@
|
|
|
78
93
|
--#{$prefix}btn-disabled-color: var(--#{$prefix}text-light-blue-dark);
|
|
79
94
|
--#{$prefix}btn-disabled-border-color: rgba(224, 224, 224, 0.1);
|
|
80
95
|
}
|
|
96
|
+
|
|
97
|
+
//Tertiary button variant (dark mode)
|
|
81
98
|
&-tertiary {
|
|
82
99
|
--#{$prefix}btn-color: var(--#{$prefix}white);
|
|
83
100
|
--#{$prefix}btn-bg: transparent;
|
|
@@ -91,16 +108,17 @@
|
|
|
91
108
|
--#{$prefix}btn-disabled-color: var(--#{$prefix}text-light-blue-dark);
|
|
92
109
|
--#{$prefix}btn-disabled-border-color: transparent;
|
|
93
110
|
}
|
|
94
|
-
}
|
|
95
111
|
}
|
|
112
|
+
|
|
96
113
|
a.btn, .btn {
|
|
97
114
|
white-space: nowrap;
|
|
115
|
+
|
|
98
116
|
span[class^=icon-],
|
|
99
117
|
span[class^=fa-] {
|
|
100
|
-
margin
|
|
118
|
+
margin: 0 0.5rem;
|
|
101
119
|
}
|
|
102
120
|
.btn-icon {
|
|
103
|
-
margin
|
|
121
|
+
margin: 0 0.5em;
|
|
104
122
|
}
|
|
105
123
|
&:hover, &:visited, &:focus {
|
|
106
124
|
color: var(--#{$prefix}btn-color);
|
|
@@ -121,6 +139,8 @@ a.btn, .btn {
|
|
|
121
139
|
&.disabled {
|
|
122
140
|
color: var(--#{$prefix}btn-disabled-color);
|
|
123
141
|
}
|
|
142
|
+
|
|
143
|
+
//Primary button variant
|
|
124
144
|
&-primary {
|
|
125
145
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1), 0px 1px 3px rgba(0, 0, 0, 0.2);
|
|
126
146
|
|
|
@@ -140,6 +160,8 @@ a.btn, .btn {
|
|
|
140
160
|
box-shadow: none;
|
|
141
161
|
}
|
|
142
162
|
}
|
|
163
|
+
|
|
164
|
+
//Secondary button variant
|
|
143
165
|
&-secondary,
|
|
144
166
|
&-outline-secondary {
|
|
145
167
|
.btn-icon {
|
|
@@ -169,6 +191,8 @@ a.btn, .btn {
|
|
|
169
191
|
}
|
|
170
192
|
}
|
|
171
193
|
}
|
|
194
|
+
|
|
195
|
+
//Tertiary button variant
|
|
172
196
|
&-tertiary {
|
|
173
197
|
text-decoration: underline;
|
|
174
198
|
text-underline-offset: 0.3em;
|
|
@@ -195,11 +219,14 @@ a.btn, .btn {
|
|
|
195
219
|
}
|
|
196
220
|
}
|
|
197
221
|
}
|
|
222
|
+
|
|
223
|
+
//Dark mode button variants
|
|
198
224
|
.dark &, .dark-alt & {
|
|
199
225
|
&:focus {
|
|
200
226
|
outline: var(--#{$prefix}dark-focus) solid 3px;
|
|
201
227
|
outline-offset: 2px;
|
|
202
|
-
|
|
228
|
+
}
|
|
229
|
+
|
|
203
230
|
&-secondary,
|
|
204
231
|
&-outline-secondary {
|
|
205
232
|
color: var(--#{$prefix}btn-disabled-color);
|
|
@@ -209,10 +236,15 @@ a.btn, .btn {
|
|
|
209
236
|
.btn-icon {
|
|
210
237
|
color: var(--#{$prefix}golden-yellow);
|
|
211
238
|
}
|
|
239
|
+
&:hover {
|
|
240
|
+
.btn-icon {
|
|
241
|
+
color: var(--#{$prefix}dark-action-secondary-hover);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
212
244
|
&:active {
|
|
213
245
|
text-decoration: none;
|
|
214
246
|
.btn-icon {
|
|
215
|
-
color: var(--#{$prefix}
|
|
247
|
+
color: var(--#{$prefix}white);
|
|
216
248
|
}
|
|
217
249
|
}
|
|
218
250
|
&:disabled, &.disabled {
|
|
@@ -224,3 +256,14 @@ a.btn, .btn {
|
|
|
224
256
|
}
|
|
225
257
|
}
|
|
226
258
|
|
|
259
|
+
// Buttons grouping using btn-toolbar.
|
|
260
|
+
.btn-toolbar .btn {
|
|
261
|
+
@include media-breakpoint-down(md) {
|
|
262
|
+
width: 100%;
|
|
263
|
+
margin: 24px 0;
|
|
264
|
+
}
|
|
265
|
+
@include media-breakpoint-up(md) {
|
|
266
|
+
margin: 1.5rem;
|
|
267
|
+
}
|
|
268
|
+
min-width: 160px;
|
|
269
|
+
}
|
|
@@ -2,17 +2,30 @@
|
|
|
2
2
|
import { Button } from './Button.js';
|
|
3
3
|
import defaultdata from './button.data.json';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Define the variants for Button component.
|
|
7
|
+
* Object key: variant's CSS class.
|
|
8
|
+
* Object value: variant's label on Storybook.
|
|
9
|
+
*/
|
|
10
|
+
const buttonVariants = {
|
|
11
|
+
"btn-primary": "Primary",
|
|
12
|
+
"btn-secondary": "Secondary",
|
|
13
|
+
"btn-tertiary": "Tertiary",
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
export default {
|
|
6
17
|
tags: ['autodocs'],
|
|
7
18
|
title: 'Components/Button',
|
|
19
|
+
args: defaultdata,
|
|
8
20
|
render: (args) => {
|
|
9
21
|
return `
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
<div class="btn-toolbar">
|
|
23
|
+
${new Button(args).html}
|
|
24
|
+
${new Button({...args, isdisabled: true}).html}
|
|
25
|
+
</div>
|
|
12
26
|
`//expand arguments, specifically turn isdisabled into true
|
|
13
27
|
},
|
|
14
28
|
|
|
15
|
-
//https://storybook.js.org/docs/api/arg-types
|
|
16
29
|
argTypes: {
|
|
17
30
|
isdisabled: {
|
|
18
31
|
table: {
|
|
@@ -21,20 +34,21 @@ export default {
|
|
|
21
34
|
},
|
|
22
35
|
variantClass: {
|
|
23
36
|
name: "Variants",
|
|
24
|
-
description:
|
|
37
|
+
description: 'Settable variant type for Button component',
|
|
25
38
|
control: {
|
|
26
39
|
type: "radio",
|
|
27
|
-
labels:
|
|
28
|
-
"btn-primary": "Primary",
|
|
29
|
-
"btn-secondary": "Secondary",
|
|
30
|
-
"btn-tertiary": "Tertiary",
|
|
31
|
-
},
|
|
40
|
+
labels: buttonVariants,
|
|
32
41
|
},
|
|
33
|
-
options:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
options: Object.keys(buttonVariants),
|
|
43
|
+
},
|
|
44
|
+
iconPosition: {
|
|
45
|
+
description: 'Position of the icon placement',
|
|
46
|
+
control: "radio",
|
|
47
|
+
options: ["leading", "trailing"],
|
|
48
|
+
},
|
|
49
|
+
target: {
|
|
50
|
+
control: "select",
|
|
51
|
+
options: ["_self", "_blank", "_parent", "_top"],
|
|
38
52
|
},
|
|
39
53
|
},
|
|
40
54
|
|
|
@@ -44,26 +58,18 @@ export default {
|
|
|
44
58
|
type: "figma",
|
|
45
59
|
url: "https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=5990-98058&mode=design&t=YBUAJHIxqF46Um9y-0",
|
|
46
60
|
},
|
|
47
|
-
docs: {
|
|
48
|
-
controls: {
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
61
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
62
|
};
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
64
|
+
/**
|
|
65
|
+
* Default Button story
|
|
66
|
+
*/
|
|
67
|
+
export const Default = {};
|
|
60
68
|
|
|
61
69
|
/**
|
|
62
|
-
* Dark
|
|
70
|
+
* Dark Button story
|
|
63
71
|
* */
|
|
64
72
|
export const Dark = {
|
|
65
|
-
|
|
66
|
-
args: defaultdata,
|
|
67
73
|
parameters: {
|
|
68
74
|
backgrounds: {
|
|
69
75
|
default: 'Dark',
|
|
@@ -82,3 +88,91 @@ export const Dark = {
|
|
|
82
88
|
},
|
|
83
89
|
],
|
|
84
90
|
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Show all button variants in the Default Light mode.
|
|
94
|
+
* This Story can be used to help in troubleshooting.
|
|
95
|
+
*/
|
|
96
|
+
export const AllVariantsInDefaultMode = {
|
|
97
|
+
render:() => {
|
|
98
|
+
const states = [
|
|
99
|
+
{ isdisabled: false, label: 'Enabled' },
|
|
100
|
+
{ isdisabled: true, label: 'Disabled' },
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
/* Return all button variants with label = variant + state */
|
|
104
|
+
return Object.entries(buttonVariants).map(([variantClass, variantLabel]) => {
|
|
105
|
+
const variantButtons = states.map(state =>
|
|
106
|
+
new Button({
|
|
107
|
+
...defaultdata,
|
|
108
|
+
variantClass,
|
|
109
|
+
...state,
|
|
110
|
+
label: state.label,
|
|
111
|
+
}).html,
|
|
112
|
+
).join('');
|
|
113
|
+
|
|
114
|
+
return `<div class="d-grid mb-4">
|
|
115
|
+
<div class="fw-bold">${variantLabel}</div>
|
|
116
|
+
<div class="btn-toolbar">
|
|
117
|
+
${variantButtons}
|
|
118
|
+
</div>
|
|
119
|
+
</div>`;
|
|
120
|
+
|
|
121
|
+
}).join('');
|
|
122
|
+
},
|
|
123
|
+
parameters: {
|
|
124
|
+
controls: {
|
|
125
|
+
disable: true,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Show all button variants in the Dark mode.
|
|
132
|
+
* This Story can be used to help in troubleshooting.
|
|
133
|
+
*/
|
|
134
|
+
export const AllVariantsInDarkMode = {
|
|
135
|
+
render:() => {
|
|
136
|
+
const states = [
|
|
137
|
+
{ isdisabled: false, label: 'Enabled' },
|
|
138
|
+
{ isdisabled: true, label: 'Disabled' },
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
/* Return all button variants with label = variant + state */
|
|
142
|
+
return Object.entries(buttonVariants).map(([variantClass, variantLabel]) => {
|
|
143
|
+
const variantButtons = states.map(state =>
|
|
144
|
+
new Button({
|
|
145
|
+
...defaultdata,
|
|
146
|
+
variantClass,
|
|
147
|
+
...state,
|
|
148
|
+
label: state.label,
|
|
149
|
+
}).html,
|
|
150
|
+
).join('');
|
|
151
|
+
|
|
152
|
+
return `<div class="d-grid mb-4">
|
|
153
|
+
<div class="fw-bold">${variantLabel}</div>
|
|
154
|
+
<div class="btn-toolbar">
|
|
155
|
+
${variantButtons}
|
|
156
|
+
</div>
|
|
157
|
+
</div>`;
|
|
158
|
+
|
|
159
|
+
}).join('');
|
|
160
|
+
},
|
|
161
|
+
parameters: {
|
|
162
|
+
backgrounds: {
|
|
163
|
+
default: 'Dark',
|
|
164
|
+
},
|
|
165
|
+
controls: {
|
|
166
|
+
disable: true,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
decorators: [
|
|
170
|
+
(Story) => {
|
|
171
|
+
return `
|
|
172
|
+
<div class="dark">
|
|
173
|
+
${Story()}
|
|
174
|
+
</div>
|
|
175
|
+
`;
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--#{$prefix}callout-border-width: 0.25rem;
|
|
9
9
|
--#{$prefix}callout-title-color: var(--#{$prefix}headings-color);
|
|
10
10
|
--#{$prefix}callout-text-color: var(--#{$prefix}body-color);
|
|
11
|
-
--#{$prefix}callout-spacer:
|
|
11
|
+
--#{$prefix}callout-spacer: 1rem;
|
|
12
12
|
|
|
13
13
|
.light & {
|
|
14
14
|
--#{$prefix}callout-bg-color: var(--#{$prefix}light-background-shade);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// ------------------------------------------------------------------------------------------------------------------
|
|
3
3
|
// 1. Common vars
|
|
4
4
|
// ------------------------------------------------------------------------------------------------------------------
|
|
5
|
-
|
|
6
5
|
// Shared thickness, offset etc.
|
|
7
6
|
--#{$prefix}header-underline__thickness-thin: 0.5px;
|
|
8
7
|
--#{$prefix}header-underline__thickness-thick: 2px;
|
|
@@ -11,22 +10,6 @@
|
|
|
11
10
|
// ------------------------------------------------------------------------------------------------------------------
|
|
12
11
|
// 2. Second hand variables (each variant, default, light, dark, dark-alt) using QGDS-Tokens (npm)
|
|
13
12
|
// ------------------------------------------------------------------------------------------------------------------
|
|
14
|
-
// Search inputs
|
|
15
|
-
--#{$prefix}header-site-search-bg: var(--#{$prefix}color-default-color-light-background-default-shade);
|
|
16
|
-
--#{$prefix}header-site-search-btn-color: var(--#{$prefix}color-default-color-dark-text-default);
|
|
17
|
-
--#{$prefix}header-site-search-btn-bg: var(--#{$prefix}color-default-color-light-link-default);
|
|
18
|
-
--#{$prefix}header-site-search-border-color: var(--#{$prefix}color-default-color-light-action-primary-hover);
|
|
19
|
-
--#{$prefix}header-site-search-icon-color:var(--#{$prefix}color-default-color-light-text-lighter);
|
|
20
|
-
--#{$prefix}header-site-search-text-color:var(--#{$prefix}color-default-color-light-text-default);
|
|
21
|
-
|
|
22
|
-
// Search input dark
|
|
23
|
-
--#{$prefix}header-dark-site-search-bg: var(--#{$prefix}color-default-color-dark-background-default-shade);
|
|
24
|
-
--#{$prefix}header-dark-site-search-btn-color: var(--#{$prefix}color-default-color-light-text-default);
|
|
25
|
-
--#{$prefix}header-dark-site-search-btn-bg: var(--#{$prefix}color-default-color-light-accent-design-accent);
|
|
26
|
-
--#{$prefix}header-dark-site-search-border-color: var(--#{$prefix}color-default-color-dark-border-default);
|
|
27
|
-
--#{$prefix}header-dark-site-search-icon-color:var(--#{$prefix}color-default-color-dark-text-lighter);
|
|
28
|
-
--#{$prefix}header-dark-site-search-text-color:var(--#{$prefix}color-default-color-dark-text-default);
|
|
29
|
-
|
|
30
13
|
// Header
|
|
31
14
|
--#{$prefix}header_color: var(--#{$prefix}color-default-color-light-text-default);
|
|
32
15
|
--#{$prefix}header_bg: var(--#{$prefix}color-default-color-light-background-default);
|
|
@@ -80,24 +63,6 @@
|
|
|
80
63
|
--#{$prefix}header__site-name__heading__text_color: var(--#{$prefix}color-default-color-light-site-title);
|
|
81
64
|
--#{$prefix}header__site-name__subline__text_color: var(--#{$prefix}color-default-color-light-text-lighter);
|
|
82
65
|
|
|
83
|
-
// Search
|
|
84
|
-
--site-search-bg: var(--#{$prefix}header-site-search-bg);
|
|
85
|
-
--site-search-btn-color: var(--#{$prefix}header-site-search-btn-color);
|
|
86
|
-
--site-search-btn-bg: var(--#{$prefix}header-site-search-btn-bg);
|
|
87
|
-
--site-search-border-color: var(--#{$prefix}header-site-search-border-color);
|
|
88
|
-
--site-search-icon-color: var(--#{$prefix}header-site-search-icon-color);
|
|
89
|
-
--site-search-input-color: var(--#{$prefix}header-site-search-text-color);
|
|
90
|
-
--site-search-input-focus-color: var(--#{$prefix}color-default-color-light-focus-default);
|
|
91
|
-
--site-search-text-color: var(--#{$prefix}header-site-search-text-color);
|
|
92
|
-
|
|
93
|
-
// Suggestions colours
|
|
94
|
-
--#{$prefix}header_site-search-suggestions-bg: var(--#{$prefix}color-default-color-light-background-default-shade);
|
|
95
|
-
--#{$prefix}header_site-search-suggestions-hover: var(--#{$prefix}color-default-color-light-border-default);
|
|
96
|
-
--#{$prefix}header_site-search-suggestions-hover__border_color: var(--#{$prefix}color-default-color-light-accent-design-accent);
|
|
97
|
-
--#{$prefix}header_site-search-suggestions-feature_bg: var(--#{$prefix}color-default-color-dark-background-default);
|
|
98
|
-
--#{$prefix}header_site-search-suggestions-feature_hover: var(--#{$prefix}color-default-color-dark-background-default-shade);
|
|
99
|
-
--#{$prefix}header_site-search-suggestions-feature_text-color: var(--#{$prefix}color-default-color-dark-text-default);
|
|
100
|
-
|
|
101
66
|
// ------------------------------------------------------------------------------------------------------------------
|
|
102
67
|
// 3. Dark/dark-alt modes
|
|
103
68
|
// ------------------------------------------------------------------------------------------------------------------
|
|
@@ -147,23 +112,6 @@
|
|
|
147
112
|
|
|
148
113
|
// COA
|
|
149
114
|
--#{$prefix}header__brand-image__crest_fill: var(--#{$prefix}color-default-color-dark-crest-fill);
|
|
150
|
-
|
|
151
|
-
// Search (dark/dark/alt)
|
|
152
|
-
--site-search-bg: var(--#{$prefix}header-dark-site-search-bg);
|
|
153
|
-
--site-search-btn-color: var(--#{$prefix}header-dark-site-search-btn-color);
|
|
154
|
-
--site-search-btn-bg: var(--#{$prefix}header-dark-site-search-btn-bg);
|
|
155
|
-
--site-search-border-color: var(--#{$prefix}header-dark-site-search-border-color);
|
|
156
|
-
--site-search-icon-color: var(--#{$prefix}header-dark-site-search-icon-color);
|
|
157
|
-
--site-search-input-color: var(--#{$prefix}header-dark-site-search-text-color);
|
|
158
|
-
--site-search-text-color: var(--#{$prefix}header-site-search-text-color);
|
|
159
|
-
|
|
160
|
-
// Suggestions colours
|
|
161
|
-
--#{$prefix}header_site-search-suggestions-bg: var(--#{$prefix}color-default-color-dark-background-default-shade);
|
|
162
|
-
--#{$prefix}header_site-search-suggestions-hover: var(--#{$prefix}color-default-color-dark-background-default);
|
|
163
|
-
--#{$prefix}header_site-search-suggestions-hover__border_color: var(--#{$prefix}color-default-color-dark-accent-design-accent);
|
|
164
|
-
--#{$prefix}header_site-search-suggestions-feature_bg: var(--#{$prefix}color-default-color-dark-background-alt);
|
|
165
|
-
--#{$prefix}header_site-search-suggestions-feature_hover: var(--#{$prefix}color-default-color-dark-background-alt-shade);
|
|
166
|
-
--#{$prefix}header_site-search-suggestions-feature_text-color: var(--#{$prefix}color-default-color-dark-text-default);
|
|
167
115
|
}
|
|
168
116
|
|
|
169
117
|
.dark-alt & {
|