awesome-timeline-react 0.2.0 → 0.3.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.
package/README.md CHANGED
@@ -86,7 +86,19 @@ The following properties for Timeline component are available:
86
86
 
87
87
  - `eventPromptTemplate` - function that can be passed for event prompt. Function receives currently hovered `event` object. It returns JSX Element so it can be customize in various ways. The example is in story. (The prompt is regular DOM — JSX still works here.)
88
88
 
89
- - `panZoom` – interaction configuration: `panOnDragBackground` (default true), `ctrlWheelZoom` (default true), `middleClickGranularity` (default true), `zoomStepSeconds` (default 900).
89
+ - `panZoom` – interaction configuration:
90
+ - `panOnDragBackground` (default true) – drag the background to pan.
91
+ - `ctrlWheelZoom` (default true) – **Ctrl/Cmd + wheel** (and Mac trackpad pinch) zooms the visible time frame around the cursor.
92
+ - `pinchZoom` (default true) – two-finger pinch zooms the time frame on touch devices.
93
+ - `dragZoom` (default true) – **Ctrl/Cmd + drag** the background to zoom (right = in, left = out).
94
+ - `minWindowSeconds` / `maxWindowSeconds` – zoom limits (defaults 900s / 30 days).
95
+ - `zoomWheelFactor` (default 1.15) – span multiplier per wheel notch.
96
+ - `middleClickGranularity` (default true) – middle-click toggles **wheel = grid granularity** mode.
97
+ - `zoomStepSeconds` (default 900) – grid-granularity step.
98
+
99
+ > Time-frame zoom changes how much time is visible; grid granularity (`cellWidth`) changes how wide a grid cell is drawn. Since 0.2.x, Ctrl+wheel does time-frame zoom and grid granularity lives on middle-click+wheel.
100
+
101
+ - `timeBar` – configure the two-row time bar (see Time bar rows). Defaults to a day row over an hour row.
90
102
 
91
103
  - `animations` – layout animations when events re-stack (rows growing, events changing lanes). `true` (default), `false` to disable, or `{ layoutMs?: number, fadeMs?: number }` to tune (defaults 200/120; `layoutMs` is the stacking tween, `fadeMs` the resize-handle fade). A dropped event always lands instantly — only the events re-stacking around it animate.
92
104
 
@@ -105,11 +117,49 @@ CSS classes cannot style canvas pixels, so canvas-drawn elements are themed with
105
117
  timeBarBorder: "yellow",
106
118
  timeBarTextColor: "white",
107
119
  font: "12px Inter", // defaults to the canvas element's computed font
120
+ // bar geometry — themeable since 0.2.x (defaults shown)
121
+ barHeight: 20, // event bar height
122
+ laneGap: 2, // gap between stacked lanes (laneHeight = barHeight + laneGap)
123
+ rowPaddingY: 10, // vertical padding above/below bars in a row
124
+ barRadius: 5, // event bar corner radius
108
125
  }}
109
126
  ...
110
127
  />
