@qld-gov-au/qgds-bootstrap5 2.0.11 → 2.0.12
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/preview.js +5 -2
- package/dist/assets/components/bs5/dateinput/dateinput.hbs +27 -27
- package/dist/assets/components/bs5/formcheck/formcheck.hbs +10 -2
- package/dist/assets/components/bs5/head/head.hbs +1 -1
- package/dist/assets/components/bs5/searchInput/searchInput.hbs +31 -29
- package/dist/assets/components/bs5/select/select.hbs +19 -19
- package/dist/assets/components/bs5/textarea/textarea.hbs +17 -17
- package/dist/assets/components/bs5/textbox/textbox.hbs +17 -18
- package/dist/assets/css/qld.bootstrap.css +2 -2
- package/dist/assets/css/qld.bootstrap.css.map +3 -3
- package/dist/assets/css/qld.bootstrap.legacy.css +2 -2
- package/dist/assets/css/qld.bootstrap.legacy.css.map +3 -3
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.init.min.js +134 -125
- package/dist/assets/js/handlebars.init.min.js.map +2 -2
- package/dist/assets/js/handlebars.partials.js +134 -125
- package/dist/assets/js/handlebars.partials.js.map +2 -2
- package/dist/assets/js/qld.bootstrap.min.js +9 -10
- package/dist/assets/js/qld.bootstrap.min.js.map +3 -3
- package/dist/assets/node/handlebars.init.min.js +51 -7
- package/dist/assets/node/handlebars.init.min.js.map +2 -2
- package/dist/components/bs5/dateinput/dateinput.hbs +27 -27
- package/dist/components/bs5/formcheck/formcheck.hbs +10 -2
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/searchInput/searchInput.hbs +31 -29
- package/dist/components/bs5/select/select.hbs +19 -19
- package/dist/components/bs5/textarea/textarea.hbs +17 -17
- package/dist/components/bs5/textbox/textbox.hbs +17 -18
- package/dist/package.json +1 -1
- package/dist/sample-data/dateinput/dateinput.data.json +14 -12
- package/dist/sample-data/formcheck/stories/checkbox/checkbox.data.json +4 -5
- package/dist/sample-data/formcheck/stories/radio/radio.data.json +4 -4
- package/dist/sample-data/searchInput/searchInput.data.json +19 -10
- package/dist/sample-data/select/select.data.json +12 -10
- package/dist/sample-data/textarea/textarea.data.json +14 -11
- package/dist/sample-data/textbox/textbox.data.json +13 -10
- package/package.json +1 -1
- package/src/components/bs5/dateinput/Dateinput.js +26 -11
- package/src/components/bs5/dateinput/dateinput.data.json +14 -12
- package/src/components/bs5/dateinput/dateinput.hbs +27 -27
- package/src/components/bs5/formcheck/Formcheck.js +57 -6
- package/src/components/bs5/formcheck/_form-variables.scss +131 -0
- package/src/components/bs5/formcheck/formcheck.hbs +10 -2
- package/src/components/bs5/formcheck/formcheck.scss +229 -66
- package/src/components/bs5/formcheck/stories/bootstrap-validation/bootstrap-validation.stories.js +304 -0
- package/src/components/bs5/formcheck/stories/checkbox/checkbox.data.json +4 -5
- package/src/components/bs5/formcheck/stories/checkbox/checkbox.stories.js +19 -111
- package/src/components/bs5/formcheck/stories/radio/radio.data.json +4 -4
- package/src/components/bs5/formcheck/stories/radio/radio.stories.js +30 -122
- package/src/components/bs5/inpageAlert/inpageAlert.scss +1 -1
- package/src/components/bs5/pageLayout/{ThemeShowcase.stories.js → PaletteShowcase.stories.js} +36 -35
- package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +24 -28
- package/src/components/bs5/searchInput/search.functions.js +93 -76
- package/src/components/bs5/searchInput/searchInput.data.json +19 -10
- package/src/components/bs5/searchInput/searchInput.hbs +31 -29
- package/src/components/bs5/searchInput/searchInput.scss +140 -196
- package/src/components/bs5/searchInput/searchInput.stories.js +35 -13
- package/src/components/bs5/searchInput/searchInput.test.js +5 -1
- package/src/components/bs5/select/Select.js +13 -5
- package/src/components/bs5/select/Select.stories.js +27 -83
- package/src/components/bs5/select/select.data.json +12 -10
- package/src/components/bs5/select/select.hbs +19 -19
- package/src/components/bs5/textarea/Textarea.js +13 -5
- package/src/components/bs5/textarea/Textarea.stories.js +29 -55
- package/src/components/bs5/textarea/textarea.data.json +14 -11
- package/src/components/bs5/textarea/textarea.hbs +17 -17
- package/src/components/bs5/textbox/Textbox.js +16 -5
- package/src/components/bs5/textbox/Textbox.stories.js +26 -51
- package/src/components/bs5/textbox/textInput.scss +12 -232
- package/src/components/bs5/textbox/textbox.data.json +13 -10
- package/src/components/bs5/textbox/textbox.hbs +17 -18
- package/src/css/functions/_index.scss +2 -0
- package/src/css/functions/remify.scss +32 -0
- package/src/css/functions/snap-line-height.scss +7 -0
- package/src/css/main.scss +1 -1
- package/src/css/mixins/focusable.scss +3 -0
- package/src/css/{qld-theme.scss → qld-palettes.scss} +30 -23
- package/src/components/bs5/formcheck/_formcheck.stories.bak.js +0 -432
|
@@ -1,89 +1,63 @@
|
|
|
1
1
|
@use "../../../css/mixins";
|
|
2
|
+
@use "../../../css/variables/animation";
|
|
2
3
|
|
|
3
4
|
.qld-search-input {
|
|
4
5
|
// Input variables
|
|
5
6
|
--background-color: var(--#{$prefix}white);
|
|
6
7
|
--border-color: var(--#{$prefix}light-border-alt);
|
|
8
|
+
--border-color-focus: var(--#{$prefix}light-border-alt);
|
|
9
|
+
--border-color-hover: var(--#{$prefix}light-action-primary-hover);
|
|
7
10
|
--placeholder-color: var(--#{$prefix}light-text-lighter);
|
|
8
11
|
--qld-icon-color: var(--#{$prefix}light-text-lighter);
|
|
9
12
|
--text-color: var(--#{$prefix}light-text-text);
|
|
10
13
|
--text-heading: var(--#{$prefix}color-default-color-light-text-heading);
|
|
14
|
+
--suggestions-shadow:
|
|
15
|
+
0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 3px 1px rgba(0, 0, 0, 0.1);
|
|
11
16
|
|
|
12
17
|
.dark &,
|
|
13
18
|
.dark-alt & {
|
|
14
|
-
--
|
|
15
|
-
--
|
|
19
|
+
--border-color: var(--#{$prefix}dark-border-alt);
|
|
20
|
+
--border-color-focus: var(--#{$prefix}dark-border-alt);
|
|
21
|
+
--border-color-hover: var(--#{$prefix}dark-action-primary-hover);
|
|
16
22
|
}
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
--border-radius: 0.25rem;
|
|
25
|
+
--_size: 3rem;
|
|
26
|
+
|
|
27
|
+
display: flex;
|
|
28
|
+
position: relative;
|
|
29
|
+
border-radius: var(--border-radius);
|
|
30
|
+
|
|
24
31
|
&:focus-within {
|
|
25
32
|
.suggestions.d-none {
|
|
26
33
|
display: block !important; // !important to override bootstrap d-none
|
|
27
34
|
}
|
|
28
35
|
}
|
|
29
36
|
|
|
30
|
-
// Suggestions variables
|
|
31
|
-
--suggestions-shadow:
|
|
32
|
-
0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 3px 1px rgba(0, 0, 0, 0.1);
|
|
33
|
-
--suggestions-bg: var(
|
|
34
|
-
--#{$prefix}color-default-color-light-background-default-shade
|
|
35
|
-
);
|
|
36
|
-
--suggestions-hover: var(
|
|
37
|
-
--#{$prefix}color-default-color-light-border-default
|
|
38
|
-
);
|
|
39
|
-
--suggestions-hover-border-color: var(
|
|
40
|
-
--#{$prefix}color-default-color-light-accent-design-accent
|
|
41
|
-
);
|
|
42
|
-
--suggestions-feature-bg: var(
|
|
43
|
-
--#{$prefix}color-default-color-dark-background-default
|
|
44
|
-
);
|
|
45
|
-
--suggestions-feature-hover: var(
|
|
46
|
-
--#{$prefix}color-default-color-dark-background-default-shade
|
|
47
|
-
);
|
|
48
|
-
--suggestions-feature-text-color: var(
|
|
49
|
-
--#{$prefix}color-default-color-dark-text-default
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
// local variables
|
|
53
|
-
$border-radius: 0.25rem;
|
|
54
|
-
--_size: 3rem;
|
|
55
|
-
|
|
56
|
-
display: flex;
|
|
57
|
-
position: relative;
|
|
58
|
-
border-radius: $border-radius;
|
|
59
|
-
|
|
60
37
|
@include mixins.focusable($customSelector: ":has(.form-control:focus)");
|
|
61
38
|
|
|
62
39
|
&:has(.form-control:focus) {
|
|
63
|
-
>
|
|
64
|
-
border-bottom-right-radius:
|
|
40
|
+
>button {
|
|
41
|
+
border-bottom-right-radius: var(--border-radius);
|
|
65
42
|
}
|
|
66
43
|
}
|
|
67
44
|
|
|
68
45
|
.form-control {
|
|
69
46
|
min-height: var(--_size);
|
|
70
47
|
padding: 0 4rem 0 1rem;
|
|
71
|
-
border:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
bottom-width: 0.125rem;
|
|
77
|
-
left-width: 0.125rem;
|
|
78
|
-
radius: $border-radius 0 0 $border-radius;
|
|
79
|
-
}
|
|
48
|
+
border: var(--border-color) solid 0.125rem;
|
|
49
|
+
border-inline-end-width: 0;
|
|
50
|
+
border-radius: 0;
|
|
51
|
+
border-start-start-radius: var(--border-radius);
|
|
52
|
+
border-end-start-radius: var(--border-radius);
|
|
80
53
|
background: var(--background-color);
|
|
81
|
-
padding-
|
|
54
|
+
padding-inline-end: 7.5rem;
|
|
82
55
|
color: var(--text-color);
|
|
56
|
+
|
|
83
57
|
transition: {
|
|
84
58
|
property: border-color, background-color, color;
|
|
85
|
-
timing-function:
|
|
86
|
-
duration:
|
|
59
|
+
timing-function: animation.$timing-function;
|
|
60
|
+
duration: animation.$duration-fast;
|
|
87
61
|
}
|
|
88
62
|
|
|
89
63
|
&::placeholder {
|
|
@@ -92,19 +66,19 @@
|
|
|
92
66
|
|
|
93
67
|
&:hover {
|
|
94
68
|
--background-color: var(--#{$prefix}neutral-lightest);
|
|
95
|
-
--border-color: var(
|
|
69
|
+
--border-color: var(--border-color-hover);
|
|
96
70
|
}
|
|
97
71
|
|
|
98
72
|
&:active,
|
|
99
73
|
&:focus {
|
|
100
|
-
--border-color: var(
|
|
74
|
+
--border-color: var(--border-color-focus);
|
|
101
75
|
--background-color: var(--#{$prefix}white);
|
|
102
76
|
outline: none;
|
|
103
77
|
}
|
|
104
78
|
}
|
|
105
79
|
|
|
106
|
-
>
|
|
107
|
-
border-radius: 0
|
|
80
|
+
>button {
|
|
81
|
+
border-radius: 0 var(--border-radius) var(--border-radius) 0;
|
|
108
82
|
padding: 0;
|
|
109
83
|
margin: 0;
|
|
110
84
|
width: var(--_size);
|
|
@@ -132,8 +106,9 @@
|
|
|
132
106
|
@include media-breakpoint-up(md) {
|
|
133
107
|
--_size: 3.25rem;
|
|
134
108
|
|
|
135
|
-
>
|
|
136
|
-
padding: calc(0.75rem - 0.125rem)
|
|
109
|
+
>button {
|
|
110
|
+
padding-block: calc(0.75rem - 0.125rem);
|
|
111
|
+
padding-inline: var(--qld-btn-padding-x);
|
|
137
112
|
margin: 0;
|
|
138
113
|
width: auto;
|
|
139
114
|
|
|
@@ -143,65 +118,113 @@
|
|
|
143
118
|
|
|
144
119
|
.btn-icon {
|
|
145
120
|
display: none;
|
|
146
|
-
margin-
|
|
121
|
+
margin-inline-start: 0;
|
|
147
122
|
}
|
|
148
123
|
}
|
|
149
124
|
|
|
150
125
|
.form-control {
|
|
151
|
-
padding: 0.75rem
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
@include mixins.make-icon($name: "search", $size: "xs", $pseudo: "before") {
|
|
155
|
-
position: absolute;
|
|
156
|
-
top: 50%;
|
|
157
|
-
transform: translateY(-50%);
|
|
158
|
-
left: calc(1rem - 0.125rem);
|
|
159
|
-
pointer-events: none;
|
|
126
|
+
padding-block: 0.75rem;
|
|
127
|
+
padding-inline: 1rem;
|
|
160
128
|
}
|
|
161
129
|
}
|
|
162
130
|
|
|
163
131
|
//Search dropdown
|
|
164
132
|
.suggestions {
|
|
165
133
|
position: absolute;
|
|
166
|
-
|
|
167
|
-
top: 100%;
|
|
134
|
+
inset-inline-start: 0;
|
|
168
135
|
width: 100%;
|
|
136
|
+
inset-block-start: 7px !important; // to override bootstrap's popperjs default top value
|
|
169
137
|
z-index: 1;
|
|
170
138
|
border-radius: 0.5rem;
|
|
171
|
-
background: var(
|
|
139
|
+
background: var(--#{$prefix}color-default-color-light-background-default-shade);
|
|
172
140
|
box-shadow: var(--suggestions-shadow);
|
|
173
|
-
|
|
141
|
+
|
|
142
|
+
&>div {
|
|
143
|
+
border-radius: 0.5rem;
|
|
144
|
+
border-bottom: 0.25rem solid var(--#{$prefix}color-default-color-light-accent-design-accent);
|
|
145
|
+
}
|
|
174
146
|
|
|
175
147
|
.suggestions-category {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
$color-default-color-light-text-default,
|
|
181
|
-
0.5
|
|
182
|
-
);
|
|
183
|
-
&:hover {
|
|
184
|
-
background-color: var(--suggestions-hover);
|
|
185
|
-
text-decoration-color: rgba(
|
|
186
|
-
$color-default-color-light-text-default,
|
|
187
|
-
1
|
|
188
|
-
);
|
|
189
|
-
text-decoration-thickness: var(
|
|
190
|
-
--#{$prefix}link-underline-thickness-hover
|
|
191
|
-
);
|
|
192
|
-
}
|
|
148
|
+
padding-block: 0.75rem;
|
|
149
|
+
|
|
150
|
+
&:not(:first-of-type) {
|
|
151
|
+
border-block-start: 1px solid var(--#{$prefix}light-alt-background-shade);
|
|
193
152
|
}
|
|
194
153
|
|
|
154
|
+
// Question
|
|
195
155
|
&-label {
|
|
196
|
-
padding: 0
|
|
156
|
+
padding-block: 0.75rem;
|
|
157
|
+
padding-inline: 1rem;
|
|
197
158
|
}
|
|
198
159
|
|
|
199
160
|
ul {
|
|
200
161
|
li {
|
|
201
162
|
a {
|
|
202
|
-
|
|
203
|
-
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
padding-block: 0.75rem;
|
|
166
|
+
padding-inline: 1rem;
|
|
167
|
+
color: var(--#{$prefix}light-text-text);
|
|
204
168
|
width: 100%;
|
|
169
|
+
text-decoration: underline;
|
|
170
|
+
text-decoration-color: transparent;
|
|
171
|
+
text-decoration-thickness: 0.5px;
|
|
172
|
+
transition:
|
|
173
|
+
text-decoration-color animation.$duration-fast animation.$timing-function,
|
|
174
|
+
text-decoration-thickness animation.$duration-fast animation.$timing-function;
|
|
175
|
+
|
|
176
|
+
&:hover {
|
|
177
|
+
text-decoration-color: inherit;
|
|
178
|
+
text-decoration-thickness: var(--#{$prefix}link-underline-thickness-hover);
|
|
179
|
+
transition:
|
|
180
|
+
text-decoration-color animation.$duration-fast animation.$timing-function,
|
|
181
|
+
text-decoration-thickness animation.$duration-fast animation.$timing-function;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&:not(.view-more) {
|
|
185
|
+
&::before {
|
|
186
|
+
content: "";
|
|
187
|
+
height: 1.25rem;
|
|
188
|
+
width: 1.25rem;
|
|
189
|
+
min-width: 1.25rem;
|
|
190
|
+
margin-inline-end: 0.5rem;
|
|
191
|
+
mask-image: var(--qgds-icon-arrow-right);
|
|
192
|
+
mask-position: center center;
|
|
193
|
+
mask-repeat: no-repeat;
|
|
194
|
+
mask-size: contain;
|
|
195
|
+
background-color: var(--#{$prefix}light-action-secondary);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&:hover {
|
|
199
|
+
&::before {
|
|
200
|
+
background-color: var(--#{$prefix}light-action-secondary-hover);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&.view-more {
|
|
206
|
+
text-decoration-color: inherit;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&:has(.dynamic-suggestions:not(.d-none)) {
|
|
214
|
+
background-color: var(--#{$prefix}default-background);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.dynamic-suggestions {
|
|
218
|
+
.suggestions-category:not(.feature) {
|
|
219
|
+
ul {
|
|
220
|
+
li {
|
|
221
|
+
a {
|
|
222
|
+
&:not(.view-more) {
|
|
223
|
+
&::before {
|
|
224
|
+
mask-image: var(--qgds-icon-search);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
205
228
|
}
|
|
206
229
|
}
|
|
207
230
|
}
|
|
@@ -213,23 +236,7 @@
|
|
|
213
236
|
|
|
214
237
|
// Featured search result styles
|
|
215
238
|
.feature {
|
|
216
|
-
background-color: var(
|
|
217
|
-
|
|
218
|
-
strong {
|
|
219
|
-
color: var(--suggestions-feature-text-color);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
ul {
|
|
223
|
-
li {
|
|
224
|
-
&:hover {
|
|
225
|
-
background-color: var(--suggestions-feature-hover);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
a {
|
|
229
|
-
color: var(--suggestions-feature-text-color);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
239
|
+
background-color: var(--#{$prefix}color-default-color-light-background-default-shade);
|
|
233
240
|
}
|
|
234
241
|
|
|
235
242
|
// Show when active
|
|
@@ -254,33 +261,37 @@
|
|
|
254
261
|
ul {
|
|
255
262
|
padding: 0;
|
|
256
263
|
margin: 0;
|
|
264
|
+
|
|
257
265
|
li {
|
|
258
266
|
min-height: 3rem;
|
|
259
267
|
list-style: none;
|
|
260
268
|
cursor: pointer;
|
|
261
|
-
margin-
|
|
269
|
+
margin-block-start: 0;
|
|
262
270
|
|
|
263
271
|
a {
|
|
264
272
|
vertical-align: middle;
|
|
265
273
|
vertical-align: -webkit-baseline-middle;
|
|
266
274
|
|
|
267
|
-
&:
|
|
268
|
-
text-decoration:
|
|
275
|
+
&:focus {
|
|
276
|
+
text-decoration-color: inherit;
|
|
277
|
+
text-decoration-thickness: var(--#{$prefix}link-underline-thickness-hover);
|
|
278
|
+
outline-color: var(--#{$prefix}light-focus);
|
|
279
|
+
outline-offset: -4px;
|
|
280
|
+
background-color: var(--#{$prefix}color-default-color-light-border-default);
|
|
269
281
|
}
|
|
270
282
|
}
|
|
271
283
|
|
|
272
284
|
&:hover {
|
|
273
|
-
background-color: var(
|
|
274
|
-
|
|
275
|
-
a {
|
|
276
|
-
text-decoration: underline;
|
|
277
|
-
text-decoration-thickness: var(
|
|
278
|
-
--#{$prefix}link-underline-thickness-hover
|
|
279
|
-
);
|
|
280
|
-
}
|
|
285
|
+
background-color: var(--#{$prefix}color-default-color-light-border-default);
|
|
281
286
|
}
|
|
282
287
|
}
|
|
283
288
|
}
|
|
289
|
+
|
|
290
|
+
.dynamic-suggestions .suggestions-category:not(.feature) {
|
|
291
|
+
strong {
|
|
292
|
+
color: var(--#{$prefix}light-text-text);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
284
295
|
}
|
|
285
296
|
}
|
|
286
297
|
|
|
@@ -292,88 +303,21 @@
|
|
|
292
303
|
--background-color: var(--#{$prefix}neutral-lightest);
|
|
293
304
|
|
|
294
305
|
.form-control {
|
|
295
|
-
border:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
left-width: 0;
|
|
300
|
-
radius: $border-radius 0 0 0;
|
|
301
|
-
}
|
|
306
|
+
border-width: 0;
|
|
307
|
+
border-block-end-width: 0.125rem;
|
|
308
|
+
border-radius: 0;
|
|
309
|
+
border-start-start-radius: var(--border-radius);
|
|
302
310
|
|
|
303
311
|
&:active,
|
|
304
312
|
&:focus {
|
|
305
313
|
--border-color: var(--#{$prefix}neutral-lighter);
|
|
306
|
-
border-bottom-left-radius:
|
|
314
|
+
border-bottom-left-radius: var(--border-radius);
|
|
307
315
|
}
|
|
308
316
|
}
|
|
309
317
|
|
|
310
|
-
>
|
|
311
|
-
border-radius: 0
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.dark &,
|
|
316
|
-
.dark-alt & {
|
|
317
|
-
--background-color: var(--#{$prefix}dark-background-background);
|
|
318
|
-
--border-color: var(--#{$prefix}dark-alt-border);
|
|
319
|
-
--placeholder-color: var(--${prefix}dark-text-lighter);
|
|
320
|
-
--qld-icon-color: var(--#{$prefix}white);
|
|
321
|
-
--text-color: var(--#{$prefix}dark-text-text);
|
|
322
|
-
|
|
323
|
-
// Suggestions variables
|
|
324
|
-
--suggestions-bg: var(
|
|
325
|
-
--#{$prefix}color-default-color-dark-background-default-shade
|
|
326
|
-
);
|
|
327
|
-
--suggestions-hover: var(
|
|
328
|
-
--#{$prefix}color-default-color-dark-background-default
|
|
329
|
-
);
|
|
330
|
-
--suggestions-hover-border-color: var(
|
|
331
|
-
--#{$prefix}color-default-color-dark-accent-design-accent
|
|
332
|
-
);
|
|
333
|
-
--suggestions-feature-bg: var(
|
|
334
|
-
--#{$prefix}color-default-color-dark-background-alt
|
|
335
|
-
);
|
|
336
|
-
--suggestions-feature-hover: var(
|
|
337
|
-
--#{$prefix}color-default-color-dark-background-alt-shade
|
|
338
|
-
);
|
|
339
|
-
--suggestions-feature-text-color: var(
|
|
340
|
-
--#{$prefix}color-default-color-dark-text-default
|
|
341
|
-
);
|
|
342
|
-
|
|
343
|
-
&:has(.form-control:focus) {
|
|
344
|
-
--qld-icon-color: var(--#{$prefix}light-text-lighter);
|
|
345
|
-
--text-color: var(--#{$prefix}light-text-text);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.form-control {
|
|
349
|
-
&:hover {
|
|
350
|
-
--background-color: var(--#{$prefix}dark-background-shade);
|
|
351
|
-
--border-color: var(--#{$prefix}dark-action-primary-hover);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
&:active,
|
|
355
|
-
&:focus {
|
|
356
|
-
--text-color: var(--#{$prefix}light-text-text);
|
|
357
|
-
--border-color: var(--#{$prefix}neutral-lighter);
|
|
358
|
-
--background-color: var(--#{$prefix}white);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
&.is-filled {
|
|
363
|
-
--background-color: var(--#{$prefix}dark-background-shade);
|
|
364
|
-
|
|
365
|
-
.form-control {
|
|
366
|
-
&:hover {
|
|
367
|
-
--background-color: var(--#{$prefix}dark-background-shade);
|
|
368
|
-
--border-color: var(--#{$prefix}dark-action-primary-hover);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
&:active,
|
|
372
|
-
&:focus {
|
|
373
|
-
--background-color: var(--#{$prefix}white);
|
|
374
|
-
--border-color: var(--#{$prefix}neutral-lighter);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
318
|
+
>button {
|
|
319
|
+
border-radius: 0;
|
|
320
|
+
border-start-end-radius: var(--border-radius);
|
|
377
321
|
}
|
|
378
322
|
}
|
|
379
|
-
}
|
|
323
|
+
}
|
|
@@ -2,34 +2,56 @@
|
|
|
2
2
|
import { SearchInput } from "./SearchInput.js";
|
|
3
3
|
import defaultdata from "./searchInput.data.json";
|
|
4
4
|
|
|
5
|
+
// Save the initial defaultSuggestions data with fallback
|
|
6
|
+
const initData = defaultdata.defaultSuggestions || null;
|
|
7
|
+
|
|
5
8
|
export default {
|
|
6
9
|
tags: ["autodocs"],
|
|
7
10
|
title: "3. Components/Search Input",
|
|
8
11
|
render: (args) => {
|
|
9
12
|
return `<form action="https://uat.forgov.qld.gov.au/search" class="site-search p-3">${new SearchInput(args).html}</form>`;
|
|
10
13
|
},
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
argTypes: {
|
|
15
|
+
buttonLabel: {
|
|
16
|
+
description: "The label for the search button",
|
|
17
|
+
control: { type: "text" },
|
|
18
|
+
},
|
|
19
|
+
hasDefaultSuggestions: {
|
|
20
|
+
description:
|
|
21
|
+
"This manipulates defaultSuggestions to on focus, shows default suggestions below the search input",
|
|
22
|
+
control: { type: "boolean" },
|
|
23
|
+
},
|
|
24
|
+
hasDynamicSuggestions: {
|
|
25
|
+
description: "This produces dynamic suggestions as the user types",
|
|
26
|
+
control: { type: "boolean" },
|
|
27
|
+
},
|
|
28
|
+
"dynamicSuggestionsServiceLink.href": {
|
|
29
|
+
description: "URL for the dynamic suggestions Related Services link",
|
|
30
|
+
control: { type: "text" },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
13
33
|
parameters: {
|
|
14
34
|
docs: {
|
|
15
35
|
controls: {
|
|
16
|
-
include: [
|
|
36
|
+
include: [
|
|
37
|
+
"buttonLabel",
|
|
38
|
+
"hasDynamicSuggestions",
|
|
39
|
+
"hasDefaultSuggestions",
|
|
40
|
+
"dynamicSuggestionsServiceLink.href",
|
|
41
|
+
],
|
|
17
42
|
},
|
|
18
|
-
story: { height: "
|
|
19
|
-
},
|
|
20
|
-
backgrounds: {
|
|
21
|
-
disable: false,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
globals: {
|
|
25
|
-
backgrounds: {
|
|
26
|
-
value: "default",
|
|
43
|
+
story: { height: "800px" },
|
|
27
44
|
},
|
|
28
45
|
},
|
|
46
|
+
// globals: {
|
|
47
|
+
// backgrounds: {
|
|
48
|
+
// value: "default",
|
|
49
|
+
// },
|
|
50
|
+
// },
|
|
29
51
|
};
|
|
30
52
|
|
|
31
53
|
export const Default = {
|
|
32
|
-
args: defaultdata,
|
|
54
|
+
args: { ...defaultdata, showDefaultSuggestions: true },
|
|
33
55
|
name: "Default - Outline Variant",
|
|
34
56
|
};
|
|
35
57
|
|
|
@@ -7,6 +7,10 @@ import { dirname } from "path";
|
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
import { waitFor, isElementVisible } from "../../../js/testingutils.js";
|
|
9
9
|
|
|
10
|
+
import init from "../src/js/handlebars.init.js";
|
|
11
|
+
import Handlebars from "handlebars";
|
|
12
|
+
init(Handlebars);
|
|
13
|
+
|
|
10
14
|
/**
|
|
11
15
|
*
|
|
12
16
|
* Test suite for the SearchInput component.
|
|
@@ -67,7 +71,7 @@ describe("SearchInput", () => {
|
|
|
67
71
|
await waitFor(100);
|
|
68
72
|
|
|
69
73
|
// Additional wait to ensure all scripts are fully initialized
|
|
70
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
74
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
71
75
|
|
|
72
76
|
form = d.querySelector(".site-search");
|
|
73
77
|
searchInput = form?.querySelector(".qld-search-input input");
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import Component from
|
|
1
|
+
import Component from "../../../js/QGDSComponent.js";
|
|
2
2
|
import template from "./select.hbs?raw";
|
|
3
3
|
|
|
4
4
|
export class Select {
|
|
5
|
-
|
|
6
5
|
// Use the global Component class to create a new instance of the Select component.
|
|
7
|
-
// A data object, containing the Handlebars placeholder replacement strings, should be provided as an argument.
|
|
6
|
+
// A data object, containing the Handlebars placeholder replacement strings, should be provided as an argument.
|
|
8
7
|
|
|
9
|
-
constructor(
|
|
8
|
+
constructor(data = {}) {
|
|
10
9
|
return new Component(template, data);
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
}
|
|
12
|
+
|
|
13
|
+
export const argTypes = {
|
|
14
|
+
isValid: {
|
|
15
|
+
description:
|
|
16
|
+
"For server-side validation, set to true or false. Omit or set to null to to indicate the input is yet to be validated.",
|
|
17
|
+
control: "radio",
|
|
18
|
+
options: [true, false, null],
|
|
19
|
+
type: "boolean | null",
|
|
20
|
+
},
|
|
21
|
+
};
|