@nnc-digital/nnc-design-system 0.4.6 → 0.4.7
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
CHANGED
|
@@ -4033,15 +4033,16 @@ var BinCollectionButtonStyles = styled.div(templateObject_3 || (templateObject_3
|
|
|
4033
4033
|
var FormContainer$1 = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n ", "\n"], ["\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n ", "\n"])), function (props) {
|
|
4034
4034
|
return props.isLoading && "\n opacity: 0.5; \n pointer-events: none;\n ";
|
|
4035
4035
|
});
|
|
4036
|
-
var
|
|
4037
|
-
var
|
|
4038
|
-
styled.
|
|
4039
|
-
|
|
4040
|
-
var
|
|
4041
|
-
var
|
|
4042
|
-
var
|
|
4043
|
-
styled.
|
|
4044
|
-
|
|
4036
|
+
var ErrorTextWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: block;\n width: 100%;\n"], ["\n display: block;\n width: 100%;\n"])));
|
|
4037
|
+
var DropDownSelectContainer = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding-bottom: 20px;\n"], ["\n padding-bottom: 20px;\n"])));
|
|
4038
|
+
var FormInnerContainer = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n"], ["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n"])));
|
|
4039
|
+
styled.label(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", ";\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", ";\n"])), function (props) { return props.theme.theme_vars.spacingSizes.small; });
|
|
4040
|
+
var UPRNPageTitleRow = styled.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n justify-content: center;\n margin-bottom: 1em;\n margin-top: 2em;\n width: 100%;\n"], ["\n justify-content: center;\n margin-bottom: 1em;\n margin-top: 2em;\n width: 100%;\n"])));
|
|
4041
|
+
var UPRNPageUPRNRow = styled.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n justify-content: left;\n margin-bottom: .5em;\n width: 100%;\n"], ["\n display: flex;\n justify-content: left;\n margin-bottom: .5em;\n width: 100%;\n"])));
|
|
4042
|
+
var UPRNPageSectionTitle = styled.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n font-size: 2em;\n font-weight: 700;\n"], ["\n font-size: 2em;\n font-weight: 700;\n"])));
|
|
4043
|
+
var UPRNPageUPRNTitle = styled.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n font-size: 1.5em;\n"], ["\n font-size: 1.5em;\n"])));
|
|
4044
|
+
styled.input(templateObject_13 || (templateObject_13 = __makeTemplateObject([""], [""])));
|
|
4045
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
4045
4046
|
|
|
4046
4047
|
const Container$16 = styled.div`
|
|
4047
4048
|
display: flex;
|
|
@@ -4332,13 +4333,22 @@ var BinCollection = function (_a) {
|
|
|
4332
4333
|
*/
|
|
4333
4334
|
var fetchAddresses = function (postcode) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4334
4335
|
return __generator(this, function (_a) {
|
|
4336
|
+
setError(false);
|
|
4337
|
+
setErrorText('');
|
|
4338
|
+
setIsLoading(true);
|
|
4335
4339
|
axios.get("".concat(BinCollectionApiUrl).concat(postcode))
|
|
4336
4340
|
.then(function (response) {
|
|
4337
4341
|
setIsLoading(false);
|
|
4342
|
+
// Check if there are any addresses returned
|
|
4343
|
+
if (response.data.data.length === 0) {
|
|
4344
|
+
setError(true);
|
|
4345
|
+
setErrorText('No addresses found for the provided postcode.');
|
|
4346
|
+
return;
|
|
4347
|
+
}
|
|
4338
4348
|
// Transform the response data into the expected format
|
|
4339
4349
|
var transformedAddresses = response.data.data.map(function (item) { return ({
|
|
4340
4350
|
value: item.UPRN,
|
|
4341
|
-
title: "".concat(item.Address
|
|
4351
|
+
title: "".concat(item.Address)
|
|
4342
4352
|
}); });
|
|
4343
4353
|
setAddressOptions(transformedAddresses);
|
|
4344
4354
|
})
|
|
@@ -4419,8 +4429,9 @@ var BinCollection = function (_a) {
|
|
|
4419
4429
|
React.createElement(FormWithLine, { onSubmit: handleSubmit, isError: isError, lineColour: themeContext.theme_vars.colours.grey_dark, hideLine: true },
|
|
4420
4430
|
React.createElement(FormContainer$1, { isLoading: isLoading },
|
|
4421
4431
|
React.createElement(Heading, { level: 2, text: "Bin Collection Checker" }),
|
|
4432
|
+
React.createElement(ErrorTextWrapper, null, errorText && React.createElement(ErrorText$1, null, errorText)),
|
|
4422
4433
|
React.createElement(FormInnerContainer, null,
|
|
4423
|
-
React.createElement(Input$6, { type: "text", placeholder: "Enter a postcode", name: "postcode",
|
|
4434
|
+
React.createElement(Input$6, { type: "text", placeholder: "Enter a postcode", name: "postcode", isErrored: isError, maxLength: 10 }),
|
|
4424
4435
|
React.createElement(BinCollectionButtonStyles, null,
|
|
4425
4436
|
React.createElement(FormButton, { size: "large", type: "submit", "aria-label": "Submit", text: "Find" }))))),
|
|
4426
4437
|
addressOptions.length > 0 && (React.createElement(DropDownSelectContainer, null,
|