northants-design-system 2.0.0 → 2.0.1

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.
@@ -27028,10 +27028,26 @@ const Container$I = styled.div`
27028
27028
  }
27029
27029
 
27030
27030
  .cludo-banner {
27031
- background-color: ${(props) => props.theme.theme_vars.colours.action_light};
27031
+ background-color: ${(props) => props.theme.theme_vars.colours.grey_light};
27032
27032
  color: ${(props) => props.theme.theme_vars.colours.black};
27033
27033
  width: 100%;
27034
- padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
27034
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.medium};
27035
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.large};
27036
+ overflow: hidden;
27037
+ ${(props) => props.theme.headingStyles}
27038
+
27039
+ img {
27040
+ width: 100%;
27041
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.medium};
27042
+ float: none;
27043
+
27044
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.l}) {
27045
+ width: 40%;
27046
+ margin-right: ${(props) => props.theme.theme_vars.spacingSizes.x_large} !important;
27047
+ margin-bottom: 0;
27048
+ float: left;
27049
+ }
27050
+ }
27035
27051
 
27036
27052
  a {
27037
27053
  text-decoration: underline !important;
@@ -27146,6 +27162,14 @@ const Container$I = styled.div`
27146
27162
  }
27147
27163
  `;
27148
27164
 
27165
+ const Loading = styled.div`
27166
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.medium};
27167
+ width: 100%;
27168
+ display: flex;
27169
+ justify-content: center;
27170
+ align-items: center;
27171
+ `;
27172
+
27149
27173
  const ImageContainer$5 = styled.div`
