@nnc-digital/nnc-design-system 1.0.0-beta2 → 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;
23733
+ }
23734
+ `;
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%;
23688
23750
  }
23689
23751
  `;
23690
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."))))));
@@ -25559,13 +25693,11 @@ const HomeLink = styled.a`
25559
25693
  }
25560
25694
  }
25561
25695
  &:focus {
25562
- outline: 2px transparent solid;
25563
- box-shadow: ${(props) => props.theme.theme_vars.colours.focus} 0 0 0 2px,
25564
- ${(props) =>
25565
- props.theme.cardinal_name === 'north'
25566
- ? props.theme.theme_vars.colours.black
25567
- : props.theme.theme_vars.colours.focus}
25568
- 0 0 0 4px;
25696
+ outline: none;
25697
+ background: ${(props) => props.theme.theme_vars.colours.focus};
25698
+ box-shadow: 0 0 0 2px ${(props) => props.theme.theme_vars.colours.focus}, 0 0 0 4px ${(props) => props.theme.theme_vars.colours.black};
25699
+ -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};
25700
+ -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};
25569
25701
  transition: box-shadow 0.3s ease 0s;
25570
25702
  }
25571
25703
  `;
@@ -25718,6 +25850,9 @@ const Button$3 = styled.button`
25718
25850
  &:focus {
25719
25851
  outline: none;
25720
25852
  background: ${(props) => props.theme.theme_vars.colours.focus};
25853
+ box-shadow: 0 0 0 2px ${(props) => props.theme.theme_vars.colours.focus}, 0 0 0 4px ${(props) => props.theme.theme_vars.colours.black};
25854
+ -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};
25855
+ -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};
25721
25856
  svg {
25722
25857
  path {
25723
25858
  fill: ${(props) => props.theme.theme_vars.colours.black};
@@ -26020,12 +26155,14 @@ const CallToActionLink = styled.a`
26020
26155
  display: inline-block;
26021
26156
  outline: none;
26022
26157
 
