@nnc-digital/nnc-design-system 1.0.0-beta3 → 1.0.0-beta5

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.
@@ -23648,8 +23648,10 @@ var ImageAndText = function (_a) {
23648
23648
 
23649
23649
  var CaseAppointmentType;
23650
23650
  (function (CaseAppointmentType) {
23651
- CaseAppointmentType["Hearing"] = "hearing";
23651
+ CaseAppointmentType["Formal"] = "formal";
23652
+ CaseAppointmentType["Hearing"] = "inquest hearing";
23652
23653
  CaseAppointmentType["Opening"] = "opening";
23654
+ CaseAppointmentType["PreInquest"] = "pre-inquest review";
23653
23655
  CaseAppointmentType["Writing"] = "writing";
23654
23656
  })(CaseAppointmentType || (CaseAppointmentType = {}));
23655
23657
 
@@ -23666,28 +23668,158 @@ const GroupContainer = styled.div`
23666
23668
 
23667
23669
  const InquestContainer = styled.div`
23668
23670
  display: flex;
23669
- flex-direction: row;
23671
+ flex-direction: column;
23670
23672
  align-items: flex-start;
23671
23673
  justify-content: flex-start;
23672
23674
  flex-wrap: wrap;
23673
-
23674
- @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
23675
- flex-wrap: nowrap;
23676
- }
23677
23675
  `;
23678
23676
 
23679
- const InquestTime = styled.div`
23680
- flex-grow: 0;
23677
+ styled.div`
23678
+ flex-grow: 1;
23681
23679
  flex-shrink: 0;
23680
+
23681
+ strong {
23682
+ display: block;
23683
+ &::first-letter {
23684
+ text-transform: capitalize;
23685
+ }
23686
+ }
23682
23687
  `;
23683
23688
 
23684
23689
  const InquestDetails = styled.div`
23685
23690
  flex-grow: 1;
23691
+ h3 {
23692
+ display: block;
23693
+ &::first-letter {
23694
+ text-transform: capitalize;
23695
+ }
23696
+ }
23697
+ `;
23698
+
23699
+ const SummaryContainer = styled.div`
23700
+ border: ${(props) => (props.$hasHeading ? `1px solid ${props.theme.theme_vars.colours.grey}` : `none`)};
23701
+ margin: ${(props) => (props.$hasMargin ? props.theme.theme_vars.spacingSizes.medium : 0)} 0;
23702
+ `;
23703
+
23704
+ const SummaryHeading = styled.div`
23705
+ background-color: ${(props) => props.theme.theme_vars.colours.grey_light};
23706
+ width: 100%;
23707
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
23708
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.medium};
23709
+
23710
+ h3 {
23711
+ margin: 0;
23712
+ }
23713
+ `;
23714
+
23715
+ const SummaryList$1 = styled.dl`
23716
+ display: table;
23717
+ width: 100%;
23718
+ table-layout: fixed;
23719
+ border-collapse: collapse;
23720
+ `;
23721
+
23722
+ const SummaryRow = styled.div`
23723
+ border-bottom: ${(props) => props.$hasBorders ? `1px solid ${props.theme.theme_vars.colours.grey}` : 'none'};
23724
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
23725
+
23686
23726
  @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
23687
- padding-left: ${(props) => props.theme.theme_vars.spacingSizes.small};
23727
+ display: table-row;
23728
+ }
23729
+
23730
+ @media print {
23731
+ display: table-row;
23732
+ border-bottom: none;
23688
23733
  }
23689
23734
  `;
23690
23735
 
