@moderneinc/react-charts 1.2.0-next.2d0a72 → 1.2.0-next.313329

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 (29) hide show
  1. package/dist/components/chrono-chart/chrono-chart.component.d.ts +10 -0
  2. package/dist/components/chrono-chart/chrono-chart.types.d.ts +118 -0
  3. package/dist/components/chrono-chart/components/category-table.component.d.ts +13 -0
  4. package/dist/components/chrono-chart/components/category-table.types.d.ts +42 -0
  5. package/dist/components/chrono-chart/utils/data-transformer.d.ts +41 -0
  6. package/dist/components/d3-stacked-area-chart/d3-stacked-area-chart.types.d.ts +21 -1
  7. package/dist/components/d3-stacked-area-chart/hooks/use-d3-stacked-area.hook.d.ts +7 -2
  8. package/dist/components/morph-chart/hooks/shared/computations.d.ts +12 -8
  9. package/dist/components/morph-chart/hooks/shared/types.d.ts +9 -5
  10. package/dist/components/morph-chart/hooks/use-morph-chart.hook.d.ts +45 -1
  11. package/dist/components/morph-chart/morph-chart.types.d.ts +22 -0
  12. package/dist/components/morph-chart/utils/accordion-generator.d.ts +102 -0
  13. package/dist/components/morph-chart/utils/area-renderer.d.ts +1 -0
  14. package/dist/components/morph-chart/utils/bar-renderer.d.ts +0 -9
  15. package/dist/components/morph-chart/utils/gsap-orchestrator.d.ts +55 -16
  16. package/dist/components/morph-chart/utils/parliament-renderer.d.ts +2 -0
  17. package/dist/components/morph-chart/utils/slinky-3d-generator.d.ts +35 -0
  18. package/dist/components/morph-chart/utils/svg-slinky-generator.d.ts +25 -0
  19. package/dist/components/timeline-chart/timeline-chart.types.d.ts +30 -0
  20. package/dist/index.cjs +84 -78
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js +19340 -17737
  23. package/dist/theme/timeline-defaults.d.ts +33 -1
  24. package/package.json +6 -2
  25. package/dist/components/chrono-perspective-chart/chrono-perspective-chart.component.d.ts +0 -3
  26. package/dist/components/chrono-perspective-chart/chrono-perspective-chart.types.d.ts +0 -62
  27. package/dist/components/chrono-perspective-chart/components/category-table.component.d.ts +0 -3
  28. package/dist/components/chrono-perspective-chart/components/category-table.types.d.ts +0 -13
  29. package/dist/components/chrono-perspective-chart/utils/data-transformer.d.ts +0 -9
@@ -4,7 +4,7 @@ export declare const TIMELINE_DEFAULTS: {
4
4
  readonly primary: "#992FB9";
5
5
  readonly background: "#FFFFFF";
6
6
  readonly border: "#9CA3AF";
7
- readonly highlightBackground: "rgba(229, 231, 235, 0.5)";
7
+ readonly highlightBackground: "rgba(31, 41, 55, 0.14)";
8
8
  readonly monthLabel: "#9ca3af";
9
9
  readonly tooltipText: "#6b7280";
10
10
  };
@@ -13,6 +13,17 @@ export declare const TIMELINE_DEFAULTS: {
13
13
  readonly eventWidth: 2;
14
14
  };
15
15
  };
