@nnc-digital/nnc-design-system 1.0.0-beta1 → 1.0.0-beta10
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 +2 -1
- package/build/index.js +487 -218
- package/build/index.js.map +1 -1
- package/build/index.mjs.js +487 -219
- package/build/index.mjs.js.map +1 -1
- package/build/library/components/SummaryList/SummaryList.types.d.ts +8 -0
- package/build/library/events/Event/Event.d.ts +4 -0
- package/build/library/events/Event/Event.storydata.d.ts +4 -0
- package/build/library/events/Event/Event.types.d.ts +206 -0
- package/build/library/events/Event/index.d.ts +3 -0
- package/build/library/events/EventList/EventList.d.ts +4 -0
- package/build/library/events/EventList/EventList.storydata.d.ts +3 -0
- package/build/library/events/EventList/EventList.types.d.ts +152 -0
- package/build/library/events/EventList/index.d.ts +3 -0
- package/build/library/events/index.d.ts +5 -0
- package/build/library/events/utils/EventFilters.d.ts +57 -0
- package/build/library/events/utils/index.d.ts +1 -0
- package/build/library/pages/EventPage/EventPage.d.ts +13 -0
- package/build/library/pages/EventPage/index.d.ts +1 -0
- package/build/library/slices/InquestSchedule/InquestSchedule.types.d.ts +4 -1
- package/build/library/slices/RoadworksList/RoadworksList.types.d.ts +4 -0
- package/build/src/index.d.ts +2 -1
- package/build/src/library/components/SummaryList/SummaryList.types.d.ts +8 -0
- package/build/src/library/events/Event/Event.d.ts +4 -0
- package/build/src/library/events/Event/Event.storydata.d.ts +4 -0
- package/build/src/library/events/Event/Event.types.d.ts +206 -0
- package/build/src/library/events/Event/index.d.ts +3 -0
- package/build/src/library/events/EventList/EventList.d.ts +4 -0
- package/build/src/library/events/EventList/EventList.storydata.d.ts +3 -0
- package/build/src/library/events/EventList/EventList.types.d.ts +152 -0
- package/build/src/library/events/EventList/index.d.ts +3 -0
- package/build/src/library/events/index.d.ts +5 -0
- package/build/src/library/events/utils/EventFilters.d.ts +57 -0
- package/build/src/library/events/utils/index.d.ts +1 -0
- package/build/src/library/pages/EventPage/EventPage.d.ts +13 -0
- package/build/src/library/pages/EventPage/index.d.ts +1 -0
- package/build/src/library/slices/InquestSchedule/InquestSchedule.types.d.ts +4 -1
- package/build/src/library/slices/RoadworksList/RoadworksList.types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -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,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,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
|
-
|
|
27
|
+
Formal = "formal",
|
|
28
|
+
Hearing = "inquest hearing",
|
|
27
29
|
Opening = "opening",
|
|
30
|
+
PreInquest = "pre-inquest review",
|
|
28
31
|
Writing = "writing"
|
|
29
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nnc-digital/nnc-design-system",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta10",
|
|
4
4
|
"description": "Design system for West & North Northamptonshire Councils, two unitary councils encompassing Wellingborough, Corby, Daventry, East Northants, Kettering, Northampton, Northamptonshire County and South Northants.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"repository": {
|