23736
+ const SummaryTerm = styled.dt`
23737
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
23738
+ font-weight: bold;
23739
+
23740
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
23741
+ display: table-cell;
23742
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
23743
+ width: 30%;
23744
+ vertical-align: middle;
23745
+ }
23746
+
23747
+ @media print {
23748
+ display: table-cell;
23749
+ width: 30%;
23750
+ }
23751
+ `;
23752
+
23753
+ const SummaryDetail = styled.dd`
23754
+ overflow-wrap: break-word;
23755
+ width: 100%;
23756
+ margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
23757
+
23758
+ @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
23759
+ display: table-cell;
23760
+ width: 70%;
23761
+ padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
23762
+ }
23763
+
23764
+ @media print {
23765
+ display: table-cell;
23766
+ width: 70%;
23767
+ }
23768
+ `;
23769
+
23770
+ var SummaryList = function (_a) {
23771
+ 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;
23772
+ return (React.createElement(SummaryContainer, { "$hasHeading": heading, "$hasMargin": hasMargin },
23773
+ heading && (React.createElement(SummaryHeading, null,
23774
+ React.createElement(Heading, { level: 3, text: heading }))),
23775
+ React.createElement(SummaryList$1, { "data-testid": "SummaryList" }, terms.map(function (summaryRow, summaryIndex) { return (React.createElement(SummaryRow, { key: summaryIndex, "$hasBorders": hasBorders },
23776
+ React.createElement(SummaryTerm, null, summaryRow.term),
23777
+ React.createElement(SummaryDetail, { dangerouslySetInnerHTML: { __html: sanitizeHtml$1(summaryRow.detail) } }))); }))));
23778
+ };
23779
+
23780
+ /**
23781
+ * Format a date string to a readable date format
23782
+ * @param {string} dateString - The date string to format
23783
+ * @returns {string} Formatted date
23784
+ */
23785
+ const formatDate = (dateString) => {
23786
+ const date = new Date(dateString);
23787
+ return date
23788
+ .toLocaleDateString('en-GB', {
23789
+ weekday: 'long',
23790
+ day: 'numeric',
23791
+ month: 'long',
23792
+ year: 'numeric',
23793
+ })
23794
+ .replace(',', '');
23795
+ };
23796
+
23797
+ /**
23798
+ * Format a date string to a time format
23799
+ * @param {string} dateString - The date string to format
23800
+ * @returns {string} Formatted time
23801
+ */
23802
+ const formatTime = (dateString) => {
23803
+ const date = new Date(dateString);
23804
+ return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
23805
+ };
23806
+
23807
+ /**
23808
+ * Format a date string to a date and time format
23809
+ * @param {string} dateString - The date string to format
23810
+ * @returns {string} Formatted date and time
23811
+ */
23812
+ const formatDateTime = (dateString) => {
23813
+ const date = new Date(dateString);
23814
+ return date.toLocaleDateString('en-GB', {
23815
+ day: 'numeric',
23816
+ month: 'long',
23817
+ year: 'numeric',
23818
+ hour: '2-digit',
23819
+ minute: '2-digit',
23820
+ });
23821
+ };
23822
+
23691
23823
  /**
23692
23824
  * A table displaying a schedule of inquests
23693
23825
  */
