@nnc-digital/nnc-design-system 1.0.0-beta1 → 1.0.0-beta11

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.
Files changed (39) hide show
  1. package/build/index.d.ts +2 -1
  2. package/build/index.js +490 -221
  3. package/build/index.js.map +1 -1
  4. package/build/index.mjs.js +490 -222
  5. package/build/index.mjs.js.map +1 -1
  6. package/build/library/components/SummaryList/SummaryList.types.d.ts +8 -0
  7. package/build/library/events/Event/Event.d.ts +4 -0
  8. package/build/library/events/Event/Event.storydata.d.ts +4 -0
  9. package/build/library/events/Event/Event.types.d.ts +206 -0
  10. package/build/library/events/Event/index.d.ts +3 -0
  11. package/build/library/events/EventList/EventList.d.ts +4 -0
  12. package/build/library/events/EventList/EventList.storydata.d.ts +3 -0
  13. package/build/library/events/EventList/EventList.types.d.ts +152 -0
  14. package/build/library/events/EventList/index.d.ts +3 -0
  15. package/build/library/events/index.d.ts +5 -0
  16. package/build/library/events/utils/EventFilters.d.ts +57 -0
  17. package/build/library/events/utils/index.d.ts +1 -0
  18. package/build/library/pages/EventPage/EventPage.d.ts +13 -0
  19. package/build/library/pages/EventPage/index.d.ts +1 -0
  20. package/build/library/slices/InquestSchedule/InquestSchedule.types.d.ts +4 -1
  21. package/build/library/slices/RoadworksList/RoadworksList.types.d.ts +4 -0
  22. package/build/src/index.d.ts +2 -1
  23. package/build/src/library/components/SummaryList/SummaryList.types.d.ts +8 -0
  24. package/build/src/library/events/Event/Event.d.ts +4 -0
  25. package/build/src/library/events/Event/Event.storydata.d.ts +4 -0
  26. package/build/src/library/events/Event/Event.types.d.ts +206 -0
  27. package/build/src/library/events/Event/index.d.ts +3 -0
  28. package/build/src/library/events/EventList/EventList.d.ts +4 -0
  29. package/build/src/library/events/EventList/EventList.storydata.d.ts +3 -0
  30. package/build/src/library/events/EventList/EventList.types.d.ts +152 -0
  31. package/build/src/library/events/EventList/index.d.ts +3 -0
  32. package/build/src/library/events/index.d.ts +5 -0
  33. package/build/src/library/events/utils/EventFilters.d.ts +57 -0
  34. package/build/src/library/events/utils/index.d.ts +1 -0
  35. package/build/src/library/pages/EventPage/EventPage.d.ts +13 -0
  36. package/build/src/library/pages/EventPage/index.d.ts +1 -0
  37. package/build/src/library/slices/InquestSchedule/InquestSchedule.types.d.ts +4 -1
  38. package/build/src/library/slices/RoadworksList/RoadworksList.types.d.ts +4 -0
  39. package/package.json +1 -1
@@ -8,6 +8,14 @@ export interface SummaryListProps {
8
8
  * Option to remove margin (default is true)
9
9
  */
10
10
  hasMargin?: boolean;
11
+ /**
12
+ * Option to show borders (default is true)
13
+ */
14
+ hasBorders?: boolean;
15
+ /**
16
+ * Optional heading for the summary list
17
+ */
18
+ heading?: string;
11
19
  }
