@nnc-digital/nnc-design-system 0.4.22 → 0.4.24

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
@@ -4414,12 +4414,18 @@ var BinCollection = function (_a) {
4414
4414
  var handleAddressChange = function (e) {
4415
4415
  var selectedUPRN = e.target.value;
4416
4416
  if (selectedUPRN) {
4417
- var startDate = getFormattedDate();
4418
- var endDate = getFormattedDate(42);
4417
+ var startDate_1 = getFormattedDate();
4418
+ var endDate_1 = getFormattedDate(28);
4419
4419
  // Fetch calendar events for the selected UPRN
4420
- axios__default["default"].get("".concat(CalendarEventsApiUrl).concat(selectedUPRN, "/").concat(startDate, "/").concat(endDate))
4420
+ axios__default["default"].get("".concat(CalendarEventsApiUrl).concat(selectedUPRN, "/").concat(startDate_1, "/").concat(endDate_1))
4421
4421
  .then(function (response) {
4422
- var groupedData = groupByTitle(response.data);
4422
+ // Filter the data based on the date range
4423
+ var filteredData = response.data.filter(function (event) {
4424
+ var eventDate = parseDate(event.start);
4425
+ var eventDateString = eventDate.toISOString().split('T')[0];
4426
+ return eventDateString >= startDate_1 && eventDateString <= endDate_1;
4427
+ });
4428
+ var groupedData = groupByTitle(filteredData);
4423
4429
  if (Object.keys(groupedData).length === 0) {
4424
4430
  setNoResultsFound(true);
4425
4431
  }
@@ -23266,12 +23272,79 @@ const AccessibleLinks = styled__default["default"].a`
23266
23272
 
23267
23273
  `;
23268
23274
 
23275
+ const SkipToMainContent$1 = styled__default["default"].a`
23276
+ ${props => props.theme.fontStyles}
23277
+
23278
+ position: absolute;
23279
+ width: 1px;
23280
+ height: 1px;
23281
+ margin: 0;
23282
+ overflow: hidden;
23283
+ clip: rect(0 0 0 0);
23284
+ clip-path: inset(50%);
23285
+ white-space: nowrap;
23286
+ display: block;
23287
+ padding: 10px 15px;
23288
+
23289
+ &:active,
23290
+ &:focus {
23291
+ position: static;
23292
+ width: auto;
23293
+ height: auto;
23294
+ margin: inherit;
23295
+ overflow: visible;
23296
+ clip: auto;
23297
+ -webkit-clip-path: none;
23298
+ clip-path: none;
23299
+ white-space: inherit
23300
+ }
23301
+
23302
+ &:link,
23303
+ &:visited,
23304
+ &:hover,
23305
+ &:active,
23306
+ &:focus {
23307
+ color: ${props => props.theme.theme_vars.colours.black};
23308
+ }
23309
+
23310
+
23311
+
23312
+ @media (min-width: 40.0625em) {
23313
+ font-size: 16px;
23314
+ font-size: 1rem;
23315
+ line-height: 1.25
23316
+ }
23317
+
23318
+
23319
+
23320
+ &:focus {
23321
+ outline: 3px solid ${props => props.theme.theme_vars.colours.focus};
23322
+ outline-offset: 0;
23323
+ background-color: ${props => props.theme.theme_vars.colours.focus};
23324
+ }
23325
+
23326
+
23327
+
23328
+
23329
+ `;
23330
+
23331
+ var SkipToMainContent = function () { return (React__default["default"].createElement(SkipToMainContent$1, { "data-testid": "SkipToMainContent", href: "#main" }, "Skip to main content")); };
23332
+
23269
23333
  var AccessibleLink = function (_a) {
23270
- var _b = _a.AccessibleLinksArray, AccessibleLinksArray = _b === void 0 ? null : _b;
23271
- return (React__default["default"].createElement(AccessibleList, null, AccessibleLinksArray && AccessibleLinksArray.map(function (link, i) {
23272
- return React__default["default"].createElement(AccessibleListItem, { key: 'accessible-link-li-' + i },
23273
- React__default["default"].createElement(AccessibleLinks, { key: 'accessible-link-' + i, href: link.url }, link.title));
23274
- })));
23334
+ var _b = _a.AccessibleLinksArray, AccessibleLinksArray = _b === void 0 ? null : _b, _c = _a.includeSkipToMainContent, includeSkipToMainContent = _c === void 0 ? false : _c, _d = _a.listItem, listItem = _d === void 0 ? true : _d;
23335
+ var ListItemWrapper = function (_a) {
23336
+ var children = _a.children;
23337
+ return listItem ? React__default["default"].createElement(AccessibleListItem, null, children) : React__default["default"].createElement(React__default["default"].Fragment, null, children);
23338
+ };
23339
+ var ListWrapper = function (_a) {
23340
+ var children = _a.children;
23341
+ return listItem ? React__default["default"].createElement(AccessibleList, null, children) : React__default["default"].createElement(React__default["default"].Fragment, null, children);
23342
+ };
23343
+ return (React__default["default"].createElement(ListWrapper, null,
23344
+ includeSkipToMainContent && (React__default["default"].createElement(ListItemWrapper, null,
23345
+ React__default["default"].createElement(SkipToMainContent, null))),
23346
+ AccessibleLinksArray && AccessibleLinksArray.map(function (link, i) { return (React__default["default"].createElement(ListItemWrapper, { key: 'accessible-link-li-' + i },
23347
+ React__default["default"].createElement(AccessibleLinks, { key: 'accessible-link-' + i, href: link.url }, link.title))); })));
23275
23348
  };
23276
23349
 
23277
23350
  const Container$F = styled__default["default"].div`
@@ -27863,64 +27936,6 @@ var SignpostLinks = function (_a) {
27863
27936
  signpostLinksArray[0].areaName))));
27864
27937
  };
27865
27938
 
27866
- const SkipToMainContent$1 = styled__default["default"].a`
27867
- ${props => props.theme.fontStyles}
27868
-
27869
- position: absolute;
27870
- width: 1px;
27871
- height: 1px;
27872
- margin: 0;
27873
- overflow: hidden;
27874
- clip: rect(0 0 0 0);
27875
- clip-path: inset(50%);
27876
- white-space: nowrap;
27877
- display: block;
27878
- padding: 10px 15px;
27879
-
27880
- &:active,
27881
- &:focus {
27882
- position: static;
27883
- width: auto;
27884
- height: auto;
27885
- margin: inherit;
27886
- overflow: visible;
27887
- clip: auto;
27888
- -webkit-clip-path: none;
27889
- clip-path: none;
27890
- white-space: inherit
27891
- }
27892
-
27893
- &:link,
27894
- &:visited,
27895
- &:hover,
27896
- &:active,
27897
- &:focus {
27898
- color: ${props => props.theme.theme_vars.colours.black};
27899
- }
27900
-
27901
-
27902
-
27903
- @media (min-width: 40.0625em) {
27904
- font-size: 16px;
27905
- font-size: 1rem;
27906
- line-height: 1.25
27907
- }
27908
-
27909
-
27910
-
27911
- &:focus {
27912
- outline: 3px solid ${props => props.theme.theme_vars.colours.focus};
27913
- outline-offset: 0;
27914
- background-color: ${props => props.theme.theme_vars.colours.focus};
27915
- }
27916
-
27917
-
27918
-
27919
-
27920
- `;
27921
-
27922
- var SkipToMainContent = function () { return (React__default["default"].createElement(SkipToMainContent$1, { "data-testid": "SkipToMainContent", href: "#main" }, "Skip to main content")); };
27923
-
27924
27939
  const summaryStyles = (props) => {
27925
27940
  if (props.theme.is_memorial === true) {
27926
27941
  return styled.css`