gridsmith-ui 0.30.2 → 0.31.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/CHANGELOG.md +53 -1
- package/dist/charts.d.ts +114 -1
- package/dist/charts.js +1113 -206
- package/dist/charts.js.map +1 -1
- package/dist/chat.js +20 -12
- package/dist/chat.js.map +1 -1
- package/dist/{chunk-MIUSSYVE.js → chunk-2Q4HOGEI.js} +16 -51
- package/dist/chunk-2Q4HOGEI.js.map +1 -0
- package/dist/{chunk-SIWERRP2.js → chunk-3J67NISC.js} +13 -14
- package/dist/chunk-3J67NISC.js.map +1 -0
- package/dist/{chunk-L6HWACK7.js → chunk-53F7GVBQ.js} +6 -3
- package/dist/chunk-53F7GVBQ.js.map +1 -0
- package/dist/{chunk-USHW523V.js → chunk-BKYWKMUN.js} +73 -699
- package/dist/chunk-BKYWKMUN.js.map +1 -0
- package/dist/{chunk-K6IDOCGE.js → chunk-EKWXPSTI.js} +10 -10
- package/dist/{chunk-K6IDOCGE.js.map → chunk-EKWXPSTI.js.map} +1 -1
- package/dist/{chunk-ACLKDE5W.js → chunk-GP2COVJC.js} +23 -11
- package/dist/chunk-GP2COVJC.js.map +1 -0
- package/dist/{chunk-BZRZENBS.js → chunk-GT6M74IZ.js} +6 -6
- package/dist/{chunk-BZRZENBS.js.map → chunk-GT6M74IZ.js.map} +1 -1
- package/dist/{chunk-ZCDA74RQ.js → chunk-HUNEJIKV.js} +3 -3
- package/dist/{chunk-ZCDA74RQ.js.map → chunk-HUNEJIKV.js.map} +1 -1
- package/dist/{chunk-ZASGFL5D.js → chunk-LE72KHIE.js} +3 -4
- package/dist/chunk-LE72KHIE.js.map +1 -0
- package/dist/{chunk-SQHKC4HA.js → chunk-OFACAHRV.js} +8 -7
- package/dist/chunk-OFACAHRV.js.map +1 -0
- package/dist/{chunk-4HJDOZ2M.js → chunk-OWQ7M6R7.js} +75 -15
- package/dist/chunk-OWQ7M6R7.js.map +1 -0
- package/dist/{chunk-TYNDXMBV.js → chunk-QOMP4D6V.js} +3 -3
- package/dist/{chunk-TYNDXMBV.js.map → chunk-QOMP4D6V.js.map} +1 -1
- package/dist/chunk-U7WBI4AV.js +285 -0
- package/dist/chunk-U7WBI4AV.js.map +1 -0
- package/dist/chunk-V2ARGHJN.js +755 -0
- package/dist/chunk-V2ARGHJN.js.map +1 -0
- package/dist/chunk-V73LHNRL.js +51 -0
- package/dist/chunk-V73LHNRL.js.map +1 -0
- package/dist/{chunk-WWN6CQKI.js → chunk-XSQD3UGY.js} +47 -7
- package/dist/chunk-XSQD3UGY.js.map +1 -0
- package/dist/{chunk-HVGHGBKV.js → chunk-YFHTREH5.js} +6 -7
- package/dist/chunk-YFHTREH5.js.map +1 -0
- package/dist/data-grid.js +10 -11
- package/dist/data-grid.js.map +1 -1
- package/dist/editor-mentions.js +2 -3
- package/dist/editor-mentions.js.map +1 -1
- package/dist/editor.js +3 -5
- package/dist/editor.js.map +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +91 -16
- package/dist/index.js +1055 -640
- package/dist/index.js.map +1 -1
- package/dist/kanban.js +9 -11
- package/dist/kanban.js.map +1 -1
- package/dist/resizable.js +9 -11
- package/dist/resizable.js.map +1 -1
- package/dist/virtualized.js +10 -11
- package/dist/virtualized.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4HJDOZ2M.js.map +0 -1
- package/dist/chunk-6C2IUMY7.js +0 -46
- package/dist/chunk-6C2IUMY7.js.map +0 -1
- package/dist/chunk-7Q46JXSK.js +0 -51
- package/dist/chunk-7Q46JXSK.js.map +0 -1
- package/dist/chunk-ACLKDE5W.js.map +0 -1
- package/dist/chunk-HVGHGBKV.js.map +0 -1
- package/dist/chunk-L6HWACK7.js.map +0 -1
- package/dist/chunk-MIUSSYVE.js.map +0 -1
- package/dist/chunk-NKUCS67T.js +0 -13
- package/dist/chunk-NKUCS67T.js.map +0 -1
- package/dist/chunk-SIWERRP2.js.map +0 -1
- package/dist/chunk-SQHKC4HA.js.map +0 -1
- package/dist/chunk-USHW523V.js.map +0 -1
- package/dist/chunk-WWN6CQKI.js.map +0 -1
- package/dist/chunk-YL5KD5RC.js +0 -49
- package/dist/chunk-YL5KD5RC.js.map +0 -1
- package/dist/chunk-ZASGFL5D.js.map +0 -1
package/dist/kanban.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { DropdownMenu } from './chunk-
|
|
2
|
+
import { DropdownMenu } from './chunk-YFHTREH5.js';
|
|
3
3
|
import { useFillHeight, FillContext } from './chunk-DBHVJ7Z3.js';
|
|
4
|
-
import { Badge } from './chunk-
|
|
5
|
-
import { useKeyboardScroll } from './chunk-
|
|
6
|
-
import { useFramesItself
|
|
7
|
-
import './chunk-
|
|
4
|
+
import { Badge } from './chunk-GT6M74IZ.js';
|
|
5
|
+
import { useKeyboardScroll } from './chunk-GP2COVJC.js';
|
|
6
|
+
import { useFramesItself } from './chunk-V73LHNRL.js';
|
|
7
|
+
import { Button } from './chunk-2Q4HOGEI.js';
|
|
8
8
|
import './chunk-ZHUVLBCC.js';
|
|
9
|
-
import { useTextOverflow } from './chunk-
|
|
10
|
-
import { useRevealFocus, AutoTooltip } from './chunk-
|
|
11
|
-
import { Icon } from './chunk-
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-4HJDOZ2M.js';
|
|
14
|
-
import { cn, FOCUS_INSET, FOCUS_RING } from './chunk-YL5KD5RC.js';
|
|
9
|
+
import { useTextOverflow } from './chunk-HUNEJIKV.js';
|
|
10
|
+
import { useRevealFocus, AutoTooltip } from './chunk-XSQD3UGY.js';
|
|
11
|
+
import { Icon } from './chunk-53F7GVBQ.js';
|
|
12
|
+
import { cn, FOCUS_INSET, FOCUS_RING } from './chunk-OWQ7M6R7.js';
|
|
15
13
|
import { useState, useRef, useLayoutEffect, useMemo, useCallback, useContext } from 'react';
|
|
16
14
|
import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCorners, DragOverlay, useDroppable } from '@dnd-kit/core';
|
|
17
15
|
import { sortableKeyboardCoordinates, SortableContext, verticalListSortingStrategy, useSortable, arrayMove } from '@dnd-kit/sortable';
|
package/dist/kanban.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../showcase/src/components/KanbanBoard.tsx"],"names":["style"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgHA,IAAM,eAAA,GAAkB,kCAAA;AACxB,IAAM,cAAA,GAAiB,0DAAA;AAKvB,SAAS,UAAA,CAAW,IAAA,EAAkB,WAAA,EAAkC,WAAA,EAAoE;AAC1I,EAAA,IAAI,CAAC,aAAa,OAAO,WAAA;AACzB,EAAA,MAAM,IAAA,GAA4B,EAAE,KAAA,EAAO,MAAA,EAAQ,OAAO,WAAA,EAA0D;AACpH,EAAA,MAAM,GAAA,GAAM,WAAA,CAAY,IAAA,EAAM,IAAI,CAAA;AAElC,EAAA,MAAM,MAAA,GAAS,CAAC,CAAA,KAAyB,CAAA,KAAM,QAAS,OAAA,IAAW,CAAA,IAAK,CAAA,CAAE,KAAA,KAAU,IAAA,CAAK,KAAA;AACzF,EAAA,MAAM,OAAA,GAA+B,EAAE,IAAA,EAAM,SAAA,EAAU;AACvD,EAAA,MAAM,OAAA,GAAU,YAAY,MAAA,KAAW,CAAA,GAAI,IAAI,MAAA,CAAO,CAAC,CAAA,KAAM,CAAC,MAAA,CAAO,CAAC,CAAC,CAAA,GAAI,GAAA,CAAI,KAAK,MAAM,CAAA,GAAI,MAAM,CAAC,GAAG,GAAA,EAAK,OAAA,EAAS,IAAI,CAAA;AAC1H,EAAA,MAAM,SAAA,GAAY,CAAC,CAAA,KAAqC,CAAC,CAAC,CAAA,IAAK,MAAA,IAAU,CAAA,IAAK,CAAA,CAAE,IAAA,KAAS,SAAA;AACzF,EAAA,OAAO,QAAQ,MAAA,CAA4B,CAAC,GAAA,EAAK,CAAA,KAAO,UAAU,CAAC,CAAA,KAAM,GA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AAK,CAAA;AAAA,cAC1B,MAAA,EAAQ,YAAA;AAAA,cACR;AAAA,aAAA;AAAA,YAPK,IAAA,CAAK;AAAA,WASb,CAAA,EAAA,EAZe,GAAA,CAAI,EAatB,CACD,CAAA;AAAA,8BAEA,KAAA,EAAA,EAAI,IAAA,EAAK,QAAA,EAAS,SAAA,EAAU,WAAW,QAAA,EAAA,MAAA,EAAO;AAAA,SAAA,EACjD,CAAA;AAAA,wBAEA,GAAA,CAAC,WAAA,EAAA,EACE,QAAA,EAAA,UAAA,oBAAc,GAAA,CAAC,WAAA,EAAA,EAAY,MAAM,UAAA,EAAY,UAAA,EAAwB,QAAA,EAAU,aAAA,EAAe,CAAA,EACjG;AAAA;AAAA;AAAA,GACF;AAEJ","file":"kanban.js","sourcesContent":["import { useCallback, useContext, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from \"react\";\nimport {\n DndContext,\n closestCorners,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n type Announcements,\n type DragCancelEvent,\n type DragEndEvent,\n type DragOverEvent,\n DragOverlay,\n type DragStartEvent,\n type KeyboardCoordinateGetter,\n useDroppable,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n useSortable,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { cn, FOCUS_INSET, FOCUS_RING } from \"../lib/utils\";\nimport { Icon } from \"../lib/icons\";\nimport { AutoTooltip } from \"./Tooltip\";\nimport { useTextOverflow } from \"../lib/use-text-overflow\";\nimport { Badge } from \"./Badge\";\nimport { Button } from \"./Button\";\nimport { DropdownMenu, type DropdownMenuDivider, type DropdownMenuEntry, type DropdownMenuItem, type DropdownMenuSubmenu } from \"./DropdownMenu\";\nimport { useFramesItself } from \"../lib/surface-context\";\nimport { FillContext, useFillHeight } from \"../lib/use-fill-height\";\nimport { useKeyboardScroll } from \"../lib/use-keyboard-scroll\";\nimport { useRevealFocus } from \"../lib/reveal-focus\";\n\nexport interface KanbanCard {\n id: string;\n title: string;\n description?: string;\n tags?: string[];\n avatar?: string;\n}\n\nexport interface KanbanColumn {\n id: string;\n title: string;\n cards: KanbanCard[];\n color?: string;\n /**\n * The column's work-in-progress limit, in cards: the header shows its count against it (\"4/3\"), and a column holding\n * more is marked with a warning icon, its count's words saying so to a screen reader. A limit informs and never refuses\n * a drop; a page that must refuse a move still can, in onCardMove. Default: no limit, the count alone.\n */\n limit?: number;\n}\n\nexport interface KanbanBoardProps {\n /**\n * The board's cards by column. Authoritative: the board shows what it is given, with one exception — a card just\n * dropped stays where it was dropped until `columns` shows the move, the save fails, or `columns` changes some other\n * way (see onCardMove). A re-render that passes the same cards again, or an array rebuilt with the same cards,\n * never puts a dropped card back.\n */\n columns: KanbanColumn[];\n /**\n * The columns after a move, once on drop (Sprint 25.7, C2: it used to fire on every hover step). Its return value\n * counts as onCardMove's does.\n */\n onColumnsChange?: (columns: KanbanColumn[]) => unknown;\n /**\n * A card was moved to a new place: its column and its index there, once on drop, or on a choice from the card's Move\n * menu (the button beside each card that moves it without dragging: to the top of another column, or a step up or\n * down) — a move between columns, into an empty one, or a reorder within one. Save the move here (or in\n * onColumnsChange); a board with neither saves nothing. The index counts the cards the board shows: when `columns` is\n * filtered, it is the place among the cards passed.\n *\n * Return the save's promise (an async function, or a mutation's mutateAsync) and the card stays where it was dropped\n * while it saves, and while an earlier move of the same card still saves, whatever `columns` arrive meanwhile; when\n * it rejects, the card goes back to where `columns` has it, a screen reader hears so, and the app says why (a toast\n * inside the app shell). The save must settle (give a request a timeout): one that never does holds the card. A\n * handler that throws refuses a move the same way (one the person isn't allowed to make). An app that updates\n * `columns` at once, then saves, puts the card back itself when its save fails; the board still says the move was not\n * saved.\n */\n onCardMove?: (card: KanbanCard, toColumnId: string, index: number) => unknown;\n /** A board to look at, not rearrange: no dragging, no grab cursor and no Move menu; cards still open with onCardClick. */\n readOnly?: boolean;\n renderCard?: (card: KanbanCard) => ReactNode;\n /**\n * Opens a card (a detail drawer, a route). The board's own card surface is the control: click, or Enter with the\n * card focused, opens it; Space picks the card up for a keyboard drag. Never wire a clickable element inside\n * renderCard — a role=\"button\" div fights the drag listeners and the judge cites it (Sprint 25.4 K-1).\n */\n onCardClick?: (card: KanbanCard) => void;\n /**\n * A card's own actions (open, edit its labels, copy a link, delete…), for its ⋯ menu. `move` is the board's Move entry,\n * a submenu of the columns the card can go to and its steps up and down: put it where it belongs among the actions;\n * left out, the board adds it at the end, since it is the way to move a card without dragging (WCAG 2.5.7). Without\n * cardActions the menu is the move choices alone. On a read-only board the menu holds the actions, with no Move.\n */\n cardActions?: (card: KanbanCard, move: DropdownMenuSubmenu) => DropdownMenuEntry[];\n className?: string;\n}\n\n/**\n * The room a card keeps clear in its top right for its Move button (Sprint 25.8.7 item 3), so no content runs under it:\n * the default card's title stops short of it, as a Card's title stops before its ⋯, and a renderCard's content is kept\n * off that edge whole, since the board can't know what its first line holds. The button sits as far in from the card's\n * corner as its top, so the room is its width.\n */\nconst MOVE_ROOM_TITLE = \"pr-[var(--ds-control-height-sm)]\";\nconst MOVE_ROOM_CARD = \"pr-[calc(var(--ds-space-3)+var(--ds-control-height-sm))]\";\n/**\n * A card's ⋯ menu: the page's actions with the board's Move among them, or at their end; Move's choices alone without\n * actions. Dividers at either end, or two together, go (a Move left out where there is nowhere to move leaves one).\n */\nfunction cardMenuOf(card: KanbanCard, moveEntries: DropdownMenuEntry[], cardActions?: KanbanBoardProps[\"cardActions\"]): DropdownMenuEntry[] {\n if (!cardActions) return moveEntries;\n const move: DropdownMenuSubmenu = { label: \"Move\", items: moveEntries as (DropdownMenuItem | DropdownMenuDivider)[] };\n const own = cardActions(card, move);\n // the board's Move by its choices, so a copy the page made of it (`{ ...move, icon }`) is Move still\n const isMove = (e: DropdownMenuEntry) => e === move || (\"items\" in e && e.items === move.items);\n const divider: DropdownMenuDivider = { type: \"divider\" };\n const entries = moveEntries.length === 0 ? own.filter((e) => !isMove(e)) : own.some(isMove) ? own : [...own, divider, move];\n const isDivider = (e: DropdownMenuEntry | undefined) => !!e && \"type\" in e && e.type === \"divider\";\n return entries.reduce<DropdownMenuEntry[]>((acc, e) => (isDivider(e) && (acc.length === 0 || isDivider(acc[acc.length - 1])) ? acc : [...acc, e]), [])\n .filter((e, i, all) => !(isDivider(e) && i === all.length - 1));\n}\n\n/** A card's Move choices as its menu's entries: the columns, then a divider, then the steps. */\nfunction menuOf(moves: MoveChoice[], choose: (move: MoveChoice) => void): DropdownMenuEntry[] {\n const entry = (m: MoveChoice): DropdownMenuEntry => ({ label: m.label, onClick: () => choose(m) });\n const others = moves.filter((m) => m.step === 0).map(entry);\n const steps = moves.filter((m) => m.step !== 0).map(entry);\n return others.length && steps.length ? [...others, { type: \"divider\" }, ...steps] : [...others, ...steps];\n}\n\n/** Where the Move button sits: in the card's top right, as far in from its top as from its side. */\nconst MOVE_PLACE = \"absolute top-ds-1.5 right-ds-1.5\";\n\n/** One choice in a card's Move menu: to the top of another column, or a step within its own (-1 up, 1 down). */\ninterface MoveChoice {\n label: string;\n to: string;\n step: number;\n}\n\nfunction SortableCard({\n card,\n renderCard,\n onCardClick,\n readOnly,\n moves,\n onMove,\n cardActions,\n}: {\n card: KanbanCard;\n renderCard?: (card: KanbanCard) => ReactNode;\n onCardClick?: (card: KanbanCard) => void;\n readOnly?: boolean;\n /** The card's Move menu: empty on a read-only board, and where there is nowhere to move it. */\n moves: MoveChoice[];\n /** Makes a move from the menu (the board's), on the press that chose it. */\n onMove: (cardId: string, to: string, step: number) => void;\n cardActions?: KanbanBoardProps[\"cardActions\"];\n}) {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id: card.id, disabled: readOnly });\n\n // the card's ⋯ menu: its actions and Move, or Move alone (no Move on a read-only board)\n const entries = cardMenuOf(card, readOnly ? [] : menuOf(moves, (m) => onMove(card.id, m.to, m.step)), cardActions);\n const renderMenu = (style: CSSProperties | undefined, faded: boolean) => (\n <DropdownMenu\n items={entries}\n trigger={\n // the library's icon button: its name says what its menu is for, and it shows that name as its one tooltip;\n // shown at all times, since a phone has no hover; quiet, as a Card's ⋯ is\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={cardActions ? `Actions for ${card.title}` : `Move ${card.title}`}\n data-kanban-move={card.id}\n style={style}\n className={cn(MOVE_PLACE, \"text-[var(--ds-text-muted)] hover:text-[var(--ds-text-primary)]\", faded && \"opacity-30\")}\n >\n <Icon name=\"more-horizontal\" size={14} />\n </Button>\n }\n />\n );\n const menu = entries.length > 0 ? renderMenu : null;\n\n if (readOnly) {\n // nothing to pick up: a card that opens is a button (Enter and Space), one that does not is a plain surface\n const open = onCardClick ? () => onCardClick(card) : undefined;\n const surface = (\n <div\n ref={setNodeRef}\n {...(open ? { role: \"button\", tabIndex: 0 } : {})}\n onClick={open}\n onKeyDown={open ? (e) => { if (e.key === \"Enter\" || e.key === \" \") { e.preventDefault(); open(); } } : undefined}\n data-kanban-card={card.id}\n className={cn(\n \"rounded-[var(--ds-radius-md)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"bg-[var(--ds-bg-surface)] p-ds-3 shadow-[var(--ds-shadow-button)]\",\n // a card with its actions' ⋯ keeps the button's room clear, as a card that moves does\n menu && renderCard && MOVE_ROOM_CARD,\n open ? \"cursor-pointer\" : \"cursor-default\",\n FOCUS_RING,\n )}\n >\n {renderCard ? renderCard(card) : <DefaultCard card={card} moveRoom={!!menu} />}\n </div>\n );\n // a card with actions keeps its menu beside it, never inside it (a control inside a control)\n return menu ? <div className=\"relative\" data-kanban-item={card.id}>{surface}{menu(undefined, false)}</div> : surface;\n }\n\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n };\n const movable = !!menu;\n\n return (\n // Sprint 25.8.7 item 3 (WCAG 2.5.7): the card's slot holds the card and, beside it, its Move button, never one\n // inside the other (a control inside a control: the card is the drag's button). The card stays the node the drag\n // measures and moves; the button takes the same transform, so it travels with the card as the list sorts.\n <div className=\"relative\" data-kanban-item={card.id}>\n <div\n ref={setNodeRef}\n style={style}\n {...attributes}\n {...listeners}\n // the surface is the control (K-1): a click opens (the pointer sensor needs 5 px of movement to start a drag),\n // Enter opens, Space stays the keyboard drag's pick-up\n onClick={onCardClick ? () => onCardClick(card) : undefined}\n onKeyDown={(e) => {\n if (onCardClick && e.key === \"Enter\") { e.preventDefault(); onCardClick(card); return; }\n listeners?.onKeyDown?.(e);\n }}\n data-kanban-card={card.id}\n className={cn(\n \"rounded-[var(--ds-radius-md)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"bg-[var(--ds-bg-surface)] p-ds-3 active:cursor-grabbing\",\n movable && renderCard && MOVE_ROOM_CARD,\n onCardClick ? \"cursor-pointer\" : \"cursor-grab\",\n \"shadow-[var(--ds-shadow-button)]\",\n \"transition-shadow duration-[var(--ds-transition-speed)]\",\n FOCUS_RING,\n // no scale on the card left behind: the drag overlay takes its size from it, and 2% wider made the cards\n // below count as \"to the right\" of it, so a keyboard drag's arrow keys landed on them (Sprint 25.7, C2)\n isDragging && \"opacity-30\",\n )}\n >\n {renderCard ? (\n renderCard(card)\n ) : (\n <DefaultCard card={card} moveRoom={movable} />\n )}\n </div>\n {menu && menu(style, isDragging)}\n </div>\n );\n}\n\nfunction ClampedDescription({ children }: { children: string }) {\n const { ref, isTruncated } = useTextOverflow({ lines: 2 });\n const el = <p ref={ref} className=\"text-xs text-[var(--ds-text-secondary)] line-clamp-2\">{children}</p>;\n if (!isTruncated) return el;\n return <AutoTooltip content={children}>{el}</AutoTooltip>;\n}\n\nfunction TruncTitle({ children, className }: { children: string; className?: string }) {\n const { ref, isTruncated } = useTextOverflow({ lines: 1 });\n const el = <p ref={ref} className={cn(\"text-sm font-medium text-[var(--ds-text-primary)] truncate\", className)}>{children}</p>;\n if (!isTruncated) return el;\n return <AutoTooltip content={children}>{el}</AutoTooltip>;\n}\n\nfunction DefaultCard({ card, moveRoom }: { card: KanbanCard; moveRoom?: boolean }) {\n return (\n <div className=\"space-y-ds-2\">\n <TruncTitle className={moveRoom ? MOVE_ROOM_TITLE : undefined}>{card.title}</TruncTitle>\n {card.description && (\n <ClampedDescription>{card.description}</ClampedDescription>\n )}\n {card.tags && card.tags.length > 0 && (\n <div className=\"flex flex-wrap gap-ds-1\">\n {card.tags.map((tag) => (\n <Badge key={tag} variant=\"subtle\" size=\"sm\">{tag}</Badge>\n ))}\n </div>\n )}\n </div>\n );\n}\n\nfunction OverlayCard({\n card,\n renderCard,\n moveRoom,\n}: {\n card: KanbanCard;\n renderCard?: (card: KanbanCard) => ReactNode;\n /** The card has a Move button: the lifted card keeps its room and shows its ⋯ (a picture of it, not a control). */\n moveRoom?: boolean;\n}) {\n return (\n <div\n className={cn(\n \"relative rounded-[var(--ds-radius-md)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"bg-[var(--ds-bg-surface)] p-ds-3 shadow-[var(--ds-shadow-card)]\",\n moveRoom && renderCard && MOVE_ROOM_CARD,\n )}\n >\n {renderCard ? renderCard(card) : <DefaultCard card={card} moveRoom={moveRoom} />}\n {moveRoom && (\n <span aria-hidden=\"true\" className={cn(MOVE_PLACE, \"inline-flex items-center justify-center h-[var(--ds-control-height-sm)] w-[var(--ds-control-height-sm)] text-[var(--ds-text-muted)]\")}>\n <Icon name=\"more-horizontal\" size={14} />\n </span>\n )}\n </div>\n );\n}\n\n/** A column's drop area has its own id, so it never collides with a card id. */\nconst DROP_PREFIX = \"kanban-column:\";\nconst columnDropId = (id: string) => `${DROP_PREFIX}${id}`;\nconst droppedColumnId = (id: string) => (id.startsWith(DROP_PREFIX) ? id.slice(DROP_PREFIX.length) : null);\n\n/**\n * Sprint 25.7, C2: a keyboard drag goes column to column. Left and Right move the card to the top of the next column's\n * list — an empty column included — and Up and Down reorder within the column (dnd-kit's own handler). dnd-kit's\n * handler alone picks the nearest drop area to the right of the card's edge, which is often a card in the same column\n * or the card's own new place, so every other arrow key did nothing.\n */\nconst boardCoordinates: KeyboardCoordinateGetter = (event, args) => {\n if (event.code !== \"ArrowLeft\" && event.code !== \"ArrowRight\") return sortableKeyboardCoordinates(event, args);\n event.preventDefault();\n const { collisionRect, droppableRects, droppableContainers } = args.context;\n if (!collisionRect) return undefined;\n const columns = droppableContainers.getEnabled()\n .filter((c) => String(c.id).startsWith(DROP_PREFIX))\n .map((c) => droppableRects.get(c.id))\n .filter((r): r is NonNullable<typeof r> => r != null)\n .sort((a, b) => a.left - b.left);\n const centre = collisionRect.left + collisionRect.width / 2;\n const current = columns.findIndex((r) => centre >= r.left && centre <= r.left + r.width);\n const next = current < 0 ? undefined : columns[current + (event.code === \"ArrowRight\" ? 1 : -1)];\n if (!next) return undefined;\n return { x: next.left + (next.width - collisionRect.width) / 2, y: next.top };\n};\n\n/** Where a card is: its column's id and its index there. */\nfunction locate(cols: KanbanColumn[], cardId: string): { col: KanbanColumn; index: number } | null {\n for (const col of cols) {\n const index = col.cards.findIndex((c) => c.id === cardId);\n if (index >= 0) return { col, index };\n }\n return null;\n}\n\n/** The columns after a drop on `overId`: within the column the preview put the card in, a drop on another card reorders it. */\nfunction landing(cols: KanbanColumn[], cardId: string, overId: string): KanbanColumn[] {\n const at = locate(cols, cardId);\n const overAt = locate(cols, overId);\n if (!at || !overAt || overAt.col.id !== at.col.id || overAt.index === at.index) return cols;\n return cols.map((col) => (col.id === at.col.id ? { ...col, cards: arrayMove(col.cards, at.index, overAt.index) } : col));\n}\n\n/** A card's place, to re-apply to other columns: its column, the card after it (null when last) and its index. */\ninterface Placement {\n cardId: string;\n toColumnId: string;\n beforeId: string | null;\n index: number;\n}\n\nfunction placementIn(cols: KanbanColumn[], cardId: string): Placement | null {\n const at = locate(cols, cardId);\n return at ? { cardId, toColumnId: at.col.id, beforeId: at.col.cards[at.index + 1]?.id ?? null, index: at.index } : null;\n}\n\n/** The columns with a card put at a placement: into its column, before the same card (else at its index). */\nfunction place(cols: KanbanColumn[], p: Placement): KanbanColumn[] {\n const from = locate(cols, p.cardId);\n if (!from || !cols.some((col) => col.id === p.toColumnId)) return cols;\n const card = from.col.cards[from.index];\n return cols.map((col) => {\n if (col.id !== p.toColumnId && col.id !== from.col.id) return col;\n const cards = col.cards.filter((c) => c.id !== p.cardId);\n if (col.id === p.toColumnId) {\n const i = p.beforeId == null ? cards.length : cards.findIndex((c) => c.id === p.beforeId);\n cards.splice(i >= 0 ? i : Math.min(p.index, cards.length), 0, card);\n }\n return { ...col, cards };\n });\n}\n\n/**\n * A drag's move so far, re-applied to new columns: the card goes into the same column, before the same card, so a\n * change that arrives while a card is held shows at once and the drop keeps it.\n */\nfunction rebase(next: KanbanColumn[], shown: KanbanColumn[], cardId: string): KanbanColumn[] {\n const p = placementIn(shown, cardId);\n return p ? place(next, p) : next;\n}\n\n/**\n * A dropped card the board holds where it was dropped (Sprint 25.7, the owner's call of 26 September 2026: a card must\n * not jump back while its move saves). The pattern Atlassian's drag-and-drop guidance sets for Trello and Jira: the move\n * shows at once, before it is saved; data that arrives meanwhile has it replayed over it; a failed save lets the data\n * win, so the card goes back. One hold per card: a later move of the card replaces its place and adds its save to the\n * ones in flight.\n */\ninterface HeldMove extends Placement {\n /** The latest drop's key: only its save's failure puts the card back. */\n key: number;\n /** Saves for this card not yet settled, a replaced move's included: while one is out, nothing the columns show ends the hold. */\n inFlight: number;\n /** Where `columns` had the card before the first drop of this run of moves. */\n origin: Placement;\n /** The places of the moves this one replaced: columns showing one of them are behind, not a decision. */\n earlier: Placement[];\n /** The cards and their order in `columns` at the drop, or when its last save settled: with the card at its origin, a change ends the hold. */\n layout: string;\n}\n\n/** Which cards each column holds, in order: what a hold compares. A card's own fields changing is not a move. */\nconst layoutOf = (cols: KanbanColumn[]) => cols.map((col) => `${col.id}:${col.cards.map((c) => c.id).join(\",\")}`).join(\"|\");\n\n/** The columns show the card at a placement: in its column, before the same card (null: last). */\nfunction isAt(cols: KanbanColumn[], p: Placement): boolean {\n const at = locate(cols, p.cardId);\n return at != null && at.col.id === p.toColumnId && (at.col.cards[at.index + 1]?.id ?? null) === p.beforeId;\n}\n\n/**\n * The holds new columns keep. While a save for the card is out, every one (stale data, a card a filter hides, a card\n * that happens to sit where it was dropped). Once none is: a hold ends when its card or column is gone; with the card\n * at its origin, when the columns change some other way (the app's data has moved on — or, for a card moved back, has\n * caught up); when the columns show the card where it was dropped; or somewhere that is none of its own places (the\n * app's data decided). Columns showing one of its earlier places are behind, and the hold stays.\n */\nfunction keptHolds(holds: HeldMove[], cols: KanbanColumn[]): HeldMove[] {\n const layout = layoutOf(cols);\n const kept = holds.filter((h) => {\n if (h.inFlight > 0) return true;\n if (!locate(cols, h.cardId) || !cols.some((col) => col.id === h.toColumnId)) return false;\n // first, as a card moved back sits at its origin in data that has not caught up yet as well as in data that has\n if (isAt(cols, h.origin)) return layout === h.layout;\n if (isAt(cols, h)) return false;\n return h.earlier.some((p) => isAt(cols, p));\n });\n return kept.length === holds.length ? holds : kept;\n}\n\nconst replayHolds = (cols: KanbanColumn[], holds: HeldMove[]) => holds.reduce(place, cols);\n\nconst isThenable = (value: unknown): value is PromiseLike<unknown> =>\n value != null && typeof (value as { then?: unknown }).then === \"function\";\n\n/** A card's place, for the live region: \"To do, position 2 of 3\". */\nconst placeWords = (at: { col: KanbanColumn; index: number }) => `${at.col.title}, position ${at.index + 1} of ${at.col.cards.length}`;\n\n/** A column holds more cards than its limit (Sprint 25.8.7 item 29). */\nconst overLimit = (col: KanbanColumn) => col.limit != null && col.cards.length > col.limit;\n\n/** Said after a move that leaves its column past its limit, which the header marks: \"\" when it doesn't. */\nconst overLimitWords = (col: KanbanColumn) => (overLimit(col) ? ` ${col.title} is over its limit of ${col.limit}.` : \"\");\n\n/** A column's count against its limit, as a screen reader hears it: \"3 cards, limit 5\", \"6 cards, over the limit of 5\". */\nconst countWords = (count: number, limit: number) =>\n `${count} ${count === 1 ? \"card\" : \"cards\"}, ${count > limit ? `over the limit of ${limit}` : `limit ${limit}`}`;\n\n/**\n * Sprint 25.8.7 item 29 (time-and-planning-10): a column's count, against its work-in-progress limit when it has one\n * (\"4/3\"). Past the limit a warning icon follows it, so the mark is never colour alone (WCAG 1.4.1), and a screen reader\n * hears the count in words rather than \"4 slash 3\". The count keeps the header's grey: the status words' colours are\n * made to read on the page, not on a column's muted ground, so only the icon, a mark, takes the warning colour (as an\n * inline field error's icon keeps its status colour).\n */\nfunction ColumnCount({ count, limit }: { count: number; limit?: number }) {\n if (limit == null) return <span className=\"text-xs text-[var(--ds-text-muted)] tabular-nums\">{count}</span>;\n return (\n <span className=\"inline-flex items-center gap-ds-1 text-xs text-[var(--ds-text-muted)] tabular-nums\">\n <span aria-hidden=\"true\">{count}/{limit}</span>\n {count > limit && (\n <span aria-hidden=\"true\" data-kanban-over-limit=\"\" className=\"inline-flex shrink-0 text-[var(--ds-status-warning)]\">\n <Icon name=\"warning\" size={14} />\n </span>\n )}\n <span className=\"sr-only\">{countWords(count, limit)}</span>\n </span>\n );\n}\n\n/** Read to a screen reader on every card that can be dragged (dnd-kit's aria-describedby). */\nconst MOVE_INSTRUCTIONS = \"Press Space to pick up the card. Use the Left and Right arrow keys to move it between columns, \"\n + \"and the Up and Down arrow keys to move it within a column. Press Space again to drop it, or Escape to cancel.\";\n\nfunction BoardColumn({\n col,\n readOnly,\n filled,\n children,\n}: {\n col: KanbanColumn;\n readOnly?: boolean;\n /** The board has a height of its own (the page's, or its pane's): the column takes it and scrolls its cards. */\n filled?: boolean;\n children: ReactNode;\n}) {\n // Sprint 25.7, C2: the column is a drop area as well as a sortable list, so an empty column takes a card\n const { setNodeRef, isOver } = useDroppable({ id: columnDropId(col.id), disabled: readOnly });\n // Sprint 25.16 A42: a column that scrolls its cards, with no card to Tab to (a read-only board), is a Tab stop itself\n const [cards, setCardsEl] = useState<HTMLDivElement | null>(null);\n const setCards = useCallback((node: HTMLDivElement | null) => { setNodeRef(node); setCardsEl(node); }, [setNodeRef]);\n useKeyboardScroll(cards, col.title, !!filled);\n return (\n <div\n className={cn(\n \"flex flex-col shrink-0 w-[calc(100vw-4rem)] sm:w-[280px] snap-center\",\n filled && \"min-h-0\",\n \"bg-[var(--ds-bg-muted)] rounded-[var(--ds-radius-lg)]\",\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n )}\n >\n <div className=\"flex items-center justify-between px-ds-3 py-ds-2.5\">\n <div className=\"flex items-center gap-ds-2\">\n {col.color && (\n <span\n className=\"w-2.5 h-2.5 rounded-[var(--ds-radius-full)] shrink-0\"\n style={{ backgroundColor: col.color }}\n />\n )}\n <span className=\"text-sm font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)]\">\n {col.title}\n </span>\n <ColumnCount count={col.cards.length} limit={col.limit} />\n </div>\n <Icon name=\"plus\" size={14} className=\"text-[var(--ds-text-muted)]\" />\n </div>\n\n <SortableContext\n items={col.cards.map((c) => c.id)}\n strategy={verticalListSortingStrategy}\n id={col.id}\n >\n <div\n ref={setCards}\n data-kanban-column={col.id}\n className={cn(\n \"flex flex-col gap-ds-2.5 px-ds-3 pb-ds-3 min-h-[60px] rounded-b-[var(--ds-radius-lg)] transition-colors\",\n // scrolling, it keeps room above the first card for its focus outline (drawn where the header's padding was) and\n // brings a card focused by keyboard in with room around it: the outline's reach, 4 px, never a theme space (P3)\n filled && cn(\"flex-1 min-h-0 overflow-y-auto -mt-[4px] pt-[4px] scroll-py-ds-2\", FOCUS_INSET),\n isOver && col.cards.length === 0 && \"bg-[var(--ds-bg-surface)]/60\",\n )}\n >\n {children}\n </div>\n </SortableContext>\n </div>\n );\n}\n\nexport function KanbanBoard({\n columns: columnsProp,\n onColumnsChange,\n onCardMove,\n readOnly,\n renderCard,\n onCardClick,\n cardActions,\n className,\n}: KanbanBoardProps) {\n // Sprint 25.14 A44: a board frames itself, so a SplitView's list pane draws nothing behind it\n useFramesItself();\n // Sprint 25.7, C2: `columns` is authoritative — a new array replaces what the board shows. A move is previewed while\n // the card is dragged and held once dropped (HeldMove) until `columns` shows it; a cancelled drag (Escape) leaves the\n // board as it was.\n const [seenProp, setSeenProp] = useState(columnsProp);\n const [holds, setHoldsState] = useState<HeldMove[]>([]);\n // the preview lives in a ref as well, so a drop in the same tick as the last hover still reads it\n const [preview, setPreviewState] = useState<KanbanColumn[] | null>(null);\n const previewRef = useRef<KanbanColumn[] | null>(null);\n const setPreview = (next: KanbanColumn[] | null) => { previewRef.current = next; setPreviewState(next); };\n const [activeCard, setActiveCard] = useState<KanbanCard | null>(null);\n // the holds, the columns and the card being dragged, for a save that settles after this render\n const holdsRef = useRef<HeldMove[]>([]);\n const columnsRef = useRef(columnsProp);\n const activeRef = useRef<string | null>(null);\n const setHolds = (next: HeldMove[]) => { holdsRef.current = next; setHoldsState(next); };\n if (columnsProp !== seenProp) {\n setSeenProp(columnsProp);\n // new columns (a save landing, a refetch, another user's move): the holds they settle end, the rest replay over them\n const kept = keptHolds(holds, columnsProp);\n if (kept !== holds) setHoldsState(kept);\n // new columns while a card is held: the preview is rebuilt from them\n if (preview && activeCard) setPreviewState(rebase(replayHolds(columnsProp, kept), preview, activeCard.id));\n }\n // a preview or holds updated while rendering reach their refs before any drag event or settled save reads them\n useLayoutEffect(() => { previewRef.current = preview; }, [preview]);\n useLayoutEffect(() => { holdsRef.current = holds; }, [holds]);\n useLayoutEffect(() => { columnsRef.current = columnsProp; }, [columnsProp]);\n const committed = useMemo(() => replayHolds(columnsProp, holds), [columnsProp, holds]);\n const columns = preview ?? committed;\n\n // The live region speaks card and column titles, never ids. Each handler words its news in `said`, and dnd-kit\n // announces it straight after calling the handler. A move is said when the card's landing place changes.\n const said = useRef<string | undefined>(undefined);\n const lastPlace = useRef<string | null>(null);\n const announcements = useMemo<Announcements>(() => {\n const take = () => { const text = said.current; said.current = undefined; return text; };\n return { onDragStart: take, onDragOver: take, onDragEnd: take, onDragCancel: take };\n }, []);\n const instructions = { draggable: onCardClick ? `Press Enter to open the card. ${MOVE_INSTRUCTIONS}` : MOVE_INSTRUCTIONS };\n // A save that fails after the drag is over has no dnd-kit event to speak in: the board's own status line says it,\n // every failure since the last pick-up together, so two that land at once are both heard.\n const [notice, setNotice] = useState(\"\");\n const noticeParts = useRef<string[]>([]);\n const say = (text: string) => { noticeParts.current = [...noticeParts.current, text]; setNotice(noticeParts.current.join(\" \")); };\n // The card to focus once a failed save has put it back: its element is rendered anew in the column it returns to.\n const rootRef = useRef<HTMLDivElement>(null);\n // the board scrolls sideways: a card the keyboard reaches at its edge comes in whole, with its outline (Sprint 30, P3)\n const [board, setBoard] = useState<HTMLDivElement | null>(null);\n const setRoot = useCallback((node: HTMLDivElement | null) => { rootRef.current = node; setBoard(node); }, []);\n useRevealFocus(board);\n // Sprint 25.16 A42 (P31): a board that is its page's last content takes the height under the header, and one in a\n // SplitView's pane takes the pane's; each column then scrolls its own cards, and the page or the pane doesn't\n const fill = useFillHeight(rootRef);\n const inPane = useContext(FillContext);\n const filled = fill != null || inPane;\n /** A card's own element on this board: the card itself, or its Move button. */\n const cardPart = (attr: \"data-kanban-card\" | \"data-kanban-move\", id: string) =>\n [...(rootRef.current?.querySelectorAll<HTMLElement>(`[${attr}]`) ?? [])].find((el) => el.getAttribute(attr) === id);\n // The card, or its Move button, to focus once a move has put the card somewhere new: its elements are rendered anew in\n // the column it goes to.\n const refocus = useRef<{ id: string; part: \"card\" | \"move\" } | null>(null);\n useLayoutEffect(() => {\n const target = refocus.current;\n if (target == null) return;\n refocus.current = null;\n cardPart(target.part === \"move\" ? \"data-kanban-move\" : \"data-kanban-card\", target.id)?.focus();\n });\n const holdKey = useRef(0);\n\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 5 } }),\n useSensor(KeyboardSensor, {\n coordinateGetter: boardCoordinates,\n // Space picks up and drops; Enter is the card's open key (onCardClick)\n keyboardCodes: { start: [\"Space\"], cancel: [\"Escape\"], end: [\"Space\"] },\n }),\n );\n // read-only: no sensors at all (an absent list would give dnd-kit's defaults)\n const noSensors = useSensors();\n\n const handleDragStart = (event: DragStartEvent) => {\n const at = locate(committed, String(event.active.id));\n if (!at) return;\n noticeParts.current = [];\n setNotice(\"\");\n activeRef.current = at.col.cards[at.index].id;\n setActiveCard(at.col.cards[at.index]);\n setPreview(committed);\n lastPlace.current = placeWords(at);\n said.current = `Picked up ${at.col.cards[at.index].title} in ${lastPlace.current}.`;\n };\n\n // Across columns, the preview moves the card as it is dragged; the parent hears nothing until the drop.\n const handleDragOver = (event: DragOverEvent) => {\n const { active, over } = event;\n const activeId = String(active.id);\n const overId = over ? String(over.id) : null;\n const cols = previewRef.current ?? committed;\n const from = locate(cols, activeId);\n const toColumnId = overId == null || overId === activeId ? null : droppedColumnId(overId) ?? locate(cols, overId)?.col.id;\n if (from && toColumnId && from.col.id !== toColumnId) {\n const card = from.col.cards[from.index];\n setPreview(cols.map((col) => {\n if (col.id === from.col.id) return { ...col, cards: col.cards.filter((c) => c.id !== activeId) };\n if (col.id !== toColumnId) return col;\n const overIndex = col.cards.findIndex((c) => c.id === overId);\n const cards = [...col.cards];\n cards.splice(overIndex >= 0 ? overIndex : cards.length, 0, card);\n return { ...col, cards };\n }));\n }\n // where a drop now would put the card\n const now = overId == null ? null : locate(landing(previewRef.current ?? committed, activeId, overId), activeId);\n const where = now ? placeWords(now) : null;\n if (where === lastPlace.current) return;\n lastPlace.current = where;\n const title = now ? now.col.cards[now.index].title : activeCard?.title;\n said.current = now ? `${title} is over ${where}.` : `${title} is not over a column.`;\n };\n\n /** A card's move failed: the hold ends and the card shows where `columns` has it, said on the status line. */\n const putBack = (hold: HeldMove) => {\n const rest = holdsRef.current.filter((h) => h.cardId !== hold.cardId);\n const shown = replayHolds(columnsRef.current, rest);\n const back = locate(shown, hold.cardId);\n const card = back?.col.cards[back.index];\n // focus follows the card only from this board (two boards over the same data each render it), to the control that\n // had it: the card or its Move button (Sprint 25.8.7 item 3). From the button's open menu, which sits outside the\n // board, it goes to the button when the card goes back to another column, where the button and its menu are new.\n const focused = document.activeElement;\n const inSlot = !!focused && !!rootRef.current?.contains(focused) && focused.closest?.(\"[data-kanban-item]\")?.getAttribute(\"data-kanban-item\") === hold.cardId;\n const menuOpen = cardPart(\"data-kanban-move\", hold.cardId)?.getAttribute(\"aria-expanded\") === \"true\";\n if (inSlot) refocus.current = { id: hold.cardId, part: focused?.hasAttribute(\"data-kanban-move\") ? \"move\" : \"card\" };\n else if (menuOpen && locate(replayHolds(columnsRef.current, holdsRef.current), hold.cardId)?.col.id !== back?.col.id) {\n refocus.current = { id: hold.cardId, part: \"move\" };\n }\n setHolds(rest);\n // a card held mid-drag: the preview is rebuilt without the failed move, so the drop cannot carry it\n if (previewRef.current && activeRef.current) setPreview(rebase(shown, previewRef.current, activeRef.current));\n if (!back || !card) return;\n const to = columnsRef.current.find((col) => col.id === hold.toColumnId)?.title;\n say(isAt(columnsRef.current, hold.origin) || !to\n ? `Move not saved. ${card.title} is back in ${placeWords(back)}.`\n : `Move not saved. ${card.title} could not move to ${to}.`);\n };\n\n /** A save for a card has settled. The latest move's failure puts the card back; otherwise, once none is out, the hold is judged against the columns. */\n const settle = (cardId: string, key: number, ok: boolean) => {\n const hold = holdsRef.current.find((h) => h.cardId === cardId);\n if (!hold) return;\n if (!ok && hold.key === key) return putBack(hold);\n const inFlight = hold.inFlight - 1;\n const next = holdsRef.current.map((h) => (h === hold ? { ...h, inFlight, layout: inFlight > 0 ? h.layout : layoutOf(columnsRef.current) } : h));\n // the columns may already show the card elsewhere (a refetch that landed before the save resolved)\n setHolds(inFlight > 0 ? next : keptHolds(next, columnsRef.current));\n };\n\n /**\n * A move the person made, dropped or chosen from the card's Move menu: the board holds the card at its new place and\n * saves it through the handlers. One path for both (Sprint 25.8.7 item 3), so a page refuses a menu move as it refuses\n * a drop, and the card goes back the same way.\n */\n const commit = (final: KanbanColumn[], cardId: string) => {\n const after = locate(final, cardId);\n if (!after) return;\n const key = ++holdKey.current;\n // a new move of a card replaces its hold's place; the replaced move's save stays in flight\n const prev = holdsRef.current.find((h) => h.cardId === cardId);\n const hold: HeldMove = {\n ...placementIn(final, cardId)!,\n key,\n inFlight: prev?.inFlight ?? 0,\n origin: prev?.origin ?? placementIn(columnsProp, cardId) ?? placementIn(committed, cardId)!,\n earlier: prev ? [...prev.earlier, { cardId: prev.cardId, toColumnId: prev.toColumnId, beforeId: prev.beforeId, index: prev.index }] : [],\n layout: layoutOf(columnsProp),\n };\n setHolds([...holdsRef.current.filter((h) => h.cardId !== cardId), hold]);\n const saves: PromiseLike<unknown>[] = [];\n try {\n for (const result of [onColumnsChange?.(final), onCardMove?.(after.col.cards[after.index], after.col.id, after.index)]) {\n if (isThenable(result)) saves.push(result);\n }\n } catch (error) {\n // a handler that throws refuses the move, as a rejected save does; the error still reaches the console\n console.error(\"KanbanBoard: a move handler threw, so the move is refused.\", error);\n return putBack(hold);\n }\n if (!saves.length) return;\n setHolds(holdsRef.current.map((h) => (h.key === key ? { ...h, inFlight: h.inFlight + 1 } : h)));\n // every save settles before the move counts as saved; any failure refuses it\n Promise.allSettled(saves).then((results) => settle(cardId, key, results.every((r) => r.status === \"fulfilled\")));\n };\n\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n const activeId = String(active.id);\n const cols = previewRef.current ?? committed;\n activeRef.current = null;\n setActiveCard(null);\n setPreview(null);\n const final = over ? landing(cols, activeId, String(over.id)) : committed;\n const before = locate(committed, activeId);\n const after = locate(final, activeId);\n if (!before || !after || (before.col.id === after.col.id && before.index === after.index)) {\n if (before) said.current = `Dropped ${before.col.cards[before.index].title} back in ${placeWords(before)}.`;\n return;\n }\n said.current = `Dropped ${after.col.cards[after.index].title} in ${placeWords(after)}.${overLimitWords(after.col)}`;\n commit(final, activeId);\n };\n\n /**\n * Sprint 25.8.7 item 3 (WCAG 2.5.7): a move chosen from a card's Move menu, by a click, a tap or the keyboard. Another\n * column takes the card at its top, where a keyboard drag's Left and Right put it; a step moves it one place within its\n * own column, as Up and Down do.\n */\n const moveFromMenu = (cardId: string, toColumnId: string, step = 0) => {\n const at = locate(committed, cardId);\n const to = committed.find((col) => col.id === toColumnId);\n if (!at || !to) return;\n const index = to.id === at.col.id ? at.index + step : 0;\n const beforeId = to.cards.filter((c) => c.id !== cardId)[index]?.id ?? null;\n const final = place(committed, { cardId, toColumnId, beforeId, index });\n const after = locate(final, cardId);\n if (!after || (after.col.id === at.col.id && after.index === at.index)) return;\n // said on the board's status line, as a drop is in dnd-kit's live region; a failure replaces it (putBack's say)\n noticeParts.current = [];\n setNotice(`Moved ${at.col.cards[at.index].title} to ${placeWords(after)}.${overLimitWords(after.col)}`);\n commit(final, cardId);\n // Focus goes to the card's ⋯ in its new place, the button that opened the menu, as a menu's own rule puts it back on\n // its button (Sprint 25.29 item 8), and stays there when the move was refused at once. The menu's own return can't\n // hold: the button moves with the card.\n refocus.current = { id: cardId, part: \"move\" };\n };\n\n /**\n * What a card's Move menu offers: the columns it isn't in, in the board's order (the one it is in is left out: the\n * menu lists what can be done, and the card is drawn under that column's heading already), then a step up or down\n * where it can take one.\n */\n const movesFor = (col: KanbanColumn, index: number): MoveChoice[] => {\n if (readOnly) return [];\n const others: MoveChoice[] = columns.filter((c) => c.id !== col.id).map((c) => ({ label: `Move to ${c.title}`, to: c.id, step: 0 }));\n const steps: MoveChoice[] = [\n ...(index > 0 ? [{ label: \"Move up\", to: col.id, step: -1 }] : []),\n ...(index < col.cards.length - 1 ? [{ label: \"Move down\", to: col.id, step: 1 }] : []),\n ];\n return [...others, ...steps];\n };\n // the lifted card keeps its Move button's room and shows its ⋯, as the card it lifts does\n const activeAt = activeCard ? locate(columns, activeCard.id) : null;\n const activeMovable = !!activeAt && cardMenuOf(activeAt.col.cards[activeAt.index], menuOf(movesFor(activeAt.col, activeAt.index), () => {}), cardActions).length > 0;\n\n const handleDragCancel = (event: DragCancelEvent) => {\n activeRef.current = null;\n setActiveCard(null);\n setPreview(null);\n const at = locate(committed, String(event.active.id));\n if (at) said.current = `Move cancelled. ${at.col.cards[at.index].title} is back in ${placeWords(at)}.`;\n };\n\n return (\n <DndContext\n sensors={readOnly ? noSensors : sensors}\n accessibility={{ announcements, screenReaderInstructions: instructions }}\n collisionDetection={closestCorners}\n onDragStart={handleDragStart}\n onDragOver={handleDragOver}\n onDragEnd={handleDragEnd}\n onDragCancel={handleDragCancel}\n >\n <div ref={setRoot} data-fill={fill != null ? \"\" : undefined} className={cn(\"relative flex gap-ds-4 overflow-x-auto pb-ds-2 scroll-px-[4px] snap-x snap-mandatory sm:snap-none\", inPane && \"h-full min-h-0\", className)} style={fill != null ? { height: fill } : undefined}>\n {columns.map((col) => (\n <BoardColumn key={col.id} col={col} readOnly={readOnly} filled={filled}>\n {col.cards.map((card, index) => (\n <SortableCard\n key={card.id}\n card={card}\n renderCard={renderCard}\n onCardClick={onCardClick}\n readOnly={readOnly}\n moves={movesFor(col, index)}\n onMove={moveFromMenu}\n cardActions={cardActions}\n />\n ))}\n </BoardColumn>\n ))}\n {/* inside the board's root, so a board in a spaced stack stays one element */}\n <div role=\"status\" className=\"sr-only\">{notice}</div>\n </div>\n\n <DragOverlay>\n {activeCard && <OverlayCard card={activeCard} renderCard={renderCard} moveRoom={activeMovable} />}\n </DragOverlay>\n </DndContext>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../showcase/src/components/KanbanBoard.tsx"],"names":["style"],"mappings":";;;;;;;;;;;;;;;;;;AAgHA,IAAM,eAAA,GAAkB,kCAAA;AACxB,IAAM,cAAA,GAAiB,0DAAA;AAKvB,SAAS,UAAA,CAAW,IAAA,EAAkB,WAAA,EAAkC,WAAA,EAAoE;AAC1I,EAAA,IAAI,CAAC,aAAa,OAAO,WAAA;AACzB,EAAA,MAAM,IAAA,GAA4B,EAAE,KAAA,EAAO,MAAA,EAAQ,OAAO,WAAA,EAA0D;AACpH,EAAA,MAAM,GAAA,GAAM,WAAA,CAAY,IAAA,EAAM,IAAI,CAAA;AAElC,EAAA,MAAM,MAAA,GAAS,CAAC,CAAA,KAAyB,CAAA,KAAM,QAAS,OAAA,IAAW,CAA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AAW,QAAQ,IAAA,GAAO,EAAA,GAAK,MAAA,EAAW,SAAA,EAAW,EAAA,CAAG,mGAAA,EAAqG,UAAU,gBAAA,EAAkB,SAAS,GAAG,KAAA,EAAO,IAAA,IAAQ,OAAO,EAAE,MAAA,EAAQ,IAAA,EAAK,GAAI,MAAA,EAC9P,QAAA,EAAA;AAAA,UAAA,OAAA,CAAQ,GAAA,CAAI,CAAC,GAAA,qBACZ,GAAA,CAAC,WAAA,EAAA,EAAyB,GAAA,EAAU,QAAA,EAAoB,MAAA,EACrD,QAAA,EAAA,GAAA,CAAI,KAAA,CAAM,GAAA,CAAI,CAAC,MAAM,KAAA,qBACpB,GAAA;AAAA,YAAC,YAAA;AAAA,YAAA;AAAA,cAEC,IAAA;AAAA,cACA,UAAA;AAAA,cACA,WAAA;AAAA,cACA,QAAA;AAAA,cACA,KAAA,EAAO,QAAA,CAAS,GAAA,EAAK,KAAK,CAAA;AAAA,cAC1B,MAAA,EAAQ,YAAA;AAAA,cACR;AAAA,aAAA;AAAA,YAPK,IAAA,CAAK;AAAA,WASb,CAAA,EAAA,EAZe,GAAA,CAAI,EAatB,CACD,CAAA;AAAA,8BAEA,KAAA,EAAA,EAAI,IAAA,EAAK,QAAA,EAAS,SAAA,EAAU,WAAW,QAAA,EAAA,MAAA,EAAO;AAAA,SAAA,EACjD,CAAA;AAAA,wBAEA,GAAA,CAAC,WAAA,EAAA,EACE,QAAA,EAAA,UAAA,oBAAc,GAAA,CAAC,WAAA,EAAA,EAAY,MAAM,UAAA,EAAY,UAAA,EAAwB,QAAA,EAAU,aAAA,EAAe,CAAA,EACjG;AAAA;AAAA;AAAA,GACF;AAEJ","file":"kanban.js","sourcesContent":["import { useCallback, useContext, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from \"react\";\nimport {\n DndContext,\n closestCorners,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n type Announcements,\n type DragCancelEvent,\n type DragEndEvent,\n type DragOverEvent,\n DragOverlay,\n type DragStartEvent,\n type KeyboardCoordinateGetter,\n useDroppable,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n useSortable,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { cn, FOCUS_INSET, FOCUS_RING } from \"../lib/utils\";\nimport { Icon } from \"../lib/icons\";\nimport { AutoTooltip } from \"./Tooltip\";\nimport { useTextOverflow } from \"../lib/use-text-overflow\";\nimport { Badge } from \"./Badge\";\nimport { Button } from \"./Button\";\nimport { DropdownMenu, type DropdownMenuDivider, type DropdownMenuEntry, type DropdownMenuItem, type DropdownMenuSubmenu } from \"./DropdownMenu\";\nimport { useFramesItself } from \"../lib/surface-context\";\nimport { FillContext, useFillHeight } from \"../lib/use-fill-height\";\nimport { useKeyboardScroll } from \"../lib/use-keyboard-scroll\";\nimport { useRevealFocus } from \"../lib/reveal-focus\";\n\nexport interface KanbanCard {\n id: string;\n title: string;\n description?: string;\n tags?: string[];\n avatar?: string;\n}\n\nexport interface KanbanColumn {\n id: string;\n title: string;\n cards: KanbanCard[];\n color?: string;\n /**\n * The column's work-in-progress limit, in cards: the header shows its count against it (\"4/3\"), and a column holding\n * more is marked with a warning icon, its count's words saying so to a screen reader. A limit informs and never refuses\n * a drop; a page that must refuse a move still can, in onCardMove. Default: no limit, the count alone.\n */\n limit?: number;\n}\n\nexport interface KanbanBoardProps {\n /**\n * The board's cards by column. Authoritative: the board shows what it is given, with one exception — a card just\n * dropped stays where it was dropped until `columns` shows the move, the save fails, or `columns` changes some other\n * way (see onCardMove). A re-render that passes the same cards again, or an array rebuilt with the same cards,\n * never puts a dropped card back.\n */\n columns: KanbanColumn[];\n /**\n * The columns after a move, once on drop (Sprint 25.7, C2: it used to fire on every hover step). Its return value\n * counts as onCardMove's does.\n */\n onColumnsChange?: (columns: KanbanColumn[]) => unknown;\n /**\n * A card was moved to a new place: its column and its index there, once on drop, or on a choice from the card's Move\n * menu (the button beside each card that moves it without dragging: to the top of another column, or a step up or\n * down) — a move between columns, into an empty one, or a reorder within one. Save the move here (or in\n * onColumnsChange); a board with neither saves nothing. The index counts the cards the board shows: when `columns` is\n * filtered, it is the place among the cards passed.\n *\n * Return the save's promise (an async function, or a mutation's mutateAsync) and the card stays where it was dropped\n * while it saves, and while an earlier move of the same card still saves, whatever `columns` arrive meanwhile; when\n * it rejects, the card goes back to where `columns` has it, a screen reader hears so, and the app says why (a toast\n * inside the app shell). The save must settle (give a request a timeout): one that never does holds the card. A\n * handler that throws refuses a move the same way (one the person isn't allowed to make). An app that updates\n * `columns` at once, then saves, puts the card back itself when its save fails; the board still says the move was not\n * saved.\n */\n onCardMove?: (card: KanbanCard, toColumnId: string, index: number) => unknown;\n /** A board to look at, not rearrange: no dragging, no grab cursor and no Move menu; cards still open with onCardClick. */\n readOnly?: boolean;\n renderCard?: (card: KanbanCard) => ReactNode;\n /**\n * Opens a card (a detail drawer, a route). The board's own card surface is the control: click, or Enter with the\n * card focused, opens it; Space picks the card up for a keyboard drag. Never wire a clickable element inside\n * renderCard — a role=\"button\" div fights the drag listeners and the judge cites it (Sprint 25.4 K-1).\n */\n onCardClick?: (card: KanbanCard) => void;\n /**\n * A card's own actions (open, edit its labels, copy a link, delete…), for its ⋯ menu. `move` is the board's Move entry,\n * a submenu of the columns the card can go to and its steps up and down: put it where it belongs among the actions;\n * left out, the board adds it at the end, since it is the way to move a card without dragging (WCAG 2.5.7). Without\n * cardActions the menu is the move choices alone. On a read-only board the menu holds the actions, with no Move.\n */\n cardActions?: (card: KanbanCard, move: DropdownMenuSubmenu) => DropdownMenuEntry[];\n className?: string;\n}\n\n/**\n * The room a card keeps clear in its top right for its Move button (Sprint 25.8.7 item 3), so no content runs under it:\n * the default card's title stops short of it, as a Card's title stops before its ⋯, and a renderCard's content is kept\n * off that edge whole, since the board can't know what its first line holds. The button sits as far in from the card's\n * corner as its top, so the room is its width.\n */\nconst MOVE_ROOM_TITLE = \"pr-[var(--ds-control-height-sm)]\";\nconst MOVE_ROOM_CARD = \"pr-[calc(var(--ds-space-3)+var(--ds-control-height-sm))]\";\n/**\n * A card's ⋯ menu: the page's actions with the board's Move among them, or at their end; Move's choices alone without\n * actions. Dividers at either end, or two together, go (a Move left out where there is nowhere to move leaves one).\n */\nfunction cardMenuOf(card: KanbanCard, moveEntries: DropdownMenuEntry[], cardActions?: KanbanBoardProps[\"cardActions\"]): DropdownMenuEntry[] {\n if (!cardActions) return moveEntries;\n const move: DropdownMenuSubmenu = { label: \"Move\", items: moveEntries as (DropdownMenuItem | DropdownMenuDivider)[] };\n const own = cardActions(card, move);\n // the board's Move by its choices, so a copy the page made of it (`{ ...move, icon }`) is Move still\n const isMove = (e: DropdownMenuEntry) => e === move || (\"items\" in e && e.items === move.items);\n const divider: DropdownMenuDivider = { type: \"divider\" };\n const entries = moveEntries.length === 0 ? own.filter((e) => !isMove(e)) : own.some(isMove) ? own : [...own, divider, move];\n const isDivider = (e: DropdownMenuEntry | undefined) => !!e && \"type\" in e && e.type === \"divider\";\n return entries.reduce<DropdownMenuEntry[]>((acc, e) => (isDivider(e) && (acc.length === 0 || isDivider(acc[acc.length - 1])) ? acc : [...acc, e]), [])\n .filter((e, i, all) => !(isDivider(e) && i === all.length - 1));\n}\n\n/** A card's Move choices as its menu's entries: the columns, then a divider, then the steps. */\nfunction menuOf(moves: MoveChoice[], choose: (move: MoveChoice) => void): DropdownMenuEntry[] {\n const entry = (m: MoveChoice): DropdownMenuEntry => ({ label: m.label, onClick: () => choose(m) });\n const others = moves.filter((m) => m.step === 0).map(entry);\n const steps = moves.filter((m) => m.step !== 0).map(entry);\n return others.length && steps.length ? [...others, { type: \"divider\" }, ...steps] : [...others, ...steps];\n}\n\n/** Where the Move button sits: in the card's top right, as far in from its top as from its side. */\nconst MOVE_PLACE = \"absolute top-ds-1.5 right-ds-1.5\";\n\n/** One choice in a card's Move menu: to the top of another column, or a step within its own (-1 up, 1 down). */\ninterface MoveChoice {\n label: string;\n to: string;\n step: number;\n}\n\nfunction SortableCard({\n card,\n renderCard,\n onCardClick,\n readOnly,\n moves,\n onMove,\n cardActions,\n}: {\n card: KanbanCard;\n renderCard?: (card: KanbanCard) => ReactNode;\n onCardClick?: (card: KanbanCard) => void;\n readOnly?: boolean;\n /** The card's Move menu: empty on a read-only board, and where there is nowhere to move it. */\n moves: MoveChoice[];\n /** Makes a move from the menu (the board's), on the press that chose it. */\n onMove: (cardId: string, to: string, step: number) => void;\n cardActions?: KanbanBoardProps[\"cardActions\"];\n}) {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id: card.id, disabled: readOnly });\n\n // the card's ⋯ menu: its actions and Move, or Move alone (no Move on a read-only board)\n const entries = cardMenuOf(card, readOnly ? [] : menuOf(moves, (m) => onMove(card.id, m.to, m.step)), cardActions);\n const renderMenu = (style: CSSProperties | undefined, faded: boolean) => (\n <DropdownMenu\n items={entries}\n trigger={\n // the library's icon button: its name says what its menu is for, and it shows that name as its one tooltip;\n // shown at all times, since a phone has no hover; quiet, as a Card's ⋯ is\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={cardActions ? `Actions for ${card.title}` : `Move ${card.title}`}\n data-kanban-move={card.id}\n style={style}\n className={cn(MOVE_PLACE, \"text-[var(--ds-text-muted)] hover:text-[var(--ds-text-primary)]\", faded && \"opacity-30\")}\n >\n <Icon name=\"more-horizontal\" size={14} />\n </Button>\n }\n />\n );\n const menu = entries.length > 0 ? renderMenu : null;\n\n if (readOnly) {\n // nothing to pick up: a card that opens is a button (Enter and Space), one that does not is a plain surface\n const open = onCardClick ? () => onCardClick(card) : undefined;\n const surface = (\n <div\n ref={setNodeRef}\n {...(open ? { role: \"button\", tabIndex: 0 } : {})}\n onClick={open}\n onKeyDown={open ? (e) => { if (e.key === \"Enter\" || e.key === \" \") { e.preventDefault(); open(); } } : undefined}\n data-kanban-card={card.id}\n className={cn(\n \"rounded-[var(--ds-radius-md)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"bg-[var(--ds-bg-surface)] p-ds-3 shadow-[var(--ds-shadow-button)]\",\n // a card with its actions' ⋯ keeps the button's room clear, as a card that moves does\n menu && renderCard && MOVE_ROOM_CARD,\n open ? \"cursor-pointer\" : \"cursor-default\",\n FOCUS_RING,\n )}\n >\n {renderCard ? renderCard(card) : <DefaultCard card={card} moveRoom={!!menu} />}\n </div>\n );\n // a card with actions keeps its menu beside it, never inside it (a control inside a control)\n return menu ? <div className=\"relative\" data-kanban-item={card.id}>{surface}{menu(undefined, false)}</div> : surface;\n }\n\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n };\n const movable = !!menu;\n\n return (\n // Sprint 25.8.7 item 3 (WCAG 2.5.7): the card's slot holds the card and, beside it, its Move button, never one\n // inside the other (a control inside a control: the card is the drag's button). The card stays the node the drag\n // measures and moves; the button takes the same transform, so it travels with the card as the list sorts.\n <div className=\"relative\" data-kanban-item={card.id}>\n <div\n ref={setNodeRef}\n style={style}\n {...attributes}\n {...listeners}\n // the surface is the control (K-1): a click opens (the pointer sensor needs 5 px of movement to start a drag),\n // Enter opens, Space stays the keyboard drag's pick-up\n onClick={onCardClick ? () => onCardClick(card) : undefined}\n onKeyDown={(e) => {\n if (onCardClick && e.key === \"Enter\") { e.preventDefault(); onCardClick(card); return; }\n listeners?.onKeyDown?.(e);\n }}\n data-kanban-card={card.id}\n className={cn(\n \"rounded-[var(--ds-radius-md)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"bg-[var(--ds-bg-surface)] p-ds-3 active:cursor-grabbing\",\n movable && renderCard && MOVE_ROOM_CARD,\n onCardClick ? \"cursor-pointer\" : \"cursor-grab\",\n \"shadow-[var(--ds-shadow-button)]\",\n \"transition-shadow duration-[var(--ds-transition-speed)]\",\n FOCUS_RING,\n // no scale on the card left behind: the drag overlay takes its size from it, and 2% wider made the cards\n // below count as \"to the right\" of it, so a keyboard drag's arrow keys landed on them (Sprint 25.7, C2)\n isDragging && \"opacity-30\",\n )}\n >\n {renderCard ? (\n renderCard(card)\n ) : (\n <DefaultCard card={card} moveRoom={movable} />\n )}\n </div>\n {menu && menu(style, isDragging)}\n </div>\n );\n}\n\nfunction ClampedDescription({ children }: { children: string }) {\n const { ref, isTruncated } = useTextOverflow({ lines: 2 });\n const el = <p ref={ref} className=\"text-xs text-[var(--ds-text-secondary)] line-clamp-2\">{children}</p>;\n if (!isTruncated) return el;\n return <AutoTooltip content={children}>{el}</AutoTooltip>;\n}\n\nfunction TruncTitle({ children, className }: { children: string; className?: string }) {\n const { ref, isTruncated } = useTextOverflow({ lines: 1 });\n const el = <p ref={ref} className={cn(\"text-sm font-medium text-[var(--ds-text-primary)] truncate\", className)}>{children}</p>;\n if (!isTruncated) return el;\n return <AutoTooltip content={children}>{el}</AutoTooltip>;\n}\n\nfunction DefaultCard({ card, moveRoom }: { card: KanbanCard; moveRoom?: boolean }) {\n return (\n <div className=\"space-y-ds-2\">\n <TruncTitle className={moveRoom ? MOVE_ROOM_TITLE : undefined}>{card.title}</TruncTitle>\n {card.description && (\n <ClampedDescription>{card.description}</ClampedDescription>\n )}\n {card.tags && card.tags.length > 0 && (\n <div className=\"flex flex-wrap gap-ds-1\">\n {card.tags.map((tag) => (\n <Badge key={tag} variant=\"subtle\" size=\"sm\">{tag}</Badge>\n ))}\n </div>\n )}\n </div>\n );\n}\n\nfunction OverlayCard({\n card,\n renderCard,\n moveRoom,\n}: {\n card: KanbanCard;\n renderCard?: (card: KanbanCard) => ReactNode;\n /** The card has a Move button: the lifted card keeps its room and shows its ⋯ (a picture of it, not a control). */\n moveRoom?: boolean;\n}) {\n return (\n <div\n className={cn(\n \"relative rounded-[var(--ds-radius-md)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"bg-[var(--ds-bg-surface)] p-ds-3 shadow-[var(--ds-shadow-card)]\",\n moveRoom && renderCard && MOVE_ROOM_CARD,\n )}\n >\n {renderCard ? renderCard(card) : <DefaultCard card={card} moveRoom={moveRoom} />}\n {moveRoom && (\n <span aria-hidden=\"true\" className={cn(MOVE_PLACE, \"inline-flex items-center justify-center h-[var(--ds-control-height-sm)] w-[var(--ds-control-height-sm)] text-[var(--ds-text-muted)]\")}>\n <Icon name=\"more-horizontal\" size={14} />\n </span>\n )}\n </div>\n );\n}\n\n/** A column's drop area has its own id, so it never collides with a card id. */\nconst DROP_PREFIX = \"kanban-column:\";\nconst columnDropId = (id: string) => `${DROP_PREFIX}${id}`;\nconst droppedColumnId = (id: string) => (id.startsWith(DROP_PREFIX) ? id.slice(DROP_PREFIX.length) : null);\n\n/**\n * Sprint 25.7, C2: a keyboard drag goes column to column. Left and Right move the card to the top of the next column's\n * list — an empty column included — and Up and Down reorder within the column (dnd-kit's own handler). dnd-kit's\n * handler alone picks the nearest drop area to the right of the card's edge, which is often a card in the same column\n * or the card's own new place, so every other arrow key did nothing.\n */\nconst boardCoordinates: KeyboardCoordinateGetter = (event, args) => {\n if (event.code !== \"ArrowLeft\" && event.code !== \"ArrowRight\") return sortableKeyboardCoordinates(event, args);\n event.preventDefault();\n const { collisionRect, droppableRects, droppableContainers } = args.context;\n if (!collisionRect) return undefined;\n const columns = droppableContainers.getEnabled()\n .filter((c) => String(c.id).startsWith(DROP_PREFIX))\n .map((c) => droppableRects.get(c.id))\n .filter((r): r is NonNullable<typeof r> => r != null)\n .sort((a, b) => a.left - b.left);\n const centre = collisionRect.left + collisionRect.width / 2;\n const current = columns.findIndex((r) => centre >= r.left && centre <= r.left + r.width);\n const next = current < 0 ? undefined : columns[current + (event.code === \"ArrowRight\" ? 1 : -1)];\n if (!next) return undefined;\n return { x: next.left + (next.width - collisionRect.width) / 2, y: next.top };\n};\n\n/** Where a card is: its column's id and its index there. */\nfunction locate(cols: KanbanColumn[], cardId: string): { col: KanbanColumn; index: number } | null {\n for (const col of cols) {\n const index = col.cards.findIndex((c) => c.id === cardId);\n if (index >= 0) return { col, index };\n }\n return null;\n}\n\n/** The columns after a drop on `overId`: within the column the preview put the card in, a drop on another card reorders it. */\nfunction landing(cols: KanbanColumn[], cardId: string, overId: string): KanbanColumn[] {\n const at = locate(cols, cardId);\n const overAt = locate(cols, overId);\n if (!at || !overAt || overAt.col.id !== at.col.id || overAt.index === at.index) return cols;\n return cols.map((col) => (col.id === at.col.id ? { ...col, cards: arrayMove(col.cards, at.index, overAt.index) } : col));\n}\n\n/** A card's place, to re-apply to other columns: its column, the card after it (null when last) and its index. */\ninterface Placement {\n cardId: string;\n toColumnId: string;\n beforeId: string | null;\n index: number;\n}\n\nfunction placementIn(cols: KanbanColumn[], cardId: string): Placement | null {\n const at = locate(cols, cardId);\n return at ? { cardId, toColumnId: at.col.id, beforeId: at.col.cards[at.index + 1]?.id ?? null, index: at.index } : null;\n}\n\n/** The columns with a card put at a placement: into its column, before the same card (else at its index). */\nfunction place(cols: KanbanColumn[], p: Placement): KanbanColumn[] {\n const from = locate(cols, p.cardId);\n if (!from || !cols.some((col) => col.id === p.toColumnId)) return cols;\n const card = from.col.cards[from.index];\n return cols.map((col) => {\n if (col.id !== p.toColumnId && col.id !== from.col.id) return col;\n const cards = col.cards.filter((c) => c.id !== p.cardId);\n if (col.id === p.toColumnId) {\n const i = p.beforeId == null ? cards.length : cards.findIndex((c) => c.id === p.beforeId);\n cards.splice(i >= 0 ? i : Math.min(p.index, cards.length), 0, card);\n }\n return { ...col, cards };\n });\n}\n\n/**\n * A drag's move so far, re-applied to new columns: the card goes into the same column, before the same card, so a\n * change that arrives while a card is held shows at once and the drop keeps it.\n */\nfunction rebase(next: KanbanColumn[], shown: KanbanColumn[], cardId: string): KanbanColumn[] {\n const p = placementIn(shown, cardId);\n return p ? place(next, p) : next;\n}\n\n/**\n * A dropped card the board holds where it was dropped (Sprint 25.7, the owner's call of 26 September 2026: a card must\n * not jump back while its move saves). The pattern Atlassian's drag-and-drop guidance sets for Trello and Jira: the move\n * shows at once, before it is saved; data that arrives meanwhile has it replayed over it; a failed save lets the data\n * win, so the card goes back. One hold per card: a later move of the card replaces its place and adds its save to the\n * ones in flight.\n */\ninterface HeldMove extends Placement {\n /** The latest drop's key: only its save's failure puts the card back. */\n key: number;\n /** Saves for this card not yet settled, a replaced move's included: while one is out, nothing the columns show ends the hold. */\n inFlight: number;\n /** Where `columns` had the card before the first drop of this run of moves. */\n origin: Placement;\n /** The places of the moves this one replaced: columns showing one of them are behind, not a decision. */\n earlier: Placement[];\n /** The cards and their order in `columns` at the drop, or when its last save settled: with the card at its origin, a change ends the hold. */\n layout: string;\n}\n\n/** Which cards each column holds, in order: what a hold compares. A card's own fields changing is not a move. */\nconst layoutOf = (cols: KanbanColumn[]) => cols.map((col) => `${col.id}:${col.cards.map((c) => c.id).join(\",\")}`).join(\"|\");\n\n/** The columns show the card at a placement: in its column, before the same card (null: last). */\nfunction isAt(cols: KanbanColumn[], p: Placement): boolean {\n const at = locate(cols, p.cardId);\n return at != null && at.col.id === p.toColumnId && (at.col.cards[at.index + 1]?.id ?? null) === p.beforeId;\n}\n\n/**\n * The holds new columns keep. While a save for the card is out, every one (stale data, a card a filter hides, a card\n * that happens to sit where it was dropped). Once none is: a hold ends when its card or column is gone; with the card\n * at its origin, when the columns change some other way (the app's data has moved on — or, for a card moved back, has\n * caught up); when the columns show the card where it was dropped; or somewhere that is none of its own places (the\n * app's data decided). Columns showing one of its earlier places are behind, and the hold stays.\n */\nfunction keptHolds(holds: HeldMove[], cols: KanbanColumn[]): HeldMove[] {\n const layout = layoutOf(cols);\n const kept = holds.filter((h) => {\n if (h.inFlight > 0) return true;\n if (!locate(cols, h.cardId) || !cols.some((col) => col.id === h.toColumnId)) return false;\n // first, as a card moved back sits at its origin in data that has not caught up yet as well as in data that has\n if (isAt(cols, h.origin)) return layout === h.layout;\n if (isAt(cols, h)) return false;\n return h.earlier.some((p) => isAt(cols, p));\n });\n return kept.length === holds.length ? holds : kept;\n}\n\nconst replayHolds = (cols: KanbanColumn[], holds: HeldMove[]) => holds.reduce(place, cols);\n\nconst isThenable = (value: unknown): value is PromiseLike<unknown> =>\n value != null && typeof (value as { then?: unknown }).then === \"function\";\n\n/** A card's place, for the live region: \"To do, position 2 of 3\". */\nconst placeWords = (at: { col: KanbanColumn; index: number }) => `${at.col.title}, position ${at.index + 1} of ${at.col.cards.length}`;\n\n/** A column holds more cards than its limit (Sprint 25.8.7 item 29). */\nconst overLimit = (col: KanbanColumn) => col.limit != null && col.cards.length > col.limit;\n\n/** Said after a move that leaves its column past its limit, which the header marks: \"\" when it doesn't. */\nconst overLimitWords = (col: KanbanColumn) => (overLimit(col) ? ` ${col.title} is over its limit of ${col.limit}.` : \"\");\n\n/** A column's count against its limit, as a screen reader hears it: \"3 cards, limit 5\", \"6 cards, over the limit of 5\". */\nconst countWords = (count: number, limit: number) =>\n `${count} ${count === 1 ? \"card\" : \"cards\"}, ${count > limit ? `over the limit of ${limit}` : `limit ${limit}`}`;\n\n/**\n * Sprint 25.8.7 item 29 (time-and-planning-10): a column's count, against its work-in-progress limit when it has one\n * (\"4/3\"). Past the limit a warning icon follows it, so the mark is never colour alone (WCAG 1.4.1), and a screen reader\n * hears the count in words rather than \"4 slash 3\". The count keeps the header's grey: the status words' colours are\n * made to read on the page, not on a column's muted ground, so only the icon, a mark, takes the warning colour (as an\n * inline field error's icon keeps its status colour).\n */\nfunction ColumnCount({ count, limit }: { count: number; limit?: number }) {\n if (limit == null) return <span className=\"text-xs text-[var(--ds-text-muted)] tabular-nums\">{count}</span>;\n return (\n <span className=\"inline-flex items-center gap-ds-1 text-xs text-[var(--ds-text-muted)] tabular-nums\">\n <span aria-hidden=\"true\">{count}/{limit}</span>\n {count > limit && (\n <span aria-hidden=\"true\" data-kanban-over-limit=\"\" className=\"inline-flex shrink-0 text-[var(--ds-status-warning)]\">\n <Icon name=\"warning\" size={14} />\n </span>\n )}\n <span className=\"sr-only\">{countWords(count, limit)}</span>\n </span>\n );\n}\n\n/** Read to a screen reader on every card that can be dragged (dnd-kit's aria-describedby). */\nconst MOVE_INSTRUCTIONS = \"Press Space to pick up the card. Use the Left and Right arrow keys to move it between columns, \"\n + \"and the Up and Down arrow keys to move it within a column. Press Space again to drop it, or Escape to cancel.\";\n\nfunction BoardColumn({\n col,\n readOnly,\n filled,\n children,\n}: {\n col: KanbanColumn;\n readOnly?: boolean;\n /** The board has a height of its own (the page's, or its pane's): the column takes it and scrolls its cards. */\n filled?: boolean;\n children: ReactNode;\n}) {\n // Sprint 25.7, C2: the column is a drop area as well as a sortable list, so an empty column takes a card\n const { setNodeRef, isOver } = useDroppable({ id: columnDropId(col.id), disabled: readOnly });\n // Sprint 25.16 A42: a column that scrolls its cards, with no card to Tab to (a read-only board), is a Tab stop itself\n const [cards, setCardsEl] = useState<HTMLDivElement | null>(null);\n const setCards = useCallback((node: HTMLDivElement | null) => { setNodeRef(node); setCardsEl(node); }, [setNodeRef]);\n useKeyboardScroll(cards, col.title, !!filled);\n return (\n <div\n className={cn(\n \"flex flex-col shrink-0 w-[calc(100vw-4rem)] sm:w-[280px] snap-center\",\n filled && \"min-h-0\",\n \"bg-[var(--ds-bg-muted)] rounded-[var(--ds-radius-lg)]\",\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n )}\n >\n <div className=\"flex items-center justify-between px-ds-3 py-ds-2.5\">\n <div className=\"flex items-center gap-ds-2\">\n {col.color && (\n <span\n className=\"w-2.5 h-2.5 rounded-[var(--ds-radius-full)] shrink-0\"\n style={{ backgroundColor: col.color }}\n />\n )}\n <span className=\"text-sm font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)]\">\n {col.title}\n </span>\n <ColumnCount count={col.cards.length} limit={col.limit} />\n </div>\n <Icon name=\"plus\" size={14} className=\"text-[var(--ds-text-muted)]\" />\n </div>\n\n <SortableContext\n items={col.cards.map((c) => c.id)}\n strategy={verticalListSortingStrategy}\n id={col.id}\n >\n <div\n ref={setCards}\n data-kanban-column={col.id}\n className={cn(\n \"flex flex-col gap-ds-2.5 px-ds-3 pb-ds-3 min-h-[60px] rounded-b-[var(--ds-radius-lg)] transition-colors\",\n // scrolling, it keeps room above the first card for its focus outline (drawn where the header's padding was) and\n // brings a card focused by keyboard in with room around it: the outline's reach, 4 px, never a theme space (P3)\n filled && cn(\"flex-1 min-h-0 overflow-y-auto -mt-[4px] pt-[4px] scroll-py-ds-2\", FOCUS_INSET),\n isOver && col.cards.length === 0 && \"bg-[var(--ds-bg-surface)]/60\",\n )}\n >\n {children}\n </div>\n </SortableContext>\n </div>\n );\n}\n\nexport function KanbanBoard({\n columns: columnsProp,\n onColumnsChange,\n onCardMove,\n readOnly,\n renderCard,\n onCardClick,\n cardActions,\n className,\n}: KanbanBoardProps) {\n // Sprint 25.14 A44: a board frames itself, so a SplitView's list pane draws nothing behind it\n useFramesItself();\n // Sprint 25.7, C2: `columns` is authoritative — a new array replaces what the board shows. A move is previewed while\n // the card is dragged and held once dropped (HeldMove) until `columns` shows it; a cancelled drag (Escape) leaves the\n // board as it was.\n const [seenProp, setSeenProp] = useState(columnsProp);\n const [holds, setHoldsState] = useState<HeldMove[]>([]);\n // the preview lives in a ref as well, so a drop in the same tick as the last hover still reads it\n const [preview, setPreviewState] = useState<KanbanColumn[] | null>(null);\n const previewRef = useRef<KanbanColumn[] | null>(null);\n const setPreview = (next: KanbanColumn[] | null) => { previewRef.current = next; setPreviewState(next); };\n const [activeCard, setActiveCard] = useState<KanbanCard | null>(null);\n // the holds, the columns and the card being dragged, for a save that settles after this render\n const holdsRef = useRef<HeldMove[]>([]);\n const columnsRef = useRef(columnsProp);\n const activeRef = useRef<string | null>(null);\n const setHolds = (next: HeldMove[]) => { holdsRef.current = next; setHoldsState(next); };\n if (columnsProp !== seenProp) {\n setSeenProp(columnsProp);\n // new columns (a save landing, a refetch, another user's move): the holds they settle end, the rest replay over them\n const kept = keptHolds(holds, columnsProp);\n if (kept !== holds) setHoldsState(kept);\n // new columns while a card is held: the preview is rebuilt from them\n if (preview && activeCard) setPreviewState(rebase(replayHolds(columnsProp, kept), preview, activeCard.id));\n }\n // a preview or holds updated while rendering reach their refs before any drag event or settled save reads them\n useLayoutEffect(() => { previewRef.current = preview; }, [preview]);\n useLayoutEffect(() => { holdsRef.current = holds; }, [holds]);\n useLayoutEffect(() => { columnsRef.current = columnsProp; }, [columnsProp]);\n const committed = useMemo(() => replayHolds(columnsProp, holds), [columnsProp, holds]);\n const columns = preview ?? committed;\n\n // The live region speaks card and column titles, never ids. Each handler words its news in `said`, and dnd-kit\n // announces it straight after calling the handler. A move is said when the card's landing place changes.\n const said = useRef<string | undefined>(undefined);\n const lastPlace = useRef<string | null>(null);\n const announcements = useMemo<Announcements>(() => {\n const take = () => { const text = said.current; said.current = undefined; return text; };\n return { onDragStart: take, onDragOver: take, onDragEnd: take, onDragCancel: take };\n }, []);\n const instructions = { draggable: onCardClick ? `Press Enter to open the card. ${MOVE_INSTRUCTIONS}` : MOVE_INSTRUCTIONS };\n // A save that fails after the drag is over has no dnd-kit event to speak in: the board's own status line says it,\n // every failure since the last pick-up together, so two that land at once are both heard.\n const [notice, setNotice] = useState(\"\");\n const noticeParts = useRef<string[]>([]);\n const say = (text: string) => { noticeParts.current = [...noticeParts.current, text]; setNotice(noticeParts.current.join(\" \")); };\n // The card to focus once a failed save has put it back: its element is rendered anew in the column it returns to.\n const rootRef = useRef<HTMLDivElement>(null);\n // the board scrolls sideways: a card the keyboard reaches at its edge comes in whole, with its outline (Sprint 30, P3)\n const [board, setBoard] = useState<HTMLDivElement | null>(null);\n const setRoot = useCallback((node: HTMLDivElement | null) => { rootRef.current = node; setBoard(node); }, []);\n useRevealFocus(board);\n // Sprint 25.16 A42 (P31): a board that is its page's last content takes the height under the header, and one in a\n // SplitView's pane takes the pane's; each column then scrolls its own cards, and the page or the pane doesn't\n const fill = useFillHeight(rootRef);\n const inPane = useContext(FillContext);\n const filled = fill != null || inPane;\n /** A card's own element on this board: the card itself, or its Move button. */\n const cardPart = (attr: \"data-kanban-card\" | \"data-kanban-move\", id: string) =>\n [...(rootRef.current?.querySelectorAll<HTMLElement>(`[${attr}]`) ?? [])].find((el) => el.getAttribute(attr) === id);\n // The card, or its Move button, to focus once a move has put the card somewhere new: its elements are rendered anew in\n // the column it goes to.\n const refocus = useRef<{ id: string; part: \"card\" | \"move\" } | null>(null);\n useLayoutEffect(() => {\n const target = refocus.current;\n if (target == null) return;\n refocus.current = null;\n cardPart(target.part === \"move\" ? \"data-kanban-move\" : \"data-kanban-card\", target.id)?.focus();\n });\n const holdKey = useRef(0);\n\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 5 } }),\n useSensor(KeyboardSensor, {\n coordinateGetter: boardCoordinates,\n // Space picks up and drops; Enter is the card's open key (onCardClick)\n keyboardCodes: { start: [\"Space\"], cancel: [\"Escape\"], end: [\"Space\"] },\n }),\n );\n // read-only: no sensors at all (an absent list would give dnd-kit's defaults)\n const noSensors = useSensors();\n\n const handleDragStart = (event: DragStartEvent) => {\n const at = locate(committed, String(event.active.id));\n if (!at) return;\n noticeParts.current = [];\n setNotice(\"\");\n activeRef.current = at.col.cards[at.index].id;\n setActiveCard(at.col.cards[at.index]);\n setPreview(committed);\n lastPlace.current = placeWords(at);\n said.current = `Picked up ${at.col.cards[at.index].title} in ${lastPlace.current}.`;\n };\n\n // Across columns, the preview moves the card as it is dragged; the parent hears nothing until the drop.\n const handleDragOver = (event: DragOverEvent) => {\n const { active, over } = event;\n const activeId = String(active.id);\n const overId = over ? String(over.id) : null;\n const cols = previewRef.current ?? committed;\n const from = locate(cols, activeId);\n const toColumnId = overId == null || overId === activeId ? null : droppedColumnId(overId) ?? locate(cols, overId)?.col.id;\n if (from && toColumnId && from.col.id !== toColumnId) {\n const card = from.col.cards[from.index];\n setPreview(cols.map((col) => {\n if (col.id === from.col.id) return { ...col, cards: col.cards.filter((c) => c.id !== activeId) };\n if (col.id !== toColumnId) return col;\n const overIndex = col.cards.findIndex((c) => c.id === overId);\n const cards = [...col.cards];\n cards.splice(overIndex >= 0 ? overIndex : cards.length, 0, card);\n return { ...col, cards };\n }));\n }\n // where a drop now would put the card\n const now = overId == null ? null : locate(landing(previewRef.current ?? committed, activeId, overId), activeId);\n const where = now ? placeWords(now) : null;\n if (where === lastPlace.current) return;\n lastPlace.current = where;\n const title = now ? now.col.cards[now.index].title : activeCard?.title;\n said.current = now ? `${title} is over ${where}.` : `${title} is not over a column.`;\n };\n\n /** A card's move failed: the hold ends and the card shows where `columns` has it, said on the status line. */\n const putBack = (hold: HeldMove) => {\n const rest = holdsRef.current.filter((h) => h.cardId !== hold.cardId);\n const shown = replayHolds(columnsRef.current, rest);\n const back = locate(shown, hold.cardId);\n const card = back?.col.cards[back.index];\n // focus follows the card only from this board (two boards over the same data each render it), to the control that\n // had it: the card or its Move button (Sprint 25.8.7 item 3). From the button's open menu, which sits outside the\n // board, it goes to the button when the card goes back to another column, where the button and its menu are new.\n const focused = document.activeElement;\n const inSlot = !!focused && !!rootRef.current?.contains(focused) && focused.closest?.(\"[data-kanban-item]\")?.getAttribute(\"data-kanban-item\") === hold.cardId;\n const menuOpen = cardPart(\"data-kanban-move\", hold.cardId)?.getAttribute(\"aria-expanded\") === \"true\";\n if (inSlot) refocus.current = { id: hold.cardId, part: focused?.hasAttribute(\"data-kanban-move\") ? \"move\" : \"card\" };\n else if (menuOpen && locate(replayHolds(columnsRef.current, holdsRef.current), hold.cardId)?.col.id !== back?.col.id) {\n refocus.current = { id: hold.cardId, part: \"move\" };\n }\n setHolds(rest);\n // a card held mid-drag: the preview is rebuilt without the failed move, so the drop cannot carry it\n if (previewRef.current && activeRef.current) setPreview(rebase(shown, previewRef.current, activeRef.current));\n if (!back || !card) return;\n const to = columnsRef.current.find((col) => col.id === hold.toColumnId)?.title;\n say(isAt(columnsRef.current, hold.origin) || !to\n ? `Move not saved. ${card.title} is back in ${placeWords(back)}.`\n : `Move not saved. ${card.title} could not move to ${to}.`);\n };\n\n /** A save for a card has settled. The latest move's failure puts the card back; otherwise, once none is out, the hold is judged against the columns. */\n const settle = (cardId: string, key: number, ok: boolean) => {\n const hold = holdsRef.current.find((h) => h.cardId === cardId);\n if (!hold) return;\n if (!ok && hold.key === key) return putBack(hold);\n const inFlight = hold.inFlight - 1;\n const next = holdsRef.current.map((h) => (h === hold ? { ...h, inFlight, layout: inFlight > 0 ? h.layout : layoutOf(columnsRef.current) } : h));\n // the columns may already show the card elsewhere (a refetch that landed before the save resolved)\n setHolds(inFlight > 0 ? next : keptHolds(next, columnsRef.current));\n };\n\n /**\n * A move the person made, dropped or chosen from the card's Move menu: the board holds the card at its new place and\n * saves it through the handlers. One path for both (Sprint 25.8.7 item 3), so a page refuses a menu move as it refuses\n * a drop, and the card goes back the same way.\n */\n const commit = (final: KanbanColumn[], cardId: string) => {\n const after = locate(final, cardId);\n if (!after) return;\n const key = ++holdKey.current;\n // a new move of a card replaces its hold's place; the replaced move's save stays in flight\n const prev = holdsRef.current.find((h) => h.cardId === cardId);\n const hold: HeldMove = {\n ...placementIn(final, cardId)!,\n key,\n inFlight: prev?.inFlight ?? 0,\n origin: prev?.origin ?? placementIn(columnsProp, cardId) ?? placementIn(committed, cardId)!,\n earlier: prev ? [...prev.earlier, { cardId: prev.cardId, toColumnId: prev.toColumnId, beforeId: prev.beforeId, index: prev.index }] : [],\n layout: layoutOf(columnsProp),\n };\n setHolds([...holdsRef.current.filter((h) => h.cardId !== cardId), hold]);\n const saves: PromiseLike<unknown>[] = [];\n try {\n for (const result of [onColumnsChange?.(final), onCardMove?.(after.col.cards[after.index], after.col.id, after.index)]) {\n if (isThenable(result)) saves.push(result);\n }\n } catch (error) {\n // a handler that throws refuses the move, as a rejected save does; the error still reaches the console\n console.error(\"KanbanBoard: a move handler threw, so the move is refused.\", error);\n return putBack(hold);\n }\n if (!saves.length) return;\n setHolds(holdsRef.current.map((h) => (h.key === key ? { ...h, inFlight: h.inFlight + 1 } : h)));\n // every save settles before the move counts as saved; any failure refuses it\n Promise.allSettled(saves).then((results) => settle(cardId, key, results.every((r) => r.status === \"fulfilled\")));\n };\n\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n const activeId = String(active.id);\n const cols = previewRef.current ?? committed;\n activeRef.current = null;\n setActiveCard(null);\n setPreview(null);\n const final = over ? landing(cols, activeId, String(over.id)) : committed;\n const before = locate(committed, activeId);\n const after = locate(final, activeId);\n if (!before || !after || (before.col.id === after.col.id && before.index === after.index)) {\n if (before) said.current = `Dropped ${before.col.cards[before.index].title} back in ${placeWords(before)}.`;\n return;\n }\n said.current = `Dropped ${after.col.cards[after.index].title} in ${placeWords(after)}.${overLimitWords(after.col)}`;\n commit(final, activeId);\n };\n\n /**\n * Sprint 25.8.7 item 3 (WCAG 2.5.7): a move chosen from a card's Move menu, by a click, a tap or the keyboard. Another\n * column takes the card at its top, where a keyboard drag's Left and Right put it; a step moves it one place within its\n * own column, as Up and Down do.\n */\n const moveFromMenu = (cardId: string, toColumnId: string, step = 0) => {\n const at = locate(committed, cardId);\n const to = committed.find((col) => col.id === toColumnId);\n if (!at || !to) return;\n const index = to.id === at.col.id ? at.index + step : 0;\n const beforeId = to.cards.filter((c) => c.id !== cardId)[index]?.id ?? null;\n const final = place(committed, { cardId, toColumnId, beforeId, index });\n const after = locate(final, cardId);\n if (!after || (after.col.id === at.col.id && after.index === at.index)) return;\n // said on the board's status line, as a drop is in dnd-kit's live region; a failure replaces it (putBack's say)\n noticeParts.current = [];\n setNotice(`Moved ${at.col.cards[at.index].title} to ${placeWords(after)}.${overLimitWords(after.col)}`);\n commit(final, cardId);\n // Focus goes to the card's ⋯ in its new place, the button that opened the menu, as a menu's own rule puts it back on\n // its button (Sprint 25.29 item 8), and stays there when the move was refused at once. The menu's own return can't\n // hold: the button moves with the card.\n refocus.current = { id: cardId, part: \"move\" };\n };\n\n /**\n * What a card's Move menu offers: the columns it isn't in, in the board's order (the one it is in is left out: the\n * menu lists what can be done, and the card is drawn under that column's heading already), then a step up or down\n * where it can take one.\n */\n const movesFor = (col: KanbanColumn, index: number): MoveChoice[] => {\n if (readOnly) return [];\n const others: MoveChoice[] = columns.filter((c) => c.id !== col.id).map((c) => ({ label: `Move to ${c.title}`, to: c.id, step: 0 }));\n const steps: MoveChoice[] = [\n ...(index > 0 ? [{ label: \"Move up\", to: col.id, step: -1 }] : []),\n ...(index < col.cards.length - 1 ? [{ label: \"Move down\", to: col.id, step: 1 }] : []),\n ];\n return [...others, ...steps];\n };\n // the lifted card keeps its Move button's room and shows its ⋯, as the card it lifts does\n const activeAt = activeCard ? locate(columns, activeCard.id) : null;\n const activeMovable = !!activeAt && cardMenuOf(activeAt.col.cards[activeAt.index], menuOf(movesFor(activeAt.col, activeAt.index), () => {}), cardActions).length > 0;\n\n const handleDragCancel = (event: DragCancelEvent) => {\n activeRef.current = null;\n setActiveCard(null);\n setPreview(null);\n const at = locate(committed, String(event.active.id));\n if (at) said.current = `Move cancelled. ${at.col.cards[at.index].title} is back in ${placeWords(at)}.`;\n };\n\n return (\n <DndContext\n sensors={readOnly ? noSensors : sensors}\n accessibility={{ announcements, screenReaderInstructions: instructions }}\n collisionDetection={closestCorners}\n onDragStart={handleDragStart}\n onDragOver={handleDragOver}\n onDragEnd={handleDragEnd}\n onDragCancel={handleDragCancel}\n >\n <div ref={setRoot} data-fill={fill != null ? \"\" : undefined} className={cn(\"relative flex gap-ds-4 overflow-x-auto pb-ds-2 scroll-px-[4px] snap-x snap-mandatory sm:snap-none\", inPane && \"h-full min-h-0\", className)} style={fill != null ? { height: fill } : undefined}>\n {columns.map((col) => (\n <BoardColumn key={col.id} col={col} readOnly={readOnly} filled={filled}>\n {col.cards.map((card, index) => (\n <SortableCard\n key={card.id}\n card={card}\n renderCard={renderCard}\n onCardClick={onCardClick}\n readOnly={readOnly}\n moves={movesFor(col, index)}\n onMove={moveFromMenu}\n cardActions={cardActions}\n />\n ))}\n </BoardColumn>\n ))}\n {/* inside the board's root, so a board in a spaced stack stays one element */}\n <div role=\"status\" className=\"sr-only\">{notice}</div>\n </div>\n\n <DragOverlay>\n {activeCard && <OverlayCard card={activeCard} renderCard={renderCard} moveRoom={activeMovable} />}\n </DragOverlay>\n </DndContext>\n );\n}\n"]}
|
package/dist/resizable.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useCompact, useElementWidth, useBelow, crumbGoes, useAppShell, Breadcrumbs, Drawer } from './chunk-
|
|
2
|
+
import { useCompact, useElementWidth, useBelow, crumbGoes, useAppShell, Breadcrumbs, Drawer } from './chunk-EKWXPSTI.js';
|
|
3
3
|
import { useFillHeight, FillContext } from './chunk-DBHVJ7Z3.js';
|
|
4
|
-
import { useKeyboardScroll } from './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import { useKeyboardScroll } from './chunk-GP2COVJC.js';
|
|
5
|
+
import './chunk-QOMP4D6V.js';
|
|
6
6
|
import './chunk-7QLXYRPD.js';
|
|
7
7
|
import './chunk-72SDAX54.js';
|
|
8
|
-
import {
|
|
9
|
-
import './chunk-
|
|
8
|
+
import { SurfaceBoundary } from './chunk-V73LHNRL.js';
|
|
9
|
+
import { Button } from './chunk-2Q4HOGEI.js';
|
|
10
10
|
import { useBreakpoint } from './chunk-ZHUVLBCC.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
13
|
-
import { Icon, warnOnce } from './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
import { isTabStop, tabStops, rememberFocus } from './chunk-4HJDOZ2M.js';
|
|
16
|
-
import { cn, GROUP_FOCUS_RING, FOCUS_INSET } from './chunk-YL5KD5RC.js';
|
|
11
|
+
import './chunk-HUNEJIKV.js';
|
|
12
|
+
import './chunk-XSQD3UGY.js';
|
|
13
|
+
import { Icon, warnOnce } from './chunk-53F7GVBQ.js';
|
|
14
|
+
import { cn, GROUP_FOCUS_RING, isTabStop, tabStops, rememberFocus, FOCUS_INSET } from './chunk-OWQ7M6R7.js';
|
|
17
15
|
import { Group, Panel, Separator } from 'react-resizable-panels';
|
|
18
16
|
import { createContext, useContext, useRef, useState, useCallback, useEffect, useLayoutEffect } from 'react';
|
|
19
17
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|