12
20
  export interface SummaryRowProps {
13
21
  /**
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { EventProps } from './Event.types';
3
+ declare const Event: React.FunctionComponent<EventProps>;
4
+ export default Event;
@@ -0,0 +1,4 @@
1
+ import { EventProps } from './Event.types';
2
+ export declare const ExampleEvent: EventProps;
3
+ export declare const ExampleVirtualEvent: EventProps;
4
+ export declare const ExampleEvents: EventProps[];
@@ -0,0 +1,206 @@
1
+ import React from 'react';
2
+ import { FileDownloadProps } from '../../components/FileDownload/FileDownload.types';
3
+ import { SocialProfile } from '../../directory/ServiceSocialLinks/ServiceSocialLinks.types';
4
+ import { ServiceContactProps } from '../../directory/ServiceContact/ServiceContact.types';
5
+ export interface EventProps {
6
+ /**
7
+ * The unique event id
8
+ */
9
+ id: string;
10
+ /**
11
+ * The event name/title
12
+ */
13
+ name: string;
14
+ /**
15
+ * The description as a plain HTML string
16
+ */
17
+ description: string;
18
+ /**
19
+ * The description as a react node
20
+ */
21
+ descriptionElement?: React.ReactNode;
22
+ /**
23
+ * The event start date and time in ISO format
24
+ */
25
+ startDateTime: string;
26
+ /**
27
+ * The event end date and time in ISO format
28
+ */
29
+ endDateTime?: string;
30
+ /**
31
+ * The event type/category
32
+ */
33
+ eventType?: string;
34
+ /**
35
+ * The target audience for the event
36
+ */
37
+ audience?: string[];
38
+ /**
39
+ * The organization hosting the event
40
+ */
41
+ organization: EventOrganizationProps;
42
+ /**
43
+ * Event location information
44
+ */
45
+ location?: EventLocationProps;
46
+ /**
47
+ * The optional service email address
48
+ */
49
+ email?: string;
50
+ /**
51
+ * The optional costs of the event
52
+ */
53
+ fees?: string;
54
+ /**
55
+ * The event website address
56
+ */
57
+ url?: string;
58
+ /**
59
+ * The event website url title
60
+ */
61
+ websiteUrlTitle?: string;
62
+ /**
63
+ * An array of contacts with phone numbers
64
+ */
65
+ contacts?: ServiceContactProps[];
66
+ /**
67
+ * An optional array of files/links belonging to the event
68
+ */
69
+ uploads?: FileDownloadProps[];
70
+ /**
71
+ * An optional array of social profile links
72
+ */
73
+ socialProfiles?: SocialProfile[];
74
+ /**
75
+ * When the event was updated. Expected format YYYY-MM-DD
76
+ */
77
+ updatedAt?: string;
78
+ /**
79
+ * The url to the shortlist
80
+ */
81
+ shortListPath?: string;
82
+ /**
83
+ * Is this event recurring?
84
+ */
85
+ isRecurring?: boolean;
86
+ /**
87
+ * Recurrence pattern information
88
+ */
89
+ recurrencePattern?: string;
90
+ /**
91
+ * Registration deadline
92
+ */
93
+ registrationDeadline?: string;
94
+ /**
95
+ * Maximum capacity for the event
96
+ */
97
+ capacity?: number;
98
+ /**
99
+ * Current number of registered attendees
100
+ */
101
+ currentAttendees?: number;
102
+ }
103
+ export interface EventOrganizationProps {
104
+ /**
105
+ * The unique identifier for the organization
106
+ */
107
+ id: string;
108
+ /**
109
+ * The name of the organization
110
+ */
111
+ name: string;
112
+ /**
113
+ * The description of the organization
114
+ */
115
+ description?: string;
116
+ /**
117
+ * The full path to the organization logo
118
+ */
119
+ logo?: string;
120
+ /**
121
+ * The organization website address
122
+ */
123
+ url?: string;
124
+ }
125
+ export interface EventLocationProps {
126
+ /**
127
+ * The unique identifier for the location
128
+ */
129
+ id: number;
130
+ /**
131
+ * The name of the location
132
+ */
133
+ name: string;
134
+ /**
135
+ * The optional description
136
+ */
137
+ description?: string;
138
+ /**
139
+ * Is the location visitable by the public?
140
+ */
141
+ isVisitable?: boolean;
142
+ /**
143
+ * The latitude of the location
144
+ */
145
+ latitude?: string;
146
+ /**
147
+ * The longitude of the location
148
+ */
149
+ longitude?: string;
150
+ /**
151
+ * The address information
152
+ */
153
+ address?: EventAddressProps;
154
+ /**
155
+ * An array of facilities that the location offers
156
+ */
157
+ accessibility?: EventAccessibilityProps[];
158
+ /**
159
+ * Is this a virtual/online event?
160
+ */
161
+ isVirtual?: boolean;
162
+ /**
163
+ * Virtual meeting link/information
164
+ */
165
+ virtualMeetingInfo?: string;
166
+ }
167
+ export interface EventAddressProps {
168
+ /**
169
+ * The unique identifier
170
+ */
171
+ id: number;
172
+ /**
173
+ * The street number and address line 1
174
+ */
175
+ address1: string;
176
+ /**
177
+ * Address line 2
178
+ */
179
+ address2?: string;
180
+ /**
181
+ * The city
182
+ */
183
+ city: string;
184
+ /**
185
+ * The county
186
+ */
187
+ county: string;
188
+ /**
189
+ * The postcode
190
+ */
191
+ postcode: string;
192
+ /**
193
+ * The country
194
+ */
195
+ country: string;
196
+ }
197
+ export interface EventAccessibilityProps {
198
+ /**
199
+ * The unique identifier
200
+ */
201
+ id: number;
202
+ /**
203
+ * The name of the facility offered by the location
204
+ */
205
+ accessibility: string;
206
+ }
@@ -0,0 +1,3 @@
1
+ export { default } from './Event';
2
+ export * from './Event.types';
3
+ export * from './Event.storydata';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { EventListProps } from './EventList.types';
3
+ declare const EventList: React.FunctionComponent<EventListProps>;
4
+ export default EventList;
@@ -0,0 +1,3 @@
1
+ import { EventCategory } from './EventList.types';
2
+ export declare const ExampleEventTypes: EventCategory[];
3
+ export declare const ExampleAudiences: EventCategory[];
@@ -0,0 +1,152 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { EventProps } from '../Event/Event.types';
3
+ export interface EventListProps {
4
+ /**
5
+ * The base url for the events directory
6
+ */
7
+ eventsPath: string;
8
+ /**
9
+ * The url to the shortlist
10
+ */
11
+ shortListPath: string;
12
+ /**
13
+ * An array of Events
14
+ */
15
+ events: EventProps[];
16
+ /**
17
+ * The search term string
18
+ */
19
+ search?: string;
20
+ /**
21
+ * Function prop passed in to handle updating search
22
+ */
23
+ setSearch: Dispatch<SetStateAction<string>>;
24
+ /**
25
+ * The optional proximity the postcode will search. Defaults to 2 miles.
26
+ */
27
+ proximity?: number;
28
+ /**
29
+ * Should the postcode search be shown? Defaults to true.
30
+ */
31
+ showPostcodeSearch?: boolean;
32
+ /**
33
+ * The postcode search term
34
+ */
35
+ postcode?: string;
36
+ /**
37
+ * Function prop passed in to handle updating postcode
38
+ */
39
+ setPostcode: Dispatch<SetStateAction<string>>;
40
+ /**
41
+ * The total amount of results
42
+ */
43
+ totalResults?: number;
44
+ /**
45
+ * The current page number
46
+ */
47
+ pageNumber?: number;
48
+ /**
49
+ * Function prop passed in to handle the update page number
50
+ */
51
+ setPageNumber: Dispatch<SetStateAction<number>>;
52
+ /**
53
+ * The number of results per page
54
+ */
55
+ perPage?: number;
56
+ /**
57
+ * The max length of each event description extract
58
+ */
59
+ extractLength?: number;
60
+ /**
61
+ * The event type categories
62
+ */
63
+ eventTypes?: EventCategory[];
64
+ /**
65
+ * Function prop passed in to handle updating event types
66
+ */
67
+ setEventTypes: Dispatch<SetStateAction<EventCategory[]>>;
68
+ /**
69
+ * The audience categories
70
+ */
71
+ audiences?: EventCategory[];
72
+ /**
73
+ * Function prop passed in to handle updating audiences
74
+ */
75
+ setAudiences: Dispatch<SetStateAction<EventCategory[]>>;
76
+ /**
77
+ * The selected month filter (1-12)
78
+ */
79
+ selectedMonth?: number;
80
+ /**
81
+ * Function prop passed in to handle updating selected month
82
+ */
83
+ setSelectedMonth: Dispatch<SetStateAction<number | undefined>>;
84
+ /**
85
+ * The selected year filter
86
+ */
87
+ selectedYear?: number;
88
+ /**
89
+ * Function prop passed in to handle updating selected year
90
+ */
91
+ setSelectedYear: Dispatch<SetStateAction<number | undefined>>;
92
+ /**
93
+ * Where to centre the map, in the format 'lat,lng'
94
+ */
95
+ mapCenter?: string;
96
+ /**
97
+ * The optional zoom level, between 1 and 20. 1 = world, 20 = buildings
98
+ */
99
+ mapZoom?: number;
100
+ /**
101
+ * Is the data loading
102
+ */
103
+ isLoading: boolean;
104
+ /**
105
+ * Is the component in error state
106
+ */
107
+ isError?: boolean;
108
+ /**
109
+ * Should old events be hidden automatically? Defaults to true.
110
+ */
111
+ hideOldEvents?: boolean;
112
+ }
113
+ export interface EventCategory {
114
+ /**
115
+ * The category label
116
+ */
117
+ label: string;
118
+ /**
119
+ * The vocabulary name
120
+ */
121
+ vocabulary: string;
122
+ /**
123
+ * An array of taxonomies
124
+ */
125
+ options: EventTaxonomy[];
126
+ /**
127
+ * Should multiple options be allowed
128
+ */
129
+ singleSelection: boolean;
130
+ }
131
+ export interface EventTaxonomy {
132
+ /**
133
+ * Unique taxonomy identifier in curie format (e.g. eventType1)
134
+ */
135
+ id: string;
136
+ /**
137
+ * The name of the taxonomy
138
+ */
139
+ name: string;
140
+ /**
141
+ * The vocabulary name
142
+ */
143
+ vocabulary: string;
144
+ /**
145
+ * The optional parent taxonomy
146
+ */
147
+ parent?: string | null;
148
+ /**
149
+ * Is the option checked
150
+ */
151
+ checked: boolean;
152
+ }
@@ -0,0 +1,3 @@
1
+ export { default } from './EventList';
2
+ export * from './EventList.types';
3
+ export * from './EventList.storydata';
@@ -0,0 +1,5 @@
1
+ export { default as Event } from './Event';
2
+ export { default as EventList } from './EventList';
3
+ export * from './Event/Event.types';
4
+ export * from './EventList/EventList.types';
5
+ export * from './utils';
@@ -0,0 +1,57 @@
1
+ import { EventProps } from '../Event/Event.types';
2
+ /**
3
+ * Filters out events that have already ended based on their end date/time
4
+ * @param events Array of events to filter
5
+ * @param hideOldEvents Whether to hide old events (defaults to true)
6
+ * @returns Filtered array of events
7
+ */
8
+ export declare const filterOldEvents: (events: EventProps[], hideOldEvents?: boolean) => EventProps[];
9
+ /**
10
+ * Filters events by month and year
11
+ * @param events Array of events to filter
12
+ * @param selectedMonth Month (1-12) or undefined for all months
13
+ * @param selectedYear Year or undefined for all years
14
+ * @returns Filtered array of events
15
+ */
16
+ export declare const filterEventsByDate: (events: EventProps[], selectedMonth?: number, selectedYear?: number) => EventProps[];
17
+ /**
18
+ * Filters events by event type
19
+ * @param events Array of events to filter
20
+ * @param selectedEventTypes Array of selected event type IDs
21
+ * @returns Filtered array of events
22
+ */
23
+ export declare const filterEventsByType: (events: EventProps[], selectedEventTypes: string[]) => EventProps[];
24
+ /**
25
+ * Filters events by audience
26
+ * @param events Array of events to filter
27
+ * @param selectedAudiences Array of selected audience IDs
28
+ * @returns Filtered array of events
29
+ */
30
+ export declare const filterEventsByAudience: (events: EventProps[], selectedAudiences: string[]) => EventProps[];
31
+ /**
32
+ * Filters events by search term (searches in name and description)
33
+ * @param events Array of events to filter
34
+ * @param searchTerm Search term to look for
35
+ * @returns Filtered array of events
36
+ */
37
+ export declare const filterEventsBySearch: (events: EventProps[], searchTerm: string) => EventProps[];
38
+ /**
39
+ * Sorts events by date (earliest first)
40
+ * @param events Array of events to sort
41
+ * @returns Sorted array of events
42
+ */
43
+ export declare const sortEventsByDate: (events: EventProps[]) => EventProps[];
44
+ /**
45
+ * Comprehensive filter function that applies all filters
46
+ * @param events Array of events to filter
47
+ * @param filters Object containing all filter criteria
48
+ * @returns Filtered and sorted array of events
49
+ */
50
+ export declare const applyAllEventFilters: (events: EventProps[], filters: {
51
+ hideOldEvents?: boolean;
52
+ selectedMonth?: number;
53
+ selectedYear?: number;
54
+ selectedEventTypes?: string[];
55
+ selectedAudiences?: string[];
56
+ searchTerm?: string;
57
+ }) => EventProps[];
@@ -0,0 +1 @@
1
+ export * from './EventFilters';
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { EventProps } from '../../events/Event/Event.types';
3
+ import { BreadcrumbProp } from '../../structure/Breadcrumbs/Breadcrumbs.types';
4
+ interface EventPageProps {
5
+ event: EventProps;
6
+ breadcrumbs?: BreadcrumbProp[];
7
+ footerLinks?: Array<{
8
+ title: string;
9
+ url: string;
10
+ }>;
11
+ }
12
+ export declare const EventPage: React.FunctionComponent<EventPageProps>;
13
+ export {};
@@ -0,0 +1 @@
1
+ export { EventPage } from './EventPage';
@@ -21,9 +21,12 @@ export interface CaseAppointmentProps {
21
21
  courtroomFullAddress: string;
22
22
  appointmentType: string;
23
23
  startDateTime: string;
24
+ endDateTime?: string | null;
24
25
  }
