northants-design-system 3.2.2 → 3.3.0

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 (29) hide show
  1. package/build/index.d.ts +1 -3
  2. package/build/index.js +240 -135
  3. package/build/index.js.map +1 -1
  4. package/build/index.mjs.js +242 -135
  5. package/build/index.mjs.js.map +1 -1
  6. package/build/library/components/MapInfoWindow/MapInfoWindow.d.ts +4 -0
  7. package/build/library/components/MapInfoWindow/MapInfoWindow.types.d.ts +6 -0
  8. package/build/library/components/MapMarker/MapMarker.d.ts +2 -4
  9. package/build/library/components/MapMarker/MapMarker.types.d.ts +46 -0
  10. package/build/library/components/StaticMap/StaticMap.d.ts +6 -0
  11. package/build/library/components/StaticMap/StaticMap.types.d.ts +7 -3
  12. package/build/library/directory/DirectoryService/DirectoryService.storydata.d.ts +4 -0
  13. package/build/library/directory/DirectoryServiceMapMarker/DirectoryServiceMapMarker.d.ts +4 -0
  14. package/build/library/directory/DirectoryServiceMapMarker/DirectoryServiceMapMarker.types.d.ts +45 -0
  15. package/build/library/directory/DirectoryServiceMapMarkerSet/DirectoryServiceMapMarkerSet.d.ts +4 -0
  16. package/build/library/directory/DirectoryServiceMapMarkerSet/DirectoryServiceMapMarkerSet.storydata.d.ts +5 -0
  17. package/build/library/directory/DirectoryServiceMapMarkerSet/DirectoryServiceMapMarkerSet.types.d.ts +53 -0
  18. package/build/library/directory/DirectoryServiceStaticMap/DirectoryServiceStaticMap.d.ts +4 -0
  19. package/build/library/directory/DirectoryServiceStaticMap/DirectoryServiceStaticMap.types.d.ts +11 -0
  20. package/package.json +4 -5
  21. package/build/library/slices/LinkBlock/LinkBlock.d.ts +0 -4
  22. package/build/library/slices/LinkBlock/LinkBlock.types.d.ts +0 -36
  23. package/build/library/structure/CludoNewsSearch/CludoNewsDateSearch.d.ts +0 -6
  24. package/build/library/structure/CludoNewsSearch/CludoNewsResultCount.d.ts +0 -3
  25. package/build/library/structure/CludoNewsSearch/CludoNewsSearch.d.ts +0 -4
  26. package/build/library/structure/CludoNewsSearch/CludoNewsSearch.test.d.ts +0 -1
  27. package/build/library/structure/CludoNewsSearch/CludoNewsSearch.types.d.ts +0 -18
  28. package/build/library/structure/CludoNewsSearch/CludoNewsSort.d.ts +0 -3
  29. /package/build/library/{slices/LinkBlock/LinkBlock.test.d.ts → components/MapInfoWindow/MapInfoWindow.test.d.ts} +0 -0
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { MapInfoWindowProps } from "./MapInfoWindow.types";
3
+ declare const MapInfoWindow: React.FunctionComponent<MapInfoWindowProps>;
4
+ export default MapInfoWindow;
@@ -0,0 +1,6 @@
1
+ export interface MapInfoWindowProps {
2
+ /**
3
+ * What is this?
4
+ */
5
+ foo: string;
6
+ }
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
- /**
3
- * A Google Maps marker to be placed inside a Map component
4
- */
5
- declare const MapMarker: React.FunctionComponent<google.maps.MarkerOptions>;
2
+ import { MapMarkerProps } from './MapMarker.types';
3
+ declare const MapMarker: React.FunctionComponent<MapMarkerProps>;
6
4
  export default MapMarker;
