@fluentui/react-charts 9.1.10 → 9.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/CHANGELOG.md +41 -2
  2. package/dist/index.d.ts +44 -3
  3. package/lib/AreaChart.js.map +1 -1
  4. package/lib/CartesianChart.js.map +1 -1
  5. package/lib/DeclarativeChart.js.map +1 -1
  6. package/lib/DonutChart.js.map +1 -1
  7. package/lib/FunnelChart.js.map +1 -1
  8. package/lib/GanttChart.js.map +1 -1
  9. package/lib/GaugeChart.js.map +1 -1
  10. package/lib/GroupedVerticalBarChart.js.map +1 -1
  11. package/lib/HeatMapChart.js.map +1 -1
  12. package/lib/HorizontalBarChart.js.map +1 -1
  13. package/lib/HorizontalBarChartWithAxis.js.map +1 -1
  14. package/lib/Legends.js.map +1 -1
  15. package/lib/LineChart.js.map +1 -1
  16. package/lib/Popover.js.map +1 -1
  17. package/lib/ResponsiveContainer.js.map +1 -1
  18. package/lib/SankeyChart.js.map +1 -1
  19. package/lib/ScatterChart.js.map +1 -1
  20. package/lib/Sparkline.js.map +1 -1
  21. package/lib/VerticalBarChart.js.map +1 -1
  22. package/lib/VerticalStackedBarChart.js.map +1 -1
  23. package/lib/components/AreaChart/AreaChart.js +11 -3
  24. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  25. package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
  26. package/lib/components/AreaChart/index.js.map +1 -1
  27. package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
  28. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +41 -0
  29. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  30. package/lib/components/CommonComponents/CartesianChart.js +2 -1
  31. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  32. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  33. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  34. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  35. package/lib/components/CommonComponents/index.js.map +1 -1
  36. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +1 -2
  37. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +128 -0
  38. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  39. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +1 -2
  40. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +126 -0
  41. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  42. package/lib/components/DeclarativeChart/DeclarativeChart.js +15 -7
  43. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  44. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +90 -29
  45. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  46. package/lib/components/DeclarativeChart/imageExporter.js +1 -0
  47. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
  48. package/lib/components/DeclarativeChart/index.js.map +1 -1
  49. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  50. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  51. package/lib/components/DonutChart/Arc/index.js.map +1 -1
  52. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +1 -2
  53. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +44 -0
  54. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  55. package/lib/components/DonutChart/DonutChart.js +11 -3
  56. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  57. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  58. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  59. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  60. package/lib/components/DonutChart/Pie/index.js.map +1 -1
  61. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +1 -2
  62. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +29 -0
  63. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  64. package/lib/components/DonutChart/index.js.map +1 -1
  65. package/lib/components/DonutChart/useDonutChartStyles.styles.js +1 -2
  66. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +45 -0
  67. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  68. package/lib/components/FunnelChart/FunnelChart.js +10 -1
  69. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  70. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  71. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  72. package/lib/components/FunnelChart/index.js.map +1 -1
  73. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +1 -2
  74. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +51 -0
  75. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  76. package/lib/components/GanttChart/GanttChart.js +19 -2
  77. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  78. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  79. package/lib/components/GanttChart/index.js.map +1 -1
  80. package/lib/components/GanttChart/useGanttChartStyles.styles.js +1 -2
  81. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +23 -0
  82. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  83. package/lib/components/GaugeChart/GaugeChart.js +9 -2
  84. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  85. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  86. package/lib/components/GaugeChart/index.js.map +1 -1
  87. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +1 -2
  88. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +142 -0
  89. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  90. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +70 -58
  91. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  92. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  93. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
  94. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
  95. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +53 -0
  96. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  97. package/lib/components/HeatMapChart/HeatMapChart.js +11 -3
  98. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  99. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  100. package/lib/components/HeatMapChart/index.js.map +1 -1
  101. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -2
  102. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +38 -0
  103. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  104. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  105. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  106. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  107. package/lib/components/HorizontalBarChart/index.js.map +1 -1
  108. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -2
  109. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +120 -0
  110. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  111. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -2
  112. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  113. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  114. package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  115. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -2
  116. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +39 -0
  117. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  118. package/lib/components/Legends/Legends.js +28 -10
  119. package/lib/components/Legends/Legends.js.map +1 -1
  120. package/lib/components/Legends/Legends.types.js.map +1 -1
  121. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  122. package/lib/components/Legends/index.js.map +1 -1
  123. package/lib/components/Legends/shape.js.map +1 -1
  124. package/lib/components/Legends/useLegendsStyles.styles.js +57 -14
  125. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  126. package/lib/components/Legends/useLegendsStyles.styles.raw.js +138 -0
  127. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  128. package/lib/components/LineChart/LineChart.js +9 -2
  129. package/lib/components/LineChart/LineChart.js.map +1 -1
  130. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  131. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  132. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  133. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  134. package/lib/components/LineChart/index.js.map +1 -1
  135. package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
  136. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +52 -0
  137. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  138. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  139. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  140. package/lib/components/ResponsiveContainer/index.js.map +1 -1
  141. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -2
  142. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +28 -0
  143. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  144. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  145. package/lib/components/SankeyChart/SankeyChart.js +5 -1
  146. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  147. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  148. package/lib/components/SankeyChart/index.js.map +1 -1
  149. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
  150. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +77 -0
  151. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  152. package/lib/components/ScatterChart/ScatterChart.js +11 -3
  153. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  154. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  155. package/lib/components/ScatterChart/index.js.map +1 -1
  156. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
  157. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +43 -0
  158. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  159. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  160. package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
  161. package/lib/components/Sparkline/index.js.map +1 -1
  162. package/lib/components/Sparkline/useSparklineStyles.styles.js +1 -2
  163. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +30 -0
  164. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  165. package/lib/components/VerticalBarChart/VerticalBarChart.js +62 -28
  166. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  167. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  168. package/lib/components/VerticalBarChart/index.js.map +1 -1
  169. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
  170. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +58 -0
  171. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  172. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +22 -8
  173. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  174. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  175. package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
  176. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
  177. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +49 -0
  178. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  179. package/lib/index.js.map +1 -1
  180. package/lib/types/DataPoint.js.map +1 -1
  181. package/lib/types/EventAnnotation.js.map +1 -1
  182. package/lib/types/LegendDataItem.js.map +1 -1
  183. package/lib/types/index.js.map +1 -1
  184. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  185. package/lib/utilities/KeyCodes.js.map +1 -1
  186. package/lib/utilities/SVGTooltipText.js +2 -0
  187. package/lib/utilities/SVGTooltipText.js.map +1 -1
  188. package/lib/utilities/async-utils.js.map +1 -1
  189. package/lib/utilities/colors.js.map +1 -1
  190. package/lib/utilities/getWindow.js.map +1 -1
  191. package/lib/utilities/image-export-utils.js +256 -0
  192. package/lib/utilities/image-export-utils.js.map +1 -0
  193. package/lib/utilities/index.js.map +1 -1
  194. package/lib/utilities/overflow-utils.js.map +1 -1
  195. package/lib/utilities/string.js.map +1 -1
  196. package/lib/utilities/test-data.js.map +1 -1
  197. package/lib/utilities/utilities.js +50 -5
  198. package/lib/utilities/utilities.js.map +1 -1
  199. package/lib/utilities/vbc-utils.js.map +1 -1
  200. package/lib-commonjs/AreaChart.js.map +1 -1
  201. package/lib-commonjs/CartesianChart.js.map +1 -1
  202. package/lib-commonjs/DeclarativeChart.js.map +1 -1
  203. package/lib-commonjs/DonutChart.js.map +1 -1
  204. package/lib-commonjs/FunnelChart.js.map +1 -1
  205. package/lib-commonjs/GanttChart.js.map +1 -1
  206. package/lib-commonjs/GaugeChart.js.map +1 -1
  207. package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -1
  208. package/lib-commonjs/HeatMapChart.js.map +1 -1
  209. package/lib-commonjs/HorizontalBarChart.js.map +1 -1
  210. package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -1
  211. package/lib-commonjs/Legends.js.map +1 -1
  212. package/lib-commonjs/LineChart.js.map +1 -1
  213. package/lib-commonjs/Popover.js.map +1 -1
  214. package/lib-commonjs/ResponsiveContainer.js.map +1 -1
  215. package/lib-commonjs/SankeyChart.js.map +1 -1
  216. package/lib-commonjs/ScatterChart.js.map +1 -1
  217. package/lib-commonjs/Sparkline.js.map +1 -1
  218. package/lib-commonjs/VerticalBarChart.js.map +1 -1
  219. package/lib-commonjs/VerticalStackedBarChart.js.map +1 -1
  220. package/lib-commonjs/components/AreaChart/AreaChart.js +10 -2
  221. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  222. package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
  223. package/lib-commonjs/components/AreaChart/index.js.map +1 -1
  224. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -1
  225. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  226. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +57 -0
  227. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  228. package/lib-commonjs/components/CommonComponents/CartesianChart.js +2 -1
  229. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  230. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  231. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  232. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  233. package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
  234. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +1 -1
  235. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  236. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +142 -0
  237. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  238. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +1 -1
  239. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  240. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +140 -0
  241. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  242. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +14 -6
  243. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  244. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +93 -29
  245. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  246. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
  247. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
  248. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
  249. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  250. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  251. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -1
  252. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +1 -1
  253. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  254. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +58 -0
  255. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  256. package/lib-commonjs/components/DonutChart/DonutChart.js +10 -2
  257. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  258. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  259. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  260. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  261. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -1
  262. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -1
  263. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +43 -0
  264. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  265. package/lib-commonjs/components/DonutChart/index.js.map +1 -1
  266. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +1 -1
  267. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +59 -0
  268. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  269. package/lib-commonjs/components/FunnelChart/FunnelChart.js +10 -1
  270. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  271. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  272. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  273. package/lib-commonjs/components/FunnelChart/index.js.map +1 -1
  274. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +1 -1
  275. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  276. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +65 -0
  277. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  278. package/lib-commonjs/components/GanttChart/GanttChart.js +18 -1
  279. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  280. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  281. package/lib-commonjs/components/GanttChart/index.js.map +1 -1
  282. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +1 -1
  283. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +39 -0
  284. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  285. package/lib-commonjs/components/GaugeChart/GaugeChart.js +9 -2
  286. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  287. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  288. package/lib-commonjs/components/GaugeChart/index.js.map +1 -1
  289. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -1
  290. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  291. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +160 -0
  292. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  293. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +70 -58
  294. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  295. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  296. package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -1
  297. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -1
  298. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +69 -0
  299. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  300. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +10 -2
  301. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  302. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  303. package/lib-commonjs/components/HeatMapChart/index.js.map +1 -1
  304. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -1
  305. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +56 -0
  306. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  307. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  308. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  309. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  310. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -1
  311. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -1
  312. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +134 -0
  313. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  314. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -2
  315. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  316. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  317. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  318. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -1
  319. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +55 -0
  320. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  321. package/lib-commonjs/components/Legends/Legends.js +28 -10
  322. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  323. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  324. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  325. package/lib-commonjs/components/Legends/index.js.map +1 -1
  326. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  327. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +101 -28
  328. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  329. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +174 -0
  330. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  331. package/lib-commonjs/components/LineChart/LineChart.js +9 -2
  332. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  333. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  334. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  335. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  336. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  337. package/lib-commonjs/components/LineChart/index.js.map +1 -1
  338. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +1 -1
  339. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +66 -0
  340. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  341. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  342. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  343. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -1
  344. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -1
  345. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +46 -0
  346. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  347. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  348. package/lib-commonjs/components/SankeyChart/SankeyChart.js +5 -1
  349. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  350. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  351. package/lib-commonjs/components/SankeyChart/index.js.map +1 -1
  352. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +1 -1
  353. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  354. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +95 -0
  355. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  356. package/lib-commonjs/components/ScatterChart/ScatterChart.js +10 -2
  357. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  358. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  359. package/lib-commonjs/components/ScatterChart/index.js.map +1 -1
  360. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
  361. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +57 -0
  362. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  363. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  364. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
  365. package/lib-commonjs/components/Sparkline/index.js.map +1 -1
  366. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -1
  367. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +44 -0
  368. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  369. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +62 -28
  370. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  371. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  372. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -1
  373. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -1
  374. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +74 -0
  375. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  376. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +22 -8
  377. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  378. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  379. package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -1
  380. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -1
  381. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  382. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +67 -0
  383. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  384. package/lib-commonjs/index.js.map +1 -1
  385. package/lib-commonjs/types/DataPoint.js.map +1 -1
  386. package/lib-commonjs/types/EventAnnotation.js.map +1 -1
  387. package/lib-commonjs/types/LegendDataItem.js.map +1 -1
  388. package/lib-commonjs/types/index.js.map +1 -1
  389. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  390. package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
  391. package/lib-commonjs/utilities/SVGTooltipText.js +2 -0
  392. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  393. package/lib-commonjs/utilities/async-utils.js.map +1 -1
  394. package/lib-commonjs/utilities/colors.js.map +1 -1
  395. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  396. package/lib-commonjs/utilities/image-export-utils.js +274 -0
  397. package/lib-commonjs/utilities/image-export-utils.js.map +1 -0
  398. package/lib-commonjs/utilities/index.js.map +1 -1
  399. package/lib-commonjs/utilities/overflow-utils.js.map +1 -1
  400. package/lib-commonjs/utilities/string.js.map +1 -1
  401. package/lib-commonjs/utilities/test-data.js.map +1 -1
  402. package/lib-commonjs/utilities/utilities.js +56 -5
  403. package/lib-commonjs/utilities/utilities.js.map +1 -1
  404. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  405. package/package.json +12 -22
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { HorizontalBarChartWithAxisProps, HorizontalBarChartWithAxisStyles } from './index';\nimport { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const hbcWithAxisClassNames: SlotClassNames<HorizontalBarChartWithAxisStyles> = {\n opacityChangeOnHover: 'fui-hbcwa__opacityChangeOnHover',\n xAxisTicks: 'fui-hbcwa__xAxisTicks',\n tooltip: 'fui-hbcwa__tooltip',\n chartLabel: '',\n xAxisDomain: '',\n xAxisText: '',\n yAxisDomain: '',\n yAxisTicks: '',\n yAxisText: '',\n root: '',\n xAxis: '',\n yAxis: '',\n legendContainer: '',\n hover: '',\n descriptionMessage: '',\n axisTitle: '',\n chartTitle: '',\n shapeStyles: '',\n chartWrapper: '',\n svgTooltip: '',\n chart: '',\n};\n\nconst useStyles = makeStyles({\n opacityChangeOnHover: {\n opacity: 0.1, // supports custom opacity\n },\n\n xAxisTicks: {},\n});\n\n/**\n * Apply styling to the HorizontalBarChartWithAxis slots based on the state\n */\nexport const useHorizontalBarChartWithAxisStyles = (\n props: HorizontalBarChartWithAxisProps,\n): HorizontalBarChartWithAxisStyles => {\n const baseStyles = useStyles();\n\n return {\n opacityChangeOnHover: mergeClasses(hbcWithAxisClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover),\n xAxisTicks: mergeClasses(hbcWithAxisClassNames.xAxisTicks, baseStyles.xAxisTicks),\n };\n};\n"],"names":["makeStyles","mergeClasses","hbcWithAxisClassNames","opacityChangeOnHover","xAxisTicks","tooltip","chartLabel","xAxisDomain","xAxisText","yAxisDomain","yAxisTicks","yAxisText","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","shapeStyles","chartWrapper","svgTooltip","chart","useStyles","opacity","useHorizontalBarChartWithAxisStyles","props","baseStyles"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAI1D,OAAO,MAAMC,wBAA0E;IACrFC,sBAAsB;IACtBC,YAAY;IACZC,SAAS;IACTC,YAAY;IACZC,aAAa;IACbC,WAAW;IACXC,aAAa;IACbC,YAAY;IACZC,WAAW;IACXC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,iBAAiB;IACjBC,OAAO;IACPC,oBAAoB;IACpBC,WAAW;IACXC,YAAY;IACZC,aAAa;IACbC,cAAc;IACdC,YAAY;IACZC,OAAO;AACT,EAAE;AAEF,MAAMC,YAAYxB,WAAW;IAC3BG,sBAAsB;QACpBsB,SAAS;IACX;IAEArB,YAAY,CAAC;AACf;AAEA;;CAEC,GACD,OAAO,MAAMsB,sCAAsC,CACjDC;IAEA,MAAMC,aAAaJ;IAEnB,OAAO;QACLrB,sBAAsBF,aAAaC,sBAAsBC,oBAAoB,EAAEyB,WAAWzB,oBAAoB;QAC9GC,YAAYH,aAAaC,sBAAsBE,UAAU,EAAEwB,WAAWxB,UAAU;IAClF;AACF,EAAE"}
@@ -6,8 +6,11 @@ import { Overflow, OverflowItem } from '@fluentui/react-overflow';
6
6
  import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';
7
7
  import { OverflowMenu } from './OverflowMenu';
8
8
  import { tokens } from '@fluentui/react-theme';
9
+ import { cloneLegendsToSVG } from '../../utilities/image-export-utils';
10
+ import { mergeClasses } from '@griffel/react';
9
11
  export const Legends = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
10
12
  /** Boolean variable to check if one or more legends are selected */ let _isLegendSelected = false;
13
+ let _rootElem = React.useRef(null);
11
14
  // set states separately for each instance of the component
12
15
  const [activeLegend, setActiveLegend] = React.useState('');
13
16
  const [selectedLegends, setSelectedLegends] = React.useState({});
@@ -16,6 +19,23 @@ export const Legends = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
16
19
  axis: 'horizontal',
17
20
  memorizeCurrent: true
18
21
  });
22
+ const classes = useLegendStyles(props);
23
+ const toSVG = React.useCallback((svgWidth, isRTL = false)=>{
24
+ return cloneLegendsToSVG(props.legends, svgWidth, {
25
+ selectedLegends,
26
+ centerLegends: !!props.centerLegends,
27
+ textClassName: classes.text,
28
+ isRTL
29
+ }, _rootElem.current);
30
+ }, [
31
+ props.legends,
32
+ props.centerLegends,
33
+ selectedLegends,
34
+ classes.text
35
+ ]);
36
+ React.useImperativeHandle(props.legendRef, ()=>({
37
+ toSVG
38
+ }));
19
39
  React.useEffect(()=>{
20
40
  var _props_selectedLegends;
21
41
  const initialSelectedLegends = (_props_selectedLegends = props.selectedLegends) !== null && _props_selectedLegends !== void 0 ? _props_selectedLegends : props.defaultSelectedLegends;
@@ -46,7 +66,6 @@ export const Legends = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
46
66
  _isLegendSelected = Object.keys(selectedLegends).length > 0;
47
67
  const dataToRender = _generateData();
48
68
  const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;
49
- const classes = useLegendStyles(props);
50
69
  const itemIds = dataToRender.map((_item, index)=>index.toString());
51
70
  const overflowHoverCardLegends = [];
52
71
  props.legends.map((legend, index)=>{
@@ -64,7 +83,8 @@ export const Legends = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
64
83
  'aria-label': 'Legends',
65
84
  'aria-multiselectable': canSelectMultipleLegends
66
85
  },
67
- className: classes.root
86
+ className: classes.root,
87
+ ref: (el)=>_rootElem.current = el
68
88
  }, /*#__PURE__*/ React.createElement(Overflow, null, /*#__PURE__*/ React.createElement("div", {
69
89
  className: classes.resizableArea,
70
90
  style: {
@@ -101,13 +121,10 @@ export const Legends = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
101
121
  flexWrap: 'wrap',
102
122
  overflow: 'auto'
103
123
  }
104
- }, dataToRender.map((item, id)=>/*#__PURE__*/ React.createElement("div", {
105
- key: id,
106
- style: {
107
- flex: '0 1 auto',
108
- margin: '4px'
109
- }
110
- }, _renderButton(item)))));
124
+ }, dataToRender.map((item)=>/*#__PURE__*/ React.createElement("div", {
125
+ className: mergeClasses(classes.legendContainer, item.legendAnnotation && classes.annotation),
126
+ key: item.key
127
+ }, _renderButton(item), item.legendAnnotation && /*#__PURE__*/ React.createElement("div", null, item.legendAnnotation())))));
111
128
  }
