@nnc-digital/nnc-design-system 1.0.0-beta5 → 1.0.0-beta7
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 +46 -5
- package/build/index.js.map +1 -1
- package/build/index.mjs.js +46 -5
- package/build/index.mjs.js.map +1 -1
- 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/RoadworksList/RoadworksList.types.d.ts +4 -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/RoadworksList/RoadworksList.types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -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';
|
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-beta7",
|
|
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": {
|