@danxbot/ui 20.15.0 → 20.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { AutoScrollOptions, CrossDrop, DragStrings } from "../lib/dnd";
3
- import type { BoardColumnModel, BoardItemId, UseBoardOptions, UseBoardResult } from "../lib/board";
4
- import { type BoardReorderLabels } from "./board/context";
3
+ import type { BoardColumnModel, BoardItemId, BoardReorderLabels, UseBoardOptions, UseBoardResult } from "../lib/board";
5
4
  export interface BoardProps<T> extends UseBoardOptions<T> {
6
5
  /** Forwarded to `DragDrop` — announcement grammar, localisation. */
7
6
  strings?: Partial<DragStrings>;
@@ -1,4 +1,4 @@
1
- import type { BoardColumnId, BoardColumnModel, BoardItemId, BoardMoveRequest, BoardMoveVerdict } from "../../lib/board";
1
+ import type { BoardColumnId, BoardColumnModel, BoardItemId, BoardMoveRequest, BoardMoveVerdict, BoardReorderLabels } from "../../lib/board";
2
2
  import type { CrossDrop } from "../../lib/dnd";
3
3
  export declare const BoardCardSurfaceContext: import("react").Context<boolean>;
4
4
  /** `true` when an ancestor `BoardCardSurface` makes this whole card draggable. */
@@ -27,11 +27,6 @@ export interface BoardContextValue<T> {
27
27
  /** What a card dropped on another lane means — `Board`'s `crossLaneDrop`. */
28
28
  crossLaneDrop: CrossDrop;
29
29
  }
30
- /** The card menu's within-column items. DX-4575: a consumer that calls moving inside a list something else renames them. */
31
- export interface BoardReorderLabels {
32
- toTop: string;
33
- toBottom: string;
34
- }
35
30
  /** What the menu says when `Board` is given no `reorderLabels`. */
36
31
  export declare const DEFAULT_REORDER_LABELS: BoardReorderLabels;
37
32
  export interface BoardColumnContextValue {
@@ -15,7 +15,7 @@ export interface AccessRequest {
15
15
  requestedAt: string;
16
16
  /** ISO instant. Shown while the request is pending. */
17
17
  expiresAt?: string;
18
- /** The short code the requester also displays. Compared by eye, never entered. */
18
+ /** The short code the requester also displays. Compared by eye, or typed back when `confirmCodeEntry` is set. */
19
19
  confirmCode: string;
20
20
  /** The label of the role granted. Shown once the request is approved or claimed. */
21
21
  roleLabel?: string;
@@ -41,6 +41,11 @@ export interface AccessRequestPanelProps {
41
41
  * that nothing was granted.
42
42
  */
43
43
  expiredNote?: ExpiredNote;
44
+ /**
45
+ * Opt in to typing the confirm code instead of comparing it by eye: the code is not rendered, a field takes it, and Approve is
46
+ * disabled until what was typed matches `request.confirmCode`, ignoring case and spaces. Deny stays available.
47
+ */
48
+ confirmCodeEntry?: boolean;
44
49
  className?: string;
45
50
  }
46
- export declare function AccessRequestPanel({ request, state, roles, permissions, ownPermissionKeys, defaultRoleId, onApprove, onDeny, expiredNote, className, }: AccessRequestPanelProps): import("react").JSX.Element;
51
+ export declare function AccessRequestPanel({ request, state, roles, permissions, ownPermissionKeys, defaultRoleId, onApprove, onDeny, expiredNote, confirmCodeEntry, className, }: AccessRequestPanelProps): import("react").JSX.Element;
@@ -15,6 +15,19 @@ export declare function ApprovalHeader({ title, state }: {
15
15
  export declare function ConfirmCodeCallout({ code }: {
16
16
  code: string;
17
17
  }): import("react").JSX.Element;
18
+ /** A typed confirm code is compared in upper case with every space removed; dashes are part of the code. */
19
+ export declare function normalizeConfirmCode(value: string): string;
20
+ /** True when what was typed is the expected code, in either case and ignoring spaces. */
21
+ export declare function confirmCodeMatches(typed: string, expected: string): boolean;
22
+ /**
23
+ * The entry step for a confirm code (DX-4467): the approver types the code the requester shows instead of reading it
24
+ * off this screen, so the code is never rendered here and cannot be copied from the page.
25
+ */
26
+ export declare function ConfirmCodeEntry({ expected, value, onValueChange }: {
27
+ expected: string;
28
+ value: string;
29
+ onValueChange: (next: string) => void;
30
+ }): import("react").JSX.Element;
18
31
  /** The readout for a settled request: the tone and title are shared, the sentence says what it meant for this requester. */
19
32
  export declare function TerminalCallout({ state, children }: {
20
33
  state: Exclude<AccessRequestState, "pending">;
@@ -113,9 +113,8 @@ export { DragDrop, DragDropContainer, DragDropItem, DragDropHandle, DragDropSurf
113
113
  export { KanbanBoard, type KanbanBoardProps, type KanbanLane, type KanbanMove, type KanbanRefusal, } from "./components/kanban/KanbanBoard";
114
114
  export { DEFAULT_DRAG_STRINGS, DRAG_INSTRUCTIONS_ID, DragInstructions, DragLiveRegion, DragSession, DragSessionProvider, applyMove, attachAutoScroll, attachKeyboardSensor, attachPointerSensor, attachSessionWindowListeners, isNoOp, resolveTarget, sameTarget, scrollVelocity, useCreateDragSession, useDragAnnouncements, useDragSession, useDragState, useDragLive, useDraggable, useDropContainer, type ContainerId, type CrossDrop, type DragAxis, type DragCancelEvent, type DragEndEvent, type DragId, type DragMode, type DragPhase, type DragSessionCallbacks, type DragStartEvent, type DragState, type AutoScrollOptions, type DragAnnouncementContext, type DragAnnouncementOptions, type DragAnnouncements, type DragInstructionsProps, type DragLiveRegionProps, type DragStrings, type DropTarget, type KeyboardSensorOptions, type PointerActivation, } from "./lib/dnd";
115
115
  export { Board, BoardColumn, BoardCard, BoardCardSurface, type BoardProps, type BoardColumnProps, type BoardCardProps, type BoardCardSurfaceProps, } from "./components/Board";
116
- export type { BoardReorderLabels } from "./components/board/context";
117
116
  export { buildBoardModel, resolveMove, applyBoardMoves, useBoard, moveAnchor, columnLength, positionInColumn, type BoardModel, type MoveAnchor, type UseBoardResult, } from "./lib/board";
118
- export type { BoardAccessors, BoardColumnDef, BoardEdge, BoardColumnId, BoardColumnModel, BoardItemId, BoardMove, BoardMoveTarget, BoardMoveRequest, BoardMoveSource, BoardMoveVerdict, UseBoardOptions, } from "./lib/board";
117
+ export type { BoardAccessors, BoardColumnDef, BoardEdge, BoardColumnId, BoardColumnModel, BoardItemId, BoardMove, BoardMoveTarget, BoardMoveRequest, BoardMoveSource, BoardMoveVerdict, BoardReorderLabels, UseBoardOptions, } from "./lib/board";
119
118
  export { PagedWindowList, type PagedWindowItemPosition, type PagedWindowListProps, type PagedWindowStrings, } from "./components/PagedWindowList";
120
119
  export { PagedWindowStore, usePagedWindow, windowPageNumbers, type LoadCount, type LoadPage, type LoadPageContext, type PageResponse, type PageSnapshot, type PageStatus, type PagedWindow, type PagedWindowMode, type PagedWindowOptions, type PagedWindowSnapshot, type UsePagedWindowOptions, } from "./lib/paged-window";
121
120
  export type { MessageRole, MessagePart, TextPart, CodePart, ReasoningPart, ToolPart, ToolStatus, FilePart, ComponentPart, ChatFile, ChatMessage, RenderContext, PartRenderer, PartRenderers, ChatComponentRenderer, ChatComponents, } from "./components/chat/types";
@@ -8,7 +8,7 @@
8
8
  * NOT wired into the package's top-level `src/index.ts` — that barrel is
9
9
  * owned by the contract's author, not this agent (see this round's brief).
10
10
  */
11
- export type { BoardAccessors, BoardColumnDef, BoardEdge, BoardColumnId, BoardColumnModel, BoardItemId, BoardMove, BoardMoveTarget, BoardMoveRequest, BoardMoveSource, BoardMoveVerdict, UseBoardOptions, } from "./types";
11
+ export type { BoardAccessors, BoardColumnDef, BoardEdge, BoardColumnId, BoardColumnModel, BoardItemId, BoardMove, BoardMoveTarget, BoardMoveRequest, BoardMoveSource, BoardMoveVerdict, BoardReorderLabels, UseBoardOptions, } from "./types";
12
12
  export { buildBoardModel, type BoardModel } from "./model";
13
13
  export { moveAnchor, type MoveAnchor } from "./anchor";
14
14
  export { columnLength, positionInColumn } from "./position";
@@ -104,6 +104,21 @@ export interface BoardColumnDef {
104
104
  * move all obey it, and the menu stops offering the within-column items.
105
105
  */
106
106
  reorderLocked?: string;
107
+ /**
108
+ * DX-4589: the words for THIS column's card-menu items that move a card to
109
+ * the column's visual top and bottom, replacing the Board's `reorderLabels`
110
+ * (then the defaults) for this column only. Partial, so a column renames one
111
+ * and inherits the other. The items stay positional: `toTop` moves to the
112
+ * visual top (`index` 0, `edge: "top"`), whatever order the column is sorted
113
+ * in, so a column sorted lowest-priority-first words `toTop` as the move that
114
+ * LOWERS the card.
115
+ */
116
+ reorderLabels?: Partial<BoardReorderLabels>;
117
+ }
118
+ /** The card menu's within-column items. DX-4575: a consumer that calls moving inside a list something else renames them. */
119
+ export interface BoardReorderLabels {
120
+ toTop: string;
121
+ toBottom: string;
107
122
  }
108
123
  /**
109
124
  * Where a move lands beyond what is loaded. In a windowed column `to.index` can
@@ -204,6 +219,8 @@ export interface BoardColumnModel<T> {
204
219
  overWip: boolean;
205
220
  /** The definition's `reorderLocked` sentence; `undefined` when the column can be reordered. */
206
221
  reorderLocked: string | undefined;
222
+ /** The definition's `reorderLabels`; `undefined` when the column words the items as the Board does. */
223
+ reorderLabels: Partial<BoardReorderLabels> | undefined;
207
224
  }
208
225
  export interface UseBoardOptions<T> {
209
226
  items: readonly T[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danxbot/ui",
3
- "version": "20.15.0",
3
+ "version": "20.17.0",
4
4
  "type": "module",
5
5
  "description": "Danxbot — a domain-agnostic React design system with motion as a first-class primitive.",
6
6
  "license": "MIT",