northants-design-system 0.4.0-alpha.3 → 0.4.0-alpha.4

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.
Files changed (152) hide show
  1. package/build/index.esm.js +201 -178
  2. package/build/index.esm.js.map +1 -1
  3. package/build/index.js +201 -178
  4. package/build/index.js.map +1 -1
  5. package/build/library/components/Button/Button.types.d.ts +5 -0
  6. package/build/library/components/Column/Column.types.d.ts +5 -0
  7. package/build/library/components/DropDownSelect/DropDownSelect.types.d.ts +5 -6
  8. package/build/library/components/FormButton/FormButton.types.d.ts +1 -1
  9. package/build/library/components/FormWithLine/FormWithLine.types.d.ts +6 -2
  10. package/build/library/components/Input/Input.types.d.ts +1 -1
  11. package/build/library/components/Map/Map.types.d.ts +5 -0
  12. package/build/library/components/Pagination/Pagination.types.d.ts +5 -0
  13. package/build/library/components/Row/Row.types.d.ts +5 -0
  14. package/build/library/directory/DirectoryServiceList/DirectoryServiceList.types.d.ts +31 -6
  15. package/build/library/pages/Home/HomePage.types.d.ts +2 -2
  16. package/build/library/pages/MemorialPage/MemorialPage.types.d.ts +2 -2
  17. package/build/library/slices/WarningText/WarningText.types.d.ts +5 -0
  18. package/build/library/structure/FullWidthContainer/FullWidthContainer.types.d.ts +5 -0
  19. package/build/library/structure/Header/Header.types.d.ts +5 -0
  20. package/build/library/structure/MaxWidthContainer/MaxWidthContainer.types.d.ts +5 -0
  21. package/build/library/structure/PageMain/PageMain.types.d.ts +5 -0
  22. package/build/library/structure/PageTitle/PageTitle.types.d.ts +5 -0
  23. package/build/library/structure/Summary/Summary.types.d.ts +5 -0
  24. package/package.json +23 -22
  25. package/build/icons/flytip.svg +0 -24
  26. package/build/index.css +0 -36
  27. package/build/library/components/CheckboxesInput/CheckboxesInput.d.ts +0 -4
  28. package/build/library/components/CheckboxesInput/CheckboxesInput.storydata.d.ts +0 -3
  29. package/build/library/components/CheckboxesInput/CheckboxesInput.types.d.ts +0 -37
  30. package/build/library/components/CouncilTaxAlphabeticalDirectory/CouncilTaxAlphabeticalDirectory.d.ts +0 -4
  31. package/build/library/components/GoogleMap/GoogleMap.d.ts +0 -4
  32. package/build/library/components/GoogleMap/GoogleMap.types.d.ts +0 -11
  33. package/build/library/components/GoogleMapMarker/GoogleMapMarker.d.ts +0 -4
  34. package/build/library/components/MapMarker/MapMarker.types.d.ts +0 -6
  35. package/build/library/components/PostCodeSearchApollo/PostCodeSearchApollo.d.ts +0 -4
  36. package/build/library/components/PostCodeSearchApollo/PostCodeSearchApollo.types.d.ts +0 -6
  37. package/build/library/components/icons/services/AccessibleParkingHover/Icon.d.ts +0 -4
  38. package/build/library/components/icons/services/AddressChangeIcon/Icon.d.ts +0 -4
  39. package/build/library/components/icons/services/AddressChangeIconHover/Icon.d.ts +0 -4
  40. package/build/library/components/icons/services/AddressIcon/Icon.d.ts +0 -4
  41. package/build/library/components/icons/services/AddressIconHover/Icon.d.ts +0 -4
  42. package/build/library/components/icons/services/AdultsIcon/Icon.d.ts +0 -4
  43. package/build/library/components/icons/services/AdultsIcon/IconHover.d.ts +0 -4
  44. package/build/library/components/icons/services/AdultsIconHover/Icon.d.ts +0 -4
  45. package/build/library/components/icons/services/BenefitsIcon/Icon.d.ts +0 -4
  46. package/build/library/components/icons/services/BenefitsIconHover/Icon.d.ts +0 -4
  47. package/build/library/components/icons/services/BinDayHover/Icon.d.ts +0 -4
  48. package/build/library/components/icons/services/BinsIcon/Icon.d.ts +0 -4
  49. package/build/library/components/icons/services/BinsIconHover/Icon.d.ts +0 -4
  50. package/build/library/components/icons/services/BirthsIcon/Icon.d.ts +0 -4
  51. package/build/library/components/icons/services/BirthsIconHover/Icon.d.ts +0 -4
  52. package/build/library/components/icons/services/BollardHover/Icon.d.ts +0 -4
  53. package/build/library/components/icons/services/BusIcon/Icon.d.ts +0 -4
  54. package/build/library/components/icons/services/BusIconHover/Icon.d.ts +0 -4
  55. package/build/library/components/icons/services/BusPassHover/Icon.d.ts +0 -4
  56. package/build/library/components/icons/services/BusinessIcon/Icon.d.ts +0 -4
  57. package/build/library/components/icons/services/BusinessIconHover/Icon.d.ts +0 -4
  58. package/build/library/components/icons/services/CareersIcon/Icon.d.ts +0 -4
  59. package/build/library/components/icons/services/CareersIconHover/Icon.d.ts +0 -4
  60. package/build/library/components/icons/services/CashIcon/Icon.d.ts +0 -4
  61. package/build/library/components/icons/services/CashIconHover/Icon.d.ts +0 -4
  62. package/build/library/components/icons/services/CharityHover/Icon.d.ts +0 -4
  63. package/build/library/components/icons/services/ChildrenIcon/Icon.d.ts +0 -4
  64. package/build/library/components/icons/services/ChildrenIconHover/Icon.d.ts +0 -4
  65. package/build/library/components/icons/services/CondolenceBookIcon/Icon.d.ts +0 -4
  66. package/build/library/components/icons/services/CondolenceBookIconHover/Icon.d.ts +0 -4
  67. package/build/library/components/icons/services/CookingIcon/Icon.d.ts +0 -4
  68. package/build/library/components/icons/services/CookingIconHover/Icon.d.ts +0 -4
  69. package/build/library/components/icons/services/CouncilIcon/Icon.d.ts +0 -4
  70. package/build/library/components/icons/services/CouncilIconHover/Icon.d.ts +0 -4
  71. package/build/library/components/icons/services/CouncilTaxIcon/Icon.d.ts +0 -4
  72. package/build/library/components/icons/services/CouncilTaxIconHover/Icon.d.ts +0 -4
  73. package/build/library/components/icons/services/CovidIcon/Icon.d.ts +0 -4
  74. package/build/library/components/icons/services/CovidIconHover/Icon.d.ts +0 -4
  75. package/build/library/components/icons/services/CultureIcon/Icon.d.ts +0 -4
  76. package/build/library/components/icons/services/CultureIconHover/Icon.d.ts +0 -4
  77. package/build/library/components/icons/services/CultureNorthIcon/Icon.d.ts +0 -4
  78. package/build/library/components/icons/services/CultureNorthIconHover/Icon.d.ts +0 -4
  79. package/build/library/components/icons/services/CultureWestIcon/Icon.d.ts +0 -4
  80. package/build/library/components/icons/services/CultureWestIconHover/Icon.d.ts +0 -4
  81. package/build/library/components/icons/services/DOLSIcon/Icon.d.ts +0 -4
  82. package/build/library/components/icons/services/DOLSIconHover/Icon.d.ts +0 -4
  83. package/build/library/components/icons/services/DemocracyIcon/Icon.d.ts +0 -4
  84. package/build/library/components/icons/services/DemocracyIconHover/Icon.d.ts +0 -4
  85. package/build/library/components/icons/services/EditIcon/Icon.d.ts +0 -4
  86. package/build/library/components/icons/services/EditIconHover/Icon.d.ts +0 -4
  87. package/build/library/components/icons/services/EnvironmentIcon/Icon.d.ts +0 -4
  88. package/build/library/components/icons/services/EnvironmentIconHover/Icon.d.ts +0 -4
  89. package/build/library/components/icons/services/FinanceIcon/Icon.d.ts +0 -4
  90. package/build/library/components/icons/services/FinanceIconHover/Icon.d.ts +0 -4
  91. package/build/library/components/icons/services/FlowerHover/Icon.d.ts +0 -4
  92. package/build/library/components/icons/services/FlyTipHover/Icon.d.ts +0 -4
  93. package/build/library/components/icons/services/FoodWasteHover/Icon.d.ts +0 -4
  94. package/build/library/components/icons/services/GovUKIcon/Icon.d.ts +0 -4
  95. package/build/library/components/icons/services/GovUKIconHover/Icon.d.ts +0 -4
  96. package/build/library/components/icons/services/HighwayHover/Icon.d.ts +0 -4
  97. package/build/library/components/icons/services/HouseMoneyIcon/Icon.d.ts +0 -4
  98. package/build/library/components/icons/services/HouseMoneyIconHover/Icon.d.ts +0 -4
  99. package/build/library/components/icons/services/HousingIcon/Icon.d.ts +0 -4
  100. package/build/library/components/icons/services/HousingIconHover/Icon.d.ts +0 -4
  101. package/build/library/components/icons/services/IndependenceIcon/Icon.d.ts +0 -4
  102. package/build/library/components/icons/services/IndependenceIconHover/Icon.d.ts +0 -4
  103. package/build/library/components/icons/services/LibrariesIcon/Icon.d.ts +0 -4
  104. package/build/library/components/icons/services/LibrariesIconHover/Icon.d.ts +0 -4
  105. package/build/library/components/icons/services/MapPinHover/Icon.d.ts +0 -4
  106. package/build/library/components/icons/services/MissedBinHover/Icon.d.ts +0 -4
  107. package/build/library/components/icons/services/NewIcon/Icon.d.ts +0 -4
  108. package/build/library/components/icons/services/NewIconHover/Icon.d.ts +0 -4
  109. package/build/library/components/icons/services/OccupationalTherapyIcon/Icon.d.ts +0 -4
  110. package/build/library/components/icons/services/OccupationalTherapyIconHover/Icon.d.ts +0 -4
  111. package/build/library/components/icons/services/ParkEventHover/Icon.d.ts +0 -4
  112. package/build/library/components/icons/services/ParkingHover/Icon.d.ts +0 -4
  113. package/build/library/components/icons/services/ParkingTicketHover/Icon.d.ts +0 -4
  114. package/build/library/components/icons/services/PayIcon/Icon.d.ts +0 -4
  115. package/build/library/components/icons/services/PayIconHover/Icon.d.ts +0 -4
  116. package/build/library/components/icons/services/PhonePayIcon/Icon.d.ts +0 -4
  117. package/build/library/components/icons/services/PhonePayIconHover/Icon.d.ts +0 -4
  118. package/build/library/components/icons/services/PlanningIcon/Icon.d.ts +0 -4
  119. package/build/library/components/icons/services/PlanningIconHover/Icon.d.ts +0 -4
  120. package/build/library/components/icons/services/PotholeHover/Icon.d.ts +0 -4
  121. package/build/library/components/icons/services/ProtectIcon/Icon.d.ts +0 -4
  122. package/build/library/components/icons/services/ProtectIconHover/Icon.d.ts +0 -4
  123. package/build/library/components/icons/services/RatePayIcon/Icon.d.ts +0 -4
  124. package/build/library/components/icons/services/RatePayIconHover/Icon.d.ts +0 -4
  125. package/build/library/components/icons/services/ReportHover/Icon.d.ts +0 -4
  126. package/build/library/components/icons/services/RestrictIcon/Icon.d.ts +0 -4
  127. package/build/library/components/icons/services/RestrictIconHover/Icon.d.ts +0 -4
  128. package/build/library/components/icons/services/RoadWorksHover/Icon.d.ts +0 -4
  129. package/build/library/components/icons/services/RoadsIcon/Icon.d.ts +0 -4
  130. package/build/library/components/icons/services/RoadsIconHover/Icon.d.ts +0 -4
  131. package/build/library/components/icons/services/RoyalWebsiteIcon/Icon.d.ts +0 -4
  132. package/build/library/components/icons/services/RoyalWebsiteIconHover/Icon.d.ts +0 -4
  133. package/build/library/components/icons/services/SafetyIcon/Icon.d.ts +0 -4
  134. package/build/library/components/icons/services/SafetyIconHover/Icon.d.ts +0 -4
  135. package/build/library/components/icons/services/SchoolsIcon/Icon.d.ts +0 -4
  136. package/build/library/components/icons/services/SchoolsIconHover/Icon.d.ts +0 -4
  137. package/build/library/components/icons/services/SinglePersonIcon/Icon.d.ts +0 -4
  138. package/build/library/components/icons/services/SinglePersonIconHover/Icon.d.ts +0 -4
  139. package/build/library/components/icons/services/SportsIcon/Icon.d.ts +0 -4
  140. package/build/library/components/icons/services/SportsIconHover/Icon.d.ts +0 -4
  141. package/build/library/components/icons/services/ValuationIcon/Icon.d.ts +0 -4
  142. package/build/library/components/icons/services/ValuationIconHover/Icon.d.ts +0 -4
  143. package/build/library/components/icons/services/WasteChecklistHover/Icon.d.ts +0 -4
  144. package/build/library/components/icons/services/WasteSortingHover/Icon.d.ts +0 -4
  145. package/build/library/contexts/DirectoryFavouritesProvider/DirectoryFavouritesProvider.d.ts +0 -4
  146. package/build/library/contexts/DirectoryFavouritesProvider/DirectoryFavouritesProvider.types.d.ts +0 -14
  147. package/build/library/pages/PromotionPage/PromotionPageExample.d.ts +0 -3
  148. package/build/library/pages/PromotionPage/PromotionPageExample.storydata.d.ts +0 -20
  149. package/build/library/pages/PromotionPage/PromotionPageExample.types.d.ts +0 -42
  150. package/build/library/structure/HomeUnitarySection/HomeUnitarySection.d.ts +0 -4
  151. package/build/library/structure/HomeUnitarySection/HomeUnitarySection.types.d.ts +0 -22
  152. package/build/library/structure/HomeUnitarySection/assets/map.d.ts +0 -3