112
129
  function _generateData() {
113
130
  const { shape } = props;
@@ -133,7 +150,8 @@ export const Legends = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
133
150
  stripePattern: legend.stripePattern,
134
151
  isLineLegendInBarChart: legend.isLineLegendInBarChart,
135
152
  opacity: legend.opacity,
136
- key: index
153
+ key: index,
154
+ legendAnnotation: legend.legendAnnotation
137
155
  };
138
156
  });
139
157
  return dataItems;
@@ -1 +1 @@
1
- {"version":3,"sources":["Legends.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button } from '@fluentui/react-button';\nimport { Legend, LegendsProps, LegendShape } from './Legends.types';\nimport { Shape } from './shape';\nimport { useLegendStyles } from './useLegendsStyles.styles';\nimport { Overflow, OverflowItem } from '@fluentui/react-overflow';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { OverflowMenu } from './OverflowMenu';\nimport { tokens } from '@fluentui/react-theme';\n\n// This is an internal interface used for rendering the legends with unique key\ninterface LegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\ninterface LegendMap {\n [key: string]: boolean;\n}\n\nexport interface LegendState {\n activeLegend: string;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: LegendMap;\n}\nexport const Legends: React.FunctionComponent<LegendsProps> = React.forwardRef<HTMLDivElement, LegendsProps>(\n (props, forwardedRef) => {\n /** Boolean variable to check if one or more legends are selected */\n let _isLegendSelected = false;\n\n // set states separately for each instance of the component\n const [activeLegend, setActiveLegend] = React.useState('');\n const [selectedLegends, setSelectedLegends] = React.useState<LegendMap>({});\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true });\n\n React.useEffect(() => {\n const initialSelectedLegends = props.selectedLegends ?? props.defaultSelectedLegends;\n const initialSelectedLegend = props.selectedLegend ?? props.defaultSelectedLegend;\n let selectedLegendsState = {};\n if (props.canSelectMultipleLegends) {\n selectedLegendsState =\n (initialSelectedLegends ?? [])?.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (combineDict: any, key: any) => ({ [key]: true, ...combineDict }),\n {},\n ) || {};\n setSelectedLegends(selectedLegendsState);\n } else if (initialSelectedLegend !== undefined) {\n selectedLegendsState = { [initialSelectedLegend]: true };\n setSelectedLegends(selectedLegendsState);\n }\n }, [\n props.canSelectMultipleLegends,\n props.defaultSelectedLegend,\n props.defaultSelectedLegends,\n props.selectedLegend,\n props.selectedLegends,\n ]);\n\n _isLegendSelected = Object.keys(selectedLegends).length > 0;\n const dataToRender = _generateData();\n const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;\n const classes = useLegendStyles(props);\n const itemIds = dataToRender.map((_item, index) => index.toString());\n const overflowHoverCardLegends: JSX.Element[] = [];\n props.legends.map((legend, index) => {\n const hoverCardElement = _renderButton(legend, index);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const overflowString = props.overflowText ? props.overflowText : 'more';\n return props.enabledWrapLines ? renderWrappedLegends() : renderLegends();\n\n function renderLegends(): JSX.Element {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n className={classes.root}\n >\n <Overflow>\n <div className={classes.resizableArea} style={{ textAlign: props.centerLegends ? 'center' : 'unset' }}>\n {dataToRender.map((item, id) => (\n <OverflowItem key={id} id={id.toString()}>\n {_renderButton(item)}\n </OverflowItem>\n ))}\n <OverflowMenu itemIds={itemIds} title={`${overflowString}`} items={overflowHoverCardLegends} />\n </div>\n </Overflow>\n </div>\n );\n }\n\n function renderWrappedLegends(): JSX.Element {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ justifyContent: props.centerLegends ? 'center' : 'unset', flexWrap: 'wrap', ...overflowStyles }}\n className={classes.root}\n >\n <div className={classes.resizableArea} style={{ display: 'flex', flexWrap: 'wrap', overflow: 'auto' }}>\n {dataToRender.map((item, id) => (\n <div key={id} style={{ flex: '0 1 auto', margin: '4px' }}>\n {_renderButton(item)}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n function _generateData(): LegendItem[] {\n const { /*allowFocusOnLegends = true,*/ shape } = props;\n const dataItems: LegendItem[] = props.legends.map((legend: Legend, index: number) => {\n return {\n /* ...(allowFocusOnLegends && {\n nativeButtonProps: getIntrinsicElementProps(\n 'div',\n {\n legend,\n ...buttonProperties,\n },\n ['title'],\n ),\n 'aria-setsize': props.legends.length,\n 'aria-posinset': index + 1,\n }), */\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n };\n });\n return dataItems;\n }\n\n /**\n * Determine whether the component is in \"controlled\" mode for selections, where the selected legend(s) are\n * determined entirely by props passed in from the parent component.\n */\n function _isInControlledMode(): boolean {\n return props.canSelectMultipleLegends ? props.selectedLegends !== undefined : props.selectedLegend !== undefined;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when multi-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend(s) state data.\n */\n function _getNewSelectedLegendsForMultiselect(legend: Legend): { [key: string]: boolean } {\n let legendsSelected = { ...selectedLegends };\n if (legendsSelected[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete legendsSelected[legend.title];\n } else {\n legendsSelected[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(legendsSelected).length === props.legends.length) {\n legendsSelected = {};\n }\n }\n return legendsSelected;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when single-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend state data.\n */\n function _getNewSelectedLegendsForSingleSelect(legend: Legend): { [key: string]: boolean } {\n return selectedLegends[legend.title] ? {} : { [legend.title]: true };\n }\n\n function _onClick(legend: Legend, event: React.MouseEvent<HTMLButtonElement>): void {\n const { canSelectMultipleLegends = false } = props;\n const nextSelectedLegends = canSelectMultipleLegends\n ? _getNewSelectedLegendsForMultiselect(legend)\n : _getNewSelectedLegendsForSingleSelect(legend);\n\n if (!_isInControlledMode()) {\n setSelectedLegends(nextSelectedLegends);\n }\n props.onChange?.(Object.keys(nextSelectedLegends), event, legend);\n legend.action?.();\n }\n\n function _onHoverOverLegend(legend: Legend) {\n if (legend.hoverAction) {\n setActiveLegend(legend.title);\n legend.hoverAction();\n }\n }\n\n function _onLeave(legend: Legend) {\n if (legend.onMouseOutAction) {\n setActiveLegend('');\n legend.onMouseOutAction();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _renderButton(data: any, index?: number) {\n const { allowFocusOnLegends = true } = props;\n const legend: Legend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = _getColor(legend.title, legend.color);\n const onClickHandler = (event: React.MouseEvent<HTMLButtonElement>) => {\n _onClick(legend, event);\n };\n const onHoverHandler = () => {\n _onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n _onLeave(legend);\n };\n const shape = _getShape(legend, color);\n return (\n <Button\n {...(allowFocusOnLegends && {\n 'aria-selected': !!selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classes.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n appearance={'outline'}\n size=\"small\"\n style={{\n '--rect-height': legend.isLineLegendInBarChart ? '4px' : '12px',\n '--rect-backgroundColor': legend.stripePattern ? '' : color,\n '--rect-borderColor': legend.color ? legend.color : tokens.colorNeutralStroke1,\n '--rect-content': legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n }} /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classes.text} style={{ opacity: color === tokens.colorNeutralBackground1 ? '0.67' : '' }}>\n {legend.title}\n </div>\n </Button>\n );\n }\n\n function _getShape(legend: Legend, color: string): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classes.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classes.rect}\n style={\n {\n height: legend.isLineLegendInBarChart ? '4px' : '12px',\n backgroundColor: legend.stripePattern ? '' : color,\n borderColor: legend.color ? legend.color : tokens.colorNeutralStroke1,\n content: legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n '--rect-content-high-contrast': `linear-gradient(to right, ${color}, ${color})`,\n '--rect-opacity-high-contrast': color === tokens.colorNeutralBackground1 ? '0.6' : '',\n } as React.CSSProperties\n }\n />\n );\n }\n\n function _getColor(title: string, color: string): string {\n let legendColor = color;\n // if one or more legends are selected\n if (_isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (activeLegend === title || activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n return legendColor;\n }\n },\n);\nLegends.displayName = 'Legends';\n"],"names":["React","Button","Shape","useLegendStyles","Overflow","OverflowItem","useFocusableGroup","useArrowNavigationGroup","OverflowMenu","tokens","Legends","forwardRef","props","forwardedRef","_isLegendSelected","activeLegend","setActiveLegend","useState","selectedLegends","setSelectedLegends","focusAttributes","arrowAttributes","axis","memorizeCurrent","useEffect","initialSelectedLegends","defaultSelectedLegends","initialSelectedLegend","selectedLegend","defaultSelectedLegend","selectedLegendsState","canSelectMultipleLegends","reduce","combineDict","key","undefined","Object","keys","length","dataToRender","_generateData","overflowStyles","allowFocusOnLegends","classes","itemIds","map","_item","index","toString","overflowHoverCardLegends","legends","legend","hoverCardElement","_renderButton","push","overflowString","overflowText","enabledWrapLines","renderWrappedLegends","renderLegends","div","role","className","root","resizableArea","style","textAlign","centerLegends","item","id","title","items","justifyContent","flexWrap","display","overflow","flex","margin","shape","dataItems","action","hoverAction","onMouseOutAction","color","stripePattern","isLineLegendInBarChart","opacity","_isInControlledMode","_getNewSelectedLegendsForMultiselect","legendsSelected","_getNewSelectedLegendsForSingleSelect","_onClick","event","nextSelectedLegends","onChange","_onHoverOverLegend","_onLeave","data","_getColor","onClickHandler","onHoverHandler","onMouseOut","_getShape","nativeButtonProps","onClick","onMouseOver","onFocus","onBlur","appearance","size","colorNeutralStroke1","text","colorNeutralBackground1","svgParentProps","svgChildProps","fill","strokeWidth","stroke","svgProps","pathProps","classNameForNonSvg","rect","height","backgroundColor","borderColor","content","legendColor","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;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2C,cAAcrH,OAAOuG,uBAAuB;YAC9C;QACF,OAEK;YACH,iCAAiC;YACjC,oCAAoC;YACpC,IAAIjG,iBAAiBuD,SAASvD,iBAAiB,IAAI;gBACjD+G,cAAc3C;YAChB,OAEK;gBACH2C,cAAcrH,OAAOuG,uBAAuB;YAC9C;QACF;QACA,OAAOc;IACT;AACF,GACA;AACFpH,QAAQqH,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/Legends/Legends.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button } from '@fluentui/react-button';\nimport { Legend, LegendsProps, LegendShape } from './Legends.types';\nimport { Shape } from './shape';\nimport { useLegendStyles } from './useLegendsStyles.styles';\nimport { Overflow, OverflowItem } from '@fluentui/react-overflow';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { OverflowMenu } from './OverflowMenu';\nimport { tokens } from '@fluentui/react-theme';\nimport { cloneLegendsToSVG } from '../../utilities/image-export-utils';\nimport { mergeClasses } from '@griffel/react';\n\n// This is an internal interface used for rendering the legends with unique key\ninterface LegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n legendAnnotation?: () => React.ReactNode;\n}\n\ninterface LegendMap {\n [key: string]: boolean;\n}\n\nexport interface LegendState {\n activeLegend: string;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: LegendMap;\n}\nexport const Legends: React.FunctionComponent<LegendsProps> = React.forwardRef<HTMLDivElement, LegendsProps>(\n (props, forwardedRef) => {\n /** Boolean variable to check if one or more legends are selected */\n let _isLegendSelected = false;\n let _rootElem = React.useRef<HTMLDivElement | null>(null);\n\n // set states separately for each instance of the component\n const [activeLegend, setActiveLegend] = React.useState('');\n const [selectedLegends, setSelectedLegends] = React.useState<LegendMap>({});\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true });\n const classes = useLegendStyles(props);\n const toSVG = React.useCallback(\n (svgWidth: number, isRTL: boolean = false) => {\n return cloneLegendsToSVG(\n props.legends,\n svgWidth,\n {\n selectedLegends,\n centerLegends: !!props.centerLegends,\n textClassName: classes.text!,\n isRTL,\n },\n _rootElem.current,\n );\n },\n [props.legends, props.centerLegends, selectedLegends, classes.text],\n );\n\n React.useImperativeHandle(props.legendRef, () => ({\n toSVG,\n }));\n\n React.useEffect(() => {\n const initialSelectedLegends = props.selectedLegends ?? props.defaultSelectedLegends;\n const initialSelectedLegend = props.selectedLegend ?? props.defaultSelectedLegend;\n let selectedLegendsState = {};\n if (props.canSelectMultipleLegends) {\n selectedLegendsState =\n (initialSelectedLegends ?? [])?.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (combineDict: any, key: any) => ({ [key]: true, ...combineDict }),\n {},\n ) || {};\n setSelectedLegends(selectedLegendsState);\n } else if (initialSelectedLegend !== undefined) {\n selectedLegendsState = { [initialSelectedLegend]: true };\n setSelectedLegends(selectedLegendsState);\n }\n }, [\n props.canSelectMultipleLegends,\n props.defaultSelectedLegend,\n props.defaultSelectedLegends,\n props.selectedLegend,\n props.selectedLegends,\n ]);\n\n _isLegendSelected = Object.keys(selectedLegends).length > 0;\n const dataToRender = _generateData();\n const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;\n const itemIds = dataToRender.map((_item, index) => index.toString());\n const overflowHoverCardLegends: JSX.Element[] = [];\n props.legends.map((legend, index) => {\n const hoverCardElement = _renderButton(legend, index);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const overflowString = props.overflowText ? props.overflowText : 'more';\n return props.enabledWrapLines ? renderWrappedLegends() : renderLegends();\n\n function renderLegends(): JSX.Element {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n className={classes.root}\n ref={el => (_rootElem.current = el)}\n >\n <Overflow>\n <div className={classes.resizableArea} style={{ textAlign: props.centerLegends ? 'center' : 'unset' }}>\n {dataToRender.map((item, id) => (\n <OverflowItem key={id} id={id.toString()}>\n {_renderButton(item)}\n </OverflowItem>\n ))}\n <OverflowMenu itemIds={itemIds} title={`${overflowString}`} items={overflowHoverCardLegends} />\n </div>\n </Overflow>\n </div>\n );\n }\n\n function renderWrappedLegends(): JSX.Element {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ justifyContent: props.centerLegends ? 'center' : 'unset', flexWrap: 'wrap', ...overflowStyles }}\n className={classes.root}\n >\n <div className={classes.resizableArea} style={{ display: 'flex', flexWrap: 'wrap', overflow: 'auto' }}>\n {dataToRender.map(item => (\n <div\n className={mergeClasses(classes.legendContainer, item.legendAnnotation && classes.annotation)}\n key={item.key}\n >\n {_renderButton(item)}\n {item.legendAnnotation && <div>{item.legendAnnotation()}</div>}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n function _generateData(): LegendItem[] {\n const { /*allowFocusOnLegends = true,*/ shape } = props;\n const dataItems: LegendItem[] = props.legends.map((legend: Legend, index: number) => {\n return {\n /* ...(allowFocusOnLegends && {\n nativeButtonProps: getIntrinsicElementProps(\n 'div',\n {\n legend,\n ...buttonProperties,\n },\n ['title'],\n ),\n 'aria-setsize': props.legends.length,\n 'aria-posinset': index + 1,\n }), */\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n legendAnnotation: legend.legendAnnotation,\n };\n });\n return dataItems;\n }\n\n /**\n * Determine whether the component is in \"controlled\" mode for selections, where the selected legend(s) are\n * determined entirely by props passed in from the parent component.\n */\n function _isInControlledMode(): boolean {\n return props.canSelectMultipleLegends ? props.selectedLegends !== undefined : props.selectedLegend !== undefined;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when multi-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend(s) state data.\n */\n function _getNewSelectedLegendsForMultiselect(legend: Legend): { [key: string]: boolean } {\n let legendsSelected = { ...selectedLegends };\n if (legendsSelected[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete legendsSelected[legend.title];\n } else {\n legendsSelected[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(legendsSelected).length === props.legends.length) {\n legendsSelected = {};\n }\n }\n return legendsSelected;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when single-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend state data.\n */\n function _getNewSelectedLegendsForSingleSelect(legend: Legend): { [key: string]: boolean } {\n return selectedLegends[legend.title] ? {} : { [legend.title]: true };\n }\n\n function _onClick(legend: Legend, event: React.MouseEvent<HTMLButtonElement>): void {\n const { canSelectMultipleLegends = false } = props;\n const nextSelectedLegends = canSelectMultipleLegends\n ? _getNewSelectedLegendsForMultiselect(legend)\n : _getNewSelectedLegendsForSingleSelect(legend);\n\n if (!_isInControlledMode()) {\n setSelectedLegends(nextSelectedLegends);\n }\n props.onChange?.(Object.keys(nextSelectedLegends), event, legend);\n legend.action?.();\n }\n\n function _onHoverOverLegend(legend: Legend) {\n if (legend.hoverAction) {\n setActiveLegend(legend.title);\n legend.hoverAction();\n }\n }\n\n function _onLeave(legend: Legend) {\n if (legend.onMouseOutAction) {\n setActiveLegend('');\n legend.onMouseOutAction();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _renderButton(data: any, index?: number) {\n const { allowFocusOnLegends = true } = props;\n const legend: Legend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = _getColor(legend.title, legend.color);\n const onClickHandler = (event: React.MouseEvent<HTMLButtonElement>) => {\n _onClick(legend, event);\n };\n const onHoverHandler = () => {\n _onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n _onLeave(legend);\n };\n const shape = _getShape(legend, color);\n return (\n <Button\n {...(allowFocusOnLegends && {\n 'aria-selected': !!selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classes.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n appearance={'outline'}\n size=\"small\"\n style={{\n '--rect-height': legend.isLineLegendInBarChart ? '4px' : '12px',\n '--rect-backgroundColor': legend.stripePattern ? '' : color,\n '--rect-borderColor': legend.color ? legend.color : tokens.colorNeutralStroke1,\n '--rect-content': legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n }} /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classes.text} style={{ opacity: color === tokens.colorNeutralBackground1 ? '0.67' : '' }}>\n {legend.title}\n </div>\n </Button>\n );\n }\n\n function _getShape(legend: Legend, color: string): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classes.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classes.rect}\n style={\n {\n height: legend.isLineLegendInBarChart ? '4px' : '12px',\n backgroundColor: legend.stripePattern ? '' : color,\n borderColor: legend.color ? legend.color : tokens.colorNeutralStroke1,\n content: legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n '--rect-content-high-contrast': `linear-gradient(to right, ${color}, ${color})`,\n '--rect-opacity-high-contrast': color === tokens.colorNeutralBackground1 ? '0.6' : '',\n } as React.CSSProperties\n }\n />\n );\n }\n\n function _getColor(title: string, color: string): string {\n let legendColor = color;\n // if one or more legends are selected\n if (_isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (activeLegend === title || activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n return legendColor;\n }\n },\n);\nLegends.displayName = 'Legends';\n"],"names":["React","Button","Shape","useLegendStyles","Overflow","OverflowItem","useFocusableGroup","useArrowNavigationGroup","OverflowMenu","tokens","cloneLegendsToSVG","mergeClasses","Legends","forwardRef","props","forwardedRef","_isLegendSelected","_rootElem","useRef","activeLegend","setActiveLegend","useState","selectedLegends","setSelectedLegends","focusAttributes","arrowAttributes","axis","memorizeCurrent","classes","toSVG","useCallback","svgWidth","isRTL","legends","centerLegends","textClassName","text","current","useImperativeHandle","legendRef","useEffect","initialSelectedLegends","defaultSelectedLegends","initialSelectedLegend","selectedLegend","defaultSelectedLegend","selectedLegendsState","canSelectMultipleLegends","reduce","combineDict","key","undefined","Object","keys","length","dataToRender","_generateData","overflowStyles","allowFocusOnLegends","itemIds","map","_item","index","toString","overflowHoverCardLegends","legend","hoverCardElement","_renderButton","push","overflowString","overflowText","enabledWrapLines","renderWrappedLegends","renderLegends","div","role","className","root","ref","el","resizableArea","style","textAlign","item","id","title","items","justifyContent","flexWrap","display","overflow","legendContainer","legendAnnotation","annotation","shape","dataItems","action","hoverAction","onMouseOutAction","color","stripePattern","isLineLegendInBarChart","opacity","_isInControlledMode","_getNewSelectedLegendsForMultiselect","legendsSelected","_getNewSelectedLegendsForSingleSelect","_onClick","event","nextSelectedLegends","onChange","_onHoverOverLegend","_onLeave","data","_getColor","onClickHandler","onHoverHandler","onMouseOut","_getShape","nativeButtonProps","onClick","onMouseOver","onFocus","onBlur","appearance","size","colorNeutralStroke1","colorNeutralBackground1","svgParentProps","svgChildProps","fill","strokeWidth","stroke","svgProps","pathProps","classNameForNonSvg","rect","height","backgroundColor","borderColor","content","legendColor","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,MAAM,QAAQ,yBAAyB;AAEhD,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,QAAQ,EAAEC,YAAY,QAAQ,2BAA2B;AAClE,SAASC,iBAAiB,EAAEC,uBAAuB,QAAQ,0BAA0B;AACrF,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,iBAAiB,QAAQ,qCAAqC;AACvE,SAASC,YAAY,QAAQ,iBAAiB;AA2B9C,OAAO,MAAMC,wBAAiDZ,MAAMa,UAAU,CAC5E,CAACC,OAAOC;IACN,kEAAkE,GAClE,IAAIC,oBAAoB;IACxB,IAAIC,YAAYjB,MAAMkB,MAAM,CAAwB;IAEpD,2DAA2D;IAC3D,MAAM,CAACC,cAAcC,gBAAgB,GAAGpB,MAAMqB,QAAQ,CAAC;IACvD,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGvB,MAAMqB,QAAQ,CAAY,CAAC;IACzE,MAAMG,kBAAkBlB;IACxB,MAA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D;YAC7D,IAAIM,eAAe,CAAC+D,MAAM,EAAE;gBAC1BwD,cAAc1C;YAChB,OAEK;gBACH0C,cAAcpI,OAAOsH,uBAAuB;YAC9C;QACF,OAEK;YACH,iCAAiC;YACjC,oCAAoC;YACpC,IAAI5G,iBAAiBkE,SAASlE,iBAAiB,IAAI;gBACjD0H,cAAc1C;YAChB,OAEK;gBACH0C,cAAcpI,OAAOsH,uBAAuB;YAC9C;QACF;QACA,OAAOc;IACT;AACF,GACA;AACFjI,QAAQkI,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Legends.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\n/**\n * @public\n * Legends styles\n * {@docCategory Legends}\n */\nexport interface LegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root?: string;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend?: string;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect?: string;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape?: string;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle?: string;\n\n /**\n * Style for the legend text\n */\n text?: string;\n\n /**\n * Style for the legend text\n */\n hoverChange?: string;\n\n /**\n * Style for the area that is resizable\n */\n resizableArea?: string;\n}\n\n/**\n * @public\n * ILegend interface\n * {@docCategory Legends}\n */\nexport interface Legend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\n/**\n * @public\n * Legend style properties\n * {@docCategory Legends}\n */\nexport interface LegendStyleProps {\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * @public\n * Legend properties\n * {@docCategory Legends}\n */\nexport interface LegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: Legend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LegendsStyles;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * style for the overflow component\n */\n overflowStyles?: React.CSSProperties;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: Legend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items. This prop is used for multi-select scenarios when\n * canSelectMultipleLegends is true; for single-select, use defaultSelectedLegend.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegends instead.\n *\n * @see selectedLegends for setting the selected legends in controlled mode.\n * @see defaultSelectedLegend for setting the initially selected legend when canSelectMultipleLegends is false.\n */\n defaultSelectedLegends?: string[];\n\n /**\n * Key that will be initially used to set selected item. This prop is used for single-select scenarios when\n * canSelectMultipleLegends is false or unspecified; for multi-select, use defaultSelectedLegends.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegend instead.\n *\n * @see selectedLegend for setting the selected legend in controlled mode.\n * @see defaultSelectedLegends for setting the initially selected legends when canSelectMultipleLegends is true.\n */\n defaultSelectedLegend?: string;\n\n /**\n * Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is\n * true. For single-select, use selectedLegend.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.\n * @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.\n */\n selectedLegends?: string[];\n\n /**\n * Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is\n * false or unspecified. For multi-select, use selectedLegends.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.\n * @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.\n */\n selectedLegend?: string;\n\n /**\n * The shape for the legend.\n */\n shape?: LegendShape;\n}\n\n/**\n * @public\n * The shape for the legend\n * default: show the rect legend\n * triangle: show the triangle legend\n * {@docCategory Legends}\n */\nexport type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/components/Legends/Legends.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\n/**\n * @public\n * Legends styles\n * {@docCategory Legends}\n */\nexport interface LegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root?: string;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend?: string;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect?: string;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape?: string;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle?: string;\n\n /**\n * Style for the legend text\n */\n text?: string;\n\n /**\n * Style for the legend text\n */\n hoverChange?: string;\n\n /**\n * Style for the area that is resizable\n */\n resizableArea?: string;\n\n /*\n * Style for the container that holds the legend and any optional JSX annotation from client is used\n */\n legendContainer?: string;\n\n /**\n * Style for the annotation that is used in the legend\n */\n annotation?: string;\n}\n\n/**\n * @public\n * ILegend interface\n * {@docCategory Legends}\n */\nexport interface Legend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n\n /**\n * The annotation for the legend, function returning a React node\n */\n legendAnnotation?: () => React.ReactNode;\n}\n\n/**\n * @public\n * Legend style properties\n * {@docCategory Legends}\n */\nexport interface LegendStyleProps {\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * @public\n * Legend properties\n * {@docCategory Legends}\n */\nexport interface LegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: Legend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LegendsStyles;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * style for the overflow component\n */\n overflowStyles?: React.CSSProperties;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: Legend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items. This prop is used for multi-select scenarios when\n * canSelectMultipleLegends is true; for single-select, use defaultSelectedLegend.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegends instead.\n *\n * @see selectedLegends for setting the selected legends in controlled mode.\n * @see defaultSelectedLegend for setting the initially selected legend when canSelectMultipleLegends is false.\n */\n defaultSelectedLegends?: string[];\n\n /**\n * Key that will be initially used to set selected item. This prop is used for single-select scenarios when\n * canSelectMultipleLegends is false or unspecified; for multi-select, use defaultSelectedLegends.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegend instead.\n *\n * @see selectedLegend for setting the selected legend in controlled mode.\n * @see defaultSelectedLegends for setting the initially selected legends when canSelectMultipleLegends is true.\n */\n defaultSelectedLegend?: string;\n\n /**\n * Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is\n * true. For single-select, use selectedLegend.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.\n * @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.\n */\n selectedLegends?: string[];\n\n /**\n * Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is\n * false or unspecified. For multi-select, use selectedLegends.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.\n * @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.\n */\n selectedLegend?: string;\n\n /**\n * The shape for the legend.\n */\n shape?: LegendShape;\n\n /**\n * Callback to access the public methods and properties of the component.\n */\n legendRef?: React.RefObject<LegendContainer>;\n}\n\n/**\n * @public\n * The shape for the legend\n * default: show the rect legend\n * triangle: show the triangle legend\n * {@docCategory Legends}\n */\nexport type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;\n\n/**\n * {@docCategory Legends}\n */\nexport interface LegendContainer {\n toSVG: (\n svgWidth: number,\n isRTL?: boolean,\n ) => {\n node: SVGGElement | null;\n width: number;\n height: number;\n };\n}\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["OverflowMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Menu, MenuTrigger, MenuPopover, MenuList, MenuItem } from '@fluentui/react-menu';\nimport { MenuButton } from '@fluentui/react-button';\nimport { useOverflowMenu } from '@fluentui/react-overflow';\n\nexport const OverflowMenu: React.FC<{ itemIds: string[]; title: string; items: JSX.Element[] }> = ({\n itemIds,\n title,\n items,\n}) => {\n const { ref, overflowCount, isOverflowing } = useOverflowMenu<HTMLButtonElement>();\n let displayLabel = title;\n displayLabel = title === '' ? `+${overflowCount} items` : `+${overflowCount} ${title}`;\n\n if (!isOverflowing) {\n return null;\n }\n const remainingItemsCount = itemIds.length - overflowCount;\n const menuList = [];\n for (let i = remainingItemsCount; i < itemIds.length; i++) {\n menuList.push(\n <MenuItem tabIndex={-1} key={i}>\n {items[i]}\n </MenuItem>,\n );\n }\n return (\n <Menu>\n <MenuTrigger disableButtonEnhancement>\n <MenuButton ref={ref}>{displayLabel}</MenuButton>\n </MenuTrigger>\n\n <MenuPopover>\n <MenuList>{menuList}</MenuList>\n </MenuPopover>\n </Menu>\n );\n};\n"],"names":["React","Menu","MenuTrigger","MenuPopover","MenuList","MenuItem","MenuButton","useOverflowMenu","OverflowMenu","itemIds","title","items","ref","overflowCount","isOverflowing","displayLabel","remainingItemsCount","length","menuList","i","push","tabIndex","key","disableButtonEnhancement"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,EAAEC,WAAW,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,uBAAuB;AAC1F,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,OAAO,MAAMC,eAAqF,CAAC,EACjGC,OAAO,EACPC,KAAK,EACLC,KAAK,EACN;IACC,MAAM,EAAEC,GAAG,EAAEC,aAAa,EAAEC,aAAa,EAAE,GAAGP;IAC9C,IAAIQ,eAAeL;IACnBK,eAAeL,UAAU,KAAK,CAAC,CAAC,EAAEG,cAAc,MAAM,CAAC,GAAG,CAAC,CAAC,EAAEA,cAAc,CAAC,EAAEH,OAAO;IAEtF,IAAI,CAACI,eAAe;QAClB,OAAO;IACT;IACA,MAAME,sBAAsBP,QAAQQ,MAAM,GAAGJ;IAC7C,MAAMK,WAAW,EAAE;IACnB,IAAK,IAAIC,IAAIH,qBAAqBG,IAAIV,QAAQQ,MAAM,EAAEE,IAAK;QACzDD,SAASE,IAAI,eACX,oBAACf;YAASgB,UAAU,CAAC;YAAGC,KAAKH;WAC1BR,KAAK,CAACQ,EAAE;IAGf;IACA,qBACE,oBAAClB,0BACC,oBAACC;QAAYqB,0BAAAA;qBACX,oBAACjB;QAAWM,KAAKA;OAAMG,8BAGzB,oBAACZ,iCACC,oBAACC,gBAAUc;AAInB,EAAE"}
1
+ {"version":3,"sources":["../src/components/Legends/OverflowMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Menu, MenuTrigger, MenuPopover, MenuList, MenuItem } from '@fluentui/react-menu';\nimport { MenuButton } from '@fluentui/react-button';\nimport { useOverflowMenu } from '@fluentui/react-overflow';\n\nexport const OverflowMenu: React.FC<{\n itemIds: string[];\n title: string;\n items: // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element[];\n}> = ({ itemIds, title, items }) => {\n const { ref, overflowCount, isOverflowing } = useOverflowMenu<HTMLButtonElement>();\n let displayLabel = title;\n displayLabel = title === '' ? `+${overflowCount} items` : `+${overflowCount} ${title}`;\n\n if (!isOverflowing) {\n return null;\n }\n const remainingItemsCount = itemIds.length - overflowCount;\n const menuList = [];\n for (let i = remainingItemsCount; i < itemIds.length; i++) {\n menuList.push(\n <MenuItem tabIndex={-1} key={i}>\n {items[i]}\n </MenuItem>,\n );\n }\n return (\n <Menu>\n <MenuTrigger disableButtonEnhancement>\n <MenuButton ref={ref}>{displayLabel}</MenuButton>\n </MenuTrigger>\n\n <MenuPopover>\n <MenuList>{menuList}</MenuList>\n </MenuPopover>\n </Menu>\n );\n};\n"],"names":["React","Menu","MenuTrigger","MenuPopover","MenuList","MenuItem","MenuButton","useOverflowMenu","OverflowMenu","itemIds","title","items","ref","overflowCount","isOverflowing","displayLabel","remainingItemsCount","length","menuList","i","push","tabIndex","key","disableButtonEnhancement"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,EAAEC,WAAW,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,uBAAuB;AAC1F,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,OAAO,MAAMC,eAKR,CAAC,EAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,EAAE;IAC7B,MAAM,EAAEC,GAAG,EAAEC,aAAa,EAAEC,aAAa,EAAE,GAAGP;IAC9C,IAAIQ,eAAeL;IACnBK,eAAeL,UAAU,KAAK,CAAC,CAAC,EAAEG,cAAc,MAAM,CAAC,GAAG,CAAC,CAAC,EAAEA,cAAc,CAAC,EAAEH,OAAO;IAEtF,IAAI,CAACI,eAAe;QAClB,OAAO;IACT;IACA,MAAME,sBAAsBP,QAAQQ,MAAM,GAAGJ;IAC7C,MAAMK,WAAW,EAAE;IACnB,IAAK,IAAIC,IAAIH,qBAAqBG,IAAIV,QAAQQ,MAAM,EAAEE,IAAK;QACzDD,SAASE,IAAI,eACX,oBAACf;YAASgB,UAAU,CAAC;YAAGC,KAAKH;WAC1BR,KAAK,CAACQ,EAAE;IAGf;IACA,qBACE,oBAAClB,0BACC,oBAACC;QAAYqB,0BAAAA;qBACX,oBAACjB;QAAWM,KAAKA;OAAMG,8BAGzB,oBAACZ,iCACC,oBAACC,gBAAUc;AAInB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Legends';\nexport * from './Legends.types';\nexport * from './shape';\n"],"names":[],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,kBAAkB;AAChC,cAAc,UAAU"}
1
+ {"version":3,"sources":["../src/components/Legends/index.ts"],"sourcesContent":["export * from './Legends';\nexport * from './Legends.types';\nexport * from './shape';\n"],"names":[],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,kBAAkB;AAChC,cAAc,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"sources":["shape.tsx"],"sourcesContent":["import * as React from 'react';\nimport { LegendShape } from './Legends.types';\nimport { CustomPoints, Points, getSecureProps } from '../../utilities/utilities';\n\nexport interface ShapeProps {\n svgProps: React.SVGAttributes<SVGElement>;\n pathProps: React.SVGAttributes<SVGPathElement>;\n shape: LegendShape;\n classNameForNonSvg?: string;\n style?: React.CSSProperties | undefined;\n}\n\ntype PointPathType = {\n [key: string]: string;\n};\n\nconst pointPath: PointPathType = {\n [`${Points[Points.circle]}`]: 'M1 6 A5 5 0 1 0 12 6 M1 6 A5 5 0 0 1 12 6',\n [`${Points[Points.square]}`]: 'M1 1 L12 1 L12 12 L1 12 L1 1 Z',\n [`${Points[Points.triangle]}`]: 'M6 10L8.74228e-07 -1.04907e-06L12 0L6 10Z',\n [`${Points[Points.pyramid]}`]: 'M6 10L8.74228e-07 -1.04907e-06L12 0L6 10Z',\n [`${Points[Points.diamond]}`]: 'M2 2 L10 2 L10 10 L2 10 L2 2 Z',\n [`${Points[Points.hexagon]}`]: 'M9 0H3L0 5L3 10H9L12 5L9 0Z',\n [`${Points[Points.pentagon]}`]: 'M6.06061 0L0 4.21277L2.30303 11H9.69697L12 4.21277L6.06061 0Z',\n [`${Points[Points.octagon]}`]:\n 'M7.08333 0H2.91667L0 2.91667V7.08333L2.91667 10H7.08333L10 7.08333V2.91667L7.08333 0Z',\n [`${CustomPoints[CustomPoints.dottedLine]}`]: 'M0 6 H3 M5 6 H8 M10 6 H13',\n};\n\nexport const Shape: React.FunctionComponent<ShapeProps> = React.forwardRef<HTMLDivElement, ShapeProps>(\n ({ svgProps, pathProps, shape, classNameForNonSvg, style }, forwardedRef) => {\n if (Object.keys(pointPath).indexOf(shape) === -1) {\n return <div className={classNameForNonSvg} style={style} />;\n }\n return (\n <svg\n width={14}\n height={14}\n viewBox={'-1 -1 14 14'}\n {...getSecureProps(svgProps)}\n transform={`rotate(${\n shape === Points[Points.diamond] ? 45 : shape === Points[Points.pyramid] ? 180 : 0\n }, 0, 0)`}\n style={{\n width: '14px',\n height: '14px',\n }}\n >\n <path d={pointPath[shape]} {...getSecureProps(pathProps)} />\n </svg>\n );\n },\n);\n"],"names":["React","CustomPoints","Points","getSecureProps","pointPath","circle","square","triangle","pyramid","diamond","hexagon","pentagon","octagon","dottedLine","Shape","forwardRef","svgProps","pathProps","shape","classNameForNonSvg","style","forwardedRef","Object","keys","indexOf","div","className","svg","width","height","viewBox","transform","path","d"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AA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O;YACLQ,OAAO;YACPC,QAAQ;QACV;qBAEA,oBAACG;QAAKC,GAAG7B,SAAS,CAACc,MAAM;QAAG,GAAGf,eAAec,UAAU;;AAG9D,GACA"}
1
+ {"version":3,"sources":["../src/components/Legends/shape.tsx"],"sourcesContent":["import * as React from 'react';\nimport { LegendShape } from './Legends.types';\nimport { CustomPoints, Points, getSecureProps } from '../../utilities/utilities';\n\nexport interface ShapeProps {\n svgProps: React.SVGAttributes<SVGElement>;\n pathProps: React.SVGAttributes<SVGPathElement>;\n shape: LegendShape;\n classNameForNonSvg?: string;\n style?: React.CSSProperties | undefined;\n}\n\ntype PointPathType = {\n [key: string]: string;\n};\n\nconst pointPath: PointPathType = {\n [`${Points[Points.circle]}`]: 'M1 6 A5 5 0 1 0 12 6 M1 6 A5 5 0 0 1 12 6',\n [`${Points[Points.square]}`]: 'M1 1 L12 1 L12 12 L1 12 L1 1 Z',\n [`${Points[Points.triangle]}`]: 'M6 10L8.74228e-07 -1.04907e-06L12 0L6 10Z',\n [`${Points[Points.pyramid]}`]: 'M6 10L8.74228e-07 -1.04907e-06L12 0L6 10Z',\n [`${Points[Points.diamond]}`]: 'M2 2 L10 2 L10 10 L2 10 L2 2 Z',\n [`${Points[Points.hexagon]}`]: 'M9 0H3L0 5L3 10H9L12 5L9 0Z',\n [`${Points[Points.pentagon]}`]: 'M6.06061 0L0 4.21277L2.30303 11H9.69697L12 4.21277L6.06061 0Z',\n [`${Points[Points.octagon]}`]:\n 'M7.08333 0H2.91667L0 2.91667V7.08333L2.91667 10H7.08333L10 7.08333V2.91667L7.08333 0Z',\n [`${CustomPoints[CustomPoints.dottedLine]}`]: 'M0 6 H3 M5 6 H8 M10 6 H13',\n};\n\nexport const Shape: React.FunctionComponent<ShapeProps> = React.forwardRef<HTMLDivElement, ShapeProps>(\n ({ svgProps, pathProps, shape, classNameForNonSvg, style }, forwardedRef) => {\n if (Object.keys(pointPath).indexOf(shape) === -1) {\n return <div className={classNameForNonSvg} style={style} />;\n }\n return (\n <svg\n width={14}\n height={14}\n viewBox={'-1 -1 14 14'}\n {...getSecureProps(svgProps)}\n transform={`rotate(${\n shape === Points[Points.diamond] ? 45 : shape === Points[Points.pyramid] ? 180 : 0\n }, 0, 0)`}\n style={{\n width: '14px',\n height: '14px',\n }}\n >\n <path d={pointPath[shape]} {...getSecureProps(pathProps)} />\n </svg>\n );\n },\n);\n"],"names":["React","CustomPoints","Points","getSecureProps","pointPath","circle","square","triangle","pyramid","diamond","hexagon","pentagon","octagon","dottedLine","Shape","forwardRef","svgProps","pathProps","shape","classNameForNonSvg","style","forwardedRef","Object","keys","indexOf","div","className","svg","width","height","viewBox","transform","path","d"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,YAAY,EAAEC,MAAM,EAAEC,cAAc,QAAQ,4BAA4B;AAcjF,MAAMC,YAA2B;IAC/B,CAAC,GAAGF,MAAM,CAACA,OAAOG,MAAM,CAAC,EAAE,CAAC,EAAE;IAC9B,CAAC,GAAGH,MAAM,CAACA,OAAOI,MAAM,CAAC,EAAE,CAAC,EAAE;IAC9B,CAAC,GAAGJ,MAAM,CAACA,OAAOK,QAAQ,CAAC,EAAE,CAAC,EAAE;IAChC,CAAC,GAAGL,MAAM,CAACA,OAAOM,OAAO,CAAC,EAAE,CAAC,EAAE;IAC/B,CAAC,GAAGN,MAAM,CAACA,OAAOO,OAAO,CAAC,EAAE,CAAC,EAAE;IAC/B,CAAC,GAAGP,MAAM,CAACA,OAAOQ,OAAO,CAAC,EAAE,CAAC,EAAE;IAC/B,CAAC,GAAGR,MAAM,CAACA,OAAOS,QAAQ,CAAC,EAAE,CAAC,EAAE;IAChC,CAAC,GAAGT,MAAM,CAACA,OAAOU,OAAO,CAAC,EAAE,CAAC,EAC3B;IACF,CAAC,GAAGX,YAAY,CAACA,aAAaY,UAAU,CAAC,EAAE,CAAC,EAAE;AAChD;AAEA,OAAO,MAAMC,sBAA6Cd,MAAMe,UAAU,CACxE,CAAC,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,KAAK,EAAEC,kBAAkB,EAAEC,KAAK,EAAE,EAAEC;IAC1D,IAAIC,OAAOC,IAAI,CAACnB,WAAWoB,OAAO,CAACN,WAAW,CAAC,GAAG;QAChD,qBAAO,oBAACO;YAAIC,WAAWP;YAAoBC,OAAOA;;IACpD;IACA,qBACE,oBAACO;QACCC,OAAO;QACPC,QAAQ;QACRC,SAAS;QACR,GAAG3B,eAAea,SAAS;QAC5Be,WAAW,CAAC,OAAO,EACjBb,UAAUhB,MAAM,CAACA,OAAOO,OAAO,CAAC,GAAG,KAAKS,UAAUhB,MAAM,CAACA,OAAOM,OAAO,CAAC,GAAG,MAAM,EAClF,OAAO,CAAC;QACTY,OAAO;YACLQ,OAAO;YACPC,QAAQ;QACV;qBAEA,oBAACG;QAAKC,GAAG7B,SAAS,CAACc,MAAM;QAAG,GAAGf,eAAec,UAAU;;AAG9D,GACA"}
@@ -1,6 +1,19 @@
1
1
  import { __styles, mergeClasses, shorthands } from '@griffel/react';
2
2
  import { tokens, typographyStyles } from '@fluentui/react-theme';
3
3
  import { HighContrastSelector } from '../../utilities/index';
4
+ // Constants needed to create legends using SVG for image export
5
+ export const LEGEND_CONTAINER_MARGIN_TOP = 8;
6
+ export const LEGEND_CONTAINER_MARGIN_START = 12;
7
+ export const LEGEND_PADDING = 8;
8
+ export const LEGEND_HEIGHT = 32;
9
+ export const LEGEND_SHAPE_BORDER = 1;
10
+ const LEGEND_SHAPE_SIZE_WITHOUT_BORDER = 12;
11
+ // SVG strokes are drawn centered around the path, with half of the stroke width extending inward
12
+ // (overlapping the fill area) and half outward. To ensure the filled area maintains its intended size,
13
+ // expand the shape accordingly.
14
+ export const LEGEND_SHAPE_SIZE = LEGEND_SHAPE_SIZE_WITHOUT_BORDER + LEGEND_SHAPE_BORDER;
15
+ export const LEGEND_SHAPE_MARGIN_END = 8;
16
+ export const INACTIVE_LEGEND_TEXT_OPACITY = 0.67;
4
17
  /**
5
18
  * @internal
6
19
  */
@@ -12,7 +25,9 @@ export const legendClassNames = {
12
25
  triangle: 'fui-legend__triangle',
13
26
  text: 'fui-legend__text',
14
27
  hoverChange: 'fui-legend__hoverChange',
15
- resizableArea: 'fui-legend__resizableArea'
28
+ resizableArea: 'fui-legend__resizableArea',
29
+ legendContainer: 'fui-legend__legendContainer',
30
+ annotation: 'fui-legend__annotation'
16
31
  };
17
32
  const useStyles = /*#__PURE__*/__styles({
18
33
  root: {
@@ -32,10 +47,11 @@ const useStyles = /*#__PURE__*/__styles({
32
47
  vrafjx: ["f1n71otn", "f1deefiw"],
33
48
  oivjwe: "f1h8hb77",
34
49
  wvpqe5: ["f1deefiw", "f1n71otn"],
35
- z8tnut: "f17mpqex",
36
- z189sj: ["f1vdfbxk", "f1f5gg8d"],
37
- Byoj8tv: "fdvome7",
38
- uwmqm3: ["f1f5gg8d", "f1vdfbxk"],
50
+ Byoj8tv: 0,
51
+ uwmqm3: 0,
52
+ z189sj: 0,
53
+ z8tnut: 0,
54
+ B0ocmuz: "f1t756mo",
39
55
  B9bfxx9: "fiwaqkr",
40
56
  Bf4jedk: "fy77jfu",
41
57
  Bs92zhm: "fuhkvgp",
@@ -47,6 +63,7 @@ const useStyles = /*#__PURE__*/__styles({
47
63
  zpeayv: "f81dvq6",
48
64
  Bcwlslt: "f1a000x3",
49
65
  a9b677: "frx94fk",
66
+ t21cq0: ["f1phki43", "ff9s3yw"],
50
67
  Bgfg5da: 0,
51
68
  B9xav0g: 0,
52
69
  oivjwe: 0,
@@ -63,11 +80,10 @@ const useStyles = /*#__PURE__*/__styles({
63
80
  g2u3we: 0,
64
81
  icvyot: 0,
65
82
  B4j52fo: 0,
66
- irswps: "fpyyuzi",
67
- t21cq0: ["f1vcna3q", "foyynoy"]
83
+ irswps: "fpyyuzi"
68
84
  },
69
85
  shape: {
70
- t21cq0: ["f1vcna3q", "foyynoy"]
86
+ t21cq0: ["f1phki43", "ff9s3yw"]
71
87
  },
72
88
  triangle: {
73
89
  a9b677: "f3tsq5r",
@@ -108,11 +124,37 @@ const useStyles = /*#__PURE__*/__styles({
108
124
  Be2s5ez: ["f1xelbol", "fk27hbk"],
109
125
  xrcqlc: "f196ehyi",
110
126
  Bhxzhr1: ["frlu5y9", "f109kcev"]
127
+ },
128
+ legendContainer: {
129
+ xawz: 0,
130
+ Bh6795r: 0,
131
+ Bnnss6s: 0,
132
+ fkmc3a: "fd43uyw",
133
+ jrapky: 0,
134
+ Frg6f3: 0,
135
+ t21cq0: 0,
136
+ B6of3ja: 0,
137
+ B74szlk: "fduql59"
138
+ },
139
+ annotation: {
140
+ mc9l5x: "f22iagw",
141
+ Bt984gj: "f122n59",
142
+ i8kkvl: 0,
143
+ Belr9w4: 0,
144
+ rmohyg: "f4xv25i"
111
145
  }
112
146
  }, {
113
- d: [".fz5stix{white-space:nowrap;}", ".fly5x3f{width:100%;}", ".f122n59{align-items:center;}", ".fpzxe1g{margin-top:-8px 0 0 -8px;}", ".f705vk6{margin-right:-8px 0 0 -8px;}", ".fqom4eq{margin-left:-8px 0 0 -8px;}", ".fzpzak3{margin-bottom:-8px 0 0 -8px;}", ".fc7pyfw{justify-content:left;}", ".fgbriwd{justify-content:right;}", ".f1k6fduh{cursor:pointer;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}", ".fiwaqkr{text-transform:capitalize;}", ".fy77jfu{min-width:0;}", ".frx94fk{width:12px;}", [".fpyyuzi{border:1px solid;}", {
147
+ d: [".fz5stix{white-space:nowrap;}", ".fly5x3f{width:100%;}", ".f122n59{align-items:center;}", ".fpzxe1g{margin-top:-8px 0 0 -8px;}", ".f705vk6{margin-right:-8px 0 0 -8px;}", ".fqom4eq{margin-left:-8px 0 0 -8px;}", ".fzpzak3{margin-bottom:-8px 0 0 -8px;}", ".fc7pyfw{justify-content:left;}", ".fgbriwd{justify-content:right;}", ".f1k6fduh{cursor:pointer;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", [".f1t756mo{padding:8px;}", {
148
+ p: -1
149
+ }], ".fiwaqkr{text-transform:capitalize;}", ".fy77jfu{min-width:0;}", ".frx94fk{width:12px;}", ".f1phki43{margin-right:8px;}", ".ff9s3yw{margin-left:8px;}", [".fpyyuzi{border:1px solid;}", {
114
150
  p: -2
115
- }], ".f1vcna3q{margin-right:var(--spacingHorizontalS);}", ".foyynoy{margin-left:var(--spacingHorizontalS);}", ".f3tsq5r{width:0;}", ".fniina8{height:0;}", ".fk1dseo{border-left-width:6px solid transparent;}", ".f1r9b9o{border-right-width:6px solid transparent;}", ".f1cm5upi{border-top-width:10.4px solid;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fhv2zbx{forced-color-adjust:auto;}", ".fvblgha{height:12px;}", ".f1d7653x{border-top-width:1px solid;}", ".f1maxq7k{border-right-width:1px solid;}", ".f16g4l54{border-left-width:1px solid;}", ".f1rzi0e7{border-bottom-width:1px solid;}", ".f10pi13n{position:relative;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".f15ivbov{transform:translate(-50%, 0);}", ".fjwp9lj{transform:translate(50%, 0);}", ".f198g47y{top:auto;}", ".f1ktbn1t{left:50%;}", ".ffenbu1{right:50%;}", ".f93ek0f{min-width:200px;}", ".f1cgdal8{max-width:800px;}", ".f2b5gy5::after{padding-top:1px 4px 1px;}", ".fk27hbk::after{padding-right:1px 4px 1px;}", ".f1xelbol::after{padding-left:1px 4px 1px;}", ".f1gw7v5p::after{padding-bottom:1px 4px 1px;}", ".f196ehyi::after{border-top-width:-2px;}", ".frlu5y9::after{border-left-width:-2px;}", ".f109kcev::after{border-right-width:-2px;}"],
151
+ }], ".f3tsq5r{width:0;}", ".fniina8{height:0;}", ".fk1dseo{border-left-width:6px solid transparent;}", ".f1r9b9o{border-right-width:6px solid transparent;}", ".f1cm5upi{border-top-width:10.4px solid;}", ".f1vcna3q{margin-right:var(--spacingHorizontalS);}", ".foyynoy{margin-left:var(--spacingHorizontalS);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fhv2zbx{forced-color-adjust:auto;}", ".fvblgha{height:12px;}", ".f1d7653x{border-top-width:1px solid;}", ".f1maxq7k{border-right-width:1px solid;}", ".f16g4l54{border-left-width:1px solid;}", ".f1rzi0e7{border-bottom-width:1px solid;}", ".f10pi13n{position:relative;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".f15ivbov{transform:translate(-50%, 0);}", ".fjwp9lj{transform:translate(50%, 0);}", ".f198g47y{top:auto;}", ".f1ktbn1t{left:50%;}", ".ffenbu1{right:50%;}", ".f93ek0f{min-width:200px;}", ".f1cgdal8{max-width:800px;}", ".f2b5gy5::after{padding-top:1px 4px 1px;}", ".fk27hbk::after{padding-right:1px 4px 1px;}", ".f1xelbol::after{padding-left:1px 4px 1px;}", ".f1gw7v5p::after{padding-bottom:1px 4px 1px;}", ".f196ehyi::after{border-top-width:-2px;}", ".frlu5y9::after{border-left-width:-2px;}", ".f109kcev::after{border-right-width:-2px;}", [".fd43uyw{flex:0 1 auto;}", {
152
+ p: -1
153
+ }], [".fduql59{margin:4px;}", {
154
+ p: -1
155
+ }], ".f22iagw{display:flex;}", [".f4xv25i{gap:4px;}", {
156
+ p: -1
157
+ }]],
116
158
  m: [["@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.fuhkvgp{color:WindowText;}}", {
117
159
  m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
118
160
  }], ["@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.f15mrrko{forced-color-adjust:none;}}", {
@@ -128,7 +170,7 @@ const useStyles = /*#__PURE__*/__styles({
128
170
  }]]
129
171
  });
130
172
  export const useLegendStyles = props => {
131
- var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7;
173
+ var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9;
132
174
  const {
133
175
  className
134
176
  } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.
@@ -141,7 +183,8 @@ export const useLegendStyles = props => {
141
183
  triangle: mergeClasses(legendClassNames.triangle, baseStyles.triangle, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.triangle),
142
184
  text: mergeClasses(legendClassNames.text, baseStyles.text, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.text),
143
185
  hoverChange: mergeClasses(legendClassNames.hoverChange, baseStyles.hoverChange, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.hoverChange),
144
- resizableArea: mergeClasses(legendClassNames.resizableArea, baseStyles.resizableArea, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.resizableArea)
186
+ resizableArea: mergeClasses(legendClassNames.resizableArea, baseStyles.resizableArea, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.resizableArea),
187
+ legendContainer: mergeClasses(legendClassNames.legendContainer, baseStyles.legendContainer, (_props_styles8 = props.styles) === null || _props_styles8 === void 0 ? void 0 : _props_styles8.legendContainer),
188
+ annotation: mergeClasses(legendClassNames.annotation, baseStyles.annotation, (_props_styles9 = props.styles) === null || _props_styles9 === void 0 ? void 0 : _props_styles9.annotation)
145
189
  };
146
- };
147
- //# sourceMappingURL=useLegendsStyles.styles.js.map
190
+ };
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","HighContrastSelector","legendClassNames","root","legend","rect","shape","triangle","text","hoverChange","resizableArea","useStyles","Huce71","a9b677","Bt984gj","B6of3ja","t21cq0","jrapky","Frg6f3","Brf1p80","Bceei9c","icvyot","vrafjx","oivjwe","wvpqe5","z8tnut","z189sj","Byoj8tv","uwmqm3","B9bfxx9","Bf4jedk","Bs92zhm","B93v9kj","Ck9m1r","mkjk8h","zpeayv","Bcwlslt","Bgfg5da","B9xav0g","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","u1mtju","h3c5rm","Bekrc4i","i8vvqc","g2u3we","B4j52fo","irswps","Bqenvij","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","sj55zd","Bvjb7m6","qhf8xq","fsow6f","Bz10aip","Bhzewxz","oyh7mz","B2u0y6b","smv486","u6pn5x","B4uzyy","Be2s5ez","xrcqlc","Bhxzhr1","d","p","m","useLegendStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","_props_styles4","_props_styles5","_props_styles6","_props_styles7","className","baseStyles","styles"],"sources":["useLegendsStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\n/**\n * @internal\n */ export const legendClassNames = {\n root: 'fui-legend__root',\n legend: 'fui-legend__legend',\n rect: 'fui-legend__rect',\n shape: 'fui-legend__shape',\n triangle: 'fui-legend__triangle',\n text: 'fui-legend__text',\n hoverChange: 'fui-legend__hoverChange',\n resizableArea: 'fui-legend__resizableArea'\n};\nconst useStyles = makeStyles({\n root: {\n // FIXME: Removing this style allows the legend container in responsive donut chart to resize\n // properly (horizontally) within a flexbox or grid layout. But it causes vertical resizing issues\n // in responsive charts where legends consist of multiple words.\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center',\n ...shorthands.margin('-8px 0 0 -8px')\n },\n legend: {\n // setting display to flex does not work\n // display: 'flex',\n alignItems: 'center',\n justifyContent: 'left',\n cursor: 'pointer',\n ...shorthands.border('none'),\n ...shorthands.padding(tokens.spacingHorizontalS),\n textTransform: 'capitalize',\n // The default min-width is 64px. Setting it to 0 allows the legend container in responsive\n // cartesian charts to resize properly within a flexbox or grid layout.\n minWidth: 0,\n [HighContrastSelector]: {\n color: 'WindowText',\n forcedColorAdjust: 'none'\n },\n '&:hover': {\n [HighContrastSelector]: {\n color: 'HighlightText',\n forcedColorAdjust: 'none'\n }\n }\n },\n rect: {\n [HighContrastSelector]: {\n content: 'var(--rect-content-high-contrast)',\n opacity: 'var(--rect-opacity-high-contrast)'\n },\n width: '12px',\n border: '1px solid',\n marginRight: tokens.spacingHorizontalS\n },\n shape: {\n marginRight: tokens.spacingHorizontalS\n },\n // TO DO Add props when these styles are used in the component\n triangle: {\n width: '0',\n height: '0',\n ...shorthands.borderLeft('6px solid transparent'),\n ...shorthands.borderRight('6px solid transparent'),\n ...shorthands.borderTop('10.4px solid'),\n marginRight: tokens.spacingHorizontalS\n },\n // TO DO Add props when these styles are used in the component\n text: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n // TO DO Add props when these styles are used in the component\n hoverChange: {\n width: '12px',\n height: '12px',\n marginRight: tokens.spacingHorizontalS,\n ...shorthands.border('1px solid')\n },\n resizableArea: {\n position: 'relative',\n textAlign: 'left',\n transform: 'translate(-50%, 0)',\n top: 'auto',\n left: '50%',\n minWidth: '200px',\n maxWidth: '800px',\n '::after': {\n ...shorthands.padding('1px 4px 1px'),\n ...shorthands.borderTop('-2px'),\n ...shorthands.borderLeft('-2px')\n }\n }\n});\nexport const useLegendStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7;\n const { className } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.\n const baseStyles = useStyles();\n return {\n root: mergeClasses(legendClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n legend: mergeClasses(legendClassNames.legend, baseStyles.legend, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.legend),\n rect: mergeClasses(legendClassNames.rect, baseStyles.rect, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.rect),\n shape: mergeClasses(legendClassNames.shape, baseStyles.shape, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.shape),\n triangle: mergeClasses(legendClassNames.triangle, baseStyles.triangle, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.triangle),\n text: mergeClasses(legendClassNames.text, baseStyles.text, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.text),\n hoverChange: mergeClasses(legendClassNames.hoverChange, baseStyles.hoverChange, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.hoverChange),\n resizableArea: mergeClasses(legendClassNames.resizableArea, baseStyles.resizableArea, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.resizableArea)\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D;AACA;AACA;AAAI,OAAO,MAAMC,gBAAgB,GAAG;EAChCC,IAAI,EAAE,kBAAkB;EACxBC,MAAM,EAAE,oBAAoB;EAC5BC,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE,mBAAmB;EAC1BC,QAAQ,EAAE,sBAA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C;IAChKC,KAAK,EAAET,YAAY,CAACK,gBAAgB,CAACI,KAAK,EAAE6E,UAAU,CAAC7E,KAAK,EAAE,CAACuE,cAAc,GAAGJ,KAAK,CAACW,MAAM,MAAM,IAAI,IAAIP,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvE,KAAK,CAAC;IACpKC,QAAQ,EAAEV,YAAY,CAACK,gBAAgB,CAACK,QAAQ,EAAE4E,UAAU,CAAC5E,QAAQ,EAAE,CAACuE,cAAc,GAAGL,KAAK,CAACW,MAAM,MAAM,IAAI,IAAIN,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvE,QAAQ,CAAC;IAChLC,IAAI,EAAEX,YAAY,CAACK,gBAAgB,CAACM,IAAI,EAAE2E,UAAU,CAAC3E,IAAI,EAAE,CAACuE,cAAc,GAAGN,KAAK,CAACW,MAAM,MAAM,IAAI,IAAIL,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvE,IAAI,CAAC;IAChKC,WAAW,EAAEZ,YAAY,CAACK,gBAAgB,CAACO,WAAW,EAAE0E,UAAU,CAAC1E,WAAW,EAAE,CAACuE,cAAc,GAAGP,KAAK,CAACW,MAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvE,WAAW,CAAC;IAC5LC,aAAa,EAAEb,YAAY,CAACK,gBAAgB,CAACQ,aAAa,EAAEyE,UAAU,CAACzE,aAAa,EAAE,CAACuE,cAAc,GAAGR,KAAK,CAACW,MAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvE,aAAa;EACvM,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","HighContrastSelector","LEGEND_CONTAINER_MARGIN_TOP","LEGEND_CONTAINER_MARGIN_START","LEGEND_PADDING","LEGEND_HEIGHT","LEGEND_SHAPE_BORDER","LEGEND_SHAPE_SIZE_WITHOUT_BORDER","LEGEND_SHAPE_SIZE","LEGEND_SHAPE_MARGIN_END","INACTIVE_LEGEND_TEXT_OPACITY","legendClassNames","root","legend","rect","shape","triangle","text","hoverChange","resizableArea","legendContainer","annotation","useStyles","Huce71","a9b677","Bt984gj","B6of3ja","t21cq0","jrapky","Frg6f3","Brf1p80","Bceei9c","icvyot","vrafjx","oivjwe","wvpqe5","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","B9bfxx9","Bf4jedk","Bs92zhm","B93v9kj","Ck9m1r","mkjk8h","zpeayv","Bcwlslt","Bgfg5da","B9xav0g","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","u1mtju","h3c5rm","Bekrc4i","i8vvqc","g2u3we","B4j52fo","irswps","Bqenvij","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","sj55zd","Bvjb7m6","qhf8xq","fsow6f","Bz10aip","Bhzewxz","oyh7mz","B2u0y6b","smv486","u6pn5x","B4uzyy","Be2s5ez","xrcqlc","Bhxzhr1","xawz","Bh6795r","Bnnss6s","fkmc3a","B74szlk","mc9l5x","i8kkvl","Belr9w4","rmohyg","d","p","m","useLegendStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","_props_styles4","_props_styles5","_props_styles6","_props_styles7","_props_styles8","_props_styles9","className","baseStyles","styles"],"sources":["useLegendsStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\n// Constants needed to create legends using SVG for image export\nexport const LEGEND_CONTAINER_MARGIN_TOP = 8;\nexport const LEGEND_CONTAINER_MARGIN_START = 12;\nexport const LEGEND_PADDING = 8;\nexport const LEGEND_HEIGHT = 32;\nexport const LEGEND_SHAPE_BORDER = 1;\nconst LEGEND_SHAPE_SIZE_WITHOUT_BORDER = 12;\n// SVG strokes are drawn centered around the path, with half of the stroke width extending inward\n// (overlapping the fill area) and half outward. To ensure the filled area maintains its intended size,\n// expand the shape accordingly.\nexport const LEGEND_SHAPE_SIZE = LEGEND_SHAPE_SIZE_WITHOUT_BORDER + LEGEND_SHAPE_BORDER;\nexport const LEGEND_SHAPE_MARGIN_END = 8;\nexport const INACTIVE_LEGEND_TEXT_OPACITY = 0.67;\n/**\n * @internal\n */ export const legendClassNames = {\n root: 'fui-legend__root',\n legend: 'fui-legend__legend',\n rect: 'fui-legend__rect',\n shape: 'fui-legend__shape',\n triangle: 'fui-legend__triangle',\n text: 'fui-legend__text',\n hoverChange: 'fui-legend__hoverChange',\n resizableArea: 'fui-legend__resizableArea',\n legendContainer: 'fui-legend__legendContainer',\n annotation: 'fui-legend__annotation'\n};\nconst useStyles = makeStyles({\n root: {\n // FIXME: Removing this style allows the legend container in responsive donut chart to resize\n // properly (horizontally) within a flexbox or grid layout. But it causes vertical resizing issues\n // in responsive charts where legends consist of multiple words.\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center',\n ...shorthands.margin('-8px 0 0 -8px')\n },\n legend: {\n // setting display to flex does not work\n // display: 'flex',\n alignItems: 'center',\n justifyContent: 'left',\n cursor: 'pointer',\n ...shorthands.border('none'),\n padding: `${LEGEND_PADDING}px`,\n textTransform: 'capitalize',\n // The default min-width is 64px. Setting it to 0 allows the legend container in responsive\n // cartesian charts to resize properly within a flexbox or grid layout.\n minWidth: 0,\n [HighContrastSelector]: {\n color: 'WindowText',\n forcedColorAdjust: 'none'\n },\n '&:hover': {\n [HighContrastSelector]: {\n color: 'HighlightText',\n forcedColorAdjust: 'none'\n }\n }\n },\n rect: {\n [HighContrastSelector]: {\n content: 'var(--rect-content-high-contrast)',\n opacity: 'var(--rect-opacity-high-contrast)'\n },\n width: `${LEGEND_SHAPE_SIZE_WITHOUT_BORDER}px`,\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`,\n border: `${LEGEND_SHAPE_BORDER}px solid`\n },\n shape: {\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`\n },\n // TO DO Add props when these styles are used in the component\n triangle: {\n width: '0',\n height: '0',\n ...shorthands.borderLeft('6px solid transparent'),\n ...shorthands.borderRight('6px solid transparent'),\n ...shorthands.borderTop('10.4px solid'),\n marginRight: tokens.spacingHorizontalS\n },\n // TO DO Add props when these styles are used in the component\n text: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n // TO DO Add props when these styles are used in the component\n hoverChange: {\n width: '12px',\n height: '12px',\n marginRight: tokens.spacingHorizontalS,\n ...shorthands.border('1px solid')\n },\n resizableArea: {\n position: 'relative',\n textAlign: 'left',\n transform: 'translate(-50%, 0)',\n top: 'auto',\n left: '50%',\n minWidth: '200px',\n maxWidth: '800px',\n '::after': {\n ...shorthands.padding('1px 4px 1px'),\n ...shorthands.borderTop('-2px'),\n ...shorthands.borderLeft('-2px')\n }\n },\n legendContainer: {\n flex: '0 1 auto',\n margin: '4px'\n },\n annotation: {\n display: 'flex',\n alignItems: 'center',\n gap: '4px'\n }\n});\nexport const useLegendStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9;\n const { className } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.\n const baseStyles = useStyles();\n return {\n root: mergeClasses(legendClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n legend: mergeClasses(legendClassNames.legend, baseStyles.legend, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.legend),\n rect: mergeClasses(legendClassNames.rect, baseStyles.rect, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.rect),\n shape: mergeClasses(legendClassNames.shape, baseStyles.shape, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.shape),\n triangle: mergeClasses(legendClassNames.triangle, baseStyles.triangle, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.triangle),\n text: mergeClasses(legendClassNames.text, baseStyles.text, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.text),\n hoverChange: mergeClasses(legendClassNames.hoverChange, baseStyles.hoverChange, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.hoverChange),\n resizableArea: mergeClasses(legendClassNames.resizableArea, baseStyles.resizableArea, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.resizableArea),\n legendContainer: mergeClasses(legendClassNames.legendContainer, baseStyles.legendContainer, (_props_styles8 = props.styles) === null || _props_styles8 === void 0 ? void 0 : _props_styles8.legendContainer),\n annotation: mergeClasses(legendClassNames.annotation, baseStyles.annotation, (_props_styles9 = props.styles) === null || _props_styles9 === void 0 ? void 0 : _props_styles9.annotation)\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D;AACA,OAAO,MAAMC,2BAA2B,GAAG,CAAC;AAC5C,OAAO,MAAMC,6BAA6B,GAAG,EAAE;AAC/C,OAAO,MAAMC,cAAc,GAAG,CAAC;AAC/B,OAAO,MAAMC,aAAa,GAAG,EAAE;AAC/B,OAAO,MAAMC,mBAAmB,GAAG,CAAC;AACpC,MAAMC,gCAAgC,GAAG,EAAE;AAC3C;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGD,gCAAgC,GAAGD,mBAAmB;AACvF,OAAO,MAAMG,uBAAuB,GAAG,CAAC;AACxC,OAAO,MAAMC,4BAA4B,GAAG,IAAI;AAChD;AACA;AACA;AAAI,OAAO,MAAMC,gB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