@qld-gov-au/qgds-bootstrap5 2.0.11 → 2.1.0
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/.esbuild/plugins/qgds-plugin-generate-icon-assets.js +31 -24
- package/.storybook/preview.js +5 -2
- package/dist/assets/components/bs5/button/button.hbs +1 -1
- package/dist/assets/components/bs5/dateinput/dateinput.hbs +27 -27
- package/dist/assets/components/bs5/footer/customLinks.hbs +1 -1
- package/dist/assets/components/bs5/footer/followLinks.hbs +1 -1
- 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/inpageAlert/inpageAlert.hbs +10 -2
- package/dist/assets/components/bs5/searchInput/searchInput.hbs +35 -31
- 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/img/icons-sprite.svg +24 -24
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.init.min.js +159 -140
- package/dist/assets/js/handlebars.init.min.js.map +2 -2
- package/dist/assets/js/handlebars.partials.js +159 -140
- 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 +4 -4
- package/dist/assets/node/handlebars.init.min.js +57 -11
- package/dist/assets/node/handlebars.init.min.js.map +2 -2
- package/dist/components/bs5/button/button.hbs +1 -1
- package/dist/components/bs5/dateinput/dateinput.hbs +27 -27
- package/dist/components/bs5/footer/customLinks.hbs +1 -1
- package/dist/components/bs5/footer/followLinks.hbs +1 -1
- package/dist/components/bs5/formcheck/formcheck.hbs +10 -2
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
- package/dist/components/bs5/searchInput/searchInput.hbs +35 -31
- 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/footer/footer.data.json +3 -0
- 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/inpageAlert/inpageAlert.data.json +1 -1
- package/dist/sample-data/searchInput/searchInput.data.json +20 -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/breadcrumbs/breadcrumbs.scss +3 -4
- package/src/components/bs5/button/Button.js +32 -6
- package/src/components/bs5/button/button.hbs +1 -1
- package/src/components/bs5/button/button.scss +0 -5
- package/src/components/bs5/card/card.scss +2 -0
- 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/footer/customLinks.hbs +1 -1
- package/src/components/bs5/footer/followLinks.hbs +1 -1
- package/src/components/bs5/footer/footer.data.json +3 -0
- package/src/components/bs5/formcheck/Formcheck.js +57 -6
- package/src/components/bs5/formcheck/_form-variables.scss +167 -0
- package/src/components/bs5/formcheck/formcheck.hbs +10 -2
- package/src/components/bs5/formcheck/formcheck.scss +268 -65
- 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/header/header.scss +1 -2
- package/src/components/bs5/icons/_icons.list.js +7 -7
- package/src/components/bs5/icons/_icons.list.scss +113 -112
- package/src/components/bs5/icons/_icons.variables.scss +7 -6
- package/src/components/bs5/icons/icons.scss +2 -1
- package/src/components/bs5/inpageAlert/inpageAlert.data.json +1 -1
- package/src/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
- package/src/components/bs5/inpageAlert/inpageAlert.scss +50 -52
- package/src/components/bs5/inpageAlert/inpageAlert.stories.js +54 -3
- package/src/components/bs5/pageLayout/{ThemeShowcase.stories.js → PaletteShowcase.stories.js} +40 -38
- package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +25 -29
- package/src/components/bs5/searchInput/search.functions.js +120 -108
- package/src/components/bs5/searchInput/searchInput.data.json +20 -10
- package/src/components/bs5/searchInput/searchInput.hbs +35 -31
- package/src/components/bs5/searchInput/searchInput.scss +193 -196
- package/src/components/bs5/searchInput/searchInput.stories.js +35 -13
- package/src/components/bs5/searchInput/searchInput.test.js +96 -120
- 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/skiplinks/skipLinks.scss +12 -4
- 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/components/common/focus-styles/focusStyles.mdx +20 -0
- package/src/components/common/focus-styles/focusStyles.stories.js +58 -0
- package/src/css/functions/_index.scss +5 -0
- package/src/css/functions/color-icon.scss +31 -0
- package/src/css/functions/remify.scss +32 -0
- package/src/css/functions/snap-line-height.scss +7 -0
- package/src/css/functions/string-replace.scss +49 -0
- package/src/css/functions/svg-encode.scss +22 -0
- package/src/css/main.scss +1 -1
- package/src/css/mixins/focusable.scss +3 -0
- package/src/css/mixins/make-icon.scss +1 -1
- package/src/css/mixins/make-link.scss +13 -10
- package/src/css/{qld-theme.scss → qld-palettes.scss} +50 -35
- package/src/css/qld-type.scss +5 -1
- package/src/css/qld-utilities.scss +9 -1
- package/src/css/qld-variables.scss +1 -1
- package/src/img/icons-sprite.svg +24 -24
- package/src/js/qld.bootstrap.js +3 -55
- package/src/components/bs5/formcheck/_formcheck.stories.bak.js +0 -432
|
@@ -1,89 +1,99 @@
|
|
|
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);
|
|
7
|
+
--background-color-hover: var(--#{$prefix}neutral-lightest);
|
|
6
8
|
--border-color: var(--#{$prefix}light-border-alt);
|
|
9
|
+
--border-color-focus: var(--#{$prefix}default-border);
|
|
10
|
+
--border-color-hover: var(--#{$prefix}light-action-primary-hover);
|
|
7
11
|
--placeholder-color: var(--#{$prefix}light-text-lighter);
|
|
8
12
|
--qld-icon-color: var(--#{$prefix}light-text-lighter);
|
|
9
13
|
--text-color: var(--#{$prefix}light-text-text);
|
|
10
14
|
--text-heading: var(--#{$prefix}color-default-color-light-text-heading);
|
|
15
|
+
--suggestions-shadow:
|
|
16
|
+
0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 3px 1px rgba(0, 0, 0, 0.1);
|
|
17
|
+
--border-radius: 0.25rem;
|
|
18
|
+
--hover-background-color: var(--#{$prefix}neutral-light);
|
|
19
|
+
--_size: 3rem;
|
|
11
20
|
|
|
12
21
|
.dark &,
|
|
13
22
|
.dark-alt & {
|
|
14
|
-
--
|
|
15
|
-
--
|
|
23
|
+
--border-color: var(--#{$prefix}dark-alt-border);
|
|
24
|
+
--border-color-focus: var(--#{$prefix}dark-alt-border);
|
|
25
|
+
--border-color-hover: var(--#{$prefix}dark-action-primary-hover);
|
|
26
|
+
--background-color: var(--#{$prefix}dark-background);
|
|
27
|
+
--text-color: var(--#{$prefix}dark-text-default);
|
|
28
|
+
--background-color-hover: var(--#{$prefix}dark-background-shade);
|
|
29
|
+
|
|
30
|
+
--qld-selection-bg: var(--qld-dark-background);
|
|
31
|
+
--qld-selection-color: var(--qld-neutral-white);
|
|
32
|
+
|
|
33
|
+
.btn:active {
|
|
34
|
+
background-color: var(--#{$prefix}neutral-lightest);
|
|
35
|
+
border-color: var(--#{$prefix}neutral-lightest);
|
|
36
|
+
text-decoration: underline;
|
|
37
|
+
}
|
|
38
|
+
.form-control:focus {
|
|
39
|
+
border-color: var(--#{$prefix}neutral-lighter);
|
|
40
|
+
--text-color: var(--#{$prefix}light-text-text);
|
|
41
|
+
}
|
|
16
42
|
}
|
|
17
43
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
44
|
+
display: flex;
|
|
45
|
+
position: relative;
|
|
46
|
+
border-radius: var(--border-radius);
|
|
47
|
+
|
|
48
|
+
.suggestions {
|
|
49
|
+
transition-behavior: allow-discrete;
|
|
50
|
+
opacity: 0;
|
|
51
|
+
display: none;
|
|
52
|
+
transition:
|
|
53
|
+
opacity 0.5s,
|
|
54
|
+
display 0.5s;
|
|
23
55
|
}
|
|
56
|
+
|
|
24
57
|
&:focus-within {
|
|
25
|
-
.suggestions
|
|
26
|
-
display: block
|
|
58
|
+
.suggestions {
|
|
59
|
+
display: block; // !important to override bootstrap d-none
|
|
60
|
+
opacity: 1;
|
|
61
|
+
transition:
|
|
62
|
+
opacity 0.5s,
|
|
63
|
+
display 0.5s;
|
|
27
64
|
}
|
|
28
|
-
}
|
|
29
|
-
|
|
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
65
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
// &:has(#search-button:active) {
|
|
67
|
+
// .suggestions {
|
|
68
|
+
// display: none;
|
|
69
|
+
// }
|
|
70
|
+
// }
|
|
71
|
+
}
|
|
59
72
|
|
|
60
73
|
@include mixins.focusable($customSelector: ":has(.form-control:focus)");
|
|
61
74
|
|
|
62
75
|
&:has(.form-control:focus) {
|
|
63
76
|
> button {
|
|
64
|
-
border-bottom-right-radius:
|
|
77
|
+
border-bottom-right-radius: var(--border-radius);
|
|
65
78
|
}
|
|
66
79
|
}
|
|
67
80
|
|
|
68
81
|
.form-control {
|
|
69
82
|
min-height: var(--_size);
|
|
70
83
|
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
|
-
}
|
|
84
|
+
border: var(--border-color) solid 0.125rem;
|
|
85
|
+
border-inline-end-width: 0;
|
|
86
|
+
border-radius: 0;
|
|
87
|
+
border-start-start-radius: var(--border-radius);
|
|
88
|
+
border-end-start-radius: var(--border-radius);
|
|
80
89
|
background: var(--background-color);
|
|
81
|
-
padding-
|
|
90
|
+
padding-inline-end: 7.5rem;
|
|
82
91
|
color: var(--text-color);
|
|
92
|
+
|
|
83
93
|
transition: {
|
|
84
94
|
property: border-color, background-color, color;
|
|
85
|
-
timing-function:
|
|
86
|
-
duration:
|
|
95
|
+
timing-function: animation.$timing-function;
|
|
96
|
+
duration: animation.$duration-fast;
|
|
87
97
|
}
|
|
88
98
|
|
|
89
99
|
&::placeholder {
|
|
@@ -91,20 +101,20 @@
|
|
|
91
101
|
}
|
|
92
102
|
|
|
93
103
|
&:hover {
|
|
94
|
-
--background-color: var(
|
|
95
|
-
--border-color: var(
|
|
104
|
+
--background-color: var(--background-color-hover);
|
|
105
|
+
--border-color: var(--border-color-hover);
|
|
96
106
|
}
|
|
97
107
|
|
|
98
108
|
&:active,
|
|
99
109
|
&:focus {
|
|
100
|
-
--border-color: var(
|
|
110
|
+
--border-color: var(--border-color-focus);
|
|
101
111
|
--background-color: var(--#{$prefix}white);
|
|
102
112
|
outline: none;
|
|
103
113
|
}
|
|
104
114
|
}
|
|
105
115
|
|
|
106
116
|
> button {
|
|
107
|
-
border-radius: 0
|
|
117
|
+
border-radius: 0 var(--border-radius) var(--border-radius) 0;
|
|
108
118
|
padding: 0;
|
|
109
119
|
margin: 0;
|
|
110
120
|
width: var(--_size);
|
|
@@ -133,7 +143,8 @@
|
|
|
133
143
|
--_size: 3.25rem;
|
|
134
144
|
|
|
135
145
|
> button {
|
|
136
|
-
padding: calc(0.75rem - 0.125rem)
|
|
146
|
+
padding-block: calc(0.75rem - 0.125rem);
|
|
147
|
+
padding-inline: var(--qld-btn-padding-x);
|
|
137
148
|
margin: 0;
|
|
138
149
|
width: auto;
|
|
139
150
|
|
|
@@ -143,65 +154,123 @@
|
|
|
143
154
|
|
|
144
155
|
.btn-icon {
|
|
145
156
|
display: none;
|
|
146
|
-
margin-
|
|
157
|
+
margin-inline-start: 0;
|
|
147
158
|
}
|
|
148
159
|
}
|
|
149
160
|
|
|
150
161
|
.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;
|
|
162
|
+
padding-block: 0.75rem;
|
|
163
|
+
padding-inline: 1rem;
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
166
|
|
|
163
167
|
//Search dropdown
|
|
164
168
|
.suggestions {
|
|
165
169
|
position: absolute;
|
|
166
|
-
|
|
167
|
-
top: 100%;
|
|
170
|
+
inset-inline-start: 0;
|
|
168
171
|
width: 100%;
|
|
172
|
+
inset-block-start: calc(3.25rem + 7px) !important;
|
|
169
173
|
z-index: 1;
|
|
170
174
|
border-radius: 0.5rem;
|
|
171
|
-
background: var(
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
background: var(--#{$prefix}neutral-lightest);
|
|
176
|
+
|
|
177
|
+
& > div:has(> div) {
|
|
178
|
+
box-shadow: var(--suggestions-shadow);
|
|
179
|
+
border-radius: 0.5rem;
|
|
180
|
+
border-bottom: 0.25rem solid
|
|
181
|
+
var(--#{$prefix}color-default-color-light-accent-design-accent);
|
|
182
|
+
}
|
|
174
183
|
|
|
175
184
|
.suggestions-category {
|
|
176
|
-
|
|
177
|
-
text-decoration: underline;
|
|
178
|
-
text-decoration-thickness: 0.5px;
|
|
179
|
-
text-decoration-color: rgba(
|
|
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
|
-
}
|
|
193
|
-
}
|
|
185
|
+
padding-block: 0.75rem;
|
|
194
186
|
|
|
187
|
+
&:not(:first-of-type) {
|
|
188
|
+
border-block-start: 1px solid
|
|
189
|
+
var(--#{$prefix}light-alt-background-shade);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Question
|
|
195
193
|
&-label {
|
|
196
|
-
padding: 0
|
|
194
|
+
padding-block: 0.75rem;
|
|
195
|
+
padding-inline: 1rem;
|
|
197
196
|
}
|
|
198
197
|
|
|
199
198
|
ul {
|
|
200
199
|
li {
|
|
201
200
|
a {
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
display: flex;
|
|
202
|
+
align-items: center;
|
|
203
|
+
padding-block: 0.75rem;
|
|
204
|
+
padding-inline: 1rem;
|
|
205
|
+
color: var(--#{$prefix}light-text-text);
|
|
204
206
|
width: 100%;
|
|
207
|
+
text-decoration: underline;
|
|
208
|
+
text-decoration-thickness: 0.5px;
|
|
209
|
+
text-decoration-color: transparent;
|
|
210
|
+
transition:
|
|
211
|
+
text-decoration-thickness animation.$duration-fast
|
|
212
|
+
animation.$timing-function,
|
|
213
|
+
text-decoration-color animation.$duration-fast
|
|
214
|
+
animation.$timing-function;
|
|
215
|
+
|
|
216
|
+
&:hover,
|
|
217
|
+
&:hover strong {
|
|
218
|
+
text-decoration-color: inherit;
|
|
219
|
+
text-decoration-thickness: var(
|
|
220
|
+
--#{$prefix}link-underline-thickness-hover
|
|
221
|
+
);
|
|
222
|
+
transition:
|
|
223
|
+
text-decoration-thickness animation.$duration-fast
|
|
224
|
+
animation.$timing-function,
|
|
225
|
+
text-decoration-color animation.$duration-fast
|
|
226
|
+
animation.$timing-function;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&:not(.view-more) {
|
|
230
|
+
&::before {
|
|
231
|
+
content: "";
|
|
232
|
+
height: 1.25rem;
|
|
233
|
+
width: 1.25rem;
|
|
234
|
+
min-width: 1.25rem;
|
|
235
|
+
margin-inline-end: 0.5rem;
|
|
236
|
+
mask-image: var(--qgds-icon-arrow-right);
|
|
237
|
+
mask-position: center center;
|
|
238
|
+
mask-repeat: no-repeat;
|
|
239
|
+
mask-size: contain;
|
|
240
|
+
background-color: var(--#{$prefix}light-action-secondary);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
&:hover {
|
|
244
|
+
&::before {
|
|
245
|
+
background-color: var(
|
|
246
|
+
--#{$prefix}light-action-secondary-hover
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
&.view-more {
|
|
253
|
+
text-decoration-color: inherit;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
&:has(.dynamic-suggestions > div) {
|
|
261
|
+
background-color: var(--#{$prefix}default-background);
|
|
262
|
+
}
|
|
263
|
+
.dynamic-suggestions {
|
|
264
|
+
.suggestions-category:not(.feature) {
|
|
265
|
+
ul {
|
|
266
|
+
li {
|
|
267
|
+
a {
|
|
268
|
+
&:not(.view-more) {
|
|
269
|
+
&::before {
|
|
270
|
+
mask-image: var(--qgds-icon-search);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
205
274
|
}
|
|
206
275
|
}
|
|
207
276
|
}
|
|
@@ -213,23 +282,9 @@
|
|
|
213
282
|
|
|
214
283
|
// Featured search result styles
|
|
215
284
|
.feature {
|
|
216
|
-
background-color: var(
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
}
|
|
285
|
+
background-color: var(
|
|
286
|
+
--#{$prefix}color-default-color-light-background-default-shade
|
|
287
|
+
);
|
|
233
288
|
}
|
|
234
289
|
|
|
235
290
|
// Show when active
|
|
@@ -243,7 +298,6 @@
|
|
|
243
298
|
a,
|
|
244
299
|
strong {
|
|
245
300
|
font-size: 1rem;
|
|
246
|
-
text-decoration: none;
|
|
247
301
|
}
|
|
248
302
|
|
|
249
303
|
strong {
|
|
@@ -254,30 +308,40 @@
|
|
|
254
308
|
ul {
|
|
255
309
|
padding: 0;
|
|
256
310
|
margin: 0;
|
|
311
|
+
|
|
257
312
|
li {
|
|
258
313
|
min-height: 3rem;
|
|
259
314
|
list-style: none;
|
|
260
315
|
cursor: pointer;
|
|
261
|
-
margin-
|
|
316
|
+
margin-block-start: 0;
|
|
262
317
|
|
|
263
318
|
a {
|
|
264
319
|
vertical-align: middle;
|
|
265
320
|
vertical-align: -webkit-baseline-middle;
|
|
266
321
|
|
|
267
|
-
&:
|
|
268
|
-
|
|
322
|
+
&:focus {
|
|
323
|
+
outline-color: var(--#{$prefix}light-focus);
|
|
324
|
+
background-color: var(--hover-background-color);
|
|
325
|
+
outline-offset: -4px;
|
|
269
326
|
}
|
|
270
327
|
}
|
|
271
328
|
|
|
272
329
|
&:hover {
|
|
273
|
-
background-color: var(--
|
|
330
|
+
background-color: var(--hover-background-color);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
274
334
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
335
|
+
.dynamic-suggestions .suggestions-category:not(.feature) {
|
|
336
|
+
strong {
|
|
337
|
+
color: var(--#{$prefix}light-text-text);
|
|
338
|
+
}
|
|
339
|
+
ul li {
|
|
340
|
+
&:hover {
|
|
341
|
+
--hover-background-color: var(--#{$prefix}default-background-shade);
|
|
342
|
+
}
|
|
343
|
+
a:focus {
|
|
344
|
+
--hover-background-color: var(--#{$prefix}default-background-shade);
|
|
281
345
|
}
|
|
282
346
|
}
|
|
283
347
|
}
|
|
@@ -289,91 +353,24 @@
|
|
|
289
353
|
}
|
|
290
354
|
|
|
291
355
|
&.is-filled {
|
|
292
|
-
--background-color: var(
|
|
356
|
+
--background-color: var(--background-color-hover);
|
|
293
357
|
|
|
294
358
|
.form-control {
|
|
295
|
-
border:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
left-width: 0;
|
|
300
|
-
radius: $border-radius 0 0 0;
|
|
301
|
-
}
|
|
359
|
+
border-width: 0;
|
|
360
|
+
border-block-end-width: 0.125rem;
|
|
361
|
+
border-radius: 0;
|
|
362
|
+
border-start-start-radius: var(--border-radius);
|
|
302
363
|
|
|
303
364
|
&:active,
|
|
304
365
|
&:focus {
|
|
305
366
|
--border-color: var(--#{$prefix}neutral-lighter);
|
|
306
|
-
border-bottom-left-radius:
|
|
367
|
+
border-bottom-left-radius: var(--border-radius);
|
|
307
368
|
}
|
|
308
369
|
}
|
|
309
370
|
|
|
310
371
|
> button {
|
|
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
|
-
}
|
|
372
|
+
border-radius: 0;
|
|
373
|
+
border-start-end-radius: var(--border-radius);
|
|
377
374
|
}
|
|
378
375
|
}
|
|
379
376
|
}
|
|
@@ -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
|
|