@moderneinc/react-charts 1.2.0-next.ceab4e → 1.2.0-next.e3d952

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.
@@ -0,0 +1,35 @@
1
+ import { Selection } from 'd3-selection';
2
+ export interface Slinky3DConfig {
3
+ categories: Array<{
4
+ name: string;
5
+ color: string;
6
+ seatCount: number;
7
+ }>;
8
+ centerX: number;
9
+ centerY: number;
10
+ radius: number;
11
+ arcAngle: number;
12
+ }
13
+ /**
14
+ * Generate HTML content for 3D slinky rings
15
+ */
16
+ export declare function generate3DSlinkyHTML(categories: Array<{
17
+ name: string;
18
+ color: string;
19
+ seatCount: number;
20
+ }>): string;
21
+ /**
22
+ * Generate CSS styles for 3D slinky effect
23
+ */
24
+ export declare function generate3DSlinkyStyles(instanceId: string): string;
25
+ /**
26
+ * Create 3D slinky elements in SVG using foreignObject
27
+ */
28
+ export declare function create3DSlinky(container: Selection<SVGGElement, unknown, null, undefined>, config: Slinky3DConfig, instanceId: string): {
29
+ wrapper: Selection<SVGForeignObjectElement, unknown, null, undefined>;
30
+ cleanup: () => void;
31
+ };
32
+ /**
33
+ * Animate 3D slinky compression using GSAP
34
+ */
35
+ export declare function animate3DSlinkyCompression(instanceId: string, timeline: gsap.core.Timeline, startTime: string, duration: number, targetX: number, targetY: number): void;
@@ -0,0 +1,25 @@
1
+ import { Selection } from 'd3-selection';
2
+ export interface SvgSlinkyConfig {
3
+ categories: Array<{
4
+ name: string;
5
+ color: string;
6
+ seatCount: number;
7
+ }>;
8
+ centerX: number;
9
+ centerY: number;
10
+ radius: number;
11
+ innerRadius: number;
12
+ arcAngle: number;
13
+ }
14
+ /**
15
+ * Create SVG slinky coils
16
+ */
17
+ export declare function createSvgSlinky(container: Selection<SVGGElement, unknown, null, undefined>, config: SvgSlinkyConfig, instanceId: string): {
18
+ slinkyGroup: Selection<SVGGElement, unknown, null, undefined>;
19
+ cleanup: () => void;
20
+ };
21
+ /**
22
+ * Animate SVG slinky closing - stacks rings vertically into a bar on the right
23
+ * Uses staggered animation phases to create realistic slinky walking effect
24
+ */
25
+ export declare function animateSvgSlinkyCompression(slinkyGroup: Selection<SVGGElement, unknown, null, undefined>, timeline: gsap.core.Timeline, startTime: string, duration: number, targetX: number, targetY: number): void;
@@ -3,12 +3,20 @@ export type TimelineEvent = {
3
3
  date: Date;
4
4
  timestamp: number;
5
5
  eventName: string;
6
+ /**
7
+ * Optional color for the event marker.
8
+ * If not provided, defaults to #2F42FF (Digital Blue 500).
9
+ * Accepts any valid CSS color string.
10
+ */
11
+ color?: string;
6
12
  [key: string]: unknown;
7
13
  };
8
14
  export type TimelineSelection = {
9
15
  start: number | null;
10
16
  end: number | null;
11
17
  };
18
+ export type DragHandleType = 'start' | 'end' | 'body' | null;
19
+ type DragHandleVariant = 'arrow' | 'grip';
12
20
  export type TimelineChartSlotProps = {
13
21
  /** Props for the header container (Stack) */
14
22
  header?: StackProps;
@@ -26,6 +34,10 @@ export type TimelineChartSlotProps = {
26
34
  event?: BoxProps;
27
35
  /** Props for the selection highlight overlay (Box) */
28
36
  selection?: BoxProps;
37
+ /** Props for the start drag handle (Box) */
38
+ startHandle?: BoxProps;
39
+ /** Props for the end drag handle (Box) */
40
+ endHandle?: BoxProps;
29
41
  /** Props for the hover tooltip container (Box) */
30
42
  tooltip?: BoxProps;
31
43
  /** Props for the tooltip event name Typography component */
@@ -59,6 +71,10 @@ export type TimelineChartProps = {
59
71
  monthLabelCount?: number;
60
72
  /** Enable zoom with mouse wheel */
61
73
  enableZoom?: boolean;
74
+ /** Drag handle style variant (default: 'arrow') */
75
+ dragHandleVariant?: DragHandleVariant;
76
+ /** Color for drag handles (default: '#4B5563' for arrow, '#9CA3AF' for grip) */
77
+ dragHandleColor?: string;
62
78
  /** Show header title and instructions (default: true) */
63
79
  showHeader?: boolean;
64
80
  /** Custom title for the header */
@@ -102,12 +118,14 @@ export type UseTimelineChartProps = {
102
118
  export type UseTimelineChartReturn = {
103
119
  isDragging: boolean;
104
120
  dragStart: number | null;
121
+ dragHandleType: DragHandleType;
105
122
  internalSelectedRange: TimelineSelection;
106
123
  internalVisibleRange: TimelineSelection;
107
124
  hoveredEvent: TimelineEvent | null;
108
125
  minDate: number;
109
126
  maxDate: number;
110
127
  timeSpan: number;
128
+ timelineContainerRef: React.RefObject<HTMLDivElement>;
111
129
  getPositionFromTimestamp: (timestamp: number) => number;
112
130
  getTimestampFromPosition: (x: number, containerWidth: number) => number;
113
131
  handleMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
@@ -115,9 +133,13 @@ export type UseTimelineChartReturn = {
115
133
  handleMouseUp: () => void;
116
134
  handleWheel: (e: React.WheelEvent<HTMLDivElement>) => void;
117
135
  handleDoubleClick: () => void;
136
+ handleStartHandleMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
137
+ handleEndHandleMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
138
+ handleSelectionBodyMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
118
139
  setHoveredEvent: (event: TimelineEvent | null) => void;
119
140
  getEventsInRange: () => TimelineEvent[];
120
141
  resetZoom: () => void;
142
+ showHandles: boolean;
121
143
  };
122
144
  export type TimelineSelectedEventsProps = {
123
145
  /** Array of selected events to display */
@@ -131,3 +153,4 @@ export type TimelineSelectedEventsProps = {
131
153
  /** Primary color for event items */
132
154
  primaryColor?: string;
133
155
  };
156
+ export {};