@nnc-digital/nnc-design-system 0.4.32 → 0.4.34
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/build/index.esm.js +74 -46
- package/build/index.esm.js.map +1 -1
- package/build/index.js +74 -46
- package/build/index.js.map +1 -1
- package/build/library/components/Autocomplete/Autocomplete.types.d.ts +8 -0
- package/build/library/structure/Searchbar/Searchbar.d.ts +2 -2
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -314,6 +314,21 @@ const AutocompleteSuggestionTextMatch = styled__default["default"].span`
|
|
|
314
314
|
font-weight: bold;
|
|
315
315
|
`;
|
|
316
316
|
|
|
317
|
+
const LightErrorText = styled__default["default"].p`
|
|
318
|
+
${(props) => props.theme.fontStyles}
|
|
319
|
+
color: ${(props) => props.theme.theme_vars.colours.white};
|
|
320
|
+
font-weight: bold;
|
|
321
|
+
margin-bottom: 5px;
|
|
322
|
+
font-size: 14px;
|
|
323
|
+
font-size: 0.8rem;
|
|
324
|
+
line-height: 1.1;
|
|
325
|
+
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
|
|
326
|
+
font-size: 18px;
|
|
327
|
+
font-size: 1rem;
|
|
328
|
+
line-height: 1.25;
|
|
329
|
+
}
|
|
330
|
+
`;
|
|
331
|
+
|
|
317
332
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
318
333
|
|
|
319
334
|
function getDefaultExportFromCjs (x) {
|
|
@@ -3747,12 +3762,12 @@ process.env.NODE_ENV !== "production" ? '__function_reset__' : 12;
|
|
|
3747
3762
|
* click on to select. If viewing in Storybook, try typing the name of a fruit in the story examples.
|
|
3748
3763
|
*/
|
|
3749
3764
|
var Autocomplete = function (_a) {
|
|
3750
|
-
var _b = _a.id, id = _b === void 0 ? 'autocomplete' : _b, _c = _a.name, name = _c === void 0 ? 'autocomplete' : _c, labelText = _a.labelText, _d = _a.hasHiddenLabel, hasHiddenLabel = _d === void 0 ? false : _d, value = _a.value, size = _a.size, placeholder = _a.placeholder, _e = _a.isErrored, isErrored = _e === void 0 ? false : _e, errorText = _a.errorText, _f = _a.suggestions, suggestions = _f === void 0 ? [] : _f, _g = _a.showSuggestions, showSuggestions = _g === void 0 ? false : _g, _h = _a.minimumMatchLength, minimumMatchLength = _h === void 0 ? 2 : _h, _j = _a.maximumMatchesShown, maximumMatchesShown = _j === void 0 ? 5 : _j, _k = _a.isLarge, isLarge = _k === void 0 ? false : _k, _l = _a.hasAdjacentButton, hasAdjacentButton = _l === void 0 ? false : _l, onSelect = _a.onSelect, onChange = _a.onChange;
|
|
3765
|
+
var _b = _a.id, id = _b === void 0 ? 'autocomplete' : _b, _c = _a.name, name = _c === void 0 ? 'autocomplete' : _c, labelText = _a.labelText, _d = _a.hasHiddenLabel, hasHiddenLabel = _d === void 0 ? false : _d, value = _a.value, size = _a.size, placeholder = _a.placeholder, _e = _a.isErrored, isErrored = _e === void 0 ? false : _e, errorText = _a.errorText, _f = _a.suggestions, suggestions = _f === void 0 ? [] : _f, _g = _a.showSuggestions, showSuggestions = _g === void 0 ? false : _g, _h = _a.minimumMatchLength, minimumMatchLength = _h === void 0 ? 2 : _h, _j = _a.maximumMatchesShown, maximumMatchesShown = _j === void 0 ? 5 : _j, _k = _a.isLarge, isLarge = _k === void 0 ? false : _k, _l = _a.hasAdjacentButton, hasAdjacentButton = _l === void 0 ? false : _l, onSelect = _a.onSelect, onChange = _a.onChange, _m = _a.required, required = _m === void 0 ? false : _m, _o = _a.hasLightBackground, hasLightBackground = _o === void 0 ? true : _o;
|
|
3751
3766
|
/**
|
|
3752
3767
|
* We save the input value in state or we can't cope with leaving the input
|
|
3753
3768
|
* without selecting a matching suggestion.
|
|
3754
3769
|
*/
|
|
3755
|
-
var
|
|
3770
|
+
var _p = React.useState(value), inputvalue = _p[0], setInputValue = _p[1];
|
|
3756
3771
|
/**
|
|
3757
3772
|
* For component state changes that affect the input value, we copy the
|
|
3758
3773
|
* value into our saved state, and fire the onSelect handler if the change
|
|
@@ -3826,7 +3841,7 @@ var Autocomplete = function (_a) {
|
|
|
3826
3841
|
var getInputProps = _a.getInputProps, getItemProps = _a.getItemProps, getLabelProps = _a.getLabelProps, getMenuProps = _a.getMenuProps, isOpen = _a.isOpen, inputValue = _a.inputValue, getRootProps = _a.getRootProps;
|
|
3827
3842
|
return (React__default["default"].createElement("div", null,
|
|
3828
3843
|
React__default["default"].createElement(AutocompleteLabel, __assign$2({}, getLabelProps(), { hasHiddenLabel: hasHiddenLabel }), labelText ? labelText : placeholder),
|
|
3829
|
-
isErrored && errorText ? React__default["default"].createElement(ErrorText$1, null, errorText) :
|
|
3844
|
+
isErrored && errorText && (React__default["default"].createElement(React__default["default"].Fragment, null, hasLightBackground ? (React__default["default"].createElement(ErrorText$1, null, errorText)) : (React__default["default"].createElement(LightErrorText, null, errorText)))),
|
|
3830
3845
|
React__default["default"].createElement("div", __assign$2({}, getRootProps(undefined, { suppressRefError: true })),
|
|
3831
3846
|
React__default["default"].createElement(AutocompleteTextInput, __assign$2({}, getInputProps({
|
|
3832
3847
|
name: name,
|
|
@@ -3837,7 +3852,7 @@ var Autocomplete = function (_a) {
|
|
|
3837
3852
|
isLarge: isLarge,
|
|
3838
3853
|
hasAdjacentButton: hasAdjacentButton,
|
|
3839
3854
|
size: size,
|
|
3840
|
-
})))),
|
|
3855
|
+
}), { "aria-required": required ? 'true' : 'false', "aria-invalid": isErrored ? 'true' : 'false' }))),
|
|
3841
3856
|
// can't rely just on isOpen or we can end up displaying an empty suggestions list
|
|
3842
3857
|
isOpen && filteredsuggestions.length > 0 ? (React__default["default"].createElement(AutocompleteSuggestionList, __assign$2({}, getMenuProps({
|
|
3843
3858
|
'aria-labelledby': null,
|
|
@@ -4167,9 +4182,9 @@ const StyledButton = styled__default["default"].button`
|
|
|
4167
4182
|
* Primary UI component for user interaction
|
|
4168
4183
|
*/
|
|
4169
4184
|
var FormButton = function (_a) {
|
|
4170
|
-
var _b = _a.primary, primary = _b === void 0 ? true : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, text = _a.text
|
|
4185
|
+
var _b = _a.primary, primary = _b === void 0 ? true : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, text = _a.text, _d = _a.type, type = _d === void 0 ? "submit" : _d; _a.isDisabled; var props = __rest(_a, ["primary", "size", "text", "type", "isDisabled"]);
|
|
4171
4186
|
var mode = primary ? 'button--primary' : 'button--secondary';
|
|
4172
|
-
return (React__default["default"].createElement(StyledButton, __assign$2({ className: ["button--".concat(size), mode].join(' ') }, props), text));
|
|
4187
|
+
return (React__default["default"].createElement(StyledButton, __assign$2({ type: type, className: ["button--".concat(size), mode].join(' ') }, props), text));
|
|
4173
4188
|
};
|
|
4174
4189
|
|
|
4175
4190
|
const Container$15 = styled__default["default"].div`
|
|
@@ -4418,7 +4433,7 @@ var BinCollection = function (_a) {
|
|
|
4418
4433
|
var selectedUPRN = e.target.value;
|
|
4419
4434
|
if (selectedUPRN) {
|
|
4420
4435
|
var startDate_1 = getFormattedDate();
|
|
4421
|
-
var endDate_1 = getFormattedDate(
|
|
4436
|
+
var endDate_1 = getFormattedDate(70);
|
|
4422
4437
|
// Fetch calendar events for the selected UPRN
|
|
4423
4438
|
axios__default["default"].get("".concat(CalendarEventsApiUrl).concat(selectedUPRN, "/").concat(startDate_1, "/").concat(endDate_1))
|
|
4424
4439
|
.then(function (response) {
|
|
@@ -4512,7 +4527,7 @@ var BinCollection = function (_a) {
|
|
|
4512
4527
|
React__default["default"].createElement(VisuallyHiddenLabel, { id: "postcode-label", htmlFor: "postcode-input" }, "Enter a postcode"),
|
|
4513
4528
|
React__default["default"].createElement(StyledTextInput, { type: "text", placeholder: "Enter a postcode", name: "postcode", id: "postcode-input", isErrored: isError, "aria-labelledby": "postcode-label", autoComplete: "postal-code" }),
|
|
4514
4529
|
React__default["default"].createElement(BinCollectionButtonStyles, null,
|
|
4515
|
-
React__default["default"].createElement(FormButton, { size: "large",
|
|
4530
|
+
React__default["default"].createElement(FormButton, { size: "large", "aria-label": "Submit", text: "Find" }))))),
|
|
4516
4531
|
addressOptions.length > 0 && (React__default["default"].createElement(DropDownSelectContainer, null,
|
|
4517
4532
|
React__default["default"].createElement(DropDownSelect, { onChange: handleAddressChange, id: "address", label: "Select your address", options: __spreadArray([{ title: 'Select an address', value: '' }], addressOptions, true) }))),
|
|
4518
4533
|
noResultsFound && React__default["default"].createElement("p", null, "No results found."),
|
|
@@ -24134,7 +24149,7 @@ var BackLink = function (_a) {
|
|
|
24134
24149
|
};
|
|
24135
24150
|
|
|
24136
24151
|
const Container$B = styled__default["default"].div`
|
|
24137
|
-
padding-top:
|
|
24152
|
+
padding-top: 15px;
|
|
24138
24153
|
border-bottom: 1px solid ${(props) => props.theme.theme_vars.colours.grey}80;
|
|
24139
24154
|
margin-bottom: ${(props) => (props.hasMargin ? props.theme.theme_vars.spacingSizes.large : 0)};
|
|
24140
24155
|
`;
|
|
@@ -24150,7 +24165,7 @@ const List$2 = styled__default["default"].ol`
|
|
|
24150
24165
|
|
|
24151
24166
|
const Crumb = styled__default["default"].li`
|
|
24152
24167
|
margin-right: ${(props) => props.theme.theme_vars.spacingSizes.small};
|
|
24153
|
-
margin-bottom:
|
|
24168
|
+
margin-bottom: 0;
|
|
24154
24169
|
display: none;
|
|
24155
24170
|
left: 0;
|
|
24156
24171
|
padding-right: 0;
|
|
@@ -24179,6 +24194,7 @@ const BreadcrumbLink$1 = styled__default["default"].a`
|
|
|
24179
24194
|
${(props) => props.theme.linkStyles}
|
|
24180
24195
|
font-weight: 400;
|
|
24181
24196
|
display: inline-block;
|
|
24197
|
+
padding: ${(props) => props.theme.theme_vars.spacingSizes.small} 0;
|
|
24182
24198
|
|
|
24183
24199
|
svg {
|
|
24184
24200
|
fill: ${(props) => props.theme.theme_vars.colours.action};
|
|
@@ -24201,7 +24217,7 @@ const BreadcrumbLink$1 = styled__default["default"].a`
|
|
|
24201
24217
|
var Breadcrumbs = function (_a) {
|
|
24202
24218
|
var breadcrumbsArray = _a.breadcrumbsArray, _b = _a.hasMargin, hasMargin = _b === void 0 ? false : _b;
|
|
24203
24219
|
return (React__default["default"].createElement(Container$B, { hasMargin: hasMargin, "data-testid": "Breadcrumbs" },
|
|
24204
|
-
React__default["default"].createElement(List$2,
|
|
24220
|
+
React__default["default"].createElement(List$2, { as: breadcrumbsArray.length === 1 ? 'div' : 'ol' }, breadcrumbsArray.map(function (crumb) { return (React__default["default"].createElement(Crumb, { key: crumb.title, as: breadcrumbsArray.length === 1 ? 'span' : 'li' }, React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
24205
24221
|
React__default["default"].createElement(BreadcrumbLink$1, { href: crumb.url, title: crumb.title }, crumb.title),
|
|
24206
24222
|
React__default["default"].createElement(IconWrapper$4, null,
|
|
24207
24223
|
React__default["default"].createElement(ChevronIcon, { direction: 'right', colourFill: "#C6C6C6" }))))); }))));
|
|
@@ -24380,10 +24396,6 @@ const FooterList = styled__default["default"].ul`
|
|
|
24380
24396
|
margin-bottom: 25px;
|
|
24381
24397
|
list-style-type: none;
|
|
24382
24398
|
|
|
24383
|
-
li:last-of-type {
|
|
24384
|
-
margin-bottom: 0;
|
|
24385
|
-
}
|
|
24386
|
-
|
|
24387
24399
|
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.s}) {
|
|
24388
24400
|
margin-bottom: 0px;
|
|
24389
24401
|
}
|
|
@@ -24393,8 +24405,15 @@ const FooterListItem = styled__default["default"].li`
|
|
|
24393
24405
|
display: inline-block;
|
|
24394
24406
|
left: 0;
|
|
24395
24407
|
padding-right: 0;
|
|
24396
|
-
margin-right:
|
|
24397
|
-
margin-bottom:
|
|
24408
|
+
margin-right: 0;
|
|
24409
|
+
margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
|
|
24410
|
+
width: 100%;
|
|
24411
|
+
|
|
24412
|
+
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
|
|
24413
|
+
width: auto;
|
|
24414
|
+
margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.medium};
|
|
24415
|
+
margin-right: ${(props) => props.theme.theme_vars.spacingSizes.small};
|
|
24416
|
+
}
|
|
24398
24417
|
`;
|
|
24399
24418
|
|
|
24400
24419
|
const SocialLinks = styled__default["default"].ul`
|
|
@@ -24408,8 +24427,8 @@ const SocialLinkItem = styled__default["default"].li`
|
|
|
24408
24427
|
`;
|
|
24409
24428
|
|
|
24410
24429
|
const SocialLinkSingle = styled__default["default"].a`
|
|
24411
|
-
display:
|
|
24412
|
-
|
|
24430
|
+
display: block;
|
|
24431
|
+
padding: ${(props) => props.theme.theme_vars.spacingSizes.extra_small};
|
|
24413
24432
|
|
|
24414
24433
|
&:hover {
|
|
24415
24434
|
opacity: 0.8;
|
|
@@ -24441,9 +24460,16 @@ const SocialLinkSingle = styled__default["default"].a`
|
|
|
24441
24460
|
`;
|
|
24442
24461
|
|
|
24443
24462
|
const FooterLink = styled__default["default"].a`
|
|
24463
|
+
display: block;
|
|
24444
24464
|
${(props) => props.theme.linkStyles}
|
|
24445
24465
|
color: ${(props) => props.theme.theme_vars.colours.white};
|
|
24446
24466
|
font-weight: 400;
|
|
24467
|
+
padding: ${(props) =>
|
|
24468
|
+
`${props.theme.theme_vars.spacingSizes.small} ${props.theme.theme_vars.spacingSizes.extra_small}`};
|
|
24469
|
+
|
|
24470
|
+
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
|
|
24471
|
+
display: inline-block;
|
|
24472
|
+
}
|
|
24447
24473
|
|
|
24448
24474
|
&:hover {
|
|
24449
24475
|
${(props) => props.theme.linkStylesHover}
|
|
@@ -24781,8 +24807,8 @@ var NorthColouredLogo = function () {
|
|
|
24781
24807
|
};
|
|
24782
24808
|
|
|
24783
24809
|
const Container$v = styled__default["default"].div`
|
|
24784
|
-
${props => props.theme.fontStyles}
|
|
24785
|
-
width: calc(100% - ${
|
|
24810
|
+
${(props) => props.theme.fontStyles}
|
|
24811
|
+
width: calc(100% - ${(props) => (props.isLarge ? '5rem' : '3rem')});
|
|
24786
24812
|
`;
|
|
24787
24813
|
|
|
24788
24814
|
styled__default["default"].label`
|
|
@@ -24807,41 +24833,44 @@ const InputWrapper = styled__default["default"].div`
|
|
|
24807
24833
|
const Button$3 = styled__default["default"].button`
|
|
24808
24834
|
position: absolute;
|
|
24809
24835
|
top: 0;
|
|
24810
|
-
right: ${
|
|
24836
|
+
right: ${(props) => (props.isLarge ? '-5rem' : '-3rem')};
|
|
24811
24837
|
cursor: pointer;
|
|
24812
24838
|
margin: 0;
|
|
24813
|
-
|
|
24814
|
-
|
|
24815
|
-
|
|
24839
|
+
margin-top: ${(props) => (props.isErrored ? '25px' : 0)};
|
|
24840
|
+
padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
|
|
24841
|
+
background: ${(props) =>
|
|
24842
|
+
props.isLight ? props.theme.theme_vars.colours.action : props.theme.theme_vars.colours.grey_darkest};
|
|
24843
|
+
color: ${(props) => props.theme.theme_vars.colours.white};
|
|
24816
24844
|
border: 1px solid transparent;
|
|
24817
|
-
border-top-right-radius: calc(${props => props.theme.theme_vars.border_radius} * 2);
|
|
24818
|
-
border-bottom-right-radius: calc(${props => props.theme.theme_vars.border_radius} * 2);
|
|
24819
|
-
width: ${props => props.isLarge ?
|
|
24845
|
+
border-top-right-radius: calc(${(props) => props.theme.theme_vars.border_radius} * 2);
|
|
24846
|
+
border-bottom-right-radius: calc(${(props) => props.theme.theme_vars.border_radius} * 2);
|
|
24847
|
+
width: ${(props) => (props.isLarge ? '5rem' : '3rem')};
|
|
24820
24848
|
text-align: center;
|
|
24821
|
-
height: ${
|
|
24822
|
-
@media screen and (min-width: ${
|
|
24823
|
-
height: ${
|
|
24849
|
+
height: ${(props) => (props.isLarge ? '2.9rem' : '2.28rem')};
|
|
24850
|
+
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
|
|
24851
|
+
height: ${(props) => (props.isLarge ? '3.22rem' : '2.6rem')};
|
|
24824
24852
|
}
|
|
24825
24853
|
|
|
24826
24854
|
&:hover {
|
|
24827
|
-
background: ${props =>
|
|
24855
|
+
background: ${(props) =>
|
|
24856
|
+
props.isLight ? props.theme.theme_vars.colours.action_dark : props.theme.theme_vars.colours.black};
|
|
24828
24857
|
}
|
|
24829
24858
|
|
|
24830
24859
|
&:focus {
|
|
24831
24860
|
outline: none;
|
|
24832
|
-
background: ${props => props.theme.theme_vars.colours.focus};
|
|
24861
|
+
background: ${(props) => props.theme.theme_vars.colours.focus};
|
|
24833
24862
|
svg {
|
|
24834
|
-
path{
|
|
24835
|
-
fill: ${props => props.theme.theme_vars.colours.black};
|
|
24863
|
+
path {
|
|
24864
|
+
fill: ${(props) => props.theme.theme_vars.colours.black};
|
|
24836
24865
|
}
|
|
24837
24866
|
}
|
|
24838
24867
|
}
|
|
24839
24868
|
|
|
24840
24869
|
&:active {
|
|
24841
24870
|
transform: translateY(1px);
|
|
24842
|
-
background-color: ${props => props.theme.theme_vars.colours.focus};
|
|
24843
|
-
box-shadow: 0px -1px 0px 0px ${props => props.theme.theme_vars.colours.black};
|
|
24844
|
-
border-top-color: ${props => props.theme.theme_vars.colours.black};
|
|
24871
|
+
background-color: ${(props) => props.theme.theme_vars.colours.focus};
|
|
24872
|
+
box-shadow: 0px -1px 0px 0px ${(props) => props.theme.theme_vars.colours.black};
|
|
24873
|
+
border-top-color: ${(props) => props.theme.theme_vars.colours.black};
|
|
24845
24874
|
border-bottom-color: transparent;
|
|
24846
24875
|
}
|
|
24847
24876
|
`;
|
|
@@ -24866,7 +24895,7 @@ var IconDownload = function (_a) {
|
|
|
24866
24895
|
};
|
|
24867
24896
|
|
|
24868
24897
|
var Searchbar = function (_a) {
|
|
24869
|
-
var _b = _a.placeholder, placeholder = _b === void 0 ?
|
|
24898
|
+
var _b = _a.placeholder, placeholder = _b === void 0 ? 'Search' : _b, isLight = _a.isLight, isLarge = _a.isLarge, _c = _a.searchTerm, searchTerm = _c === void 0 ? '' : _c, submitInfo = _a.submitInfo, _d = _a.id, id = _d === void 0 ? 'search' : _d, _e = _a.suggestions, suggestions = _e === void 0 ? [] : _e, _f = _a.minimumMatchLength, minimumMatchLength = _f === void 0 ? 2 : _f, _g = _a.maximumMatchesShown, maximumMatchesShown = _g === void 0 ? 5 : _g;
|
|
24870
24899
|
var initialSearchTerm = searchTerm;
|
|
24871
24900
|
var _h = React.useState(initialSearchTerm), inputSearchTerm = _h[0], setInputSearchTerm = _h[1];
|
|
24872
24901
|
var _j = React.useState(false), submit = _j[0], setSubmit = _j[1];
|
|
@@ -24898,13 +24927,12 @@ var Searchbar = function (_a) {
|
|
|
24898
24927
|
return;
|
|
24899
24928
|
setSubmit(false);
|
|
24900
24929
|
var submitParams = submitInfo.params;
|
|
24901
|
-
if (initialSearchTerm !== inputSearchTerm ||
|
|
24902
|
-
!(NewsArticleFilterFields.search.queryParamKey in submitParams)) {
|
|
24930
|
+
if (initialSearchTerm !== inputSearchTerm || !(NewsArticleFilterFields.search.queryParamKey in submitParams)) {
|
|
24903
24931
|
submitParams = __assign$2(__assign$2({}, submitParams), { searchTerm: inputSearchTerm });
|
|
24904
24932
|
var keyValueFormat = Object.keys(submitParams).map(function (key) {
|
|
24905
24933
|
return { key: key, value: submitParams[key] };
|
|
24906
24934
|
});
|
|
24907
|
-
handleParams(submitInfo.postTo, keyValueFormat, [
|
|
24935
|
+
handleParams(submitInfo.postTo, keyValueFormat, ['page']);
|
|
24908
24936
|
}
|
|
24909
24937
|
}, [submit, submitInfo, initialSearchTerm, inputSearchTerm, handleParams] // dependencies that this function relies upon
|
|
24910
24938
|
);
|
|
@@ -24915,7 +24943,7 @@ var Searchbar = function (_a) {
|
|
|
24915
24943
|
var handleSubmit = function (event) {
|
|
24916
24944
|
if (event)
|
|
24917
24945
|
event.preventDefault();
|
|
24918
|
-
if (inputSearchTerm ==
|
|
24946
|
+
if (inputSearchTerm == '') {
|
|
24919
24947
|
if (!isErrored) {
|
|
24920
24948
|
setIsErrored(true);
|
|
24921
24949
|
}
|
|
@@ -24930,8 +24958,8 @@ var Searchbar = function (_a) {
|
|
|
24930
24958
|
React__default["default"].createElement("form", { onSubmit: handleSubmit },
|
|
24931
24959
|
React__default["default"].createElement("div", { role: "search" },
|
|
24932
24960
|
React__default["default"].createElement(InputWrapper, null,
|
|
24933
|
-
React__default["default"].createElement(Autocomplete, { id: id, name: NewsArticleFilterFields.search.queryParamKey, placeholder: placeholder, onSelect: handleSelect, onChange: handleChange, value: inputSearchTerm, suggestions: suggestions, minimumMatchLength: minimumMatchLength, maximumMatchesShown: maximumMatchesShown, isLarge: isLarge, hasAdjacentButton: true, isErrored: isErrored, hasHiddenLabel: true }),
|
|
24934
|
-
React__default["default"].createElement(Button$3, { type: "submit", value: "Search", isLarge: isLarge, isLight: isLight, "data-testid": "SearchButton" },
|
|
24961
|
+
React__default["default"].createElement(Autocomplete, { id: id, name: NewsArticleFilterFields.search.queryParamKey, placeholder: placeholder, onSelect: handleSelect, onChange: handleChange, value: inputSearchTerm, suggestions: suggestions, minimumMatchLength: minimumMatchLength, maximumMatchesShown: maximumMatchesShown, isLarge: isLarge, hasAdjacentButton: true, isErrored: isErrored, hasHiddenLabel: true, required: true, errorText: "The search field is required.", hasLightBackground: isLight }),
|
|
24962
|
+
React__default["default"].createElement(Button$3, { type: "submit", value: "Search", isLarge: isLarge, isLight: isLight, isErrored: isErrored, "data-testid": "SearchButton" },
|
|
24935
24963
|
React__default["default"].createElement(IconDownload, { colourFill: "#fff" }),
|
|
24936
24964
|
React__default["default"].createElement(ButtonText$2, null, "Search")))))));
|
|
24937
24965
|
};
|
|
@@ -24989,7 +25017,7 @@ var Header = function (_a) {
|
|
|
24989
25017
|
hasNewsLink && (React__default["default"].createElement(Link$1, { href: "/news" }, "News")),
|
|
24990
25018
|
allServicesLink && (React__default["default"].createElement(Link$1, { href: isHomepage ? '#all-services' : allServicesLink + '#all-services' }, "All services")))),
|
|
24991
25019
|
!hideSearchBar && (React__default["default"].createElement(SearchWrapper, null,
|
|
24992
|
-
React__default["default"].createElement(Searchbar, { isLight: themeContext.cardinal_name === 'north' ? true : false, submitInfo: {
|
|
25020
|
+
React__default["default"].createElement(Searchbar, { isLight: themeContext.cardinal_name === 'north' ? true : false, isLarge: true, submitInfo: {
|
|
24993
25021
|
postTo: '/search',
|
|
24994
25022
|
params: {
|
|
24995
25023
|
type: 'search',
|