northants-design-system 3.1.0 → 3.1.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.
package/build/index.js CHANGED
@@ -3927,9 +3927,25 @@ const SummaryList$1 = styled__default.default.dl`
3927
3927
  border-collapse: collapse;
3928
3928
  `;
3929
3929
 
3930
+ const wrapOnMobile = (props) => {
3931
+ if (props.$hasWrapOnMobile) {
3932
+ return styled.css`
3933
+ display: block;
3934
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3935
+ `;
3936
+ } else {
3937
+ return styled.css`
3938
+ display: grid;
3939
+ grid-template-columns: repeat(2, minmax(0, 1fr));
3940
+ margin: 0;
3941
+ `;
3942
+ }
3943
+ };
3944
+
3930
3945
  const SummaryRow = styled__default.default.div`
3931
3946
  border-bottom: ${(props) => (props.$hasBorders ? `1px solid ${props.theme.theme_vars.colours.grey}` : `none`)};
3932
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3947
+
3948
+ ${wrapOnMobile};
3933
3949
 
3934
3950
  @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
3935
3951
  display: table-row;
@@ -3941,9 +3957,24 @@ const SummaryRow = styled__default.default.div`
3941
3957
  }
3942
3958
  `;
3943
3959
 
3960
+ const summaryTermHasWrap = (props) => {
3961
+ if (props.$hasWrapOnMobile) {
3962
+ return styled.css`
3963
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3964
+ `;
3965
+ } else {
3966
+ return styled.css`
3967
+ grid-column-start: 1;
3968
+ grid-column-end: 1;
3969
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
3970
+ margin: 0;
3971
+ `;
3972
+ }
3973
+ };
3974
+
3944
3975
  const SummaryTerm = styled__default.default.dt`
3945
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3946
3976
  font-weight: bold;
3977
+ ${summaryTermHasWrap};
3947
3978
 
3948
3979
  @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
3949
3980
  display: table-cell;
@@ -3958,10 +3989,25 @@ const SummaryTerm = styled__default.default.dt`
3958
3989
  }
3959
3990
  `;
3960
3991
 
3992
+ const summaryDetailHasWrap = (props) => {
3993
+ if (props.$hasWrapOnMobile) {
3994
+ return styled.css`
3995
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
3996
+ `;
3997
+ } else {
3998
+ return styled.css`
3999
+ grid-column-start: 2;
4000
+ grid-column-end: 2;
4001
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
4002
+ margin: 0;
4003
+ `;
4004
+ }
4005
+ };
4006
+
3961
4007
  const SummaryDetail = styled__default.default.dd`
3962
4008
  overflow-wrap: break-word;
3963
4009
  width: 100%;
3964
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
4010
+ ${summaryDetailHasWrap};
3965
4011
 
3966
4012
  @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
3967
4013
  display: table-cell;
@@ -19900,13 +19946,13 @@ var Heading$1 = function (_a) {
19900
19946
  };
19901
19947
 
19902
19948
  var SummaryList = function (_a) {
19903
- 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;
19949
+ 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;
19904
19950
  return (React__namespace.default.createElement(SummaryContainer, { "$hasHeading": heading, "$hasMargin": hasMargin },
19905
19951
  heading && (React__namespace.default.createElement(SummaryHeading, null,
19906
19952
  React__namespace.default.createElement(Heading$1, { level: 3, text: heading }))),
19907
- React__namespace.default.createElement(SummaryList$1, { "data-testid": "SummaryList" }, terms.map(function (summaryRow, summaryIndex) { return (React__namespace.default.createElement(SummaryRow, { key: summaryIndex, "$hasBorders": hasBorders },
19908
- React__namespace.default.createElement(SummaryTerm, null, summaryRow.term),
19909
- React__namespace.default.createElement(SummaryDetail, { dangerouslySetInnerHTML: { __html: sanitizeHtml(summaryRow.detail) } }))); }))));
19953
+ React__namespace.default.createElement(SummaryList$1, { "data-testid": "SummaryList" }, terms.map(function (summaryRow, summaryIndex) { return (React__namespace.default.createElement(SummaryRow, { key: summaryIndex, "$hasBorders": hasBorders, "$hasWrapOnMobile": hasWrapOnMobile },
19954
+ React__namespace.default.createElement(SummaryTerm, { "$hasWrapOnMobile": hasWrapOnMobile }, summaryRow.term),
19955
+ React__namespace.default.createElement(SummaryDetail, { dangerouslySetInnerHTML: { __html: sanitizeHtml(summaryRow.detail) }, "$hasWrapOnMobile": hasWrapOnMobile }))); }))));
19910
19956
  };
19911
19957
 
19912
19958
  var ConsultationStatus = function (_a) {
@@ -19923,7 +19969,7 @@ var ConsultationStatus = function (_a) {
19923
19969
  },
19924
19970
  ];
19925
19971
  return (React__namespace.default.createElement(Container$1t, { "data-testid": "ConsultationStatus", "$isOpen": isOpen },
19926
- React__namespace.default.createElement(SummaryList, { terms: terms, hasBorders: false, hasMargin: false })));
19972
+ React__namespace.default.createElement(SummaryList, { terms: terms, hasBorders: false, hasMargin: false, hasWrapOnMobile: false })));
19927
19973
  };
19928
19974
 
19929
19975
  const Icon$4 = styled__default.default.span`
