@kubit-ui-web/react-charts 1.5.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/cjs/charts/lineChart/context/buildLineContextValue.d.ts +1 -3
  2. package/dist/cjs/charts/lineChart/context/buildLineContextValue.d.ts.map +1 -1
  3. package/dist/cjs/charts/lineChart/context/buildLineContextValue.js +64 -128
  4. package/dist/cjs/charts/lineChart/fragments/fixture/contextData.d.ts +2 -43
  5. package/dist/cjs/charts/lineChart/fragments/fixture/contextData.d.ts.map +1 -1
  6. package/dist/cjs/charts/lineChart/fragments/fixture/contextData.js +8 -6
  7. package/dist/cjs/charts/lineChart/fragments/lineChartPath.js +3 -3
  8. package/dist/cjs/charts/lineChart/fragments/lineChartXAxis.d.ts.map +1 -1
  9. package/dist/cjs/charts/lineChart/fragments/lineChartXAxis.js +3 -8
  10. package/dist/cjs/charts/lineChart/fragments/lineChartYAxis.d.ts.map +1 -1
  11. package/dist/cjs/charts/lineChart/fragments/lineChartYAxis.js +9 -9
  12. package/dist/cjs/charts/lineChart/lineChart.type.d.ts +12 -7
  13. package/dist/cjs/charts/lineChart/lineChart.type.d.ts.map +1 -1
  14. package/dist/cjs/charts/lineChart/lineChartStructure.js +11 -10
  15. package/dist/cjs/charts/lineChart/utils/getCoordinates.d.ts +25 -0
  16. package/dist/cjs/charts/lineChart/utils/getCoordinates.d.ts.map +1 -0
  17. package/dist/cjs/charts/lineChart/utils/getCoordinates.js +55 -0
  18. package/dist/cjs/charts/lineChart/utils/getExtraSpacing.d.ts +1 -3
  19. package/dist/cjs/charts/lineChart/utils/getExtraSpacing.d.ts.map +1 -1
  20. package/dist/cjs/charts/lineChart/utils/getExtraSpacing.js +68 -51
  21. package/dist/cjs/charts/lineChart/utils/getTicks.d.ts +21 -0
  22. package/dist/cjs/charts/lineChart/utils/getTicks.d.ts.map +1 -0
  23. package/dist/cjs/charts/lineChart/utils/getTicks.js +36 -0
  24. package/dist/cjs/charts/lineChart/utils/handleNodesFocus.d.ts.map +1 -1
  25. package/dist/cjs/charts/lineChart/utils/handleNodesFocus.js +14 -25
  26. package/dist/cjs/charts/lineChart/utils/tickTextPosition.d.ts +33 -0
  27. package/dist/cjs/charts/lineChart/utils/tickTextPosition.d.ts.map +1 -0
  28. package/dist/cjs/charts/lineChart/utils/tickTextPosition.js +109 -0
  29. package/dist/cjs/charts/lineChart/utils/validations.d.ts +54 -0
  30. package/dist/cjs/charts/lineChart/utils/validations.d.ts.map +1 -0
  31. package/dist/cjs/charts/lineChart/utils/validations.js +117 -0
  32. package/dist/cjs/components/chartText/chartText.d.ts.map +1 -1
  33. package/dist/cjs/components/chartText/chartText.js +2 -2
  34. package/dist/cjs/components/focusRing/components/FocusRingInline.d.ts +25 -0
  35. package/dist/cjs/components/focusRing/components/FocusRingInline.d.ts.map +1 -0
  36. package/dist/cjs/components/focusRing/components/FocusRingInline.js +37 -0
  37. package/dist/cjs/components/focusRing/components/FocusRingRenderer.d.ts +13 -0
  38. package/dist/cjs/components/focusRing/components/FocusRingRenderer.d.ts.map +1 -0
  39. package/dist/cjs/components/focusRing/components/FocusRingRenderer.js +25 -0
  40. package/dist/cjs/components/focusRing/components/FocusRingSeparate.d.ts +40 -0
  41. package/dist/cjs/components/focusRing/components/FocusRingSeparate.d.ts.map +1 -0
  42. package/dist/cjs/components/focusRing/components/FocusRingSeparate.js +45 -0
  43. package/dist/cjs/components/focusRing/focusRing.css +14 -0
  44. package/dist/cjs/components/focusRing/focusRing.d.ts +35 -0
  45. package/dist/cjs/components/focusRing/focusRing.d.ts.map +1 -0
  46. package/dist/cjs/components/focusRing/focusRing.js +44 -0
  47. package/dist/cjs/components/focusRing/focusRing.types.d.ts +40 -0
  48. package/dist/cjs/components/focusRing/focusRing.types.d.ts.map +1 -0
  49. package/dist/cjs/components/focusRing/focusRing.types.js +1 -0
  50. package/dist/cjs/components/focusRing/hooks/useFocusRingData.d.ts +27 -0
  51. package/dist/cjs/components/focusRing/hooks/useFocusRingData.d.ts.map +1 -0
  52. package/dist/cjs/components/focusRing/hooks/useFocusRingData.js +67 -0
  53. package/dist/cjs/components/focusRing/index.d.ts +3 -0
  54. package/dist/cjs/components/focusRing/index.d.ts.map +1 -0
  55. package/dist/cjs/components/focusRing/index.js +1 -0
  56. package/dist/cjs/components/focusRing/utils/composeRefs.d.ts +7 -0
  57. package/dist/cjs/components/focusRing/utils/composeRefs.d.ts.map +1 -0
  58. package/dist/cjs/components/focusRing/utils/composeRefs.js +16 -0
  59. package/dist/cjs/components/focusRing/utils/createAdaptiveFocusRings.d.ts +24 -0
  60. package/dist/cjs/components/focusRing/utils/createAdaptiveFocusRings.d.ts.map +1 -0
  61. package/dist/cjs/components/focusRing/utils/createAdaptiveFocusRings.js +141 -0
  62. package/dist/cjs/components/focusRing/utils/createBoundingBoxFocusRings.d.ts +33 -0
  63. package/dist/cjs/components/focusRing/utils/createBoundingBoxFocusRings.d.ts.map +1 -0
  64. package/dist/cjs/components/focusRing/utils/createBoundingBoxFocusRings.js +126 -0
  65. package/dist/cjs/components/focusRing/utils/utils.types.d.ts +52 -0
  66. package/dist/cjs/components/focusRing/utils/utils.types.d.ts.map +1 -0
  67. package/dist/cjs/components/focusRing/utils/utils.types.js +1 -0
  68. package/dist/cjs/components/index.d.ts +1 -0
  69. package/dist/cjs/components/index.d.ts.map +1 -1
  70. package/dist/cjs/components/index.js +1 -0
  71. package/dist/cjs/components/line/line.d.ts.map +1 -1
  72. package/dist/cjs/components/line/line.js +2 -2
  73. package/dist/cjs/components/line/line.types.d.ts +2 -0
  74. package/dist/cjs/components/line/line.types.d.ts.map +1 -1
  75. package/dist/cjs/components/node/node.d.ts.map +1 -1
  76. package/dist/cjs/components/node/node.js +1 -1
  77. package/dist/cjs/components/node/node.types.d.ts +2 -0
  78. package/dist/cjs/components/node/node.types.d.ts.map +1 -1
  79. package/dist/cjs/components/path/path.js +1 -1
  80. package/dist/cjs/components/plot/plot.d.ts.map +1 -1
  81. package/dist/cjs/components/plot/plot.js +7 -19
  82. package/dist/cjs/components/zoomArea/components/SelectionArea.d.ts +3 -23
  83. package/dist/cjs/components/zoomArea/components/SelectionArea.d.ts.map +1 -1
  84. package/dist/cjs/components/zoomArea/components/SelectionArea.js +7 -39
  85. package/dist/cjs/components/zoomArea/components/ZoomHandler.d.ts +3 -3
  86. package/dist/cjs/components/zoomArea/components/ZoomHandler.d.ts.map +1 -1
  87. package/dist/cjs/components/zoomArea/components/ZoomHandler.js +2 -15
  88. package/dist/cjs/components/zoomArea/components/index.d.ts +1 -1
  89. package/dist/cjs/components/zoomArea/components/index.d.ts.map +1 -1
  90. package/dist/cjs/components/zoomArea/components/index.js +1 -1
  91. package/dist/cjs/components/zoomArea/zoomArea.js +6 -6
  92. package/dist/cjs/components/zoomArea/zoomArea.type.d.ts +1 -1
  93. package/dist/cjs/components/zoomArea/zoomArea.type.d.ts.map +1 -1
  94. package/dist/cjs/types/focusConfig.type.d.ts +15 -3
  95. package/dist/cjs/types/focusConfig.type.d.ts.map +1 -1
  96. package/dist/cjs/types/focusConfig.type.js +14 -1
  97. package/dist/cjs/utils/pickCustomAttributes/pickCustomAttributes.d.ts +7 -6
  98. package/dist/cjs/utils/pickCustomAttributes/pickCustomAttributes.d.ts.map +1 -1
  99. package/dist/cjs/utils/pickCustomAttributes/pickCustomAttributes.js +8 -7
  100. package/dist/esm/charts/lineChart/context/buildLineContextValue.d.ts +1 -3
  101. package/dist/esm/charts/lineChart/context/buildLineContextValue.d.ts.map +1 -1
  102. package/dist/esm/charts/lineChart/context/buildLineContextValue.js +64 -128
  103. package/dist/esm/charts/lineChart/fragments/fixture/contextData.d.ts +2 -43
  104. package/dist/esm/charts/lineChart/fragments/fixture/contextData.d.ts.map +1 -1
  105. package/dist/esm/charts/lineChart/fragments/fixture/contextData.js +8 -6
  106. package/dist/esm/charts/lineChart/fragments/lineChartPath.js +3 -3
  107. package/dist/esm/charts/lineChart/fragments/lineChartXAxis.d.ts.map +1 -1
  108. package/dist/esm/charts/lineChart/fragments/lineChartXAxis.js +3 -8
  109. package/dist/esm/charts/lineChart/fragments/lineChartYAxis.d.ts.map +1 -1
  110. package/dist/esm/charts/lineChart/fragments/lineChartYAxis.js +9 -9
  111. package/dist/esm/charts/lineChart/lineChart.type.d.ts +12 -7
  112. package/dist/esm/charts/lineChart/lineChart.type.d.ts.map +1 -1
  113. package/dist/esm/charts/lineChart/lineChartStructure.js +11 -10
  114. package/dist/esm/charts/lineChart/utils/getCoordinates.d.ts +25 -0
  115. package/dist/esm/charts/lineChart/utils/getCoordinates.d.ts.map +1 -0
  116. package/dist/esm/charts/lineChart/utils/getCoordinates.js +55 -0
  117. package/dist/esm/charts/lineChart/utils/getExtraSpacing.d.ts +1 -3
  118. package/dist/esm/charts/lineChart/utils/getExtraSpacing.d.ts.map +1 -1
  119. package/dist/esm/charts/lineChart/utils/getExtraSpacing.js +68 -51
  120. package/dist/esm/charts/lineChart/utils/getTicks.d.ts +21 -0
  121. package/dist/esm/charts/lineChart/utils/getTicks.d.ts.map +1 -0
  122. package/dist/esm/charts/lineChart/utils/getTicks.js +36 -0
  123. package/dist/esm/charts/lineChart/utils/handleNodesFocus.d.ts.map +1 -1
  124. package/dist/esm/charts/lineChart/utils/handleNodesFocus.js +14 -25
  125. package/dist/esm/charts/lineChart/utils/tickTextPosition.d.ts +33 -0
  126. package/dist/esm/charts/lineChart/utils/tickTextPosition.d.ts.map +1 -0
  127. package/dist/esm/charts/lineChart/utils/tickTextPosition.js +109 -0
  128. package/dist/esm/charts/lineChart/utils/validations.d.ts +54 -0
  129. package/dist/esm/charts/lineChart/utils/validations.d.ts.map +1 -0
  130. package/dist/esm/charts/lineChart/utils/validations.js +117 -0
  131. package/dist/esm/components/chartText/chartText.d.ts.map +1 -1
  132. package/dist/esm/components/chartText/chartText.js +2 -2
  133. package/dist/esm/components/focusRing/components/FocusRingInline.d.ts +25 -0
  134. package/dist/esm/components/focusRing/components/FocusRingInline.d.ts.map +1 -0
  135. package/dist/esm/components/focusRing/components/FocusRingInline.js +37 -0
  136. package/dist/esm/components/focusRing/components/FocusRingRenderer.d.ts +13 -0
  137. package/dist/esm/components/focusRing/components/FocusRingRenderer.d.ts.map +1 -0
  138. package/dist/esm/components/focusRing/components/FocusRingRenderer.js +25 -0
  139. package/dist/esm/components/focusRing/components/FocusRingSeparate.d.ts +40 -0
  140. package/dist/esm/components/focusRing/components/FocusRingSeparate.d.ts.map +1 -0
  141. package/dist/esm/components/focusRing/components/FocusRingSeparate.js +45 -0
  142. package/dist/esm/components/focusRing/focusRing.css +14 -0
  143. package/dist/esm/components/focusRing/focusRing.d.ts +35 -0
  144. package/dist/esm/components/focusRing/focusRing.d.ts.map +1 -0
  145. package/dist/esm/components/focusRing/focusRing.js +44 -0
  146. package/dist/esm/components/focusRing/focusRing.types.d.ts +40 -0
  147. package/dist/esm/components/focusRing/focusRing.types.d.ts.map +1 -0
  148. package/dist/esm/components/focusRing/focusRing.types.js +1 -0
  149. package/dist/esm/components/focusRing/hooks/useFocusRingData.d.ts +27 -0
  150. package/dist/esm/components/focusRing/hooks/useFocusRingData.d.ts.map +1 -0
  151. package/dist/esm/components/focusRing/hooks/useFocusRingData.js +67 -0
  152. package/dist/esm/components/focusRing/index.d.ts +3 -0
  153. package/dist/esm/components/focusRing/index.d.ts.map +1 -0
  154. package/dist/esm/components/focusRing/index.js +1 -0
  155. package/dist/esm/components/focusRing/utils/composeRefs.d.ts +7 -0
  156. package/dist/esm/components/focusRing/utils/composeRefs.d.ts.map +1 -0
  157. package/dist/esm/components/focusRing/utils/composeRefs.js +16 -0
  158. package/dist/esm/components/focusRing/utils/createAdaptiveFocusRings.d.ts +24 -0
  159. package/dist/esm/components/focusRing/utils/createAdaptiveFocusRings.d.ts.map +1 -0
  160. package/dist/esm/components/focusRing/utils/createAdaptiveFocusRings.js +141 -0
  161. package/dist/esm/components/focusRing/utils/createBoundingBoxFocusRings.d.ts +33 -0
  162. package/dist/esm/components/focusRing/utils/createBoundingBoxFocusRings.d.ts.map +1 -0
  163. package/dist/esm/components/focusRing/utils/createBoundingBoxFocusRings.js +126 -0
  164. package/dist/esm/components/focusRing/utils/utils.types.d.ts +52 -0
  165. package/dist/esm/components/focusRing/utils/utils.types.d.ts.map +1 -0
  166. package/dist/esm/components/focusRing/utils/utils.types.js +1 -0
  167. package/dist/esm/components/index.d.ts +1 -0
  168. package/dist/esm/components/index.d.ts.map +1 -1
  169. package/dist/esm/components/index.js +1 -0
  170. package/dist/esm/components/line/line.d.ts.map +1 -1
  171. package/dist/esm/components/line/line.js +2 -2
  172. package/dist/esm/components/line/line.types.d.ts +2 -0
  173. package/dist/esm/components/line/line.types.d.ts.map +1 -1
  174. package/dist/esm/components/node/node.d.ts.map +1 -1
  175. package/dist/esm/components/node/node.js +1 -1
  176. package/dist/esm/components/node/node.types.d.ts +2 -0
  177. package/dist/esm/components/node/node.types.d.ts.map +1 -1
  178. package/dist/esm/components/path/path.js +1 -1
  179. package/dist/esm/components/plot/plot.d.ts.map +1 -1
  180. package/dist/esm/components/plot/plot.js +7 -19
  181. package/dist/esm/components/zoomArea/components/SelectionArea.d.ts +3 -23
  182. package/dist/esm/components/zoomArea/components/SelectionArea.d.ts.map +1 -1
  183. package/dist/esm/components/zoomArea/components/SelectionArea.js +7 -39
  184. package/dist/esm/components/zoomArea/components/ZoomHandler.d.ts +3 -3
  185. package/dist/esm/components/zoomArea/components/ZoomHandler.d.ts.map +1 -1
  186. package/dist/esm/components/zoomArea/components/ZoomHandler.js +2 -15
  187. package/dist/esm/components/zoomArea/components/index.d.ts +1 -1
  188. package/dist/esm/components/zoomArea/components/index.d.ts.map +1 -1
  189. package/dist/esm/components/zoomArea/components/index.js +1 -1
  190. package/dist/esm/components/zoomArea/zoomArea.js +6 -6
  191. package/dist/esm/components/zoomArea/zoomArea.type.d.ts +1 -1
  192. package/dist/esm/components/zoomArea/zoomArea.type.d.ts.map +1 -1
  193. package/dist/esm/types/focusConfig.type.d.ts +15 -3
  194. package/dist/esm/types/focusConfig.type.d.ts.map +1 -1
  195. package/dist/esm/types/focusConfig.type.js +14 -1
  196. package/dist/esm/utils/pickCustomAttributes/pickCustomAttributes.d.ts +7 -6
  197. package/dist/esm/utils/pickCustomAttributes/pickCustomAttributes.d.ts.map +1 -1
  198. package/dist/esm/utils/pickCustomAttributes/pickCustomAttributes.js +8 -7
  199. package/dist/kubit-ui-web-react-charts.cjs.js +1 -1
  200. package/dist/kubit-ui-web-react-charts.es.js +1 -1
  201. package/dist/kubit-ui-web-react-charts.umd.js +1 -1
  202. package/dist/react-charts.css +1 -1
  203. package/dist/types/charts/lineChart/context/buildLineContextValue.d.ts +1 -3
  204. package/dist/types/charts/lineChart/context/buildLineContextValue.d.ts.map +1 -1
  205. package/dist/types/charts/lineChart/fragments/fixture/contextData.d.ts +2 -43
  206. package/dist/types/charts/lineChart/fragments/fixture/contextData.d.ts.map +1 -1
  207. package/dist/types/charts/lineChart/fragments/lineChartXAxis.d.ts.map +1 -1
  208. package/dist/types/charts/lineChart/fragments/lineChartYAxis.d.ts.map +1 -1
  209. package/dist/types/charts/lineChart/lineChart.type.d.ts +12 -7
  210. package/dist/types/charts/lineChart/lineChart.type.d.ts.map +1 -1
  211. package/dist/types/charts/lineChart/utils/getCoordinates.d.ts +25 -0
  212. package/dist/types/charts/lineChart/utils/getCoordinates.d.ts.map +1 -0
  213. package/dist/types/charts/lineChart/utils/getExtraSpacing.d.ts +1 -3
  214. package/dist/types/charts/lineChart/utils/getExtraSpacing.d.ts.map +1 -1
  215. package/dist/types/charts/lineChart/utils/getTicks.d.ts +21 -0
  216. package/dist/types/charts/lineChart/utils/getTicks.d.ts.map +1 -0
  217. package/dist/types/charts/lineChart/utils/handleNodesFocus.d.ts.map +1 -1
  218. package/dist/types/charts/lineChart/utils/tickTextPosition.d.ts +33 -0
  219. package/dist/types/charts/lineChart/utils/tickTextPosition.d.ts.map +1 -0
  220. package/dist/types/charts/lineChart/utils/validations.d.ts +54 -0
  221. package/dist/types/charts/lineChart/utils/validations.d.ts.map +1 -0
  222. package/dist/types/components/chartText/chartText.d.ts.map +1 -1
  223. package/dist/types/components/focusRing/components/FocusRingInline.d.ts +25 -0
  224. package/dist/types/components/focusRing/components/FocusRingInline.d.ts.map +1 -0
  225. package/dist/types/components/focusRing/components/FocusRingRenderer.d.ts +13 -0
  226. package/dist/types/components/focusRing/components/FocusRingRenderer.d.ts.map +1 -0
  227. package/dist/types/components/focusRing/components/FocusRingSeparate.d.ts +40 -0
  228. package/dist/types/components/focusRing/components/FocusRingSeparate.d.ts.map +1 -0
  229. package/dist/types/components/focusRing/focusRing.d.ts +34 -0
  230. package/dist/types/components/focusRing/focusRing.d.ts.map +1 -0
  231. package/dist/types/components/focusRing/focusRing.types.d.ts +40 -0
  232. package/dist/types/components/focusRing/focusRing.types.d.ts.map +1 -0
  233. package/dist/types/components/focusRing/hooks/useFocusRingData.d.ts +27 -0
  234. package/dist/types/components/focusRing/hooks/useFocusRingData.d.ts.map +1 -0
  235. package/dist/types/components/focusRing/index.d.ts +3 -0
  236. package/dist/types/components/focusRing/index.d.ts.map +1 -0
  237. package/dist/types/components/focusRing/utils/composeRefs.d.ts +7 -0
  238. package/dist/types/components/focusRing/utils/composeRefs.d.ts.map +1 -0
  239. package/dist/types/components/focusRing/utils/createAdaptiveFocusRings.d.ts +24 -0
  240. package/dist/types/components/focusRing/utils/createAdaptiveFocusRings.d.ts.map +1 -0
  241. package/dist/types/components/focusRing/utils/createBoundingBoxFocusRings.d.ts +33 -0
  242. package/dist/types/components/focusRing/utils/createBoundingBoxFocusRings.d.ts.map +1 -0
  243. package/dist/types/components/focusRing/utils/utils.types.d.ts +52 -0
  244. package/dist/types/components/focusRing/utils/utils.types.d.ts.map +1 -0
  245. package/dist/types/components/index.d.ts +1 -0
  246. package/dist/types/components/index.d.ts.map +1 -1
  247. package/dist/types/components/line/line.d.ts.map +1 -1
  248. package/dist/types/components/line/line.types.d.ts +2 -0
  249. package/dist/types/components/line/line.types.d.ts.map +1 -1
  250. package/dist/types/components/node/node.d.ts.map +1 -1
  251. package/dist/types/components/node/node.types.d.ts +2 -0
  252. package/dist/types/components/node/node.types.d.ts.map +1 -1
  253. package/dist/types/components/plot/plot.d.ts.map +1 -1
  254. package/dist/types/components/zoomArea/components/SelectionArea.d.ts +3 -23
  255. package/dist/types/components/zoomArea/components/SelectionArea.d.ts.map +1 -1
  256. package/dist/types/components/zoomArea/components/ZoomHandler.d.ts +3 -3
  257. package/dist/types/components/zoomArea/components/ZoomHandler.d.ts.map +1 -1
  258. package/dist/types/components/zoomArea/components/index.d.ts +1 -1
  259. package/dist/types/components/zoomArea/components/index.d.ts.map +1 -1
  260. package/dist/types/components/zoomArea/zoomArea.type.d.ts +1 -1
  261. package/dist/types/components/zoomArea/zoomArea.type.d.ts.map +1 -1
  262. package/dist/types/types/focusConfig.type.d.ts +15 -3
  263. package/dist/types/types/focusConfig.type.d.ts.map +1 -1
  264. package/dist/types/utils/pickCustomAttributes/pickCustomAttributes.d.ts +7 -6
  265. package/dist/types/utils/pickCustomAttributes/pickCustomAttributes.d.ts.map +1 -1
  266. package/package.json +1 -1
  267. package/dist/cjs/utils/calculateFocusOutline/calculateFocusOutline.d.ts +0 -73
  268. package/dist/cjs/utils/calculateFocusOutline/calculateFocusOutline.d.ts.map +0 -1
  269. package/dist/cjs/utils/calculateFocusOutline/calculateFocusOutline.js +0 -80
  270. package/dist/esm/utils/calculateFocusOutline/calculateFocusOutline.d.ts +0 -73
  271. package/dist/esm/utils/calculateFocusOutline/calculateFocusOutline.d.ts.map +0 -1
  272. package/dist/esm/utils/calculateFocusOutline/calculateFocusOutline.js +0 -80
  273. package/dist/types/utils/calculateFocusOutline/calculateFocusOutline.d.ts +0 -73
  274. package/dist/types/utils/calculateFocusOutline/calculateFocusOutline.d.ts.map +0 -1