26023
- &:hover,
26024
- &:focus {
26158
+ &:hover {
26025
26159
  text-decoration-style: dotted;
26026
26160
  text-shadow: 2px 2px 4px rgba(150, 150, 150, 0.5), -2px 2px 4px rgba(150, 150, 150, 0.5),
26027
26161
  2px -2px 4px rgba(150, 150, 150, 0.5), -2px -2px 4px rgba(150, 150, 150, 0.5);
26028
26162
  }
26163
+ &:focus {
26164
+ ${(props) => props.theme.linkStylesFocus};
26165
+ }
26029
26166
  &:active {
26030
26167
  transform: translate(3px);
26031
26168
  }
@@ -26111,6 +26248,14 @@ const PlayPauseButton = styled.button`
26111
26248
  &:hover {
26112
26249
  background: rgba(0, 0, 0, 0.7);
26113
26250
  }
26251
+ &:focus {
26252
+ outline: none;
26253
+ background: ${(props) => props.theme.theme_vars.colours.focus};
26254
+ color: ${(props) => props.theme.theme_vars.colours.black};
26255
+ box-shadow: 0 0 0 2px ${(props) => props.theme.theme_vars.colours.focus}, 0 0 0 4px ${(props) => props.theme.theme_vars.colours.black};
26256
+ -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};
26257
+ -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};
26258
+ }
26114
26259
  }
26115
26260
  `;
26116
26261
 
@@ -28215,9 +28360,9 @@ const focusListItem = css`
28215
28360
  color: ${(props) => props.theme.theme_vars.colours.black};
28216
28361
  background-color: ${(props) => props.theme.theme_vars.colours.focus};
28217
28362
  outline: none;
28218
- box-shadow: 0px -2px 0px 0px ${(props) => props.theme.theme_vars.colours.black} inset;
28219
- -webkit-box-shadow: 0px -2px 0px 0px ${(props) => props.theme.theme_vars.colours.black} inset;
28220
- -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};
28221
28366
  `;
28222
28367
 
28223
28368
  const ListItem = styled.li`
@@ -30015,9 +30160,9 @@ const generate_theme = (theme_vars) => {
30015
30160
  background: ${theme_vars.colours.focus};
30016
30161
  outline: none;
30017
30162
  text-decoration: none !important;
30018
- box-shadow: 0 0 0 1px ${theme_vars.colours.focus}, 0 0 0 3px ${theme_vars.colours.black};
30019
- -webkit-box-shadow: 0 0 0 1px ${theme_vars.colours.focus}, 0 0 0 3px ${theme_vars.colours.black};
30020
- -moz-box-shadow: 0 0 0 1px ${theme_vars.colours.focus}, 0 0 0 3px ${theme_vars.colours.black};
30163
+ box-shadow: 0 0 0 2px ${theme_vars.colours.focus}, 0 0 0 4px ${theme_vars.colours.black};
30164
+ -webkit-box-shadow: 0 0 0 2px ${theme_vars.colours.focus}, 0 0 0 4px ${theme_vars.colours.black};
30165
+ -moz-box-shadow: 0 0 0 2px ${theme_vars.colours.focus}, 0 0 0 4px ${theme_vars.colours.black};
30021
30166
  `,
30022
30167
  linkStylesActive: css`
30023
30168
  color: ${theme_vars.colours.black};
@@ -30457,69 +30602,6 @@ var ServiceContact = function (_a) {
30457
30602
  contact.phones.map(function (phone, phoneIndex) { return (React.createElement(ContactLink, { href: "tel:".concat(phone.number), key: phoneIndex }, phone.number)); }))); })))))));
30458
30603
  };
30459
30604
 
30460
- const SummaryList$1 = styled.dl`
30461
- display: table;
30462
- width: 100%;
30463
- table-layout: fixed;
30464
- border-collapse: collapse;
30465
- margin: ${(props) => (props.$hasMargin ? props.theme.theme_vars.spacingSizes.medium : 0)} 0;
30466
- `;
30467
-
30468
- const SummaryRow = styled.div`
30469
- border-bottom: 1px solid ${(props) => props.theme.theme_vars.colours.grey};
30470
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
30471
-
30472
- @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
30473
- display: table-row;
30474
- }
30475
-
30476
- @media print {
30477
- display: table-row;
30478
- border-bottom: none;
30479
- }
30480
- `;
30481
-
30482
- const SummaryTerm = styled.dt`
30483
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
30484
- font-weight: bold;
30485
-
30486
- @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
30487
- display: table-cell;
30488
- padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
30489
- width: 30%;
30490
- vertical-align: middle;
30491
- }
30492
-
30493
- @media print {
30494
- display: table-cell;
30495
- width: 30%;
30496
- }
30497
- `;
30498
-
30499
- const SummaryDetail = styled.dd`
30500
- overflow-wrap: break-word;
30501
- width: 100%;
30502
- margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.small};
30503
-
30504
- @media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
30505
- display: table-cell;
30506
- width: 70%;
30507
- padding: ${(props) => props.theme.theme_vars.spacingSizes.small};
30508
- }
30509
-
30510
- @media print {
30511
- display: table-cell;
30512
- width: 70%;
30513
- }
30514
- `;
30515
-
30516
- var SummaryList = function (_a) {
30517
- var terms = _a.terms, _b = _a.hasMargin, hasMargin = _b === void 0 ? true : _b;
30518
- return (React.createElement(SummaryList$1, { "data-testid": "SummaryList", "$hasMargin": hasMargin }, terms.map(function (summaryRow, summaryIndex) { return (React.createElement(SummaryRow, { key: summaryIndex },
30519
- React.createElement(SummaryTerm, null, summaryRow.term),
30520
- React.createElement(SummaryDetail, { dangerouslySetInnerHTML: { __html: sanitizeHtml$1(summaryRow.detail) } }))); })));
30521
- };
30522
-
30523
30605
  /**
30524
30606
  * Group an array of items by the key
30525
30607
  */