25
26
  export declare enum CaseAppointmentType {
26
- Hearing = "hearing",
27
+ Formal = "formal",
28
+ Hearing = "inquest hearing",
27
29
  Opening = "opening",
30
+ PreInquest = "pre-inquest review",
28
31
  Writing = "writing"
29
32
  }
@@ -45,4 +45,8 @@ export interface Roadwork {
45
45
  * The responsible organisation
46
46
  */
47
47
  responsibility: string;
48
+ /**
49
+ * Optional URL link for more information about the roadworks
50
+ */
51
+ urlLinkAddress?: string;
48
52
  }
@@ -26,11 +26,12 @@ import Image from './library/slices/Image/Image';
26
26
  import ImageAndText from './library/slices/ImageAndText/ImageAndText';
27
27
  import InquestSchedule from './library/slices/InquestSchedule/InquestSchedule';
28
28
  import Promotions from './library/slices/Promotions/Promotions';
29
+ import RoadworksList from './library/slices/RoadworksList/RoadworksList';
29
30
  import SearchBox from './library/slices/SearchBox/SearchBox';
30
31
  import Video from './library/slices/Video/Video';
31
32
  import WarningText from './library/slices/WarningText/WarningText';
32
33
  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 { Accordion, BlockQuote, CallToAction, Cards, CouncilTaxAlphabeticalDirectory, Divider, DownloadableFiles, GoogleMap, Image, ImageAndText, InquestSchedule, Promotions, RoadworksList, SearchBox, Video, WarningText, WarningTextDisclaimer, };
34
35
  export * from './library/structure/PageStructures';
35
36
  export { GDS_theme, north_theme, west_theme, lb_theme_north, lb_theme_west } from './themes/theme_generator';
36
37
  export { GlobalStyleReset } from './themes/GlobalStyleReset.jsx';
@@ -8,6 +8,14 @@ export interface SummaryListProps {
8
8
  * Option to remove margin (default is true)
9
9
  */
10
10
  hasMargin?: boolean;
11
+ /**
12
+ * Option to show borders (default is true)
13
+ */
14
+ hasBorders?: boolean;
15
+ /**
16
+ * Optional heading for the summary list
17
+ */
18
+ heading?: string;
11
19
  }
12
20
  export interface SummaryRowProps {
13
21
  /**
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { EventProps } from './Event.types';
3
+ declare const Event: React.FunctionComponent<EventProps>;
4
+ export default Event;
@@ -0,0 +1,4 @@
1
+ import { EventProps } from './Event.types';
2
+ export declare const ExampleEvent: EventProps;
3
+ export declare const ExampleVirtualEvent: EventProps;
4
+ export declare const ExampleEvents: EventProps[];