@@ -1,5 +1,4 @@
1
- import { FC, KeyboardEvent, MouseEvent, TouchEvent } from '../../../../node_modules/react';
2
- import { FocusConfig } from '../../../types/focusConfig.type';
1
+ import { KeyboardEvent, MouseEvent, TouchEvent } from '../../../../node_modules/react';
3
2
  import { ZoomAreaSelectionConfig, ZoomRange } from '../zoomArea.type';
4
3
  /**
5
4
 
@@ -31,27 +30,8 @@ interface SelectionAreaProps {
31
30
  onBlur: () => void;
32
31
  }
33
32
  /**
34
- * Props for the SelectionAreaFocusRing component
33
+ * Selection area overlay - the interactive rectangle that users can drag and focus
35
34
  */
36
- interface SelectionAreaFocusRingProps {
37
- /** Start X position */
38
- startX: number;
39
- /** End X position */
40
- endX: number;
41
- /** Chart height */
42
- height: number;
43
- /** Whether the selection area is focused */
44
- isFocused: boolean;
45
- /** Custom focus configuration (already resolved) */
46
- focusConfig: Required<FocusConfig>;
47
- }
48
- /**
49
- * Focus ring for the selection area - rendered separately to control z-order
50
- */
51
- export declare const SelectionAreaFocusRing: FC<SelectionAreaFocusRingProps>;
52
- /**
53
- * Selection area overlay
54
- */
55
- export declare const SelectionArea: FC<SelectionAreaProps>;
35
+ export declare const SelectionArea: import('../../../../node_modules/react').ForwardRefExoticComponent<SelectionAreaProps & import('../../../../node_modules/react').RefAttributes<SVGRectElement>>;
56
36
  export {};
