gridsmith-ui 0.16.0 → 0.17.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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, LabelHTMLAttributes, TextareaHTMLAttributes, Ref, CSSProperties, ReactElement, HTMLAttributes, AnchorHTMLAttributes, ComponentType } from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, LabelHTMLAttributes, TextareaHTMLAttributes, Ref, CSSProperties, ReactElement, HTMLAttributes, RefObject, KeyboardEvent, AnchorHTMLAttributes, ComponentType } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { IconName } from './icons.js';
5
5
  import { C as ColumnKind, B as BreakpointKey } from './table-utils-GounRE6s.js';
@@ -1244,6 +1244,465 @@ interface StackedListProps {
1244
1244
  }
1245
1245
  declare const StackedList: react.ForwardRefExoticComponent<StackedListProps & react.RefAttributes<HTMLUListElement>>;
1246
1246
 
1247
+ /**
1248
+ * Dates on a time axis (Sprint 25.7, Part D). A calendar day is a whole-number day index: days since 1970-01-01,
1249
+ * counted on UTC day boundaries, so every day is the same width and a clock change never stretches or shrinks one.
1250
+ * A "YYYY-MM-DD" string is a calendar day in the user's zone and is never parsed as UTC (new Date("2026-03-03") is
1251
+ * 2 March, 19:00 in New York). Tick labels come from Intl in the locale, longest form first.
1252
+ */
1253
+ /** A Date, or a string: "YYYY-MM-DD" is a calendar day; any other string is a date-time. */
1254
+ type DateInput = Date | string;
1255
+ type TimeZoom = "day" | "week" | "month" | "quarter";
1256
+ /** Narrow to wide. */
1257
+ declare const TIME_ZOOMS: readonly TimeZoom[];
1258
+ /**
1259
+ * The day index of a date: "2026-03-03" → that calendar day's index; a Date or a date-time string → its local calendar
1260
+ * day plus the fraction of the day its local clock shows. NaN for anything that is not a date.
1261
+ */
1262
+ declare function dayOf(value: DateInput): number;
1263
+ /** Local midnight of that calendar day; a fraction adds that much of the day on the local clock. */
1264
+ declare function dateOfDay(day: number): Date;
1265
+ /**
1266
+ * Where a range that ends at `value` stops. A whole-day end is inclusive: "2026-03-14" (or a Date at local midnight,
1267
+ * as the date pickers give) → the start of 15 March. A date-time end is half-open: it stops at that moment.
1268
+ */
1269
+ declare function endDayOf(value: DateInput): number;
1270
+ interface TimeTick {
1271
+ /** Stable: "2026-09" for September 2026, "2026-09-07" for a day or the week starting on it, "2026-Q3", "2026". */
1272
+ key: string;
1273
+ /** The day index it starts on (the scale's start, for a period the scale cuts). */
1274
+ day: number;
1275
+ /** Px from the scale's start. */
1276
+ x: number;
1277
+ /** Px it spans: its label's room. */
1278
+ width: number;
1279
+ /** The weekday of the day it starts on: 0 is Sunday, as Date's getDay. */
1280
+ weekday: number;
1281
+ /** Longest first, from Intl in the locale: ["September", "Sept", "S"], ["Mon 7", "7"], ["2026", "26"]. */
1282
+ labels: string[];
1283
+ }
1284
+ /** A calendar day, as shadeDays sees it: its index, its weekday (0 is Sunday) and its "YYYY-MM-DD" key. */
1285
+ interface CalendarDay {
1286
+ day: number;
1287
+ weekday: number;
1288
+ key: string;
1289
+ }
1290
+ interface TimeScale {
1291
+ zoom: TimeZoom;
1292
+ /** The whole days shown, end exclusive: the range padded to whole minor periods. */
1293
+ startDay: number;
1294
+ endDay: number;
1295
+ pxPerDay: number;
1296
+ /** (endDay − startDay) × pxPerDay. */
1297
+ width: number;
1298
+ /** A date or a day index → px from the scale's start. */
1299
+ x(value: DateInput | number): number;
1300
+ /**
1301
+ * Where a range sits: px from the scale's start and its width. The end is inclusive for a whole day, as endDayOf
1302
+ * (so a day's bar is never a day short); a day index is where the range stops. Default: the start's own day.
1303
+ */
1304
+ span(start: DateInput | number, end?: DateInput | number): {
1305
+ x: number;
1306
+ width: number;
1307
+ };
1308
+ /** Px → the fractional day index there. */
1309
+ dayAt(x: number): number;
1310
+ /** The top row: months at day and week zoom, years at month and quarter zoom. */
1311
+ major: TimeTick[];
1312
+ /** The bottom row: days, weeks, months or quarters. */
1313
+ minor: TimeTick[];
1314
+ /** Today's day index when the scale shows it, else null. */
1315
+ today: number | null;
1316
+ /** The moment `today` names, as a fractional day index (its time of day), when the scale shows it: an hourly view's "now". */
1317
+ now: number | null;
1318
+ weekStartsOn: 0 | 1;
1319
+ locale?: string;
1320
+ }
1321
+ interface TimeScaleOptions {
1322
+ /** The extent to show (the data's first start to its last end, or timeExtent's); the scale pads it to whole minor periods. */
1323
+ start: DateInput | number;
1324
+ /** Inclusive for a whole day, as endDayOf. A day index is where the range stops. */
1325
+ end: DateInput | number;
1326
+ zoom: TimeZoom;
1327
+ /** Default now; demos and tests pass a fixed date (a date-time gives an hourly view its "now"). */
1328
+ today?: DateInput;
1329
+ /** Default 1 (Monday), as Calendar's. */
1330
+ weekStartsOn?: 0 | 1;
1331
+ /** Default the browser's. */
1332
+ locale?: string;
1333
+ /** Px per day at each level, where a view needs another density (the defaults fit each level's labels). */
1334
+ pxPerDay?: Partial<Record<TimeZoom, number>>;
1335
+ /** Whole minor periods of room before the start and after the end (default 0), so nothing sits against an edge. */
1336
+ pad?: number;
1337
+ }
1338
+ /**
1339
+ * Maps dates to pixels and back in calendar days, and makes the major and minor ticks for the zoom level. The scale
1340
+ * is the same object while its inputs mean the same days, so a Date made on every render does not rebuild it.
1341
+ */
1342
+ declare function useTimeScale({ start, end, zoom, today, weekStartsOn, locale, pxPerDay, pad }: TimeScaleOptions): TimeScale;
1343
+ /**
1344
+ * The earliest start and the latest end of some ranges, as day indices for useTimeScale: the end is where the last
1345
+ * range stops (inclusive for a whole day, as endDayOf), and a range with no end ends where it starts (a milestone).
1346
+ * NaN for no dated range, which the scale shows as today.
1347
+ */
1348
+ declare function timeExtent(ranges: Iterable<{
1349
+ start: DateInput;
1350
+ end?: DateInput;
1351
+ }>): {
1352
+ start: number;
1353
+ end: number;
1354
+ };
1355
+ interface DateRangeWords {
1356
+ locale?: string;
1357
+ /** Joins the two ends in place of Intl's separator. Default " to " in English, and Intl's own separator elsewhere. */
1358
+ to?: string;
1359
+ /** Intl options for the days. Default { day: "numeric", month: "long" }; the year is added when the ends' years differ. */
1360
+ day?: Intl.DateTimeFormatOptions;
1361
+ /** Intl options for the times of a date-time range. Default { hour: "2-digit", minute: "2-digit" }. */
1362
+ time?: Intl.DateTimeFormatOptions;
1363
+ }
1364
+ /**
1365
+ * A range in words, in the locale, for accessible names: "3 to 14 March", "28 September to 3 October", "16 September"
1366
+ * for one day. The end is inclusive for a whole day, as endDayOf (a day index is where the range stops). A date-time
1367
+ * range is named by its times, and the end's day only when it differs: "Friday 23 October, 06:00 to 14:00". Intl
1368
+ * joins each day and time in the locale's own way, and outside English the two ends too ("10/31(土曜日)~11/01(日曜日)");
1369
+ * the year shows when the two ends are in different years.
1370
+ */
1371
+ declare function formatDateRange(start: DateInput | number, end?: DateInput | number, { locale, to, day, time }?: DateRangeWords): string;
1372
+
1373
+ /**
1374
+ * What a TimeViewport gives the things drawn inside it (Sprint 25.7, Part D). The scroll position lives in a store of
1375
+ * its own, so rows that only need the scale do not re-render while the view scrolls; useTimeViewport() does.
1376
+ */
1377
+ interface TimeViewportApi {
1378
+ /** Scroll so the date (or day index) sits a little clear of the pinned column ("start"), or in the middle of the view. */
1379
+ scrollToDate(value: DateInput | number, align?: "start" | "center"): void;
1380
+ /** One visible width back or on (the previous and next period), ending on a minor tick. */
1381
+ page(direction: -1 | 1): void;
1382
+ /**
1383
+ * Scroll the least to show [x0, x1] (px on the scale) clear of the pinned column. A range wider than the view is
1384
+ * left alone while part of it shows, else brought in at its start.
1385
+ */
1386
+ ensureVisible(x0: number, x1: number): void;
1387
+ /** Scroll the least to show an element inside the rows clear of the pinned column and the sticky scale (a focused bar). */
1388
+ reveal(el: Element): void;
1389
+ }
1390
+ interface TimeViewportLayout extends TimeViewportApi {
1391
+ /** The scale the viewport draws: the one it was given, continued at its end to fill the viewport's width. */
1392
+ scale: TimeScale;
1393
+ /** The pinned label column's width, px (narrower on a phone). */
1394
+ labelWidth: number;
1395
+ /** Whether the Today marker (the line and its label) is drawn. */
1396
+ showToday: boolean;
1397
+ /** Px on the scale where the Today line and its label sit (todayAt), or null when they are not drawn. */
1398
+ todayX: number | null;
1399
+ /** The phone layout: the viewport is narrower than 640 px and its label column has narrowed (data-compact). */
1400
+ compact: boolean;
1401
+ }
1402
+ interface TimeViewportScroll {
1403
+ /** Px of the scale scrolled out of view behind the pinned column. */
1404
+ scrollLeft: number;
1405
+ /** Px of the scale in view, clear of the pinned column. */
1406
+ visibleWidth: number;
1407
+ }
1408
+ type TimeViewportState = TimeViewportLayout & TimeViewportScroll;
1409
+ /**
1410
+ * The viewport's scale (continued to fill it), its label width, compact flag, Today position and scrolling API, for
1411
+ * rows and the items in them. Unlike useTimeViewport(), it does not re-render as the view scrolls.
1412
+ */
1413
+ declare function useTimeViewportLayout(): TimeViewportLayout;
1414
+ /**
1415
+ * For anything drawn inside a TimeViewport (a Gantt's arrows, a marker, a header): the scale, what is in view now and
1416
+ * the viewport's scrolling. It re-renders as the view scrolls.
1417
+ */
1418
+ declare function useTimeViewport(): TimeViewportState;
1419
+
1420
+ interface TimeViewportProps {
1421
+ /** Controlled: what useTimeScale returns. The viewport shows it and asks for another zoom through onZoomChange. */
1422
+ scale: TimeScale;
1423
+ /** The toolbar's zoom buttons, + and − (and =), and Ctrl or ⌘ with the wheel. Without it there is no zoom. */
1424
+ onZoomChange?: (zoom: TimeZoom) => void;
1425
+ /** The levels offered, default TIME_ZOOMS. */
1426
+ zooms?: readonly TimeZoom[];
1427
+ /** The pinned label column, px (default 240). Narrower on a phone, never below a readable width. */
1428
+ labelWidth?: number;
1429
+ /** The corner cell above the labels ("Task"). */
1430
+ labelHeader?: ReactNode;
1431
+ /** The scale above the rows, default <TimeScaleHeader />; null for none. */
1432
+ header?: ReactNode;
1433
+ /** Controls after the built-in zoom out, zoom in and Today; they can call useTimeViewport(). False hides the bar. */
1434
+ toolbar?: ReactNode | false;
1435
+ /** Scrolled into the middle of the view on mount. Default today when the scale shows it, else the start. */
1436
+ initialDate?: DateInput;
1437
+ /** The Today line across the rows (default true). */
1438
+ showToday?: boolean;
1439
+ /**
1440
+ * Where the Today line and its label sit: the middle of today (default, for day-long items), or "now", the time of
1441
+ * day `today` gives the scale, for an hourly view (a rota's shifts).
1442
+ */
1443
+ todayAt?: "day" | "now";
1444
+ /**
1445
+ * Days to shade under the rows (weekends, holidays), by their weekday (0 is Sunday) or "YYYY-MM-DD" key: no date
1446
+ * maths for the caller. Drawn where a day is at least 4 px wide; narrower, the bands would only be stripes.
1447
+ */
1448
+ shadeDays?: (day: CalendarDay) => boolean;
1449
+ /**
1450
+ * The scroll region is a Tab stop (default true), so the view can be scrolled by keyboard. Pass false when the rows
1451
+ * hold a keyboard of their own with one Tab stop (a tree, a grid), which scrolls the view as focus moves.
1452
+ */
1453
+ tabStop?: boolean;
1454
+ /** <TimeRow> elements, or one element holding them (a role="grid" or role="tree" with the rows' keyboard). */
1455
+ children?: ReactNode;
1456
+ /** Names the scroll region. */
1457
+ "aria-label": string;
1458
+ className?: string;
1459
+ }
1460
+ type TimeViewportHandle = TimeViewportApi;
1461
+ interface TimeRowProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
1462
+ /** The row's cell in the pinned column: a name, an avatar and a name, a group's toggle. */
1463
+ label: ReactNode;
1464
+ /** Drawn on the row's track, which is as wide as the scale: place them with scale.x() from useTimeViewport(). */
1465
+ children?: ReactNode;
1466
+ /** Px, default 40. */
1467
+ height?: number;
1468
+ /** Classes for the pinned label cell (a selected row's tint). Its background stays opaque under them. */
1469
+ labelClassName?: string;
1470
+ "data-row-key"?: string;
1471
+ }
1472
+ interface TimeBarProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
1473
+ /** Where it starts: a Date, "YYYY-MM-DD" or a date-time string, or a day index. */
1474
+ start: DateInput | number;
1475
+ /** Where it ends: inclusive for a whole day, as endDayOf; a day index is where it stops. Default its start's day. */
1476
+ end?: DateInput | number;
1477
+ /** Px it is never drawn narrower than (default 0). */
1478
+ minWidth?: number;
1479
+ /**
1480
+ * Its label's forms, longest first (["Early", "E"]). The bar shows the longest that fits the part of itself in view
1481
+ * inside its own padding, which narrows on a short bar, and moves to a shorter form (never an ellipsis) as it slides
1482
+ * under the pinned column or past the view's end; none when even the shortest does not fit. The forms are for sight;
1483
+ * assistive technology reads the longest, or the bar's own name when it has one (aria-label, aria-labelledby).
1484
+ */
1485
+ labels?: readonly string[];
1486
+ /**
1487
+ * Custom content in place of `labels` (an icon and a title): kept in view beside the pinned column the same way,
1488
+ * never wider than the part of the bar in view (put text in a `truncate` span, which ends it with an ellipsis).
1489
+ */
1490
+ children?: ReactNode;
1491
+ "data-grid-key"?: string;
1492
+ }
1493
+ /**
1494
+ * The one scrolling area for anything on a time axis (Sprint 25.7, Part D): a Gantt, a roadmap, a resource scheduler.
1495
+ * One scroll container, so the scale sticks at the top and the label column at the start while the rows scroll under
1496
+ * both; it fills a frame of definite height (page_composition#17: no nested scroll containers). It draws the scale it
1497
+ * is given, continued to fill its width, and asks for another zoom: its toolbar, + and − (and =), and Ctrl or ⌘ with
1498
+ * the wheel step between the levels, keeping the date at the pointer or at the centre in place. It pans by scrolling,
1499
+ * by dragging on the scale and with Shift+Left and Right (one minor period). The scroll region is a named Tab stop,
1500
+ * so the view can be scrolled by keyboard with nothing focusable inside it.
1501
+ */
1502
+ declare const TimeViewport: react.ForwardRefExoticComponent<TimeViewportProps & react.RefAttributes<TimeViewportApi>>;
1503
+ /**
1504
+ * A row of a TimeViewport: its label pinned at the start, and a track as wide as the scale where its children lay
1505
+ * themselves out with scale.x(). Other attributes (role, aria-*, handlers) go on the row.
1506
+ */
1507
+ declare function TimeRow({ label, children, height, labelClassName, className, style, ...props }: TimeRowProps): react_jsx_runtime.JSX.Element;
1508
+ /**
1509
+ * An item on a TimeRow's track (a task, a shift): placed by the viewport's scale from its start to its end (through
1510
+ * scale.span, so a whole-day end is never a day short), with its content clipped and the focus ring. Its label is kept
1511
+ * in view beside the pinned column while its start is scrolled away, and fitted to the part of the bar in view: the
1512
+ * longest of `labels` that fits, or `children` shortened with an ellipsis. Other attributes (role, aria-*,
1513
+ * data-grid-key, tabIndex, handlers, className, style) go on the bar; the caller gives the fill and the insets.
1514
+ */
1515
+ declare function TimeBar({ start, end, minWidth, labels, children, className, style, ...props }: TimeBarProps): react_jsx_runtime.JSX.Element;
1516
+
1517
+ interface TimeScaleHeaderProps {
1518
+ /** The Today marker's label. Default "Today". */
1519
+ todayLabel?: string;
1520
+ className?: string;
1521
+ }
1522
+ /**
1523
+ * The two-row scale of a TimeViewport (Sprint 25.7, Part D): months over days or weeks, years over months or
1524
+ * quarters. Each row's labels take the longest form that fits and thin out rather than overlap; a month that starts
1525
+ * before the view keeps its label in view, as a sticky heading does. The Today marker's label sits in the lower row
1526
+ * on the Today line, never inside the thin line itself, and is clamped inside the visible area so it never clips
1527
+ * (round 23's Today badge). The scale is drawn for sight only: the dates it shows are in the items' accessible names.
1528
+ */
1529
+ declare function TimeScaleHeader({ todayLabel, className }: TimeScaleHeaderProps): react_jsx_runtime.JSX.Element;
1530
+
1531
+ /**
1532
+ * Labels along a scale that never overlap (Sprint 25.7, Part D; data-visualisation#7). Each label gets the longest form
1533
+ * that fits its box ("September" → "Sept" → "S"), one form along the row; when even the shortest does not fit, the row
1534
+ * thins to every second, third … label, and each label left has the room of the boxes up to the next. No label is
1535
+ * reachable only by hover: a date a label drops stays in the items' own accessible names. The maths takes the measure
1536
+ * function, so it runs in jsdom; useFittedLabels measures in the element's own font.
1537
+ */
1538
+ interface LabelBox {
1539
+ key: string;
1540
+ /** Px from the row's start. */
1541
+ x: number;
1542
+ width: number;
1543
+ /** Longest first. A TimeTick is a LabelBox. */
1544
+ labels: readonly string[];
1545
+ }
1546
+ interface FittedLabel {
1547
+ key: string;
1548
+ /** Where the text starts, px from the row's start. */
1549
+ x: number;
1550
+ /** The text's measured width (0 when thinned out). */
1551
+ width: number;
1552
+ /** Null: thinned out, or no form fits. */
1553
+ text: string | null;
1554
+ }
1555
+ interface FitLabelsOptions {
1556
+ /** The least space between two labels; each keeps half of it from the edges of its room. Default 8. */
1557
+ gap?: number;
1558
+ /** In its own box: "start" (default) or "center". */
1559
+ align?: "start" | "center";
1560
+ /**
1561
+ * The part of the row in view. A label is only ever shown whole in it: a start-aligned label slides along its room
1562
+ * to stay in view, as a sticky heading does (the month the view starts halfway through); a centred one centres on
1563
+ * the part of its box in view. Near an edge a label takes a shorter form that fits, or none.
1564
+ */
1565
+ visible?: {
1566
+ start: number;
1567
+ end: number;
1568
+ };
1569
+ }
1570
+ declare function fitLabels(boxes: readonly LabelBox[], measure: (text: string) => number, { gap, align, visible }?: FitLabelsOptions): FittedLabel[];
1571
+ /**
1572
+ * The longest of `labels` that fits one box `width` px wide with `gap` shared either side of it, or null: a label
1573
+ * inside a bar or a block, where fitLabels' row-wide form and thinning do not apply.
1574
+ */
1575
+ declare function fitLabel(labels: readonly string[], width: number, measure: (text: string) => number, { gap }?: {
1576
+ gap?: number;
1577
+ }): string | null;
1578
+ /**
1579
+ * Measures text in `ref`'s computed font. Read after the element mounts (before paint), again when it resizes and when
1580
+ * web fonts finish loading. Give it an element whose size follows its text (a span holding a character, out of sight),
1581
+ * not a box of fixed size: its resize is how a change of text size (the theme's base size, a class up the tree) is seen.
1582
+ */
1583
+ declare function useTextMeasure(ref: RefObject<HTMLElement | null>): (text: string) => number;
1584
+ /** fitLabels in the computed font of `ref`, the row the labels are drawn in. */
1585
+ declare function useFittedLabels(boxes: readonly LabelBox[], ref: RefObject<HTMLElement | null>, options?: FitLabelsOptions): FittedLabel[];
1586
+
1587
+ interface GridKeyboardOptions<K> {
1588
+ /** Holds the items, which carry `data-grid-key={keyOf(item)}`. */
1589
+ container: RefObject<HTMLElement | null>;
1590
+ /** The item that is the Tab stop. Keep it in step with focus (setActive from the item's onFocus). */
1591
+ active: K;
1592
+ setActive: (item: K) => void;
1593
+ keyOf: (item: K) => string;
1594
+ /** Where a key moves focus from `from` (arrows, Home, End: the caller's geometry), or null for a key it leaves alone. */
1595
+ move: (from: K, e: KeyboardEvent) => K | null;
1596
+ /** Enter and Space on an item. */
1597
+ onActivate?: (item: K, e: KeyboardEvent) => void;
1598
+ /**
1599
+ * Printable keys go to the next item whose label starts with what was typed in the last 500 ms (the same letter
1600
+ * again cycles). Never the zoom keys (+, = and −), never with Ctrl, ⌘ or Alt.
1601
+ */
1602
+ typeahead?: {
1603
+ items: readonly K[];
1604
+ labelOf: (item: K) => string;
1605
+ };
1606
+ /** Runs after focus moves to an item, in place of the browser's own scrolling (a time view keeps the item clear of its pinned column). */
1607
+ scrollIntoView?: (key: string, el: HTMLElement) => void;
1608
+ /**
1609
+ * Keys held with Ctrl, ⌘ or Alt go to `move` too: an APG grid's Ctrl+Home and Ctrl+End. Typeahead and activation
1610
+ * still ignore them. Off by default, so the browser keeps its own (Alt+Left is Back).
1611
+ */
1612
+ modifierKeys?: boolean;
1613
+ }
1614
+ interface GridKeyboard<K> {
1615
+ /** On the container. */
1616
+ onKeyDown: (e: KeyboardEvent) => void;
1617
+ tabIndexOf: (item: K) => 0 | -1;
1618
+ /** Focus the active item (after the next render when it is not in the DOM yet). */
1619
+ focusActive: () => void;
1620
+ /** Focus an item, as a key would (after the next render when it is not in the DOM yet); keep `active` in step. */
1621
+ focus: (item: K) => void;
1622
+ }
1623
+ /**
1624
+ * One Tab stop over a grid or rows of items (APG grid and tree patterns): the caller says where each key moves
1625
+ * (`move`), and the hook keeps the roving tabindex and puts focus on the new item — after the next render when the
1626
+ * item is not in the DOM yet (a date grid moving into the next month). Enter and Space activate, typeahead jumps by
1627
+ * label, and `scrollIntoView` places the item. It works by key, not DOM position, so a virtualised list can use it.
1628
+ * Keys typed in a field inside the container are left alone. Built for the date pickers, extended in Part D for
1629
+ * time-axis rows (it is Sprint 2X.3's `useGridNavigation`).
1630
+ */
1631
+ declare function useGridKeyboard<K>({ container, active, setActive, keyOf, move, onActivate, typeahead, scrollIntoView, modifierKeys }: GridKeyboardOptions<K>): GridKeyboard<K>;
1632
+
1633
+ type GanttTone = "neutral" | "info" | "success" | "warning" | "error" | "accent";
1634
+ interface GanttItem {
1635
+ id: string;
1636
+ title: string;
1637
+ /** A Date, or "YYYY-MM-DD" for a calendar day in the user's zone. */
1638
+ start: DateInput;
1639
+ /** Inclusive for a whole day ("3 to 14 March" covers the 14th); required unless `milestone`. */
1640
+ end?: DateInput;
1641
+ /** A GanttGroup's id. */
1642
+ group?: string;
1643
+ /** A key of `statuses`. */
1644
+ status?: string;
1645
+ /** A diamond on its start. */
1646
+ milestone?: boolean;
1647
+ /** The ids it waits for: finish-to-start. */
1648
+ dependsOn?: string[];
1649
+ }
1650
+ interface GanttGroup {
1651
+ id: string;
1652
+ title: string;
1653
+ defaultCollapsed?: boolean;
1654
+ }
1655
+ interface GanttStatus {
1656
+ label: string;
1657
+ tone: GanttTone;
1658
+ }
1659
+ interface GanttProps {
1660
+ items: GanttItem[];
1661
+ /** Rows grouped under collapsible headers, in this order; items with no group come last. A group with no items is left out. */
1662
+ groups?: GanttGroup[];
1663
+ /** Controlled selection; leave it out for the Gantt to keep its own. */
1664
+ selectedId?: string | null;
1665
+ /** Enter, Space or a click: the item. Escape, or a click on the selected item: null. */
1666
+ onSelect?: (item: GanttItem | null) => void;
1667
+ /** The bars' colours and the legend; an item with no known status is neutral. */
1668
+ statuses?: Record<string, GanttStatus>;
1669
+ zoom?: TimeZoom;
1670
+ /** Default "week". */
1671
+ defaultZoom?: TimeZoom;
1672
+ onZoomChange?: (zoom: TimeZoom) => void;
1673
+ /** Default now; demos and tests pass a fixed date. */
1674
+ today?: DateInput;
1675
+ /** Default 1 (Monday), as Calendar's. */
1676
+ weekStartsOn?: 0 | 1;
1677
+ /** Default the browser's: the scale's labels and the items' dates. */
1678
+ locale?: string;
1679
+ /**
1680
+ * Beside the title in the name column (assignees' avatars): shown, not announced, and left out when the column is
1681
+ * too narrow for it and the title (a phone). Nothing in it may take focus.
1682
+ */
1683
+ renderLabel?: (item: GanttItem) => ReactNode;
1684
+ /** The name column's heading. Default "Task". */
1685
+ labelHeader?: string;
1686
+ /** Controls after the built-in zoom, period and Today buttons, before the legend; false hides the bar. */
1687
+ toolbar?: ReactNode | false;
1688
+ "aria-label": string;
1689
+ className?: string;
1690
+ }
1691
+ /**
1692
+ * A plan on a time axis (Sprint 25.7, Part D2): tasks as bars on a date scale, grouped under collapsible headers, with
1693
+ * milestones and finish-to-start dependencies. Assembled from the time blocks: the scale and date model
1694
+ * (useTimeScale), the viewport with its pinned name column, sticky scale, zoom, pan and Today (TimeViewport), labels
1695
+ * that fit (TimeScaleHeader) and the one-Tab-stop keyboard (useGridKeyboard). It does no date maths and no scrolling
1696
+ * of its own.
1697
+ *
1698
+ * Keyboard (APG tree view): the chart is one Tab stop. Up and Down move between rows; Right opens a group, or moves
1699
+ * into it; Left closes it, or moves to it; Home and End go to the first and last row; typing jumps by title. Enter or
1700
+ * Space selects, and opens or closes a group; Escape clears the selection. + and − zoom and Shift+Left and Right pan,
1701
+ * from the viewport. Each item's accessible name carries its title, dates, status and dependencies; the arrows and
1702
+ * the scale are for sight only.
1703
+ */
1704
+ declare function Gantt({ items, groups, selectedId, onSelect, statuses, zoom: zoomProp, defaultZoom, onZoomChange, today, weekStartsOn, locale, renderLabel, labelHeader, toolbar, "aria-label": ariaLabel, className, }: GanttProps): react_jsx_runtime.JSX.Element;
1705
+
1247
1706
  type LinkUnderline = "hover" | "always" | "none";