@@ -23376,7 +23422,7 @@ var CheckboxListFilter = function (_a) {
23376
23422
  handleParams('news', [{ key: NewsArticleFilterFields.articleType.queryParamKey, value: articleTypes }], ['page']);
23377
23423
  }
23378
23424
  };
23379
- var backupLabel = Math.random().toString(36).substring(7);
23425
+ var backupLabel = React.useId();
23380
23426
  return (React__namespace.default.createElement(Container$1p, { "data-testid": "CheckboxListFilter" },
23381
23427
  React__namespace.default.createElement(Fieldset$2, { "aria-describedby": hintId },
23382
23428
  React__namespace.default.createElement(Legend$4, { "$labelHidden": labelHidden, "data-testid": "CheckboxListFilterLegend" }, label),
@@ -29160,6 +29206,11 @@ const Container$M = styled__default.default.div`
29160
29206
  padding-top: 31.25%;
29161
29207
  }
29162
29208
  }
29209
+
29210
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.l}) {
29211
+ max-width: 1680px;
29212
+ margin: 0 auto;
29213
+ }
29163
29214
  `;
29164
29215
 
29165
29216
  const ImageContainer$4 = styled__default.default.div`
@@ -34265,6 +34316,9 @@ var WebChatAssistant = function (_a) {
34265
34316
  if (data === null) {
34266
34317
  return;
34267
34318
  }
34319
+ if (timeoutWarningRef === null || timeoutWarningRef === void 0 ? void 0 : timeoutWarningRef.current) {
34320
+ clearTimeout(timeoutWarningRef.current);
34321
+ }
34268
34322
  timeoutWarningRef.current = setTimeout(handleTimeoutWarning, warningTimeout);
34269
34323
  setIsLoading(true);
34270
34324
  var newMessages = __spreadArray([], messages, true);
@@ -34395,9 +34449,9 @@ var WebChatAssistant = function (_a) {
34395
34449
  React__namespace.default.createElement(ChatWidget, { "$chatOpen": chatOpen },
34396
34450
  React__namespace.default.createElement(ChatHeader, null,
34397
34451
  React__namespace.default.createElement(Heading$1, { level: 2, text: "Virtual Assistant" }),
34398
- React__namespace.default.createElement(ChatClose, { onClick: function () { return handleClose(); }, "aria-label": "Close chat" },
34399
- React__namespace.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" },
34400
- React__namespace.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18 18 6M6 6l12 12" })))),
34452
+ React__namespace.default.createElement(ChatClose, { onClick: function () { return handleClose(); }, "aria-label": "Minimise chat" },
34453
+ React__namespace.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "24", height: "24" },
34454
+ React__namespace.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" })))),
34401
34455
  React__namespace.default.createElement(ChatMessages, { "aria-live": "polite", role: "log" },
34402
34456
  messages.map(function (message, index) { return (React__namespace.default.createElement(Message, { key: index, "$sender": message.sender },
34403
34457
  React__namespace.default.createElement(ScreenReaderOnly, null,