@cdc/map 4.24.12 → 4.25.1

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 (60) hide show
  1. package/dist/cdcmap.js +51010 -49337
  2. package/examples/annotation/index.json +1 -1
  3. package/examples/custom-map-layers.json +1 -1
  4. package/examples/default-geocode.json +2 -2
  5. package/examples/private/DEV-9989.json +229 -0
  6. package/examples/private/ardi.json +180 -0
  7. package/examples/private/colors 2.json +416 -0
  8. package/examples/private/colors.json +416 -0
  9. package/examples/private/colors.json.zip +0 -0
  10. package/examples/private/customColors.json +45348 -0
  11. package/examples/private/mmr.json +246 -0
  12. package/examples/private/test.json +1632 -0
  13. package/index.html +12 -14
  14. package/package.json +8 -3
  15. package/src/CdcMap.tsx +126 -394
  16. package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +9 -0
  17. package/src/_stories/CdcMap.stories.tsx +1 -1
  18. package/src/_stories/GoogleMap.stories.tsx +19 -0
  19. package/src/_stories/_mock/DEV-10148.json +859 -0
  20. package/src/_stories/_mock/DEV-9989.json +229 -0
  21. package/src/_stories/_mock/example-city-state.json +1 -1
  22. package/src/_stories/_mock/google-map.json +819 -0
  23. package/src/components/Annotation/Annotation.Draggable.tsx +34 -43
  24. package/src/components/Annotation/AnnotationDropdown.tsx +4 -4
  25. package/src/components/CityList.tsx +2 -2
  26. package/src/components/DataTable.tsx +8 -9
  27. package/src/components/EditorPanel/components/EditorPanel.tsx +96 -270
  28. package/src/components/GoogleMap/components/GoogleMap.tsx +67 -0
  29. package/src/components/GoogleMap/index.tsx +3 -0
  30. package/src/components/Legend/components/Legend.tsx +40 -30
  31. package/src/components/Legend/components/LegendItem.Hex.tsx +7 -3
  32. package/src/components/Legend/components/index.scss +22 -16
  33. package/src/components/Modal.tsx +6 -5
  34. package/src/components/NavigationMenu.tsx +5 -4
  35. package/src/components/UsaMap/components/TerritoriesSection.tsx +56 -0
  36. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +3 -3
  37. package/src/components/UsaMap/components/UsaMap.County.tsx +1 -1
  38. package/src/components/UsaMap/components/UsaMap.Region.tsx +12 -8
  39. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +2 -2
  40. package/src/components/UsaMap/components/UsaMap.State.tsx +23 -29
  41. package/src/components/WorldMap/WorldMap.tsx +3 -5
  42. package/src/context.ts +0 -12
  43. package/src/data/initial-state.js +2 -2
  44. package/src/data/supported-geos.js +23 -3
  45. package/src/helpers/applyColorToLegend.ts +3 -3
  46. package/src/helpers/closeModal.ts +9 -0
  47. package/src/helpers/handleMapAriaLabels.ts +38 -0
  48. package/src/helpers/indexOfIgnoreType.ts +8 -0
  49. package/src/helpers/navigationHandler.ts +21 -0
  50. package/src/helpers/toTitleCase.ts +44 -0
  51. package/src/helpers/validateFipsCodeLength.ts +30 -0
  52. package/src/hooks/useResizeObserver.ts +42 -0
  53. package/src/hooks/useTooltip.ts +4 -2
  54. package/src/index.jsx +1 -0
  55. package/src/scss/editor-panel.scss +2 -1
  56. package/src/scss/filters.scss +0 -5
  57. package/src/scss/main.scss +57 -61
  58. package/src/scss/map.scss +1 -13
  59. package/src/types/MapConfig.ts +20 -11
  60. package/src/types/MapContext.ts +4 -12
@@ -1,11 +1,10 @@
1
- import { type MapConfig, type ViewportSize } from './MapConfig'
1
+ import { type MapConfig } from './MapConfig'
2
+ import { type ViewPort } from '@cdc/core/types/ViewPort'
2
3
 
3
4
  export type MapContext = {
4
5
  applyLegendToRow
5
6
  applyTooltipsToGeo
6
- closeModal
7
- columnsInData
8
- currentViewport: ViewportSize
7
+ currentViewport: ViewPort
9
8
  data
10
9
  displayDataAsText
11
10
  displayGeoName
@@ -16,7 +15,6 @@ export type MapContext = {
16
15
  handleCircleClick: Function
17
16
  handleDragStateChange: Function
18
17
  isDraggingAnnotation: boolean
19
- handleMapAriaLabels
20
18
  hasZoom
21
19
  innerContainerRef
22
20
  isDashboard
@@ -25,7 +23,6 @@ export type MapContext = {
25
23
  isFilterValueSupported: boolean
26
24
  loadConfig
27
25
  logo: string
28
- navigationHandler
29
26
  position
30
27
  resetLegendToggles
31
28
  runtimeFilters
@@ -38,13 +35,8 @@ export type MapContext = {
38
35
  setRuntimeFilters
39
36
  setRuntimeLegend
40
37
  setSharedFilterValue
41
- setState
38
+ setState: (newState: MapConfig) => MapConfig
42
39
  state: MapConfig
43
- supportedCities
44
- supportedCounties
45
- supportedCountries
46
- supportedTerritories
47
- titleCase
48
40
  viewport
49
41
  setStateToShow: (string) => void
50
42
  stateToShow: string