1248
1707
  type LinkTone = "accent" | "muted" | "inherit";
1249
1708
  interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
@@ -2654,4 +3113,4 @@ interface UseTextOverflowResult {
2654
3113
  */
2655
3114
  declare function useTextOverflow(options?: UseTextOverflowOptions): UseTextOverflowResult;
2656
3115
 
2657
- export { Accordion, ActionPanel, ActionPanelGroup, Alert, type AlertPlacement, AppShell, type AppShellContextValue, type AppShellFocus, type AppShellPreferences, type AppShellTheme, AsidePanel, type AsidePanelProps, type AsidePanelSide, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarStatus, Badge, type BadgePaletteColor, type BadgeSeverity, type BadgeSize, type BadgeVariant, BottomNav, type BottomNavItem, type BreadcrumbItem$1 as BreadcrumbItem, Breadcrumbs, type BreadcrumbsSeparator, type BreadcrumbsSize, type BreadcrumbsVariant, BreakpointKey, BulkActionBar, Button, ButtonSizeContext, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardSelectType, CardTitle, type CardVariant, Carousel, type ChatMessage, type ChatMessageAction, type ChatMessageLayout, ChatMessageList, type ChatMessageSender, type ChatMessageSource, type ChatMessageStatus, ChatPanel, type ChatPanelProps, type ChatPanelStatusTone, Checkbox, CheckboxGroup, CheckboxGroupItem, CodeBlock, Collapsible, ColorPicker, type Column, Combobox, CommandPalette, ContextMenu, type ControlSize, ControlSizeContext, CornerPanel, type CornerPanelEdge, type CornerPanelProps, DEFAULT_DATE_RANGE_PRESETS, DataList, DatePicker, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DescriptionItem, DescriptionList, type DescriptionListOrientation, type DescriptionListSize, type DestructiveActionHandle, type DestructiveActionOptions, Dialog, Divider, Dock, Drawer, Dropdown, DropdownMenu, type DropdownMenuDivider, type DropdownMenuEntry, type DropdownMenuItem, EmptyState, EntityCell, Field, type FieldControlProps, type FieldProps, FileUpload, FormWrapper, HoverCard, InlineFieldError, Input, Kbd, Label, Launcher, type LauncherEdge, type LauncherProps, type LauncherVariant, type LauncherWhenOpen, Link, type LinkProps, MentionInput, MobileHeaderMenu, type MobileHeaderMenuItemData, type MobileHeaderMenuType, NavItem, type NavItemProps, type NavItemType, NavMenu, type NavMenuItem, Navbar, type NavbarSize, type NavbarType, type NavbarVariant, NotificationCenter, NumberInput, PageContainer, type PageContainerWidth, PageHeader, type PageHeaderBehavior, type PageHeaderIntensity, type PageHeaderProps, type PageHeaderVariant, type Pager, Pagination, type PaginationOptions, PinInput, Popover, PreferencesContext, Progress, type PromiseToastMessages, RadioGroup, Rating, type ResolvedPreferences, ScrollArea, SectionHeading, type SectionHeadingProps, SegmentedControl, SettingsLayout, type SettingsLayoutProps, type SettingsSection, Sheet, Sidebar, type SidebarContextValue, type SidebarItem, SidebarNav, type SidebarNavSize, type SidebarPosition, type SidebarSection, type SidebarType, Skeleton, SkipLink, SliderRange, Spinner, StackedList, type StackedListVariant, StatsCard, StatusDot, type StatusDotVariant, Stepper, type Tab, Table, type TableDensity, type TableProps, TableToolbar, type TableToolbarActiveFilter, type TableToolbarFilterOption, Tabs, Tag, TagInput, type TagPaletteColor, type TagVariant, TextOverflow, type TextOverflowProps, Textarea, TimePicker, Timeline, Toast, type ToastAction, type ToastApi, type ToastOptions, type ToastPosition, ToastProvider, type ToastVariant, Toggle, Tooltip, Tour, TransferList, TreeView, type Trend, type UseTextOverflowOptions, type UseTextOverflowResult, preferenceActionKey, useAppShell, useContentWidth, useDestructiveAction, useFormContext, usePagination, usePreferences, useSidebar, useTextOverflow, useToast, useToastOptional, useUnsavedChanges };
3116
+ export { Accordion, ActionPanel, ActionPanelGroup, Alert, type AlertPlacement, AppShell, type AppShellContextValue, type AppShellFocus, type AppShellPreferences, type AppShellTheme, AsidePanel, type AsidePanelProps, type AsidePanelSide, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarStatus, Badge, type BadgePaletteColor, type BadgeSeverity, type BadgeSize, type BadgeVariant, BottomNav, type BottomNavItem, type BreadcrumbItem$1 as BreadcrumbItem, Breadcrumbs, type BreadcrumbsSeparator, type BreadcrumbsSize, type BreadcrumbsVariant, BreakpointKey, BulkActionBar, Button, ButtonSizeContext, Calendar, type CalendarDay, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardSelectType, CardTitle, type CardVariant, Carousel, type ChatMessage, type ChatMessageAction, type ChatMessageLayout, ChatMessageList, type ChatMessageSender, type ChatMessageSource, type ChatMessageStatus, ChatPanel, type ChatPanelProps, type ChatPanelStatusTone, Checkbox, CheckboxGroup, CheckboxGroupItem, CodeBlock, Collapsible, ColorPicker, type Column, Combobox, CommandPalette, ContextMenu, type ControlSize, ControlSizeContext, CornerPanel, type CornerPanelEdge, type CornerPanelProps, DEFAULT_DATE_RANGE_PRESETS, DataList, type DateInput, DatePicker, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DateRangeWords, type DescriptionItem, DescriptionList, type DescriptionListOrientation, type DescriptionListSize, type DestructiveActionHandle, type DestructiveActionOptions, Dialog, Divider, Dock, Drawer, Dropdown, DropdownMenu, type DropdownMenuDivider, type DropdownMenuEntry, type DropdownMenuItem, EmptyState, EntityCell, Field, type FieldControlProps, type FieldProps, FileUpload, type FitLabelsOptions, type FittedLabel, FormWrapper, Gantt, type GanttGroup, type GanttItem, type GanttProps, type GanttStatus, type GanttTone, type GridKeyboard, type GridKeyboardOptions, HoverCard, InlineFieldError, Input, Kbd, Label, type LabelBox, Launcher, type LauncherEdge, type LauncherProps, type LauncherVariant, type LauncherWhenOpen, Link, type LinkProps, MentionInput, MobileHeaderMenu, type MobileHeaderMenuItemData, type MobileHeaderMenuType, NavItem, type NavItemProps, type NavItemType, NavMenu, type NavMenuItem, Navbar, type NavbarSize, type NavbarType, type NavbarVariant, NotificationCenter, NumberInput, PageContainer, type PageContainerWidth, PageHeader, type PageHeaderBehavior, type PageHeaderIntensity, type PageHeaderProps, type PageHeaderVariant, type Pager, Pagination, type PaginationOptions, PinInput, Popover, PreferencesContext, Progress, type PromiseToastMessages, RadioGroup, Rating, type ResolvedPreferences, ScrollArea, SectionHeading, type SectionHeadingProps, SegmentedControl, SettingsLayout, type SettingsLayoutProps, type SettingsSection, Sheet, Sidebar, type SidebarContextValue, type SidebarItem, SidebarNav, type SidebarNavSize, type SidebarPosition, type SidebarSection, type SidebarType, Skeleton, SkipLink, SliderRange, Spinner, StackedList, type StackedListVariant, StatsCard, StatusDot, type StatusDotVariant, Stepper, TIME_ZOOMS, type Tab, Table, type TableDensity, type TableProps, TableToolbar, type TableToolbarActiveFilter, type TableToolbarFilterOption, Tabs, Tag, TagInput, type TagPaletteColor, type TagVariant, TextOverflow, type TextOverflowProps, Textarea, TimeBar, type TimeBarProps, TimePicker, TimeRow, type TimeRowProps, type TimeScale, TimeScaleHeader, type TimeScaleHeaderProps, type TimeScaleOptions, type TimeTick, TimeViewport, type TimeViewportHandle, type TimeViewportLayout, type TimeViewportProps, type TimeViewportState, type TimeZoom, Timeline, Toast, type ToastAction, type ToastApi, type ToastOptions, type ToastPosition, ToastProvider, type ToastVariant, Toggle, Tooltip, Tour, TransferList, TreeView, type Trend, type UseTextOverflowOptions, type UseTextOverflowResult, dateOfDay, dayOf, endDayOf, fitLabel, fitLabels, formatDateRange, preferenceActionKey, timeExtent, useAppShell, useContentWidth, useDestructiveAction, useFittedLabels, useFormContext, useGridKeyboard, usePagination, usePreferences, useSidebar, useTextMeasure, useTextOverflow, useTimeScale, useTimeViewport, useTimeViewportLayout, useToast, useToastOptional, useUnsavedChanges };