@nnc-digital/nnc-design-system 1.0.0-alpha42 → 1.0.0-alpha44

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.
@@ -30155,7 +30155,7 @@ var PhoneIcon = function (_a) {
30155
30155
  };
30156
30156
 
30157
30157
  var ServiceContact = function (_a) {
30158
- var website = _a.website, email = _a.email, contacts = _a.contacts;
30158
+ var website = _a.website, email = _a.email, contacts = _a.contacts, websiteTitle = _a.websiteTitle;
30159
30159
  var themeContext = useContext(ThemeContext);
30160
30160
  return (React.createElement(Container$6, { "data-testid": "ServiceContact" },
30161
30161
  React.createElement(Row$1, { hasWrap: false },
@@ -30163,7 +30163,7 @@ var ServiceContact = function (_a) {
30163
30163
  React.createElement(IconContainer$1, null,
30164
30164
  React.createElement(WebsiteIcon, { colourFill: themeContext.theme_vars.colours.black })),
30165
30165
  React.createElement(Content$1, null,
30166
- React.createElement(WebLink$1, { href: website }, website)))),
30166
+ React.createElement(WebLink$1, { href: website }, websiteTitle ? "".concat(websiteTitle) : website)))),
30167
30167
  email && (React.createElement(Column, { small: "full", medium: "full", large: "auto", classes: "striped-contacts" },
30168
30168
  React.createElement(IconContainer$1, null,
30169
30169
  React.createElement(EmailIcon, { colourFill: themeContext.theme_vars.colours.black })),
@@ -30353,10 +30353,15 @@ var transformDescriptionDetails = function (accreditations, fees, service_areas,
30353
30353
  };
30354
30354
  var transformSnippet = function (description, extractLength) {
30355
30355
  if (extractLength === void 0) { extractLength = 190; }
30356
- return (sanitizeHtml$1(description, {
30356
+ var sanitized = sanitizeHtml$1(description, {
30357
30357
  allowedTags: [],
30358
30358
  allowedAttributes: {},
30359
- }).substr(0, extractLength) + String.fromCharCode(8230));
30359
+ }).trim();
30360
+ if (!sanitized) {
30361
+ return '';
30362
+ }
30363
+ var snippet = sanitized.substr(0, extractLength);
30364
+ return sanitized.length > extractLength ? snippet + String.fromCharCode(8230) : snippet;
30360
30365
  };
30361
30366
  var transformTaxonomies = function (service_taxonomys, taxonomiesToShow) {
30362
30367
  if (taxonomiesToShow === void 0) { taxonomiesToShow = []; }
@@ -30586,7 +30591,7 @@ var getIcon = function (profile) {
30586
30591
 
30587
30592
  var DirectoryService = function (_a) {
30588
30593
  var _b, _c, _d, _e;
30589
- var id = _a.id, name = _a.name, accreditations = _a.accreditations, _f = _a.ageInMonths, ageInMonths = _f === void 0 ? false : _f, description = _a.description, descriptionElement = _a.descriptionElement, eligibilitys = _a.eligibilitys, email = _a.email, fees = _a.fees, languages = _a.languages, organization = _a.organization, regular_schedules = _a.regular_schedules, contacts = _a.contacts, service_areas = _a.service_areas, service_at_locations = _a.service_at_locations, service_social_profiles = _a.service_social_profiles, service_taxonomys = _a.service_taxonomys, taxonomiesToShow = _a.taxonomiesToShow, url = _a.url, uploads = _a.uploads, shortListPath = _a.shortListPath;
30594
+ var id = _a.id, name = _a.name, accreditations = _a.accreditations, _f = _a.ageInMonths, ageInMonths = _f === void 0 ? false : _f, description = _a.description, descriptionElement = _a.descriptionElement, eligibilitys = _a.eligibilitys, email = _a.email, fees = _a.fees, languages = _a.languages, organization = _a.organization, regular_schedules = _a.regular_schedules, contacts = _a.contacts, service_areas = _a.service_areas, service_at_locations = _a.service_at_locations, service_social_profiles = _a.service_social_profiles, service_taxonomys = _a.service_taxonomys, taxonomiesToShow = _a.taxonomiesToShow, url = _a.url, websiteUrlTitle = _a.websiteUrlTitle, uploads = _a.uploads, shortListPath = _a.shortListPath;
30590
30595
  var labelLetters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'];
30591
30596
  var _g = useState(false), notServer = _g[0], setNotServer = _g[1];
30592
30597
  var themeContext = useContext(ThemeContext);
@@ -30659,7 +30664,7 @@ var DirectoryService = function (_a) {
30659
30664
  React.createElement(MapLink, { href: "https://www.google.com/maps/search/?api=1&query=".concat(service_at_locations[0].latitude, "%2C").concat(service_at_locations[0].longitude) }, "View in Google Maps"))))))),