111
128
  ```
112
129
 
130
+ Bar geometry tokens drive row heights, lane stacking, hit-testing, and the drag
131
+ ghost together — changing `barHeight`/`laneGap` restacks and re-measures rows
132
+ automatically. (Per-event `style.borderRadius` still overrides `barRadius`.)
133
+
134
+ ## Time bar rows
135
+
136
+ The time bar has two rows. By default the top row shows calendar days and the
137
+ bottom row shows hours, but each row's unit and label are configurable via
138
+ `timeBar`:
139
+
140
+ ```tsx
141
+ <Timeline
142
+ timeBar={{
143
+ topRow: { unit: "day" }, // "hour" | "day" | "week" | "month"
144
+ bottomRow: {
145
+ unit: { stepSeconds: 8 * 3600 }, // or a fixed step in seconds
146
+ format: (start, end) => `Shift ${Math.floor(start.getHours() / 8) + 1}`,
147
+ },
148
+ }}
149
+ ...
150
+ />
151
+ ```
152
+
153
+ - `unit` – `"hour" | "day" | "week" | "month"`, or `{ stepSeconds }` for fixed
154
+ steps (weeks start on Monday; custom steps anchor to local midnight).
155
+ - `format(blockStart, blockEnd)` – optional label override; defaults mirror the
156
+ built-in `Mon 1 Jan` (day) and `HH:00` (hour) labels.
157
+
158
+ The time bar is purely presentational: it never changes the visible time range
159
+ or the grid. Vertical grid lines and drop snapping stay on the grid cell
160
+ (`cellWidth`), independent of the time-bar rows — so e.g. an 8-hour bottom row
161
+ can sit over an hourly grid.
162
+
113
163
  ## Custom event rendering (`drawEvent`)
114
164
 
115
165
  For visuals beyond `label` + `style`, draw the event yourself. Resolution order: per-event `props.drawEvent` → Timeline-level `drawEvent` → built-in default. Return `false` to fall through to the default.
@@ -171,6 +221,12 @@ Panning is smooth since 0.2.0: drag the background to move the time window with
171
221
 
172
222
  New in 0.2.0: `ref` (`TimelineHandle`), `theme`, `drawEvent`, `onEventClick`, `onEventHover`, `panZoom`.
173
223
 
224
+ New in 0.3.0:
225
+ - Themeable bar geometry — `theme.barHeight` / `laneGap` / `rowPaddingY` / `barRadius`.
226
+ - Configurable time-bar rows — `timeBar.topRow` / `bottomRow` (`unit` + `format`), units `hour`/`day`/`week`/`month` or `{ stepSeconds }`.
227
+ - Time-frame zoom — Ctrl/Cmd + wheel (and trackpad/touch pinch) and Ctrl + drag; grid granularity moved to middle-click + wheel. New `panZoom` keys: `pinchZoom`, `dragZoom`, `minWindowSeconds`, `maxWindowSeconds`, `zoomWheelFactor`.
228
+ - Fixes: time-bar hour labels follow panning on sub-day windows; grid lines stay aligned to the time-bar blocks while panning and zooming; the drag ghost inherits the dragged event's style; corrected weekday names.
229
+
174
230
  ## Roadmap
175
231
 
176
232
  Here, we will store major features planned for future releases (from highest to lowest priority):
@@ -179,6 +235,6 @@ Here, we will store major features planned for future releases (from highest to
179
235
  2. ~~Real time line~~ - published in 0.1.7 version
180
236
  3. ~~Customizable prompts after hovering over an event~~ - published in 0.1.14 version
181
237
  4. ~~Canvas rendering engine, virtualization, streaming API~~ - published in 0.2.0 version
182
- 5. Customizable second row of the time bar
183
- 6. Themeable bar geometry (heights, lane spacing, radius)
238
+ 5. ~~Customizable second row of the time bar~~ - `timeBar.topRow/bottomRow` (unit + format)
239
+ 6. ~~Themeable bar geometry (heights, lane spacing, radius)~~ - `theme.barHeight/laneGap/rowPaddingY/barRadius`
184
240
  7. Multi-select and rubber-band selection
@@ -44,6 +44,7 @@ declare type CanvasBoardProps = {
44
44
  rowsHeaderClassName?: string;
45
45
  setWindowTime: React_2.Dispatch<React_2.SetStateAction<number[]>>;
46
46
  setCellWidth: React_2.Dispatch<React_2.SetStateAction<number>>;
47
+ setTick: React_2.Dispatch<React_2.SetStateAction<number | null>>;
47
48
  onDrop?: (props: OnDropProps) => void;
48
49
  onResize?: (props: OnResizeProps) => void;
49
50
  onEventClick?: (props: OnEventClickProps) => void;
@@ -56,7 +57,12 @@ declare type CanvasBoardProps = {
56
57
  };
57
58
  };
58
59
 
59
- /** Drop: same cell-snap as row-content.tsx handleOnDrop. */
60
+ /**
61
+ * Drop: snap the dropped start to the nearest grid cell boundary. Cells are
62
+ * anchored to absolute time (multiples of the cell duration), matching the
63
+ * vertical grid lines (`drawGridLines`) — so a dropped event lands on a line
64
+ * regardless of how the window has been panned.
65
+ */
60
66
  export declare const computeDropTimes: ({ pointerX, cellWidth, tick, windowStart, duration, }: {
61
67
  pointerX: number;
62
68
  cellWidth: number;
@@ -79,6 +85,26 @@ tick: number, direction: "left" | "right") => {
79
85
  endTime: number;
80
86
  } | null;
81
87
 
88
+ /**
89
+ * Time-frame zoom: returns a new visible window (+ derived tick and cellWidth)
90
+ * for scaling the visible duration by `factor` (newDuration = oldDuration *
91
+ * factor; <1 zooms in, >1 zooms out), anchored so the timestamp under
92
+ * `anchorX` (px from the content's left edge) stays under that pixel.
93
+ *
94
+ * `tick` is recomputed from the new (integer-rounded) window; `cellWidth` is
95
+ * then derived from the *actual* new tick so time-per-cell (`cellWidth * tick`)
96
+ * — i.e. the grid cell duration the grid lines snap to — is preserved exactly.
97
+ * Rescaling cellWidth by the unrounded factor instead would let rounding drift
98
+ * the cell duration off the hour over many zooms, so the grid lines would creep
99
+ * out of step with the time-bar blocks. The new duration is clamped to the
100
+ * limits; the anchor still holds after clamping.
101
+ */
102
+ export declare const computeZoom: (windowTime: [number, number], tick: number, cellWidth: number, anchorX: number, factor: number, contentWidth: number, { minWindowSeconds, maxWindowSeconds }: ZoomLimits) => {
103
+ windowTime: [number, number];
104
+ tick: number;
105
+ cellWidth: number;
106
+ };
107
+
82
108
  /**
83
109
  * Returns the window-visible slice of a startTime-sorted event array.
84
110
  * Binary search cuts the tail (startTime > windowEnd) in O(log n); the head
@@ -102,19 +128,13 @@ export declare const default_alias: {
102
128
  */
103
129
  export declare const default_alias_1: React_2.ForwardRefExoticComponent<CanvasBoardProps & React_2.RefAttributes<HTMLDivElement>>;
104
130
 
105
- export declare const default_alias_10: ({ windowTime, setTick, setCellWidth, contentRef, }: {
106
- windowTime: number[];
107
- setTick: React.Dispatch<React.SetStateAction<number | null>>;
108
- setCellWidth: React.Dispatch<React.SetStateAction<number>>;
109
- contentRef: React.MutableRefObject<HTMLDivElement | null>;
110
- }) => void;
111
-
112
- export declare const default_alias_2: ({ windowTime, tick, contentWidth, scrollWidth, theme, }: {
131
+ export declare const default_alias_2: ({ windowTime, tick, contentWidth, scrollWidth, theme, timeBar, }: {
113
132
  windowTime: number[];
114
133
  tick: number | null;
115
134
  contentWidth: number | null;
116
135
  scrollWidth: number;
117
136
  theme?: ResolvedTheme;
137
+ timeBar?: TimeBarConfig;
118
138
  }) => React_2.JSX.Element;
119
139
 
120
140
  /**
@@ -142,24 +162,27 @@ export declare const default_alias_7: (eventA: EventType, eventB: EventType) =>
142
162
  * change grid granularity (middle-click mode or ctrl+wheel). Event mutations
143
163
  * are applied straight to the SceneStore — no React state on the hot path.
144
164
  */
145
- export declare const default_alias_8: ({ scene, rendererRef, dynamicCanvasRef, bodyRef, ghostRef, eventPromptRef, setWindowTime, setCellWidth, onDrop, onResize, onEventClick, onEventHover, eventsResize, panZoom, }: UseCanvasInteractionsArgs) => {
165
+ export declare const default_alias_8: ({ scene, rendererRef, dynamicCanvasRef, bodyRef, ghostRef, eventPromptRef, setWindowTime, setCellWidth, setTick, onDrop, onResize, onEventClick, onEventHover, eventsResize, panZoom, }: UseCanvasInteractionsArgs) => {
146
166
  handlePointerDown: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
147
167
  handlePointerMove: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
148
168
  handlePointerUp: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
149
169
  handlePointerLeave: () => void;
170
+ handlePointerCancel: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
150
171
  handleAuxClick: (pointerEvent: React_2.MouseEvent<HTMLCanvasElement>) => void;
151
172
  };
152
173
 
153
- export declare const default_alias_9: ({ windowTime, contentWidth, }: {
174
+ export declare const default_alias_9: ({ windowTime, setTick, setCellWidth, contentRef, }: {
154
175
  windowTime: number[];
155
- contentWidth: number | null;
156
- }) => {
157
- numberOfHourBlocks: number;
158
- blockWidth: number;
159
- };
176
+ setTick: React.Dispatch<React.SetStateAction<number | null>>;
177
+ setCellWidth: React.Dispatch<React.SetStateAction<number>>;
178
+ contentRef: React.MutableRefObject<HTMLDivElement | null>;
179
+ }) => void;
160
180
 
161
181
  export declare const DEFAULT_FADE_DURATION_MS = 120;
162
182
 
183
+ /** Defaults mirror the pre-0.2.x constants (20px bars, 22px lanes, 10px pad). */
184
+ export declare const DEFAULT_GEOMETRY: Geometry;
185
+
163
186
  export declare const DEFAULT_LAYOUT_DURATION_MS = 200;
164
187
 
165
188
  /** Defaults mirror the pre-0.2.0 stylesheet values. */
@@ -181,14 +204,18 @@ export { DrawEventFn as DrawEventFn_alias_1 }
181
204
  export declare const drawEvents: (ctx: CanvasRenderingContext2D, view: RendererView, scene: SceneStore, font: string, animator: LayoutAnimator) => void;
182
205
 
183
206
  /**
184
- * Vertical grid lines, one per cellWidth — canvas replacement for the ~N
185
- * line divs of lines-canvas.tsx. Matches the legacy "hide-last-line"
186
- * behavior: no line within 1px of the right edge.
207
+ * Vertical grid lines, one per grid cell (`cellWidth` px == `cellWidth * tick`
208
+ * seconds). Lines are anchored to absolute time — placed at cell boundaries
209
+ * (multiples of the cell duration), not at fixed screen offsets — so they pan
210
+ * with the content and stay aligned with the time-bar blocks. Keeps the legacy
211
+ * "hide-last-line" behavior: no line within 1px of either edge.
187
212
  */
188
- export declare const drawGridLines: (ctx: CanvasRenderingContext2D, { width, height, cellWidth, color, }: {
213
+ export declare const drawGridLines: (ctx: CanvasRenderingContext2D, { width, height, cellWidth, windowStart, tick, color, }: {
189
214
  width: number;
190
215
  height: number;
191
216
  cellWidth: number;
217
+ windowStart: number;
218
+ tick: number;
192
219
  color?: string;
193
220
  }) => void;
194
221
 
@@ -196,21 +223,20 @@ export declare const drawGridLines: (ctx: CanvasRenderingContext2D, { width, hei
196
223
  export declare const drawRowDividers: (ctx: CanvasRenderingContext2D, view: RendererView, scene: SceneStore, animator: LayoutAnimator) => void;
197
224
 
198
225
  /**
199
- * Day row over hour row — canvas replacement for the day/hour block divs of
200
- * time-bar.tsx. Background is left transparent so the .time-bar container
201
- * color shows through, exactly like the DOM blocks did.
226
+ * Two-row time bar (top row over bottom row) — canvas replacement for the
227
+ * day/hour block divs of time-bar.tsx. The two rows are unit-agnostic
228
+ * (day/hour by default, configurable via TimeBarConfig). Background is left
229
+ * transparent so the .time-bar container color shows through.
202
230
  */
203
- export declare const drawTimeBar: (ctx: CanvasRenderingContext2D, { width, height, dayBlocks, hourBlocks, font, borderColor, textColor, }: {
231
+ export declare const drawTimeBar: (ctx: CanvasRenderingContext2D, { width, height, topBlocks, bottomBlocks, font, borderColor, textColor, }: {
204
232
  width: number;
205
233
  height: number;
206
234
  font: string;
207
235
  borderColor?: string;
208
236
  textColor?: string;
209
- } & TimeBlocks) => void;
210
-
211
- export declare const EVENT_BAR_HEIGHT = 20;
212
-
213
- export declare const EVENT_RADIUS = 5;
237
+ topBlocks: TimeBlock[];
238
+ bottomBlocks: TimeBlock[];
239
+ }) => void;
214
240
 
215
241
  /** Imperative event mutation, applied without React re-renders. */
216
242
  declare type EventPatch = {
@@ -307,18 +333,58 @@ export declare class FrameScheduler {
307
333
  }
308
334
 
309
335
  /**
310
- * Pure extraction of the day/hour block generation previously inlined as JSX
311
- * in use-generate-blocks.tsx. Same walk over the window, same Math.round
312
- * block counting, same labels — but returns positioned data that both the
313
- * canvas time bar and tests can consume.
336
+ * The default two-row time bar: a day row over an hour row. Thin wrapper over
337
+ * `generateUnitBlocks` kept for the golden tests and as the documented
338
+ * default; the canvas time bar resolves `TimeBarConfig` and calls
339
+ * `generateUnitBlocks` per row directly.
314
340
  */
315
- export declare const generateTimeBlocks: ({ windowStart, tick, contentWidth, blockWidth, }: {
341
+ export declare const generateTimeBlocks: ({ windowStart, tick, contentWidth, }: {
316
342
  windowStart: number;
317
343
  tick: number | null;
318
344
  contentWidth: number | null;
319
- blockWidth: number;
345
+ /** @deprecated unused — block widths now derive from `tick` */
346
+ blockWidth?: number;
320
347
  }) => TimeBlocks;
321
348
 
349
+ /**
350
+ * Positioned blocks for one time-bar row. Walks real calendar/step boundaries
351
+ * from `windowStart` to `windowEnd` and derives each block's pixel x/width
352
+ * from `tick` (seconds per pixel), so blocks stay aligned to the wall clock as
353
+ * the window pans. The first/last blocks are clipped to the window edges, so
354
+ * the row tiles contiguously from x=0 to the content width.
355
+ */
356
+ export declare const generateUnitBlocks: ({ unit, format, windowStart, windowEnd, tick, }: TimeBarRowConfig & {
357
+ windowStart: number;
358
+ windowEnd: number;
359
+ tick: number | null;
360
+ }) => TimeBlock[];
361
+
362
+ /**
363
+ * Resolved vertical layout for event bars and rows (px). Derived once from the
364
+ * theme (see `geometryFromTheme`) and owned by the SceneStore, which both the
365
+ * renderer (`draw-events`) and hit-testing read so positioning stays in sync.
366
+ *
367
+ * Only `barHeight`, `laneGap`, `rowPaddingY`, and `barRadius` are themeable;
368
+ * the rest are derived from them.
369
+ */
370
+ export declare type Geometry = {
371
+ /** event bar height */
372
+ barHeight: number;
373
+ /** vertical stride between stacked lanes (barHeight + laneGap) */
374
+ laneHeight: number;
375
+ /** top padding before the first lane (== rowPaddingY) */
376
+ laneTopOffset: number;
377
+ /** minimum row height with no stacking (barHeight + 2*rowPaddingY) */
378
+ rowBaseHeight: number;
379
+ /** static-event height with no stacking (== barHeight) */
380
+ staticEventBaseHeight: number;
381
+ /** event bar corner radius */
382
+ barRadius: number;
383
+ };
384
+
385
+ /** Derive the full Geometry from the resolved theme's geometry tokens. */
386
+ export declare const geometryFromTheme: (theme: ResolvedTheme) => Geometry;
387
+
322
388
  export declare type HitTarget = {
323
389
  kind: "event" | "static";
324
390
  event: EventType;
@@ -345,16 +411,12 @@ export declare type HitTestView = {
345
411
 
346
412
  export declare const intersectsWindow: (event: EventType, windowStart: number, windowEnd: number) => boolean;
347
413
 
348
- export declare const LANE_HEIGHT = 22;
349
-
350
- export declare const LANE_TOP_OFFSET = 10;
351
-
352
414
  export declare type LaneResult = {
353
415
  laneOf: Map<string, number>;
354
416
  highestLane: number;
355
417
  };
356
418
 
357
- export declare const laneTop: (lane: number) => number;
419
+ export declare const laneTop: (lane: number, g?: Geometry) => number;
358
420
 
359
421
  export declare type Layer = "static" | "dynamic";
360
422
 
@@ -456,11 +518,24 @@ export { OnResizeProps as OnResizeProps_alias_1 }
456
518
  declare type PanZoomConfig = {
457
519
  /** drag the empty background to pan the time window (default true) */
458
520
  panOnDragBackground?: boolean;
459
- /** ctrl/cmd + wheel changes grid granularity (default true) */
521
+ /** ctrl/cmd + wheel (and trackpad pinch) zooms the visible time frame,
522
+ * anchored at the cursor (default true). Since 0.2.x this is time-frame
523
+ * zoom — grid granularity now lives on middle-click+wheel only. */
460
524
  ctrlWheelZoom?: boolean;
461
- /** middle-click toggles wheel-granularity mode (default true) */
525
+ /** two-finger pinch zooms the time frame on touch devices (default true) */
526
+ pinchZoom?: boolean;
527
+ /** ctrl/cmd + drag on the background zooms the time frame: drag right to zoom
528
+ * in, left to zoom out (default true) */
529
+ dragZoom?: boolean;
530
+ /** smallest visible window in seconds the zoom will go to (default 900 = 15 min) */
531
+ minWindowSeconds?: number;
532
+ /** largest visible window in seconds the zoom will go to (default 30 days) */
533
+ maxWindowSeconds?: number;
534
+ /** multiplier applied to the window per wheel notch (default 1.15) */
535
+ zoomWheelFactor?: number;
536
+ /** middle-click toggles wheel grid-granularity mode (default true) */
462
537
  middleClickGranularity?: boolean;
463
- /** seconds per granularity step (default 900 = 15 min) */
538
+ /** seconds per grid-granularity step (default 900 = 15 min) */
464
539
  zoomStepSeconds?: number;
465
540
  };
466
541
  export { PanZoomConfig }
@@ -507,9 +582,7 @@ export { ResolvedTheme as ResolvedTheme_alias_1 }
507
582
 
508
583
  export declare const resolveTheme: (theme?: Theme) => ResolvedTheme;
509
584
 
510
- export declare const ROW_BASE_HEIGHT = 40;
511
-
512
- export declare const rowMinHeight: (highestLane: number) => number;
585
+ export declare const rowMinHeight: (highestLane: number, g?: Geometry) => number;
513
586
 
514
587
  declare type RowType = {
515
588
  id: string;
@@ -532,7 +605,10 @@ export declare class SceneStore {
532
605
  private rowOrder;
533
606
  private eventRow;
534
607
  private listeners;
608
+ private geometry;
535
609
  version: number;
610
+ setGeometry(geometry: Geometry): void;
611
+ getGeometry(): Geometry;
536
612
  setRows(rows: RowType[]): void;
537
613
  setEvents(events: EventType[]): void;
538
614
  setStaticEvents(events: EventType[]): void;
@@ -564,17 +640,15 @@ export declare class SceneStore {
564
640
  */
565
641
  export declare const sizeCanvas: (canvas: HTMLCanvasElement, cssWidth: number, cssHeight: number, dpr: number) => CanvasRenderingContext2D | null;
566
642
 
567
- export declare const STATIC_EVENT_BASE_HEIGHT = 20;
568
-
569
- export declare const staticEventHeight: (highestLane: number) => number;
643
+ export declare const staticEventHeight: (highestLane: number, g?: Geometry) => number;
570
644
 
571
645
  /** Grid granularity step: same clamp as content.tsx handleOnWheel. */
572
646
  export declare const stepCellWidth: (cellWidth: number, deltaY: number, tick: number) => number;
573
647
 
574
648
  /**
575
- * Color/font tokens for everything drawn to canvas. Defaults mirror the
576
- * pre-0.2.0 stylesheet. (Bar geometry — heights, lane spacing, radius — is
577
- * not yet themeable.)
649
+ * Color/font/geometry tokens for everything drawn to canvas. Defaults mirror
650
+ * the pre-0.2.0 stylesheet. Bar geometry (height, lane spacing, row padding,
651
+ * radius) is themeable since 0.2.x — see `core/geometry.ts`.
578
652
  */
579
653
  declare type Theme = {
580
654
  eventFill?: string;
@@ -586,10 +660,38 @@ declare type Theme = {
586
660
  timeBarTextColor?: string;
587
661
  /** canvas text font; defaults to the canvas element's computed font */
588
662
  font?: string;
663
+ /** event bar height in px (default 20) */
664
+ barHeight?: number;
665
+ /** gap between stacked lanes in px; laneHeight = barHeight + laneGap (default 2) */
666
+ laneGap?: number;
667
+ /** vertical padding above/below the bars within a row in px (default 10) */
668
+ rowPaddingY?: number;
669
+ /** event bar corner radius in px (default 5) */
670
+ barRadius?: number;
589
671
  };
590
672
  export { Theme }
591
673
  export { Theme as Theme_alias_1 }
592
674
 
675
+ /** Per-row configuration for the two-row time bar. */
676
+ export declare type TimeBarConfig = {
677
+ topRow?: TimeBarRowConfig;
678
+ bottomRow?: TimeBarRowConfig;
679
+ };
680
+
681
+ export declare type TimeBarRowConfig = {
682
+ /** the unit each block spans (default: "day" for the top row, "hour" for
683
+ * the bottom row), or a fixed step like `{ stepSeconds: 8 * 3600 }`. */
684
+ unit?: TimeBarUnit | {
685
+ stepSeconds: number;
686
+ };
687
+ /** label for a block; receives the block's start and end. Defaults mirror
688
+ * the built-in day ("Mon 1 Jan") and hour ("HH:00") labels. */
689
+ format?: (blockStart: Date, blockEnd: Date) => string;
690
+ };
691
+
692
+ /** Calendar unit for a time-bar row, or a fixed step in seconds. */
693
+ export declare type TimeBarUnit = "hour" | "day" | "week" | "month";
694
+
593
695
  export declare type TimeBlock = {
594
696
  label: string;
595
697
  x: number;
@@ -638,6 +740,14 @@ declare type TimelineHandle = {
638
740
  export { TimelineHandle }
639
741
  export { TimelineHandle as TimelineHandle_alias_1 }
640
742
 
743
+ /**
744
+ * A small, sub-day window (~6h). With a window narrower than a day the time
745
+ * bar must still track the hour labels to the actual time as you pan — pan the
746
+ * background and watch the hour labels advance continuously (rather than
747
+ * staying pinned and then jumping by a whole day near midnight).
748
+ */
749
+ export declare const TimelineNarrowWindow: () => React_2.JSX.Element;
750
+
641
751
  export declare const TimelinePrimary: () => React_2.JSX.Element;
642
752
 
643
753
  declare type TimelineProps = {
@@ -659,6 +769,8 @@ declare type TimelineProps = {
659
769
  showEventPrompt?: boolean;
660
770
  eventPromptTemplate?: (event: EventType) => JSX.Element;
661
771
  panZoom?: PanZoomConfig;
772
+ /** configure each row's unit/label in the two-row time bar */
773
+ timeBar?: TimeBarConfig;
662
774
  /** layout animations: true (default), false to disable, or durations */
663
775
  animations?: AnimationConfig;
664
776
  };
@@ -697,6 +809,14 @@ export declare class TimelineRenderer {
697
809
  private drawFrame;
698
810
  }
699
811
 
812
+ /**
813
+ * Configurable time-bar rows: a day row over 8-hour "shift" blocks instead of
814
+ * hours. The bottom row uses `{ stepSeconds: 8 * 3600 }` with a custom
815
+ * `format`. Grid lines and drop snapping stay on the hour grid, independent of
816
+ * the time-bar rows.
817
+ */
818
+ export declare const TimelineShiftBar: () => React_2.JSX.Element;
819
+
700
820
  /**
701
821
  * 10k events across 500 rows with a fake websocket pushing 200 random
702
822
  * event moves every 100ms through the imperative handle — zero React
@@ -704,6 +824,14 @@ export declare class TimelineRenderer {
704
824
  */
705
825
  export declare const TimelineStreaming10k: () => React_2.JSX.Element;
706
826
 
827
+ /**
828
+ * Themeable bar geometry: chunky 32px bars with a 6px lane gap, wide row
829
+ * padding, and a larger corner radius. Verifies stacking, hit-testing
830
+ * (hover/resize zones), drag-ghost height, and header alignment all follow the
831
+ * geometry. Compare with TimelineCanvas (default 20px bars).
832
+ */
833
+ export declare const TimelineThemed: () => React_2.JSX.Element;
834
+
707
835
  /** @deprecated renamed to TimelineProps in 0.2.0 */
708
836
  declare type TimelineType = TimelineProps;
709
837
  export { TimelineType }
@@ -722,6 +850,7 @@ declare type UseCanvasInteractionsArgs = {
722
850
  eventPromptRef: React_2.MutableRefObject<EventPromptActionsType | null>;
723
851
  setWindowTime: React_2.Dispatch<React_2.SetStateAction<number[]>>;
724
852
  setCellWidth: React_2.Dispatch<React_2.SetStateAction<number>>;
853
+ setTick: React_2.Dispatch<React_2.SetStateAction<number | null>>;
725
854
  onDrop?: (props: OnDropProps) => void;
726
855
  onResize?: (props: OnResizeProps) => void;
727
856
  onEventClick?: (props: OnEventClickProps) => void;
@@ -735,4 +864,9 @@ export declare const watchDpr: (onChange: (dpr: number) => void) => (() => void)
735
864
 
736
865
  export declare const xToTime: (x: number, windowStart: number, tick: number) => number;
737
866
 
867
+ export declare type ZoomLimits = {
868
+ minWindowSeconds: number;
869
+ maxWindowSeconds: number;
870
+ };
871
+
738
872
  export { }