northants-design-system 0.2.10 → 0.2.11

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.
@@ -6485,6 +6485,12 @@ const Divider$1 = styled.hr`
6485
6485
  // @TODO this needs to fit within the content border
6486
6486
  var Divider = function () { return (React.createElement(Divider$1, { "data-testid": "Divider" })); };
6487
6487
 
6488
+ /**
6489
+ * A div to workaround a bug in styled components that results in no or wrong class and
6490
+ * therefore styling being applied in some circumstances. Wrapped around anything affected.
6491
+ */
6492
+ const ProtectiveContainer = styled.div``;
6493
+
6488
6494
  /**
6489
6495
  * Description text above map embed/link
6490
6496
  */
@@ -6558,6 +6564,10 @@ const MapLink = styled.a`
6558
6564
  }
6559
6565
  `;
6560
6566
 
6567
+ const AccessibleMapLink = styled(MapLink)`
6568
+ ${(props) => props.theme.visuallyHidden};
6569
+ `;
6570
+
6561
6571
  const cookieName = 'fn-cookie';
6562
6572
 
6563
6573
  const getCookie = (name) => {
@@ -19457,7 +19467,7 @@ var GoogleMap = function (_a) {
19457
19467
  var cookiesAccepted = wereCookiesAccepted(allowCookies);
19458
19468
  /* We extract the iframe source URL and check it actually goes to www.google.com/maps */
19459
19469
  var src_matches = iframe_html.match(/src="([^"]+)"/gi);
19460
- var embed_url = (src_matches === null || src_matches === void 0 ? void 0 : src_matches.length) == 1 ? src_matches[0].replace("src=\"", "") : '';
19470
+ var embed_url = (src_matches === null || src_matches === void 0 ? void 0 : src_matches.length) == 1 ? src_matches[0].replace('src="', '') : '';
19461
19471
  if (embed_url) {
19462
19472
  var map_matches = embed_url.match(/^https:\/\/www.google.com\/maps/gi);
19463
19473
  embed_url = (map_matches === null || map_matches === void 0 ? void 0 : map_matches.length) == 1 ? embed_url : '';
@@ -19468,19 +19478,26 @@ var GoogleMap = function (_a) {
19468
19478
  link_url = (googl_matches === null || googl_matches === void 0 ? void 0 : googl_matches.length) == 1 ? link_url : '';
19469
19479
  }
19470
19480
  return (React.createElement(React.Fragment, null,
19471
- title && React.createElement(Heading, { level: 3, text: title }),
19472
- description && (React.createElement(MapDescription, { dangerouslySetInnerHTML: {
19473
- __html: sanitizeHtml$1(description),
19474
- } })),
19475
- (!link_url || !embed_url) && (React.createElement(AlertBannerService, { alertType: 'warning', title: 'Invalid map' },
19476
- "Embedded map contains invalid ",
19477
- !link_url && 'link',
19478
- !link_url && !embed_url && ' and ',
19479
- !embed_url && 'iframe data',
19480
- "; please report this to the content editor")),
19481
- cookiesAccepted && embed_url && (React.createElement(MapEmbed, { "data-testid": "GoogleMapContainer" },
19482
- React.createElement(MapEmbedIFrame, { src: embed_url, allow: "fullscreen", "data-testid": "GoogleMapIframe" }))),
19483
- !cookiesAccepted && link_url && (React.createElement(MapLink, { href: link_url }, link_title ? link_title : 'Google Maps link'))));
19481
+ React.createElement(ProtectiveContainer, null,
19482
+ title && React.createElement(Heading, { level: 3, text: title }),
19483
+ description && (React.createElement(MapDescription, { dangerouslySetInnerHTML: {
19484
+ __html: sanitizeHtml$1(description),
19485
+ } })),
19486
+ (!link_url || !embed_url) && (React.createElement(AlertBannerService, { alertType: 'warning', title: 'Invalid map' },
19487
+ "Embedded map contains invalid ",
19488
+ !link_url && 'link',
19489
+ !link_url && !embed_url && ' and ',
19490
+ !embed_url && 'iframe data',
19491
+ "; please report this to the content editor")),
19492
+ cookiesAccepted && embed_url && (React.createElement(MapEmbed, { "data-testid": "GoogleMapContainer" },
19493
+ React.createElement(MapEmbedIFrame, { src: embed_url, "data-testid": "GoogleMapIframe", title: title ? title : 'Embedded map', "aria-hidden": "true" }))),
19494
+ cookiesAccepted &&
19495
+ link_url && ( // visually hidden link for screen readers etc. as the embed isn't very accessible so hidden from them
19496
+ React.createElement(ProtectiveContainer, null,
19497
+ React.createElement(AccessibleMapLink, { href: link_url }, link_title ? link_title : 'Google Maps link'))),
19498
+ !cookiesAccepted &&
19499
+ link_url && ( // visible link for all if cookies not accepted
19500
+ React.createElement(MapLink, { href: link_url }, link_title ? link_title : 'Google Maps link')))));
19484
19501
  };
19485
19502
 
19486
19503
  const Container$x = styled.figure`