30660
30665
  (email || url || (contacts === null || contacts === void 0 ? void 0 : contacts.length) > 0) && (React.createElement(Column, { small: "full", medium: "full", large: "full", classes: "striped-column" },
30661
30666
  React.createElement(Heading, { level: 2, text: "How to contact this service" }),
30662
- React.createElement(ServiceContact, { email: email, website: url, contacts: contacts }))),
30667
+ React.createElement(ServiceContact, { email: email, website: url, websiteTitle: websiteUrlTitle, contacts: contacts }))),
30663
30668
  React.createElement(Column, { small: "full", medium: "full", large: "full", classes: "striped-column" },
30664
30669
  React.createElement(Heading, { level: 2, text: "Description" }),
30665
30670
  React.createElement("div", null,
@@ -30775,6 +30780,20 @@ const Button$1 = styled.button`
30775
30780
  &:active {
30776
30781
  ${(props) => props.theme.linkStylesActive}
30777
30782
  }
30783
+
30784
+ ${(props) => {
30785
+ if (props.size === 'large') {
30786
+ return `
30787
+ font-size: 16px;
30788
+ padding: 14px 24px;
30789
+ `;
30790
+ }
30791
+ }}
30792
+
30793
+ ${(props) =>
30794
+ props.$isWarning && props.size === 'large' && `
30795
+ padding: 12px 24px;
30796
+ `}
30778
30797
  `;
30779
30798
 
30780
30799
  const ButtonText$1 = styled.span`
@@ -30985,6 +31004,14 @@ const MapToggle = styled.button`
30985
31004
  &:active {
30986
31005
  ${(props) => props.theme.linkStylesActive}
30987
31006
  }
31007
+ ${(props) => {
31008
+ if (props.size === 'large') {
31009
+ return `
31010
+ font-size: 16px;
31011
+ padding: 14px 24px;
31012
+ `;
31013
+ }
31014
+ }}
30988
31015
  `;
30989
31016
 
30990
31017
  const Favourites = styled.a`
@@ -31330,13 +31357,13 @@ var DirectoryServiceList = function (_a) {
31330
31357
  React.createElement(Input, { name: "postcode", type: "text", defaultValue: postcodeSearch, id: "postcode", onChange: function (e) { return setPostcodeSearch(e.target.value); }, autocomplete: "postal-code" }))),
31331
31358
  React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
31332
31359
  React.createElement(ButtonContainer$2, null,
31333
- React.createElement(Button$1, { onClick: submitSearch, type: "submit" },
31360
+ React.createElement(Button$1, { size: "large", onClick: submitSearch, type: "submit" },
31334
31361
  React.createElement(ButtonText$1, null, "Search"),
31335
31362
  React.createElement(IconDownload, { colourFill: "#fff" })),
31336
- filtersActive && (React.createElement(Button$1, { onClick: clearSearch, type: "button", "$isWarning": true },
31363
+ filtersActive && (React.createElement(Button$1, { size: "large", onClick: clearSearch, type: "button", "$isWarning": true },
31337
31364
  React.createElement(ButtonText$1, null, "Clear search"))))),
31338
31365
  hasDocuments && (React.createElement(Column, { small: "full", medium: "full", large: "full" },
31339
- React.createElement(Button$4, { url: "".concat(directoryPath, "/documents?search=").concat(searchTerm), text: "View documents and resources", primary: false }))))))),
31366
+ React.createElement(Button$4, { url: "".concat(directoryPath, "/documents?search=").concat(searchTerm), text: "View documents and resources", primary: false, size: "large" }))))))),
31340
31367
  React.createElement(Column, { small: "full", medium: "one-third", large: "one-third" },
31341
31368
  React.createElement(FilterToggle, { type: "button", onClick: function (e) { return setShowFilters(!showFilters); } }, showFilters ? "Hide Filters" : "Show Filters"),
31342
31369
  React.createElement(FilterContainer, { "$showFilters": showFilters },
@@ -31393,7 +31420,7 @@ var DirectoryServiceList = function (_a) {
31393
31420
  " out of ",
31394
31421
  totalResults.toLocaleString())) : (React.createElement(ResultInfo$1, null, "No results found")),
31395
31422
  React.createElement(FavouritesContainer, null,
31396
- (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")),
31423
+ (services === null || services === void 0 ? void 0 : services.length) > 0 && (React.createElement(MapToggle, { type: "button", size: "large", onClick: function (e) { return setShowMap(!showMap); } }, showMap ? "Hide Map" : "Show Map")),
31397
31424
  React.createElement(Favourites, { href: shortListPath },
31398
31425
  React.createElement(HeartIcon, { colourFill: themeContext.theme_vars.colours.action }),
31399
31426
  " Shortlist (",