northants-design-system 3.1.0 → 3.1.2

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.
@@ -3899,9 +3899,25 @@ const SummaryList$1 = styled.dl`
3899
3899
  border-collapse: collapse;
3900
3900
  `;
3901
3901
 
3902
+ const wrapOnMobile = (props) => {
3903
+ if (props.$hasWrapOnMobile) {
3904
+ return css`
3905
+ display: block;
3906
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3907
+ `;
3908
+ } else {
3909
+ return css`
3910
+ display: grid;
3911
+ grid-template-columns: repeat(2, minmax(0, 1fr));
3912
+ margin: 0;
3913
+ `;
3914
+ }
3915
+ };
3916
+
3902
3917
  const SummaryRow = styled.div`
3903
3918
  border-bottom: ${(props) => (props.$hasBorders ? `1px solid ${props.theme.theme_vars.colours.grey}` : `none`)};
3904
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3919
+
3920
+ ${wrapOnMobile};
3905
3921
 
3906
3922
  @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
3907
3923
  display: table-row;
@@ -3913,9 +3929,24 @@ const SummaryRow = styled.div`
3913
3929
  }
3914
3930
  `;
3915
3931
 
3932
+ const summaryTermHasWrap = (props) => {
3933
+ if (props.$hasWrapOnMobile) {
3934
+ return css`
3935
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3936
+ `;
3937
+ } else {
3938
+ return css`
3939
+ grid-column-start: 1;
3940
+ grid-column-end: 1;
3941
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
3942
+ margin: 0;
3943
+ `;
3944
+ }
3945
+ };
3946
+
3916
3947
  const SummaryTerm = styled.dt`
3917
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3918
3948
  font-weight: bold;
3949
+ ${summaryTermHasWrap};
3919
3950
 
3920
3951
  @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
3921
3952
  display: table-cell;
@@ -3930,10 +3961,25 @@ const SummaryTerm = styled.dt`
3930
3961
  }
3931
3962
  `;
3932
3963
 
3964
+ const summaryDetailHasWrap = (props) => {
3965
+ if (props.$hasWrapOnMobile) {
3966
+ return css`
3967
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3968
+ `;
3969
+ } else {
3970
+ return css`
3971
+ grid-column-start: 2;
3972
+ grid-column-end: 2;
3973
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
3974
+ margin: 0;
3975
+ `;
3976
+ }
3977
+ };
3978
+
3933
3979
  const SummaryDetail = styled.dd`
3934
3980
  overflow-wrap: break-word;
3935
3981
  width: 100%;
3936
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3982
+ ${summaryDetailHasWrap};
3937
3983
 
3938
3984
  @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
3939
3985
  display: table-cell;
@@ -19872,13 +19918,13 @@ var Heading$1 = function (_a) {
19872
19918
  };
19873
19919
 
19874
19920
  var SummaryList = function (_a) {
19875
- var terms = _a.terms, _b = _a.hasMargin, hasMargin = _b === void 0 ? true : _b, _c = _a.hasBorders, hasBorders = _c === void 0 ? true : _c, heading = _a.heading;
19921
+ var terms = _a.terms, _b = _a.hasMargin, hasMargin = _b === void 0 ? true : _b, _c = _a.hasBorders, hasBorders = _c === void 0 ? true : _c, heading = _a.heading, _d = _a.hasWrapOnMobile, hasWrapOnMobile = _d === void 0 ? true : _d;
19876
19922
  return (React__default.createElement(SummaryContainer, { "$hasHeading": heading, "$hasMargin": hasMargin },
19877
19923
  heading && (React__default.createElement(SummaryHeading, null,
19878
19924
  React__default.createElement(Heading$1, { level: 3, text: heading }))),
19879
- React__default.createElement(SummaryList$1, { "data-testid": "SummaryList" }, terms.map(function (summaryRow, summaryIndex) { return (React__default.createElement(SummaryRow, { key: summaryIndex, "$hasBorders": hasBorders },
19880
- React__default.createElement(SummaryTerm, null, summaryRow.term),
19881
- React__default.createElement(SummaryDetail, { dangerouslySetInnerHTML: { __html: sanitizeHtml(summaryRow.detail) } }))); }))));
19925
+ React__default.createElement(SummaryList$1, { "data-testid": "SummaryList" }, terms.map(function (summaryRow, summaryIndex) { return (React__default.createElement(SummaryRow, { key: summaryIndex, "$hasBorders": hasBorders, "$hasWrapOnMobile": hasWrapOnMobile },
19926
+ React__default.createElement(SummaryTerm, { "$hasWrapOnMobile": hasWrapOnMobile }, summaryRow.term),
19927
+ React__default.createElement(SummaryDetail, { dangerouslySetInnerHTML: { __html: sanitizeHtml(summaryRow.detail) }, "$hasWrapOnMobile": hasWrapOnMobile }))); }))));
19882
19928
  };
19883
19929
 
19884
19930
  var ConsultationStatus = function (_a) {
@@ -19895,7 +19941,7 @@ var ConsultationStatus = function (_a) {
19895
19941
  },
19896
19942
  ];
19897
19943
  return (React__default.createElement(Container$1t, { "data-testid": "ConsultationStatus", "$isOpen": isOpen },
19898
- React__default.createElement(SummaryList, { terms: terms, hasBorders: false, hasMargin: false })));
19944
+ React__default.createElement(SummaryList, { terms: terms, hasBorders: false, hasMargin: false, hasWrapOnMobile: false })));
19899
19945
  };
19900
19946
 
19901
19947
  const Icon$4 = styled.span`