@@ -6595,7 +6595,7 @@ var Uri = Uri$1.exports;
6595
6595
  };
6596
6596
 
6597
6597
  var Pagination = function (_a) {
6598
- var currentPage = _a.currentPage, totalResults = _a.totalResults, resultsPerPage = _a.resultsPerPage, _b = _a.postTo, postTo = _b === void 0 ? 'search' : _b;
6598
+ var currentPage = _a.currentPage, totalResults = _a.totalResults, resultsPerPage = _a.resultsPerPage, _b = _a.postTo, postTo = _b === void 0 ? 'search' : _b, buttonClickOverride = _a.buttonClickOverride;
6599
6599
  // given current page number and max page number, return list of numbers to display with ... to reduce range visible
6600
6600
  var pagination = function (currentPage, maxPage) {
6601
6601
  var current = currentPage;
@@ -6638,13 +6638,18 @@ var Pagination = function (_a) {
6638
6638
  }
6639
6639
  var numbers = pagination(currentPage, numberOfNumbers);
6640
6640
  var buttonClick = function (pageNo) {
6641
- handleParams(postTo, [{ key: 'page', value: pageNo }]);
6641
+ if (buttonClickOverride) {
6642
+ buttonClickOverride(pageNo);
6643
+ }
6644
+ else {
6645
+ handleParams(postTo, [{ key: 'page', value: pageNo }]);
6646
+ }
6642
6647
  };
6643
6648
  if (numbers.length > 1) {
6644
6649
  return (React.createElement(Container$10, { "data-testid": "Pagination", role: "navigation", "aria-label": "Pagination" },
6645
6650
  currentPage > 1 && (React.createElement(Previous, { onClick: function () { return buttonClick(currentPage - 1); }, title: "Go back a page" }, "Previous")),
6646
6651
  React.createElement(NumbersContainer, null, numbers.map(function (v, i) { return (React.createElement(NumberContainer, { key: i },
6647
- v === '...' && (React.createElement(Ellipsis, null, "...")),
6652
+ v === '...' && React.createElement(Ellipsis, null, "..."),
6648
6653
  v !== '...' && (React.createElement(Number$1, { onClick: function () { return buttonClick(v); }, isCurrent: currentPage === v, title: currentPage === v ? 'This is the current page' : 'Go to page ' + v },
6649
6654
  React.createElement(VisuallyHidden$1, null, "Page "),
6650
6655
  v)))); })),
@@ -20139,6 +20144,9 @@ function sanitizeHtml(html, options, _recursing) {
20139
20144
  if (html == null) {
20140
20145
  return '';
20141
20146
  }
20147
+ if (typeof html === 'number') {
20148
+ html = html.toString();
20149
+ }
20142
20150
 
20143
20151
  let result = '';
20144
20152
  // Used for hot swapping the result variable with an empty string in order to "capture" the text written to it.
@@ -20895,6 +20903,8 @@ sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge) {
20895
20903
  };
20896
20904
  };
20897
20905
 
20906
+ var sanitizeHtml$1 = sanitizeHtml_1;
20907
+
20898
20908
  /**
20899
20909
  * A card component with header, footer and content
20900
20910
  */
@@ -20907,7 +20917,7 @@ var Card = function (_a) {
20907
20917
  showContent && (React.createElement(Content$4, null,
20908
20918
  header && (React.createElement(Header$1, null,
20909
20919
  React.createElement(Heading, { text: header, level: 3 }))),
20910
- React.createElement("div", { dangerouslySetInnerHTML: { __html: sanitizeHtml_1(content) } }))),
20920
+ React.createElement("div", { dangerouslySetInnerHTML: { __html: sanitizeHtml$1(content) } }))),
20911
20921
  footerLink && (React.createElement(Footer$1, null,
20912
20922
  React.createElement(FooterLink$1, { href: footerLink.url }, footerLink.title)))));
20913
20923
  };