@@ -0,0 +1,46 @@
1
+ export interface MapMarkerProps {
2
+ /**
3
+ * The 'Advanced Marker Element Options' as defined by Google
4
+ * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions
5
+ *
6
+ * 'Pin Element Options' can be set through the 'content' attribute
7
+ * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#PinElementOptions
8
+ */
9
+ advancedMarkerElementOptions?: google.maps.marker.AdvancedMarkerElementOptions;
10
+ /**
11
+ * Appearance options for the marker's pin (glyph text/colour, background,
12
+ * scale, etc.). Merged over the component's theme-based defaults.
13
+ * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#PinElementOptions
14
+ */
15
+ pinElementOptions?: google.maps.marker.PinElementOptions;
16
+ /**
17
+ * The content to be displayed in the InfoWindow when this Marker is clicked on
18
+ */
19
+ infoWindowContent?: React.ReactNode;
20
+ /**
21
+ * The index, assigned by the parent map, to uniquely identify this Marker
22
+ * (e.g. when recording that its InfoWindow is open).
23
+ */
24
+ markerIndex?: number;
25
+ /**
26
+ * The index of the InfoWindow that has been recorded by the parent map
27
+ * as being currently open
28
+ */
29
+ currentlyOpenInfoWindow: number;
30
+ /**
31
+ * The function to change the currently open InfoWindow that has been
32
+ * recorded by the parent map
33
+ */
34
+ setCurrentlyOpenInfowindow: (n: number) => void;
35
+ /**
36
+ * The reset signal count to be used by the Parent Map to instruct this
37
+ * Marker to close its InfoWindow (e.g. when the map or another marker is clicked on)
38
+ * (this parameter will be incremented whenever the parent wishes to initiate InfoWindow closure)
39
+ */
40
+ resetSignal: number;
41
+ /**
42
+ * A function that can be used when this Marker wants to instruct its parent
43
+ * that its InfoWindow has been clicked on
44
+ */
45
+ initiateResetOfAnotherMarker: (n: number) => void;
46
+ }
@@ -1,5 +1,11 @@
1
1
  import React from 'react';
2
2
  import { StaticMapProps } from './StaticMap.types';
3
+ /**
4
+ * A function to validate whether a given latitude/longitude pair are valid
5
+ * Ths function can be used to prevent untrusted backend/CMS values from
6
+ * injecting extra query parameters into the Static Maps request.
7
+ */
8
+ export declare const isValidLatLng: (lat: unknown, lng: unknown) => boolean;
3
9
  /**
4
10
  * A static Google map with optional markers
5
11
  */
