northants-design-system 1.0.5 → 1.0.6

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.js CHANGED
@@ -8576,10 +8576,10 @@ var LoadingSpinner = function () {
8576
8576
  * If value is set then treat as controlled component
8577
8577
  */
8578
8578
  var Input$6 = function (_a) {
8579
- var _b = _a.type, type = _b === void 0 ? 'text' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, _d = _a.isErrored, isErrored = _d === void 0 ? false : _d, errorText = _a.errorText, name = _a.name, maxLength = _a.maxLength, defaultValue = _a.defaultValue, onChange = _a.onChange, id = _a.id, value = _a.value, _e = _a.isFullWidth, isFullWidth = _e === void 0 ? false : _e;
8579
+ var _b = _a.type, type = _b === void 0 ? 'text' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, _d = _a.isErrored, isErrored = _d === void 0 ? false : _d, errorText = _a.errorText, name = _a.name, maxLength = _a.maxLength, defaultValue = _a.defaultValue, onChange = _a.onChange, id = _a.id, value = _a.value, autocomplete = _a.autocomplete, _e = _a.isFullWidth, isFullWidth = _e === void 0 ? false : _e;
8580
8580
  return (React__default.default.createElement(React__default.default.Fragment, null,
8581
8581
  errorText && React__default.default.createElement(ErrorText$2, null, errorText),
8582
- typeof value !== 'undefined' ? (React__default.default.createElement(StyledInput, { onChange: onChange, type: type, placeholder: placeholder, name: name, "$isErrored": isErrored, maxLength: maxLength, value: value, id: id, "$isFullWidth": isFullWidth })) : (React__default.default.createElement(StyledInput, { onChange: onChange, type: type, placeholder: placeholder, name: name, "$isErrored": isErrored, maxLength: maxLength, defaultValue: defaultValue, id: id, "$isFullWidth": isFullWidth }))));
8582
+ typeof value !== 'undefined' ? (React__default.default.createElement(StyledInput, { onChange: onChange, type: type, placeholder: placeholder, name: name, "$isErrored": isErrored, maxLength: maxLength, value: value, id: id, autoComplete: autocomplete, "$isFullWidth": isFullWidth })) : (React__default.default.createElement(StyledInput, { onChange: onChange, type: type, placeholder: placeholder, name: name, "$isErrored": isErrored, maxLength: maxLength, defaultValue: defaultValue, id: id, autoComplete: autocomplete, "$isFullWidth": isFullWidth }))));
8583
8583
  };
8584
8584
 
8585
8585
  const Container$_ = styled__default.default.div`
@@ -22530,8 +22530,10 @@ var BinFinder = function (_a) {
22530
22530
  var onSubmit = function (data) {
22531
22531
  setIsLoading(true);
22532
22532
  setIsError(undefined);
22533
+ var formattedPostcode = data.postcode.replace(/ /g, '').substring(0, 10);
22534
+ var formattedHouseNumber = data.houseNumber.trim();
22533
22535
  axios__default.default
22534
- .get("".concat(PostcodeSearchApiUrl).concat(data.postcode.replace(/ /g, '').substring(0, 10), "?address=").concat(data.houseNumber))
22536
+ .get("".concat(PostcodeSearchApiUrl).concat(formattedPostcode, "?address=").concat(formattedHouseNumber))
22535
22537
  .then(function (response) {
22536
22538
  var _a, _b, _c, _d;
22537
22539
  setIsLoading(false);
@@ -22552,6 +22554,12 @@ var BinFinder = function (_a) {
22552
22554
  setAddress(response.data.addresses[0].single_line_address);
22553
22555
  }
22554
22556
  else if (response.data.total_pages > 1) {
22557
+ if (showFirstLine) {
22558
+ setError('houseNumber', {
22559
+ type: 'custom',
22560
+ message: 'This address could not be found based on the information given. Please try entering further information.',
22561
+ });
22562
+ }
22555
22563
  setShowFirstLine(true);
22556
22564
  }
22557
22565
  else {
@@ -22654,9 +22662,9 @@ var BinFinder = function (_a) {
22654
22662
  } })),
22655
22663
  showFirstLine && (React__default.default.createElement(React__default.default.Fragment, null,
22656
22664
  React__default.default.createElement(Column, { small: "full", medium: "full", large: "full" },
22657
- React__default.default.createElement("p", null, "There are several addresses for this postcode. Please enter the first line of your address.")),
22665
+ React__default.default.createElement("p", null, "There are several addresses for this postcode. Please enter the full first line of your address.")),
22658
22666
  React__default.default.createElement(Column, { small: "full", medium: "full", large: "full" },
22659
- React__default.default.createElement(Label$4, { htmlFor: "houseNumber" }, "First line of address"),
22667
+ React__default.default.createElement(Label$4, { htmlFor: "houseNumber" }, "Full first line of address"),
22660
22668
  React__default.default.createElement(reactHookForm.Controller, { name: "houseNumber", control: control, rules: { maxLength: 50 }, render: function (_a) {
22661
22669
  var _b;
22662
22670
  var _c = _a.field, onChange = _c.onChange, value = _c.value;
@@ -23919,7 +23927,7 @@ var Video = function (_a) {
23919
23927
  var defineLinks = function () {
23920
23928
  if (provider == VideoProvider.YouTube) {
23921
23929
  watchLink = "https://www.youtube.com/watch?v=".concat(video_id);
23922
- embedLink = "https://www.youtube.com/embed/".concat(video_id, "?rel=0");
23930
+ embedLink = "https://www.youtube.com/embed/".concat(video_id, "?rel=0&cc_load_policy=1");
23923
23931
  }
23924
23932
  if (provider == VideoProvider.Vimeo) {
23925
23933
  watchLink = "https://vimeo.com/".concat(video_id);
@@ -24314,8 +24322,8 @@ var AlertBanner = function (_a) {
24314
24322
  const Container$C = styled__default.default.a`