@@ -21257,7 +21267,7 @@ var GoogleMap = function (_a) {
21257
21267
  React.createElement(ProtectiveContainer, null,
21258
21268
  title && React.createElement(Heading, { level: 3, text: title }),
21259
21269
  description && (React.createElement(MapDescription, { dangerouslySetInnerHTML: {
21260
- __html: sanitizeHtml_1(description),
21270
+ __html: sanitizeHtml$1(description),
21261
21271
  } })),
21262
21272
  (!link_url || !embed_url) && (React.createElement(AlertBannerService, { alertType: 'warning', title: 'Invalid map' },
21263
21273
  "Embedded map contains invalid ",
@@ -21956,8 +21966,8 @@ var ImageAndText = function (_a) {
21956
21966
  React.createElement(Column, { small: "full", medium: "one-third", large: "one-third" },
21957
21967
  React.createElement(Image$2, __assign$2({}, image))),
21958
21968
  React.createElement(Column, { small: "full", medium: "two-thirds", large: "two-thirds" },
21959
- React.createElement(Content$3, { dangerouslySetInnerHTML: { __html: sanitizeHtml_1(textContent) } })))) : (React.createElement(Column, { small: "full", medium: "full", large: "full" },
21960
- React.createElement(Content$3, { dangerouslySetInnerHTML: { __html: sanitizeHtml_1(textContent) } }))))));
21969
+ React.createElement(Content$3, { dangerouslySetInnerHTML: { __html: sanitizeHtml$1(textContent) } })))) : (React.createElement(Column, { small: "full", medium: "full", large: "full" },
21970
+ React.createElement(Content$3, { dangerouslySetInnerHTML: { __html: sanitizeHtml$1(textContent) } }))))));
21961
21971
  };
21962
21972
 
21963
21973
  const Container$F = styled.div`
@@ -22231,7 +22241,7 @@ var PromoBlock = function (_a) {
22231
22241
  React.createElement(PromoText, null,
22232
22242
  React.createElement(PromoHeadline, { level: 3, text: promo.title }),
22233
22243
  React.createElement(PromoContent, { dangerouslySetInnerHTML: {
22234
- __html: sanitizeHtml_1(promo.content),
22244
+ __html: sanitizeHtml$1(promo.content),
22235
22245
  } }),
22236
22246
  React.createElement(PromoCallToAction, null, promo.callToActionText))))); }),
22237
22247
  promos.length === 1 && React.createElement(Column, { small: "full", medium: "one-half", large: "one-half" }))))));
@@ -22246,7 +22256,7 @@ var Promotions = function (_a) {
22246
22256
  return (React.createElement(React.Fragment, null,
22247
22257
  numberOfPromos > 0 && (React.createElement(PromoBanner, { title: promos[0].title, ctaUrl: promos[0].callToActionURL, ctaText: promos[0].callToActionText, image1440x810: promos[0].imageMedium, image144x81: promos[0].imageMedium },
22248
22258
  React.createElement(PromoContent, { dangerouslySetInnerHTML: {
22249
- __html: sanitizeHtml_1(promos[0].content),
22259
+ __html: sanitizeHtml$1(promos[0].content),
22250
22260
  } }))),
22251
22261
  numberOfPromos > 1 && React.createElement(PromoBlock, { promos: promos.slice(1, numberOfPromos) })));
22252
22262
  };
@@ -24208,7 +24218,7 @@ var HeroImage = function (_a) {
24208
24218
  React.createElement(Overlay, { backgroundBox: backgroundBox, "data-testid": "HeroImageOverlay" },
24209
24219
  breadcrumb && (React.createElement(BreadcrumbLink, { href: breadcrumb.url, backgroundBox: backgroundBox }, breadcrumb.title)),
24210
24220
  headline && React.createElement(Headline, { level: 1, text: headline, backgroundBox: backgroundBox }),
24211
- content && React.createElement(Content, { dangerouslySetInnerHTML: { __html: sanitizeHtml_1(content) } }),
24221
+ content && React.createElement(Content, { dangerouslySetInnerHTML: { __html: sanitizeHtml$1(content) } }),
24212
24222
  customSearch && (React.createElement(Search, null,
24213
24223
  React.createElement(CustomSearch, __assign$2({}, customSearch)))),
24214
24224
  callToActionURL && backgroundBox && (React.createElement(CallToAction, { url: callToActionURL, text: callToActionText, primary: callToActionIsPrimary })),
@@ -32993,7 +33003,7 @@ const StartAgain = styled.button`
32993
33003
  }
