@kubit-ui-web/react-charts 1.0.0 → 1.1.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 (178) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/charts/barChart/barChart.js +12 -29
  3. package/dist/cjs/charts/barChart/barChart.type.js +1 -2
  4. package/dist/cjs/charts/barChart/barChartStructure.js +25 -29
  5. package/dist/cjs/charts/barChart/context/barChartContext.js +2 -5
  6. package/dist/cjs/charts/barChart/context/buildBarContextValues.js +17 -21
  7. package/dist/cjs/charts/barChart/fragments/barChartPath.js +12 -16
  8. package/dist/cjs/charts/barChart/fragments/barChartSeparator.js +10 -14
  9. package/dist/cjs/charts/barChart/fragments/barChartXAxis.js +10 -14
  10. package/dist/cjs/charts/barChart/fragments/barChartYAxis.js +13 -17
  11. package/dist/cjs/charts/barChart/fragments/fixture/barContextData.js +3 -6
  12. package/dist/cjs/charts/barChart/fragments/fixture/index.js +1 -5
  13. package/dist/cjs/charts/barChart/index.js +1 -17
  14. package/dist/cjs/charts/barChart/utils/countBarChildren.js +5 -9
  15. package/dist/cjs/charts/barChart/utils/getAxisExtraSpacing.js +31 -35
  16. package/dist/cjs/charts/barChart/utils/getBarDataValue.js +1 -5
  17. package/dist/cjs/charts/barChart/utils/getRoundedBarMaxValue.js +1 -5
  18. package/dist/cjs/charts/index.js +3 -19
  19. package/dist/cjs/charts/lineChart/context/buildLineContextValue.js +17 -21
  20. package/dist/cjs/charts/lineChart/context/index.js +2 -7
  21. package/dist/cjs/charts/lineChart/context/lineChartContext.js +2 -5
  22. package/dist/cjs/charts/lineChart/fragments/fixture/contextData.js +1 -4
  23. package/dist/cjs/charts/lineChart/fragments/fixture/index.js +1 -5
  24. package/dist/cjs/charts/lineChart/fragments/index.js +4 -11
  25. package/dist/cjs/charts/lineChart/fragments/lineChartPath.js +31 -35
  26. package/dist/cjs/charts/lineChart/fragments/lineChartProjection.js +6 -10
  27. package/dist/cjs/charts/lineChart/fragments/lineChartSeparator.js +10 -14
  28. package/dist/cjs/charts/lineChart/fragments/lineChartXAxis.js +14 -18
  29. package/dist/cjs/charts/lineChart/fragments/lineChartYAxis.js +17 -21
  30. package/dist/cjs/charts/lineChart/hook/index.js +3 -9
  31. package/dist/cjs/charts/lineChart/hook/useAutoClick.js +6 -10
  32. package/dist/cjs/charts/lineChart/hook/useHover.js +5 -9
  33. package/dist/cjs/charts/lineChart/hook/useIndicator.js +5 -9
  34. package/dist/cjs/charts/lineChart/index.js +1 -17
  35. package/dist/cjs/charts/lineChart/lineChart.js +12 -29
  36. package/dist/cjs/charts/lineChart/lineChart.type.js +1 -2
  37. package/dist/cjs/charts/lineChart/lineChartStructure.js +34 -38
  38. package/dist/cjs/charts/lineChart/utils/accessibilityTemplateProcessor.js +6 -10
  39. package/dist/cjs/charts/lineChart/utils/findSurroundingNumber.js +2 -7
  40. package/dist/cjs/charts/lineChart/utils/getDataValues.js +1 -5
  41. package/dist/cjs/charts/lineChart/utils/getExtraSpacing.js +26 -30
  42. package/dist/cjs/charts/lineChart/utils/getPathData.js +1 -5
  43. package/dist/cjs/charts/lineChart/utils/getProjection.js +1 -5
  44. package/dist/cjs/charts/lineChart/utils/getRoundedMaxValue.js +2 -7
  45. package/dist/cjs/charts/lineChart/utils/handleNodesFocus.js +1 -5
  46. package/dist/cjs/charts/lineChart/utils/index.js +6 -17
  47. package/dist/cjs/charts/pieChart/context/buildPieContextValue.js +8 -12
  48. package/dist/cjs/charts/pieChart/context/index.js +2 -7
  49. package/dist/cjs/charts/pieChart/context/pieChartContext.js +2 -5
  50. package/dist/cjs/charts/pieChart/fragments/index.js +2 -7
  51. package/dist/cjs/charts/pieChart/fragments/pieChartForeign.js +7 -11
  52. package/dist/cjs/charts/pieChart/fragments/pieChartPath.js +12 -16
  53. package/dist/cjs/charts/pieChart/fragments/pieChartSegment.js +6 -10
  54. package/dist/cjs/charts/pieChart/index.js +1 -17
  55. package/dist/cjs/charts/pieChart/pieChart.js +8 -25
  56. package/dist/cjs/charts/pieChart/pieChart.type.js +1 -2
  57. package/dist/cjs/charts/pieChart/pieChartStructure.js +16 -20
  58. package/dist/cjs/charts/pieChart/utils/buildL.js +1 -5
  59. package/dist/cjs/charts/pieChart/utils/calculatePoint.js +1 -5
  60. package/dist/cjs/charts/pieChart/utils/calculateSegmentPath.js +10 -14
  61. package/dist/cjs/charts/pieChart/utils/drawSegmentPath.js +6 -10
  62. package/dist/cjs/charts/pieChart/utils/index.js +2 -7
  63. package/dist/cjs/charts/pieChart/utils/rotationDirection.js +3 -7
  64. package/dist/cjs/components/axisChart/index.js +2 -18
  65. package/dist/cjs/components/axisChart/utils/filterLineProps/filterLineProps.js +1 -5
  66. package/dist/cjs/components/axisChart/utils/index.js +1 -17
  67. package/dist/cjs/components/axisChart/xAxis/index.js +2 -18
  68. package/dist/cjs/components/axisChart/xAxis/xAxis.js +14 -18
  69. package/dist/cjs/components/axisChart/xAxis/xAxis.types.js +1 -2
  70. package/dist/cjs/components/axisChart/yAxis/index.js +2 -18
  71. package/dist/cjs/components/axisChart/yAxis/yAxis.js +13 -17
  72. package/dist/cjs/components/axisChart/yAxis/yAxis.types.js +1 -2
  73. package/dist/cjs/components/bar/bar.js +9 -13
  74. package/dist/cjs/components/bar/bar.type.js +1 -4
  75. package/dist/cjs/components/bar/fragments/barChartSegment.js +3 -7
  76. package/dist/cjs/components/bar/index.js +2 -18
  77. package/dist/cjs/components/bar/utils/buildD.js +5 -9
  78. package/dist/cjs/components/bar/utils/getSegments.js +3 -7
  79. package/dist/cjs/components/chartText/chartText.js +3 -7
  80. package/dist/cjs/components/chartText/chartText.types.js +1 -2
  81. package/dist/cjs/components/chartText/index.js +2 -18
  82. package/dist/cjs/components/foreignObject/foreignObject.js +3 -7
  83. package/dist/cjs/components/foreignObject/foreignObject.types.js +1 -2
  84. package/dist/cjs/components/foreignObject/index.js +2 -18
  85. package/dist/cjs/components/index.js +10 -26
  86. package/dist/cjs/components/line/index.js +2 -18
  87. package/dist/cjs/components/line/line.js +3 -7
  88. package/dist/cjs/components/line/line.types.js +1 -2
  89. package/dist/cjs/components/node/components/circle/circle.js +4 -7
  90. package/dist/cjs/components/node/components/hexagon/hexagon.js +6 -9
  91. package/dist/cjs/components/node/components/pentagon/pentagon.js +6 -9
  92. package/dist/cjs/components/node/components/square/square.js +4 -7
  93. package/dist/cjs/components/node/components/star/star.js +6 -9
  94. package/dist/cjs/components/node/components/straight/straight.js +4 -7
  95. package/dist/cjs/components/node/components/triangle/triangle.js +4 -7
  96. package/dist/cjs/components/node/index.js +2 -18
  97. package/dist/cjs/components/node/node.js +22 -25
  98. package/dist/cjs/components/node/node.types.js +1 -4
  99. package/dist/cjs/components/node/utils/calculateShapePoints/calculateShapePoints.js +1 -5
  100. package/dist/cjs/components/path/components/nodePath/nodePath.js +9 -12
  101. package/dist/cjs/components/path/index.js +2 -18
  102. package/dist/cjs/components/path/path.js +20 -23
  103. package/dist/cjs/components/path/path.types.js +1 -2
  104. package/dist/cjs/components/plot/components/circle/circle.js +4 -7
  105. package/dist/cjs/components/plot/components/index.js +3 -19
  106. package/dist/cjs/components/plot/components/square/square.js +4 -7
  107. package/dist/cjs/components/plot/components/triangle/triangle.js +4 -7
  108. package/dist/cjs/components/plot/index.js +2 -18
  109. package/dist/cjs/components/plot/plot.js +21 -24
  110. package/dist/cjs/components/plot/plot.types.js +8 -11
  111. package/dist/cjs/components/svgContainer/index.js +1 -17
  112. package/dist/cjs/components/svgContainer/svgContainer.js +5 -8
  113. package/dist/cjs/components/svgContainer/svgContainer.types.js +1 -2
  114. package/dist/cjs/components/svgContainer/utils/buildViewBox/buildViewBox.js +1 -5
  115. package/dist/cjs/components/svgContainer/utils/index.js +1 -17
  116. package/dist/cjs/components/tick/index.js +2 -18
  117. package/dist/cjs/components/tick/tick.js +4 -8
  118. package/dist/cjs/components/tick/tick.types.js +1 -4
  119. package/dist/cjs/components/zoomArea/components/HandlerIcon.js +3 -7
  120. package/dist/cjs/components/zoomArea/components/LineRenderer.js +3 -7
  121. package/dist/cjs/components/zoomArea/components/SelectionArea.js +9 -14
  122. package/dist/cjs/components/zoomArea/components/ZoomHandler.js +6 -10
  123. package/dist/cjs/components/zoomArea/components/index.js +4 -12
  124. package/dist/cjs/components/zoomArea/hooks/index.js +5 -13
  125. package/dist/cjs/components/zoomArea/hooks/useDragInteraction.js +19 -23
  126. package/dist/cjs/components/zoomArea/hooks/useKeyboardNavigation.js +18 -22
  127. package/dist/cjs/components/zoomArea/hooks/useResponsiveCanvas.js +12 -16
  128. package/dist/cjs/components/zoomArea/hooks/useZoomAreaFocus.js +6 -10
  129. package/dist/cjs/components/zoomArea/hooks/useZoomData.js +8 -12
  130. package/dist/cjs/components/zoomArea/index.js +5 -21
  131. package/dist/cjs/components/zoomArea/utils/accessibilityLabels.js +6 -11
  132. package/dist/cjs/components/zoomArea/utils/index.js +3 -14
  133. package/dist/cjs/components/zoomArea/utils/indexRounding.js +5 -11
  134. package/dist/cjs/components/zoomArea/utils/interactionConfig.js +1 -5
  135. package/dist/cjs/components/zoomArea/utils/pathGeneration.js +4 -9
  136. package/dist/cjs/components/zoomArea/utils/rangeAndPositions.js +5 -13
  137. package/dist/cjs/components/zoomArea/utils/selectionConfig.js +1 -5
  138. package/dist/cjs/components/zoomArea/zoomArea.js +35 -39
  139. package/dist/cjs/components/zoomArea/zoomArea.type.js +1 -4
  140. package/dist/cjs/hooks/index.js +2 -18
  141. package/dist/cjs/hooks/useFocus/useFocus.js +5 -9
  142. package/dist/cjs/hooks/useFocus/useFocus.types.js +1 -2
  143. package/dist/cjs/hooks/useHover/useHover.js +5 -9
  144. package/dist/cjs/hooks/useHover/useHover.types.js +1 -2
  145. package/dist/cjs/index.js +3 -19
  146. package/dist/cjs/types/canvas.type.js +1 -4
  147. package/dist/cjs/types/errors.type.js +1 -4
  148. package/dist/cjs/types/focusConfig.type.js +1 -4
  149. package/dist/cjs/types/index.js +4 -20
  150. package/dist/cjs/types/position.enum.js +1 -4
  151. package/dist/cjs/types/unit.enum.js +1 -4
  152. package/dist/cjs/types/valueFormatter.type.js +1 -2
  153. package/dist/cjs/utils/ajustedTextSpace/ajustedTextSpace.js +1 -5
  154. package/dist/cjs/utils/buildErrors/buildErrors.js +3 -7
  155. package/dist/cjs/utils/buildTickValues/buildTickValues.js +2 -7
  156. package/dist/cjs/utils/calculateFocusOutline/calculateFocusOutline.js +8 -13
  157. package/dist/cjs/utils/classNames/classNames.js +1 -5
  158. package/dist/cjs/utils/cssGradientToSvg/cssGradientToSvg.js +4 -8
  159. package/dist/cjs/utils/cssGradientToSvg/cssGradientToSvg.types.js +1 -2
  160. package/dist/cjs/utils/cursorNear/isNear.js +1 -5
  161. package/dist/cjs/utils/getAxisData/getAxisData.js +1 -5
  162. package/dist/cjs/utils/getCanvasDimensions/getCanvasDimensions.js +8 -12
  163. package/dist/cjs/utils/getChildrenAttr/getChildrenAttr.js +4 -8
  164. package/dist/cjs/utils/getCoordinates/getCoordinates.js +9 -14
  165. package/dist/cjs/utils/getDataFingerprint/getDataFingerprint.js +1 -5
  166. package/dist/cjs/utils/getPoints/getPoints.js +1 -5
  167. package/dist/cjs/utils/getTickTextCoordinate/getTickTextCoordinates.js +5 -10
  168. package/dist/cjs/utils/getTicks/getTicks.js +2 -7
  169. package/dist/cjs/utils/index.js +8 -24
  170. package/dist/cjs/utils/parseStringToNumberPx.ts/parseStringToNumberPx.js +3 -7
  171. package/dist/cjs/utils/pickCustomAttributes/pickCustomAttributes.js +1 -5
  172. package/dist/cjs/utils/shadowSvg/shadowSvg.js +3 -7
  173. package/dist/cjs/utils/shadowSvg/shadowSvg.types.js +1 -2
  174. package/dist/cjs/utils/textBound/textBound.js +1 -5
  175. package/dist/kubit-ui-web-react-charts.cjs.js +1 -10
  176. package/dist/kubit-ui-web-react-charts.es.js +1 -10
  177. package/dist/kubit-ui-web-react-charts.umd.js +1 -10
  178. package/package.json +31 -33
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodePath = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const accessibilityTemplateProcessor_1 = require("../../../../charts/lineChart/utils/accessibilityTemplateProcessor");
7
- const pickCustomAttributes_1 = require("../../../../utils/pickCustomAttributes/pickCustomAttributes");
8
- const node_1 = require("../../../node/node");
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { processAccessibilityTemplate } from '../../../../charts/lineChart/utils/accessibilityTemplateProcessor';
4
+ import { pickCustomAttributes } from '../../../../utils/pickCustomAttributes/pickCustomAttributes';
5
+ import { Node } from '../../../node/node';
9
6
  const NODE_PATH_FOCUS_BORDER = 'node-path-focus-border';