24315
24323
  display: inline-block;
24316
24324
  position: relative;
24317
- margin-top: 15px;
24318
- margin-bottom: 15px;
24325
+ padding-top: 15px;
24326
+ padding-bottom: 15px;
24319
24327
  padding-left: 14px;
24320
24328
  border: none;
24321
24329
  background: transparent;
@@ -28931,6 +28939,7 @@ styled__default.default.img`
28931
28939
 
28932
28940
  const MapLink = styled__default.default.a`
28933
28941
  display: block;
28942
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
28934
28943
  `;
28935
28944
 
28936
28945
  styled__default.default.div`
@@ -29046,6 +29055,7 @@ const ContactName = styled__default.default.div`
29046
29055
 
29047
29056
  const ContactLink = styled__default.default.a`
29048
29057
  display: block;
29058
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small} 0;
29049
29059
  margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
29050
29060
  text-align: center;
29051
29061
  `;
@@ -29054,12 +29064,14 @@ const WebLink$1 = styled__default.default.a`
29054
29064
  word-break: break-all;
29055
29065
  display: block;
29056
29066
  text-align: center;
29067
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small} 0;
29057
29068
  `;
29058
29069
 
29059
29070
  const EmailLink = styled__default.default.a`
29060
29071
  word-break: break-all;
29061
29072
  display: block;
29062
29073
  text-align: center;
29074
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small} 0;
29063
29075
  `;
29064
29076
 
29065
29077
  var WebsiteIcon = function (_a) {
@@ -29739,7 +29751,10 @@ const ServiceContainer = styled__default.default.div`
29739
29751
  transition: box-shadow 0.3s ease;
29740
29752
  border-bottom: 5px solid ${(props) => props.theme.theme_vars.colours.action};
29741
29753
  border-radius: ${(props) => props.theme.theme_vars.border_radius};
29742
- padding: ${(props) => props.theme.theme_vars.spacingSizes.medium};
29754
+ padding-top: ${(props) => props.theme.theme_vars.spacingSizes.small};
29755
+ padding-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
29756
+ padding-left: ${(props) => props.theme.theme_vars.spacingSizes.medium};
29757
+ padding-right: ${(props) => props.theme.theme_vars.spacingSizes.medium};
29743
29758
  `;
29744
29759
 
29745
29760
  styled__default.default.span`
@@ -29804,6 +29819,8 @@ const LegendButton = styled__default.default.button`
29804
29819
  cursor: pointer;
29805
29820
  text-align: left;
29806
29821
  padding-right: 30px;
29822
+ padding-top: ${(props) => props.theme.theme_vars.spacingSizes.small};
29823
+ padding-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
29807
29824
  ${(props) => props.theme.theme_vars.h4}
29808
29825
  ${(props) => props.theme.linkStyles}
29809
29826
  &:hover {
@@ -29834,7 +29851,7 @@ const AccordionIcon = styled__default.default.span`
29834
29851
  vertical-align: top;
29835
29852
  width: 12px;
29836
29853
  border-color: ${(props) => props.theme.theme_vars.colours.black};
29837
- top: ${(props) => (props.$isOpen ? `5px` : `0`)};
29854
+ top: ${(props) => (props.$isOpen ? `15px` : `10px`)};
29838
29855
  left: 6px;
29839
29856
  transform: ${(props) => (props.$isOpen ? `rotate(-45deg)` : `rotate(135deg)`)};
29840
29857
  }
@@ -29872,8 +29889,8 @@ const TextLink$1 = styled__default.default.button`
29872
29889
  position: relative;
29873
29890
  z-index: 1;
29874
29891
  margin: 0;
29875
- margin-bottom: 15px;
29876
- padding: 0;
29892
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small} 0;
29893
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.extra_small};
29877
29894
  border-width: 0;
29878
29895
  color: ${(props) => props.theme.theme_vars.colours.action};
29879
29896
  background: none;
@@ -29950,7 +29967,7 @@ const Favourites = styled__default.default.a`
29950
29967
 
29951
29968
  const ServiceLink$1 = styled__default.default.a`
29952
29969
  display: block;
29953
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
29970
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small} 0;
29954
29971
  flex-grow: 1;
29955
29972
  ${(props) => props.theme.theme_vars.h4}
29956
29973
  ${(props) => props.theme.linkStyles}
@@ -30265,7 +30282,7 @@ var DirectoryServiceList = function (_a) {
30265
30282
  React__default.default.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
30266
30283
  React__default.default.createElement(Label$1, { htmlFor: "postcode" }, "Postcode (optional)"),
30267
30284
  React__default.default.createElement(HintText, { text: "Enter a postcode to see results within 2 miles" }),
30268
- React__default.default.createElement(Input$6, { name: "postcode", type: "text", defaultValue: postcodeSearch, id: "postcode", onChange: function (e) { return setPostcodeSearch(e.target.value); } })),
30285
+ React__default.default.createElement(Input$6, { name: "postcode", type: "text", defaultValue: postcodeSearch, id: "postcode", onChange: function (e) { return setPostcodeSearch(e.target.value); }, autocomplete: "postal-code" })),
30269
30286
  React__default.default.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
30270
30287
  React__default.default.createElement(ButtonContainer$2, null,
30271
30288
  React__default.default.createElement(Button$1, { onClick: submitSearch, type: "submit" },