32994
33004
  `;
32995
33005
 
32996
- const LoadingContainer = styled.div`
33006
+ const LoadingContainer$1 = styled.div`
32997
33007
  padding-left: 30px;
32998
33008
  `;
32999
33009
 
@@ -33225,7 +33235,7 @@ var PostCodeSearch = function (_a) {
33225
33235
  open && (React.createElement(DropDownContent, null, responseData.unitaries.length === 0 ? (React.createElement(FormWithLine, { onSubmit: function (e) {
33226
33236
  handleSubmit(e);
33227
33237
  }, isError: isError, lineColour: themeContext.theme_vars.colours.grey_dark },
33228
- isLoading && (React.createElement(LoadingContainer, null,
33238
+ isLoading && (React.createElement(LoadingContainer$1, null,
33229
33239
  React.createElement(LoadingSpinner, null),
33230
33240
  React.createElement("p", null, "Loading..."))),
33231
33241
  React.createElement(FormContainer, { isLoading: isLoading },
@@ -34291,7 +34301,7 @@ var SummaryList = function (_a) {
34291
34301
  var terms = _a.terms, _b = _a.hasMargin, hasMargin = _b === void 0 ? true : _b;
34292
34302
  return (React.createElement(SummaryList$1, { "data-testid": "SummaryList", hasMargin: hasMargin }, terms.map(function (summaryRow, summaryIndex) { return (React.createElement(SummaryRow, { key: summaryIndex },
34293
34303
  React.createElement(SummaryTerm, null, summaryRow.term),
34294
- React.createElement(SummaryDetail, { dangerouslySetInnerHTML: { __html: sanitizeHtml_1(summaryRow.detail) } }))); })));
34304
+ React.createElement(SummaryDetail, { dangerouslySetInnerHTML: { __html: sanitizeHtml$1(summaryRow.detail) } }))); })));
34295
34305
  };
34296
34306
 
34297
34307
  var ServiceContact = function (_a) {
@@ -34388,15 +34398,19 @@ var DirectoryMap = function (_a) {
34388
34398
  };
34389
34399
  return (React.createElement(Container$2, { "data-testid": "DirectoryMap" }, cookiesAccepted ? (React.createElement(React.Fragment, null,
34390
34400
  React.createElement(Wrapper$5, { apiKey: apiKey },
34391
- React.createElement(Map$1, { center: center, zoom: (_c = mapProps.zoom) !== null && _c !== void 0 ? _c : 14 }, mapProps.mapMarkers.map(function (marker) {
34401
+ React.createElement(Map$1, { center: center, zoom: (_c = mapProps.zoom) !== null && _c !== void 0 ? _c : 14 }, mapProps.mapMarkers.map(function (marker, index) {
34392
34402
  var _a;
34393
- return (React.createElement(MapMarker, { position: { lat: marker.lat, lng: marker.lng }, label: marker.label, title: (_a = marker.title) !== null && _a !== void 0 ? _a : '' }));
34403
+ return (React.createElement(MapMarker, { position: { lat: marker.lat, lng: marker.lng }, label: marker.label, title: (_a = marker.title) !== null && _a !== void 0 ? _a : '', key: index }));
34394
34404
  }))))) : (React.createElement(StaticMap, __assign$2({}, mapProps)))));
34395
34405
  };
34396
34406
 
34397
34407
  var DirectoryService = function (_a) {
34398
34408
  var name = _a.name, accreditations = _a.accreditations, descriptionElement = _a.descriptionElement, email = _a.email, fees = _a.fees, languages = _a.languages, regular_schedules = _a.regular_schedules, contacts = _a.contacts, service_areas = _a.service_areas, service_at_locations = _a.service_at_locations, url = _a.url;
34399
34409
  var labelLetters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'];
34410
+ var _b = useState(false), notServer = _b[0], setNotServer = _b[1];
34411
+ useEffect(function () {
34412
+ setNotServer(true);
34413
+ }, []);
34400
34414
  return (React.createElement(Container$4, { "data-testid": "DirectoryService" },
34401
34415
  React.createElement(Row$1, null,
34402
34416
  React.createElement(Column, { small: "full", medium: "full", large: "full" },
@@ -34414,7 +34428,7 @@ var DirectoryService = function (_a) {
34414
34428
  React.createElement(Heading, { level: 3, text: "Facilities" }),
34415
34429
  React.createElement("ul", null, location.accessibility_for_disabilities.map(function (accessibility) { return (React.createElement("li", { key: accessibility.id }, accessibility.accessibility)); }))))),
34416
34430
  React.createElement(Column, { small: "full", medium: "full", large: "one-half" },
34417
- React.createElement(DirectoryMap, { mapProps: {
34431
+ notServer && (React.createElement(DirectoryMap, { mapProps: {
34418
34432
  centre: "".concat(location.latitude, ",").concat(location.longitude),
34419
34433
  imageAltText: "".concat(location.name, " shown on a map"),
34420
34434
  zoom: 14,
@@ -34427,7 +34441,7 @@ var DirectoryService = function (_a) {
34427
34441
  title: location.name,
34428
34442
  },
34429
34443
  ],
34430
- } }),
34444
+ } })),
34431
34445
  React.createElement(MapLink, { href: "https://www.google.com/maps/search/?api=1&query=".concat(location.latitude, "%2C").concat(location.longitude) }, "View in Google Maps")))); }))),
34432
34446
  React.createElement(Column, { small: "full", medium: "full", large: "full" },
34433
34447
  React.createElement(Heading, { level: 2, text: "About this service" }),
@@ -34541,6 +34555,38 @@ styled.span`
34541
34555
  word-wrap: break-word;
34542
34556
  `;
34543
34557
 
34558
+ const FilterContainer = styled.div`
34559
+ display: ${(props) => (props.showFilters ? 'flex' : 'none')};
34560
+
34561
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
34562
+ display: flex;
34563
+ }
34564
+ `;
34565
+
34566
+ const FilterToggle = styled.button`
34567
+ cursor: pointer;
34568
+ width: 100%;
34569
+ border: none;
34570
+ background: none;
34571
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
34572
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
34573
+ ${(props) => props.theme.theme_vars.h4}
34574
+ ${(props) => props.theme.linkStyles}
34575
+ &:hover {
34576
+ ${(props) => props.theme.linkStylesHover}
34577
+ }
34578
+ &:focus {
34579
+ ${(props) => props.theme.linkStylesFocus}
34580
+ }
34581
+ &:active {
34582
+ ${(props) => props.theme.linkStylesActive}
34583
+ }
34584
+
34585
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
34586
+ display: none;
34587
+ }
34588
+ `;
34589
+
34544
34590
  const Fieldset = styled.fieldset`
34545
34591
  display: block;
34546
34592
  border-bottom: 1px solid ${(props) => props.theme.theme_vars.colours.grey};
@@ -34558,6 +34604,7 @@ const Legend = styled.legend`
34558
34604
  `;
34559
34605
 
34560
34606
  const LegendButton = styled.button`
34607
+ position: relative;
34561
34608
  background: none;
34562
34609
  border: none;
34563
34610
  color: ${(props) => props.theme.theme_vars.colours.action};
@@ -34708,11 +34755,44 @@ const Accordion = styled.div`
34708
34755
  display: ${(props) => (props.isOpen ? 'block' : 'none')};
34709
34756
  `;
34710
34757
 
34758
+ const FavouritesContainer = styled.div`
34759
+ display: flex;
34760
+ flex-direction: row;
34761
+ justify-content: space-between;
34762
+ align-items: center;
34763
+ padding-top: ${(props) => props.theme.theme_vars.spacingSizes.small};
34764
+ `;
34765
+
34766
+ const MapToggle = styled.button`
34767
+ margin-right: ${(props) => props.theme.theme_vars.spacingSizes.medium};
34768
+ border: 2px solid ${(props) => props.theme.theme_vars.colours.action};
34769
+ background: ${(props) => props.theme.theme_vars.colours.white};
34770
+ color: ${(props) => props.theme.theme_vars.colours.action};
34771
+ cursor: pointer;
34772
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
34773
+ font-weight: bold;
34774
+ display: flex;
34775
+ flex-direction: row;
34776
+ justify-content: flex-start;
34777
+ align-items: center;
34778
+ &:hover {
34779
+ ${(props) => props.theme.linkStylesHover}
34780
+ background: ${(props) => props.theme.theme_vars.colours.action_light}
34781
+ }
34782
+ &:focus {
34783
+ ${(props) => props.theme.linkStylesFocus}
34784
+ }
34785
+ &:active {
34786
+ ${(props) => props.theme.linkStylesActive}
34787
+ }
34788
+ `;
34789
+
34711
34790
  const Favourites = styled.a`
34712
34791
  display: flex;
34713
34792
  flex-direction: row;
34714
34793
  justify-content: flex-end;
34715
34794
  align-items: center;
34795
+ flex-grow: 1;
34716
34796
  cursor: pointer;
34717
34797
  padding: ${(props) => props.theme.theme_vars.spacingSizes.small} 0;
34718
34798
  &:hover {
@@ -34774,6 +34854,13 @@ const MarkerContainer = styled.div`
34774
34854
  }
34775
34855
  `;
34776
34856
 
34857
+ const LoadingContainer = styled.div`
34858
+ display: flex;
34859
+ justify-content: center;
34860
+ align-items: center;
34861
+ width: 100%;
34862
+ `;
34863
+
34777
34864
  var DirectoryShortListContext = createContext({});
34778
34865
  var DirectoryShortListProvider = function (_a) {
34779
34866
  var children = _a.children;
@@ -34851,15 +34938,15 @@ var DirectoryAddToShortList = function (_a) {
34851
34938
  };
34852
34939
 
34853
34940
  var DirectoryServiceList = function (_a) {
34854
- var directoryPath = _a.directoryPath, shortListPath = _a.shortListPath, services = _a.services, _b = _a.searchTerm, searchTerm = _b === void 0 ? '' : _b, _c = _a.searchPostcode, searchPostcode = _c === void 0 ? '' : _c, _d = _a.totalResults, totalResults = _d === void 0 ? 0 : _d, _e = _a.pageNumber, pageNumber = _e === void 0 ? 1 : _e, _f = _a.perPage, perPage = _f === void 0 ? 5 : _f, _g = _a.extractLength, extractLength = _g === void 0 ? 190 : _g, _h = _a.categories, categories = _h === void 0 ? [] : _h, _j = _a.searchMinimumAge, searchMinimumAge = _j === void 0 ? '' : _j, _k = _a.searchMaximumAge, searchMaximumAge = _k === void 0 ? '' : _k, _l = _a.customTaxonomyFilters, customTaxonomyFilters = _l === void 0 ? [] : _l, _m = _a.mapCenter, mapCenter = _m === void 0 ? '52.23555414368587,-0.8957390701320571' : _m, _o = _a.mapZoom, mapZoom = _o === void 0 ? 9 : _o;
34855
- var _p = useState(false), submit = _p[0], setSubmit = _p[1];
34856
- var _q = useState(searchTerm), search = _q[0], setSearch = _q[1];
34857
- var _r = useState(searchPostcode), postcode = _r[0], setPostcode = _r[1];
34858
- var _s = useState(categories), checkboxState = _s[0], setCheckboxState = _s[1];
34859
- var _t = useState(searchMinimumAge), minimumAge = _t[0], setMinimumAge = _t[1];
34860
- var _u = useState(searchMaximumAge), maximumAge = _u[0], setMaximumAge = _u[1];
34861
- var _v = useLocalStorage("".concat(directoryPath.replace(/\//g, ''), "-accordion"), []), accordions = _v[0], setAccordions = _v[1];
34862
- var _w = useDirectoryShortListContext(), _x = _w.favourites, favourites = _x.favourites; _x.setFavourites; _w.toggleFavourites; _w.isFavourite;
34941
+ var directoryPath = _a.directoryPath, shortListPath = _a.shortListPath, services = _a.services, _b = _a.search, search = _b === void 0 ? '' : _b, setSearch = _a.setSearch, _c = _a.postcode, postcode = _c === void 0 ? '' : _c, setPostcode = _a.setPostcode, _d = _a.totalResults, totalResults = _d === void 0 ? 0 : _d, _e = _a.pageNumber, pageNumber = _e === void 0 ? 1 : _e, setPageNumber = _a.setPageNumber, _f = _a.perPage, perPage = _f === void 0 ? 5 : _f, _g = _a.extractLength, extractLength = _g === void 0 ? 190 : _g, _h = _a.categories, categories = _h === void 0 ? [] : _h, setCategories = _a.setCategories, _j = _a.minimumAge, minimumAge = _j === void 0 ? '' : _j, setMinimumAge = _a.setMinimumAge, _k = _a.maximumAge, maximumAge = _k === void 0 ? '' : _k, setMaximumAge = _a.setMaximumAge, _l = _a.mapCenter, mapCenter = _l === void 0 ? '52.23555414368587,-0.8957390701320571' : _l, _m = _a.mapZoom, mapZoom = _m === void 0 ? 9 : _m, _o = _a.isLoading, isLoading = _o === void 0 ? false : _o;
34942
+ var _p = useLocalStorage("".concat(directoryPath.replace(/\//g, ''), "-accordion"), []), accordions = _p[0], setAccordions = _p[1];
34943
+ var _q = useLocalStorage("".concat(directoryPath.replace(/\//g, ''), "-show-map"), false), showMap = _q[0], setShowMap = _q[1];
34944
+ var _r = useState(false), showFilters = _r[0], setShowFilters = _r[1];
34945
+ var _s = useDirectoryShortListContext(), _t = _s.favourites, favourites = _t.favourites; _t.setFavourites; _s.toggleFavourites; _s.isFavourite;
34946
+ var _u = useState(false), notServer = _u[0], setNotServer = _u[1];
34947
+ useEffect(function () {
34948
+ setNotServer(true);
34949
+ }, []);
34863
34950
  if (accordions.length === 0) {
34864
34951
  var tempAccordions_1 = [];
34865
34952
  categories === null || categories === void 0 ? void 0 : categories.forEach(function () {
@@ -34868,84 +34955,19 @@ var DirectoryServiceList = function (_a) {
34868
34955
  tempAccordions_1.push(false);
34869
34956
  setAccordions(tempAccordions_1);
34870
34957
  }
34871
- useEffect(function () {
34872
- if (!submit)
34873
- return;
34874
- var params = [];
34875
- if (search !== '') {
34876
- params.push({
34877
- key: 'search',
34878
- value: search,
34879
- });
34880
- }
34881
- if (postcode !== '') {
34882
- params.push({
34883
- key: 'postcode',
34884
- value: postcode,
34885
- });
34886
- }
34887
- if (minimumAge && typeof minimumAge === 'number') {
34888
- params.push({
34889
- key: 'minimum_age',
34890
- value: minimumAge,
34891
- });
34892
- }
34893
- if (maximumAge && typeof maximumAge === 'number') {
34894
- params.push({
34895
- key: 'maximum_age',
34896
- value: maximumAge,
34897
- });
34898
- }
34899
- checkboxState === null || checkboxState === void 0 ? void 0 : checkboxState.forEach(function (category) {
34900
- if (customTaxonomyFilters.includes(category.vocabulary)) {
34901
- category.options.forEach(function (taxonomy) {
34902
- if (taxonomy.checked) {
34903
- params.push({
34904
- key: category.vocabulary,
34905
- value: taxonomy.id,
34906
- });
34907
- }
34908
- });
34909
- }
34910
- else {
34911
- category.options.forEach(function (taxonomy) {
34912
- if (taxonomy.checked) {
34913
- params.push({
34914
- key: 'taxonomy_id',
34915
- value: taxonomy.id,
34916
- });
34917
- }
34918
- });
34919
- }
34920
- });
34921
- setSubmit(false);
34922
- var query = params
34923
- .map(function (param) {
34924
- return "".concat(param.key, "=").concat(param.value);
34925
- })
34926
- .join('&');
34927
- window.location.href = directoryPath + '?' + query;
34928
- }, [submit]);
34929
- var handleSubmit = function (e) {
34930
- e.preventDefault();
34931
- setSearch(e.target.directorySearch.value);
34932
- setPostcode(e.target.postcode.value);
34933
- setSubmit(true);
34934
- };
34935
34958
  var optionChecked = function (e, categoryIndex, singleSelection) {
34936
- var newCheckboxState = __spreadArray([], checkboxState, true);
34959
+ var newCategories = __spreadArray([], categories, true);
34937
34960
  if (singleSelection) {
34938
- newCheckboxState[categoryIndex].options.forEach(function (option) {
34961
+ newCategories[categoryIndex].options.forEach(function (option) {
34939
34962
  option.checked = false;
34940
34963
  });
34941
34964
  }
34942
- newCheckboxState[categoryIndex].options.find(function (option) {
34965
+ newCategories[categoryIndex].options.find(function (option) {
34943
34966
  if (option.id === e.target.value) {
34944
34967
  option.checked = !option.checked;
34945
34968
  }
34946
34969
  });
34947
- setCheckboxState(newCheckboxState);
34948
- setSubmit(true);
34970
+ setCategories(newCategories);
34949
34971
  };
34950
34972
  var from = pageNumber * perPage - (perPage - 1);
34951
34973
  var to = from + ((services === null || services === void 0 ? void 0 : services.length) ? services.length - 1 : 0);
@@ -34957,8 +34979,8 @@ var DirectoryServiceList = function (_a) {
34957
34979
  updatedAccordions[index] = !updatedAccordions[index];
34958
34980
  setAccordions(updatedAccordions);
34959
34981
  };
34960
- var notServer = typeof window !== 'undefined';
34961
- var labelLetters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'];
34982
+ var letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
34983
+ var labelLetters = letters.split('');
34962
34984
  var mapProps = {
34963
34985
  centre: mapCenter,
34964
34986
  zoom: mapZoom,
@@ -34978,103 +35000,101 @@ var DirectoryServiceList = function (_a) {
34978
35000
  React.createElement(Row$1, null,
34979
35001
  React.createElement(Column, { small: "full", medium: "full", large: "full" },
34980
35002
  React.createElement(SearchHeader, null,
34981
- React.createElement(FormWithLine, { hideLine: true, onSubmit: function (e) {
34982
- handleSubmit(e);
34983
- } },
35003
+ React.createElement(FormWithLine, { hideLine: true, onSubmit: function () { } },
34984
35004
  React.createElement(Row$1, null,
34985
35005
  React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
34986
35006
  React.createElement(Label, { htmlFor: "directorySearch" }, "What are you looking for?"),
34987
35007
  React.createElement(HintText, { text: "Enter a search word or phrase" }),
34988
- React.createElement(Input, { name: "directorySearch", type: "text", defaultValue: searchTerm, placeholder: "Enter a search term", id: "directorySearch" })),
35008
+ React.createElement(Input, { name: "directorySearch", type: "text", defaultValue: search, id: "directorySearch", onChange: function (e) {
35009
+ setSearch(e.target.value);
35010
+ } })),
34989
35011
  React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
34990
35012
  React.createElement(Label, { htmlFor: "postcode" }, "Postcode"),
34991
35013
  React.createElement(HintText, { text: "Enter a postcode" }),
34992
- React.createElement(Input, { name: "postcode", type: "text", defaultValue: postcode, placeholder: "Enter a postcode", id: "postcode" })),
35014
+ React.createElement(Input, { name: "postcode", type: "text", defaultValue: postcode, id: "postcode", onChange: function (e) { return setPostcode(e.target.value); } })),
34993
35015
  React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
34994
35016
  React.createElement(ButtonContainer, null,
34995
- React.createElement(Button, null,
34996
- React.createElement(ButtonText, null, "Search"),
34997
- React.createElement(IconDownload, { colourFill: "#fff" })),
34998
35017
  React.createElement(Button, { onClick: clearSearch, type: "button" },
34999
35018
  React.createElement(ButtonText, null, "Clear"),
35000
35019
  React.createElement(IconDownload$1, { colourFill: "#fff" })))))))),
35001
35020
  React.createElement(Column, { small: "full", medium: "one-third", large: "one-third" },
35021
+ React.createElement(FilterToggle, { type: "button", onClick: function (e) { return setShowFilters(!showFilters); } }, showFilters ? "Hide Filters" : "Show Filters"),
35022
+ React.createElement(FilterContainer, { showFilters: showFilters },
35023
+ React.createElement(Row$1, null,
35024
+ React.createElement(Column, { small: "full", medium: "full", large: "full" },
35025
+ React.createElement(ResultInfo, null, "Refine your search")),
35026
+ notServer && (React.createElement(React.Fragment, null, categories === null || categories === void 0 ? void 0 :
35027
+ categories.map(function (category, categoryIndex) { return (React.createElement(Column, { small: "full", medium: "full", large: "full", key: category.label },
35028
+ React.createElement(Fieldset, null,
35029
+ React.createElement(Legend, null,
35030
+ React.createElement(LegendButton, { onClick: function (e) { return toggleAccordion(categoryIndex); }, type: "button" },
35031
+ category.label,
35032
+ React.createElement(AccordionIcon, { isOpen: accordions[categoryIndex] }))),
35033
+ React.createElement(Accordion, { isOpen: accordions[categoryIndex] }, category.options.map(function (taxonomy) { return (React.createElement(Category, { key: taxonomy.id },
35034
+ React.createElement(CategoryInput, { type: category.singleSelection ? 'radio' : 'checkbox', value: taxonomy.id, id: taxonomy.id.replace(' ', ''), name: taxonomy.vocabulary, onChange: function (e) { return optionChecked(e, categoryIndex, category.singleSelection); }, checked: taxonomy.checked }),
35035
+ React.createElement(CategoryInputLabel, { isChecked: taxonomy.checked, htmlFor: taxonomy.id.replace(' ', ''), singleSelection: category.singleSelection }, taxonomy.name))); }))))); }),
35036
+ React.createElement(Column, { small: "full", medium: "full", large: "full" },
35037
+ React.createElement(Fieldset, null,
35038
+ React.createElement(Legend, { onClick: function (e) { return toggleAccordion(categories.length); } },
35039
+ React.createElement(LegendButton, { onClick: function (e) { return toggleAccordion(categories.length); }, type: "button" },
35040
+ "Select age group (years)",
35041
+ React.createElement(AccordionIcon, { isOpen: accordions[categories.length] }))),
35042
+ React.createElement(Accordion, { isOpen: accordions[categories.length] },
35043
+ React.createElement(Row$1, null,
35044
+ React.createElement(Column, { small: "full", medium: "one-half", large: "one-half" },
35045
+ React.createElement(Label, { htmlFor: "minimum_age" }, "From"),
35046
+ React.createElement(Input, { name: "minimum_age", onChange: function (e) { var _a; return setMinimumAge((_a = e.target.value) !== null && _a !== void 0 ? _a : ''); }, defaultValue: minimumAge, id: "minimum_age" })),
35047
+ React.createElement(Column, { small: "full", medium: "one-half", large: "one-half" },
35048
+ React.createElement(Label, { htmlFor: "maximum_age" }, "To"),
35049
+ React.createElement(Input, { name: "maximum_age", onChange: function (e) { var _a; return setMaximumAge((_a = e.target.value) !== null && _a !== void 0 ? _a : ''); }, defaultValue: maximumAge, id: "maximum_age" }))))))))))),
35050
+ React.createElement(Column, { small: "full", medium: "two-thirds", large: "two-thirds" },
35002
35051
  React.createElement(Row$1, null,
35003
- React.createElement(Column, { small: "full", medium: "full", large: "full" },
35004
- React.createElement(ResultInfo, null, "Refine your search")),
35005
- notServer && (React.createElement(React.Fragment, null, checkboxState === null || checkboxState === void 0 ? void 0 :
35006
- checkboxState.map(function (category, categoryIndex) { return (React.createElement(Column, { small: "full", medium: "full", large: "full", key: category.label },
35007
- React.createElement(Fieldset, null,
35008
- React.createElement(Legend, null,
35009
- React.createElement(LegendButton, { onClick: function (e) { return toggleAccordion(categoryIndex); }, type: "button" },
35010
- category.label,
35011
- React.createElement(AccordionIcon, { isOpen: accordions[categoryIndex] }))),
35012
- React.createElement(Accordion, { isOpen: accordions[categoryIndex] }, category.options.map(function (taxonomy) { return (React.createElement(Category, { key: taxonomy.id },
35013
- React.createElement(CategoryInput, { type: category.singleSelection ? 'radio' : 'checkbox', value: taxonomy.id, id: taxonomy.id.replace(' ', ''), name: taxonomy.vocabulary, onChange: function (e) { return optionChecked(e, categoryIndex, category.singleSelection); }, checked: taxonomy.checked }),
35014
- React.createElement(CategoryInputLabel, { isChecked: taxonomy.checked, htmlFor: taxonomy.id.replace(' ', ''), singleSelection: category.singleSelection }, taxonomy.name))); }))))); }),
35052
+ isLoading ? (React.createElement(LoadingContainer, null,
35053
+ React.createElement(LoadingSpinner, null),
35054
+ React.createElement("p", null, "Loading"))) : (React.createElement(React.Fragment, null,
35015
35055
  React.createElement(Column, { small: "full", medium: "full", large: "full" },
35016
- React.createElement(Fieldset, null,
35017
- React.createElement(Legend, { onClick: function (e) { return toggleAccordion(checkboxState.length); } },
35018
- React.createElement(LegendButton, { onClick: function (e) { return toggleAccordion(checkboxState.length); }, type: "button" },
35019
- "Select age group (years)",
35020
- React.createElement(AccordionIcon, { isOpen: accordions[checkboxState.length] }))),
35021
- React.createElement(Accordion, { isOpen: accordions[checkboxState.length] },
35056
+ (services === null || services === void 0 ? void 0 : services.length) > 0 ? (React.createElement(ResultInfo, null,
35057
+ "Showing ",
35058
+ from,
35059
+ " to ",
35060
+ to,
35061
+ " out of ",
35062
+ totalResults.toLocaleString())) : (React.createElement(ResultInfo, null, "No results found")),
35063
+ React.createElement(FavouritesContainer, null,
35064
+ (services === null || services === void 0 ? void 0 : services.length) > 0 && (React.createElement(MapToggle, { type: "button", onClick: function (e) { return setShowMap(!showMap); } }, showMap ? "Hide Map" : "Show Map")),
35065
+ React.createElement(Favourites, { href: shortListPath },
35066
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", width: "15px", height: "15px" },
35067
+ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z" })),
35068
+ ' ',
35069
+ "Shortlist (",
35070
+ favourites.length,
35071
+ ")"))),
35072
+ React.createElement(Column, { small: "full", medium: "full", large: "full" }, notServer && React.createElement(React.Fragment, null, (services === null || services === void 0 ? void 0 : services.length) > 0 && showMap && React.createElement(DirectoryMap, { mapProps: mapProps }))),
35073
+ services.map(function (service, index) {
35074
+ var snippet = sanitizeHtml$1(service.description, {
35075
+ allowedTags: [],
35076
+ allowedAttributes: {},
35077
+ }).substr(0, extractLength) + String.fromCharCode(8230);
35078
+ return (React.createElement(Column, { small: "full", medium: "full", large: "full", key: service.id },
35079
+ React.createElement(ServiceContainer, { resultNumber: index },
35022
35080
  React.createElement(Row$1, null,
35023
- React.createElement(Column, { small: "full", medium: "one-half", large: "one-half" },
35024
- React.createElement(Label, { htmlFor: "minimum_age" }, "From"),
35025
- React.createElement(Input, { name: "minimum_age", onChange: function (e) { var _a; return setMinimumAge((_a = parseInt(e.target.value)) !== null && _a !== void 0 ? _a : ''); }, defaultValue: minimumAge, id: "minimum_age" })),
35026
- React.createElement(Column, { small: "full", medium: "one-half", large: "one-half" },
35027
- React.createElement(Label, { htmlFor: "maximum_age" }, "To"),
35028
- React.createElement(Input, { name: "maximum_age", onChange: function (e) { var _a; return setMaximumAge((_a = parseInt(e.target.value)) !== null && _a !== void 0 ? _a : ''); }, defaultValue: maximumAge, id: "maximum_age" })),
35029
35081
  React.createElement(Column, { small: "full", medium: "full", large: "full" },
35030
- React.createElement(Button, { onClick: function (e) { return setSubmit(true); } },
35031
- React.createElement(ButtonText, null, "Search"),
35032
- React.createElement(IconDownload, { colourFill: "#fff" }))))))))))),
35033
- React.createElement(Column, { small: "full", medium: "two-thirds", large: "two-thirds" },
35034
- React.createElement(Row$1, null,
35035
- React.createElement(Column, { small: "full", medium: "full", large: "full" },
35036
- (services === null || services === void 0 ? void 0 : services.length) > 0 ? (React.createElement(ResultInfo, null,
35037
- "Showing ",
35038
- from,
35039
- " to ",
35040
- to,
35041
- " out of ",
35042
- totalResults.toLocaleString())) : (React.createElement(ResultInfo, null, "No results found")),
35043
- React.createElement(Favourites, { href: shortListPath },
35044
- React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", width: "15px", height: "15px" },
35045
- React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z" })),
35046
- ' ',
35047
- "Shortlist (",
35048
- favourites.length,
35049
- ")")),
35050
- (services === null || services === void 0 ? void 0 : services.length) > 0 && (React.createElement(Column, { small: "full", medium: "full", large: "full" },
35051
- React.createElement(DirectoryMap, { mapProps: mapProps }))),
35052
- services.map(function (service, index) {
35053
- var snippet = sanitizeHtml_1(service.description, {
35054
- allowedTags: [],
35055
- allowedAttributes: {},
35056
- }).substr(0, extractLength) + String.fromCharCode(8230);
35057
- return (React.createElement(Column, { small: "full", medium: "full", large: "full", key: service.id },
35058
- React.createElement(ServiceContainer, { resultNumber: index },
35059
- React.createElement(Row$1, null,
35060
- React.createElement(Column, { small: "full", medium: "full", large: "full" },
35061
- React.createElement(ServiceHeader, null,
35062
- React.createElement(ServiceLink$1, { href: "".concat(directoryPath, "/").concat(service.id) }, service.name),
35063
- React.createElement(MarkerContainer, null,
35064
- React.createElement("span", null, labelLetters[index]),
35065
- React.createElement("svg", { version: "1.1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", viewBox: "0 0 42.4 59.1", stroke: "currentColor" },
35066
- React.createElement("path", { d: "M19.7,5.6c-0.1,0-0.5,0.1-0.9,0.1c-3.3,0.4-6.5,2-8.9,4.4c-2.6,2.6-4.2,5.9-4.6,9.6c-0.1,1,0,3.1,0.1,4.1c0.3,2.1,1.1,4.2,2.3,6.6c0.9,1.6,1.6,2.9,4.2,7c0.9,1.4,1.9,3.1,2.6,4.2c2.3,3.9,4.1,7.9,5.4,11.9c0.2,0.6,0.3,0.8,0.6,0.9c0.5,0.2,1.1,0.1,1.4-0.3c0.1-0.1,0.2-0.5,0.4-0.9c1.1-3.3,2.5-6.5,4.2-9.5c1.2-2.2,2-3.6,4.4-7.4c1.7-2.7,2.3-3.6,2.9-4.8c1.6-2.9,2.5-5.3,2.9-7.8c0.2-1,0.2-3.1,0.1-4.1c-0.2-1.5-0.5-3-1-4.2c-2.1-5.2-6.8-8.9-12.4-9.8C22.9,5.6,20.2,5.5,19.7,5.6z", fill: "currentColor" })))),
35067
- React.createElement("div", null, snippet),
35068
- service.eligibilitys && (React.createElement(React.Fragment, null, service.eligibilitys.map(function (eligibility) { return (React.createElement(Age, { key: eligibility.id },
35069
- "Suitable for ages from ",
35070
- eligibility.minimum_age,
35071
- " to ",
35072
- eligibility.maximum_age)); })))),
35073
- React.createElement(Column, { small: "full", medium: "full", large: "full" },
35074
- React.createElement(DirectoryAddToShortList, { id: service.id, name: service.name, snippet: snippet }))))));
35075
- }),
35076
- React.createElement(Column, { small: "full", medium: "full", large: "full" },
35077
- React.createElement(Pagination, { currentPage: pageNumber, totalResults: totalResults, resultsPerPage: perPage, postTo: directoryPath })))))));
35082
+ React.createElement(ServiceHeader, null,
35083
+ React.createElement(ServiceLink$1, { href: "".concat(directoryPath, "/").concat(service.id) }, service.name),
35084
+ React.createElement(MarkerContainer, null,
35085
+ React.createElement("span", null, labelLetters[index]),
35086
+ React.createElement("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", viewBox: "0 0 42.4 59.1" },
35087
+ React.createElement("path", { d: "M19.7,5.6c-0.1,0-0.5,0.1-0.9,0.1c-3.3,0.4-6.5,2-8.9,4.4c-2.6,2.6-4.2,5.9-4.6,9.6c-0.1,1,0,3.1,0.1,4.1c0.3,2.1,1.1,4.2,2.3,6.6c0.9,1.6,1.6,2.9,4.2,7c0.9,1.4,1.9,3.1,2.6,4.2c2.3,3.9,4.1,7.9,5.4,11.9c0.2,0.6,0.3,0.8,0.6,0.9c0.5,0.2,1.1,0.1,1.4-0.3c0.1-0.1,0.2-0.5,0.4-0.9c1.1-3.3,2.5-6.5,4.2-9.5c1.2-2.2,2-3.6,4.4-7.4c1.7-2.7,2.3-3.6,2.9-4.8c1.6-2.9,2.5-5.3,2.9-7.8c0.2-1,0.2-3.1,0.1-4.1c-0.2-1.5-0.5-3-1-4.2c-2.1-5.2-6.8-8.9-12.4-9.8C22.9,5.6,20.2,5.5,19.7,5.6z", fill: "currentColor" })))),
35088
+ React.createElement("div", null, snippet),
35089
+ service.eligibilitys && (React.createElement(React.Fragment, null, service.eligibilitys.map(function (eligibility) { return (React.createElement(Age, { key: eligibility.id },
35090
+ "Suitable for ages from ",
35091
+ eligibility.minimum_age,
35092
+ " to ",
35093
+ eligibility.maximum_age)); })))),
35094
+ React.createElement(Column, { small: "full", medium: "full", large: "full" },
35095
+ React.createElement(DirectoryAddToShortList, { id: service.id, name: service.name, snippet: snippet }))))));
35096
+ }))),
35097
+ React.createElement(Column, { small: "full", medium: "full", large: "full" }, !isLoading && (React.createElement(Pagination, { currentPage: pageNumber, totalResults: totalResults, resultsPerPage: perPage, postTo: directoryPath, buttonClickOverride: setPageNumber }))))))));
35078
35098
  };
35079
35099
 
35080
35100
  const Container = styled.div`
@@ -35169,7 +35189,10 @@ const PrintButton = styled.button`
35169
35189
  var DirectoryShortList = function (_a) {
35170
35190
  var directoryPath = _a.directoryPath;
35171
35191
  var _b = useDirectoryShortListContext(), _c = _b.favourites, favourites = _c.favourites; _c.setFavourites; _b.toggleFavourites; _b.isFavourite;
35172
- var notServer = typeof window !== 'undefined';
35192
+ var _d = useState(false), notServer = _d[0], setNotServer = _d[1];
35193
+ useEffect(function () {
35194
+ setNotServer(true);
35195
+ }, []);
35173
35196
  return (React.createElement(Container, { "data-testid": "DirectoryShortList" }, notServer && (React.createElement(DirectoryShortListProvider, null,
35174
35197
  React.createElement(Row$1, null, favourites.length > 0 ? (React.createElement(React.Fragment, null,
35175
35198
  React.createElement(Column, { small: "full", medium: "full", large: "full" },