@undp/data-viz 2.3.17 → 2.4.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.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.cjs.map +1 -1
- package/dist/AreaChart.d.ts +2 -0
- package/dist/AreaChart.js +356 -354
- package/dist/AreaChart.js.map +1 -1
- package/dist/{Axis-Jt_tmhxS.cjs → Axis-BTaS9oPQ.cjs} +2 -2
- package/dist/{Axis-Jt_tmhxS.cjs.map → Axis-BTaS9oPQ.cjs.map} +1 -1
- package/dist/{Axis-RyGdzLrG.js → Axis-CNZYWzH0.js} +2 -2
- package/dist/{Axis-RyGdzLrG.js.map → Axis-CNZYWzH0.js.map} +1 -1
- package/dist/{AxisTitle-DGjX1_2v.js → AxisTitle-CyLCqpW6.js} +2 -2
- package/dist/{AxisTitle-DGjX1_2v.js.map → AxisTitle-CyLCqpW6.js.map} +1 -1
- package/dist/{AxisTitle-DV4n0RxE.cjs → AxisTitle-DP_evhbe.cjs} +2 -2
- package/dist/{AxisTitle-DV4n0RxE.cjs.map → AxisTitle-DP_evhbe.cjs.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.d.ts +6 -0
- package/dist/BarGraph.js +1735 -1726
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.cjs.map +1 -1
- package/dist/BasicStatCard.d.ts +2 -0
- package/dist/BasicStatCard.js +46 -45
- package/dist/BasicStatCard.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.d.ts +2 -0
- package/dist/BeeSwarmChart.js +266 -266
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +300 -298
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.d.ts +2 -0
- package/dist/BulletChart.js +469 -469
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.d.ts +2 -0
- package/dist/ButterflyChart.js +330 -328
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +303 -301
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.d.ts +2 -0
- package/dist/CirclePackingGraph.js +4 -4
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +1 -1
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +7 -9
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +10 -12
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.cjs.map +1 -1
- package/dist/DataTable.d.ts +2 -0
- package/dist/DataTable.js +103 -102
- package/dist/DataTable.js.map +1 -1
- package/dist/{DetailsModal-C3qlUyFK.js → DetailsModal-B2XBWR7w.js} +4 -4
- package/dist/{DetailsModal-C3qlUyFK.js.map → DetailsModal-B2XBWR7w.js.map} +1 -1
- package/dist/{DetailsModal-DIRTulvr.cjs → DetailsModal-jmmKRMRM.cjs} +2 -2
- package/dist/{DetailsModal-DIRTulvr.cjs.map → DetailsModal-jmmKRMRM.cjs.map} +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.d.ts +4 -0
- package/dist/DifferenceLineChart.js +441 -437
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.d.ts +4 -0
- package/dist/DonutChart.js +146 -142
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +265 -268
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-NNpOs7DX.cjs → DropdownSelect-CX1yMemd.cjs} +2 -2
- package/dist/DropdownSelect-CX1yMemd.cjs.map +1 -0
- package/dist/{DropdownSelect-B2WTeedJ.js → DropdownSelect-Dz7imdTB.js} +6 -9
- package/dist/DropdownSelect-Dz7imdTB.js.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.d.ts +4 -0
- package/dist/DualAxisLineChart.js +336 -332
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.d.ts +2 -0
- package/dist/DumbbellChart.js +484 -484
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-B4c-CrXs.cjs → EmptyState-CFmiFPHz.cjs} +2 -2
- package/dist/{EmptyState-B4c-CrXs.cjs.map → EmptyState-CFmiFPHz.cjs.map} +1 -1
- package/dist/{EmptyState-B3fPoH6L.js → EmptyState-CaxXCkiN.js} +4 -4
- package/dist/{EmptyState-B3fPoH6L.js.map → EmptyState-CaxXCkiN.js.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +111 -111
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +71 -71
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +83 -83
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/{GraphContainer-DwMxWRCi.js → GraphContainer-B8ZqOzKI.js} +2 -2
- package/dist/{GraphContainer-DwMxWRCi.js.map → GraphContainer-B8ZqOzKI.js.map} +1 -1
- package/dist/{GraphContainer-B1EDxJ0S.cjs → GraphContainer-Cul9b74X.cjs} +2 -2
- package/dist/{GraphContainer-B1EDxJ0S.cjs.map → GraphContainer-Cul9b74X.cjs.map} +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CnJf8b50.js → GraphEl-B73N4RIA.js} +48 -10
- package/dist/GraphEl-B73N4RIA.js.map +1 -0
- package/dist/GraphEl-Lt1og0C-.cjs +2 -0
- package/dist/GraphEl-Lt1og0C-.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +2 -2
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +6 -6
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.cjs.map +1 -1
- package/dist/HeatMap.d.ts +4 -0
- package/dist/HeatMap.js +158 -155
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.cjs.map +1 -1
- package/dist/Histogram.d.ts +2 -0
- package/dist/Histogram.js +81 -80
- package/dist/Histogram.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.d.ts +2 -0
- package/dist/HybridMap.js +314 -315
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.d.ts +2 -0
- package/dist/LineChartWithConfidenceInterval.js +367 -365
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.cjs.map +1 -1
- package/dist/LinearColorLegend.d.ts +1 -0
- package/dist/LinearColorLegend.js +38 -37
- package/dist/LinearColorLegend.js.map +1 -1
- package/dist/{Modal-ZX55hLH-.cjs → Modal-BIErPPKT.cjs} +5 -5
- package/dist/{Modal-ZX55hLH-.cjs.map → Modal-BIErPPKT.cjs.map} +1 -1
- package/dist/{Modal-BV4rkoLM.js → Modal-CrUYln5V.js} +4 -4
- package/dist/{Modal-BV4rkoLM.js.map → Modal-CrUYln5V.js.map} +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +4 -4
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.d.ts +2 -0
- package/dist/MultiLineAltChart.js +419 -420
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.d.ts +4 -0
- package/dist/MultiLineChart.js +410 -409
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.d.ts +2 -0
- package/dist/ParetoChart.js +273 -271
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +4 -4
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.d.ts +2 -0
- package/dist/RadarChart.js +221 -219
- package/dist/RadarChart.js.map +1 -1
- package/dist/{ReferenceLine-M9aP3dj-.cjs → ReferenceLine-CpU4G01Y.cjs} +2 -2
- package/dist/{ReferenceLine-M9aP3dj-.cjs.map → ReferenceLine-CpU4G01Y.cjs.map} +1 -1
- package/dist/{ReferenceLine-CNEjAYvv.js → ReferenceLine-D41VuUhE.js} +3 -3
- package/dist/{ReferenceLine-CNEjAYvv.js.map → ReferenceLine-D41VuUhE.js.map} +1 -1
- package/dist/{RegressionLine-Ci-Dh0w0.cjs → RegressionLine-BFoBiVJk.cjs} +2 -2
- package/dist/{RegressionLine-Ci-Dh0w0.cjs.map → RegressionLine-BFoBiVJk.cjs.map} +1 -1
- package/dist/{RegressionLine-BDrndQxo.js → RegressionLine-CuwB42I6.js} +4 -4
- package/dist/{RegressionLine-BDrndQxo.js.map → RegressionLine-CuwB42I6.js.map} +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.cjs.map +1 -1
- package/dist/SankeyChart.d.ts +2 -0
- package/dist/SankeyChart.js +404 -408
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.d.ts +2 -0
- package/dist/ScatterPlot.js +444 -445
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.d.ts +2 -0
- package/dist/SimpleLineChart.js +360 -358
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +3 -3
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +6 -6
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +259 -262
- package/dist/SlopeChart.js.map +1 -1
- package/dist/{Source-BOSAl3UX.cjs → Source-PKuwZOn3.cjs} +2 -2
- package/dist/{Source-BOSAl3UX.cjs.map → Source-PKuwZOn3.cjs.map} +1 -1
- package/dist/{Source-Djkz-7jX.js → Source-QGk8vhkS.js} +3 -3
- package/dist/{Source-Djkz-7jX.js.map → Source-QGk8vhkS.js.map} +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +3 -3
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +3 -3
- package/dist/{Spinner-CtJETd5V.js → Spinner-B2IIKg9r.js} +2 -2
- package/dist/{Spinner-CtJETd5V.js.map → Spinner-B2IIKg9r.js.map} +1 -1
- package/dist/{Spinner-jTMOLuw_.cjs → Spinner-WHzzloYQ.cjs} +2 -2
- package/dist/{Spinner-jTMOLuw_.cjs.map → Spinner-WHzzloYQ.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.cjs.map +1 -1
- package/dist/StatCardFromData.d.ts +4 -0
- package/dist/StatCardFromData.js +97 -95
- package/dist/StatCardFromData.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.d.ts +2 -0
- package/dist/StripChart.js +343 -343
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +198 -196
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.d.ts +2 -0
- package/dist/ThresholdColorLegendWithMouseOver.js +50 -48
- package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -1
- package/dist/{Tooltip-CohiIbLZ.js → Tooltip-Bj-s__cI.js} +3 -3
- package/dist/{Tooltip-CohiIbLZ.js.map → Tooltip-Bj-s__cI.js.map} +1 -1
- package/dist/{Tooltip-BLa2EfMs.cjs → Tooltip-Hr46paWP.cjs} +2 -2
- package/dist/{Tooltip-BLa2EfMs.cjs.map → Tooltip-Hr46paWP.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.cjs.map +1 -1
- package/dist/TreeMapGraph.d.ts +2 -0
- package/dist/TreeMapGraph.js +139 -140
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-DMVW6JnV.js → Typography-BO0gQDIT.js} +2 -2
- package/dist/{Typography-DMVW6JnV.js.map → Typography-BO0gQDIT.js.map} +1 -1
- package/dist/{Typography-CZZxlj1W.cjs → Typography-BqmyF1gP.cjs} +2 -2
- package/dist/{Typography-CZZxlj1W.cjs.map → Typography-BqmyF1gP.cjs.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.d.ts +4 -0
- package/dist/UnitChart.js +88 -86
- package/dist/UnitChart.js.map +1 -1
- package/dist/WaterfallChart.cjs +1 -1
- package/dist/WaterfallChart.cjs.map +1 -1
- package/dist/WaterfallChart.d.ts +2 -0
- package/dist/WaterfallChart.js +257 -258
- package/dist/WaterfallChart.js.map +1 -1
- package/dist/{XAxesLabels-IwjMJkYS.js → XAxesLabels-B9gkjUiC.js} +3 -3
- package/dist/{XAxesLabels-IwjMJkYS.js.map → XAxesLabels-B9gkjUiC.js.map} +1 -1
- package/dist/{XAxesLabels-C6o9jJal.cjs → XAxesLabels-C03jHniq.cjs} +2 -2
- package/dist/{XAxesLabels-C6o9jJal.cjs.map → XAxesLabels-C03jHniq.cjs.map} +1 -1
- package/dist/XTicksAndGridLines-C5DuC5oY.cjs +2 -0
- package/dist/XTicksAndGridLines-C5DuC5oY.cjs.map +1 -0
- package/dist/XTicksAndGridLines-gdbGX2rm.js +39 -0
- package/dist/XTicksAndGridLines-gdbGX2rm.js.map +1 -0
- package/dist/{YAxesLabels-BQ2aCazV.cjs → YAxesLabels-DeENFC2M.cjs} +2 -2
- package/dist/{YAxesLabels-BQ2aCazV.cjs.map → YAxesLabels-DeENFC2M.cjs.map} +1 -1
- package/dist/{YAxesLabels-DoGvgHdw.js → YAxesLabels-hWEUCTvs.js} +3 -3
- package/dist/{YAxesLabels-DoGvgHdw.js.map → YAxesLabels-hWEUCTvs.js.map} +1 -1
- package/dist/YTicksAndGridLines-CsNSq9W9.js +39 -0
- package/dist/YTicksAndGridLines-CsNSq9W9.js.map +1 -0
- package/dist/YTicksAndGridLines-DFjm8RCc.cjs +2 -0
- package/dist/YTicksAndGridLines-DFjm8RCc.cjs.map +1 -0
- package/dist/{checkIfMultiple-TOaaUwS7.cjs → checkIfMultiple-CH5tqj4q.cjs} +2 -2
- package/dist/checkIfMultiple-CH5tqj4q.cjs.map +1 -0
- package/dist/{checkIfMultiple-B97uOUVq.js → checkIfMultiple-Dpyy6BUP.js} +6 -6
- package/dist/checkIfMultiple-Dpyy6BUP.js.map +1 -0
- package/dist/{customArea-B1LWQBmM.cjs → customArea-BAcQ3pBM.cjs} +2 -2
- package/dist/{customArea-B1LWQBmM.cjs.map → customArea-BAcQ3pBM.cjs.map} +1 -1
- package/dist/{customArea-Cc2whe6P.js → customArea-D89lETG0.js} +3 -3
- package/dist/{customArea-Cc2whe6P.js.map → customArea-D89lETG0.js.map} +1 -1
- package/dist/getSliderMarks-BzrpHrHS.cjs +2 -0
- package/dist/getSliderMarks-BzrpHrHS.cjs.map +1 -0
- package/dist/{getSliderMarks-vXsR8RrR.js → getSliderMarks-X-_goqH9.js} +3 -4
- package/dist/getSliderMarks-X-_goqH9.js.map +1 -0
- package/dist/{index-CZ0elhKR.js → index-ApTBN0kp.js} +20 -10
- package/dist/{index-CZ0elhKR.js.map → index-ApTBN0kp.js.map} +1 -1
- package/dist/index-B0Awa_de.js +377 -0
- package/dist/index-B0Awa_de.js.map +1 -0
- package/dist/{index-sbKVyHS2.cjs → index-BhI7mBJx.cjs} +2 -2
- package/dist/{index-sbKVyHS2.cjs.map → index-BhI7mBJx.cjs.map} +1 -1
- package/dist/{index-D69M6klB.cjs → index-BuhBhuCq.cjs} +2 -2
- package/dist/{index-D69M6klB.cjs.map → index-BuhBhuCq.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BCLAYDCV.js → index-CHPV5EwG-BzibaIRc.js} +5 -9
- package/dist/index-CHPV5EwG-BzibaIRc.js.map +1 -0
- package/dist/{index-CHPV5EwG-6v2a2njQ.cjs → index-CHPV5EwG-D4pAp7u0.cjs} +3 -3
- package/dist/index-CHPV5EwG-D4pAp7u0.cjs.map +1 -0
- package/dist/index-CP8cmNzt.cjs +2 -0
- package/dist/index-CP8cmNzt.cjs.map +1 -0
- package/dist/{index-Co3YGYe1.js → index-Cv_5q6Rb.js} +3 -3
- package/dist/{index-Co3YGYe1.js.map → index-Cv_5q6Rb.js.map} +1 -1
- package/dist/{index-D_dtv_T9.js → index-DHVGV8Df.js} +3 -3
- package/dist/{index-D_dtv_T9.js.map → index-DHVGV8Df.js.map} +1 -1
- package/dist/{index-CoobIWNj.cjs → index-FXfr51ZM.cjs} +2 -2
- package/dist/{index-CoobIWNj.cjs.map → index-FXfr51ZM.cjs.map} +1 -1
- package/dist/{index-D6CYcVc7-BOa7Dpvf.js → index-Scxs_wcm-BAjU0Cob.js} +16 -16
- package/dist/index-Scxs_wcm-BAjU0Cob.js.map +1 -0
- package/dist/index-Scxs_wcm-DUDU-Gll.cjs +2 -0
- package/dist/index-Scxs_wcm-DUDU-Gll.cjs.map +1 -0
- package/dist/{index-DoS4bGNa-C3DbPpy3.cjs → index-w64Zl8io-DrMm5QSb.cjs} +2 -2
- package/dist/index-w64Zl8io-DrMm5QSb.cjs.map +1 -0
- package/dist/{index-DoS4bGNa-Bgab95kx.js → index-w64Zl8io-ihagHOdP.js} +2 -2
- package/dist/index-w64Zl8io-ihagHOdP.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +92 -17
- package/dist/index.js +3 -3
- package/dist/numberFormattingFunction-Cn9R7CM9.cjs +2 -0
- package/dist/numberFormattingFunction-Cn9R7CM9.cjs.map +1 -0
- package/dist/numberFormattingFunction-DqMf_v1m.js +28 -0
- package/dist/numberFormattingFunction-DqMf_v1m.js.map +1 -0
- package/dist/{proxy--_f6k3NR.js → proxy-BsxtcZKa.js} +2 -2
- package/dist/{proxy--_f6k3NR.js.map → proxy-BsxtcZKa.js.map} +1 -1
- package/dist/{proxy-C4-uo6nS.cjs → proxy-CqH8m8IQ.cjs} +2 -2
- package/dist/{proxy-C4-uo6nS.cjs.map → proxy-CqH8m8IQ.cjs.map} +1 -1
- package/dist/{string2HTML-DUYZT1L9.js → string2HTML-BrFperRM.js} +2 -2
- package/dist/{string2HTML-DUYZT1L9.js.map → string2HTML-BrFperRM.js.map} +1 -1
- package/dist/{string2HTML-xx9MzTtY.cjs → string2HTML-ZoGd08P_.cjs} +2 -2
- package/dist/{string2HTML-xx9MzTtY.cjs.map → string2HTML-ZoGd08P_.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-DqvKAveg.js → use-in-view-KOXq5Kmc.js} +2 -2
- package/dist/{use-in-view-DqvKAveg.js.map → use-in-view-KOXq5Kmc.js.map} +1 -1
- package/dist/{use-in-view-C3o_ntMv.cjs → use-in-view-dnRv_qqF.cjs} +2 -2
- package/dist/{use-in-view-C3o_ntMv.cjs.map → use-in-view-dnRv_qqF.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +9 -18
- package/dist/utils.js +1 -1
- package/dist/x-BXShoIAM-BC2sxios.cjs +2 -0
- package/dist/x-BXShoIAM-BC2sxios.cjs.map +1 -0
- package/dist/{x-BBpi7a_7-BsvWCzYM.js → x-BXShoIAM-D6VWO6z5.js} +3 -5
- package/dist/x-BXShoIAM-D6VWO6z5.js.map +1 -0
- package/package.json +2 -2
- package/dist/DropdownSelect-B2WTeedJ.js.map +0 -1
- package/dist/DropdownSelect-NNpOs7DX.cjs.map +0 -1
- package/dist/GraphEl-CnJf8b50.js.map +0 -1
- package/dist/GraphEl-D_w0Qak4.cjs +0 -2
- package/dist/GraphEl-D_w0Qak4.cjs.map +0 -1
- package/dist/XTicksAndGridLines-BDmF9etl.js +0 -38
- package/dist/XTicksAndGridLines-BDmF9etl.js.map +0 -1
- package/dist/XTicksAndGridLines-CekrPykD.cjs +0 -2
- package/dist/XTicksAndGridLines-CekrPykD.cjs.map +0 -1
- package/dist/YTicksAndGridLines-C3GW1xFG.js +0 -38
- package/dist/YTicksAndGridLines-C3GW1xFG.js.map +0 -1
- package/dist/YTicksAndGridLines-UzVC5eBM.cjs +0 -2
- package/dist/YTicksAndGridLines-UzVC5eBM.cjs.map +0 -1
- package/dist/checkIfMultiple-B97uOUVq.js.map +0 -1
- package/dist/checkIfMultiple-TOaaUwS7.cjs.map +0 -1
- package/dist/getSliderMarks-CIuSoedo.cjs +0 -2
- package/dist/getSliderMarks-CIuSoedo.cjs.map +0 -1
- package/dist/getSliderMarks-vXsR8RrR.js.map +0 -1
- package/dist/index-C6VwVS8W.js +0 -378
- package/dist/index-C6VwVS8W.js.map +0 -1
- package/dist/index-CHPV5EwG-6v2a2njQ.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BCLAYDCV.js.map +0 -1
- package/dist/index-D6CYcVc7-BOa7Dpvf.js.map +0 -1
- package/dist/index-D6CYcVc7-CTEcAtiQ.cjs +0 -2
- package/dist/index-D6CYcVc7-CTEcAtiQ.cjs.map +0 -1
- package/dist/index-DoS4bGNa-Bgab95kx.js.map +0 -1
- package/dist/index-DoS4bGNa-C3DbPpy3.cjs.map +0 -1
- package/dist/index-_TlgeI_i.cjs +0 -2
- package/dist/index-_TlgeI_i.cjs.map +0 -1
- package/dist/numberFormattingFunction-02t-wJta.cjs +0 -2
- package/dist/numberFormattingFunction-02t-wJta.cjs.map +0 -1
- package/dist/numberFormattingFunction-14YCbkN2.js +0 -13
- package/dist/numberFormattingFunction-14YCbkN2.js.map +0 -1
- package/dist/x-BBpi7a_7-BsvWCzYM.js.map +0 -1
- package/dist/x-BBpi7a_7-DXYIEFwN.cjs +0 -2
- package/dist/x-BBpi7a_7-DXYIEFwN.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoroplethMap.js","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold, scaleOrdinal } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n colorDomain: (number | string)[];\r\n mapData: FeatureCollection;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n collapseColorScaleByDefault?: boolean;\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n zoomAndCenterByHighlightedIds = false,\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n customLayers={customLayers}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","i","path","stroke","strokeWidth","fill","vectorEffect","AnimatePresence","index","findIndex","el","id","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","pointerEvents","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","t28","mapOverlay","Colors","light","graphNoData","grays","t29","t30","t31","t32","enabled","autoplay","showOnlyActiveDate","t33","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t34","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t35","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t36","shape","onUpdateShape","useEffectEvent","t37","shape_0","onUpdateOverlayMapShape","t38","fetchAndParseJSON","then","d_1","t39","t40","d_2","t41","t42","t43","getUniqValue","getJenks","_temp3","t44","t45","speed","interval","setInterval","clearInterval","t46","t47","getSliderMarks","markObj","t48","graphContainer","t49","t50","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t51","Pause","Play","SliderUI","nextValue","nextValue_0","t52","GraphArea","d_9","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t53","footnote","source","GraphFooter","t54","GraphContainer","NAME","d_6","d_5","d_4","d_8","d_7","d_3","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,cAAAA;AAAAA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,IAAAhI,SAAAkI,IAAAlI,SAAAmI,IAAAnI,SAAA4I,IAAA5I,SAAAkJ,IAAAlJ,SAAA2J,IAAA3J,SAAAkC,GAAAlC,SAAApK,GAAAoK,SAAA+J,MAAAA,KAAA/J,EAAA,GAAA,GArKjB+J;AAqKiB;AApTd,SAAAT,GAAApL,GAAA;AAAA,SAgOsDA,EAAE1C,YAAiByO,SAAK;AAAY;AAhO1F,SAAAtB,GAAAuB,GAAA;AAAA,SAgL4B7O,MAAMnD;AAAS;AAhL3C,SAAAwQ,GAAAyB,GAAA;AAAA,SA+K6C9O,MAAMnD;AAAS;AA/K5D,SAAAuQ,GAAA2B,GAAA;AAAA,SA+KyB/O,EAAChG;AAAK;AA/K/B,SAAAmT,GAAA6B,GAAA;AAAA,SA8K2ChP,MAAMnD;AAAS;AA9K1D,SAAAqQ,GAAA+B,GAAA;AAAA,SA8KuBjP,EAAChG;AAAK;AA9K7B,SAAAgS,GAAAkD,GAAA;AAAA,SAyHiBlP,EAACiD;AAA+B;AAzHjD,SAAAwG,GAAA0F,GAAAC,GAAA;AAAA,SAkEkBD,IAAIC;AAAC;AAlEvB,SAAA7F,GAAAvJ,GAAA;AAAA,SA8DgBA,EAACmJ;AAAK;"}
|
|
1
|
+
{"version":3,"file":"ChoroplethMap.js","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold, scaleOrdinal } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ExpandIcon, X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n colorDomain: (number | string)[];\r\n mapData: FeatureCollection;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds?: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n collapseColorScaleByDefault?: boolean;\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n locale: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n locale,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(\r\n d as number,\r\n 'NA',\r\n undefined,\r\n undefined,\r\n undefined,\r\n locale,\r\n )}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <ExpandIcon />\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Locale for number formatting. Must matches what `Intl.NumberFormat` expects. */\r\n locale?: string;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n zoomAndCenterByHighlightedIds = false,\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\r\n locale = 'en',\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n customLayers={customLayers}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n locale={locale}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","locale","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","i","path","stroke","strokeWidth","fill","vectorEffect","AnimatePresence","index","findIndex","el","id","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","pointerEvents","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","ExpandIcon","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","t28","mapOverlay","t29","Colors","light","graphNoData","grays","t30","t31","t32","t33","enabled","autoplay","showOnlyActiveDate","t34","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t35","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t36","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t37","shape","onUpdateShape","useEffectEvent","t38","shape_0","onUpdateOverlayMapShape","t39","fetchAndParseJSON","then","d_1","t40","t41","d_2","t42","t43","t44","getUniqValue","getJenks","_temp3","t45","t46","speed","interval","setInterval","clearInterval","t47","t48","getSliderMarks","markObj","t49","graphContainer","t50","t51","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t52","Pause","Play","SliderUI","nextValue","nextValue_0","t53","GraphArea","d_9","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t54","footnote","source","GraphFooter","t55","GraphContainer","NAME","d_6","d_5","d_4","d_8","d_7","d_3","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkFO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAA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A,IAuBAS;AAAAA,IA6BDM;AAAAA,IAuFCS;AAAAA,EAAAA,GAYH,GAAiB5J,SAAAoC,IAAApC,SAAAR,IAAAQ,SAAAqB,GAAArB,SAAAvK,GAAAuK,SAAA8B,IAAA9B,SAAAgC,GAAAhC,SAAAW,IAAAX,SAAAgB,GAAAhB,SAAAiI,IAAAjI,SAAAmI,IAAAnI,SAAAoI,IAAApI,SAAA6I,IAAA7I,SAAAmJ,IAAAnJ,SAAA4J,IAAA5J,SAAAkC,GAAAlC,SAAAtK,GAAAsK,SAAAgK,MAAAA,KAAAhK,EAAA,GAAA,GAtKjBgK;AAsKiB;AAtTd,SAAAT,GAAAtL,GAAA;AAAA,SAiOsDA,EAAE1C,YAAiB2O,SAAK;AAAY;AAjO1F,SAAAtB,GAAAuB,GAAA;AAAA,SAiL4B/O,MAAMnD;AAAS;AAjL3C,SAAA0Q,GAAAyB,GAAA;AAAA,SAgL6ChP,MAAMnD;AAAS;AAhL5D,SAAAyQ,GAAA2B,GAAA;AAAA,SAgLyBjP,EAACjG;AAAK;AAhL/B,SAAAsT,GAAA6B,GAAA;AAAA,SA+K2ClP,MAAMnD;AAAS;AA/K1D,SAAAuQ,GAAA+B,GAAA;AAAA,SA+KuBnP,EAACjG;AAAK;AA/K7B,SAAAmS,GAAAkD,GAAA;AAAA,SA0HiBpP,EAACiD;AAA+B;AA1HjD,SAAA0G,GAAA0F,GAAAC,GAAA;AAAA,SAmEkBD,IAAIC;AAAC;AAnEvB,SAAA7F,GAAAzJ,GAAA;AAAA,SA+DgBA,EAACqJ;AAAK;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-CHPV5EwG-D4pAp7u0.cjs");require("react");const e=require("./index-CP8cmNzt.cjs");require("./GraphFooter.cjs");require("./GraphHeader.cjs");require("./ColorLegendWithMouseOver.cjs");require("./Colors.cjs");require("./EmptyState-CFmiFPHz.cjs");require("./uniqBy-O05lp2S5.cjs");require("./GraphContainer-Cul9b74X.cjs");exports.CirclePackingGraph=e.CirclePackingGraph;
|
|
2
2
|
//# sourceMappingURL=CirclePackingGraph.cjs.map
|
|
@@ -104,6 +104,8 @@ declare interface Props {
|
|
|
104
104
|
dimmedOpacity?: number;
|
|
105
105
|
/** Specifies the number of decimal places to display in the value. */
|
|
106
106
|
precision?: number;
|
|
107
|
+
/** Locale for number formatting. Must matches what `Intl.NumberFormat` expects. */
|
|
108
|
+
locale?: string;
|
|
107
109
|
/** Enable graph download option as png */
|
|
108
110
|
graphDownload?: boolean;
|
|
109
111
|
/** Enable data download option as a csv */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./index-CHPV5EwG-
|
|
1
|
+
import "./index-CHPV5EwG-BzibaIRc.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import { C as g } from "./index-
|
|
3
|
+
import { C as g } from "./index-B0Awa_de.js";
|
|
4
4
|
import "./GraphFooter.js";
|
|
5
5
|
import "./GraphHeader.js";
|
|
6
6
|
import "./ColorLegendWithMouseOver.js";
|
|
7
7
|
import "./Colors.js";
|
|
8
|
-
import "./EmptyState-
|
|
8
|
+
import "./EmptyState-CaxXCkiN.js";
|
|
9
9
|
import "./uniqBy-BHy4I8PK.js";
|
|
10
|
-
import "./GraphContainer-
|
|
10
|
+
import "./GraphContainer-B8ZqOzKI.js";
|
|
11
11
|
export {
|
|
12
12
|
g as CirclePackingGraph
|
|
13
13
|
};
|
package/dist/ColorLegend.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-D4pAp7u0.cjs"),b=require("./Typography-BqmyF1gP.cjs"),B=require("./Colors.cjs");function T(w){const e=s.compilerRuntimeExports.c(29),{colorLegendTitle:a,colorDomain:g,colors:t,showNAColor:h,width:v,isCenter:d,className:E,labelsToBeHidden:u}=w;let j;e[0]!==u?(j=u===void 0?[]:u,e[0]=u,e[1]=j):j=e[1];const m=j,R=d&&"justify-center";let l;e[2]!==E||e[3]!==R?(l=s.mo("flex leading-0 pb-3",R,E),e[2]=E,e[3]=R,e[4]=l):l=e[4];const C=v?`${v}px`:"none";let o;e[5]!==C?(o={maxWidth:C},e[5]=C,e[6]=o):o=e[6];let n;e[7]!==a||e[8]!==d?(n=a&&a!==""?s.jsxRuntimeExports.jsx(b._,{size:"sm",marginBottom:"2xs",className:d?"text-center":"",children:a}):null,e[7]=a,e[8]=d,e[9]=n):n=e[9];let i;if(e[10]!==g||e[11]!==t||e[12]!==m){let f;e[14]!==t||e[15]!==m?(f=(N,y)=>m.includes(N)?null:s.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:t[y%t.length]}}),N===""?null:s.jsxRuntimeExports.jsx(b._,{size:"sm",marginBottom:"none",children:N})]},y),e[14]=t,e[15]=m,e[16]=f):f=e[16],i=g.map(f),e[10]=g,e[11]=t,e[12]=m,e[13]=i}else i=e[13];let r;e[17]!==h?(r=h?s.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:B.Colors.gray}}),s.jsxRuntimeExports.jsx(b._,{size:"sm",marginBottom:"none",children:"NA"})]}):null,e[17]=h,e[18]=r):r=e[18];let x;e[19]!==i||e[20]!==r?(x=s.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap mb-0 gap-3.5",children:[i,r]}),e[19]=i,e[20]=r,e[21]=x):x=e[21];let c;e[22]!==n||e[23]!==x?(c=s.jsxRuntimeExports.jsxs("div",{children:[n,x]}),e[22]=n,e[23]=x,e[24]=c):c=e[24];let p;return e[25]!==c||e[26]!==l||e[27]!==o?(p=s.jsxRuntimeExports.jsx("div",{className:l,style:o,"aria-label":"Color legend",children:c}),e[25]=c,e[26]=l,e[27]=o,e[28]=p):p=e[28],p}exports.ColorLegend=T;
|
|
2
2
|
//# sourceMappingURL=ColorLegend.cjs.map
|
package/dist/ColorLegend.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as T, m as k, j as l } from "./index-CHPV5EwG-
|
|
2
|
-
import { _ as w } from "./Typography-
|
|
1
|
+
import { c as T, m as k, j as l } from "./index-CHPV5EwG-BzibaIRc.js";
|
|
2
|
+
import { _ as w } from "./Typography-BO0gQDIT.js";
|
|
3
3
|
import { Colors as A } from "./Colors.js";
|
|
4
4
|
function R(z) {
|
|
5
5
|
const e = T.c(29), {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-D4pAp7u0.cjs"),C=require("./Typography-BqmyF1gP.cjs"),N=require("./Colors.cjs");function M(b){const e=s.compilerRuntimeExports.c(28),{colorLegendTitle:m,colorDomain:j,colors:o,setSelectedColor:t,showNAColor:g,width:R,isCenter:u,className:f}=b,h=u&&"justify-center";let l;e[0]!==f||e[1]!==h?(l=s.mo("flex leading-0 pb-3",h,f),e[0]=f,e[1]=h,e[2]=l):l=e[2];const v=R?`${R}px`:"none";let r;e[3]!==v?(r={maxWidth:v},e[3]=v,e[4]=r):r=e[4];let n;e[5]!==m||e[6]!==u?(n=m&&m!==""?s.jsxRuntimeExports.jsx(C._,{size:"sm",marginBottom:"2xs",className:u?"text-center":"",children:m}):null,e[5]=m,e[6]=u,e[7]=n):n=e[7];let i;if(e[8]!==j||e[9]!==o||e[10]!==t){let p;e[12]!==o||e[13]!==t?(p=(y,E)=>s.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-1 cursor-pointer",onMouseEnter:()=>{t(o[E%o.length])},onMouseLeave:()=>{t(void 0)},children:[s.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:o[E%o.length]}}),y===""?null:s.jsxRuntimeExports.jsx(C._,{size:"sm",marginBottom:"none",children:y})]},E),e[12]=o,e[13]=t,e[14]=p):p=e[14],i=j.map(p),e[8]=j,e[9]=o,e[10]=t,e[11]=i}else i=e[11];let x;e[15]!==t||e[16]!==g?(x=g?s.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>{t(N.Colors.gray)},onMouseLeave:()=>{t(void 0)},className:"flex items-center gap-1 cursor-pointer",children:[s.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:N.Colors.gray}}),s.jsxRuntimeExports.jsx(C._,{size:"sm",marginBottom:"none",children:"NA"})]}):null,e[15]=t,e[16]=g,e[17]=x):x=e[17];let c;e[18]!==i||e[19]!==x?(c=s.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap gap-3.5 mb-0",children:[i,x]}),e[18]=i,e[19]=x,e[20]=c):c=e[20];let a;e[21]!==n||e[22]!==c?(a=s.jsxRuntimeExports.jsxs("div",{children:[n,c]}),e[21]=n,e[22]=c,e[23]=a):a=e[23];let d;return e[24]!==l||e[25]!==r||e[26]!==a?(d=s.jsxRuntimeExports.jsx("div",{className:l,style:r,"aria-label":"Color legend",children:a}),e[24]=l,e[25]=r,e[26]=a,e[27]=d):d=e[27],d}exports.ColorLegendWithMouseOver=M;
|
|
2
2
|
//# sourceMappingURL=ColorLegendWithMouseOver.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as E, m as L, j as l } from "./index-CHPV5EwG-
|
|
2
|
-
import { _ as C } from "./Typography-
|
|
1
|
+
import { c as E, m as L, j as l } from "./index-CHPV5EwG-BzibaIRc.js";
|
|
2
|
+
import { _ as C } from "./Typography-BO0gQDIT.js";
|
|
3
3
|
import { Colors as w } from "./Colors.js";
|
|
4
4
|
function A(M) {
|
|
5
5
|
const e = E.c(28), {
|
package/dist/CopyTextButton.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),se=require("./index-sbKVyHS2.cjs"),k=require("react"),Fe=require("react-dom"),f=require("./index-DoS4bGNa-C3DbPpy3.cjs"),Oe=require("./index-D6CYcVc7-CTEcAtiQ.cjs"),z=require("./x-BBpi7a_7-DXYIEFwN.cjs");function ce(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const l=ce(k),Ke=ce(Fe),$e=1,Ve=1e6;let G=0;function qe(){return G=(G+1)%Number.MAX_SAFE_INTEGER,G.toString()}const U=new Map,oe=t=>{if(U.has(t))return;const r=setTimeout(()=>{U.delete(t),M({type:"REMOVE_TOAST",toastId:t})},Ve);U.set(t,r)},ze=(t,r)=>{switch(r.type){case"ADD_TOAST":return{...t,toasts:[r.toast,...t.toasts].slice(0,$e)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(e=>e.id===r.toast.id?{...e,...r.toast}:e)};case"DISMISS_TOAST":{const{toastId:e}=r;return e?oe(e):t.toasts.forEach(a=>{oe(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===e||e===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return r.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(e=>e.id!==r.toastId)};default:return{...t}}},V=[];let q={toasts:[]};function M(t){q=ze(q,t),V.forEach(r=>{r(q)})}function We({...t}){const r=qe(),e=n=>M({type:"UPDATE_TOAST",toast:{...n,id:r}}),a=()=>M({type:"DISMISS_TOAST",toastId:r});return M({type:"ADD_TOAST",toast:{...t,id:r,open:!0,onOpenChange:n=>{n||a()}}}),{id:r,dismiss:a,update:e}}function le(){const t=o._.c(5),[r,e]=k.useState(q);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>(V.push(e),()=>{const i=V.indexOf(e);i>-1&&V.splice(i,1)}),t[0]=a):a=t[0];let n;t[1]!==r?(n=[r],t[1]=r,t[2]=n):n=t[2],k.useEffect(a,n);let s;return t[3]!==r?(s={...r,toast:We,dismiss:Be},t[3]=r,t[4]=s):s=t[4],s}function Be(t){return M({type:"DISMISS_TOAST",toastId:t})}const Ge=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ue=z.k("circle-check-big",Ge);const Xe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ye=z.k("circle-x",Xe);const He=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ze=z.k("triangle-alert",He);var J="ToastProvider",[Q,Je,Qe]=Oe.h("Toast"),[de]=f.g("Toast",[Qe]),[et,W]=de(J),ue=t=>{const{__scopeToast:r,label:e="Notification",duration:a=5e3,swipeDirection:n="right",swipeThreshold:s=50,children:i}=t,[u,x]=l.useState(null),[c,w]=l.useState(0),m=l.useRef(!1),E=l.useRef(!1);return e.trim()||console.error(`Invalid prop \`label\` supplied to \`${J}\`. Expected non-empty \`string\`.`),o.ae.jsx(Q.Provider,{scope:r,children:o.ae.jsx(et,{scope:r,label:e,duration:a,swipeDirection:n,swipeThreshold:s,toastCount:c,viewport:u,onViewportChange:x,onToastAdd:l.useCallback(()=>w(g=>g+1),[]),onToastRemove:l.useCallback(()=>w(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:E,children:i})})};ue.displayName=J;var pe="ToastViewport",tt=["F8"],Y="toast.viewportPause",H="toast.viewportResume",fe=l.forwardRef((t,r)=>{const{__scopeToast:e,hotkey:a=tt,label:n="Notifications ({hotkey})",...s}=t,i=W(pe,e),u=Je(e),x=l.useRef(null),c=l.useRef(null),w=l.useRef(null),m=l.useRef(null),E=f.P(r,m,i.onViewportChange),g=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=i.toastCount>0;l.useEffect(()=>{const d=h=>{a.length!==0&&a.every(v=>h[v]||h.code===v)&&m.current?.focus()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[a]),l.useEffect(()=>{const d=x.current,h=m.current;if(j&&d&&h){const v=()=>{if(!i.isClosePausedRef.current){const N=new CustomEvent(Y);h.dispatchEvent(N),i.isClosePausedRef.current=!0}},b=()=>{if(i.isClosePausedRef.current){const N=new CustomEvent(H);h.dispatchEvent(N),i.isClosePausedRef.current=!1}},T=N=>{!d.contains(N.relatedTarget)&&b()},_=()=>{d.contains(document.activeElement)||b()};return d.addEventListener("focusin",v),d.addEventListener("focusout",T),d.addEventListener("pointermove",v),d.addEventListener("pointerleave",_),window.addEventListener("blur",v),window.addEventListener("focus",b),()=>{d.removeEventListener("focusin",v),d.removeEventListener("focusout",T),d.removeEventListener("pointermove",v),d.removeEventListener("pointerleave",_),window.removeEventListener("blur",v),window.removeEventListener("focus",b)}}},[j,i.isClosePausedRef]);const y=l.useCallback(({tabbingDirection:d})=>{const h=u().map(v=>{const b=v.ref.current,T=[b,...mt(b)];return d==="forwards"?T:T.reverse()});return(d==="forwards"?h.reverse():h).flat()},[u]);return l.useEffect(()=>{const d=m.current;if(d){const h=v=>{const b=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!b){const T=document.activeElement,_=v.shiftKey;if(v.target===d&&_){c.current?.focus();return}const N=y({tabbingDirection:_?"backwards":"forwards"}),R=N.findIndex(P=>P===T);X(N.slice(R+1))?v.preventDefault():_?c.current?.focus():w.current?.focus()}};return d.addEventListener("keydown",h),()=>d.removeEventListener("keydown",h)}},[u,y]),o.ae.jsxs(f.$,{ref:x,role:"region","aria-label":n.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&o.ae.jsx(Z,{ref:c,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"forwards"});X(d)}}),o.ae.jsx(Q.Slot,{scope:e,children:o.ae.jsx(f.w.ol,{tabIndex:-1,...s,ref:E})}),j&&o.ae.jsx(Z,{ref:w,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"backwards"});X(d)}})]})});fe.displayName=pe;var me="ToastFocusProxy",Z=l.forwardRef((t,r)=>{const{__scopeToast:e,onFocusFromOutsideViewport:a,...n}=t,s=W(me,e);return o.ae.jsx(f.a,{tabIndex:0,...n,ref:r,style:{position:"fixed"},onFocus:i=>{const u=i.relatedTarget;!s.viewport?.contains(u)&&a()}})});Z.displayName=me;var L="Toast",rt="toast.swipeStart",at="toast.swipeMove",nt="toast.swipeCancel",st="toast.swipeEnd",ye=l.forwardRef((t,r)=>{const{forceMount:e,open:a,defaultOpen:n,onOpenChange:s,...i}=t,[u,x]=f._({prop:a,defaultProp:n??!0,onChange:s,caller:L});return o.ae.jsx(f.E,{present:e||u,children:o.ae.jsx(ct,{open:u,...i,ref:r,onClose:()=>x(!1),onPause:f.c(t.onPause),onResume:f.c(t.onResume),onSwipeStart:f.j(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:f.j(t.onSwipeMove,c=>{const{x:w,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${w}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:f.j(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:f.j(t.onSwipeEnd,c=>{const{x:w,y:m}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${w}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),x(!1)})})})});ye.displayName=L;var[ot,it]=de(L,{onClose(){}}),ct=l.forwardRef((t,r)=>{const{__scopeToast:e,type:a="foreground",duration:n,open:s,onClose:i,onEscapeKeyDown:u,onPause:x,onResume:c,onSwipeStart:w,onSwipeMove:m,onSwipeCancel:E,onSwipeEnd:g,...j}=t,y=W(L,e),[d,h]=l.useState(null),v=f.P(r,p=>h(p)),b=l.useRef(null),T=l.useRef(null),_=n||y.duration,N=l.useRef(0),R=l.useRef(_),P=l.useRef(0),{onToastAdd:te,onToastRemove:re}=y,D=f.c(()=>{d?.contains(document.activeElement)&&y.viewport?.focus(),i()}),F=l.useCallback(p=>{!p||p===1/0||(window.clearTimeout(P.current),N.current=new Date().getTime(),P.current=window.setTimeout(D,p))},[D]);l.useEffect(()=>{const p=y.viewport;if(p){const S=()=>{F(R.current),c?.()},C=()=>{const A=new Date().getTime()-N.current;R.current=R.current-A,window.clearTimeout(P.current),x?.()};return p.addEventListener(Y,C),p.addEventListener(H,S),()=>{p.removeEventListener(Y,C),p.removeEventListener(H,S)}}},[y.viewport,_,x,c,F]),l.useEffect(()=>{s&&!y.isClosePausedRef.current&&F(_)},[s,_,y.isClosePausedRef,F]),l.useEffect(()=>(te(),()=>re()),[te,re]);const ae=l.useMemo(()=>d?Ee(d):null,[d]);return y.viewport?o.ae.jsxs(o.ae.Fragment,{children:[ae&&o.ae.jsx(lt,{__scopeToast:e,role:"status","aria-live":a==="foreground"?"assertive":"polite",children:ae}),o.ae.jsx(ot,{scope:e,onClose:D,children:Ke.createPortal(o.ae.jsx(Q.ItemSlot,{scope:e,children:o.ae.jsx(f.Z,{asChild:!0,onEscapeKeyDown:f.j(u,()=>{y.isFocusedToastEscapeKeyDownRef.current||D(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.ae.jsx(f.w.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":y.swipeDirection,...j,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:f.j(t.onKeyDown,p=>{p.key==="Escape"&&(u?.(p.nativeEvent),p.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:f.j(t.onPointerDown,p=>{p.button===0&&(b.current={x:p.clientX,y:p.clientY})}),onPointerMove:f.j(t.onPointerMove,p=>{if(!b.current)return;const S=p.clientX-b.current.x,C=p.clientY-b.current.y,A=!!T.current,I=["left","right"].includes(y.swipeDirection),O=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,Me=I?O(0,S):0,Le=I?0:O(0,C),B=p.pointerType==="touch"?10:2,K={x:Me,y:Le},ne={originalEvent:p,delta:K};A?(T.current=K,$(at,m,ne,{discrete:!1})):ie(K,y.swipeDirection,B)?(T.current=K,$(rt,w,ne,{discrete:!1}),p.target.setPointerCapture(p.pointerId)):(Math.abs(S)>B||Math.abs(C)>B)&&(b.current=null)}),onPointerUp:f.j(t.onPointerUp,p=>{const S=T.current,C=p.target;if(C.hasPointerCapture(p.pointerId)&&C.releasePointerCapture(p.pointerId),T.current=null,b.current=null,S){const A=p.currentTarget,I={originalEvent:p,delta:S};ie(S,y.swipeDirection,y.swipeThreshold)?$(st,g,I,{discrete:!0}):$(nt,E,I,{discrete:!0}),A.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),lt=t=>{const{__scopeToast:r,children:e,...a}=t,n=W(L,r),[s,i]=l.useState(!1),[u,x]=l.useState(!1);return pt(()=>i(!0)),l.useEffect(()=>{const c=window.setTimeout(()=>x(!0),1e3);return()=>window.clearTimeout(c)},[]),u?null:o.ae.jsx(f.u,{asChild:!0,children:o.ae.jsx(f.a,{...a,children:s&&o.ae.jsxs(o.ae.Fragment,{children:[n.label," ",e]})})})},dt="ToastTitle",xe=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t;return o.ae.jsx(f.w.div,{...a,ref:r})});xe.displayName=dt;var ut="ToastDescription",ve=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t;return o.ae.jsx(f.w.div,{...a,ref:r})});ve.displayName=ut;var we="ToastAction",he=l.forwardRef((t,r)=>{const{altText:e,...a}=t;return e.trim()?o.ae.jsx(Te,{altText:e,asChild:!0,children:o.ae.jsx(ee,{...a,ref:r})}):(console.error(`Invalid prop \`altText\` supplied to \`${we}\`. Expected non-empty \`string\`.`),null)});he.displayName=we;var be="ToastClose",ee=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t,n=it(be,e);return o.ae.jsx(Te,{asChild:!0,children:o.ae.jsx(f.w.button,{type:"button",...a,ref:r,onClick:f.j(t.onClick,n.onClose)})})});ee.displayName=be;var Te=l.forwardRef((t,r)=>{const{__scopeToast:e,altText:a,...n}=t;return o.ae.jsx(f.w.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...n,ref:r})});function Ee(t){const r=[];return Array.from(t.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&r.push(e.textContent),ft(e)){const a=e.ariaHidden||e.hidden||e.style.display==="none",n=e.dataset.radixToastAnnounceExclude==="";if(!a)if(n){const s=e.dataset.radixToastAnnounceAlt;s&&r.push(s)}else r.push(...Ee(e))}}),r}function $(t,r,e,{discrete:a}){const n=e.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});r&&n.addEventListener(t,r,{once:!0}),a?f.N(n,s):n.dispatchEvent(s)}var ie=(t,r,e=0)=>{const a=Math.abs(t.x),n=Math.abs(t.y),s=a>n;return r==="left"||r==="right"?s&&a>e:!s&&n>e};function pt(t=()=>{}){const r=f.c(t);f.E$1(()=>{let e=0,a=0;return e=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(r)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(a)}},[r])}function ft(t){return t.nodeType===t.ELEMENT_NODE}function mt(t){const r=[],e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;e.nextNode();)r.push(e.currentNode);return r}function X(t){const r=document.activeElement;return t.some(e=>e===r?!0:(e.focus(),document.activeElement!==r))}var yt=ue,ge=fe,ke=ye,je=xe,_e=ve,Ne=he,Se=ee;const xt=yt,Ce=k.createContext(null),Re=k.forwardRef((t,r)=>{const e=o._.c(9);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);let s;e[3]!==a?(s=o.mo("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",a),e[3]=a,e[4]=s):s=e[4];let i;return e[5]!==n||e[6]!==r||e[7]!==s?(i=o.ae.jsx(ge,{...n,ref:r,className:s}),e[5]=n,e[6]=r,e[7]=s,e[8]=i):i=e[8],i});Re.displayName=ge.displayName;const vt=o.j("group pointer-events-auto relative shadow-xs bg-primary-white dark:bg-primary-gray-650 flex w-full text-primary-black dark:text-primary-white items-center justify-between flex gap-2 overflow-hidden rounded-sm border border-primary-gray-400 p-2 pr-6 transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border border-primary-gray-400 dark:border-0",success:"border-t-4 border-accent-dark-green dark:border-b-0 dark:border-l-0 dark:border-r-0",warning:"border-t-4 border-accent-dark-yellow dark:border-b-0 dark:border-l-0 dark:border-r-0",destructive:"border-t-4 border-accent-dark-red dark:border-b-0 dark:border-l-0 dark:border-r-0"}},defaultVariants:{variant:"default"}}),wt=o.j("",{variants:{variant:{default:"text-primary-black dark:text-primary-white",success:"text-accent-dark-green",warning:"text-accent-dark-yellow",destructive:"text-accent-dark-red"}},defaultVariants:{variant:"default"}}),Pe=k.forwardRef((t,r)=>{const e=o._.c(16);let a,n,s;e[0]!==t?({className:a,variant:s,...n}=t,e[0]=t,e[1]=a,e[2]=n,e[3]=s):(a=e[1],n=e[2],s=e[3]);let i;e[4]!==s?(i={variant:s},e[4]=s,e[5]=i):i=e[5];let u;e[6]!==a||e[7]!==s?(u=o.mo(vt({variant:s}),a),e[6]=a,e[7]=s,e[8]=u):u=e[8];let x;e[9]!==n||e[10]!==r||e[11]!==u?(x=o.ae.jsx(ke,{...n,ref:r,className:u}),e[9]=n,e[10]=r,e[11]=u,e[12]=x):x=e[12];let c;return e[13]!==i||e[14]!==x?(c=o.ae.jsx(Ce.Provider,{value:i,children:x}),e[13]=i,e[14]=x,e[15]=c):c=e[15],c});Pe.displayName=ke.displayName;const ht=k.forwardRef((t,r)=>{const e=o._.c(9);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);let s;e[3]!==a?(s=o.mo("inline-flex h-8 shrink-0 items-center text-primary-gray-700 dark:text-primary-gray-100 justify-center rounded-none bg-transparent px-3 text-sm font-medium transition-colors hover:bg-primary-gray-200 dark:hover:bg-primary-gray-600 focus:outline-hidden focus:ring-1 disabled:pointer-events-none disabled:opacity-50",a),e[3]=a,e[4]=s):s=e[4];let i;return e[5]!==n||e[6]!==r||e[7]!==s?(i=o.ae.jsx(Ne,{...n,ref:r,className:s}),e[5]=n,e[6]=r,e[7]=s,e[8]=i):i=e[8],i});ht.displayName=Ne.displayName;const De=k.forwardRef((t,r)=>{const e=o._.c(10);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);let s;e[3]!==a?(s=o.mo("absolute right-1 top-1 rounded-md p-1 text-primary-gray-700/50 dark:text-primary-gray-100/50 opacity-0 transition-opacity hover:text-primary-gray-700 dark:hover:text-primary-gray-100 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100",a),e[3]=a,e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=o.ae.jsx(z.t,{className:"h-4 w-4"}),e[5]=i):i=e[5];let u;return e[6]!==n||e[7]!==r||e[8]!==s?(u=o.ae.jsx(Se,{...n,ref:r,className:s,"toast-close":"",children:i}),e[6]=n,e[7]=r,e[8]=s,e[9]=u):u=e[9],u});De.displayName=Se.displayName;const Ae=k.forwardRef((t,r)=>{const e=o._.c(16);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);const s=k.useContext(Ce);let i;e[3]!==a||e[4]!==s?.variant?(i=o.mo(wt({variant:s?.variant}),"text-lg font-bold [&+div]:text-xs",a),e[3]=a,e[4]=s?.variant,e[5]=i):i=e[5];const u=i;let x;e:switch(s?.variant){case"destructive":{let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(Ye,{className:"h-4 w-4 stroke-accent-dark-red",strokeWidth:2}),e[6]=m):m=e[6],x=m;break e}case"success":{let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(Ue,{className:"h-4 w-4 stroke-accent-dark-green",strokeWidth:2}),e[7]=m):m=e[7],x=m;break e}case"warning":{let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(Ze,{className:"h-4 w-4 stroke-accent-dark-yellow",strokeWidth:2}),e[8]=m):m=e[8],x=m;break e}default:x=null}let c;e[9]!==u||e[10]!==n||e[11]!==r?(c=o.ae.jsx(je,{...n,ref:r,className:u}),e[9]=u,e[10]=n,e[11]=r,e[12]=c):c=e[12];let w;return e[13]!==x||e[14]!==c?(w=o.ae.jsxs("div",{className:"flex gap-x-1 items-center",children:[x,c]}),e[13]=x,e[14]=c,e[15]=w):w=e[15],w});Ae.displayName=je.displayName;const Ie=k.forwardRef((t,r)=>{const e=o._.c(9);let a,n;e[0]!==t?({className:a,...n}=t,e[0]=t,e[1]=a,e[2]=n):(a=e[1],n=e[2]);let s;e[3]!==a?(s=o.mo("text-base opacity-90 dark:text-primary-white",a),e[3]=a,e[4]=s):s=e[4];let i;return e[5]!==n||e[6]!==r||e[7]!==s?(i=o.ae.jsx(_e,{...n,ref:r,className:s}),e[5]=n,e[6]=r,e[7]=s,e[8]=i):i=e[8],i});Ie.displayName=_e.displayName;function bt(){const t=o._.c(5),{toasts:r}=le();let e;t[0]!==r?(e=r.map(Tt),t[0]=r,t[1]=e):e=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.ae.jsx(Re,{}),t[2]=a):a=t[2];let n;return t[3]!==e?(n=o.ae.jsxs(xt,{children:[e,a]}),t[3]=e,t[4]=n):n=t[4],n}function Tt(t){const{id:r,title:e,description:a,action:n,...s}=t;return k.createElement(Pe,{...s,key:r},o.ae.jsxs("div",{className:"grid gap-1",children:[e&&o.ae.jsx(Ae,{children:e}),a&&o.ae.jsx(Ie,{children:a})]}),n,o.ae.jsx(De,{}))}function Et(t){const r=o.compilerRuntimeExports.c(12),{text:e,successMessage:a,buttonText:n,buttonSmall:s,className:i}=t,u=a===void 0?"Text copied":a,x=s===void 0?!1:s,c=i===void 0?"":i,{toast:w}=le(),m=`${x?"p-2":"py-4 px-6"} ${c}`;let E;r[0]!==u||r[1]!==e||r[2]!==w?(E=()=>{navigator.clipboard.writeText(e),w({variant:"success",description:u,duration:1e3})},r[0]=u,r[1]=e,r[2]=w,r[3]=E):E=r[3];let g;r[4]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxRuntimeExports.jsx(se.Copy,{}),r[4]=g):g=r[4];const j=n||null;let y;r[5]!==m||r[6]!==E||r[7]!==j?(y=o.jsxRuntimeExports.jsxs(se.u,{variant:"tertiary",className:m,onClick:E,"aria-label":"Click to copy the text",children:[g,j]}),r[5]=m,r[6]=E,r[7]=j,r[8]=y):y=r[8];let d;r[9]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxRuntimeExports.jsx(bt,{}),r[9]=d):d=r[9];let h;return r[10]!==y?(h=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[y,d]}),r[10]=y,r[11]=h):h=r[11],h}exports.CopyTextButton=Et;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-D4pAp7u0.cjs"),ne=require("./index-BhI7mBJx.cjs"),k=require("react"),Fe=require("react-dom"),m=require("./index-w64Zl8io-DrMm5QSb.cjs"),Oe=require("./index-Scxs_wcm-DUDU-Gll.cjs"),z=require("./x-BXShoIAM-BC2sxios.cjs");function ce(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const l=ce(k),Ke=ce(Fe),$e=1,qe=1e6;let U=0;function Ve(){return U=(U+1)%Number.MAX_SAFE_INTEGER,U.toString()}const B=new Map,oe=t=>{if(B.has(t))return;const r=setTimeout(()=>{B.delete(t),M({type:"REMOVE_TOAST",toastId:t})},qe);B.set(t,r)},ze=(t,r)=>{switch(r.type){case"ADD_TOAST":return{...t,toasts:[r.toast,...t.toasts].slice(0,$e)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(e=>e.id===r.toast.id?{...e,...r.toast}:e)};case"DISMISS_TOAST":{const{toastId:e}=r;return e?oe(e):t.toasts.forEach(a=>{oe(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===e||e===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return r.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(e=>e.id!==r.toastId)};default:return{...t}}},q=[];let V={toasts:[]};function M(t){V=ze(V,t),q.forEach(r=>{r(V)})}function We({...t}){const r=Ve(),e=s=>M({type:"UPDATE_TOAST",toast:{...s,id:r}}),a=()=>M({type:"DISMISS_TOAST",toastId:r});return M({type:"ADD_TOAST",toast:{...t,id:r,open:!0,onOpenChange:s=>{s||a()}}}),{id:r,dismiss:a,update:e}}function le(){const t=o._.c(5),[r,e]=k.useState(V);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>(q.push(e),()=>{const i=q.indexOf(e);i>-1&&q.splice(i,1)}),t[0]=a):a=t[0];let s;t[1]!==r?(s=[r],t[1]=r,t[2]=s):s=t[2],k.useEffect(a,s);let n;return t[3]!==r?(n={...r,toast:We,dismiss:Xe},t[3]=r,t[4]=n):n=t[4],n}function Xe(t){return M({type:"DISMISS_TOAST",toastId:t})}const Ue=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Be=z.k("circle-check-big",Ue),Ge=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],He=z.k("circle-x",Ge),Ye=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ze=z.k("triangle-alert",Ye);var J="ToastProvider",[Q,Je,Qe]=Oe.h("Toast"),[de]=m.g("Toast",[Qe]),[et,W]=de(J),ue=t=>{const{__scopeToast:r,label:e="Notification",duration:a=5e3,swipeDirection:s="right",swipeThreshold:n=50,children:i}=t,[u,x]=l.useState(null),[c,w]=l.useState(0),f=l.useRef(!1),E=l.useRef(!1);return e.trim()||console.error(`Invalid prop \`label\` supplied to \`${J}\`. Expected non-empty \`string\`.`),o.ae.jsx(Q.Provider,{scope:r,children:o.ae.jsx(et,{scope:r,label:e,duration:a,swipeDirection:s,swipeThreshold:n,toastCount:c,viewport:u,onViewportChange:x,onToastAdd:l.useCallback(()=>w(g=>g+1),[]),onToastRemove:l.useCallback(()=>w(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:E,children:i})})};ue.displayName=J;var pe="ToastViewport",tt=["F8"],H="toast.viewportPause",Y="toast.viewportResume",me=l.forwardRef((t,r)=>{const{__scopeToast:e,hotkey:a=tt,label:s="Notifications ({hotkey})",...n}=t,i=W(pe,e),u=Je(e),x=l.useRef(null),c=l.useRef(null),w=l.useRef(null),f=l.useRef(null),E=m.P(r,f,i.onViewportChange),g=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=i.toastCount>0;l.useEffect(()=>{const d=h=>{a.length!==0&&a.every(v=>h[v]||h.code===v)&&f.current?.focus()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[a]),l.useEffect(()=>{const d=x.current,h=f.current;if(j&&d&&h){const v=()=>{if(!i.isClosePausedRef.current){const S=new CustomEvent(H);h.dispatchEvent(S),i.isClosePausedRef.current=!0}},b=()=>{if(i.isClosePausedRef.current){const S=new CustomEvent(Y);h.dispatchEvent(S),i.isClosePausedRef.current=!1}},T=S=>{!d.contains(S.relatedTarget)&&b()},_=()=>{d.contains(document.activeElement)||b()};return d.addEventListener("focusin",v),d.addEventListener("focusout",T),d.addEventListener("pointermove",v),d.addEventListener("pointerleave",_),window.addEventListener("blur",v),window.addEventListener("focus",b),()=>{d.removeEventListener("focusin",v),d.removeEventListener("focusout",T),d.removeEventListener("pointermove",v),d.removeEventListener("pointerleave",_),window.removeEventListener("blur",v),window.removeEventListener("focus",b)}}},[j,i.isClosePausedRef]);const y=l.useCallback(({tabbingDirection:d})=>{const h=u().map(v=>{const b=v.ref.current,T=[b,...ft(b)];return d==="forwards"?T:T.reverse()});return(d==="forwards"?h.reverse():h).flat()},[u]);return l.useEffect(()=>{const d=f.current;if(d){const h=v=>{const b=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!b){const T=document.activeElement,_=v.shiftKey;if(v.target===d&&_){c.current?.focus();return}const S=y({tabbingDirection:_?"backwards":"forwards"}),R=S.findIndex(P=>P===T);G(S.slice(R+1))?v.preventDefault():_?c.current?.focus():w.current?.focus()}};return d.addEventListener("keydown",h),()=>d.removeEventListener("keydown",h)}},[u,y]),o.ae.jsxs(m.$,{ref:x,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&o.ae.jsx(Z,{ref:c,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"forwards"});G(d)}}),o.ae.jsx(Q.Slot,{scope:e,children:o.ae.jsx(m.w.ol,{tabIndex:-1,...n,ref:E})}),j&&o.ae.jsx(Z,{ref:w,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"backwards"});G(d)}})]})});me.displayName=pe;var fe="ToastFocusProxy",Z=l.forwardRef((t,r)=>{const{__scopeToast:e,onFocusFromOutsideViewport:a,...s}=t,n=W(fe,e);return o.ae.jsx(m.a,{tabIndex:0,...s,ref:r,style:{position:"fixed"},onFocus:i=>{const u=i.relatedTarget;!n.viewport?.contains(u)&&a()}})});Z.displayName=fe;var L="Toast",rt="toast.swipeStart",at="toast.swipeMove",st="toast.swipeCancel",nt="toast.swipeEnd",ye=l.forwardRef((t,r)=>{const{forceMount:e,open:a,defaultOpen:s,onOpenChange:n,...i}=t,[u,x]=m._({prop:a,defaultProp:s??!0,onChange:n,caller:L});return o.ae.jsx(m.E,{present:e||u,children:o.ae.jsx(ct,{open:u,...i,ref:r,onClose:()=>x(!1),onPause:m.c(t.onPause),onResume:m.c(t.onResume),onSwipeStart:m.j(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:m.j(t.onSwipeMove,c=>{const{x:w,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${w}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:m.j(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:m.j(t.onSwipeEnd,c=>{const{x:w,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${w}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),x(!1)})})})});ye.displayName=L;var[ot,it]=de(L,{onClose(){}}),ct=l.forwardRef((t,r)=>{const{__scopeToast:e,type:a="foreground",duration:s,open:n,onClose:i,onEscapeKeyDown:u,onPause:x,onResume:c,onSwipeStart:w,onSwipeMove:f,onSwipeCancel:E,onSwipeEnd:g,...j}=t,y=W(L,e),[d,h]=l.useState(null),v=m.P(r,p=>h(p)),b=l.useRef(null),T=l.useRef(null),_=s||y.duration,S=l.useRef(0),R=l.useRef(_),P=l.useRef(0),{onToastAdd:te,onToastRemove:re}=y,D=m.c(()=>{d?.contains(document.activeElement)&&y.viewport?.focus(),i()}),F=l.useCallback(p=>{!p||p===1/0||(window.clearTimeout(P.current),S.current=new Date().getTime(),P.current=window.setTimeout(D,p))},[D]);l.useEffect(()=>{const p=y.viewport;if(p){const N=()=>{F(R.current),c?.()},C=()=>{const A=new Date().getTime()-S.current;R.current=R.current-A,window.clearTimeout(P.current),x?.()};return p.addEventListener(H,C),p.addEventListener(Y,N),()=>{p.removeEventListener(H,C),p.removeEventListener(Y,N)}}},[y.viewport,_,x,c,F]),l.useEffect(()=>{n&&!y.isClosePausedRef.current&&F(_)},[n,_,y.isClosePausedRef,F]),l.useEffect(()=>(te(),()=>re()),[te,re]);const ae=l.useMemo(()=>d?Ee(d):null,[d]);return y.viewport?o.ae.jsxs(o.ae.Fragment,{children:[ae&&o.ae.jsx(lt,{__scopeToast:e,role:"status","aria-live":a==="foreground"?"assertive":"polite",children:ae}),o.ae.jsx(ot,{scope:e,onClose:D,children:Ke.createPortal(o.ae.jsx(Q.ItemSlot,{scope:e,children:o.ae.jsx(m.Z,{asChild:!0,onEscapeKeyDown:m.j(u,()=>{y.isFocusedToastEscapeKeyDownRef.current||D(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.ae.jsx(m.w.li,{tabIndex:0,"data-state":n?"open":"closed","data-swipe-direction":y.swipeDirection,...j,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:m.j(t.onKeyDown,p=>{p.key==="Escape"&&(u?.(p.nativeEvent),p.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:m.j(t.onPointerDown,p=>{p.button===0&&(b.current={x:p.clientX,y:p.clientY})}),onPointerMove:m.j(t.onPointerMove,p=>{if(!b.current)return;const N=p.clientX-b.current.x,C=p.clientY-b.current.y,A=!!T.current,I=["left","right"].includes(y.swipeDirection),O=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,Me=I?O(0,N):0,Le=I?0:O(0,C),X=p.pointerType==="touch"?10:2,K={x:Me,y:Le},se={originalEvent:p,delta:K};A?(T.current=K,$(at,f,se,{discrete:!1})):ie(K,y.swipeDirection,X)?(T.current=K,$(rt,w,se,{discrete:!1}),p.target.setPointerCapture(p.pointerId)):(Math.abs(N)>X||Math.abs(C)>X)&&(b.current=null)}),onPointerUp:m.j(t.onPointerUp,p=>{const N=T.current,C=p.target;if(C.hasPointerCapture(p.pointerId)&&C.releasePointerCapture(p.pointerId),T.current=null,b.current=null,N){const A=p.currentTarget,I={originalEvent:p,delta:N};ie(N,y.swipeDirection,y.swipeThreshold)?$(nt,g,I,{discrete:!0}):$(st,E,I,{discrete:!0}),A.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),lt=t=>{const{__scopeToast:r,children:e,...a}=t,s=W(L,r),[n,i]=l.useState(!1),[u,x]=l.useState(!1);return pt(()=>i(!0)),l.useEffect(()=>{const c=window.setTimeout(()=>x(!0),1e3);return()=>window.clearTimeout(c)},[]),u?null:o.ae.jsx(m.u,{asChild:!0,children:o.ae.jsx(m.a,{...a,children:n&&o.ae.jsxs(o.ae.Fragment,{children:[s.label," ",e]})})})},dt="ToastTitle",xe=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t;return o.ae.jsx(m.w.div,{...a,ref:r})});xe.displayName=dt;var ut="ToastDescription",ve=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t;return o.ae.jsx(m.w.div,{...a,ref:r})});ve.displayName=ut;var we="ToastAction",he=l.forwardRef((t,r)=>{const{altText:e,...a}=t;return e.trim()?o.ae.jsx(Te,{altText:e,asChild:!0,children:o.ae.jsx(ee,{...a,ref:r})}):(console.error(`Invalid prop \`altText\` supplied to \`${we}\`. Expected non-empty \`string\`.`),null)});he.displayName=we;var be="ToastClose",ee=l.forwardRef((t,r)=>{const{__scopeToast:e,...a}=t,s=it(be,e);return o.ae.jsx(Te,{asChild:!0,children:o.ae.jsx(m.w.button,{type:"button",...a,ref:r,onClick:m.j(t.onClick,s.onClose)})})});ee.displayName=be;var Te=l.forwardRef((t,r)=>{const{__scopeToast:e,altText:a,...s}=t;return o.ae.jsx(m.w.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...s,ref:r})});function Ee(t){const r=[];return Array.from(t.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&r.push(e.textContent),mt(e)){const a=e.ariaHidden||e.hidden||e.style.display==="none",s=e.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const n=e.dataset.radixToastAnnounceAlt;n&&r.push(n)}else r.push(...Ee(e))}}),r}function $(t,r,e,{discrete:a}){const s=e.originalEvent.currentTarget,n=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});r&&s.addEventListener(t,r,{once:!0}),a?m.N(s,n):s.dispatchEvent(n)}var ie=(t,r,e=0)=>{const a=Math.abs(t.x),s=Math.abs(t.y),n=a>s;return r==="left"||r==="right"?n&&a>e:!n&&s>e};function pt(t=()=>{}){const r=m.c(t);m.E$1(()=>{let e=0,a=0;return e=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(r)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(a)}},[r])}function mt(t){return t.nodeType===t.ELEMENT_NODE}function ft(t){const r=[],e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;e.nextNode();)r.push(e.currentNode);return r}function G(t){const r=document.activeElement;return t.some(e=>e===r?!0:(e.focus(),document.activeElement!==r))}var yt=ue,ge=me,ke=ye,je=xe,_e=ve,Se=he,Ne=ee;const xt=yt,Ce=k.createContext(null),Re=k.forwardRef((t,r)=>{const e=o._.c(9);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let n;e[3]!==a?(n=o.mo("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",a),e[3]=a,e[4]=n):n=e[4];let i;return e[5]!==s||e[6]!==r||e[7]!==n?(i=o.ae.jsx(ge,{...s,ref:r,className:n}),e[5]=s,e[6]=r,e[7]=n,e[8]=i):i=e[8],i});Re.displayName=ge.displayName;const vt=o.j("group pointer-events-auto relative shadow-xs bg-primary-white dark:bg-primary-gray-650 flex w-full text-primary-black dark:text-primary-white items-center justify-between flex gap-2 overflow-hidden rounded-sm border border-primary-gray-400 p-2 pr-6 transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border border-primary-gray-400 dark:border-0",success:"border-t-4 border-accent-dark-green dark:border-b-0 dark:border-l-0 dark:border-r-0",warning:"border-t-4 border-accent-dark-yellow dark:border-b-0 dark:border-l-0 dark:border-r-0",destructive:"border-t-4 border-accent-dark-red dark:border-b-0 dark:border-l-0 dark:border-r-0"}},defaultVariants:{variant:"default"}}),wt=o.j("",{variants:{variant:{default:"text-primary-black dark:text-primary-white",success:"text-accent-dark-green",warning:"text-accent-dark-yellow",destructive:"text-accent-dark-red"}},defaultVariants:{variant:"default"}}),Pe=k.forwardRef((t,r)=>{const e=o._.c(16);let a,s,n;e[0]!==t?({className:a,variant:n,...s}=t,e[0]=t,e[1]=a,e[2]=s,e[3]=n):(a=e[1],s=e[2],n=e[3]);let i;e[4]!==n?(i={variant:n},e[4]=n,e[5]=i):i=e[5];let u;e[6]!==a||e[7]!==n?(u=o.mo(vt({variant:n}),a),e[6]=a,e[7]=n,e[8]=u):u=e[8];let x;e[9]!==s||e[10]!==r||e[11]!==u?(x=o.ae.jsx(ke,{...s,ref:r,className:u}),e[9]=s,e[10]=r,e[11]=u,e[12]=x):x=e[12];let c;return e[13]!==i||e[14]!==x?(c=o.ae.jsx(Ce.Provider,{value:i,children:x}),e[13]=i,e[14]=x,e[15]=c):c=e[15],c});Pe.displayName=ke.displayName;const ht=k.forwardRef((t,r)=>{const e=o._.c(9);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let n;e[3]!==a?(n=o.mo("inline-flex h-8 shrink-0 items-center text-primary-gray-700 dark:text-primary-gray-100 justify-center rounded-none bg-transparent px-3 text-sm font-medium transition-colors hover:bg-primary-gray-200 dark:hover:bg-primary-gray-600 focus:outline-hidden focus:ring-1 disabled:pointer-events-none disabled:opacity-50",a),e[3]=a,e[4]=n):n=e[4];let i;return e[5]!==s||e[6]!==r||e[7]!==n?(i=o.ae.jsx(Se,{...s,ref:r,className:n}),e[5]=s,e[6]=r,e[7]=n,e[8]=i):i=e[8],i});ht.displayName=Se.displayName;const De=k.forwardRef((t,r)=>{const e=o._.c(10);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let n;e[3]!==a?(n=o.mo("absolute right-1 top-1 rounded-md p-1 text-primary-gray-700/50 dark:text-primary-gray-100/50 opacity-0 transition-opacity hover:text-primary-gray-700 dark:hover:text-primary-gray-100 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100",a),e[3]=a,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=o.ae.jsx(z.t,{className:"h-4 w-4"}),e[5]=i):i=e[5];let u;return e[6]!==s||e[7]!==r||e[8]!==n?(u=o.ae.jsx(Ne,{...s,ref:r,className:n,"toast-close":"",children:i}),e[6]=s,e[7]=r,e[8]=n,e[9]=u):u=e[9],u});De.displayName=Ne.displayName;const Ae=k.forwardRef((t,r)=>{const e=o._.c(16);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);const n=k.useContext(Ce);let i;e[3]!==a||e[4]!==n?.variant?(i=o.mo(wt({variant:n?.variant}),"text-lg font-bold [&+div]:text-xs",a),e[3]=a,e[4]=n?.variant,e[5]=i):i=e[5];const u=i;let x;e:switch(n?.variant){case"destructive":{let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=o.ae.jsx(He,{className:"h-4 w-4 stroke-accent-dark-red",strokeWidth:2}),e[6]=f):f=e[6],x=f;break e}case"success":{let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=o.ae.jsx(Be,{className:"h-4 w-4 stroke-accent-dark-green",strokeWidth:2}),e[7]=f):f=e[7],x=f;break e}case"warning":{let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=o.ae.jsx(Ze,{className:"h-4 w-4 stroke-accent-dark-yellow",strokeWidth:2}),e[8]=f):f=e[8],x=f;break e}default:x=null}let c;e[9]!==u||e[10]!==s||e[11]!==r?(c=o.ae.jsx(je,{...s,ref:r,className:u}),e[9]=u,e[10]=s,e[11]=r,e[12]=c):c=e[12];let w;return e[13]!==x||e[14]!==c?(w=o.ae.jsxs("div",{className:"flex gap-x-1 items-center",children:[x,c]}),e[13]=x,e[14]=c,e[15]=w):w=e[15],w});Ae.displayName=je.displayName;const Ie=k.forwardRef((t,r)=>{const e=o._.c(9);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let n;e[3]!==a?(n=o.mo("text-base opacity-90 dark:text-primary-white",a),e[3]=a,e[4]=n):n=e[4];let i;return e[5]!==s||e[6]!==r||e[7]!==n?(i=o.ae.jsx(_e,{...s,ref:r,className:n}),e[5]=s,e[6]=r,e[7]=n,e[8]=i):i=e[8],i});Ie.displayName=_e.displayName;function bt(){const t=o._.c(5),{toasts:r}=le();let e;t[0]!==r?(e=r.map(Tt),t[0]=r,t[1]=e):e=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.ae.jsx(Re,{}),t[2]=a):a=t[2];let s;return t[3]!==e?(s=o.ae.jsxs(xt,{children:[e,a]}),t[3]=e,t[4]=s):s=t[4],s}function Tt(t){const{id:r,title:e,description:a,action:s,...n}=t;return k.createElement(Pe,{...n,key:r},o.ae.jsxs("div",{className:"grid gap-1",children:[e&&o.ae.jsx(Ae,{children:e}),a&&o.ae.jsx(Ie,{children:a})]}),s,o.ae.jsx(De,{}))}function Et(t){const r=o.compilerRuntimeExports.c(12),{text:e,successMessage:a,buttonText:s,buttonSmall:n,className:i}=t,u=a===void 0?"Text copied":a,x=n===void 0?!1:n,c=i===void 0?"":i,{toast:w}=le(),f=`${x?"p-2":"py-4 px-6"} ${c}`;let E;r[0]!==u||r[1]!==e||r[2]!==w?(E=()=>{navigator.clipboard.writeText(e),w({variant:"success",description:u,duration:1e3})},r[0]=u,r[1]=e,r[2]=w,r[3]=E):E=r[3];let g;r[4]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxRuntimeExports.jsx(ne.Copy,{}),r[4]=g):g=r[4];const j=s||null;let y;r[5]!==f||r[6]!==E||r[7]!==j?(y=o.jsxRuntimeExports.jsxs(ne.u,{variant:"tertiary",className:f,onClick:E,"aria-label":"Click to copy the text",children:[g,j]}),r[5]=f,r[6]=E,r[7]=j,r[8]=y):y=r[8];let d;r[9]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxRuntimeExports.jsx(bt,{}),r[9]=d):d=r[9];let h;return r[10]!==y?(h=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[y,d]}),r[10]=y,r[11]=h):h=r[11],h}exports.CopyTextButton=Et;
|
|
2
2
|
//# sourceMappingURL=CopyTextButton.cjs.map
|