10
7
  /**
11
8
  * NodePathComponent renders a Node with custom attributes including processed aria-label templates.
@@ -15,14 +12,14 @@ const NODE_PATH_FOCUS_BORDER = 'node-path-focus-border';
15
12
  */
16
13
  const NodePathComponent = ({ data, nodeConfig, tabIndex = 0, x, y }, ref) => {
17
14
  // Extract custom aria-* and data-* attributes from nodeConfig
18
- const customAttributes = nodeConfig ? (0, pickCustomAttributes_1.pickCustomAttributes)(nodeConfig) : {};
15
+ const customAttributes = nodeConfig ? pickCustomAttributes(nodeConfig) : {};
19
16
  // Process aria-label template if it exists and contains placeholders
20
17
  if (customAttributes['aria-label'] &&
21
18
  data &&
22
19
  typeof customAttributes['aria-label'] === 'string') {
23
20
  const ariaLabelValue = customAttributes['aria-label'];
24
21
  if (ariaLabelValue.includes('{{')) {
25
- const processedAriaLabel = (0, accessibilityTemplateProcessor_1.processAccessibilityTemplate)(ariaLabelValue, {
22
+ const processedAriaLabel = processAccessibilityTemplate(ariaLabelValue, {
26
23
  dataKey: data.dataKey,
27
24
  dataValue: data.dataValue,
28
25
  index: data.index ?? 0,
@@ -33,9 +30,9 @@ const NodePathComponent = ({ data, nodeConfig, tabIndex = 0, x, y }, ref) => {
33
30
  }
34
31
  }
35
32
  }
36
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nodeConfig && ((0, jsx_runtime_1.jsx)(node_1.Node, { ...nodeConfig, ref: ref, ...customAttributes, className: NODE_PATH_FOCUS_BORDER, data: data, hasHalo: nodeConfig.hasHalo, position: {
33
+ return (_jsx(_Fragment, { children: nodeConfig && (_jsx(Node, { ...nodeConfig, ref: ref, ...customAttributes, className: NODE_PATH_FOCUS_BORDER, data: data, hasHalo: nodeConfig.hasHalo, position: {
37
34
  x: x,
38
35
  y: y,
39
36
  }, tabIndex: tabIndex })) }));
40
37
  };
41
- exports.NodePath = (0, react_1.forwardRef)(NodePathComponent);
38
+ export const NodePath = forwardRef(NodePathComponent);
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./path"), exports);
18
- __exportStar(require("./path.types"), exports);
1
+ export * from './path';
2
+ export * from './path.types';
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Path = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const useFocus_1 = require("../../hooks/useFocus/useFocus");
7
- const useHover_1 = require("../../hooks/useHover/useHover");
8
- const cssGradientToSvg_1 = require("../../utils/cssGradientToSvg/cssGradientToSvg");
9
- const pickCustomAttributes_1 = require("../../utils/pickCustomAttributes/pickCustomAttributes");
10
- const shadowSvg_1 = require("../../utils/shadowSvg/shadowSvg");
11
- const nodePath_1 = require("./components/nodePath/nodePath");
12
- require("./path.css");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useImperativeHandle, useRef, } from 'react';
3
+ import { useFocus } from '../../hooks/useFocus/useFocus';
4
+ import { useHover } from '../../hooks/useHover/useHover';
5
+ import { cssGradientToSVG } from '../../utils/cssGradientToSvg/cssGradientToSvg';
6
+ import { pickCustomAttributes } from '../../utils/pickCustomAttributes/pickCustomAttributes';
7
+ import { ShadowSvg } from '../../utils/shadowSvg/shadowSvg';
8
+ import { NodePath } from './components/nodePath/nodePath';
9
+ import './path.css';
13
10
  const ENTER = {
14
11
  code: 'Enter',
15
12
  key: 'Enter',
@@ -55,12 +52,12 @@ const PathComponent = ({ classNames = '', fill = 'transparent', stroke = '#0000F
55
52
  stroke: '#0000FF',
56
53
  strokeWidth: '0.5',
57
54
  }, role = 'img', ...props }, ref) => {
58
- const { handleBlur, handleFocus, isFocused } = (0, useFocus_1.useFocus)(props.onFocus, props.onBlur);
59
- const { handleMouseEnter, handleMouseLeave, isHovered } = (0, useHover_1.useHover)(props.onMouseEnter, props.onMouseLeave);
60
- const pathRef = (0, react_1.useRef)(null);
61
- const nodeRef = (0, react_1.useRef)([]);
62
- const mainRef = (0, react_1.useRef)(null);
63
- (0, react_1.useImperativeHandle)(ref, () => ({
55
+ const { handleBlur, handleFocus, isFocused } = useFocus(props.onFocus, props.onBlur);
56
+ const { handleMouseEnter, handleMouseLeave, isHovered } = useHover(props.onMouseEnter, props.onMouseLeave);
57
+ const pathRef = useRef(null);
58
+ const nodeRef = useRef([]);
59
+ const mainRef = useRef(null);
60
+ useImperativeHandle(ref, () => ({
64
61
  get main() {
65
62
  return mainRef.current;
66
63
  },
@@ -85,9 +82,9 @@ const PathComponent = ({ classNames = '', fill = 'transparent', stroke = '#0000F
85
82
  const handleMouseDown = (e) => {
86
83
  e.preventDefault();
87
84
  };
88
- const gradientSvgElement = props.gradient && (0, cssGradientToSvg_1.cssGradientToSVG)(props.gradient);
85
+ const gradientSvgElement = props.gradient && cssGradientToSVG(props.gradient);
89
86
  // Extract custom data-* and aria-* attributes
90
- const customAttributes = (0, pickCustomAttributes_1.pickCustomAttributes)(props);
87
+ const customAttributes = pickCustomAttributes(props);
91
88
  // Merge props to include focus and hover styles
92
89
  const defaultProps = {
93
90
  ...props,
@@ -103,7 +100,7 @@ const PathComponent = ({ classNames = '', fill = 'transparent', stroke = '#0000F
103
100
  ...(isFocused && focusConfig),
104
101
  ...(isHovered && hoverConfig),
105
102
  };
106
- return ((0, jsx_runtime_1.jsxs)("g", { ref: mainRef, tabIndex: -1, children: [gradientSvgElement && gradientSvgElement, mergedProps.shadowSvgConfig && ((0, jsx_runtime_1.jsx)(shadowSvg_1.ShadowSvg, { id: SHADOW_FILTER_ID, shadowSvgConfig: mergedProps.shadowSvgConfig })), (0, jsx_runtime_1.jsxs)("g", { "aria-label": mergedProps.ariaLabel, className: mergedProps.classNames, "data-draw": true, filter: mergedProps.shadowSvgConfig && mergedProps.filter, opacity: mergedProps.opacity, orientation: mergedProps.orientation, role: mergedProps.role, rotate: mergedProps.rotate, tabIndex: mergedProps.tabIndex, transform: mergedProps.transform, visibility: mergedProps.visibility, ...customAttributes, onBlur: handleBlur, onClick: handleClick, onDoubleClick: handleDoubleClick, onFocus: handleFocus, onKeyDown: handleKeyDown, onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [(0, jsx_runtime_1.jsx)("path", { ref: pathRef, d: mergedProps.d, "data-testid": mergedProps.dataTestId, fill: mergedProps.dFill ? 'transparent' : mergedProps.fill, fillOpacity: mergedProps.fillOpacity, fillRule: mergedProps.fillRule, stroke: mergedProps.stroke, strokeDasharray: mergedProps.strokeDasharray, strokeDashoffset: mergedProps.strokeDashoffset, strokeLinecap: mergedProps.strokeLinecap, strokeLinejoin: mergedProps.strokeLinejoin, strokeMiterlimit: mergedProps.strokeMiterlimit, strokeOpacity: mergedProps.strokeOpacity, strokeWidth: mergedProps.strokeWidth, children: mergedProps.title && (0, jsx_runtime_1.jsx)("title", { children: mergedProps.title }) }), mergedProps.dFill && ((0, jsx_runtime_1.jsx)("path", { d: mergedProps.dFill, fill: mergedProps.fill, fillOpacity: mergedProps.fillOpacity, fillRule: mergedProps.fillRule }))] }), mergedProps.points &&
103
+ return (_jsxs("g", { ref: mainRef, tabIndex: -1, children: [gradientSvgElement && gradientSvgElement, mergedProps.shadowSvgConfig && (_jsx(ShadowSvg, { id: SHADOW_FILTER_ID, shadowSvgConfig: mergedProps.shadowSvgConfig })), _jsxs("g", { "aria-label": mergedProps.ariaLabel, className: mergedProps.classNames, "data-draw": true, filter: mergedProps.shadowSvgConfig && mergedProps.filter, opacity: mergedProps.opacity, orientation: mergedProps.orientation, role: mergedProps.role, rotate: mergedProps.rotate, tabIndex: mergedProps.tabIndex, transform: mergedProps.transform, visibility: mergedProps.visibility, ...customAttributes, onBlur: handleBlur, onClick: handleClick, onDoubleClick: handleDoubleClick, onFocus: handleFocus, onKeyDown: handleKeyDown, onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsx("path", { ref: pathRef, d: mergedProps.d, "data-testid": mergedProps.dataTestId, fill: mergedProps.dFill ? 'transparent' : mergedProps.fill, fillOpacity: mergedProps.fillOpacity, fillRule: mergedProps.fillRule, stroke: mergedProps.stroke, strokeDasharray: mergedProps.strokeDasharray, strokeDashoffset: mergedProps.strokeDashoffset, strokeLinecap: mergedProps.strokeLinecap, strokeLinejoin: mergedProps.strokeLinejoin, strokeMiterlimit: mergedProps.strokeMiterlimit, strokeOpacity: mergedProps.strokeOpacity, strokeWidth: mergedProps.strokeWidth, children: mergedProps.title && _jsx("title", { children: mergedProps.title }) }), mergedProps.dFill && (_jsx("path", { d: mergedProps.dFill, fill: mergedProps.fill, fillOpacity: mergedProps.fillOpacity, fillRule: mergedProps.fillRule }))] }), mergedProps.points &&
107
104
  mergedProps.nodeConfig &&
108
105
  mergedProps.points.map(([x, y], index) => {
109
106
  const nodeData = {
@@ -112,7 +109,7 @@ const PathComponent = ({ classNames = '', fill = 'transparent', stroke = '#0000F
112
109
  index,
113
110
  xKey: mergedProps?.xKey,
114
111
  };
115
- return ((0, jsx_runtime_1.jsx)(nodePath_1.NodePath, { ref: rf => (nodeRef.current[index] = rf), data: nodeData, nodeConfig: mergedProps.nodeConfig, tabIndex: -1, x: x, y: y }, `${index.toString()}`));
112
+ return (_jsx(NodePath, { ref: rf => (nodeRef.current[index] = rf), data: nodeData, nodeConfig: mergedProps.nodeConfig, tabIndex: -1, x: x, y: y }, `${index.toString()}`));
116
113
  })] }));
117
114
  };
118
- exports.Path = (0, react_1.forwardRef)(PathComponent);
115
+ export const Path = forwardRef(PathComponent);
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Circle = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
6
3
  const CircleComponent = ({ dataTestId, position, size, ...props }, ref) => {
7
- return ((0, jsx_runtime_1.jsx)("circle", { ...props, ref: ref, cx: position.x, cy: position.y, "data-testid": `${dataTestId}-circle`, r: size / 2 }));
4
+ return (_jsx("circle", { ...props, ref: ref, cx: position.x, cy: position.y, "data-testid": `${dataTestId}-circle`, r: size / 2 }));
8
5
  };
9
- exports.Circle = (0, react_1.forwardRef)(CircleComponent);
6
+ export const Circle = forwardRef(CircleComponent);
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./circle/circle"), exports);
18
- __exportStar(require("./square/square"), exports);
19
- __exportStar(require("./triangle/triangle"), exports);
1
+ export * from './circle/circle';
2
+ export * from './square/square';
3
+ export * from './triangle/triangle';
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Square = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
6
3
  const SquareComponent = ({ dataTestId, position, size, ...props }, ref) => {
7
- return ((0, jsx_runtime_1.jsx)("rect", { ...props, ref: ref, "data-testid": `${dataTestId}-square`, height: size, width: size, x: position.x - size / 2, y: position.y - size / 2 }));
4
+ return (_jsx("rect", { ...props, ref: ref, "data-testid": `${dataTestId}-square`, height: size, width: size, x: position.x - size / 2, y: position.y - size / 2 }));
8
5
  };
9
- exports.Square = (0, react_1.forwardRef)(SquareComponent);
6
+ export const Square = forwardRef(SquareComponent);
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Triangle = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
6
3
  const TriangleComponent = ({ dataTestId, position, size, ...props }, ref) => {
7
4
  // Create an isosceles triangle where both width and height are size*2
8
5
  // This maintains consistency with the circle and square Plots
@@ -12,6 +9,6 @@ const TriangleComponent = ({ dataTestId, position, size, ...props }, ref) => {
12
9
  const bottomLeft = `${position.x - halfWidth},${position.y + height / 2}`;
13
10
  const bottomRight = `${position.x + halfWidth},${position.y + height / 2}`;
14
11
  const trianglePoints = `${topPoint} ${bottomLeft} ${bottomRight}`;
15
- return ((0, jsx_runtime_1.jsx)("polygon", { ...props, ref: ref, "data-testid": `${dataTestId}-triangle`, points: trianglePoints }));
12
+ return (_jsx("polygon", { ...props, ref: ref, "data-testid": `${dataTestId}-triangle`, points: trianglePoints }));
16
13
  };
17
- exports.Triangle = (0, react_1.forwardRef)(TriangleComponent);
14
+ export const Triangle = forwardRef(TriangleComponent);
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./plot"), exports);
18
- __exportStar(require("./plot.types"), exports);
1
+ export * from './plot';
2
+ export * from './plot.types';
@@ -1,32 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Plot = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const useFocus_1 = require("../../hooks/useFocus/useFocus");
7
- const useHover_1 = require("../../hooks/useHover/useHover");
8
- const calculateFocusOutline_1 = require("../../utils/calculateFocusOutline/calculateFocusOutline");
9
- const circle_1 = require("./components/circle/circle");
10
- const square_1 = require("./components/square/square");
11
- const triangle_1 = require("./components/triangle/triangle");
12
- require("./plot.css");
13
- const plot_types_1 = require("./plot.types");
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { useFocus } from '../../hooks/useFocus/useFocus';
4
+ import { useHover } from '../../hooks/useHover/useHover';
5
+ import { calculateFocusOutline, getFocusConfig, } from '../../utils/calculateFocusOutline/calculateFocusOutline';
6
+ import { Circle } from './components/circle/circle';
7
+ import { Square } from './components/square/square';
8
+ import { Triangle } from './components/triangle/triangle';
9
+ import './plot.css';
10
+ import { PLOT_SIZE_MAP, PlotSize, PlotType } from './plot.types';
14
11
  // Map of components by type
15
12
  const Component = {
16
- [plot_types_1.PlotType.CIRCLE]: circle_1.Circle,
17
- [plot_types_1.PlotType.SQUARE]: square_1.Square,
18
- [plot_types_1.PlotType.TRIANGLE]: triangle_1.Triangle,
13
+ [PlotType.CIRCLE]: Circle,
14
+ [PlotType.SQUARE]: Square,
15
+ [PlotType.TRIANGLE]: Triangle,
19
16
  };
20
- const PlotComponent = ({ className, data, dataTestId = 'plot', fill, fillOpacity, focusConfig, hasHoverEffect, hoverConfig, id, label, onBlur, onClick, onFocus, onKeyDown, onMouseEnter, onMouseLeave, opacity, position = { x: 0, y: 0 }, size = plot_types_1.PlotSize.MEDIUM, stroke, strokeWidth, tabIndex, type = plot_types_1.PlotType.CIRCLE, ...props }, ref) => {
21
- const { handleBlur, handleFocus, isFocused } = (0, useFocus_1.useFocus)(onFocus, onBlur);
22
- const { handleMouseEnter, handleMouseLeave, isHovered } = (0, useHover_1.useHover)(onMouseEnter, onMouseLeave);
17
+ const PlotComponent = ({ className, data, dataTestId = 'plot', fill, fillOpacity, focusConfig, hasHoverEffect, hoverConfig, id, label, onBlur, onClick, onFocus, onKeyDown, onMouseEnter, onMouseLeave, opacity, position = { x: 0, y: 0 }, size = PlotSize.MEDIUM, stroke, strokeWidth, tabIndex, type = PlotType.CIRCLE, ...props }, ref) => {
18
+ const { handleBlur, handleFocus, isFocused } = useFocus(onFocus, onBlur);
19
+ const { handleMouseEnter, handleMouseLeave, isHovered } = useHover(onMouseEnter, onMouseLeave);
23
20
  // Extract properties from hoverConfig with default values
24
21
  const { fill: hoverFill = fill, opacity: hoverOpacity = 0.3, scale: hoverScale = 1.3, stroke: hoverStroke = fill, strokeWidth: hoverStrokeWidth = 0, } = hoverConfig || {};
25
22
  // Extract properties from focusConfig with default values
26
- const resolvedFocusConfig = (0, calculateFocusOutline_1.getFocusConfig)(focusConfig);
23
+ const resolvedFocusConfig = getFocusConfig(focusConfig);
27
24
  // Calculate focus outline dimensions using the utility
28
- const sizeInPixels = typeof size === 'number' ? size : plot_types_1.PLOT_SIZE_MAP[size];
29
- const focusOutline = (0, calculateFocusOutline_1.calculateFocusOutline)({
25
+ const sizeInPixels = typeof size === 'number' ? size : PLOT_SIZE_MAP[size];
26
+ const focusOutline = calculateFocusOutline({
30
27
  elementHeight: sizeInPixels,
31
28
  elementPosition: position,
32
29
  elementStrokeWidth: strokeWidth,
@@ -61,7 +58,7 @@ const PlotComponent = ({ className, data, dataTestId = 'plot', fill, fillOpacity
61
58
  };
62
59
  // Get the correct component based on type
63
60
  const PlotShape = Component[type];
64
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [hasHoverEffect && isHovered && !isFocused && ((0, jsx_runtime_1.jsx)(PlotShape, { dataTestId: `${dataTestId}-hover`, fill: hoverFill, opacity: hoverOpacity, position: position, size: sizeInPixels * hoverScale, stroke: hoverStroke, strokeWidth: hoverStrokeWidth })), isFocused && focusOutline.type === 'rectangle' && ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("rect", { className: "plot-focus-outer", "data-testid": `${dataTestId}-focus-outer`, fill: "none", height: focusOutline.outer.height, stroke: resolvedFocusConfig.outlineColor, strokeWidth: resolvedFocusConfig.outlineStrokeWidth, width: focusOutline.outer.width, x: focusOutline.outer.x, y: focusOutline.outer.y }), (0, jsx_runtime_1.jsx)("rect", { className: "plot-focus-inner", "data-testid": `${dataTestId}-focus-inner`, fill: "none", height: focusOutline.inner.height, stroke: resolvedFocusConfig.innerColor, strokeWidth: resolvedFocusConfig.innerStrokeWidth, width: focusOutline.inner.width, x: focusOutline.inner.x, y: focusOutline.inner.y })] })), (0, jsx_runtime_1.jsx)(PlotShape, { ref: ref, ...plotShapeProps })] }));
61
+ return (_jsxs(_Fragment, { children: [hasHoverEffect && isHovered && !isFocused && (_jsx(PlotShape, { dataTestId: `${dataTestId}-hover`, fill: hoverFill, opacity: hoverOpacity, position: position, size: sizeInPixels * hoverScale, stroke: hoverStroke, strokeWidth: hoverStrokeWidth })), isFocused && focusOutline.type === 'rectangle' && (_jsxs("g", { children: [_jsx("rect", { className: "plot-focus-outer", "data-testid": `${dataTestId}-focus-outer`, fill: "none", height: focusOutline.outer.height, stroke: resolvedFocusConfig.outlineColor, strokeWidth: resolvedFocusConfig.outlineStrokeWidth, width: focusOutline.outer.width, x: focusOutline.outer.x, y: focusOutline.outer.y }), _jsx("rect", { className: "plot-focus-inner", "data-testid": `${dataTestId}-focus-inner`, fill: "none", height: focusOutline.inner.height, stroke: resolvedFocusConfig.innerColor, strokeWidth: resolvedFocusConfig.innerStrokeWidth, width: focusOutline.inner.width, x: focusOutline.inner.x, y: focusOutline.inner.y })] })), _jsx(PlotShape, { ref: ref, ...plotShapeProps })] }));
65
62
  };
66
63
  /**
67
64
  * `Plot` component which renders an interactive point in a chart with hover effects and accessibility features.
@@ -95,4 +92,4 @@ const PlotComponent = ({ className, data, dataTestId = 'plot', fill, fillOpacity
95
92
  *
96
93
  * @returns An SVG element representing the plot point with event handlers and accessibility features.
97
94
  */
98
- exports.Plot = (0, react_1.forwardRef)(PlotComponent);
95
+ export const Plot = forwardRef(PlotComponent);
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PLOT_SIZE_MAP = exports.PlotSize = exports.PlotType = void 0;
4
1
  /**
5
2
  * Enum for plot types.
6
3
  *
@@ -9,7 +6,7 @@ exports.PLOT_SIZE_MAP = exports.PlotSize = exports.PlotType = void 0;
9
6
  *
10
7
  * @enum {string}
11
8
  */
12
- exports.PlotType = {
9
+ export const PlotType = {
13
10
  /** Represents a circle plot point */
14
11
  CIRCLE: 'CIRCLE',
15
12
  /** Represents a square plot point */
@@ -25,7 +22,7 @@ exports.PlotType = {
25
22
  *
26
23
  * @enum {string}
27
24
  */
28
- exports.PlotSize = {
25
+ export const PlotSize = {
29
26
  /** Extra large plot point (40x40 pixels) */
30
27
  EXTRA_LARGE: 'EXTRA_LARGE',
31
28
  /** Extra small plot point (8x8 pixels) */
@@ -45,10 +42,10 @@ exports.PlotSize = {
45
42
  *
46
43
  * @type {Record<PlotSize, number>}
47
44
  */
48
- exports.PLOT_SIZE_MAP = {
49
- [exports.PlotSize.EXTRA_LARGE]: 40,
50
- [exports.PlotSize.EXTRA_SMALL]: 8,
51
- [exports.PlotSize.LARGE]: 32,
52
- [exports.PlotSize.MEDIUM]: 24,
53
- [exports.PlotSize.SMALL]: 16,
45
+ export const PLOT_SIZE_MAP = {
46
+ [PlotSize.EXTRA_LARGE]: 40,
47
+ [PlotSize.EXTRA_SMALL]: 8,
48
+ [PlotSize.LARGE]: 32,
49
+ [PlotSize.MEDIUM]: 24,
50
+ [PlotSize.SMALL]: 16,
54
51
  };
@@ -1,17 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./svgContainer"), exports);
1
+ export * from './svgContainer';
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SvgContainer = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
6
3
  /**
7
4
  * Renders an SVG container with customizable properties.
8
5
  *
@@ -28,10 +25,10 @@ const react_1 = require("react");
28
25
  * @returns {ReactElement} A React element representing the SVG container.
29
26
  */
30
27
  const SvgContainerComponent = ({ ariaHidden, ariaLabel, backgroundColor, caption, children, className, dataTestId, height, imageSrc, overflow, radius = '0px', role, tabIndex, viewBox, width, ...callbacks }, ref) => {
31
- return ((0, jsx_runtime_1.jsxs)("svg", { ref: ref, "aria-hidden": ariaHidden, "aria-label": ariaLabel, className: className, "data-testid": dataTestId, height: height, role: role, style: {
28
+ return (_jsxs("svg", { ref: ref, "aria-hidden": ariaHidden, "aria-label": ariaLabel, className: className, "data-testid": dataTestId, height: height, role: role, style: {
32
29
  backgroundColor: backgroundColor,
33
30
  borderRadius: radius,
34
31
  overflow: overflow,
35
- }, tabIndex: tabIndex, viewBox: viewBox, width: width, onMouseDown: e => e.preventDefault(), ...callbacks, children: [caption && (0, jsx_runtime_1.jsx)("title", { children: caption }), imageSrc && (0, jsx_runtime_1.jsx)("image", { height: height, href: imageSrc, width: width, x: "0", y: "0" }), children] }));
32
+ }, tabIndex: tabIndex, viewBox: viewBox, width: width, onMouseDown: e => e.preventDefault(), ...callbacks, children: [caption && _jsx("title", { children: caption }), imageSrc && _jsx("image", { height: height, href: imageSrc, width: width, x: "0", y: "0" }), children] }));
36
33
  };
37
- exports.SvgContainer = (0, react_1.forwardRef)(SvgContainerComponent);
34
+ export const SvgContainer = forwardRef(SvgContainerComponent);
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildViewBox = void 0;
4
1
  /**
5
2
  * Constructs a viewBox attribute value for an SVG element.
6
3
  *
@@ -14,11 +11,10 @@ exports.buildViewBox = void 0;
14
11
  *
15
12
  * @returns {string} The `viewBox` attribute value, formatted as "minX minY width height".
16
13
  */
17
- const buildViewBox = (width, height, extraSpace = 0) => {
14
+ export const buildViewBox = (width, height, extraSpace = 0) => {
18
15
  const minX = -extraSpace;
19
16
  const minY = -extraSpace;
20
17
  const viewBoxWidth = width;
21
18
  const viewBoxHeight = height;
22
19
  return `${minX} ${minY} ${viewBoxWidth} ${viewBoxHeight}`;
23
20
  };
24
- exports.buildViewBox = buildViewBox;
@@ -1,17 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./buildViewBox/buildViewBox"), exports);
1
+ export * from './buildViewBox/buildViewBox';
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./tick"), exports);
18
- __exportStar(require("./tick.types"), exports);
1
+ export * from './tick';
2
+ export * from './tick.types';
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Tick = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const chartText_1 = require("../../components/chartText/chartText");
6
- const line_1 = require("../../components/line/line");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChartText } from '../../components/chartText/chartText';
3
+ import { Line } from '../../components/line/line';
7
4
  /**
8
5
  * Functional component for rendering a tick mark in a chart or graph.
9
6
  *
@@ -19,5 +16,4 @@ const line_1 = require("../../components/line/line");
19
16
  * @param {number} [props.y] - Optional y-coordinate for the position of the tick mark. Used for vertical placement.
20
17
  * @returns A React functional component that renders the tick mark and its associated elements.
21
18
  */
22
- const Tick = ({ showTickLines, tick, tickLine, tickText }) => ((0, jsx_runtime_1.jsxs)("g", { children: [showTickLines && (0, jsx_runtime_1.jsx)(line_1.Line, { ...tickLine }), tickText && (0, jsx_runtime_1.jsx)(chartText_1.ChartText, { ...tickText, children: tick.value })] }));
23
- exports.Tick = Tick;
19
+ export const Tick = ({ showTickLines, tick, tickLine, tickText }) => (_jsxs("g", { children: [showTickLines && _jsx(Line, { ...tickLine }), tickText && _jsx(ChartText, { ...tickText, children: tick.value })] }));
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TickDataUtils = void 0;
4
1
  /**
5
2
  * Utility functions for working with TickData.
6
3
  */
7
- exports.TickDataUtils = {
4
+ export const TickDataUtils = {
8
5
  /**
9
6
  * Formats the values of an array of TickData using the provided formatter function.
10
7
  *
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HandlerIcon = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
2
  /**
6
3
  * Default color for handler icons
7
4
  */
@@ -20,7 +17,6 @@ const ICON_OFFSET = 5;
20
17
  * The icon is centered on the handler by applying a translation of:
21
18
  * x - ICON_OFFSET, y - ICON_OFFSET
22
19
  */
23
- const HandlerIcon = ({ fill = DEFAULT_ICON_COLOR, x, y }) => {
24
- return ((0, jsx_runtime_1.jsxs)("g", { fill: fill, pointerEvents: "none", transform: `translate(${x - ICON_OFFSET}, ${y - ICON_OFFSET})`, children: [(0, jsx_runtime_1.jsx)("path", { d: "M4.99948 9.99802C4.47168 9.99802 4.04419 9.64335 4.04419 9.20547V0.79255C4.04419 0.354666 4.47168 0 4.99948 0C5.52728 0 5.95477 0.354666 5.95477 0.79255V9.20745C5.95477 9.64533 5.52728 10 4.99948 10V9.99802Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M0.955289 8.78839C0.427492 8.78839 0 8.43372 0 7.99584V2.00416C0 1.56628 0.427492 1.21161 0.955289 1.21161C1.48309 1.21161 1.91058 1.56628 1.91058 2.00416V7.99584C1.91058 8.43372 1.48309 8.78839 0.955289 8.78839Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M8.08936 7.99584C8.08936 8.43372 8.51685 8.78839 9.04464 8.78839C9.57244 8.78839 9.99993 8.43372 9.99993 7.99584V2.00416C9.99993 1.56628 9.57244 1.21161 9.04464 1.21161C8.51685 1.21161 8.08936 1.56628 8.08936 2.00416V7.99584Z" })] }));
20
+ export const HandlerIcon = ({ fill = DEFAULT_ICON_COLOR, x, y }) => {
21
+ return (_jsxs("g", { fill: fill, pointerEvents: "none", transform: `translate(${x - ICON_OFFSET}, ${y - ICON_OFFSET})`, children: [_jsx("path", { d: "M4.99948 9.99802C4.47168 9.99802 4.04419 9.64335 4.04419 9.20547V0.79255C4.04419 0.354666 4.47168 0 4.99948 0C5.52728 0 5.95477 0.354666 5.95477 0.79255V9.20745C5.95477 9.64533 5.52728 10 4.99948 10V9.99802Z" }), _jsx("path", { d: "M0.955289 8.78839C0.427492 8.78839 0 8.43372 0 7.99584V2.00416C0 1.56628 0.427492 1.21161 0.955289 1.21161C1.48309 1.21161 1.91058 1.56628 1.91058 2.00416V7.99584C1.91058 8.43372 1.48309 8.78839 0.955289 8.78839Z" }), _jsx("path", { d: "M8.08936 7.99584C8.08936 8.43372 8.51685 8.78839 9.04464 8.78839C9.57244 8.78839 9.99993 8.43372 9.99993 7.99584V2.00416C9.99993 1.56628 9.57244 1.21161 9.04464 1.21161C8.51685 1.21161 8.08936 1.56628 8.08936 2.00416V7.99584Z" })] }));
25
22
  };
26
- exports.HandlerIcon = HandlerIcon;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LineRenderer = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
5
2
  /**
6
3
  * Default color for lines when no stroke is provided
7
4
  */
@@ -9,7 +6,6 @@ const DEFAULT_LINE_COLOR = '#0078D4';
9
6
  /**
10
7
  * Renders all lines and fill areas for the zoom area chart
11
8
  */
12
- const LineRenderer = ({ linesData }) => {
13
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: linesData.map((lineData, index) => ((0, jsx_runtime_1.jsxs)("g", { children: [lineData.config.fill && lineData.fillPath && ((0, jsx_runtime_1.jsx)("path", { d: lineData.fillPath, fill: lineData.config.fill, fillOpacity: lineData.config.fillOpacity || 0.2, stroke: "none" })), (0, jsx_runtime_1.jsx)("path", { d: lineData.linePath, fill: "none", stroke: lineData.config.stroke || DEFAULT_LINE_COLOR, strokeWidth: lineData.config.strokeWidth || 1 })] }, lineData.config.dataKey || lineData.config.yKey || index))) }));
9
+ export const LineRenderer = ({ linesData }) => {
10
+ return (_jsx(_Fragment, { children: linesData.map((lineData, index) => (_jsxs("g", { children: [lineData.config.fill && lineData.fillPath && (_jsx("path", { d: lineData.fillPath, fill: lineData.config.fill, fillOpacity: lineData.config.fillOpacity || 0.2, stroke: "none" })), _jsx("path", { d: lineData.linePath, fill: "none", stroke: lineData.config.stroke || DEFAULT_LINE_COLOR, strokeWidth: lineData.config.strokeWidth || 1 })] }, lineData.config.dataKey || lineData.config.yKey || index))) }));
14
11
  };
15
- exports.LineRenderer = LineRenderer;
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SelectionArea = exports.SelectionAreaFocusRing = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const calculateFocusOutline_1 = require("../../../utils/calculateFocusOutline/calculateFocusOutline");
6
- const rangeAndPositions_1 = require("../utils/rangeAndPositions");
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { calculateFocusOutline } from '../../../utils/calculateFocusOutline/calculateFocusOutline';
3
+ import { isFullRange } from '../utils/rangeAndPositions';
7
4
  /**
8
5
  * Focus ring for the selection area - rendered separately to control z-order
9
6
  */
10
- const SelectionAreaFocusRing = ({ endX, focusConfig, height, isFocused, startX, }) => {
7
+ export const SelectionAreaFocusRing = ({ endX, focusConfig, height, isFocused, startX, }) => {
11
8
  if (!isFocused) {
12
9
  return null;
13
10
  }
@@ -17,7 +14,7 @@ const SelectionAreaFocusRing = ({ endX, focusConfig, height, isFocused, startX,
17
14
  const centerX = startX + selectionWidth / 2;
18
15
  const centerY = height / 2;
19
16
  // Calculate focus ring dimensions using the new util
20
- const focusOutline = (0, calculateFocusOutline_1.calculateFocusOutline)({
17
+ const focusOutline = calculateFocusOutline({
21
18
  elementHeight: selectionHeight,
22
19
  elementPosition: { x: centerX, y: centerY },
23
20
  elementStrokeWidth: 0, // Selection area typically has no border
@@ -35,19 +32,17 @@ const SelectionAreaFocusRing = ({ endX, focusConfig, height, isFocused, startX,
35
32
  if (focusOutline.type !== 'rectangle') {
36
33
  return null;
37
34
  }
38
- return ((0, jsx_runtime_1.jsxs)("g", { pointerEvents: "none", children: [(0, jsx_runtime_1.jsx)("rect", { fill: "none", height: focusOutline.outer.height, stroke: outlineColor, strokeWidth: outlineStrokeWidth, width: focusOutline.outer.width, x: focusOutline.outer.x, y: focusOutline.outer.y }), (0, jsx_runtime_1.jsx)("rect", { fill: "none", height: focusOutline.inner.height, stroke: innerColor, strokeWidth: innerStrokeWidth, width: focusOutline.inner.width, x: focusOutline.inner.x, y: focusOutline.inner.y })] }));
35
+ return (_jsxs("g", { pointerEvents: "none", children: [_jsx("rect", { fill: "none", height: focusOutline.outer.height, stroke: outlineColor, strokeWidth: outlineStrokeWidth, width: focusOutline.outer.width, x: focusOutline.outer.x, y: focusOutline.outer.y }), _jsx("rect", { fill: "none", height: focusOutline.inner.height, stroke: innerColor, strokeWidth: innerStrokeWidth, width: focusOutline.inner.width, x: focusOutline.inner.x, y: focusOutline.inner.y })] }));
39
36
  };
40
- exports.SelectionAreaFocusRing = SelectionAreaFocusRing;
41
37
  /**
42
38
  * Selection area overlay
43
39
  */
44
- const SelectionArea = ({ currentRange, dataLength, dataTestId, endX, height, onBlur, onFocus, onKeyDown, onMouseDown, onTouchStart, screenReaderText, selectionConfig, startX, }) => {
40
+ export const SelectionArea = ({ currentRange, dataLength, dataTestId, endX, height, onBlur, onFocus, onKeyDown, onMouseDown, onTouchStart, screenReaderText, selectionConfig, startX, }) => {
45
41
  // Check if overlay should be hidden based on design specs:
46
42
  // "Only visible when a range is defined"
47
- const shouldHideOverlay = selectionConfig.hideOverlayOnFullRange && (0, rangeAndPositions_1.isFullRange)(currentRange, dataLength);
48
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("rect", { "aria-label": screenReaderText, "aria-valuemax": dataLength - 1, "aria-valuemin": 0, "aria-valuetext": screenReaderText, cursor: "grab", "data-testid": dataTestId, fill: selectionConfig.fill, fillOpacity: selectionConfig.fillOpacity, height: height, role: "slider", stroke: selectionConfig.stroke, strokeWidth: selectionConfig.strokeWidth, style: {
43
+ const shouldHideOverlay = selectionConfig.hideOverlayOnFullRange && isFullRange(currentRange, dataLength);
44
+ return (_jsx(_Fragment, { children: _jsx("rect", { "aria-label": screenReaderText, "aria-valuemax": dataLength - 1, "aria-valuemin": 0, "aria-valuetext": screenReaderText, cursor: "grab", "data-testid": dataTestId, fill: selectionConfig.fill, fillOpacity: selectionConfig.fillOpacity, height: height, role: "slider", stroke: selectionConfig.stroke, strokeWidth: selectionConfig.strokeWidth, style: {
49
45
  outline: 'none',
50
46
  visibility: shouldHideOverlay ? 'hidden' : 'visible',
51
47
  }, tabIndex: 0, width: endX - startX, x: startX, y: 0, onBlur: onBlur, onFocus: onFocus, onKeyDown: onKeyDown, onMouseDown: onMouseDown, onTouchStart: onTouchStart }) }));
52
48
  };
53
- exports.SelectionArea = SelectionArea;