@@ -23696,12 +23828,18 @@ var InquestSchedule = function (_a) {
23696
23828
  var hearings = caseAppointments.filter(function (appointment) {
23697
23829
  return appointment.appointmentType.toLowerCase().includes(CaseAppointmentType.Hearing);
23698
23830
  });
23831
+ var preInquest = caseAppointments.filter(function (appointment) {
23832
+ return appointment.appointmentType.toLowerCase().includes(CaseAppointmentType.PreInquest);
23833
+ });
23699
23834
  var openings = caseAppointments.filter(function (appointment) {
23700
23835
  return appointment.appointmentType.toLowerCase().includes(CaseAppointmentType.Opening);
23701
23836
  });
23702
23837
  var writings = caseAppointments.filter(function (appointment) {
23703
23838
  return appointment.appointmentType.toLowerCase().includes(CaseAppointmentType.Writing);
23704
23839
  });
23840
+ var formal = caseAppointments.filter(function (appointment) {
23841
+ return appointment.appointmentType.toLowerCase().includes(CaseAppointmentType.Formal);
23842
+ });
23705
23843
  var groupHearingsByDay = function (appointments) {
23706
23844
  return appointments.reduce(function (acc, inquest) {
23707
23845
  var inquestDate = new Date(inquest.startDateTime);
@@ -23714,62 +23852,52 @@ var InquestSchedule = function (_a) {
23714
23852
  }, {});
23715
23853
  };
23716
23854
  var hearingDayGrouped = groupHearingsByDay(hearings);
23855
+ var preInquestDayGrouped = groupHearingsByDay(preInquest);
23717
23856
  var openingDayGrouped = groupHearingsByDay(openings);
23718
23857
  var writingDayGrouped = groupHearingsByDay(writings);
23719
- var formatDate = function (inquestDay) {
23720
- return inquestDay
23721
- .toLocaleDateString('en-GB', {
23722
- weekday: 'long',
23723
- day: 'numeric',
23724
- month: 'long',
23725
- year: 'numeric',
23726
- })
23727
- .replace(',', '');
23728
- };
23729
- var formatTime = function (inquestDate) {
23730
- return inquestDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
23731
- };
23858
+ var formalDayGrouped = groupHearingsByDay(formal);
23732
23859
  var transformToSections = function (groupedData) {
23733
23860
  return Object.keys(groupedData).map(function (day) {
23734
- var inquestDayDate = new Date(day);
23735
23861
  return {
23736
- title: formatDate(inquestDayDate),
23862
+ title: formatDate(day),
23737
23863
  content: (React.createElement(Row$1, null, groupedData[day]
23738
23864
  .sort(function (a, b) {
23739
23865
  return new Date(a.startDateTime).getTime() - new Date(b.startDateTime).getTime();
23740
23866
  })
23741
23867
  .map(function (inquest, key) {
23742
- var startDateTime = new Date(inquest.startDateTime);
23743
- var timeOfDeath = new Date(inquest.dateTimeOfDeath);
23868
+ var terms = [
23869
+ {
23870
+ term: 'Name',
23871
+ detail: inquest.fullName,
23872
+ },
23873
+ {
23874
+ term: 'Died',
23875
+ detail: formatDate(inquest.dateTimeOfDeath) +
23876
+ ' at ' +
23877
+ inquest.placeOfDeath +
23878
+ '. Aged ' +
23879
+ inquest.age +
23880
+ ' years.',
23881
+ },
23882
+ {
23883
+ term: 'Court location',
23884
+ detail: inquest.courtroomFullAddress + '.',
23885
+ },
23886
+ {
23887
+ term: 'Coroner',
23888
+ detail: inquest.coroner + '.',
23889
+ },
23890
+ ];
23891
+ if (inquest.endDateTime) {
23892
+ terms.push({
23893
+ term: 'End date',
23894
+ detail: formatDateTime(inquest.endDateTime) + '.',
23895
+ });
23896
+ }
23744
23897
  return (React.createElement(Column, { small: "full", medium: "full", large: "full", key: key },
23745
23898
  React.createElement(InquestContainer, null,
23746
- React.createElement(InquestTime, null,
23747
- React.createElement("strong", null, formatTime(startDateTime))),
23748
23899
  React.createElement(InquestDetails, null,
23749
- React.createElement("strong", null, "Name:"),
23750
- " ",
23751
- inquest.fullName,
23752
- ".",
23753
- React.createElement("br", null),
23754
- React.createElement("strong", null, "Died:"),
23755
- " ",
23756
- formatDate(timeOfDeath),
23757
- " at ",
23758
- inquest.placeOfDeath,
23759
- ". Aged ",
23760
- inquest.age,
23761
- ' ',
23762
- "years.",
23763
- React.createElement("br", null),
23764
- React.createElement("strong", null, "Court location:"),
23765
- " ",
23766
- inquest.courtroomFullAddress,
23767
- ".",
23768
- React.createElement("br", null),
23769
- React.createElement("strong", null, "Coroner:"),
23770
- " ",
23771
- inquest.coroner,
23772
- "."))));
23900
+ React.createElement(SummaryList, { terms: terms, hasBorders: false, heading: formatTime(inquest.startDateTime) })))));
23773
23901
  }))),
23774
23902
  };
23775
23903
  });
@@ -23781,9 +23909,15 @@ var InquestSchedule = function (_a) {
23781
23909
  Object.keys(openingDayGrouped).length > 0 && (React.createElement(GroupContainer, null,
23782
23910
  React.createElement(Heading, { level: 2, text: "Inquest Openings" }),
23783
23911
  React.createElement(Accordion$1, { sections: transformToSections(openingDayGrouped) }))),
23912
+ Object.keys(preInquestDayGrouped).length > 0 && (React.createElement(GroupContainer, null,
23913
+ React.createElement(Heading, { level: 2, text: "Pre-inquest Review Hearings" }),
23914
+ React.createElement(Accordion$1, { sections: transformToSections(preInquestDayGrouped) }))),
23784
23915
  Object.keys(writingDayGrouped).length > 0 && (React.createElement(GroupContainer, null,
23785
23916
  React.createElement(Heading, { level: 2, text: "Inquests in Writing" }),
23786
23917
  React.createElement(Accordion$1, { sections: transformToSections(writingDayGrouped) }))),
23918
+ Object.keys(formalDayGrouped).length > 0 && (React.createElement(GroupContainer, null,
23919
+ React.createElement(Heading, { level: 2, text: "Formal Suspension Hearings" }),
23920
+ React.createElement(Accordion$1, { sections: transformToSections(formalDayGrouped) }))),
23787
23921
  caseAppointments.length === 0 && (React.createElement("div", null,
23788
23922
  React.createElement("p", null, "We can't find any results at the moment."),
23789
23923
  error ? (React.createElement("p", null, " The information is currently unavailable.")) : (React.createElement("p", null, "There are no inquests scheduled for next month."))))));