57
37
  //# sourceMappingURL=SelectionArea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionArea.d.ts","sourceRoot":"","sources":["../../../../../src/components/zoomArea/components/SelectionArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;;;GAIG;AACH,UAAU,kBAAkB;IAC1B,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,YAAY,EAAE,SAAS,CAAC;IACxB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,eAAe,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IACnD,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB;IACrB,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,YAAY,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;GAEG;AACH,UAAU,2BAA2B;IACnC,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,oDAAoD;IACpD,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CA+DlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAqDhD,CAAC"}
1
+ {"version":3,"file":"SelectionArea.d.ts","sourceRoot":"","sources":["../../../../../src/components/zoomArea/components/SelectionArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAc,MAAM,OAAO,CAAC;AAGzF,OAAO,KAAK,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;;;GAIG;AACH,UAAU,kBAAkB;IAC1B,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,YAAY,EAAE,SAAS,CAAC;IACxB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,eAAe,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IACnD,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB;IACrB,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,YAAY,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,+GA2DzB,CAAC"}
@@ -17,12 +17,12 @@ interface ZoomHandlerProps {
17
17
  min: number;
18
18
  /** Maximum allowed value */
19
19
  max: number;
20
- /** Whether this handler is focused */
20
+ /** Whether the handler is focused (controlled mode) */
21
21
  isFocused: boolean;
22
22
  /** Custom handler configuration */
23
23
  handlerConfig?: ZoomAreaHandlerConfig;
24
- /** Custom focus configuration (already resolved) */
25
- focusConfig: Required<FocusConfig>;
24
+ /** Focus ring configuration */
25
+ focusConfig?: FocusConfig;
26
26
  /** Text announced by screen readers */
27
27
  screenReaderText?: string;
28
28
  /** Data test ID */
@@ -1 +1 @@
1
- {"version":3,"file":"ZoomHandler.d.ts","sourceRoot":"","sources":["../../../../../src/components/zoomArea/components/ZoomHandler.tsx"],"names":[],"mappings":"AAAA,OAAO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
3
- export { SelectionArea, SelectionAreaFocusRing } from './SelectionArea';
3
+ export { SelectionArea } from './SelectionArea';
4
4
  export { ZoomHandler } from './ZoomHandler';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/zoomArea/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/zoomArea/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -121,7 +121,7 @@ export interface ZoomAreaProps {
121
121
  /** Custom selection area configuration */
122
122
  selectionConfig?: ZoomAreaSelectionConfig;
123
123
  /** Custom focus configuration applied to all focusable elements */
124
- focusConfig?: FocusConfig;
124
+ focusConfig?: Omit<FocusConfig, 'variant'>;
125
125
  /** Configuration for interaction behavior (keyboard navigation, handler distances) */
126
126
  interactionConfig?: ZoomAreaInteractionConfig;
127
127
  /** Configuration for accessibility label templates */
@@ -1 +1 @@
1
- {"version":3,"file":"zoomArea.type.d.ts","sourceRoot":"","sources":["../../../../src/components/zoomArea/zoomArea.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AA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,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;CAC/D"}
1
+ {"version":3,"file":"zoomArea.type.d.ts","sourceRoot":"","sources":["../../../../src/components/zoomArea/zoomArea.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,kBAAkB,CAAC,E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AC,UAAU,CAAC,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACvD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;CAC/D"}
@@ -3,16 +3,22 @@
3
3
  *
4
4
  * - `outlineColor` - Color of the outer outline when focused. Defaults to #0078D7.
5
5
  * - `outlineStrokeWidth` - Stroke width of the outer outline. Defaults to 2.
6
- * - `innerStrokeColor` - Color of the inner outline when focused. Defaults to #FFFFFF.
6
+ * - `innerColor` - Color of the inner outline when focused. Defaults to #FFFFFF.
7
7
  * - `innerStrokeWidth` - Stroke width of the inner outline. Defaults to 2.
8
- * - `gap` - Gap between the inner and outer outline. Defaults to 0.
8
+ * - `gap` - Gap between the element and the focus rings. Defaults to 0.
9
+ * Note: Only applies when variant is 'bounding-box'. Ignored in 'adaptive' mode.
10
+ * - `variant` - Focus ring rendering mode. Defaults to 'adaptive'.
11
+ * - 'adaptive': Ring follows the exact shape of the element (circle → circular ring, path → path ring)
12
+ * - 'bounding-box': Ring is always rectangular, wrapping the element's bounding box
9
13
  */
10
14
  export interface FocusConfig {
11
15
  outlineColor?: string;
12
16
  outlineStrokeWidth?: number;
13
17
  innerColor?: string;
14
18
  innerStrokeWidth?: number;
19
+ /** Only applicable when variant is 'bounding-box' */
15
20
  gap?: number;
21
+ variant?: 'adaptive' | 'bounding-box';
16
22
  }
17
23
  export declare const FOCUS_DEFAULT: {
18
24
  /** Focus ring color */
@@ -23,7 +29,13 @@ export declare const FOCUS_DEFAULT: {
23
29
  readonly INNER_FOCUS_STROKE_WIDTH: 2;
24
30
  /** Focus ring outer stroke width */
25
31
  readonly OUTER_FOCUS_STROKE_WIDTH: 2;
26
- /** Gap between element and outlines */
32
+ /** Gap between element and outlines (only applies in bounding-box variant) */
27
33
  readonly OUTLINES_GAP: 0;
34
+ /** Focus ring rendering variant */
35
+ readonly VARIANT: "adaptive";
28
36
  };
37
+ /**
38
+ * Helper function to get complete focus config with defaults applied
39
+ */
40
+ export declare const getFocusConfig: (focusConfig?: FocusConfig) => Required<FocusConfig>;
29
41
  //# sourceMappingURL=focusConfig.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"focusConfig.type.d.ts","sourceRoot":"","sources":["../../../src/types/focusConfig.type.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,aAAa;IACxB,uBAAuB;;IAEvB,8BAA8B;;IAE9B,oCAAoC;;IAEpC,oCAAoC;;IAEpC,uCAAuC;;CAE/B,CAAC"}
1
+ {"version":3,"file":"focusConfig.type.d.ts","sourceRoot":"","sources":["../../../src/types/focusConfig.type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,UAAU,GAAG,cAAc,CAAC;CACvC;AAED,eAAO,MAAM,aAAa;IACxB,uBAAuB;;IAEvB,8BAA8B;;IAE9B,oCAAoC;;IAEpC,oCAAoC;;IAEpC,8EAA8E;;IAE9E,mCAAmC;;CAE3B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,cAAc,WAAW,KAAG,QAAQ,CAAC,WAAW,CAO7E,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Filters and extracts only aria-* and data-* attributes from a given object,
2
+ * Filters and extracts only aria-*, data-* and role attributes from a given object,
3
3
  * converting all values to strings for HTML compatibility.
4
4
  *
5
5
  * This function is useful for extracting accessibility and data attributes
@@ -10,8 +10,8 @@
10
10
  * - Keys can be strings representing attribute names.
11
11
  * - Values can be strings, booleans, numbers, or any other type.
12
12
  *
13
- * @returns A new object containing only aria-* and data-* attributes:
14
- * - Only includes attributes that start with `aria-` or `data-`.
13
+ * @returns A new object containing only aria-*, data-* and role attributes:
14
+ * - Only includes attributes that start with `aria-` or `data-` or are exactly `role`.
15
15
  * - All values are converted to strings for HTML compatibility.
16
16
  * - Null and undefined values are excluded.
17
17
  *
@@ -20,13 +20,14 @@
20
20
  * const props = {
21
21
  * 'aria-label': 'Button',
22
22
  * 'data-testid': 'my-button',
23
- * 'onClick': () => {},
23
+ * 'onClick': () => {},g
24
24
  * 'className': 'btn',
25
- * 'aria-hidden': true
25
+ * 'aria-hidden': true,
26
+ * 'role': 'button',
26
27
  * };
27
28
  *
28
29
  * const result = pickCustomAttributes(props);
29
- * // Result: { 'aria-label': 'Button', 'data-testid': 'my-button', 'aria-hidden': 'true' }
30
+ * // Result: { 'aria-label': 'Button', 'data-testid': 'my-button', 'aria-hidden': 'true', 'role': 'button' }
30
31
  * ```
31
32
  */
32
33
  export declare const pickCustomAttributes: (attributes?: Record<string, any>) => Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"pickCustomAttributes.d.ts","sourceRoot":"","sources":["../../../../src/utils/pickCustomAttributes/pickCustomAttributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,oBAAoB,GAE/B,aAAa,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAkBvB,CAAC"}
1
+ {"version":3,"file":"pickCustomAttributes.d.ts","sourceRoot":"","sources":["../../../../src/utils/pickCustomAttributes/pickCustomAttributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,oBAAoB,GAE/B,aAAa,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAkBvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubit-ui-web/react-charts",
3
- "version": "1.5.1",
3
+ "version": "1.7.0",
4
4
  "private": false,
5
5
  "main": "dist/kubit-ui-web-react-charts.cjs.js",
6
6
  "module": "dist/kubit-ui-web-react-charts.es.js",
@@ -1,73 +0,0 @@
1
- import { type FocusConfig } from '../../types/focusConfig.type';
2
- export interface FocusOutlineConfig {
3
- /** Type of element for focus calculation */
4
- elementType: 'circle' | 'rectangle';
5
- /** Element width in pixels */
6
- elementWidth: number;
7
- /** Element height in pixels */
8
- elementHeight: number;
9
- /** Position of the element center */
10
- elementPosition: {
11
- x: number;
12
- y: number;
13
- };
14
- /** Stroke width of the element */
15
- elementStrokeWidth?: number;
16
- /** Stroke width of the outer focus outline */
17
- outlineStrokeWidth?: number;
18
- /** Stroke width of the inner focus outline */
19
- innerStrokeWidth?: number;
20
- /** Gap between the outer and inner outlines */
21
- gap?: number;
22
- }
23
- /**
24
- * Dimensions for circle focus outlines
25
- */
26
- export interface CircleFocusOutline {
27
- type: 'circle';
28
- outer: {
29
- cx: number;
30
- cy: number;
31
- r: number;
32
- };
33
- inner: {
34
- cx: number;
35
- cy: number;
36
- r: number;
37
- };
38
- }
39
- /**
40
- * Dimensions for rectangle focus outlines
41
- */
42
- export interface RectangleFocusOutline {
43
- type: 'rectangle';
44
- outer: {
45
- x: number;
46
- y: number;
47
- width: number;
48
- height: number;
49
- };
50
- inner: {
51
- x: number;
52
- y: number;
53
- width: number;
54
- height: number;
55
- };
56
- }
57
- /**
58
- * Union type for focus outline results
59
- */
60
- export type FocusOutlineDimensions = CircleFocusOutline | RectangleFocusOutline;
61
- /**
62
- * Calculates the dimensions of the focus outlines (outer and inner) for an SVG element.
63
- * Supports elements with different width and height dimensions.
64
- *
65
- * @param config - Configuration for the calculation.
66
- * @returns Object with the dimensions and positions of the outer and inner rectangles.
67
- */
68
- export declare const calculateFocusOutline: ({ elementHeight, elementPosition, elementStrokeWidth, elementType, elementWidth, gap, innerStrokeWidth, outlineStrokeWidth, }: FocusOutlineConfig) => FocusOutlineDimensions;
69
- /**
70
- * Helper function to get focus complete config
71
- */
72
- export declare const getFocusConfig: (focusConfig?: FocusConfig) => Required<FocusConfig>;
73
- //# sourceMappingURL=calculateFocusOutline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateFocusOutline.d.ts","sourceRoot":"","sources":["../../../../src/utils/calculateFocusOutline/calculateFocusOutline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAC;IACpC,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,eAAe,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,kCAAkC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;IACF,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AAEhF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,+HASnC,kBAAkB,KAAG,sBAmEvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,cAAc,WAAW,KAAG,QAAQ,CAAC,WAAW,CAM7E,CAAC"}
@@ -1,80 +0,0 @@
1
- import { FOCUS_DEFAULT } from '../../types/focusConfig.type';
2
- /**
3
- * Calculates the dimensions of the focus outlines (outer and inner) for an SVG element.
4
- * Supports elements with different width and height dimensions.
5
- *
6
- * @param config - Configuration for the calculation.
7
- * @returns Object with the dimensions and positions of the outer and inner rectangles.
8
- */
9
- export const calculateFocusOutline = ({ elementHeight, elementPosition, elementStrokeWidth = 0, elementType, elementWidth, gap = 0, innerStrokeWidth = 2, outlineStrokeWidth = 2, }) => {
10
- if (elementType === 'circle') {
11
- // For circles, work with radius
12
- const elementRadius = elementWidth / 2;
13
- // Calculate inner circle radius
14
- // Position inner circle adjacent to the inner edge of the outer stroke (no gap)
15
- // The element's stroke extends strokeWidth/2 outward from the element edge
16
- // The same happens for the inner stroke
17
- // This ensures the inner circle is positioned correctly without gaps
18
- const innerRadius = elementRadius + elementStrokeWidth / 2 + innerStrokeWidth / 2 + gap;
19
- // Calculate outer circle radius
20
- // Position outer ring completely outside the element and the inner stroke
21
- // The element's stroke extends strokeWidth/2 outward from the element edge
22
- // The inner stroke is added to ensure the outer ring is clearly visible
23
- // The outline stroke / 2 is added to ensure the outer ring is clearly visible
24
- const outerRadius = innerRadius + innerStrokeWidth / 2 + outlineStrokeWidth / 2;
25
- return {
26
- inner: {
27
- cx: elementPosition.x,
28
- cy: elementPosition.y,
29
- r: innerRadius,
30
- },
31
- outer: {
32
- cx: elementPosition.x,
33
- cy: elementPosition.y,
34
- r: outerRadius,
35
- },
36
- type: 'circle',
37
- };
38
- }
39
- // Calculate inner rectangle dimensions
40
- // Here we have to take into account that height and width must grow in both sides
41
- // to ensure the inner rectangle is positioned correctly without gaps
42
- // that is why here we do not divide by 2
43
- const innerWidth = elementWidth + elementStrokeWidth + innerStrokeWidth + gap * 2;
44
- const innerHeight = elementHeight + elementStrokeWidth + innerStrokeWidth + gap * 2;
45
- const innerX = elementPosition.x - innerWidth / 2;
46
- const innerY = elementPosition.y - innerHeight / 2;
47
- // Calculate outer rectangle dimensions
48
- // Must account for the fact that both inner and outer strokes extend outward from their borders
49
- // Inner stroke extends innerStrokeWidth/2 on each side, outer stroke extends outlineStrokeWidth/2 on each side
50
- // We also take into account if some gap between outlines is wanted
51
- const outerWidth = innerWidth + innerStrokeWidth + outlineStrokeWidth;
52
- const outerHeight = innerHeight + innerStrokeWidth + outlineStrokeWidth;
53
- const outerX = elementPosition.x - outerWidth / 2;
54
- const outerY = elementPosition.y - outerHeight / 2;
55
- return {
56
- inner: {
57
- height: innerHeight,
58
- width: innerWidth,
59
- x: innerX,
60
- y: innerY,
61
- },
62
- outer: {
63
- height: outerHeight,
64
- width: outerWidth,
65
- x: outerX,
66
- y: outerY,
67
- },
68
- type: 'rectangle',
69
- };
70
- };
71
- /**
72
- * Helper function to get focus complete config
73
- */
74
- export const getFocusConfig = (focusConfig) => ({
75
- gap: focusConfig?.gap ?? FOCUS_DEFAULT.OUTLINES_GAP,
76
- innerColor: focusConfig?.innerColor ?? FOCUS_DEFAULT.FOCUS_INNER,
77
- innerStrokeWidth: focusConfig?.innerStrokeWidth ?? FOCUS_DEFAULT.INNER_FOCUS_STROKE_WIDTH,
78
- outlineColor: focusConfig?.outlineColor ?? FOCUS_DEFAULT.FOCUS_COLOR,
79
- outlineStrokeWidth: focusConfig?.outlineStrokeWidth ?? FOCUS_DEFAULT.OUTER_FOCUS_STROKE_WIDTH,
80
- });
@@ -1,73 +0,0 @@
1
- import { type FocusConfig } from '../../types/focusConfig.type';
2
- export interface FocusOutlineConfig {
3
- /** Type of element for focus calculation */
4
- elementType: 'circle' | 'rectangle';
5
- /** Element width in pixels */
6
- elementWidth: number;
7
- /** Element height in pixels */
8
- elementHeight: number;
9
- /** Position of the element center */
10
- elementPosition: {
11
- x: number;
12
- y: number;
13
- };
14
- /** Stroke width of the element */
15
- elementStrokeWidth?: number;
16
- /** Stroke width of the outer focus outline */
17
- outlineStrokeWidth?: number;
18
- /** Stroke width of the inner focus outline */
19
- innerStrokeWidth?: number;
20
- /** Gap between the outer and inner outlines */
21
- gap?: number;
22
- }
23
- /**
24
- * Dimensions for circle focus outlines
25
- */
26
- export interface CircleFocusOutline {
27
- type: 'circle';
28
- outer: {
29
- cx: number;
30
- cy: number;
31
- r: number;
32
- };
33
- inner: {
34
- cx: number;
35
- cy: number;
36
- r: number;
37
- };
38
- }
39
- /**
40
- * Dimensions for rectangle focus outlines
41
- */
42
- export interface RectangleFocusOutline {
43
- type: 'rectangle';
44
- outer: {
45
- x: number;
46
- y: number;
47
- width: number;
48
- height: number;
49
- };
50
- inner: {
51
- x: number;
52
- y: number;
53
- width: number;
54
- height: number;
55
- };
56
- }
57
- /**
58
- * Union type for focus outline results
59
- */
60
- export type FocusOutlineDimensions = CircleFocusOutline | RectangleFocusOutline;
61
- /**
62
- * Calculates the dimensions of the focus outlines (outer and inner) for an SVG element.
63
- * Supports elements with different width and height dimensions.
64
- *
65
- * @param config - Configuration for the calculation.
66
- * @returns Object with the dimensions and positions of the outer and inner rectangles.
67
- */
68
- export declare const calculateFocusOutline: ({ elementHeight, elementPosition, elementStrokeWidth, elementType, elementWidth, gap, innerStrokeWidth, outlineStrokeWidth, }: FocusOutlineConfig) => FocusOutlineDimensions;
69
- /**
70
- * Helper function to get focus complete config
71
- */
72
- export declare const getFocusConfig: (focusConfig?: FocusConfig) => Required<FocusConfig>;
73
- //# sourceMappingURL=calculateFocusOutline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateFocusOutline.d.ts","sourceRoot":"","sources":["../../../../src/utils/calculateFocusOutline/calculateFocusOutline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAC;IACpC,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,eAAe,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,kCAAkC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;IACF,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AAEhF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,+HASnC,kBAAkB,KAAG,sBAmEvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,cAAc,WAAW,KAAG,QAAQ,CAAC,WAAW,CAM7E,CAAC"}
@@ -1,80 +0,0 @@
1
- import { FOCUS_DEFAULT } from '../../types/focusConfig.type';
2
- /**
3
- * Calculates the dimensions of the focus outlines (outer and inner) for an SVG element.
4
- * Supports elements with different width and height dimensions.
5
- *
6
- * @param config - Configuration for the calculation.
7
- * @returns Object with the dimensions and positions of the outer and inner rectangles.
8
- */
9
- export const calculateFocusOutline = ({ elementHeight, elementPosition, elementStrokeWidth = 0, elementType, elementWidth, gap = 0, innerStrokeWidth = 2, outlineStrokeWidth = 2, }) => {
10
- if (elementType === 'circle') {
11
- // For circles, work with radius
12
- const elementRadius = elementWidth / 2;
13
- // Calculate inner circle radius
14
- // Position inner circle adjacent to the inner edge of the outer stroke (no gap)
15
- // The element's stroke extends strokeWidth/2 outward from the element edge
16
- // The same happens for the inner stroke
17
- // This ensures the inner circle is positioned correctly without gaps
18
- const innerRadius = elementRadius + elementStrokeWidth / 2 + innerStrokeWidth / 2 + gap;
19
- // Calculate outer circle radius
20
- // Position outer ring completely outside the element and the inner stroke
21
- // The element's stroke extends strokeWidth/2 outward from the element edge
22
- // The inner stroke is added to ensure the outer ring is clearly visible
23
- // The outline stroke / 2 is added to ensure the outer ring is clearly visible
24
- const outerRadius = innerRadius + innerStrokeWidth / 2 + outlineStrokeWidth / 2;
25
- return {
26
- inner: {
27
- cx: elementPosition.x,
28
- cy: elementPosition.y,
29
- r: innerRadius,
30
- },
31
- outer: {
32
- cx: elementPosition.x,
33
- cy: elementPosition.y,
34
- r: outerRadius,
35
- },
36
- type: 'circle',
37
- };
38
- }
39
- // Calculate inner rectangle dimensions
40
- // Here we have to take into account that height and width must grow in both sides
41
- // to ensure the inner rectangle is positioned correctly without gaps
42
- // that is why here we do not divide by 2
43
- const innerWidth = elementWidth + elementStrokeWidth + innerStrokeWidth + gap * 2;
44
- const innerHeight = elementHeight + elementStrokeWidth + innerStrokeWidth + gap * 2;
45
- const innerX = elementPosition.x - innerWidth / 2;
46
- const innerY = elementPosition.y - innerHeight / 2;
47
- // Calculate outer rectangle dimensions
48
- // Must account for the fact that both inner and outer strokes extend outward from their borders
49
- // Inner stroke extends innerStrokeWidth/2 on each side, outer stroke extends outlineStrokeWidth/2 on each side
50
- // We also take into account if some gap between outlines is wanted
51
- const outerWidth = innerWidth + innerStrokeWidth + outlineStrokeWidth;
52
- const outerHeight = innerHeight + innerStrokeWidth + outlineStrokeWidth;
53
- const outerX = elementPosition.x - outerWidth / 2;
54
- const outerY = elementPosition.y - outerHeight / 2;
55
- return {
56
- inner: {
57
- height: innerHeight,
58
- width: innerWidth,
59
- x: innerX,
60
- y: innerY,
61
- },
62
- outer: {
63
- height: outerHeight,
64
- width: outerWidth,
65
- x: outerX,
66
- y: outerY,
67
- },
68
- type: 'rectangle',
69
- };
70
- };
71
- /**
72
- * Helper function to get focus complete config
73
- */
74
- export const getFocusConfig = (focusConfig) => ({
75
- gap: focusConfig?.gap ?? FOCUS_DEFAULT.OUTLINES_GAP,
76
- innerColor: focusConfig?.innerColor ?? FOCUS_DEFAULT.FOCUS_INNER,
77
- innerStrokeWidth: focusConfig?.innerStrokeWidth ?? FOCUS_DEFAULT.INNER_FOCUS_STROKE_WIDTH,
78
- outlineColor: focusConfig?.outlineColor ?? FOCUS_DEFAULT.FOCUS_COLOR,
79
- outlineStrokeWidth: focusConfig?.outlineStrokeWidth ?? FOCUS_DEFAULT.OUTER_FOCUS_STROKE_WIDTH,
80
- });
@@ -1,73 +0,0 @@
1
- import { FocusConfig } from '../../types/focusConfig.type';
2
- export interface FocusOutlineConfig {
3
- /** Type of element for focus calculation */
4
- elementType: 'circle' | 'rectangle';
5
- /** Element width in pixels */
6
- elementWidth: number;
7
- /** Element height in pixels */
8
- elementHeight: number;
9
- /** Position of the element center */
10
- elementPosition: {
11
- x: number;
12
- y: number;
13
- };
14
- /** Stroke width of the element */
15
- elementStrokeWidth?: number;
16
- /** Stroke width of the outer focus outline */
17
- outlineStrokeWidth?: number;
18
- /** Stroke width of the inner focus outline */
19
- innerStrokeWidth?: number;
20
- /** Gap between the outer and inner outlines */
21
- gap?: number;
22
- }
23
- /**
24
- * Dimensions for circle focus outlines
25
- */
26
- export interface CircleFocusOutline {
27
- type: 'circle';
28
- outer: {
29
- cx: number;
30
- cy: number;
31
- r: number;
32
- };
33
- inner: {
34
- cx: number;
35
- cy: number;
36
- r: number;
37
- };
38
- }
39
- /**
40
- * Dimensions for rectangle focus outlines
41
- */
42
- export interface RectangleFocusOutline {
43
- type: 'rectangle';
44
- outer: {
45
- x: number;
46
- y: number;
47
- width: number;
48
- height: number;
49
- };
50
- inner: {
51
- x: number;
52
- y: number;
53
- width: number;
54
- height: number;
55
- };
56
- }
57
- /**
58
- * Union type for focus outline results
59
- */
60
- export type FocusOutlineDimensions = CircleFocusOutline | RectangleFocusOutline;
61
- /**
62
- * Calculates the dimensions of the focus outlines (outer and inner) for an SVG element.
63
- * Supports elements with different width and height dimensions.
64
- *
65
- * @param config - Configuration for the calculation.
66
- * @returns Object with the dimensions and positions of the outer and inner rectangles.
67
- */
68
- export declare const calculateFocusOutline: ({ elementHeight, elementPosition, elementStrokeWidth, elementType, elementWidth, gap, innerStrokeWidth, outlineStrokeWidth, }: FocusOutlineConfig) => FocusOutlineDimensions;
69
- /**
70
- * Helper function to get focus complete config
71
- */
72
- export declare const getFocusConfig: (focusConfig?: FocusConfig) => Required<FocusConfig>;
73
- //# sourceMappingURL=calculateFocusOutline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateFocusOutline.d.ts","sourceRoot":"","sources":["../../../../src/utils/calculateFocusOutline/calculateFocusOutline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAC;IACpC,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,eAAe,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,kCAAkC;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM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