@nnc-digital/nnc-design-system 1.0.0-alpha57 → 1.0.0-alpha59
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.d.ts +42 -42
- package/build/index.js +136 -28
- package/build/index.js.map +1 -1
- package/build/index.mjs.js +136 -28
- package/build/index.mjs.js.map +1 -1
- package/build/library/slices/InquestSchedule/InquestSchedule.storydata.d.ts +1 -0
- package/build/library/slices/InquestSchedule/InquestSchedule.types.d.ts +5 -0
- package/build/src/library/slices/InquestSchedule/InquestSchedule.storydata.d.ts +1 -0
- package/build/src/library/slices/InquestSchedule/InquestSchedule.types.d.ts +5 -0
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import Autocomplete from './library/components/Autocomplete/Autocomplete';
|
|
2
|
-
import BackToTop from './library/components/BackToTop/BackToTop';
|
|
3
|
-
import Button from './library/components/Button/Button';
|
|
4
|
-
import BinCollection from './library/components/BinCollection/BinCollection';
|
|
5
|
-
import DynamicIcon from './library/components/DynamicIcon/DynamicIcon';
|
|
6
|
-
import Heading from './library/components/Heading/Heading';
|
|
7
|
-
import HeadingWithIcon from './library/components/HeadingWithIcon/HeadingWithIcon';
|
|
8
|
-
import Map from './library/components/Map/Map';
|
|
9
|
-
import MapMarker from './library/components/MapMarker/MapMarker';
|
|
10
|
-
import Pagination from './library/components/Pagination/Pagination';
|
|
11
|
-
import CheckboxListFilter from './library/components/CheckboxListFilter/CheckboxListFilter';
|
|
12
|
-
import DropDownFilter from './library/components/DropDownFilter/DropDownFilter';
|
|
13
|
-
import PromotedLinks from './library/components/PromotedLinks/PromotedLinks';
|
|
14
|
-
import StaticMap from './library/components/StaticMap/StaticMap';
|
|
15
|
-
import TextInput from './library/components/TextInput/TextInput';
|
|
16
|
-
export { Autocomplete, BackToTop, Button, BinCollection, DynamicIcon, Heading, HeadingWithIcon, Map, MapMarker, Pagination, CheckboxListFilter, DropDownFilter, PromotedLinks, StaticMap, TextInput, };
|
|
17
|
-
import Accordion from './library/slices/Accordion/Accordion';
|
|
18
|
-
import BlockQuote from './library/slices/BlockQuote/BlockQuote';
|
|
19
|
-
import CallToAction from './library/slices/CallToAction/CallToAction';
|
|
20
|
-
import CouncilTaxAlphabeticalDirectory from './library/slices/CouncilTaxAlphabeticalDirectory/CouncilTaxAlphabeticalDirectory';
|
|
21
|
-
import Cards from './library/slices/Cards/Cards';
|
|
22
|
-
import DownloadableFiles from './library/slices/DownloadableFiles/DownloadableFiles';
|
|
23
|
-
import Divider from './library/slices/Divider/Divider';
|
|
24
|
-
import GoogleMap from './library/slices/GoogleMap/GoogleMap';
|
|
25
|
-
import Image from './library/slices/Image/Image';
|
|
26
|
-
import ImageAndText from './library/slices/ImageAndText/ImageAndText';
|
|
27
|
-
import InquestSchedule from './library/slices/InquestSchedule/InquestSchedule';
|
|
28
|
-
import Promotions from './library/slices/Promotions/Promotions';
|
|
29
|
-
import SearchBox from './library/slices/SearchBox/SearchBox';
|
|
30
|
-
import Video from './library/slices/Video/Video';
|
|
31
|
-
import WarningText from './library/slices/WarningText/WarningText';
|
|
32
|
-
import WarningTextDisclaimer from './library/slices/WarningTextDisclaimer/WarningTextDisclaimer';
|
|
33
|
-
export { Accordion, BlockQuote, CallToAction, Cards, CouncilTaxAlphabeticalDirectory, Divider, DownloadableFiles, GoogleMap, Image, ImageAndText, InquestSchedule, Promotions, SearchBox, Video, WarningText, WarningTextDisclaimer, };
|
|
34
|
-
export * from './library/structure/PageStructures';
|
|
35
|
-
export { GDS_theme, north_theme, west_theme, lb_theme_north, lb_theme_west } from './themes/theme_generator';
|
|
36
|
-
export { GlobalStyleReset } from './themes/GlobalStyleReset.jsx';
|
|
37
|
-
import DirectoryService from './library/directory/DirectoryService/DirectoryService';
|
|
38
|
-
import DirectoryServiceList from './library/directory/DirectoryServiceList/DirectoryServiceList';
|
|
39
|
-
import DirectoryShortList from './library/directory/DirectoryShortList/DirectoryShortList';
|
|
40
|
-
import { DirectoryShortListProvider, useDirectoryShortListContext } from './library/contexts/DirectoryShortListProvider/DirectoryShortListProvider';
|
|
41
|
-
import DirectoryDocumentList from './library/directory/DirectoryDocumentList/DirectoryDocumentList';
|
|
42
|
-
export { DirectoryService, DirectoryServiceList, DirectoryShortList, DirectoryShortListProvider, useDirectoryShortListContext, DirectoryDocumentList, };
|
|
1
|
+
import Autocomplete from './library/components/Autocomplete/Autocomplete';
|
|
2
|
+
import BackToTop from './library/components/BackToTop/BackToTop';
|
|
3
|
+
import Button from './library/components/Button/Button';
|
|
4
|
+
import BinCollection from './library/components/BinCollection/BinCollection';
|
|
5
|
+
import DynamicIcon from './library/components/DynamicIcon/DynamicIcon';
|
|
6
|
+
import Heading from './library/components/Heading/Heading';
|
|
7
|
+
import HeadingWithIcon from './library/components/HeadingWithIcon/HeadingWithIcon';
|
|
8
|
+
import Map from './library/components/Map/Map';
|
|
9
|
+
import MapMarker from './library/components/MapMarker/MapMarker';
|
|
10
|
+
import Pagination from './library/components/Pagination/Pagination';
|
|
11
|
+
import CheckboxListFilter from './library/components/CheckboxListFilter/CheckboxListFilter';
|
|
12
|
+
import DropDownFilter from './library/components/DropDownFilter/DropDownFilter';
|
|
13
|
+
import PromotedLinks from './library/components/PromotedLinks/PromotedLinks';
|
|
14
|
+
import StaticMap from './library/components/StaticMap/StaticMap';
|
|
15
|
+
import TextInput from './library/components/TextInput/TextInput';
|
|
16
|
+
export { Autocomplete, BackToTop, Button, BinCollection, DynamicIcon, Heading, HeadingWithIcon, Map, MapMarker, Pagination, CheckboxListFilter, DropDownFilter, PromotedLinks, StaticMap, TextInput, };
|
|
17
|
+
import Accordion from './library/slices/Accordion/Accordion';
|
|
18
|
+
import BlockQuote from './library/slices/BlockQuote/BlockQuote';
|
|
19
|
+
import CallToAction from './library/slices/CallToAction/CallToAction';
|
|
20
|
+
import CouncilTaxAlphabeticalDirectory from './library/slices/CouncilTaxAlphabeticalDirectory/CouncilTaxAlphabeticalDirectory';
|
|
21
|
+
import Cards from './library/slices/Cards/Cards';
|
|
22
|
+
import DownloadableFiles from './library/slices/DownloadableFiles/DownloadableFiles';
|
|
23
|
+
import Divider from './library/slices/Divider/Divider';
|
|
24
|
+
import GoogleMap from './library/slices/GoogleMap/GoogleMap';
|
|
25
|
+
import Image from './library/slices/Image/Image';
|
|
26
|
+
import ImageAndText from './library/slices/ImageAndText/ImageAndText';
|
|
27
|
+
import InquestSchedule from './library/slices/InquestSchedule/InquestSchedule';
|
|
28
|
+
import Promotions from './library/slices/Promotions/Promotions';
|
|
29
|
+
import SearchBox from './library/slices/SearchBox/SearchBox';
|
|
30
|
+
import Video from './library/slices/Video/Video';
|
|
31
|
+
import WarningText from './library/slices/WarningText/WarningText';
|
|
32
|
+
import WarningTextDisclaimer from './library/slices/WarningTextDisclaimer/WarningTextDisclaimer';
|
|
33
|
+
export { Accordion, BlockQuote, CallToAction, Cards, CouncilTaxAlphabeticalDirectory, Divider, DownloadableFiles, GoogleMap, Image, ImageAndText, InquestSchedule, Promotions, SearchBox, Video, WarningText, WarningTextDisclaimer, };
|
|
34
|
+
export * from './library/structure/PageStructures';
|
|
35
|
+
export { GDS_theme, north_theme, west_theme, lb_theme_north, lb_theme_west } from './themes/theme_generator';
|
|
36
|
+
export { GlobalStyleReset } from './themes/GlobalStyleReset.jsx';
|
|
37
|
+
import DirectoryService from './library/directory/DirectoryService/DirectoryService';
|
|
38
|
+
import DirectoryServiceList from './library/directory/DirectoryServiceList/DirectoryServiceList';
|
|
39
|
+
import DirectoryShortList from './library/directory/DirectoryShortList/DirectoryShortList';
|
|
40
|
+
import { DirectoryShortListProvider, useDirectoryShortListContext } from './library/contexts/DirectoryShortListProvider/DirectoryShortListProvider';
|
|
41
|
+
import DirectoryDocumentList from './library/directory/DirectoryDocumentList/DirectoryDocumentList';
|
|
42
|
+
export { DirectoryService, DirectoryServiceList, DirectoryShortList, DirectoryShortListProvider, useDirectoryShortListContext, DirectoryDocumentList, };
|
package/build/index.js
CHANGED
|
@@ -6690,7 +6690,9 @@ var MapMarker = function (options) {
|
|
|
6690
6690
|
anchor: new google.maps.Point(40, 60),
|
|
6691
6691
|
labelOrigin: new google.maps.Point(21, 25),
|
|
6692
6692
|
};
|
|
6693
|
-
var mergedOptions = __assign$2(__assign$2({}, options), { anchorPoint: new google.maps.Point(-5, -40), icon: icon, position: options.position, title: options.title
|
|
6693
|
+
var mergedOptions = __assign$2(__assign$2({}, options), { anchorPoint: new google.maps.Point(-5, -40), icon: icon, position: options.position, title: options.title, label: options.label ?
|
|
6694
|
+
(typeof options.label === 'string' ?
|
|
6695
|
+
{ text: options.label, color: '#FFFFFF' } : __assign$2(__assign$2({}, options.label), { color: '#FFFFFF' })) : undefined });
|
|
6694
6696
|
for (var key in options) {
|
|
6695
6697
|
if (key !== 'label' && Object.prototype.hasOwnProperty.call(options, key)) {
|
|
6696
6698
|
mergedOptions[key] = options[key];
|
|
@@ -23657,8 +23659,46 @@ var ImageAndText = function (_a) {
|
|
|
23657
23659
|
React__default.default.createElement(Content$5, { dangerouslySetInnerHTML: { __html: sanitizeHtml$1(textContent) } }))))));
|
|
23658
23660
|
};
|
|
23659
23661
|
|
|
23662
|
+
var CaseAppointmentType;
|
|
23663
|
+
(function (CaseAppointmentType) {
|
|
23664
|
+
CaseAppointmentType["Hearing"] = "hearing";
|
|
23665
|
+
CaseAppointmentType["Opening"] = "opening";
|
|
23666
|
+
CaseAppointmentType["Writing"] = "writing";
|
|
23667
|
+
})(CaseAppointmentType || (CaseAppointmentType = {}));
|
|
23668
|
+
|
|
23660
23669
|
const Container$I = styled__default.default.div`
|
|
23661
23670
|
display: block;
|
|
23671
|
+
box-sizing: border-box;
|
|
23672
|
+
`;
|
|
23673
|
+
|
|
23674
|
+
const GroupContainer = styled__default.default.div`
|
|
23675
|
+
display: flex;
|
|
23676
|
+
flex-direction: column;
|
|
23677
|
+
margin-bottom: ${(props) => props.theme.theme_vars.spacingSizes.large};
|
|
23678
|
+
`;
|
|
23679
|
+
|
|
23680
|
+
const InquestContainer = styled__default.default.div`
|
|
23681
|
+
display: flex;
|
|
23682
|
+
flex-direction: row;
|
|
23683
|
+
align-items: flex-start;
|
|
23684
|
+
justify-content: flex-start;
|
|
23685
|
+
flex-wrap: wrap;
|
|
23686
|
+
|
|
23687
|
+
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
|
|
23688
|
+
flex-wrap: nowrap;
|
|
23689
|
+
}
|
|
23690
|
+
`;
|
|
23691
|
+
|
|
23692
|
+
const InquestTime = styled__default.default.div`
|
|
23693
|
+
flex-grow: 0;
|
|
23694
|
+
flex-shrink: 0;
|
|
23695
|
+
`;
|
|
23696
|
+
|
|
23697
|
+
const InquestDetails = styled__default.default.div`
|
|
23698
|
+
flex-grow: 1;
|
|
23699
|
+
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.m}) {
|
|
23700
|
+
padding-left: ${(props) => props.theme.theme_vars.spacingSizes.small};
|
|
23701
|
+
}
|
|
23662
23702
|
`;
|
|
23663
23703
|
|
|
23664
23704
|
/**
|
|
@@ -23666,32 +23706,100 @@ const Container$I = styled__default.default.div`
|
|
|
23666
23706
|
*/
|
|
23667
23707
|
var InquestSchedule = function (_a) {
|
|
23668
23708
|
var caseAppointments = _a.caseAppointments, title = _a.title, _b = _a.error, error = _b === void 0 ? false : _b;
|
|
23709
|
+
var hearings = caseAppointments.filter(function (appointment) {
|
|
23710
|
+
return appointment.appointmentType.toLowerCase().includes(CaseAppointmentType.Hearing);
|
|
23711
|
+
});
|
|
23712
|
+
var openings = caseAppointments.filter(function (appointment) {
|
|
23713
|
+
return appointment.appointmentType.toLowerCase().includes(CaseAppointmentType.Opening);
|
|
23714
|
+
});
|
|
23715
|
+
var writings = caseAppointments.filter(function (appointment) {
|
|
23716
|
+
return appointment.appointmentType.toLowerCase().includes(CaseAppointmentType.Writing);
|
|
23717
|
+
});
|
|
23718
|
+
var groupHearingsByDay = function (appointments) {
|
|
23719
|
+
return appointments.reduce(function (acc, inquest) {
|
|
23720
|
+
var inquestDate = new Date(inquest.startDateTime);
|
|
23721
|
+
var inquestISODay = inquestDate.toISOString().substring(0, 10);
|
|
23722
|
+
if (!acc[inquestISODay]) {
|
|
23723
|
+
acc[inquestISODay] = [];
|
|
23724
|
+
}
|
|
23725
|
+
acc[inquestISODay].push(inquest);
|
|
23726
|
+
return acc;
|
|
23727
|
+
}, {});
|
|
23728
|
+
};
|
|
23729
|
+
var hearingDayGrouped = groupHearingsByDay(hearings);
|
|
23730
|
+
var openingDayGrouped = groupHearingsByDay(openings);
|
|
23731
|
+
var writingDayGrouped = groupHearingsByDay(writings);
|
|
23732
|
+
var formatDate = function (inquestDay) {
|
|
23733
|
+
return inquestDay
|
|
23734
|
+
.toLocaleDateString('en-GB', {
|
|
23735
|
+
weekday: 'long',
|
|
23736
|
+
day: 'numeric',
|
|
23737
|
+
month: 'long',
|
|
23738
|
+
year: 'numeric',
|
|
23739
|
+
})
|
|
23740
|
+
.replace(',', '');
|
|
23741
|
+
};
|
|
23742
|
+
var formatTime = function (inquestDate) {
|
|
23743
|
+
return inquestDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
|
23744
|
+
};
|
|
23745
|
+
var transformToSections = function (groupedData) {
|
|
23746
|
+
return Object.keys(groupedData).map(function (day) {
|
|
23747
|
+
var inquestDayDate = new Date(day);
|
|
23748
|
+
return {
|
|
23749
|
+
title: formatDate(inquestDayDate),
|
|
23750
|
+
content: (React__default.default.createElement(Row$1, null, groupedData[day]
|
|
23751
|
+
.sort(function (a, b) {
|
|
23752
|
+
return new Date(a.startDateTime).getTime() - new Date(b.startDateTime).getTime();
|
|
23753
|
+
})
|
|
23754
|
+
.map(function (inquest, key) {
|
|
23755
|
+
var startDateTime = new Date(inquest.startDateTime);
|
|
23756
|
+
var timeOfDeath = new Date(inquest.dateTimeOfDeath);
|
|
23757
|
+
return (React__default.default.createElement(Column, { small: "full", medium: "full", large: "full", key: key },
|
|
23758
|
+
React__default.default.createElement(InquestContainer, null,
|
|
23759
|
+
React__default.default.createElement(InquestTime, null,
|
|
23760
|
+
React__default.default.createElement("strong", null, formatTime(startDateTime))),
|
|
23761
|
+
React__default.default.createElement(InquestDetails, null,
|
|
23762
|
+
React__default.default.createElement("strong", null, "Name:"),
|
|
23763
|
+
" ",
|
|
23764
|
+
inquest.fullName,
|
|
23765
|
+
".",
|
|
23766
|
+
React__default.default.createElement("br", null),
|
|
23767
|
+
React__default.default.createElement("strong", null, "Died:"),
|
|
23768
|
+
" ",
|
|
23769
|
+
formatDate(timeOfDeath),
|
|
23770
|
+
" at ",
|
|
23771
|
+
inquest.placeOfDeath,
|
|
23772
|
+
". Aged ",
|
|
23773
|
+
inquest.age,
|
|
23774
|
+
' ',
|
|
23775
|
+
"years.",
|
|
23776
|
+
React__default.default.createElement("br", null),
|
|
23777
|
+
React__default.default.createElement("strong", null, "Court location:"),
|
|
23778
|
+
" ",
|
|
23779
|
+
inquest.courtroomFullAddress,
|
|
23780
|
+
".",
|
|
23781
|
+
React__default.default.createElement("br", null),
|
|
23782
|
+
React__default.default.createElement("strong", null, "Coroner:"),
|
|
23783
|
+
" ",
|
|
23784
|
+
inquest.coroner,
|
|
23785
|
+
"."))));
|
|
23786
|
+
}))),
|
|
23787
|
+
};
|
|
23788
|
+
});
|
|
23789
|
+
};
|
|
23669
23790
|
return (React__default.default.createElement(Container$I, { "data-testid": "InquestSchedule" },
|
|
23670
|
-
React__default.default.createElement(
|
|
23671
|
-
React__default.default.createElement(
|
|
23672
|
-
|
|
23673
|
-
|
|
23674
|
-
|
|
23675
|
-
|
|
23676
|
-
|
|
23677
|
-
|
|
23678
|
-
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
React__default.default.createElement("tbody", null,
|
|
23683
|
-
caseAppointments.map(function (item, index) { return (React__default.default.createElement("tr", { key: index },
|
|
23684
|
-
React__default.default.createElement("td", null, item.fullName),
|
|
23685
|
-
React__default.default.createElement("td", null, item.age),
|
|
23686
|
-
React__default.default.createElement("td", null, item.placeOfDeath),
|
|
23687
|
-
React__default.default.createElement("td", null, new Date(item.dateTimeOfDeath).toLocaleString('en-GB')),
|
|
23688
|
-
React__default.default.createElement("td", null, item.coroner),
|
|
23689
|
-
React__default.default.createElement("td", null, item.courtroomFullAddress),
|
|
23690
|
-
React__default.default.createElement("td", null, new Date(item.startDateTime).toLocaleString('en-GB')))); }),
|
|
23691
|
-
caseAppointments.length === 0 && (React__default.default.createElement("tr", null,
|
|
23692
|
-
React__default.default.createElement("td", { colSpan: 7 },
|
|
23693
|
-
React__default.default.createElement("p", null, "We can't find any results at the moment."),
|
|
23694
|
-
error ? (React__default.default.createElement("p", null, " The information is currently unavailable.")) : (React__default.default.createElement("p", null, "There are no inquests scheduled for next month."))))))))));
|
|
23791
|
+
Object.keys(hearingDayGrouped).length > 0 && (React__default.default.createElement(GroupContainer, null,
|
|
23792
|
+
React__default.default.createElement(Heading, { level: 2, text: title }),
|
|
23793
|
+
React__default.default.createElement(Accordion$1, { sections: transformToSections(hearingDayGrouped) }))),
|
|
23794
|
+
Object.keys(openingDayGrouped).length > 0 && (React__default.default.createElement(GroupContainer, null,
|
|
23795
|
+
React__default.default.createElement(Heading, { level: 2, text: "Inquest Openings" }),
|
|
23796
|
+
React__default.default.createElement(Accordion$1, { sections: transformToSections(openingDayGrouped) }))),
|
|
23797
|
+
Object.keys(writingDayGrouped).length > 0 && (React__default.default.createElement(GroupContainer, null,
|
|
23798
|
+
React__default.default.createElement(Heading, { level: 2, text: "Inquests in Writing" }),
|
|
23799
|
+
React__default.default.createElement(Accordion$1, { sections: transformToSections(writingDayGrouped) }))),
|
|
23800
|
+
caseAppointments.length === 0 && (React__default.default.createElement("div", null,
|
|
23801
|
+
React__default.default.createElement("p", null, "We can't find any results at the moment."),
|
|
23802
|
+
error ? (React__default.default.createElement("p", null, " The information is currently unavailable.")) : (React__default.default.createElement("p", null, "There are no inquests scheduled for next month."))))));
|
|
23695
23803
|
};
|
|
23696
23804
|
|
|
23697
23805
|
const Container$H = styled__default.default.div`
|
|
@@ -31377,7 +31485,7 @@ var DirectoryServiceList = function (_a) {
|
|
|
31377
31485
|
React__default.default.createElement(Row$1, null,
|
|
31378
31486
|
React__default.default.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
|
|
31379
31487
|
React__default.default.createElement(Label$1, { htmlFor: "directorySearch" }, "What are you looking for?"),
|
|
31380
|
-
React__default.default.createElement(HintText, { text: "Enter
|
|
31488
|
+
React__default.default.createElement(HintText, { text: "Enter the name of a specific organisation" }),
|
|
31381
31489
|
React__default.default.createElement(Input, { name: "directorySearch", type: "text", defaultValue: searchTerm, id: "directorySearch", onChange: function (e) {
|
|
31382
31490
|
setSearchTerm(e.target.value);
|
|
31383
31491
|
} })),
|
|
@@ -33282,7 +33390,7 @@ var DirectoryDocumentList = function (_a) {
|
|
|
33282
33390
|
React__default.default.createElement(Row$1, null,
|
|
33283
33391
|
React__default.default.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
|
|
33284
33392
|
React__default.default.createElement(Label, { htmlFor: "directorySearch" }, "What are you looking for?"),
|
|
33285
|
-
React__default.default.createElement(HintText, { text: "Enter
|
|
33393
|
+
React__default.default.createElement(HintText, { text: "Enter the name of a specific organisation" }),
|
|
33286
33394
|
React__default.default.createElement(Input, { name: "directorySearch", type: "text", defaultValue: searchTerm, id: "directorySearch", onChange: function (e) {
|
|
33287
33395
|
setSearchTerm(e.target.value);
|
|
33288
33396
|
} })),
|