@ledgerhq/lumen-ui-react 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai-rules/RULES.md +5 -4
- package/dist/lib/Components/core/Card/Card.d.ts.map +1 -1
- package/dist/lib/Components/core/Card/Card.js +29 -25
- package/dist/lib/Components/core/SearchInput/types.d.ts +2 -2
- package/dist/lib/Components/core/SearchInput/types.d.ts.map +1 -1
- package/dist/lib/Components/core/TextInput/types.d.ts +1 -2
- package/dist/lib/Components/core/TextInput/types.d.ts.map +1 -1
- package/dist/lib/Components/internal/BaseInput/BaseInput.d.ts +2 -16
- package/dist/lib/Components/internal/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/lib/Components/internal/BaseInput/BaseInput.js +141 -168
- package/dist/lib/Components/internal/BaseInput/BaseInputCounter.d.ts +8 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputCounter.d.ts.map +1 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputCounter.js +8 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputHelperText.d.ts +8 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputHelperText.d.ts.map +1 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputHelperText.js +37 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputLabel.d.ts +8 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputLabel.d.ts.map +1 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputLabel.js +48 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputMultiline.d.ts +9 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputMultiline.d.ts.map +1 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputMultiline.js +88 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputSingleLine.d.ts +8 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputSingleLine.d.ts.map +1 -0
- package/dist/lib/Components/internal/BaseInput/BaseInputSingleLine.js +25 -0
- package/dist/lib/Components/internal/BaseInput/types.d.ts +72 -1
- package/dist/lib/Components/internal/BaseInput/types.d.ts.map +1 -1
- package/dist/lib/Components/internal/BaseInput/useAutosizeTextarea/index.d.ts +2 -0
- package/dist/lib/Components/internal/BaseInput/useAutosizeTextarea/index.d.ts.map +1 -0
- package/dist/lib/Components/internal/BaseInput/useAutosizeTextarea/useAutosizeTextarea.d.ts +20 -0
- package/dist/lib/Components/internal/BaseInput/useAutosizeTextarea/useAutosizeTextarea.d.ts.map +1 -0
- package/dist/lib/Components/internal/BaseInput/useAutosizeTextarea/useAutosizeTextarea.js +49 -0
- package/dist/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.d.ts +26 -0
- package/dist/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.d.ts.map +1 -0
- package/dist/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.js +35 -0
- package/dist/lib/Components/visualization/Axis/XAxis/XAxis.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/XAxis/XAxis.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/XAxis/XAxis.js +85 -0
- package/dist/lib/Components/visualization/Axis/XAxis/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/XAxis/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/XAxis/types.d.ts +9 -0
- package/dist/lib/Components/visualization/Axis/XAxis/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/YAxis/YAxis.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/YAxis/YAxis.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/YAxis/YAxis.js +85 -0
- package/dist/lib/Components/visualization/Axis/YAxis/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/YAxis/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/YAxis/types.d.ts +14 -0
- package/dist/lib/Components/visualization/Axis/YAxis/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/index.d.ts +2 -0
- package/dist/lib/Components/visualization/Axis/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/types.d.ts +80 -0
- package/dist/lib/Components/visualization/Axis/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.js +107 -0
- package/dist/lib/Components/visualization/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts +11 -0
- package/dist/lib/Components/visualization/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js +21 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/RevealAnimationProvider.js +41 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/context.d.ts +15 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/context.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/context.js +10 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/index.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/types.d.ts +57 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/utils.d.ts +35 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/utils.js +69 -0
- package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.d.ts +8 -0
- package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.js +9 -0
- package/dist/lib/Components/visualization/CartesianChart/context/index.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/context/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.d.ts +25 -0
- package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.js +61 -0
- package/dist/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.d.ts +18 -0
- package/dist/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.js +15 -0
- package/dist/lib/Components/visualization/CartesianChart/index.d.ts +4 -0
- package/dist/lib/Components/visualization/CartesianChart/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/types.d.ts +127 -0
- package/dist/lib/Components/visualization/CartesianChart/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/utils.d.ts +5 -0
- package/dist/lib/Components/visualization/CartesianChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/utils.js +24 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChart.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChart.js +90 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.d.ts +10 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.js +61 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.d.ts +9 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +20 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartDescription.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartDescription.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartDescription.js +49 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartTitle.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartTitle.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartTitle.js +55 -0
- package/dist/lib/Components/visualization/DonutChart/DonutRing.d.ts +12 -0
- package/dist/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutRing.js +110 -0
- package/dist/lib/Components/visualization/DonutChart/RevealAnimation.d.ts +7 -0
- package/dist/lib/Components/visualization/DonutChart/RevealAnimation.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/RevealAnimation.js +28 -0
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.d.ts +18 -0
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.js +6 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useContrastSafeSeries.d.ts +12 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useContrastSafeSeries.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useContrastSafeSeries.js +13 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useDonutLoadingAnimation.d.ts +8 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useDonutLoadingAnimation.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useDonutLoadingAnimation.js +16 -0
- package/dist/lib/Components/visualization/DonutChart/index.d.ts +7 -0
- package/dist/lib/Components/visualization/DonutChart/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/types.d.ts +172 -0
- package/dist/lib/Components/visualization/DonutChart/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/index.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/useDonutSeries.d.ts +10 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/useDonutSeries.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/useDonutSeries.js +16 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/utils.d.ts +9 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/utils.js +46 -0
- package/dist/lib/Components/visualization/DonutChart/utils.d.ts +37 -0
- package/dist/lib/Components/visualization/DonutChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/utils.js +83 -0
- package/dist/lib/Components/visualization/Legend/Legend.d.ts +3 -0
- package/dist/lib/Components/visualization/Legend/Legend.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Legend/Legend.js +23 -0
- package/dist/lib/Components/visualization/Legend/LegendItem.d.ts +7 -0
- package/dist/lib/Components/visualization/Legend/LegendItem.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Legend/LegendItem.js +19 -0
- package/dist/lib/Components/visualization/Legend/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Legend/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Legend/types.d.ts +32 -0
- package/dist/lib/Components/visualization/Legend/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/Line.d.ts +3 -0
- package/dist/lib/Components/visualization/Line/Line.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/Line.js +82 -0
- package/dist/lib/Components/visualization/Line/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Line/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/types.d.ts +45 -0
- package/dist/lib/Components/visualization/Line/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/utils.d.ts +28 -0
- package/dist/lib/Components/visualization/Line/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/utils.js +34 -0
- package/dist/lib/Components/visualization/LineChart/LineChart.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChart.js +181 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts +9 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.js +51 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/index.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/types.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/utils.d.ts +8 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/utils.js +8 -0
- package/dist/lib/Components/visualization/LineChart/index.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/types.d.ts +82 -0
- package/dist/lib/Components/visualization/LineChart/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/utils.d.ts +56 -0
- package/dist/lib/Components/visualization/LineChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/utils.js +57 -0
- package/dist/lib/Components/visualization/Point/Point.d.ts +4 -0
- package/dist/lib/Components/visualization/Point/Point.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/Point.js +122 -0
- package/dist/lib/Components/visualization/Point/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Point/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/MagneticPointsProvider.d.ts +7 -0
- package/dist/lib/Components/visualization/Point/pointContext/MagneticPointsProvider.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/MagneticPointsProvider.js +22 -0
- package/dist/lib/Components/visualization/Point/pointContext/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Point/pointContext/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/magneticPointsContext.d.ts +30 -0
- package/dist/lib/Components/visualization/Point/pointContext/magneticPointsContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/magneticPointsContext.js +14 -0
- package/dist/lib/Components/visualization/Point/types.d.ts +110 -0
- package/dist/lib/Components/visualization/Point/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/usePointGeometry.d.ts +33 -0
- package/dist/lib/Components/visualization/Point/usePointGeometry.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/usePointGeometry.js +30 -0
- package/dist/lib/Components/visualization/Point/utils.d.ts +51 -0
- package/dist/lib/Components/visualization/Point/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/utils.js +54 -0
- package/dist/lib/Components/visualization/ReferenceLine/ReferenceLine.d.ts +3 -0
- package/dist/lib/Components/visualization/ReferenceLine/ReferenceLine.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/ReferenceLine.js +42 -0
- package/dist/lib/Components/visualization/ReferenceLine/index.d.ts +3 -0
- package/dist/lib/Components/visualization/ReferenceLine/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/types.d.ts +74 -0
- package/dist/lib/Components/visualization/ReferenceLine/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.d.ts +21 -0
- package/dist/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.js +49 -0
- package/dist/lib/Components/visualization/ReferenceLine/utils.d.ts +50 -0
- package/dist/lib/Components/visualization/ReferenceLine/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/utils.js +66 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts +9 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.js +50 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts +12 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.js +82 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.d.ts +58 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.js +80 -0
- package/dist/lib/Components/visualization/Scrubber/Scrubber.d.ts +29 -0
- package/dist/lib/Components/visualization/Scrubber/Scrubber.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/Scrubber.js +114 -0
- package/dist/lib/Components/visualization/Scrubber/ScrubberProvider.d.ts +3 -0
- package/dist/lib/Components/visualization/Scrubber/ScrubberProvider.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/ScrubberProvider.js +154 -0
- package/dist/lib/Components/visualization/Scrubber/context/index.d.ts +2 -0
- package/dist/lib/Components/visualization/Scrubber/context/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/context/scrubberContext.d.ts +8 -0
- package/dist/lib/Components/visualization/Scrubber/context/scrubberContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/context/scrubberContext.js +9 -0
- package/dist/lib/Components/visualization/Scrubber/index.d.ts +4 -0
- package/dist/lib/Components/visualization/Scrubber/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/types.d.ts +130 -0
- package/dist/lib/Components/visualization/Scrubber/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/useScrubberGeometry.d.ts +29 -0
- package/dist/lib/Components/visualization/Scrubber/useScrubberGeometry.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/useScrubberGeometry.js +37 -0
- package/dist/lib/Components/visualization/Scrubber/utils.d.ts +79 -0
- package/dist/lib/Components/visualization/Scrubber/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/utils.js +104 -0
- package/dist/lib/Components/visualization/config.d.ts +162 -0
- package/dist/lib/Components/visualization/config.d.ts.map +1 -0
- package/dist/lib/Components/visualization/config.js +156 -0
- package/dist/lib/Components/visualization/index.d.ts +8 -0
- package/dist/lib/Components/visualization/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/index.js +27 -0
- package/dist/lib/Components/visualization/utils/domain/domain.d.ts +18 -0
- package/dist/lib/Components/visualization/utils/domain/domain.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/domain/domain.js +35 -0
- package/dist/lib/Components/visualization/utils/index.d.ts +2 -0
- package/dist/lib/Components/visualization/utils/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/numbers.d.ts +13 -0
- package/dist/lib/Components/visualization/utils/numbers.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/numbers.js +5 -0
- package/dist/lib/Components/visualization/utils/scales/scales.d.ts +47 -0
- package/dist/lib/Components/visualization/utils/scales/scales.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/scales/scales.js +32 -0
- package/dist/lib/Components/visualization/utils/ticks/ticks.d.ts +35 -0
- package/dist/lib/Components/visualization/utils/ticks/ticks.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/ticks/ticks.js +23 -0
- package/dist/lib/Components/visualization/utils/types.d.ts +63 -0
- package/dist/lib/Components/visualization/utils/types.d.ts.map +1 -0
- package/dist/libs/design-core/dist/lib/colorContrast/colorContrast.js +15 -0
- package/dist/libs/design-core/dist/lib/colorContrast/hexToHsl.js +14 -0
- package/dist/libs/design-core/dist/lib/colorContrast/hslToHex.js +10 -0
- package/dist/libs/design-core/dist/lib/themes/js/primitives/primitive.colors.js +15 -0
- package/dist/libs/utils-shared/dist/index.js +115 -113
- package/dist/package.json +11 -3
- package/package.json +12 -4
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { DrawingArea } from '../../utils/types';
|
|
3
|
+
import { ChartTooltipItemData, SvgTextContent } from '../types';
|
|
4
|
+
type Widths = {
|
|
5
|
+
title: number;
|
|
6
|
+
labels: number[];
|
|
7
|
+
values: number[];
|
|
8
|
+
};
|
|
9
|
+
type UseTooltipMeasurementReturn = {
|
|
10
|
+
widths: Widths | null;
|
|
11
|
+
titleRef: RefObject<SVGTextElement | null>;
|
|
12
|
+
labelRefs: RefObject<(SVGTextElement | null)[]>;
|
|
13
|
+
valueRefs: RefObject<(SVGTextElement | null)[]>;
|
|
14
|
+
};
|
|
15
|
+
export declare const safeGetBBoxWidth: (el: SVGGraphicsElement | null) => number;
|
|
16
|
+
/**
|
|
17
|
+
* Derive the auto-fit tooltip width from measured text widths,
|
|
18
|
+
* clamped to a minimum floor.
|
|
19
|
+
*/
|
|
20
|
+
export declare const computeTooltipWidth: (widths: Widths | null, hasTitle: boolean, minWidth: number) => number;
|
|
21
|
+
/**
|
|
22
|
+
* Compute the tooltip's horizontal position, flipping to the left
|
|
23
|
+
* of the scrubber line when it would overflow the drawing area.
|
|
24
|
+
*/
|
|
25
|
+
export declare const computeTooltipX: (pixelX: number, offset: number, tooltipWidth: number, drawingArea: DrawingArea) => number;
|
|
26
|
+
/**
|
|
27
|
+
* Compute the total tooltip height from item count and title presence.
|
|
28
|
+
*/
|
|
29
|
+
export declare const computeTooltipHeight: (itemCount: number, hasTitle: boolean) => number;
|
|
30
|
+
/**
|
|
31
|
+
* Vertical offset where tooltip rows begin, accounting for title presence.
|
|
32
|
+
*/
|
|
33
|
+
export declare const computeItemsBaseY: (drawingAreaY: number, hasTitle: boolean) => number;
|
|
34
|
+
/**
|
|
35
|
+
* Manages SVG text measurement for the tooltip via `getBBox`.
|
|
36
|
+
*
|
|
37
|
+
* A single `ResizeObserver` is created on mount and reused for the component's
|
|
38
|
+
* entire lifetime, avoiding the cost of tearing down and recreating an observer
|
|
39
|
+
* on every scrubber movement.
|
|
40
|
+
*
|
|
41
|
+
* The re-measure / re-observe effect's dependency is a shape signature (labels
|
|
42
|
+
* + title + count) rather than the raw `items` reference, so high-frequency
|
|
43
|
+
* value updates during a scrub do not trigger a fresh measurement or
|
|
44
|
+
* disconnect / re-observe cycle. The `ResizeObserver` still picks up real
|
|
45
|
+
* geometry changes (e.g. value strings widening past the current rect).
|
|
46
|
+
*/
|
|
47
|
+
export declare function useTooltipMeasurement(items: ChartTooltipItemData[], hasTitle: boolean, title: SvgTextContent | undefined): UseTooltipMeasurementReturn;
|
|
48
|
+
type SvgTextRefSetter = (el: SVGTextElement | null) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Builds stable per-index ref-callback arrays that mutate the given refs in
|
|
51
|
+
* place. Recomputed only when `length` changes, so the same callback identity
|
|
52
|
+
* is passed to each `ChartTooltipItem` across scrub frames. This unlocks
|
|
53
|
+
* `React.memo` on `ChartTooltipItem` and avoids the per-frame detach /
|
|
54
|
+
* re-attach dance of inline arrow ref callbacks.
|
|
55
|
+
*/
|
|
56
|
+
export declare const useBuildRefSetters: (refs: RefObject<(SVGTextElement | null)[]>, length: number) => SvgTextRefSetter[];
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAIrE,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC3C,SAAS,EAAE,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,SAAS,EAAE,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,IAAI,kBAAkB,GAAG,IAAI,KAAG,MAOhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,MAAM,GAAG,IAAI,EACrB,UAAU,OAAO,EACjB,UAAU,MAAM,KACf,MAUF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,cAAc,MAAM,EACpB,aAAa,WAAW,KACvB,MAOF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,UAAU,OAAO,KAChB,MAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,UAAU,OAAO,KAChB,MAGF,CAAC;AA4BF;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,EAAE,EAC7B,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,cAAc,GAAG,SAAS,GAChC,2BAA2B,CAuD7B;AAED,KAAK,gBAAgB,GAAG,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,EAC1C,QAAQ,MAAM,KACb,gBAAgB,EAUlB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { useRef as a, useState as B, useEffect as R, useLayoutEffect as x, useMemo as W } from "react";
|
|
2
|
+
import { chartConfig as H } from "../../config.js";
|
|
3
|
+
const { tooltip: u } = H, d = (t) => {
|
|
4
|
+
if (!t || typeof t.getBBox != "function") return 0;
|
|
5
|
+
try {
|
|
6
|
+
return t.getBBox().width;
|
|
7
|
+
} catch {
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
}, w = (t, r, n) => {
|
|
11
|
+
const e = t && r ? t.title : 0, o = t ? t.labels.map(
|
|
12
|
+
(f, h) => f + u.labelValueGap + (t.values[h] ?? 0)
|
|
13
|
+
) : [], s = Math.max(e, ...o) + u.paddingX * 2;
|
|
14
|
+
return Math.max(s, n);
|
|
15
|
+
}, E = (t, r, n, e) => {
|
|
16
|
+
const o = t + r + n > e.x + e.width;
|
|
17
|
+
return Math.max(
|
|
18
|
+
e.x,
|
|
19
|
+
o ? t - r - n : t + r
|
|
20
|
+
);
|
|
21
|
+
}, T = (t, r) => {
|
|
22
|
+
const n = r ? u.rowHeight + u.titleGap : 0;
|
|
23
|
+
return u.paddingY * 2 + n + t * u.rowHeight + (t - 1) * u.rowGap;
|
|
24
|
+
}, L = (t, r) => {
|
|
25
|
+
const n = r ? u.rowHeight + u.titleGap : 0;
|
|
26
|
+
return t + u.paddingY + n;
|
|
27
|
+
}, S = (t, r, n) => {
|
|
28
|
+
let e = "";
|
|
29
|
+
for (let c = 0; c < t.length; c++) {
|
|
30
|
+
c > 0 && (e += "");
|
|
31
|
+
const s = t[c].label;
|
|
32
|
+
e += typeof s == "string" || typeof s == "number" ? String(s) : "";
|
|
33
|
+
}
|
|
34
|
+
const o = typeof n == "string" || typeof n == "number" ? String(n) : "";
|
|
35
|
+
return `${r ? "1" : "0"}|${e}|${o}`;
|
|
36
|
+
};
|
|
37
|
+
function Y(t, r, n) {
|
|
38
|
+
const e = a(null), o = a([]), c = a([]), s = a(null), f = a(() => {
|
|
39
|
+
}), [h, b] = B(null);
|
|
40
|
+
f.current = () => {
|
|
41
|
+
const p = r ? d(e.current) : 0, i = t.map(
|
|
42
|
+
(v, g) => d(o.current[g])
|
|
43
|
+
), l = t.map(
|
|
44
|
+
(v, g) => d(c.current[g])
|
|
45
|
+
);
|
|
46
|
+
b({
|
|
47
|
+
title: p,
|
|
48
|
+
labels: i,
|
|
49
|
+
values: l
|
|
50
|
+
});
|
|
51
|
+
}, R(() => {
|
|
52
|
+
if (!(typeof ResizeObserver > "u"))
|
|
53
|
+
return s.current = new ResizeObserver(() => f.current()), () => s.current?.disconnect();
|
|
54
|
+
}, []);
|
|
55
|
+
const y = S(t, r, n), m = a(t.length);
|
|
56
|
+
return m.current = t.length, x(() => {
|
|
57
|
+
const p = m.current;
|
|
58
|
+
if (p === 0) return;
|
|
59
|
+
o.current.length = p, c.current.length = p, f.current();
|
|
60
|
+
const i = s.current;
|
|
61
|
+
i && (i.disconnect(), e.current && i.observe(e.current), o.current.forEach((l) => l && i.observe(l)), c.current.forEach((l) => l && i.observe(l)));
|
|
62
|
+
}, [y]), { widths: h, titleRef: e, labelRefs: o, valueRefs: c };
|
|
63
|
+
}
|
|
64
|
+
const $ = (t, r) => W(() => {
|
|
65
|
+
const n = new Array(r);
|
|
66
|
+
for (let e = 0; e < r; e++)
|
|
67
|
+
n[e] = (o) => {
|
|
68
|
+
t.current[e] = o;
|
|
69
|
+
};
|
|
70
|
+
return n;
|
|
71
|
+
}, [t, r]);
|
|
72
|
+
export {
|
|
73
|
+
L as computeItemsBaseY,
|
|
74
|
+
T as computeTooltipHeight,
|
|
75
|
+
w as computeTooltipWidth,
|
|
76
|
+
E as computeTooltipX,
|
|
77
|
+
d as safeGetBBoxWidth,
|
|
78
|
+
$ as useBuildRefSetters,
|
|
79
|
+
Y as useTooltipMeasurement
|
|
80
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ScrubberProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders the scrubber visuals: vertical reference line, future-data overlay
|
|
4
|
+
* rect, per-series beacon dots, and an optional tooltip when
|
|
5
|
+
* {@link ScrubberProps.tooltip} is set, using {@link DefaultScrubberTooltip}.
|
|
6
|
+
*
|
|
7
|
+
* Must be used as a child of `LineChart` (or `CartesianChart`) with
|
|
8
|
+
* `enableScrubbing` enabled. Renders nothing when no scrubber position is active.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <LineChart series={data} enableScrubbing>
|
|
13
|
+
* <Scrubber showBeacons />
|
|
14
|
+
* </LineChart>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Tooltip
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Scrubber
|
|
20
|
+
* tooltip={(i) => ({
|
|
21
|
+
* title: `${counts[i]} Transactions`,
|
|
22
|
+
* items: [{ label: 'Index', value: String(i) }],
|
|
23
|
+
* minWidth: 160,
|
|
24
|
+
* })}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function Scrubber({ hideLine, hideOverlay, showBeacons, tooltip, }: Readonly<ScrubberProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
29
|
+
//# sourceMappingURL=Scrubber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Scrubber/Scrubber.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAoD7C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAgB,EAChB,WAAmB,EACnB,WAAmB,EACnB,OAAO,GACR,EAAE,QAAQ,CAAC,aAAa,CAAC,kDAwDzB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsxs as f, jsx as t, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { useId as b } from "react";
|
|
3
|
+
import { chartConfig as h } from "../config.js";
|
|
4
|
+
import { DefaultScrubberTooltip as m } from "./DefaultScrubberTooltip/DefaultScrubberTooltip.js";
|
|
5
|
+
import { useScrubberGeometry as g } from "./useScrubberGeometry.js";
|
|
6
|
+
const { color: C, strokeWidth: x, scrubber: e } = h;
|
|
7
|
+
function k({ pixelX: r, top: s, bottom: o }) {
|
|
8
|
+
const l = b();
|
|
9
|
+
return /* @__PURE__ */ f(y, { children: [
|
|
10
|
+
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */ f(
|
|
11
|
+
"linearGradient",
|
|
12
|
+
{
|
|
13
|
+
id: l,
|
|
14
|
+
gradientUnits: "userSpaceOnUse",
|
|
15
|
+
x1: r,
|
|
16
|
+
y1: s,
|
|
17
|
+
x2: r,
|
|
18
|
+
y2: o,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ t(
|
|
21
|
+
"stop",
|
|
22
|
+
{
|
|
23
|
+
offset: "0%",
|
|
24
|
+
stopColor: e.lineColor,
|
|
25
|
+
stopOpacity: e.lineGradientEdgeOpacity
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ t("stop", { offset: "20%", stopColor: e.lineColor }),
|
|
29
|
+
/* @__PURE__ */ t("stop", { offset: "80%", stopColor: e.lineColor }),
|
|
30
|
+
/* @__PURE__ */ t(
|
|
31
|
+
"stop",
|
|
32
|
+
{
|
|
33
|
+
offset: "100%",
|
|
34
|
+
stopColor: e.lineColor,
|
|
35
|
+
stopOpacity: e.lineGradientEdgeOpacity
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
) }),
|
|
41
|
+
/* @__PURE__ */ t(
|
|
42
|
+
"line",
|
|
43
|
+
{
|
|
44
|
+
"data-testid": "scrubber-line",
|
|
45
|
+
x1: r,
|
|
46
|
+
y1: s,
|
|
47
|
+
x2: r,
|
|
48
|
+
y2: o,
|
|
49
|
+
stroke: `url(#${l})`,
|
|
50
|
+
strokeWidth: x.hairline
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
function j({
|
|
56
|
+
hideLine: r = !1,
|
|
57
|
+
hideOverlay: s = !1,
|
|
58
|
+
showBeacons: o = !1,
|
|
59
|
+
tooltip: l
|
|
60
|
+
}) {
|
|
61
|
+
const p = g({ showBeacons: o, tooltip: l });
|
|
62
|
+
if (!p)
|
|
63
|
+
return null;
|
|
64
|
+
const { pixelX: c, drawingArea: n, beacons: u, overlay: a, tooltipPayload: i } = p;
|
|
65
|
+
return /* @__PURE__ */ f("g", { "data-testid": "scrubber", children: [
|
|
66
|
+
!r && /* @__PURE__ */ t(
|
|
67
|
+
k,
|
|
68
|
+
{
|
|
69
|
+
pixelX: c,
|
|
70
|
+
top: n.y,
|
|
71
|
+
bottom: n.y + n.height
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
!s && /* @__PURE__ */ t(
|
|
75
|
+
"rect",
|
|
76
|
+
{
|
|
77
|
+
"data-testid": "scrubber-overlay",
|
|
78
|
+
x: a.x,
|
|
79
|
+
y: a.y,
|
|
80
|
+
width: a.width,
|
|
81
|
+
height: a.height,
|
|
82
|
+
fill: e.overlayColor,
|
|
83
|
+
opacity: e.overlayOpacity
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
o && u.map((d) => /* @__PURE__ */ t(
|
|
87
|
+
"circle",
|
|
88
|
+
{
|
|
89
|
+
"data-testid": `scrubber-beacon-${d.id}`,
|
|
90
|
+
cx: c,
|
|
91
|
+
cy: d.pixelY,
|
|
92
|
+
r: e.beaconRadius,
|
|
93
|
+
fill: d.stroke,
|
|
94
|
+
stroke: C.markOutline,
|
|
95
|
+
strokeWidth: e.beaconStrokeWidth
|
|
96
|
+
},
|
|
97
|
+
d.id
|
|
98
|
+
)),
|
|
99
|
+
i !== void 0 && /* @__PURE__ */ t(
|
|
100
|
+
m,
|
|
101
|
+
{
|
|
102
|
+
pixelX: c,
|
|
103
|
+
drawingArea: n,
|
|
104
|
+
title: i.resolvedTitle,
|
|
105
|
+
items: i.items,
|
|
106
|
+
offset: i.offset,
|
|
107
|
+
minWidth: i.minWidth
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] });
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
j as Scrubber
|
|
114
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ScrubberProviderProps } from './types';
|
|
2
|
+
export declare function ScrubberProvider({ children, svgRef, enableScrubbing, onScrubberPositionChange, magnetRadius, }: Readonly<ScrubberProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=ScrubberProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAwB,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAU3E,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,MAAM,EACN,eAAe,EACf,wBAAwB,EACxB,YAA2C,GAC5C,EAAE,QAAQ,CAAC,qBAAqB,CAAC,2CAmOjC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { jsx as K } from "react/jsx-runtime";
|
|
2
|
+
import { useState as j, useRef as C, useMemo as X, useCallback as c, useEffect as z } from "react";
|
|
3
|
+
import { chartConfig as H } from "../config.js";
|
|
4
|
+
import { clamp as g } from "../utils/numbers.js";
|
|
5
|
+
import { buildSortedMagnets as N, getDataIndexFromPosition as U, resolvePixelX as V, applyMagnetization as G } from "./utils.js";
|
|
6
|
+
import { useCartesianChartContext as J } from "../CartesianChart/context/cartesianChartContext.js";
|
|
7
|
+
import { useMagneticSnapshot as O } from "../Point/pointContext/magneticPointsContext.js";
|
|
8
|
+
import { ScrubberContextProvider as Q } from "./context/scrubberContext.js";
|
|
9
|
+
const { scrubber: l } = H;
|
|
10
|
+
function te({
|
|
11
|
+
children: T,
|
|
12
|
+
svgRef: D,
|
|
13
|
+
enableScrubbing: r,
|
|
14
|
+
onScrubberPositionChange: R,
|
|
15
|
+
magnetRadius: E = l.defaultMagnetRadius
|
|
16
|
+
}) {
|
|
17
|
+
const { getXScale: m, getXAxisConfig: v, dataLength: n } = J(), { getMagneticPoints: w, version: B } = O(), [h, F] = j(
|
|
18
|
+
void 0
|
|
19
|
+
), p = C(h);
|
|
20
|
+
p.current = h;
|
|
21
|
+
const L = C(null), f = C(0), A = X(() => {
|
|
22
|
+
const e = w();
|
|
23
|
+
return N({
|
|
24
|
+
magneticIndices: e,
|
|
25
|
+
getPixelForIndex: (t) => V(t, m, v())
|
|
26
|
+
});
|
|
27
|
+
}, [B, w, m, v]), a = c(
|
|
28
|
+
(e) => {
|
|
29
|
+
const t = e === void 0 || n <= 0 ? void 0 : g(e, 0, n - 1);
|
|
30
|
+
F(t), R?.(t);
|
|
31
|
+
},
|
|
32
|
+
[n, R]
|
|
33
|
+
), I = c(
|
|
34
|
+
(e) => {
|
|
35
|
+
const t = m();
|
|
36
|
+
if (!t || !r || n <= 0) return;
|
|
37
|
+
const i = v();
|
|
38
|
+
let o = U(
|
|
39
|
+
e,
|
|
40
|
+
t,
|
|
41
|
+
i,
|
|
42
|
+
n
|
|
43
|
+
);
|
|
44
|
+
E > 0 && (o = G({
|
|
45
|
+
resolvedIndex: o,
|
|
46
|
+
pixelX: e,
|
|
47
|
+
sortedMagnets: A,
|
|
48
|
+
magnetRadius: E
|
|
49
|
+
})), o !== p.current && a(o);
|
|
50
|
+
},
|
|
51
|
+
[
|
|
52
|
+
r,
|
|
53
|
+
m,
|
|
54
|
+
v,
|
|
55
|
+
n,
|
|
56
|
+
A,
|
|
57
|
+
E,
|
|
58
|
+
a
|
|
59
|
+
]
|
|
60
|
+
), u = c(
|
|
61
|
+
(e) => {
|
|
62
|
+
L.current = e, f.current || (f.current = requestAnimationFrame(() => {
|
|
63
|
+
f.current = 0;
|
|
64
|
+
const t = L.current;
|
|
65
|
+
t !== null && (L.current = null, I(t));
|
|
66
|
+
}));
|
|
67
|
+
},
|
|
68
|
+
[I]
|
|
69
|
+
), s = c(() => {
|
|
70
|
+
r && a(void 0);
|
|
71
|
+
}, [r, a]), x = c(
|
|
72
|
+
(e) => {
|
|
73
|
+
const i = e.currentTarget.getBoundingClientRect();
|
|
74
|
+
u(e.clientX - i.left);
|
|
75
|
+
},
|
|
76
|
+
[u]
|
|
77
|
+
), P = c(
|
|
78
|
+
(e) => {
|
|
79
|
+
if (!r || !e.touches.length) return;
|
|
80
|
+
const t = e.touches[0], o = e.currentTarget.getBoundingClientRect();
|
|
81
|
+
u(t.clientX - o.left);
|
|
82
|
+
},
|
|
83
|
+
[r, u]
|
|
84
|
+
), k = c(
|
|
85
|
+
(e) => {
|
|
86
|
+
if (!e.touches.length) return;
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
const t = e.touches[0], o = e.currentTarget.getBoundingClientRect();
|
|
89
|
+
u(t.clientX - o.left);
|
|
90
|
+
},
|
|
91
|
+
[u]
|
|
92
|
+
), M = c(
|
|
93
|
+
(e) => {
|
|
94
|
+
if (!r || n <= 0) return;
|
|
95
|
+
const t = n - 1, i = p.current ?? t, o = e.shiftKey ? g(
|
|
96
|
+
Math.floor(t * l.keyboardPageStepRatio),
|
|
97
|
+
l.keyboardPageStepMin,
|
|
98
|
+
l.keyboardPageStepMax
|
|
99
|
+
) : l.keyboardStep;
|
|
100
|
+
let d;
|
|
101
|
+
switch (e.key) {
|
|
102
|
+
case "ArrowLeft":
|
|
103
|
+
e.preventDefault(), d = g(i - o, 0, t);
|
|
104
|
+
break;
|
|
105
|
+
case "ArrowRight":
|
|
106
|
+
e.preventDefault(), d = g(i + o, 0, t);
|
|
107
|
+
break;
|
|
108
|
+
case "Home":
|
|
109
|
+
e.preventDefault(), d = 0;
|
|
110
|
+
break;
|
|
111
|
+
case "End":
|
|
112
|
+
e.preventDefault(), d = t;
|
|
113
|
+
break;
|
|
114
|
+
case "Escape":
|
|
115
|
+
e.preventDefault(), d = void 0;
|
|
116
|
+
break;
|
|
117
|
+
default:
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
a(d);
|
|
121
|
+
},
|
|
122
|
+
[r, n, a]
|
|
123
|
+
), y = c(() => {
|
|
124
|
+
!r || p.current === void 0 || s();
|
|
125
|
+
}, [r, s]);
|
|
126
|
+
z(() => {
|
|
127
|
+
const e = D.current;
|
|
128
|
+
if (!(!e || !r))
|
|
129
|
+
return e.addEventListener("mousemove", x), e.addEventListener("mouseleave", s), e.addEventListener("touchstart", P, { passive: !1 }), e.addEventListener("touchmove", k, { passive: !1 }), e.addEventListener("touchend", s), e.addEventListener("touchcancel", s), e.addEventListener("keydown", M), e.addEventListener("blur", y), () => {
|
|
130
|
+
e.removeEventListener("mousemove", x), e.removeEventListener("mouseleave", s), e.removeEventListener("touchstart", P), e.removeEventListener("touchmove", k), e.removeEventListener("touchend", s), e.removeEventListener("touchcancel", s), e.removeEventListener("keydown", M), e.removeEventListener("blur", y), cancelAnimationFrame(f.current), f.current = 0;
|
|
131
|
+
};
|
|
132
|
+
}, [
|
|
133
|
+
D,
|
|
134
|
+
r,
|
|
135
|
+
x,
|
|
136
|
+
s,
|
|
137
|
+
P,
|
|
138
|
+
k,
|
|
139
|
+
M,
|
|
140
|
+
y
|
|
141
|
+
]);
|
|
142
|
+
const q = X(
|
|
143
|
+
() => ({
|
|
144
|
+
enableScrubbing: r,
|
|
145
|
+
scrubberPosition: h,
|
|
146
|
+
onScrubberPositionChange: a
|
|
147
|
+
}),
|
|
148
|
+
[r, h, a]
|
|
149
|
+
);
|
|
150
|
+
return /* @__PURE__ */ K(Q, { value: q, children: T });
|
|
151
|
+
}
|
|
152
|
+
export {
|
|
153
|
+
te as ScrubberProvider
|
|
154
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/Scrubber/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ScrubberContextValue } from '../types';
|
|
2
|
+
declare const ScrubberContextProvider: import('react').FC<{
|
|
3
|
+
children: import('react').ReactNode;
|
|
4
|
+
value: ScrubberContextValue;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const useScrubberContext: () => ScrubberContextValue;
|
|
7
|
+
export { ScrubberContextProvider };
|
|
8
|
+
//# sourceMappingURL=scrubberContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrubberContext.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/Scrubber/context/scrubberContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,QAAA,MAAO,uBAAuB;;;EACuB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,QAAO,oBAIlC,CAAC;AAEL,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createSafeContext as e } from "../../../../../libs/utils-shared/dist/index.js";
|
|
2
|
+
const [o, r] = e("Scrubber"), u = () => r({
|
|
3
|
+
consumerName: "useScrubberContext",
|
|
4
|
+
contextRequired: !0
|
|
5
|
+
});
|
|
6
|
+
export {
|
|
7
|
+
o as ScrubberContextProvider,
|
|
8
|
+
u as useScrubberContext
|
|
9
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Scrubber } from './Scrubber';
|
|
2
|
+
export { useScrubberContext } from './context';
|
|
3
|
+
export type { ChartTooltipItemData, ChartTooltipItemProps, ScrubberContextValue, ScrubberProps, ScrubberTooltipContent, ScrubberTooltipProps, SvgTextContent, } from './types';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Scrubber/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, Ref, RefObject, SVGProps } from 'react';
|
|
2
|
+
import { ScrubbingOptions } from '../CartesianChart/types';
|
|
3
|
+
import { DrawingArea } from '../utils/types';
|
|
4
|
+
export type ScrubberContextValue = Required<Pick<ScrubbingOptions, 'enableScrubbing' | 'onScrubberPositionChange'>> & {
|
|
5
|
+
/**
|
|
6
|
+
* The current data index of the scrubber, or undefined when idle.
|
|
7
|
+
*/
|
|
8
|
+
scrubberPosition: number | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type ScrubberProviderProps = Omit<ScrubbingOptions, 'enableScrubbing'> & Required<Pick<ScrubbingOptions, 'enableScrubbing'>> & {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Ref to the root SVG element where event listeners will be attached.
|
|
14
|
+
*/
|
|
15
|
+
svgRef: RefObject<SVGSVGElement | null>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Valid content for an SVG `<text>` element: a plain string,
|
|
19
|
+
* a number, or a `<tspan>` element.
|
|
20
|
+
*/
|
|
21
|
+
export type SvgTextContent = string | number | ReactElement<SVGProps<SVGTSpanElement>, 'tspan'>;
|
|
22
|
+
export type ChartTooltipItemData = {
|
|
23
|
+
/**
|
|
24
|
+
* Label displayed on the left side of the row.
|
|
25
|
+
*/
|
|
26
|
+
label: SvgTextContent;
|
|
27
|
+
/**
|
|
28
|
+
* Value displayed on the right side of the row.
|
|
29
|
+
*/
|
|
30
|
+
value: SvgTextContent;
|
|
31
|
+
};
|
|
32
|
+
export type ChartTooltipItemProps = ChartTooltipItemData & {
|
|
33
|
+
/**
|
|
34
|
+
* X position in SVG coordinate space.
|
|
35
|
+
* @default 0
|
|
36
|
+
*/
|
|
37
|
+
x?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Y midline position in SVG coordinate space.
|
|
40
|
+
* @default 0
|
|
41
|
+
*/
|
|
42
|
+
y?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Width allocated to this row, used to right-align the value text.
|
|
45
|
+
*/
|
|
46
|
+
width: number;
|
|
47
|
+
/**
|
|
48
|
+
* Optional ref forwarded to the label `<text>` element. Useful to measure
|
|
49
|
+
* the label's natural width via `getBBox` for auto-fit layouts.
|
|
50
|
+
*/
|
|
51
|
+
labelRef?: Ref<SVGTextElement>;
|
|
52
|
+
/**
|
|
53
|
+
* Optional ref forwarded to the value `<text>` element. Useful to measure
|
|
54
|
+
* the value's natural width via `getBBox` for auto-fit layouts.
|
|
55
|
+
*/
|
|
56
|
+
valueRef?: Ref<SVGTextElement>;
|
|
57
|
+
};
|
|
58
|
+
export type ScrubberTooltipLayoutProps = {
|
|
59
|
+
/**
|
|
60
|
+
* Horizontal gap in pixels between the scrubber line and the tooltip box.
|
|
61
|
+
* @default 10
|
|
62
|
+
*/
|
|
63
|
+
offset?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Minimum width in pixels. The tooltip auto-fits to the rendered content
|
|
66
|
+
* but never collapses below this floor; raise it to avoid jitter when
|
|
67
|
+
* value length changes between indices.
|
|
68
|
+
* @default 80
|
|
69
|
+
*/
|
|
70
|
+
minWidth?: number;
|
|
71
|
+
};
|
|
72
|
+
export type ScrubberTooltipProps = ScrubberTooltipLayoutProps & {
|
|
73
|
+
/**
|
|
74
|
+
* Horizontal pixel position of the scrubber line within the SVG coordinate
|
|
75
|
+
* space. Used to place the tooltip left or right of the line.
|
|
76
|
+
*/
|
|
77
|
+
pixelX: number;
|
|
78
|
+
/**
|
|
79
|
+
* Bounding box of the chart's drawing area (x, y, width, height). Used to
|
|
80
|
+
* constrain the tooltip so it never overflows the chart boundaries.
|
|
81
|
+
*/
|
|
82
|
+
drawingArea: DrawingArea;
|
|
83
|
+
/**
|
|
84
|
+
* Optional title displayed at the top of the tooltip. Omit to render
|
|
85
|
+
* the tooltip without a title row.
|
|
86
|
+
*/
|
|
87
|
+
title?: SvgTextContent;
|
|
88
|
+
/**
|
|
89
|
+
* List of label/value pairs rendered as rows inside the tooltip body.
|
|
90
|
+
*/
|
|
91
|
+
items: ChartTooltipItemData[];
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Return value of the `tooltip` callback on {@link ScrubberProps}.
|
|
95
|
+
*/
|
|
96
|
+
export type ScrubberTooltipContent = ScrubberTooltipLayoutProps & {
|
|
97
|
+
/**
|
|
98
|
+
* Optional header. Static value or callback per data index.
|
|
99
|
+
* A callback may return `undefined` to suppress the title.
|
|
100
|
+
*/
|
|
101
|
+
title?: SvgTextContent | ((index: number) => SvgTextContent | undefined);
|
|
102
|
+
/**
|
|
103
|
+
* Tooltip rows for this index. Return an empty array to hide the tooltip.
|
|
104
|
+
*/
|
|
105
|
+
items: ChartTooltipItemData[];
|
|
106
|
+
};
|
|
107
|
+
export type ScrubberProps = {
|
|
108
|
+
/**
|
|
109
|
+
* Hides the vertical reference line.
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
hideLine?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Hides the semi-transparent overlay that dims data after the scrubber position.
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
hideOverlay?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Shows the beacon dots on each series at the scrubbed data index.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
showBeacons?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Produces tooltip content for the active data index. When set, {@link DefaultScrubberTooltip}
|
|
125
|
+
* is rendered. Optional `offset` and `minWidth` on the returned object tune layout.
|
|
126
|
+
* Return `{ items: [] }` to hide the tooltip at an index.
|
|
127
|
+
*/
|
|
128
|
+
tooltip?: (dataIndex: number) => ScrubberTooltipContent;
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Scrubber/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CACzC,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,0BAA0B,CAAC,CACvE,GAAG;IACF;;OAEG;IACH,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GAC3E,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,GAAG;IACpD,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;CACzC,CAAC;AAEJ;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,MAAM,GACN,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG;IACzD;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG;IAC9D;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,GAAG;IAChE;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC,CAAC;IACzE;;OAEG;IACH,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,sBAAsB,CAAC;CACzD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DrawingArea } from '../utils/types';
|
|
2
|
+
import { ScrubberProps } from './types';
|
|
3
|
+
import { OverlayRect, ScrubberTooltipPayload } from './utils';
|
|
4
|
+
type Beacon = {
|
|
5
|
+
id: string;
|
|
6
|
+
stroke: string;
|
|
7
|
+
pixelY: number;
|
|
8
|
+
};
|
|
9
|
+
type ScrubberGeometry = {
|
|
10
|
+
pixelX: number;
|
|
11
|
+
drawingArea: DrawingArea;
|
|
12
|
+
beacons: Beacon[];
|
|
13
|
+
overlay: OverlayRect;
|
|
14
|
+
tooltipPayload: ScrubberTooltipPayload | undefined;
|
|
15
|
+
};
|
|
16
|
+
type UseScrubberGeometryParams = {
|
|
17
|
+
showBeacons: boolean;
|
|
18
|
+
tooltip: ScrubberProps['tooltip'];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Resolves the scrubber's chart geometry: reads the scrubber and chart
|
|
22
|
+
* contexts, projects the active data index to the line's `pixelX`, and derives
|
|
23
|
+
* the per-series beacons, the future-data overlay rect, and the tooltip
|
|
24
|
+
* payload. Returns `null` when no scrubber position is active or the position
|
|
25
|
+
* cannot be projected.
|
|
26
|
+
*/
|
|
27
|
+
export declare const useScrubberGeometry: ({ showBeacons, tooltip, }: UseScrubberGeometryParams) => ScrubberGeometry | null;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=useScrubberGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrubberGeometry.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Scrubber/useScrubberGeometry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC5B,MAAM,SAAS,CAAC;AAIjB,KAAK,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D,KAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,WAAW,CAAC;IACrB,cAAc,EAAE,sBAAsB,GAAG,SAAS,CAAC;CACpD,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACnC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,2BAGjC,yBAAyB,KAAG,gBAAgB,GAAG,IA4CjD,CAAC"}
|