@@ -28226,9 +28360,9 @@ const focusListItem = css`
28226
28360
  color: ${(props) => props.theme.theme_vars.colours.black};
28227
28361
  background-color: ${(props) => props.theme.theme_vars.colours.focus};
28228
28362
  outline: none;
28229
- box-shadow: 0px -2px 0px 0px ${(props) => props.theme.theme_vars.colours.black} inset;
28230
- -webkit-box-shadow: 0px -2px 0px 0px ${(props) => props.theme.theme_vars.colours.black} inset;
28231
- -moz-box-shadow: 0px -2px 0px 0px ${(props) => props.theme.theme_vars.colours.black} inset;
28363
+ box-shadow: 0 0 0 2px ${(props) => props.theme.theme_vars.colours.focus}, 0 0 0 4px ${(props) => props.theme.theme_vars.colours.black};
28364
+ -webkit-box-shadow: 0 0 0 2px ${(props) => props.theme.theme_vars.colours.focus}, 0 0 0 4px ${(props) => props.theme.theme_vars.colours.black};
28365
+ -moz-box-shadow: 0 0 0 2px ${(props) => props.theme.theme_vars.colours.focus}, 0 0 0 4px ${(props) => props.theme.theme_vars.colours.black};
28232
28366
  `;
28233
28367
 
28234
28368
  const ListItem = styled.li`
@@ -30468,69 +30602,6 @@ var ServiceContact = function (_a) {
30468
30602
  contact.phones.map(function (phone, phoneIndex) { return (React.createElement(ContactLink, { href: "tel:".concat(phone.number), key: phoneIndex }, phone.number)); }))); })))))));
30469
30603
  };
30470
30604
 
30471
- const SummaryList$1 = styled.dl`
30472
- display: table;
30473
- width: 100%;
30474
- table-layout: fixed;
30475
- border-collapse: collapse;
30476
- margin: ${(props) => (props.$hasMargin ? props.theme.theme_vars.spacingSizes.medium : 0)} 0;
30477
- `;
30478
-
30479
- const SummaryRow = styled.div`
30480
- border-bottom: 1px solid ${(props) => props.theme.theme_vars.colours.grey};
30481
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
30482
-
30483
- @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
30484
- display: table-row;
30485
- }
30486
-
30487
- @media print {
30488
- display: table-row;
30489
- border-bottom: none;
30490
- }
30491
- `;
30492
-
30493
- const SummaryTerm = styled.dt`
30494
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
30495
- font-weight: bold;
30496
-
30497
- @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
30498
- display: table-cell;
30499
- padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
30500
- width: 30%;
30501
- vertical-align: middle;
30502
- }
30503
-
30504
- @media print {
30505
- display: table-cell;
30506
- width: 30%;
30507
- }
30508
- `;
30509
-
30510
- const SummaryDetail = styled.dd`
30511
- overflow-wrap: break-word;
30512
- width: 100%;
30513
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
30514
-
30515
- @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
30516
- display: table-cell;
30517
- width: 70%;
30518
- padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
30519
- }
30520
-
30521
- @media print {
30522
- display: table-cell;
30523
- width: 70%;
30524
- }
30525
- `;
30526
-
30527
- var SummaryList = function (_a) {
30528
- var terms = _a.terms, _b = _a.hasMargin, hasMargin = _b === void 0 ? true : _b;
30529
- return (React.createElement(SummaryList$1, { "data-testid": "SummaryList", "$hasMargin": hasMargin }, terms.map(function (summaryRow, summaryIndex) { return (React.createElement(SummaryRow, { key: summaryIndex },
30530
- React.createElement(SummaryTerm, null, summaryRow.term),
30531
- React.createElement(SummaryDetail, { dangerouslySetInnerHTML: { __html: sanitizeHtml$1(summaryRow.detail) } }))); })));
30532
- };
30533
-
30534
30605
  /**
30535
30606
  * Group an array of items by the key
30536
30607
  */