@@ -12,9 +12,9 @@ export interface StaticMapProps {
12
12
  */
13
13
  mapType?: 'roadmap' | 'satellite' | 'terrain' | 'hybrid';
14
14
  /**
15
- * An array of map markers
15
+ * An optional array of map markers
16
16
  */
17
- mapMarkers?: MapMarkerProps[];
17
+ mapMarkers?: StaticMapMarkerProps[];
18
18
  /**
19
19
  * The size of the map in the format wxh, such as 640x320
20
20
  */
@@ -24,7 +24,7 @@ export interface StaticMapProps {
24
24
  */
25
25
  zoom?: number;
26
26
  }
27
- export interface MapMarkerProps {
27
+ export interface StaticMapMarkerProps {
28
28
  /**
29
29
  * Optional marker colour. Default is red
30
30
  */
@@ -49,4 +49,8 @@ export interface MapMarkerProps {
49
49
  * Optional marker title
50
50
  */
51
51
  title?: string;
52
+ /**
53
+ * The content to be displayed in the InfoWindow when this Marker is clicked on
54
+ */
55
+ infoWindowContent?: React.ReactNode;
52
56
  }
@@ -3,3 +3,7 @@ export declare const ExampleService: DirectoryServiceProps;
3
3
  export declare const MultipleLocations: LocationProps[];
4
4
  export declare const OneVisitableLocation: LocationProps[];
5
5
  export declare const OneVisitableLocationNoLatLon: LocationProps[];
6
+ export declare const locationsFormerNorthantsCC: LocationProps[];
7
+ export declare const locationsFormerNptonBorough: LocationProps[];
8
+ export declare const locationsInTowcesterFormerSNC: LocationProps[];
9
+ export declare const locationsInDaventryFormerDDC: LocationProps[];
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DirectoryServiceMapMarkerProps } from './DirectoryServiceMapMarker.types';
3
+ declare const DirectoryServiceMapMarker: React.FunctionComponent<DirectoryServiceMapMarkerProps>;
4
+ export default DirectoryServiceMapMarker;
@@ -0,0 +1,45 @@
1
+ import { DirectoryServiceProps } from '../DirectoryService/DirectoryService.types';
2
+ export interface DirectoryServiceMapMarkerProps {
3
+ /**
4
+ * The 'Advanced Marker Element Options' as defined by Google
5
+ * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions
6
+ *
7
+ * 'Pin Element Options' can be set through the 'content' attribute
8
+ * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#PinElementOptions
9
+ */
10
+ advancedMarkerElementOptions: google.maps.marker.AdvancedMarkerElementOptions;
11
+ /**
12
+ * The 'Directory Path'
13
+ */
14
+ directoryPath?: string;
15
+ /**
16
+ * The 'Directory Service' which this 'Advanced Map Marker' is intended to represent
17
+ */
18
+ directoryService?: DirectoryServiceProps;
19
+ /**
20
+ * The index, assigned by the parent map, to uniquely identify this Marker
21
+ * (e.g. when recording that its InfoWindow is open)
22
+ */
23
+ index: number;
24
+ /**
25
+ * The index of the InfoWindow that has been recorded by the parent map
26
+ * as being currently open
27
+ */
28
+ currentlyOpenInfoWindow: number;
29
+ /**
30
+ * The function to change the currently open InfoWindow that has been
31
+ * recorded by the parent map
32
+ */
33
+ setCurrentlyOpenInfowindow: (n: number) => void;
34
+ /**
35
+ * The reset signal count to be used by the Parent Map to instruct this
36
+ * Marker to close its InfoWindow (e.g. when the map or another marker is clicked on)
37
+ * (this parameter will be incremented whenever the parent wishes to initiate InfoWindow closure)
38
+ */
39
+ resetSignal: number;
40
+ /**
41
+ * A function that can be used when this Marker wants to instruct its parent
42
+ * that its InfoWindow has been clicked on
43
+ */
44
+ initiateResetOfAnotherMarker: (n: number) => void;
45
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DirectoryServiceMapMarkerSetProps } from './DirectoryServiceMapMarkerSet.types';
3
+ declare const DirectoryServiceMapMarkerSet: React.FunctionComponent<DirectoryServiceMapMarkerSetProps>;
4
+ export default DirectoryServiceMapMarkerSet;
@@ -0,0 +1,5 @@
1
+ import { LocationProps } from '../DirectoryService/DirectoryService.types';
2
+ export declare const formerNCCmainBuildings: LocationProps[];
3
+ export declare const formerNBCmainBuildings: LocationProps[];
4
+ export declare const formerSNCmainBuildings: LocationProps[];
5
+ export declare const formerDDCmainBuildings: LocationProps[];
@@ -0,0 +1,53 @@
1
+ import { DirectoryServiceProps } from '../DirectoryService/DirectoryService.types';
2
+ export interface DirectoryServiceMapMarkerSetProps {
3
+ /**
4
+ * The 'Advanced Marker Element Options' as defined by Google
5
+ * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions
6
+ *
7
+ * 'Pin Element Options' can be set through the 'content' attribute
8
+ * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#PinElementOptions
9
+ */
10
+ advancedMarkerElementOptions: google.maps.marker.AdvancedMarkerElementOptions;
11
+ /**
12
+ * The 'Directory Path'
13
+ */
14
+ directoryPath?: string;
15
+ /**
16
+ * The 'Directory Service' which this 'Advanced Map Marker' is intended to represent
17
+ * It is assumed that the Directory Service has multiple locations recorded against it
18
+ * and therefore a whole 'set' of GPS coordinates that need to be displayed on the map
19
+ * (though this component can cater for a Directory Service that only has 1 location)
20
+ */
21
+ directoryService: DirectoryServiceProps;
22
+ /**
23
+ * The index of the InfoWindow that has been recorded by the parent map
24
+ * as being currently open
25
+ */
26
+ currentlyOpenInfoWindow: number;
27
+ /**
28
+ * The function to change the currently open InfoWindow that has been
29
+ * recorded by the parent map
30
+ */
31
+ setCurrentlyOpenInfowindow: (n: number) => void;
32
+ /**
33
+ * The reset signal count to be used by the Parent Map to instruct this
34
+ * Marker to close its InfoWindow (e.g. when the map or another marker is clicked on)
35
+ * (this parameter will be incremented whenever the parent wishes to initiate InfoWindow closure)
36
+ */
37
+ resetSignals: number[];
38
+ /**
39
+ * The "index offset", assigned by the parent map, to uniquely identify this "Marker Set"
40
+ * (e.g. when recording that its various InfoWindow is open)
41
+ */
42
+ minIndex?: number;
43
+ /**
44
+ * The "index offset", assigned by the parent map, to uniquely identify this "Marker Set"
45
+ * (e.g. when recording that its various InfoWindow is open)
46
+ */
47
+ maxIndex?: number;
48
+ /**
49
+ * A function that can be used when this Marker wants to instruct its parent
50
+ * that its InfoWindow has been clicked on
51
+ */
52
+ initiateResetOfAnotherMarker: (n: number) => void;
53
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DirectoryServiceStaticMapProps } from './DirectoryServiceStaticMap.types';
3
+ declare const DirectoryServiceStaticMap: React.FunctionComponent<DirectoryServiceStaticMapProps>;
4
+ export default DirectoryServiceStaticMap;
@@ -0,0 +1,11 @@
1
+ import { StaticMapProps } from '../../components/StaticMap/StaticMap.types';
2
+ export interface DirectoryServiceStaticMapProps {
3
+ /**
4
+ * What is this?
5
+ */
6
+ staticMapProps: StaticMapProps;
7
+ /**
8
+ * Show multiple locations?
9
+ */
10
+ showSecondaryLocationsToo?: boolean;
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "northants-design-system",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "private": false,
5
5
  "description": "Design system for West & North Northamptonshire Councils, two unitary councils encompassing Wellingborough, Corby, Daventry, East Northants, Kettering, Northampton, Northamptonshire County and South Northants.",
6
6
  "main": "build/index.js",
@@ -45,7 +45,7 @@
45
45
  ],
46
46
  "peerDependencies": {
47
47
  "@cludosearch/cludo-search-components": "^1.0.146",
48
- "@googlemaps/react-wrapper": ">=1.1.35",
48
+ "@vis.gl/react-google-maps": "^1.10.1",
49
49
  "axios": "^1",
50
50
  "react": "^19.2.3",
51
51
  "react-dom": "^19.2.3",
@@ -65,8 +65,6 @@
65
65
  "@eslint-react/eslint-plugin": "^5.7.4",
66
66
  "@eslint/js": "^10.0.1",
67
67
  "@etchteam/storybook-addon-status": "^8.0.0",
68
- "@googlemaps/react-wrapper": "^1.1.35",
69
- "@googlemaps/typescript-guards": "^2.0.3",
70
68
  "@rollup/plugin-commonjs": "^29.0.0",
71
69
  "@rollup/plugin-json": "^6",
72
70
  "@rollup/plugin-node-resolve": "^16",
@@ -80,13 +78,14 @@
80
78
  "@testing-library/dom": "^10.4.0",
81
79
  "@testing-library/jest-dom": "^6.0",
82
80
  "@testing-library/react": "^16.0.0",
83
- "@types/google.maps": "^3.50.5",
81
+ "@types/google.maps": "^3.66.4",
84
82
  "@types/jest": "^30.0.0",
85
83
  "@types/jest-axe": "^3.5.9",
86
84
  "@types/react": "^19.2.3",
87
85
  "@types/react-dom": "^19.2.3",
88
86
  "@typescript-eslint/eslint-plugin": "^8.0",
89
87
  "@typescript-eslint/parser": "^8.0",
88
+ "@vis.gl/react-google-maps": "^1.10.1",
90
89
  "axios": "^1",
91
90
  "colors": "^1.4.0",
92
91
  "dayjs": "^1.10.7",
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { LinkBlockProps } from './LinkBlock.types';
3
- declare const LinkBlock: React.FunctionComponent<LinkBlockProps>;
4
- export default LinkBlock;
@@ -1,36 +0,0 @@
1
- export interface LinkBlockProps {
2
- /**
3
- * The title for the link block
4
- */
5
- title?: string;
6
- /**
7
- * An array of links
8
- */
9
- links: BlockLink[];
10
- /**
11
- * The optional alt text
12
- */
13
- imageAltText?: string | null;
14
- /**
15
- * The optional small image url
16
- */
17
- imageSmall?: string | null;
18
- /**
19
- * The optional large image url
20
- */
21
- imageLarge?: string | null;
22
- }
23
- export interface BlockLink {
24
- /**
25
- * The url for the link
26
- */
27
- url: string;
28
- /**
29
- * The text for the link
30
- */
31
- title: string;
32
- /**
33
- * The optional summary text to describe the link
34
- */
35
- summary?: string | null;
36
- }
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- interface CludoNewsDateSearchProps {
3
- firstArticleDate?: string;
4
- }
5
- declare const CludoNewsDateSearch: React.FunctionComponent<CludoNewsDateSearchProps>;
6
- export default CludoNewsDateSearch;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const CludoNewsResultCount: React.FunctionComponent;
3
- export default CludoNewsResultCount;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { CludoNewsSearchProps } from './CludoNewsSearch.types';
3
- declare const CludoNewsSearch: React.FunctionComponent<CludoNewsSearchProps>;
4
- export default CludoNewsSearch;
@@ -1,18 +0,0 @@
1
- export interface CludoNewsSearchProps {
2
- /**
3
- * The optional search term
4
- */
5
- searchTerm?: string;
6
- /**
7
- * The cludo customer Id
8
- */
9
- customerId: number;
10
- /**
11
- * The cludo engine Id
12
- */
13
- engineId: number;
14
- /**
15
- * Optional first article date to work out the start year
16
- */
17
- firstArticleDate?: string;
18
- }
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const CludoNewsSort: React.FunctionComponent;
3
- export default CludoNewsSort;