27150
27174
  img {
27151
27175
  width: 100%;
@@ -27273,7 +27297,8 @@ var CludoSearch = function (_a) {
27273
27297
  React.createElement(Column, { small: "full", medium: "two-thirds", large: "three-quarters" },
27274
27298
  React.createElement(MobileFacets, null,
27275
27299
  React.createElement(Facets, null)),
27276
- React.createElement(ResultsList, { template: function (currResult) { return (React.createElement(CustomResult, { result: currResult, wrapWithLink: true, className: "wnc-cludo-result" },
27300
+ React.createElement(ResultsList, { customLoader: React.createElement(Loading, null,
27301
+ React.createElement(LoadingSpinner, null)), template: function (currResult) { return (React.createElement(CustomResult, { result: currResult, wrapWithLink: true, className: "wnc-cludo-result" },
27277
27302
  React.createElement(Row$1, null,
27278
27303
  React.createElement(Column, { small: "full", medium: "one-third", large: "one-quarter" },
27279
27304
  React.createElement(ImageContainer$5, null,
@@ -28649,6 +28674,7 @@ var NorthBlackLogo = function () {
28649
28674
 
28650
28675
  const Container$z = styled.div`
28651
28676
  display: block;
28677
+ min-height: 46px;
28652
28678
 
28653
28679
  .wnc-cludo-input {
28654
28680
  padding-left: 0;
@@ -30487,14 +30513,19 @@ const StyledMaxWidthContainer = styled(MaxWidthContainer)`
30487
30513
  props.$isHome ? props.theme.theme_vars.spacingSizes.extra_small : props.theme.theme_vars.spacingSizes.small};
30488
30514
  padding-bottom: ${(props) =>
30489
30515
  props.$isHome ? props.theme.theme_vars.spacingSizes.extra_small : props.theme.theme_vars.spacingSizes.small};
30516
+ padding-left: 0;
30517
+ padding-right: 0;
30518
+ margin: 0;
30490
30519
  border-bottom: ${(props) => (props.$isHome ? 'none' : '1px solid ' + props.theme.theme_vars.colours.grey + '80')};
30491
30520
  display: flex;
30492
- flex-direction: row;
30521
+ flex-direction: column;
30493
30522
  align-items: flex-start;
30494
- margin: auto;
30495
- margin-left: ${(props) => props.theme.theme_vars.spacingSizes.large};
30496
- margin-right: ${(props) => props.theme.theme_vars.spacingSizes.large};
30523
+ width: 100%;
30497
30524
  color: ${(props) => (props.$isHome ? props.theme.theme_vars.colours.white : props.theme.theme_vars.colours.black)};
30525
+
30526
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.l}) {
30527
+ flex-direction: row;
30528
+ }
30498
30529
  `;
30499
30530
 
30500
30531
  styled.span`
@@ -30503,9 +30534,13 @@ styled.span`
30503
30534
  `;
30504
30535
 
30505
30536
  const PhaseContentContainer = styled.div`
30506
- margin: 0 0 0 ${(props) => props.theme.theme_vars.spacingSizes.medium};
30537
+ margin: 0;
30507
30538
  padding: 0;
30508
30539
 
30540
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.l}) {
30541
+ margin: 0 0 0 ${(props) => props.theme.theme_vars.spacingSizes.medium};
30542
+ }
30543
+
30509
30544
  a {
30510
30545
  color: ${(props) =>
30511
30546
  props.$isHome ? props.theme.theme_vars.colours.white : props.theme.theme_vars.colours.black} !important;
@@ -30534,7 +30569,6 @@ const PhaseContentContainer = styled.div`
30534
30569
  margin-bottom: auto;
30535
30570
  padding-top: ${(props) => props.theme.theme_vars.spacingSizes.small};
30536
30571
  padding-bottom: ${(props) => `calc(${props.theme.theme_vars.spacingSizes.small} - 3px)`};
30537
- padding-left: ${(props) => props.theme.theme_vars.spacingSizes.medium};
30538
30572
  }
30539
30573
  `;
30540
30574
 
@@ -32487,50 +32521,47 @@ var ServicesLinksList = function (_a) {
32487
32521
  };
32488
32522
 
32489
32523
  const Container$9 = styled.div`
32490
- ${props => props.theme.fontStyles}
32491
- max-width: 500px;
32492
- border-radius: ${props => props.theme.theme_vars.border_radius};
32493
- padding: 20px;
32494
- background-color: ${props => props.theme.theme_vars.colours.grey_light};
32495
-
32496
-
32497
- p:first-of-type {
32498
- margin-top: 0;
32499
- margin-bottom: 15px;
32500
- }
32501
- p:last-of-type {
32502
- margin-bottom: 0 !important;
32503
- }
32524
+ ${(props) => props.theme.fontStyles}
32525
+ max-width: 500px;
32526
+ border-radius: ${(props) => props.theme.theme_vars.border_radius};
32527
+ padding: 20px;
32528
+ background-color: ${(props) => props.theme.theme_vars.colours.grey_light};
32504
32529
 
32505
- width: 100%;
32506
- margin-left: -15px;
32507
- padding: 15px;
32530
+ p:first-of-type {
32531
+ margin-top: 0;
32532
+ margin-bottom: 15px;
32533
+ }
32534
+ p:last-of-type {
32535
+ margin-bottom: 0 !important;
32536
+ }
32508
32537
 
32509
- @media screen and (min-width: ${props => props.theme.theme_vars.breakpoints.s}){
32510
- margin-left: 0;
32511
- padding: 20px;
32512
- max-width: calc(100% - 40px);
32513
- }
32514
- `;
32515
- const Paragraph = styled.p`
32538
+ width: 100%;
32539
+ margin-left: -15px;
32540
+ padding: 15px;
32516
32541
 
32542
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.s}) {
32543
+ margin-left: 0;
32544
+ padding: 20px;
32545
+ max-width: calc(100% - 40px);
32546
+ }
32517
32547
  `;
32548
+ const Paragraph = styled.p``;
32518
32549
  const LastParagraph = styled.p`
32519
- margin-top: 25px;
32520
- margin-bottom: 0;
32550
+ margin-top: 25px;
32551
+ margin-bottom: 0;
32521
32552
  `;
32522
32553
 
32523
32554
  const SingleButtonContainer = styled.div`
32555
+ svg {
32556
+ fill: ${(props) => props.theme.theme_vars.colours.white};
32557
+ margin-right: 5px;
32558
+ vertical-align: bottom;
32559
+ }
32560
+ &:focus-within {
32524
32561
  svg {
32525
- fill: ${props => props.theme.theme_vars.colours.white};
32526
- margin-right: 5px;
32527
- vertical-align: bottom;
32528
- }
32529
- &:focus-within {
32530
- svg {
32531
- fill: ${props => props.theme.theme_vars.colours.black};
32532
- }
32562
+ fill: ${(props) => props.theme.theme_vars.colours.black};
32533
32563
  }
32564
+ }
32534
32565
  `;
32535
32566
 
32536
32567
  const Container$8 = styled.div`
@@ -32678,21 +32709,22 @@ var HintText = function (_a) {
32678
32709
  * The functionality for searching for a postcode
32679
32710
  */
32680
32711
  var PostCodeSearch = function (_a) {
32681
- var _b = _a.title, title = _b === void 0 ? 'Enter your postcode to find your area' : _b, _c = _a.formError, formError = _c === void 0 ? false : _c, otherCouncilLink = _a.otherCouncilLink; _a.signPostLinks; var _d = _a.isUnitary, isUnitary = _d === void 0 ? false : _d;
32712
+ var _b = _a.title, title = _b === void 0 ? 'Enter your postcode to find your area' : _b, _c = _a.formError, formError = _c === void 0 ? false : _c, otherCouncilLink = _a.otherCouncilLink; _a.signPostLinks; var _d = _a.isUnitary, isUnitary = _d === void 0 ? false : _d, _e = _a.sovereignType, sovereignType = _e === void 0 ? 'sovereigns' : _e;
32682
32713
  var themeContext = useContext(ThemeContext);
32683
- var _e = useState(false), open = _e[0], setOpen = _e[1];
32684
- var _f = useState(false), isLoading = _f[0], setIsLoading = _f[1];
32685
- var _g = useState(formError), isError = _g[0], setisError = _g[1];
32686
- var _h = useState(''), errorText = _h[0], setErrorText = _h[1];
32687
- var _j = useState(''), currentPostcode = _j[0], setCurrentPostcode = _j[1];
32688
- var _k = useState(false), isMultiple = _k[0], setIsMultiple = _k[1];
32689
- var _l = useState([]), addressOptions = _l[0], setAddressOptions = _l[1];
32714
+ var _f = useState(false), open = _f[0], setOpen = _f[1];
32715
+ var _g = useState(false), isLoading = _g[0], setIsLoading = _g[1];
32716
+ var _h = useState(formError), isError = _h[0], setisError = _h[1];
32717
+ var _j = useState(''), errorText = _j[0], setErrorText = _j[1];
32718
+ var _k = useState(''), currentPostcode = _k[0], setCurrentPostcode = _k[1];
32719
+ var _l = useState(false), isMultiple = _l[0], setIsMultiple = _l[1];
32720
+ var _m = useState([]), addressOptions = _m[0], setAddressOptions = _m[1];
32690
32721
  var defaultArray = {
32691
32722
  sovereigns: [],
32723
+ wasteSovereigns: [],
32692
32724
  unitaries: [],
32693
32725
  addresses: [],
32694
32726
  };
32695
- var _m = useState(defaultArray), responseData = _m[0], setResponseData = _m[1];
32727
+ var _o = useState(defaultArray), responseData = _o[0], setResponseData = _o[1];
32696
32728
  var clearData = function () {
32697
32729
  setResponseData(defaultArray);
32698
32730
  setCurrentPostcode('');
@@ -32740,11 +32772,11 @@ var PostCodeSearch = function (_a) {
32740
32772
  };
32741
32773
  useEffect(function () {
32742
32774
  var _a, _b;
32743
- if (((_a = responseData.unitaries) === null || _a === void 0 ? void 0 : _a.length) > 0) {
32775
+ if (((_a = responseData[sovereignType]) === null || _a === void 0 ? void 0 : _a.length) > 0) {
32744
32776
  if (isError) {
32745
32777
  handleError(false, '');
32746
32778
  }
32747
- if (((_b = responseData.unitaries) === null || _b === void 0 ? void 0 : _b.length) > 1) {
32779
+ if (((_b = responseData[sovereignType]) === null || _b === void 0 ? void 0 : _b.length) > 1) {
32748
32780
  setIsMultiple(true);
32749
32781
  responseData.addresses.map(function (address) {
32750
32782
  setAddressOptions(function (addressOptions) { return __spreadArray(__spreadArray([], addressOptions, true), [
@@ -32766,6 +32798,11 @@ var PostCodeSearch = function (_a) {
32766
32798
  name: address.sovereign,
32767
32799
  },
32768
32800
  ],
32801
+ wasteSovereigns: [
32802
+ {
32803
+ name: address.wastesovereign,
32804
+ },
32805
+ ],
32769
32806
  unitaries: [
32770
32807
  {
32771
32808
  name: address.unitary,
@@ -32802,7 +32839,7 @@ var PostCodeSearch = function (_a) {
32802
32839
  React.createElement(FormContainer, { "$isLoading": isLoading },
32803
32840
  React.createElement(Label$2, { htmlFor: "postcode" },
32804
32841
  "Enter your postcode",
32805
- React.createElement(HintText, { text: themeContext.cardinal_name === 'north' ? 'For example NN16 0AP' : 'For example NN1 1DE' }),
32842
+ React.createElement(HintText, { text: themeContext.cardinal_name === 'north' ? 'For example NN16 0AP' : 'For example NN1 1ED' }),
32806
32843
  React.createElement(Input, { type: "text", placeholder: "Enter a postcode", name: "postcode", errorText: errorText, isErrored: isError, maxLength: 10 })),
32807
32844
  React.createElement(FormButton, { type: "submit", "aria-label": "Submit", text: "Find" })))) : (React.createElement(PostcodeResult, null,
32808
32845
  React.createElement(Line, null),
@@ -32820,7 +32857,7 @@ var PostCodeSearch = function (_a) {
32820
32857
  React.createElement("strong", null, responseData.unitaries[0].name),
32821
32858
  ", in the",
32822
32859
  ' ',
32823
- React.createElement("strong", null, responseData.sovereigns[0].name),
32860
+ React.createElement("strong", null, responseData[sovereignType][0].name),
32824
32861
  " area."),
32825
32862
  themeContext.theme_vars.cardinal_name !== responseData.unitaries[0].name.toLowerCase() ? (React.createElement("p", null,
32826
32863
  "In order to find the right information for you, please visit the",
@@ -32831,6 +32868,8 @@ var PostCodeSearch = function (_a) {
32831
32868
  "You are on the ",
32832
32869
  React.createElement("strong", null, "correct website for this postcode"),
32833
32870
  ".")),
32871
+ React.createElement(StartAgain, { onClick: function () { return clearData(); } }, "Check another postcode"))) : !responseData[sovereignType] ? (React.createElement("div", { className: "result" },
32872
+ React.createElement("p", null, "This service is currently unavailable. We apologise for the inconvenience. Please try again later."),
32834
32873
  React.createElement(StartAgain, { onClick: function () { return clearData(); } }, "Check another postcode"))) : (React.createElement("div", { className: "result" },
32835
32874
  React.createElement("p", null,
32836
32875
  "This postcode ",
@@ -32842,7 +32881,7 @@ var PostCodeSearch = function (_a) {
32842
32881
  " Northamptonshire"),
32843
32882
  ", in the",
32844
32883
  ' ',
32845
- React.createElement("strong", null, responseData.sovereigns[0].name),
32884
+ React.createElement("strong", null, responseData[sovereignType][0].name),
32846
32885
  " area."),
32847
32886
  themeContext.theme_vars.cardinal_name !==
32848
32887
  responseData.unitaries[0].name.split(' ')[0].toLowerCase() && (React.createElement(React.Fragment, null,
@@ -32851,7 +32890,7 @@ var PostCodeSearch = function (_a) {
32851
32890
  ' ',
32852
32891
  responseData.unitaries[0].name,
32853
32892
  " Northamptonshire website and find your local area (",
32854
- responseData.sovereigns[0].name,
32893
+ responseData[sovereignType][0].name,
32855
32894
  ") for this service."),
32856
32895
  React.createElement(Button$4, { size: "large", colourOverride: themeContext.theme_vars.other_council_action, text: 'Go to ' + responseData.unitaries[0].name + " Northamptonshire's website", url: otherCouncilLink, isExternal: true }),
32857
32896
  React.createElement("br", null))),
@@ -32859,13 +32898,13 @@ var PostCodeSearch = function (_a) {
32859
32898
  };
32860
32899
 
32861
32900
  var SignpostLinks = function (_a) {
32862
- var signpostLinksArray = _a.signpostLinksArray, _b = _a.TopLineText, TopLineText = _b === void 0 ? 'Select your local area for more information:' : _b, otherCouncilLink = _a.otherCouncilLink;
32901
+ var signpostLinksArray = _a.signpostLinksArray, _b = _a.TopLineText, TopLineText = _b === void 0 ? 'Select your local area for more information:' : _b, otherCouncilLink = _a.otherCouncilLink, _c = _a.sovereignType, sovereignType = _c === void 0 ? 'sovereigns' : _c;
32863
32902
  var themeContext = useContext(ThemeContext);
32864
32903
  var councilLink = otherCouncilLink ? otherCouncilLink : themeContext.theme_vars.other_council_link;
32865
32904
  return (React.createElement(React.Fragment, null, signpostLinksArray.length > 1 ? (React.createElement(Container$9, null,
32866
32905
  React.createElement(Paragraph, null, TopLineText),
32867
32906
  React.createElement(SignpostLinksList, { signpostLinksArray: signpostLinksArray }),
32868
- React.createElement(PostCodeSearch, { otherCouncilLink: councilLink, signPostLinks: signpostLinksArray }),
32907
+ React.createElement(PostCodeSearch, { otherCouncilLink: councilLink, signPostLinks: signpostLinksArray, sovereignType: sovereignType }),
32869
32908
  (otherCouncilLink || themeContext.theme_vars.other_council_link) && (React.createElement(LastParagraph, null,
32870
32909
  "If your area isn't listed, you may be a resident of\u00A0",
32871
32910
  React.createElement(SignpostLink, { href: councilLink, title: themeContext.theme_vars.other_council_name + ' (this link will take you to an external website)' }, themeContext.theme_vars.other_council_name),