@undp/data-viz 2.1.8 → 2.2.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.js +19 -19
- package/dist/AreaChart.js.map +1 -1
- package/dist/{Axis-CRyfcLjc.js → Axis-DoOqnt6g.js} +2 -2
- package/dist/{Axis-CRyfcLjc.js.map → Axis-DoOqnt6g.js.map} +1 -1
- package/dist/{Axis-DxRV2yMi.cjs → Axis-Dtjn-EgM.cjs} +2 -2
- package/dist/{Axis-DxRV2yMi.cjs.map → Axis-Dtjn-EgM.cjs.map} +1 -1
- package/dist/{AxisTitle-sS5bLLR7.cjs → AxisTitle-DV4n0RxE.cjs} +2 -2
- package/dist/{AxisTitle-sS5bLLR7.cjs.map → AxisTitle-DV4n0RxE.cjs.map} +1 -1
- package/dist/{AxisTitle-jeI7am8o.js → AxisTitle-VFq89Olw.js} +2 -2
- package/dist/{AxisTitle-jeI7am8o.js.map → AxisTitle-VFq89Olw.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +24 -24
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +14 -14
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +48 -48
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +22 -22
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +19 -19
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +51 -51
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- 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 -16
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +13 -31
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +2 -20
- package/dist/CsvDownloadButton.cjs.map +1 -1
- package/dist/CsvDownloadButton.js +5 -26
- package/dist/CsvDownloadButton.js.map +1 -1
- package/dist/DataCards.cjs +1 -21
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +18 -42
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +6 -6
- package/dist/DataTable.js.map +1 -1
- package/dist/{DetailsModal-0Ry5nXiC.js → DetailsModal-BMCTgVsk.js} +4 -4
- package/dist/{DetailsModal-0Ry5nXiC.js.map → DetailsModal-BMCTgVsk.js.map} +1 -1
- package/dist/{DetailsModal-BN0HDFlV.cjs → DetailsModal-DHttOA80.cjs} +2 -2
- package/dist/{DetailsModal-BN0HDFlV.cjs.map → DetailsModal-DHttOA80.cjs.map} +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +22 -22
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +10 -10
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +1 -1
- package/dist/DotDensityMap.js +78 -78
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-BbdPQa2k.js → DropdownSelect-D8rFbygC.js} +5 -33
- package/dist/{DropdownSelect-BbdPQa2k.js.map → DropdownSelect-D8rFbygC.js.map} +1 -1
- package/dist/{DropdownSelect-Doz3mCrM.cjs → DropdownSelect-NNpOs7DX.cjs} +2 -26
- package/dist/{DropdownSelect-Doz3mCrM.cjs.map → DropdownSelect-NNpOs7DX.cjs.map} +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +15 -15
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +22 -22
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-gLDRXBHm.cjs → EmptyState-CGeBqbmR.cjs} +2 -2
- package/dist/{EmptyState-gLDRXBHm.cjs.map → EmptyState-CGeBqbmR.cjs.map} +1 -1
- package/dist/EmptyState-tZBErBKF.js +15 -0
- package/dist/{EmptyState-C7ZXkZWd.js.map → EmptyState-tZBErBKF.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.js +13 -13
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.js +8 -8
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +12 -12
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/{GraphContainer-d8A46BK2.cjs → GraphContainer-B1EDxJ0S.cjs} +2 -2
- package/dist/{GraphContainer-d8A46BK2.cjs.map → GraphContainer-B1EDxJ0S.cjs.map} +1 -1
- package/dist/{GraphContainer-CRqzdKu2.js → GraphContainer-CF6ws3pd.js} +2 -2
- package/dist/{GraphContainer-CRqzdKu2.js.map → GraphContainer-CF6ws3pd.js.map} +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/GraphEl-CBZdcvb7.cjs +2 -0
- package/dist/GraphEl-CBZdcvb7.cjs.map +1 -0
- package/dist/{GraphEl-Dyu_EIQb.js → GraphEl-DKrjuQNB.js} +79 -18
- package/dist/GraphEl-DKrjuQNB.js.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 -1
- package/dist/GriddedGraphs.js +8 -8
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -1
- package/dist/GriddedGraphsFromConfig.js +4 -4
- package/dist/GriddedGraphsFromConfig.js.map +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +14 -14
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +5 -5
- package/dist/Histogram.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +134 -133
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +3 -3
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +18 -18
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-JW_IExO3.cjs → Modal-CaYa_TLE.cjs} +2 -2
- package/dist/{Modal-JW_IExO3.cjs.map → Modal-CaYa_TLE.cjs.map} +1 -1
- package/dist/{Modal-bMQA6bL_.js → Modal-Ch9wvKxF.js} +4 -4
- package/dist/{Modal-bMQA6bL_.js.map → Modal-Ch9wvKxF.js.map} +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -1
- package/dist/MultiGraphDashboard.js +5 -5
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -1
- package/dist/MultiGraphDashboardFromConfig.js +4 -4
- package/dist/MultiGraphDashboardFromConfig.js.map +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +5 -5
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js.map +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +17 -17
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +19 -19
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +15 -15
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +5 -5
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +4 -4
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js.map +1 -1
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -1
- package/dist/PerformanceIntensiveScrollStory.js +6 -6
- package/dist/PerformanceIntensiveScrollStory.js.map +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +9 -9
- package/dist/{ReferenceLine-2XCwHXQ4.js → ReferenceLine-DgtoRgw0.js} +5 -5
- package/dist/ReferenceLine-DgtoRgw0.js.map +1 -0
- package/dist/{ReferenceLine-BH0qdf4R.cjs → ReferenceLine-M9aP3dj-.cjs} +2 -2
- package/dist/{ReferenceLine-BH0qdf4R.cjs.map → ReferenceLine-M9aP3dj-.cjs.map} +1 -1
- package/dist/{RegressionLine-BOTTNSrr.cjs → RegressionLine-Ci-Dh0w0.cjs} +2 -2
- package/dist/{RegressionLine-BOTTNSrr.cjs.map → RegressionLine-Ci-Dh0w0.cjs.map} +1 -1
- package/dist/{RegressionLine-DAcY2DjT.js → RegressionLine-D2aqeBKp.js} +6 -6
- package/dist/RegressionLine-D2aqeBKp.js.map +1 -0
- 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.js +61 -67
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +23 -23
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -1
- package/dist/ScrollStory.js +4 -4
- package/dist/ScrollStory.js.map +1 -1
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +19 -19
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -1
- package/dist/SingleGraphDashboard.js +9 -9
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -1
- package/dist/SingleGraphDashboardFromConfig.js +4 -4
- package/dist/SingleGraphDashboardFromConfig.js.map +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.js +5 -5
- package/dist/SingleGraphDashboardGeoHubMaps.js.map +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +4 -4
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +63 -70
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +4 -4
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js.map +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +12 -12
- package/dist/SlopeChart.js.map +1 -1
- package/dist/{Source-DYMJRrsq.cjs → Source-B5AoSlsi.cjs} +2 -2
- package/dist/{Source-DYMJRrsq.cjs.map → Source-B5AoSlsi.cjs.map} +1 -1
- package/dist/{Source-DwTHB8fn.js → Source-F8EYCYkV.js} +4 -4
- package/dist/{Source-DwTHB8fn.js.map → Source-F8EYCYkV.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 +8 -8
- package/dist/SparkLine.js.map +1 -1
- package/dist/{Spinner-DVBnY6Vg.js → Spinner--r2RrJV8.js} +2 -2
- package/dist/{Spinner-DVBnY6Vg.js.map → Spinner--r2RrJV8.js.map} +1 -1
- package/dist/{Spinner-CQZcjzwd.cjs → Spinner-jTMOLuw_.cjs} +2 -2
- package/dist/{Spinner-CQZcjzwd.cjs.map → Spinner-jTMOLuw_.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +10 -10
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +13 -13
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +3 -3
- package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -1
- package/dist/{Tooltip-uUdw6wJL.cjs → Tooltip-BLa2EfMs.cjs} +2 -2
- package/dist/{Tooltip-uUdw6wJL.cjs.map → Tooltip-BLa2EfMs.cjs.map} +1 -1
- package/dist/{Tooltip-Dj5eVppQ.js → Tooltip-BRnAz2Gv.js} +3 -3
- package/dist/{Tooltip-Dj5eVppQ.js.map → Tooltip-BRnAz2Gv.js.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +10 -10
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/Types.d.ts +8 -1
- package/dist/{Typography-PxtFcnJb.js → Typography-hWfh3H0J.js} +2 -2
- package/dist/{Typography-PxtFcnJb.js.map → Typography-hWfh3H0J.js.map} +1 -1
- package/dist/{Typography-DX7PlgQU.cjs → Typography-sa1UE0oF.cjs} +2 -2
- package/dist/{Typography-DX7PlgQU.cjs.map → Typography-sa1UE0oF.cjs.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +8 -8
- package/dist/WaterfallChart.cjs +2 -0
- package/dist/WaterfallChart.cjs.map +1 -0
- package/dist/WaterfallChart.d.ts +208 -0
- package/dist/WaterfallChart.js +427 -0
- package/dist/WaterfallChart.js.map +1 -0
- package/dist/{XAxesLabels-Bt5NZBmX.cjs → XAxesLabels-C6o9jJal.cjs} +2 -2
- package/dist/{XAxesLabels-Bt5NZBmX.cjs.map → XAxesLabels-C6o9jJal.cjs.map} +1 -1
- package/dist/{XAxesLabels-Dy8E1SEo.js → XAxesLabels-rhK7lRjO.js} +3 -3
- package/dist/{XAxesLabels-Dy8E1SEo.js.map → XAxesLabels-rhK7lRjO.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CObVFSm4.js → XTicksAndGridLines-CVZkZkpS.js} +2 -2
- package/dist/{XTicksAndGridLines-CObVFSm4.js.map → XTicksAndGridLines-CVZkZkpS.js.map} +1 -1
- package/dist/{XTicksAndGridLines-B6CELS7q.cjs → XTicksAndGridLines-CekrPykD.cjs} +2 -2
- package/dist/{XTicksAndGridLines-B6CELS7q.cjs.map → XTicksAndGridLines-CekrPykD.cjs.map} +1 -1
- package/dist/{YAxesLabels-DesLesUP.cjs → YAxesLabels-BQ2aCazV.cjs} +2 -2
- package/dist/{YAxesLabels-DesLesUP.cjs.map → YAxesLabels-BQ2aCazV.cjs.map} +1 -1
- package/dist/{YAxesLabels-a57ZRv-0.js → YAxesLabels-QICWVsHf.js} +3 -3
- package/dist/{YAxesLabels-a57ZRv-0.js.map → YAxesLabels-QICWVsHf.js.map} +1 -1
- package/dist/{YTicksAndGridLines-Blepl7XF.js → YTicksAndGridLines-GnXnSRF2.js} +2 -2
- package/dist/{YTicksAndGridLines-Blepl7XF.js.map → YTicksAndGridLines-GnXnSRF2.js.map} +1 -1
- package/dist/{YTicksAndGridLines-4pxTRlRK.cjs → YTicksAndGridLines-UzVC5eBM.cjs} +2 -2
- package/dist/{YTicksAndGridLines-4pxTRlRK.cjs.map → YTicksAndGridLines-UzVC5eBM.cjs.map} +1 -1
- package/dist/{band-DHUZ2X7J.js → band-DYty33LD.js} +2 -2
- package/dist/{band-DHUZ2X7J.js.map → band-DYty33LD.js.map} +1 -1
- package/dist/{checkIfMultiple-CIRtG0KE.js → checkIfMultiple-D9fVkeOq.js} +7 -19
- package/dist/{checkIfMultiple-CIRtG0KE.js.map → checkIfMultiple-D9fVkeOq.js.map} +1 -1
- package/dist/checkIfMultiple-DxnGtm3t.cjs +2 -0
- package/dist/{checkIfMultiple-wg6hJLXy.cjs.map → checkIfMultiple-DxnGtm3t.cjs.map} +1 -1
- package/dist/{customArea-BUhPiPT6.js → customArea-ASDaSE4u.js} +5 -5
- package/dist/{customArea-BUhPiPT6.js.map → customArea-ASDaSE4u.js.map} +1 -1
- package/dist/{customArea-CMF5g-C3.cjs → customArea-B1LWQBmM.cjs} +2 -2
- package/dist/{customArea-CMF5g-C3.cjs.map → customArea-B1LWQBmM.cjs.map} +1 -1
- package/dist/defaultLocale-C4wbwF1n.cjs +2 -0
- package/dist/defaultLocale-C4wbwF1n.cjs.map +1 -0
- package/dist/defaultLocale-CPy_WVtp.js +172 -0
- package/dist/defaultLocale-CPy_WVtp.js.map +1 -0
- package/dist/{ensureCompleteData-DH5c52Ub.js → ensureCompleteData-CDIukSG6.js} +2 -2
- package/dist/{ensureCompleteData-DH5c52Ub.js.map → ensureCompleteData-CDIukSG6.js.map} +1 -1
- package/dist/{ensureCompleteData-pZ9QO6kB.cjs → ensureCompleteData-D9bQTiVS.cjs} +2 -2
- package/dist/{ensureCompleteData-pZ9QO6kB.cjs.map → ensureCompleteData-D9bQTiVS.cjs.map} +1 -1
- package/dist/{fetchAndParseData-BpqkBPQL.js → fetchAndParseData-BAXhgTDM.js} +12 -18
- package/dist/{fetchAndParseData-BpqkBPQL.js.map → fetchAndParseData-BAXhgTDM.js.map} +1 -1
- package/dist/{fetchAndParseData-l5HGMAEs.cjs → fetchAndParseData-QTF6tjij.cjs} +3 -8
- package/dist/{fetchAndParseData-l5HGMAEs.cjs.map → fetchAndParseData-QTF6tjij.cjs.map} +1 -1
- package/dist/fetchAndParseData.cjs +1 -1
- package/dist/fetchAndParseData.js +1 -1
- package/dist/getCentroidCoordinates-CtBGrNC8.cjs +2 -0
- package/dist/getCentroidCoordinates-CtBGrNC8.cjs.map +1 -0
- package/dist/{getCentroidCoordinates-D7r34N4w.js → getCentroidCoordinates-s0OOUjLF.js} +15 -15
- package/dist/getCentroidCoordinates-s0OOUjLF.js.map +1 -0
- package/dist/{getGraphList-Dxwo9TDb.js → getGraphList-Bpd3PVmF.js} +7 -1
- package/dist/getGraphList-Bpd3PVmF.js.map +1 -0
- package/dist/getGraphList-DQ24IzAn.cjs +2 -0
- package/dist/getGraphList-DQ24IzAn.cjs.map +1 -0
- package/dist/{getJenks-GYmdwBqm.cjs → getJenks-BzJvhy_H.cjs} +2 -2
- package/dist/{getJenks-GYmdwBqm.cjs.map → getJenks-BzJvhy_H.cjs.map} +1 -1
- package/dist/{getJenks-BbngDoBQ.js → getJenks-DTCcQSDi.js} +2 -2
- package/dist/{getJenks-BbngDoBQ.js.map → getJenks-DTCcQSDi.js.map} +1 -1
- package/dist/getSchema.cjs +1 -1
- package/dist/getSchema.cjs.map +1 -1
- package/dist/getSchema.d.ts +3 -3
- package/dist/getSchema.js +24 -16
- package/dist/getSchema.js.map +1 -1
- package/dist/getSliderMarks-CIuSoedo.cjs +2 -0
- package/dist/{getSliderMarks-BmADcPQt.cjs.map → getSliderMarks-CIuSoedo.cjs.map} +1 -1
- package/dist/{getSliderMarks-HIDJ0_Cd.js → getSliderMarks-Cvg8zHBU.js} +4 -9
- package/dist/getSliderMarks-Cvg8zHBU.js.map +1 -0
- package/dist/{imageDownload-NYXbvKob.cjs → imageDownload-61q6jyJW.cjs} +3 -3
- package/dist/imageDownload-61q6jyJW.cjs.map +1 -0
- package/dist/{imageDownload-BU4qnxJP.js → imageDownload-Diofs_vY.js} +14 -15
- package/dist/imageDownload-Diofs_vY.js.map +1 -0
- package/dist/{index-D491FEn1.js → index-BQYOuXdl.js} +15 -15
- package/dist/{index-D491FEn1.js.map → index-BQYOuXdl.js.map} +1 -1
- package/dist/{index-DxXnJ8Ti.cjs → index-C5K--w8d.cjs} +2 -2
- package/dist/index-C5K--w8d.cjs.map +1 -0
- package/dist/{index-DRXx7m-C.cjs → index-C6er0ety.cjs} +2 -2
- package/dist/{index-DRXx7m-C.cjs.map → index-C6er0ety.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-CTPQjnHt.cjs → index-CHPV5EwG-6v2a2njQ.cjs} +5 -69
- package/dist/{index-CHPV5EwG-CTPQjnHt.cjs.map → index-CHPV5EwG-6v2a2njQ.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-Curnpaqc.js → index-CHPV5EwG-DecW7_qr.js} +5 -77
- package/dist/{index-CHPV5EwG-Curnpaqc.js.map → index-CHPV5EwG-DecW7_qr.js.map} +1 -1
- package/dist/{index-SKgJALZg.js → index-CSiFiXPj.js} +3 -3
- package/dist/{index-SKgJALZg.js.map → index-CSiFiXPj.js.map} +1 -1
- package/dist/index-CoobIWNj.cjs +10 -0
- package/dist/index-CoobIWNj.cjs.map +1 -0
- package/dist/index-CtMBjvtq.js +148 -0
- package/dist/index-CtMBjvtq.js.map +1 -0
- package/dist/{index-Cw8sCyo_-BrHiWiRF.cjs → index-Cw8sCyo_-CEcCMKUi.cjs} +2 -2
- package/dist/{index-Cw8sCyo_-BrHiWiRF.cjs.map → index-Cw8sCyo_-CEcCMKUi.cjs.map} +1 -1
- package/dist/{index-Cw8sCyo_-B2hEKjzG.js → index-Cw8sCyo_-n4AacHGk.js} +6 -4
- package/dist/{index-Cw8sCyo_-B2hEKjzG.js.map → index-Cw8sCyo_-n4AacHGk.js.map} +1 -1
- package/dist/{index-R1gTfap5.js → index-D5ihtaJJ.js} +12 -12
- package/dist/{index-R1gTfap5.js.map → index-D5ihtaJJ.js.map} +1 -1
- package/dist/{index-B_sAFsEV.cjs → index-D69M6klB.cjs} +2 -2
- package/dist/{index-B_sAFsEV.cjs.map → index-D69M6klB.cjs.map} +1 -1
- package/dist/{index-GEsywGxz.js → index-DCsFBfJ_.js} +160 -104
- package/dist/index-DCsFBfJ_.js.map +1 -0
- package/dist/{index-WML2dCZ0.cjs → index-Dgjq6aZ2.cjs} +2 -2
- package/dist/{index-WML2dCZ0.cjs.map → index-Dgjq6aZ2.cjs.map} +1 -1
- package/dist/{index-Dzc_aaI9-BmkfPMyc.cjs → index-Dzc_aaI9-C3DbPpy3.cjs} +2 -2
- package/dist/{index-Dzc_aaI9-BmkfPMyc.cjs.map → index-Dzc_aaI9-C3DbPpy3.cjs.map} +1 -1
- package/dist/{index-Dzc_aaI9-Bb7gobH_.js → index-Dzc_aaI9-CG2Ar7l1.js} +4 -4
- package/dist/{index-Dzc_aaI9-Bb7gobH_.js.map → index-Dzc_aaI9-CG2Ar7l1.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +209 -94
- package/dist/index.js +129 -127
- package/dist/index.js.map +1 -1
- package/dist/{linear-BqltdMeF.js → linear-CalFSAaO.js} +2 -2
- package/dist/{linear-BqltdMeF.js.map → linear-CalFSAaO.js.map} +1 -1
- package/dist/{linear-BwPAspcq.cjs → linear-CgUCbw9F.cjs} +2 -2
- package/dist/{linear-BwPAspcq.cjs.map → linear-CgUCbw9F.cjs.map} +1 -1
- package/dist/{ordinal-BJ6O_LC5.js → ordinal-CHaxGJ_l.js} +2 -2
- package/dist/{ordinal-BJ6O_LC5.js.map → ordinal-CHaxGJ_l.js.map} +1 -1
- package/dist/{parse-DlCRUFh_.js → parse-Dv4of-PN.js} +2 -67
- package/dist/{parse-DlCRUFh_.js.map → parse-Dv4of-PN.js.map} +1 -1
- package/dist/parse-xYI9yrvL.cjs +2 -0
- package/dist/{parse-hMnG_lRV.cjs.map → parse-xYI9yrvL.cjs.map} +1 -1
- package/dist/{pow-DgrUorRi.cjs → pow-BnyPO-NX.cjs} +2 -2
- package/dist/{pow-DgrUorRi.cjs.map → pow-BnyPO-NX.cjs.map} +1 -1
- package/dist/{pow-CM2aze4M.js → pow-CaIrlM4J.js} +2 -2
- package/dist/{pow-CM2aze4M.js.map → pow-CaIrlM4J.js.map} +1 -1
- package/dist/proxy-C4-uo6nS.cjs +2 -0
- package/dist/proxy-C4-uo6nS.cjs.map +1 -0
- package/dist/{proxy-BxkFHwUw.js → proxy-DRuSUlPL.js} +2828 -2717
- package/dist/proxy-DRuSUlPL.js.map +1 -0
- package/dist/{string2HTML-DhG75NqA.js → string2HTML-DUYZT1L9.js} +17 -17
- package/dist/{string2HTML-DhG75NqA.js.map → string2HTML-DUYZT1L9.js.map} +1 -1
- package/dist/{string2HTML-CPGr_I5E.cjs → string2HTML-xx9MzTtY.cjs} +3 -3
- package/dist/{string2HTML-CPGr_I5E.cjs.map → string2HTML-xx9MzTtY.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{time-BUL-dwnK.js → time-CAtex-RV.js} +2 -2
- package/dist/{time-BUL-dwnK.js.map → time-CAtex-RV.js.map} +1 -1
- package/dist/{time-CZd5YLSP.cjs → time-CkcKbhwe.cjs} +2 -2
- package/dist/{time-CZd5YLSP.cjs.map → time-CkcKbhwe.cjs.map} +1 -1
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.d.ts +1 -1
- package/dist/transformData.js +3 -3
- package/dist/transformDataForAggregation-BFdha9Dx.cjs +2 -0
- package/dist/transformDataForAggregation-BFdha9Dx.cjs.map +1 -0
- package/dist/{transformDataForAggregation-j34UL73s.js → transformDataForAggregation-wdPf8bNt.js} +26 -11
- package/dist/transformDataForAggregation-wdPf8bNt.js.map +1 -0
- package/dist/{transformDataForGraphFromFile-CuXxR8uA.cjs → transformDataForGraphFromFile-DOhp1qrp.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-CuXxR8uA.cjs.map → transformDataForGraphFromFile-DOhp1qrp.cjs.map} +1 -1
- package/dist/{transformDataForGraphFromFile-DyP-83Nh.js → transformDataForGraphFromFile-dt9sHTVy.js} +3 -3
- package/dist/{transformDataForGraphFromFile-DyP-83Nh.js.map → transformDataForGraphFromFile-dt9sHTVy.js.map} +1 -1
- package/dist/{use-in-view-QcfiW0w3.cjs → use-in-view-C3o_ntMv.cjs} +2 -2
- package/dist/use-in-view-C3o_ntMv.cjs.map +1 -0
- package/dist/{use-in-view-Cxa7y1TH.js → use-in-view-Dl5L8LtP.js} +2 -2
- package/dist/use-in-view-Dl5L8LtP.js.map +1 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +4 -4
- package/dist/validateSchema.cjs +1 -1
- package/dist/validateSchema.d.ts +1 -1
- package/dist/validateSchema.js +1 -1
- package/dist/{x-BBpi7a_7-WVdj1j6r.js → x-BBpi7a_7-BsvWCzYM.js} +1 -31
- package/dist/{x-BBpi7a_7-WVdj1j6r.js.map → x-BBpi7a_7-BsvWCzYM.js.map} +1 -1
- package/dist/x-BBpi7a_7-DXYIEFwN.cjs +2 -0
- package/dist/{x-BBpi7a_7-mTo40uId.cjs.map → x-BBpi7a_7-DXYIEFwN.cjs.map} +1 -1
- package/dist/{zoom-C9MFjAaV.js → zoom-5AkJSuWO.js} +3 -3
- package/dist/zoom-5AkJSuWO.js.map +1 -0
- package/dist/{zoom-DPw8bba-.cjs → zoom-ChcvXFIz.cjs} +2 -2
- package/dist/zoom-ChcvXFIz.cjs.map +1 -0
- package/package.json +21 -1
- package/readme.md +33 -22
- package/dist/EmptyState-C7ZXkZWd.js +0 -15
- package/dist/GraphEl-BixTEyKW.cjs +0 -2
- package/dist/GraphEl-BixTEyKW.cjs.map +0 -1
- package/dist/GraphEl-Dyu_EIQb.js.map +0 -1
- package/dist/ReferenceLine-2XCwHXQ4.js.map +0 -1
- package/dist/RegressionLine-DAcY2DjT.js.map +0 -1
- package/dist/checkIfMultiple-wg6hJLXy.cjs +0 -12
- package/dist/defaultLocale-BEa-49Qz.js +0 -172
- package/dist/defaultLocale-BEa-49Qz.js.map +0 -1
- package/dist/defaultLocale-DIVzfLaQ.cjs +0 -2
- package/dist/defaultLocale-DIVzfLaQ.cjs.map +0 -1
- package/dist/getCentroidCoordinates-D7r34N4w.js.map +0 -1
- package/dist/getCentroidCoordinates-Dng1HVjO.cjs +0 -2
- package/dist/getCentroidCoordinates-Dng1HVjO.cjs.map +0 -1
- package/dist/getGraphList-CA17dvFB.cjs +0 -2
- package/dist/getGraphList-CA17dvFB.cjs.map +0 -1
- package/dist/getGraphList-Dxwo9TDb.js.map +0 -1
- package/dist/getSliderMarks-BmADcPQt.cjs +0 -6
- package/dist/getSliderMarks-HIDJ0_Cd.js.map +0 -1
- package/dist/imageDownload-BU4qnxJP.js.map +0 -1
- package/dist/imageDownload-NYXbvKob.cjs.map +0 -1
- package/dist/index-BqfRwk1n.js +0 -146
- package/dist/index-BqfRwk1n.js.map +0 -1
- package/dist/index-DG2bgAva.cjs +0 -10
- package/dist/index-DG2bgAva.cjs.map +0 -1
- package/dist/index-DxXnJ8Ti.cjs.map +0 -1
- package/dist/index-GEsywGxz.js.map +0 -1
- package/dist/parse-hMnG_lRV.cjs +0 -2
- package/dist/proxy-BxkFHwUw.js.map +0 -1
- package/dist/proxy-BxvUI_9l.cjs +0 -2
- package/dist/proxy-BxvUI_9l.cjs.map +0 -1
- package/dist/transformDataForAggregation-CYoB5Xsk.cjs +0 -2
- package/dist/transformDataForAggregation-CYoB5Xsk.cjs.map +0 -1
- package/dist/transformDataForAggregation-j34UL73s.js.map +0 -1
- package/dist/use-in-view-Cxa7y1TH.js.map +0 -1
- package/dist/use-in-view-QcfiW0w3.cjs.map +0 -1
- package/dist/x-BBpi7a_7-mTo40uId.cjs +0 -27
- package/dist/zoom-C9MFjAaV.js.map +0 -1
- package/dist/zoom-DPw8bba-.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, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\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\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\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}\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 } = props;\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\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([0, 0])\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([0, 0])\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([0, 0])\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([0, 0])\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([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\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 {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <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 {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.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 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 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 {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={masterPath}\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 }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\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 }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\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 }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\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 }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\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\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} 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [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.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,\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 } = 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(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\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 === 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(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\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 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 collapseColorScaleByDefault={collapseColorScaleByDefault}\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","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","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","i","findIndex","el","id","properties","length","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","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","timeline","t24","Colors","light","graphNoData","grays","t25","t26","t27","t28","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t29","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","d_1","t33","t34","getUniqValue","getJenks","_temp3","t35","t36","speed","interval","setInterval","clearInterval","t37","t38","getSliderMarks","markObj","t39","graphContainer","t40","t41","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t42","Pause","Play","SliderUI","nextValue","nextValue_0","t43","GraphArea","d_8","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t44","footnote","source","GraphFooter","t45","GraphContainer","NAME","d_5","d_4","d_3","d_7","d_6","d_2","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEO,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,IACAC,6BAAAA;AAAAA,EAAAA,IACE/B,GACE,CAACgC,GAAeC,CAAgB,IAAIC,EAA6BC,MAAS,GAC1EC,KAAUC,GAAoD,IAAI,GAClE,CAACC,IAAYC,EAAa,IAA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;AA3J7B,SAAAyQ,GAAAkD,GAAA;AAAA,SAsGiB5M,EAAC2B;AAA+B;AAtGjD,SAAAiG,GAAAiF,GAAAC,GAAA;AAAA,SA8DkBD,IAAIC;AAAC;AA9DvB,SAAApF,GAAA1H,GAAA;AAAA,SA0DgBA,EAACsH;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, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\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\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\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}\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 } = props;\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\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([0, 0])\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([0, 0])\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([0, 0])\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([0, 0])\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([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\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 {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <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 {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.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 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 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 {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={masterPath}\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 }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\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 }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\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 }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\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 }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\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\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} 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [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.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,\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 } = 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(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\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 === 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(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\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 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 collapseColorScaleByDefault={collapseColorScaleByDefault}\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","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","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","i","findIndex","el","id","properties","length","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","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","timeline","t24","Colors","light","graphNoData","grays","t25","t26","t27","t28","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t29","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","d_1","t33","t34","getUniqValue","getJenks","_temp3","t35","t36","speed","interval","setInterval","clearInterval","t37","t38","getSliderMarks","markObj","t39","graphContainer","t40","t41","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t42","Pause","Play","SliderUI","nextValue","nextValue_0","t43","GraphArea","d_8","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t44","footnote","source","GraphFooter","t45","GraphContainer","NAME","d_5","d_4","d_3","d_7","d_6","d_2","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AA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,SAAAqB,GAAArB,SAAA7J,GAAA6J,SAAA8B,GAAA9B,SAAAgC,GAAAhC,SAAAW,IAAAX,SAAAgB,GAAAhB,SAAAiH,IAAAjH,SAAAmH,IAAAnH,SAAAoH,IAAApH,SAAA6H,IAAA7H,SAAAmI,IAAAnI,SAAA4I,IAAA5I,SAAAkC,IAAAlC,SAAA5J,GAAA4J,SAAAgJ,MAAAA,KAAAhJ,EAAA,GAAA,GAjKjBgJ;AAiKiB;AA7Rd,SAAAT,GAAApL,GAAA;AAAA,SA8M4BA,EAAEE,WAAW6L,SAAU;AAAY;AA9M/D,SAAAtB,GAAAuB,GAAA;AAAA,SA6J4BvM,MAAM7E;AAAS;AA7J3C,SAAA4P,GAAAyB,GAAA;AAAA,SA4J6CxM,MAAM7E;AAAS;AA5J5D,SAAA2P,GAAA2B,GAAA;AAAA,SA4JyBzM,EAAC/G;AAAK;AA5J/B,SAAA4R,GAAA6B,GAAA;AAAA,SA2J2C1M,MAAM7E;AAAS;AA3J1D,SAAAyP,GAAA+B,GAAA;AAAA,SA2JuB3M,EAAC/G;AAAK;AA3J7B,SAAAyQ,GAAAkD,GAAA;AAAA,SAsGiB5M,EAAC2B;AAA+B;AAtGjD,SAAAiG,GAAAiF,GAAAC,GAAA;AAAA,SA8DkBD,IAAIC;AAAC;AA9DvB,SAAApF,GAAA1H,GAAA;AAAA,SA0DgBA,EAACsH;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-6v2a2njQ.cjs");require("react");const e=require("./index-Dgjq6aZ2.cjs");require("./GraphFooter.cjs");require("./GraphHeader.cjs");require("./ColorLegendWithMouseOver.cjs");require("./Colors.cjs");require("./EmptyState-CGeBqbmR.cjs");require("./uniqBy-O05lp2S5.cjs");require("./GraphContainer-B1EDxJ0S.cjs");exports.CirclePackingGraph=e.CirclePackingGraph;
|
|
2
2
|
//# sourceMappingURL=CirclePackingGraph.cjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./index-CHPV5EwG-
|
|
1
|
+
import "./index-CHPV5EwG-DecW7_qr.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import { C as g } from "./index-
|
|
3
|
+
import { C as g } from "./index-D5ihtaJJ.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-tZBErBKF.js";
|
|
9
9
|
import "./uniqBy-BHy4I8PK.js";
|
|
10
|
-
import "./GraphContainer-
|
|
10
|
+
import "./GraphContainer-CF6ws3pd.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-6v2a2njQ.cjs"),b=require("./Typography-sa1UE0oF.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.j,{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.j,{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.j,{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 { j as w } from "./Typography-
|
|
1
|
+
import { c as T, m as k, j as l } from "./index-CHPV5EwG-DecW7_qr.js";
|
|
2
|
+
import { j as w } from "./Typography-hWfh3H0J.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-6v2a2njQ.cjs"),C=require("./Typography-sa1UE0oF.cjs"),N=require("./Colors.cjs");function M(b){const e=s.compilerRuntimeExports.c(28),{colorLegendTitle:m,colorDomain:p,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.j,{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]!==p||e[9]!==o||e[10]!==t){let j;e[12]!==o||e[13]!==t?(j=(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.j,{size:"sm",marginBottom:"none",children:y})]},E),e[12]=o,e[13]=t,e[14]=j):j=e[14],i=p.map(j),e[8]=p,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.j,{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 { j as C } from "./Typography-
|
|
1
|
+
import { c as E, m as L, j as l } from "./index-CHPV5EwG-DecW7_qr.js";
|
|
2
|
+
import { j as C } from "./Typography-hWfh3H0J.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,17 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-CTPQjnHt.cjs"),ne=require("./index-DRXx7m-C.cjs"),k=require("react"),Fe=require("react-dom"),f=require("./index-Dzc_aaI9-BmkfPMyc.cjs"),Oe=require("./index-Cw8sCyo_-BrHiWiRF.cjs"),z=require("./x-BBpi7a_7-mTo40uId.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 X=new Map,oe=t=>{if(X.has(t))return;const r=setTimeout(()=>{X.delete(t),M({type:"REMOVE_TOAST",toastId:t})},qe);X.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:Be},t[3]=r,t[4]=n):n=t[4],n}function Be(t){return M({type:"DISMISS_TOAST",toastId:t})}/**
|
|
2
|
-
* @license lucide-react v0.542.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/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"}]],Xe=z.k("circle-check-big",Ue);/**
|
|
7
|
-
* @license lucide-react v0.542.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const 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);/**
|
|
12
|
-
* @license lucide-react v0.542.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const 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]=f.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),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:s,swipeThreshold:n,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"],H="toast.viewportPause",Y="toast.viewportResume",fe=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),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(H);h.dispatchEvent(N),i.isClosePausedRef.current=!0}},b=()=>{if(i.isClosePausedRef.current){const N=new CustomEvent(Y);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);G(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":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(f.w.ol,{tabIndex:-1,...n,ref:E})}),j&&o.ae.jsx(Z,{ref:w,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"backwards"});G(d)}})]})});fe.displayName=pe;var me="ToastFocusProxy",Z=l.forwardRef((t,r)=>{const{__scopeToast:e,onFocusFromOutsideViewport:a,...s}=t,n=W(me,e);return o.ae.jsx(f.a,{tabIndex:0,...s,ref:r,style:{position:"fixed"},onFocus:i=>{const u=i.relatedTarget;!n.viewport?.contains(u)&&a()}})});Z.displayName=me;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]=f._({prop:a,defaultProp:s??!0,onChange:n,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:s,open:n,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),_=s||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(H,C),p.addEventListener(Y,S),()=>{p.removeEventListener(H,C),p.removeEventListener(Y,S)}}},[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(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":n?"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},se={originalEvent:p,delta:K};A?(T.current=K,$(at,m,se,{discrete:!1})):ie(K,y.swipeDirection,B)?(T.current=K,$(rt,w,se,{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)?$(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(f.u,{asChild:!0,children:o.ae.jsx(f.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(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,s=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,s.onClose)})})});ee.displayName=be;var Te=l.forwardRef((t,r)=>{const{__scopeToast:e,altText:a,...s}=t;return o.ae.jsx(f.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),ft(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?f.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=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 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=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,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(Ne,{...s,ref:r,className:n}),e[5]=s,e[6]=r,e[7]=n,e[8]=i):i=e[8],i});ht.displayName=Ne.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(Se,{...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=Se.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 m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(He,{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(Xe,{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]!==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(),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(ne.Copy,{}),r[4]=g):g=r[4];const j=s||null;let y;r[5]!==m||r[6]!==E||r[7]!==j?(y=o.jsxRuntimeExports.jsxs(ne.x,{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-6v2a2njQ.cjs"),ne=require("./index-C6er0ety.cjs"),k=require("react"),Fe=require("react-dom"),f=require("./index-Dzc_aaI9-C3DbPpy3.cjs"),Oe=require("./index-Cw8sCyo_-CEcCMKUi.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,qe=1e6;let U=0;function Ve(){return U=(U+1)%Number.MAX_SAFE_INTEGER,U.toString()}const X=new Map,oe=t=>{if(X.has(t))return;const r=setTimeout(()=>{X.delete(t),M({type:"REMOVE_TOAST",toastId:t})},qe);X.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:Be},t[3]=r,t[4]=n):n=t[4],n}function Be(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"}]],Xe=z.k("circle-check-big",Ue);const 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);const 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]=f.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),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:s,swipeThreshold:n,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"],H="toast.viewportPause",Y="toast.viewportResume",fe=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),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(H);h.dispatchEvent(N),i.isClosePausedRef.current=!0}},b=()=>{if(i.isClosePausedRef.current){const N=new CustomEvent(Y);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);G(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":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(f.w.ol,{tabIndex:-1,...n,ref:E})}),j&&o.ae.jsx(Z,{ref:w,onFocusFromOutsideViewport:()=>{const d=y({tabbingDirection:"backwards"});G(d)}})]})});fe.displayName=pe;var me="ToastFocusProxy",Z=l.forwardRef((t,r)=>{const{__scopeToast:e,onFocusFromOutsideViewport:a,...s}=t,n=W(me,e);return o.ae.jsx(f.a,{tabIndex:0,...s,ref:r,style:{position:"fixed"},onFocus:i=>{const u=i.relatedTarget;!n.viewport?.contains(u)&&a()}})});Z.displayName=me;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]=f._({prop:a,defaultProp:s??!0,onChange:n,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:s,open:n,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),_=s||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(H,C),p.addEventListener(Y,S),()=>{p.removeEventListener(H,C),p.removeEventListener(Y,S)}}},[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(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":n?"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},se={originalEvent:p,delta:K};A?(T.current=K,$(at,m,se,{discrete:!1})):ie(K,y.swipeDirection,B)?(T.current=K,$(rt,w,se,{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)?$(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(f.u,{asChild:!0,children:o.ae.jsx(f.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(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,s=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,s.onClose)})})});ee.displayName=be;var Te=l.forwardRef((t,r)=>{const{__scopeToast:e,altText:a,...s}=t;return o.ae.jsx(f.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),ft(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?f.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=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 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=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,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(Ne,{...s,ref:r,className:n}),e[5]=s,e[6]=r,e[7]=n,e[8]=i):i=e[8],i});ht.displayName=Ne.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(Se,{...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=Se.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 m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=o.ae.jsx(He,{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(Xe,{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]!==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(),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(ne.Copy,{}),r[4]=g):g=r[4];const j=s||null;let y;r[5]!==m||r[6]!==E||r[7]!==j?(y=o.jsxRuntimeExports.jsxs(ne.x,{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;
|
|
17
2
|
//# sourceMappingURL=CopyTextButton.cjs.map
|