16
+ /**
17
+ * Get default slot props with arrow handle styling
18
+ */
19
+ export declare const getArrowHandleSlotProps: (color?: string) => {
20
+ startHandle: {
21
+ sx: SxProps<Theme>;
22
+ };
23
+ endHandle: {
24
+ sx: SxProps<Theme>;
25
+ };
26
+ };
16
27
  export declare const defaultSlotProps: {
17
28
  header: {
18
29
  sx: SxProps<Theme>;
@@ -38,6 +49,8 @@ export declare const defaultSlotProps: {
38
49
  selection: {
39
50
  sx: SxProps<Theme>;
40
51
  };
52
+ startHandle: {};
53
+ endHandle: {};
41
54
  tooltip: {
42
55
  sx: SxProps<Theme>;
43
56
  };
@@ -48,3 +61,22 @@ export declare const defaultSlotProps: {
48
61
  sx: SxProps<Theme>;
49
62
  };
50
63
  };
64
+ /**
65
+ * Get grip handle slot props with custom color
66
+ */
67
+ export declare const getGripHandleSlotProps: (color?: string) => {
68
+ startHandle: {
69
+ sx: SxProps<Theme>;
70
+ };
71
+ endHandle: {
72
+ sx: SxProps<Theme>;
73
+ };
74
+ };
75
+ export declare const gripHandleSlotProps: {
76
+ startHandle: {
77
+ sx: SxProps<Theme>;
78
+ };
79
+ endHandle: {
80
+ sx: SxProps<Theme>;
81
+ };
82
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moderneinc/react-charts",
3
- "version": "1.2.0-next.2d0a72",
3
+ "version": "1.2.0-next.313329",
4
4
  "description": "Parliament chart visualization library for React",
5
5
  "type": "module",
6
6
  "devEngines": {
@@ -26,6 +26,7 @@
26
26
  "scripts": {
27
27
  "build-storybook": "storybook build",
28
28
  "build": "tsc --noEmit && vite build",
29
+ "build:watch": "vite build --watch",
29
30
  "check:all": "npm run format && npm run check:lint:fix && npm run check:lint && npm run check:types && npm run test && npm run check:unused",
30
31
  "check:biome:fix": "biome check --write",
31
32
  "check:biome": "biome check",
@@ -54,9 +55,12 @@
54
55
  "recharts": ">=2.0.0"
55
56
  },
56
57
  "dependencies": {
58
+ "@dnd-kit/core": "^6.3.1",
59
+ "@dnd-kit/utilities": "^3.2.2",
57
60
  "d3-array": "^3.2.4",
58
61
  "d3-axis": "^3.0.0",
59
62
  "d3-brush": "^3.0.0",
63
+ "d3-force": "^3.0.0",
60
64
  "d3-selection": "^3.0.0",
61
65
  "d3-transition": "^3.0.1",
62
66
  "gsap": "^3.13.0",
@@ -104,7 +108,7 @@
104
108
  "react": "^19.1.1",
105
109
  "react-dom": "^19.1.1",
106
110
  "recharts": "^2.15.0",
107
- "semantic-release": "^24.2.0",
111
+ "semantic-release": "^25.0.2",
108
112
  "storybook": "^8.4.7",
109
113
  "typescript": "^5.9.2",
110
114
  "vite": "^6.0.11",
@@ -1,3 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { ChronoPerspectiveChartProps } from './chrono-perspective-chart.types';
3
- export declare const ChronoPerspectiveChart: FunctionComponent<ChronoPerspectiveChartProps>;
@@ -1,62 +0,0 @@
1
- import { TimelineEvent } from '../timeline-chart/timeline-chart.types';
2
- export type ChronoPerspectiveMode = 'point-in-time' | 'historical';
3
- export type ChronoPerspectiveCategory = {
4
- id: string;
5
- label: string;
6
- color: string;
7
- parliamentMapping?: {
8
- isSpecialCategory: boolean;
9
- hatchPattern?: string;
10
- };
11
- };
12
- export type ChronoPerspectiveData = {
13
- timeSeries: Array<{
14
- timestamp: number;
15
- values: Record<string, number>;
16
- }>;
17
- categories: ChronoPerspectiveCategory[];
18
- metadata: {
19
- totalRepositories: number;
20
- specialCounts?: {
21
- notApplicable: number;
22
- noLst: number;
23
- unavailable: number;
24
- };
25
- };
26
- events?: TimelineEvent[];
27
- };
28
- export type ChronoPerspectiveChartProps = {
29
- data: ChronoPerspectiveData;
30
- /**
31
- * @deprecated Use selectedIndex instead. Will be removed in next major version.
32
- * Mode prop kept for backward compatibility only.
33
- */
34
- mode?: ChronoPerspectiveMode;
35
- /**
36
- * Index of the time series data point to display in point-in-time mode.
37
- * - If set: Chart shows point-in-time view for data at this index
38
- * - If undefined: Chart shows historical view
39
- * - If data.timeSeries.length === 1: Automatically shows point-in-time mode
40
- *
41
- * Note: Changing selectedIndex does NOT trigger animation. Animation only
42
- * plays when toggling between point-in-time and historical modes.
43
- */
44
- selectedIndex?: number;
45
- title?: string;
46
- subtitle?: string;
47
- showHeader?: boolean;
48
- height?: number;
49
- timeRange?: [number, number];
50
- onTimeRangeChange?: (range: [number, number]) => void;
51
- enableBrush?: boolean;
52
- showLegend?: boolean;
53
- showTooltip?: boolean;
54
- showGrid?: boolean;
55
- enableAnimation?: boolean;
56
- animationDuration?: number;
57
- formatDate?: (timestamp: number) => string;
58
- formatValue?: (value: number) => string;
59
- onAnimationStateChange?: (isAnimating: boolean) => void;
60
- onTimelineReady?: (timeline: unknown) => void;
61
- onAnimationProgress?: (progress: number, stage: string) => void;
62
- };
@@ -1,3 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { CategoryTableProps } from './category-table.types';
3
- export declare const CategoryTable: FunctionComponent<CategoryTableProps>;
@@ -1,13 +0,0 @@
1
- export type CategoryTableItem = {
2
- id: string;
3
- label: string;
4
- value: number;
5
- percentage: number;
6
- color: string;
7
- tooltip?: string;
8
- };
9
- export type CategoryTableProps = {
10
- categories: CategoryTableItem[];
11
- activeCategory: string | null;
12
- onCategoryHover: (categoryId: string | null) => void;
13
- };
@@ -1,9 +0,0 @@
1
- import { MorphChartCategory, MorphChartDataPoint } from '../../morph-chart/morph-chart.types';
2
- import { ChronoPerspectiveData } from '../chrono-perspective-chart.types';
3
- import { CategoryTableItem } from '../components/category-table.types';
4
- export declare const extractLatestValues: (data: ChronoPerspectiveData) => CategoryTableItem[];
5
- export declare const transformToMorphChart: (data: ChronoPerspectiveData) => {
6
- data: MorphChartDataPoint[];
7
- categories: MorphChartCategory[];
8
- };
9
- export declare const validateChronoPerspectiveData: (data: ChronoPerspectiveData) => void;