@arbidocs/blocks 0.3.177 → 0.3.179

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.
@@ -292,6 +292,12 @@ interface TimelineItem {
292
292
  end?: string | null;
293
293
  /** Longer text shown in the detail panel. */
294
294
  description?: string;
295
+ /**
296
+ * Up to three CSS colours the bar is painted with — e.g. an item's label
297
+ * colours. One fills solid; two or three split the bar into equal segments.
298
+ * Omitted or empty renders a neutral bar; colours past the third are ignored.
299
+ */
300
+ colors?: readonly string[];
295
301
  }
296
302
 
297
303
  interface TimelineCalendarProps<T extends TimelineItem = TimelineItem> {
@@ -300,29 +306,86 @@ interface TimelineCalendarProps<T extends TimelineItem = TimelineItem> {
300
306
  onSelect?: (item: T) => void;
301
307
  /** Bars shown per week before the remainder collapses to "+n more". */
302
308
  maxLanes?: number;
309
+ /** Ids to treat as the current selection — positions the event navigator's
310
+ * ‹ n / N › on the matching event (e.g. the one open in the app's editor). */
311
+ selectedIds?: readonly string[];
312
+ /**
313
+ * Where the ‹ n / N › event navigator renders. Omit it for the built-in
314
+ * inline placement. Pass a host element (e.g. a slot in the app's own
315
+ * toolbar) to portal the navigator there instead — or `null` while that slot
316
+ * isn't mounted yet, which renders no navigator at all rather than falling
317
+ * back inline (avoids a flash of the inline one on first paint).
318
+ */
319
+ navigatorContainer?: HTMLElement | null;
320
+ /**
321
+ * Denominator shown by the navigator (`n / N`). Defaults to the number of
322
+ * dated items it can step through; a host may pass its full (filtered) item
323
+ * count instead so the figure matches the list it shows elsewhere, even when
324
+ * some of those items carry no date and so never appear here.
325
+ */
326
+ navigatorTotal?: number;
303
327
  /** Shown when nothing in `items` carries a date. */
304
328
  emptyState?: ReactNode;
305
329
  className?: string;
306
330
  /** Prefix for every `data-testid` this view emits. */
307
331
  testId?: string;
308
332
  }
309
- declare function TimelineCalendar<T extends TimelineItem = TimelineItem>({ items, onSelect, maxLanes, emptyState, className, testId, }: TimelineCalendarProps<T>): react.JSX.Element;
333
+ declare function TimelineCalendar<T extends TimelineItem = TimelineItem>({ items, onSelect, selectedIds, maxLanes, navigatorContainer, navigatorTotal, emptyState, className, testId, }: TimelineCalendarProps<T>): react.JSX.Element;
310
334
 
311
335
  interface TimelineGanttProps<T extends TimelineItem = TimelineItem> {
312
336
  items: T[];
313
337
  /** The selected item, or null when the panel closes. */
314
338
  onSelect?: (item: T | null) => void;
339
+ /**
340
+ * Ids to render as selected — e.g. rows a user checked in another view.
341
+ * Their bar and label are highlighted so the selection carries across views;
342
+ * this does not open the detail panel (that stays driven by clicks here).
343
+ */
344
+ selectedIds?: readonly string[];
315
345
  /** Extra detail-panel content for the selected item — sources, links, actions. */
316
346
  renderDetail?: (item: T) => ReactNode;
317
347
  /** Width of the row-label gutter, in pixels. */
318
348
  labelWidth?: number;
349
+ /**
350
+ * When provided, the label gutter becomes user-resizable: a drag handle
351
+ * appears on its right edge and this fires with the new width (px) as the
352
+ * user drags. The caller owns the value (so it can persist it) and feeds it
353
+ * back via `labelWidth`.
354
+ */
355
+ onLabelWidthChange?: (width: number) => void;
356
+ /** Clamp for the resizable gutter, in pixels. */
357
+ minLabelWidth?: number;
358
+ maxLabelWidth?: number;
359
+ /**
360
+ * Controlled date-axis zoom (1 = fit). Provide BOTH `zoom` and `onZoomChange`
361
+ * to drive it from outside — e.g. a button in the app's own header — which also
362
+ * suppresses the chart's built-in corner control. Omit them to use the internal
363
+ * state and the corner control.
364
+ */
365
+ zoom?: number;
366
+ onZoomChange?: (zoom: number) => void;
367
+ /**
368
+ * Where the ‹ n / N › event navigator renders. Omit it for the built-in
369
+ * inline placement. Pass a host element (e.g. a slot in the app's own
370
+ * toolbar) to portal the navigator there instead — or `null` while that slot
371
+ * isn't mounted yet, which renders no navigator at all rather than falling
372
+ * back inline (avoids a flash of the inline one on first paint).
373
+ */
374
+ navigatorContainer?: HTMLElement | null;
375
+ /**
376
+ * Denominator shown by the navigator (`n / N`). Defaults to the number of
377
+ * dated items it can step through; a host may pass its full (filtered) item
378
+ * count instead so the figure matches the list it shows elsewhere, even when
379
+ * some of those items carry no date and so never appear here.
380
+ */
381
+ navigatorTotal?: number;
319
382
  /** Shown when nothing in `items` carries a usable date. */
320
383
  emptyMessage?: string;
321
384
  className?: string;
322
385
  /** Prefix for every `data-testid` this view emits. */
323
386
  testId?: string;
324
387
  }
325
- declare function TimelineGantt<T extends TimelineItem = TimelineItem>({ items, onSelect, renderDetail, labelWidth, emptyMessage, className, testId, }: TimelineGanttProps<T>): react.JSX.Element;
388
+ declare function TimelineGantt<T extends TimelineItem = TimelineItem>({ items, onSelect, selectedIds, renderDetail, labelWidth, onLabelWidthChange, minLabelWidth, maxLabelWidth, zoom: zoomProp, onZoomChange, navigatorContainer, navigatorTotal, emptyMessage, className, testId, }: TimelineGanttProps<T>): react.JSX.Element;
326
389
 
327
390
  type TimelineViewMode = 'calendar' | 'gantt';
328
391
  interface TimelineProps<T extends TimelineItem = TimelineItem> {
@@ -292,6 +292,12 @@ interface TimelineItem {
292
292
  end?: string | null;
293
293
  /** Longer text shown in the detail panel. */
294
294
  description?: string;
295
+ /**
296
+ * Up to three CSS colours the bar is painted with — e.g. an item's label
297
+ * colours. One fills solid; two or three split the bar into equal segments.
298
+ * Omitted or empty renders a neutral bar; colours past the third are ignored.
299
+ */
300
+ colors?: readonly string[];
295
301
  }
296
302
 
297
303
  interface TimelineCalendarProps<T extends TimelineItem = TimelineItem> {
@@ -300,29 +306,86 @@ interface TimelineCalendarProps<T extends TimelineItem = TimelineItem> {
300
306
  onSelect?: (item: T) => void;
301
307
  /** Bars shown per week before the remainder collapses to "+n more". */
302
308
  maxLanes?: number;
309
+ /** Ids to treat as the current selection — positions the event navigator's
310
+ * ‹ n / N › on the matching event (e.g. the one open in the app's editor). */
311
+ selectedIds?: readonly string[];
312
+ /**
313
+ * Where the ‹ n / N › event navigator renders. Omit it for the built-in
314
+ * inline placement. Pass a host element (e.g. a slot in the app's own
315
+ * toolbar) to portal the navigator there instead — or `null` while that slot
316
+ * isn't mounted yet, which renders no navigator at all rather than falling
317
+ * back inline (avoids a flash of the inline one on first paint).
318
+ */
319
+ navigatorContainer?: HTMLElement | null;
320
+ /**
321
+ * Denominator shown by the navigator (`n / N`). Defaults to the number of
322
+ * dated items it can step through; a host may pass its full (filtered) item
323
+ * count instead so the figure matches the list it shows elsewhere, even when
324
+ * some of those items carry no date and so never appear here.
325
+ */
326
+ navigatorTotal?: number;
303
327
  /** Shown when nothing in `items` carries a date. */
304
328
  emptyState?: ReactNode;
305
329
  className?: string;
306
330
  /** Prefix for every `data-testid` this view emits. */
307
331
  testId?: string;
308
332
  }
309
- declare function TimelineCalendar<T extends TimelineItem = TimelineItem>({ items, onSelect, maxLanes, emptyState, className, testId, }: TimelineCalendarProps<T>): react.JSX.Element;
333
+ declare function TimelineCalendar<T extends TimelineItem = TimelineItem>({ items, onSelect, selectedIds, maxLanes, navigatorContainer, navigatorTotal, emptyState, className, testId, }: TimelineCalendarProps<T>): react.JSX.Element;
310
334
 
311
335
  interface TimelineGanttProps<T extends TimelineItem = TimelineItem> {
312
336
  items: T[];
313
337
  /** The selected item, or null when the panel closes. */
314
338
  onSelect?: (item: T | null) => void;
339
+ /**
340
+ * Ids to render as selected — e.g. rows a user checked in another view.
341
+ * Their bar and label are highlighted so the selection carries across views;
342
+ * this does not open the detail panel (that stays driven by clicks here).
343
+ */
344
+ selectedIds?: readonly string[];
315
345
  /** Extra detail-panel content for the selected item — sources, links, actions. */
316
346
  renderDetail?: (item: T) => ReactNode;
317
347
  /** Width of the row-label gutter, in pixels. */
318
348
  labelWidth?: number;
349
+ /**
350
+ * When provided, the label gutter becomes user-resizable: a drag handle
351
+ * appears on its right edge and this fires with the new width (px) as the
352
+ * user drags. The caller owns the value (so it can persist it) and feeds it
353
+ * back via `labelWidth`.
354
+ */
355
+ onLabelWidthChange?: (width: number) => void;
356
+ /** Clamp for the resizable gutter, in pixels. */
357
+ minLabelWidth?: number;
358
+ maxLabelWidth?: number;
359
+ /**
360
+ * Controlled date-axis zoom (1 = fit). Provide BOTH `zoom` and `onZoomChange`
361
+ * to drive it from outside — e.g. a button in the app's own header — which also
362
+ * suppresses the chart's built-in corner control. Omit them to use the internal
363
+ * state and the corner control.
364
+ */
365
+ zoom?: number;
366
+ onZoomChange?: (zoom: number) => void;
367
+ /**
368
+ * Where the ‹ n / N › event navigator renders. Omit it for the built-in
369
+ * inline placement. Pass a host element (e.g. a slot in the app's own
370
+ * toolbar) to portal the navigator there instead — or `null` while that slot
371
+ * isn't mounted yet, which renders no navigator at all rather than falling
372
+ * back inline (avoids a flash of the inline one on first paint).
373
+ */
374
+ navigatorContainer?: HTMLElement | null;
375
+ /**
376
+ * Denominator shown by the navigator (`n / N`). Defaults to the number of
377
+ * dated items it can step through; a host may pass its full (filtered) item
378
+ * count instead so the figure matches the list it shows elsewhere, even when
379
+ * some of those items carry no date and so never appear here.
380
+ */
381
+ navigatorTotal?: number;
319
382
  /** Shown when nothing in `items` carries a usable date. */
320
383
  emptyMessage?: string;
321
384
  className?: string;
322
385
  /** Prefix for every `data-testid` this view emits. */
323
386
  testId?: string;
324
387
  }
325
- declare function TimelineGantt<T extends TimelineItem = TimelineItem>({ items, onSelect, renderDetail, labelWidth, emptyMessage, className, testId, }: TimelineGanttProps<T>): react.JSX.Element;
388
+ declare function TimelineGantt<T extends TimelineItem = TimelineItem>({ items, onSelect, selectedIds, renderDetail, labelWidth, onLabelWidthChange, minLabelWidth, maxLabelWidth, zoom: zoomProp, onZoomChange, navigatorContainer, navigatorTotal, emptyMessage, className, testId, }: TimelineGanttProps<T>): react.JSX.Element;
326
389
 
327
390
  type TimelineViewMode = 'calendar' | 'gantt';
328
391
  interface TimelineProps<T extends TimelineItem = TimelineItem> {