@moderneinc/react-charts 1.2.0-next.d2aaa2 → 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.
@@ -15,6 +15,8 @@ export type TimelineSelection = {
15
15
  start: number | null;
16
16
  end: number | null;
17
17
  };
18
+ export type DragHandleType = 'start' | 'end' | 'body' | null;
19
+ type DragHandleVariant = 'arrow' | 'grip';
18
20
  export type TimelineChartSlotProps = {
19
21
  /** Props for the header container (Stack) */
20
22
  header?: StackProps;
@@ -32,6 +34,10 @@ export type TimelineChartSlotProps = {
32
34
  event?: BoxProps;
33
35
  /** Props for the selection highlight overlay (Box) */
34
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;
35
41
  /** Props for the hover tooltip container (Box) */
36
42
  tooltip?: BoxProps;
37
43
  /** Props for the tooltip event name Typography component */
@@ -65,6 +71,10 @@ export type TimelineChartProps = {
65
71
  monthLabelCount?: number;
66
72
  /** Enable zoom with mouse wheel */
67
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;
68
78
  /** Show header title and instructions (default: true) */
69
79
  showHeader?: boolean;
70
80
  /** Custom title for the header */
@@ -108,12 +118,14 @@ export type UseTimelineChartProps = {
108
118
  export type UseTimelineChartReturn = {
109
119
  isDragging: boolean;
110
120
  dragStart: number | null;
121
+ dragHandleType: DragHandleType;
111
122
  internalSelectedRange: TimelineSelection;
112
123
  internalVisibleRange: TimelineSelection;
113
124
  hoveredEvent: TimelineEvent | null;
114
125
  minDate: number;
115
126
  maxDate: number;
116
127
  timeSpan: number;
128
+ timelineContainerRef: React.RefObject<HTMLDivElement>;
117
129
  getPositionFromTimestamp: (timestamp: number) => number;
118
130
  getTimestampFromPosition: (x: number, containerWidth: number) => number;
119
131
  handleMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
@@ -121,9 +133,13 @@ export type UseTimelineChartReturn = {
121
133
  handleMouseUp: () => void;
122
134
  handleWheel: (e: React.WheelEvent<HTMLDivElement>) => void;
123
135
  handleDoubleClick: () => void;
136
+ handleStartHandleMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
137
+ handleEndHandleMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
138
+ handleSelectionBodyMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
124
139
  setHoveredEvent: (event: TimelineEvent | null) => void;
125
140
  getEventsInRange: () => TimelineEvent[];
126
141
  resetZoom: () => void;
142
+ showHandles: boolean;
127
143
  };
128
144
  export type TimelineSelectedEventsProps = {
129
145
  /** Array of selected events to display */
@@ -137,3 +153,4 @@ export type TimelineSelectedEventsProps = {
137
153
  /** Primary color for event items */
138
154
  primaryColor?: string;
139
155
  };
156
+ export {};