@@ -23348,7 +23394,7 @@ var CheckboxListFilter = function (_a) {
23348
23394
  handleParams('news', [{ key: NewsArticleFilterFields.articleType.queryParamKey, value: articleTypes }], ['page']);
23349
23395
  }
23350
23396
  };
23351
- var backupLabel = Math.random().toString(36).substring(7);
23397
+ var backupLabel = useId();
23352
23398
  return (React__default.createElement(Container$1p, { "data-testid": "CheckboxListFilter" },
23353
23399
  React__default.createElement(Fieldset$2, { "aria-describedby": hintId },
23354
23400
  React__default.createElement(Legend$4, { "$labelHidden": labelHidden, "data-testid": "CheckboxListFilterLegend" }, label),
@@ -29132,6 +29178,11 @@ const Container$M = styled.div`
29132
29178
  padding-top: 31.25%;
29133
29179
  }
29134
29180
  }
29181
+
29182
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.l}) {
29183
+ max-width: 1680px;
29184
+ margin: 0 auto;
29185
+ }
29135
29186
  `;
29136
29187
 
29137
29188
  const ImageContainer$4 = styled.div`
@@ -32368,16 +32419,15 @@ styled.img`
32368
32419
  * Display a list of links for a section with optional images
32369
32420
  */
32370
32421
  var SectionLinks = function (_a) {
32371
- var sectionTitle = _a.sectionTitle, _b = _a.displayTitle, displayTitle = _b === void 0 ? true : _b, sectionSlug = _a.sectionSlug, pageLinksArray = _a.pageLinksArray, _c = _a.hasImages, hasImages = _c === void 0 ? false : _c;
32422
+ var sectionTitle = _a.sectionTitle, _b = _a.displayTitle, displayTitle = _b === void 0 ? true : _b, sectionSlug = _a.sectionSlug, pageLinksArray = _a.pageLinksArray, _c = _a.hasImages, hasImages = _c === void 0 ? false : _c, _d = _a.hasCards, hasCards = _d === void 0 ? false : _d;
32372
32423
  return (React__default.createElement(Container$o, { id: sectionSlug, "data-testid": "SectionLinks" },
32373
32424
  displayTitle ? React__default.createElement(SectionTitle$1, { text: sectionTitle }) : React__default.createElement("br", null),
32374
32425
  React__default.createElement(Row$1, { isList: true }, pageLinksArray.map(function (link, i) {
32375
32426
  var _a;
32376
- return (React__default.createElement(Column, { isList: true, small: "full", medium: "one-half", large: "one-third", key: i },
32377
- React__default.createElement(Pagelink, { href: link.url, title: link.title },
32378
- hasImages && (React__default.createElement(React__default.Fragment, null, ((_a = link.imageLarge) === null || _a === void 0 ? void 0 : _a.trim()) ? (React__default.createElement(ResponsiveImage, { imageSmall: link.imageSmall, imageLarge: link.imageLarge, imageAltText: link.imageAltText, ratio: "16by9", smallWidth: "400", largeWidth: "800", objectFit: "cover" })) : (React__default.createElement(ImageContainer, null)))),
32379
- React__default.createElement(Title$3, null, link.title),
32380
- React__default.createElement(Summary$1, null, link.summary))));
32427
+ return (React__default.createElement(Column, { isList: true, small: "full", medium: "one-half", large: "one-third", key: i }, hasCards && hasImages ? (React__default.createElement(Card, { footerLink: link, imageAltText: link.imageAltText, imageLarge: link.imageLarge, imageSmall: link.imageSmall, content: link.summary })) : hasCards && !hasImages ? (React__default.createElement(Card, { footerLink: link, header: link.title, content: link.summary })) : (React__default.createElement(Pagelink, { href: link.url, title: link.title },
32428
+ hasImages && (React__default.createElement(React__default.Fragment, null, ((_a = link.imageLarge) === null || _a === void 0 ? void 0 : _a.trim()) ? (React__default.createElement(ResponsiveImage, { imageSmall: link.imageSmall, imageLarge: link.imageLarge, imageAltText: link.imageAltText, ratio: "16by9", smallWidth: "400", largeWidth: "800", objectFit: "cover" })) : (React__default.createElement(ImageContainer, null)))),
32429
+ React__default.createElement(Title$3, null, link.title),
32430
+ React__default.createElement(Summary$1, null, link.summary)))));
32381
32431
  }))));
32382
32432
  };
32383
32433
 
@@ -33818,12 +33868,11 @@ const ChatWidget = styled.div`
33818
33868
  z-index: 1000;
33819
33869
  background-color: ${(props) => props.theme.theme_vars.colours.action_light};
33820
33870
 
33821
- @media (max-height: 560px) {
33822
- bottom: 0;
33871
+ @media screen and (min-height: 650px) and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
33872
+ bottom: ${(props) => props.theme.theme_vars.spacingSizes.xx_large};
33823
33873
  }
33824
33874
 
33825
- @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.s}) {
33826
- bottom: ${(props) => props.theme.theme_vars.spacingSizes.xx_large};
33875
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
33827
33876
  right: ${(props) => props.theme.theme_vars.spacingSizes.medium};
33828
33877
  width: 380px;
33829
33878
  height: 560px;
@@ -34237,6 +34286,9 @@ var WebChatAssistant = function (_a) {
34237
34286
  if (data === null) {
34238
34287
  return;
34239
34288
  }
34289
+ if (timeoutWarningRef === null || timeoutWarningRef === void 0 ? void 0 : timeoutWarningRef.current) {
34290
+ clearTimeout(timeoutWarningRef.current);
34291
+ }
34240
34292
  timeoutWarningRef.current = setTimeout(handleTimeoutWarning, warningTimeout);
34241
34293
  setIsLoading(true);
34242
34294
  var newMessages = __spreadArray([], messages, true);
@@ -34367,9 +34419,9 @@ var WebChatAssistant = function (_a) {
34367
34419
  React__default.createElement(ChatWidget, { "$chatOpen": chatOpen },
34368
34420
  React__default.createElement(ChatHeader, null,
34369
34421
  React__default.createElement(Heading$1, { level: 2, text: "Virtual Assistant" }),
34370
- React__default.createElement(ChatClose, { onClick: function () { return handleClose(); }, "aria-label": "Close chat" },
34371
- React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", width: "24", height: "24" },
34372
- React__default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18 18 6M6 6l12 12" })))),
34422
+ React__default.createElement(ChatClose, { onClick: function () { return handleClose(); }, "aria-label": "Minimise chat" },
34423
+ React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "24", height: "24" },
34424
+ React__default.createElement("path", { fillRule: "evenodd", d: "M4.25 12a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75Z", clipRule: "evenodd" })))),
34373
34425
  React__default.createElement(ChatMessages, { "aria-live": "polite", role: "log" },
34374
34426
  messages.map(function (message, index) { return (React__default.createElement(Message, { key: index, "$sender": message.sender },
34375
34427
  React__default.createElement(ScreenReaderOnly, null,