@botiverse/raft-ui 0.35.1 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/styles.css CHANGED
@@ -174,6 +174,10 @@
174
174
  }
175
175
 
176
176
  @theme inline {
177
+ /* A drag settling: the drop and cancel glide, siblings sliding apart, a
178
+ layout reflowing on a drop (design/foundations/motion.md). */
179
+ --ease-drag-settle: var(--motion-drag-settle-easing);
180
+
177
181
  --color-foreground: var(--foreground);
178
182
  --color-foreground-muted: var(--foreground-muted);
179
183
  --color-foreground-hint: var(--foreground-hint);
@@ -659,6 +663,34 @@ textarea:-webkit-autofill:disabled {
659
663
  }
660
664
  }
661
665
 
666
+ /* Drag and drop (design/patterns/drag-and-drop.md). While something is
667
+ lifted, DragLift sets data-dragging on the root, and DragRefusalHint sets
668
+ data-drag-refused while the place under the hand refuses it: the cursor
669
+ says so over everything, whatever the element under it would show. The
670
+ item a drag came from carries data-drag-origin and stays in place at 40%
671
+ until something else takes its place, and a container it has moved into
672
+ carries data-drag-into. Unlayered, so no utility on the
673
+ item overrides the one value. */
674
+ :root[data-dragging],
675
+ :root[data-dragging] * {
676
+ cursor: grabbing !important;
677
+ }
678
+
679
+ :root[data-drag-refused],
680
+ :root[data-drag-refused] * {
681
+ cursor: not-allowed !important;
682
+ }
683
+
684
+ [data-drag-origin] {
685
+ opacity: 0.4;
686
+ }
687
+
688
+ /* A container the dragged item has moved into (another sidebar section, a
689
+ row it drops onto) takes the subtle hover tier while the item is in it. */
690
+ [data-drag-into] {
691
+ background-color: var(--fill-subtle);
692
+ }
693
+
662
694
  @utility image-transparency-bg {
663
695
  --checker-cell: light-dark(oklch(0.1813 0.00497 17.62 / 0.12), oklch(1 0 0 / 0.1));
664
696
  background-color: light-dark(oklch(1 0 0), oklch(0.23 0 0));
package/dist/tokens.json CHANGED
@@ -2530,6 +2530,20 @@
2530
2530
  }
2531
2531
  }
2532
2532
  },
2533
+ "motion": {
2534
+ "drag-settle-duration": {
2535
+ "$type": "duration",
2536
+ "$value": { "value": 160, "unit": "ms" },
2537
+ "$description": "A drag settling: the lifted copy gliding into its place on a drop or back home on a cancel, siblings sliding apart to open the place, and a layout reflowing on a drop.",
2538
+ "$extensions": { "build.botiverse.raft": { "scope": "root" } }
2539
+ },
2540
+ "drag-settle-easing": {
2541
+ "$type": "cubicBezier",
2542
+ "$value": [0.25, 1, 0.5, 1],
2543
+ "$description": "The ease-out of drag-settle-duration: fast off the hand, slow into place.",
2544
+ "$extensions": { "build.botiverse.raft": { "scope": "root" } }
2545
+ }
2546
+ },
2533
2547
  "focus": {
2534
2548
  "$type": "shadow",
2535
2549
  "ring": {
package/dist/wip.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import { $i as MobileNavServerPopoverDestinationProps, $s as DialogTitleProps, B as MessageListJumpPill, C as InboxItemProps, Ca as PopoverBodyProps, Cs as DialogCommitProps, Es as Dialog, G as MessageListJumpPillProps, H as MessageListJumpPillDismissProps, Is as DialogFooterNote, Ji as MobileNavServerItemProps, Js as DialogSheetBack, Jt as MessageReferenceIcon, Ls as DialogFooterNoteProps, Ms as DialogContentProps, Qi as MobileNavServerPopoverDestination, R as MessageListJumpControls, Sa as PopoverBody, Ss as DialogCommit, Ti as PreviewCardMetaProps, Ts as DialogSheetContentProps, U as MessageListJumpPillGroup, V as MessageListJumpPillDismiss, W as MessageListJumpPillGroupProps, Xi as MobileNavServerPopoverContent, Yi as MobileNavServerPopover, Ys as DialogSheetBackProps, Yt as MessageReferenceIconProps, Zi as MobileNavServerPopoverContentProps, _a as PopoverActionsProps, aa as MobileNavServerPopoverListProps, ac as ButtonProps, ar as MessageItemDelegatedByButtonProps, bi as PreviewCardFooter, bs as TextLinkProps, ca as MobileNavServerPopoverRowBody, ci as PreviewCardActions, cr as MessageItemDelegatedByProps, ct as MessageQuotedPreviewAuthorDelegatedBy, da as MobileNavServerPopoverRowDescriptionProps, dc as StyledProps, ea as MobileNavServerPopoverDestinations, ec as DialogTrigger, fa as MobileNavServerPopoverRowLabel, fi as PreviewCardBody, ga as PopoverActions, ho as DropdownMenuLinkItemProps, ia as MobileNavServerPopoverList, ir as MessageItemDelegatedByButton, ks as DialogClose, la as MobileNavServerPopoverRowBodyProps, lc as VariantProps, li as PreviewCardActionsProps, ls as ListRowProps, lt as MessageQuotedPreviewAuthorDelegatedByProps, ma as MobileNavServerPopoverRowProps, mo as DropdownMenuLinkItem, na as MobileNavServerPopoverGroup, nn as MessageReferenceReadMark, nr as MessageItemDelegatedAvatarProps, oa as MobileNavServerPopoverProps, or as MessageItemDelegatedByName, pa as MobileNavServerPopoverRowLabelProps, pi as PreviewCardBodyProps, qi as MobileNavServerItem, ra as MobileNavServerPopoverGroupProps, rn as MessageReferenceReadMarkProps, rr as MessageItemDelegatedBy, sa as MobileNavServerPopoverRow, sr as MessageItemDelegatedByNameProps, ta as MobileNavServerPopoverDestinationsProps, tr as MessageItemDelegatedAvatar, u as InboxItemDensity, ua as MobileNavServerPopoverRowDescription, uc as DataAttributes, vi as PreviewCardEyebrow, wi as PreviewCardMeta, ws as DialogSheetContent, xi as PreviewCardFooterProps, yi as PreviewCardEyebrowProps, z as MessageListJumpControlsProps } from "./inbox-item-CQJIhaym.mjs";
1
+ import { $ as MessageListJumpPillProps, Aa as PopoverBody, As as DialogCommit, B as DragMessages, Bs as DialogContentProps, C as InboxItemProps, Co as DropdownMenuLinkItemProps, Di as PreviewCardEyebrowProps, Ei as PreviewCardEyebrow, G as dragMessages, Gs as DialogFooterNoteProps, H as DragPlace, J as MessageListJumpPill, K as MessageListJumpControls, Ls as DialogClose, Mi as PreviewCardMeta, Ms as DialogSheetContent, Ni as PreviewCardMetaProps, Ns as DialogSheetContentProps, Oi as PreviewCardFooter, Os as TextLinkProps, Ps as Dialog, Q as MessageListJumpPillGroupProps, R as DEFAULT_DRAG_MESSAGES, Sa as MobileNavServerPopoverRowProps, So as DropdownMenuLinkItem, Ta as PopoverActionsProps, U as createDragAnnouncements, V as DragNamed, W as dragInstructions, Ws as DialogFooterNote, X as MessageListJumpPillDismissProps, Y as MessageListJumpPillDismiss, Z as MessageListJumpPillGroup, _a as MobileNavServerPopoverRowBodyProps, _c as VariantProps, _i as PreviewCardActionsProps, _s as ListRowProps, _t as MessageQuotedPreviewAuthorDelegatedByProps, aa as MobileNavServerPopoverContentProps, ba as MobileNavServerPopoverRowLabel, bi as PreviewCardBody, ca as MobileNavServerPopoverDestinations, cc as DialogTrigger, da as MobileNavServerPopoverGroupProps, dn as MessageReferenceReadMarkProps, dr as MessageItemDelegatedBy, fa as MobileNavServerPopoverList, fr as MessageItemDelegatedByButton, ga as MobileNavServerPopoverRowBody, gi as PreviewCardActions, gr as MessageItemDelegatedByProps, gt as MessageQuotedPreviewAuthorDelegatedBy, ha as MobileNavServerPopoverRow, hr as MessageItemDelegatedByNameProps, ia as MobileNavServerPopoverContent, ja as PopoverBodyProps, js as DialogCommitProps, ki as PreviewCardFooterProps, la as MobileNavServerPopoverDestinationsProps, lr as MessageItemDelegatedAvatar, ma as MobileNavServerPopoverProps, mr as MessageItemDelegatedByName, na as MobileNavServerItemProps, nc as DialogSheetBack, nn as MessageReferenceIcon, oa as MobileNavServerPopoverDestination, pa as MobileNavServerPopoverListProps, pc as ButtonProps, pr as MessageItemDelegatedByButtonProps, q as MessageListJumpControlsProps, ra as MobileNavServerPopover, rc as DialogSheetBackProps, rn as MessageReferenceIconProps, sa as MobileNavServerPopoverDestinationProps, sc as DialogTitleProps, ta as MobileNavServerItem, u as InboxItemDensity, ua as MobileNavServerPopoverGroup, un as MessageReferenceReadMark, ur as MessageItemDelegatedAvatarProps, va as MobileNavServerPopoverRowDescription, vc as DataAttributes, wa as PopoverActions, xa as MobileNavServerPopoverRowLabelProps, xi as PreviewCardBodyProps, ya as MobileNavServerPopoverRowDescriptionProps, yc as StyledProps, z as DragAnnouncementSource } from "./inbox-item-B8eXIikq.mjs";
2
2
  import { CSSProperties, ComponentProps, ComponentPropsWithRef, PointerEvent, ReactNode, RefObject } from "react";
3
3
  import { Button } from "@base-ui/react/button";
4
4
  import { useRender } from "@base-ui/react/use-render";
5
- import { PointerSensor, TouchSensor, TouchSensorOptions } from "@dnd-kit/core";
5
+ import { Announcements, CollisionDetection, DragEndEvent, DragOverEvent, DragStartEvent, DropAnimation, KeyboardCoordinateGetter, KeyboardSensorOptions, Modifier, PointerSensor, PointerSensorOptions, ScreenReaderInstructions, TouchSensor, TouchSensorOptions, UniqueIdentifier } from "@dnd-kit/core";
6
6
  import { Combobox } from "@base-ui/react/combobox";
7
+ import { SortingStrategy } from "@dnd-kit/sortable";
7
8
  import { Meter as Meter$1 } from "@base-ui/react/meter";
8
9
  //#region src/components/combobox-select/combobox-select.types.d.ts
9
10
  type ComboboxSelectValue = string | number;
@@ -290,6 +291,8 @@ export declare function useCommentMarginFits(element: Element | null, { minWidth
290
291
  * touch on its distance and this sensor would never run.
291
292
  */
292
293
  export declare const TOUCH_DRAG_HOLD_MS = 500;
294
+ export declare const TOUCH_DRAG_DISTANCE_PX = 10;
295
+ export declare const TOUCH_DRAG_TOLERANCE_PX = 10;
293
296
  type HoldThenMoveOptions = {
294
297
  /** How long the finger stays still before a move can start the drag. */
295
298
  holdMs?: number;
@@ -298,12 +301,340 @@ type HoldThenMoveOptions = {
298
301
  /** How far the finger may drift during the hold before it counts as a scroll. */
299
302
  tolerance?: number;
300
303
  };
304
+ /** A TouchSensor that starts a drag on the first move after a still hold (see above). */
305
+ export declare const HoldThenMoveTouchSensor: typeof TouchSensor;
306
+ /**
307
+ * dnd-kit's PointerSensor for a mouse and a pen only: a finger's pointerdown is
308
+ * left to `HoldThenMoveTouchSensor`.
309
+ */
310
+ export declare class MouseOnlyPointerSensor extends PointerSensor {
311
+ static activators: {
312
+ eventName: "onPointerDown";
313
+ handler: (event: PointerEvent, options: PointerSensorOptions) => boolean;
314
+ }[];
315
+ }
301
316
  /**
302
317
  * `useSensor(HoldThenMoveTouchSensor, …)` with the activation the sensor relies
303
318
  * on: no constraint dnd-kit would act on by itself, so only a move after the
304
319
  * hold starts the drag.
305
320
  */
306
321
  export declare function useHoldThenMoveTouchSensor({ holdMs, distance, tolerance }?: HoldThenMoveOptions): import("@dnd-kit/core").SensorDescriptor<TouchSensorOptions>;
322
+ /** The mouse / pen sensor that goes with it: picks up after `distance` px. */
323
+ export declare function useMouseOnlyPointerSensor(distance: number): import("@dnd-kit/core").SensorDescriptor<{
324
+ activationConstraint: {
325
+ distance: number;
326
+ };
327
+ }>;
328
+ //#endregion
329
+ //#region src/components/drag/drag-sensors.d.ts
330
+ /**
331
+ * A mouse or a pen picks an item up once it has moved this far, so a click
332
+ * never moves anything (design/patterns/drag-and-drop.md#starting-a-drag).
333
+ */
334
+ export declare const MOUSE_DRAG_DISTANCE_PX = 6;
335
+ /**
336
+ * Space picks up and drops, Escape puts back, the arrow keys move. Enter
337
+ * never starts a drag: on an item that can also be opened or activated, Enter
338
+ * does that.
339
+ */
340
+ export declare const DRAG_KEYBOARD_CODES: NonNullable<KeyboardSensorOptions["keyboardCodes"]>;
341
+ type DragSensorsOptions = {
342
+ /**
343
+ * How the arrow keys move a lifted item. Defaults to
344
+ * `listKeyboardCoordinates`, which steps through a sortable list.
345
+ */
346
+ coordinateGetter?: KeyboardCoordinateGetter;
347
+ /** Leave the keyboard out, for a surface whose keyboard path is a button. */
348
+ keyboard?: boolean;
349
+ /** The touch hold, distance and tolerance; the defaults are the system's. */
350
+ touch?: HoldThenMoveOptions;
351
+ };
352
+ /**
353
+ * The one sensor set for everything that can be dragged
354
+ * (design/patterns/drag-and-drop.md#starting-a-drag):
355
+ *
356
+ * - a mouse or a pen: after 6px of movement;
357
+ * - a finger: hold still 500ms, then move 10px (`useHoldThenMoveTouchSensor`);
358
+ * - the keyboard: Space picks up, the arrows move, Space drops, Escape puts
359
+ * back. Enter never starts a drag.
360
+ *
361
+ * Pass the options, or only the keyboard's `coordinateGetter`.
362
+ */
363
+ export declare function useDragSensors(options?: DragSensorsOptions | KeyboardCoordinateGetter): import("@dnd-kit/core").SensorDescriptor<import("@dnd-kit/core").SensorOptions>[];
364
+ /**
365
+ * dnd-kit's sortable keyboard steps, measured from where the item's place
366
+ * actually is (its own node, slid into the landing spot) rather than from the
367
+ * lifted copy. After an item moves into another list the two differ, and the
368
+ * arrows would skip a place. Use it for lists inside one `DndContext`.
369
+ */
370
+ export declare const listKeyboardCoordinates: KeyboardCoordinateGetter;
371
+ type DragAcrossLists = {
372
+ /** The caller's collision detection, holding the item over itself right after it moves list. */
373
+ collisionDetection: CollisionDetection;
374
+ /** Pass to `useDragSensors({ coordinateGetter })`. */
375
+ coordinateGetter: KeyboardCoordinateGetter;
376
+ /**
377
+ * Call when the item has just been moved into another list. By keyboard it
378
+ * then stays over itself until the next arrow; by pointer, for one frame.
379
+ */
380
+ moved: (viaKeyboard: boolean) => void;
381
+ /** Call when the drag ends or is cancelled. */
382
+ reset: () => void;
383
+ };
384
+ /**
385
+ * The keyboard fix for an item that moves between lists while it is dragged
386
+ * (a sidebar's sections, a board's columns). Without it, dnd-kit still counts
387
+ * the row the item was put next to as the place under it, projects one more
388
+ * move, and the next arrow skips a place: what is announced and where the item
389
+ * drops disagree. With it:
390
+ *
391
+ * - right after it moves list, the item is over itself (by keyboard until the
392
+ * next arrow, by pointer for one frame);
393
+ * - the arrows are measured from the item's real place (`listKeyboardCoordinates`).
394
+ *
395
+ * Render `DragRemeasure` too, so the lists are measured again after the move.
396
+ */
397
+ export declare function useDragAcrossLists(collisionDetection: CollisionDetection): DragAcrossLists;
398
+ type DragRemeasureProps = {
399
+ /** Anything that changes when an item moves list, such as the lists' items. */
400
+ version: unknown;
401
+ };
402
+ /**
403
+ * Measures every drop target again once an item's move into another list has
404
+ * rendered. dnd-kit's own observers skip targets whose size didn't change,
405
+ * even when they moved. Render it inside the `DndContext`.
406
+ */
407
+ export declare function DragRemeasure({ version }: DragRemeasureProps): null;
408
+ //#endregion
409
+ //#region src/components/drag/drag.recipe.d.ts
410
+ /**
411
+ * The lift look, for a copy drawn outside `DragLift`: an opaque popover
412
+ * surface, `shadow-float` and the `line-seam` ring. No scale, no tilt.
413
+ */
414
+ export declare const LIFT_CLASS = "bg-layer-popover shadow-float ring-1 ring-line-seam";
415
+ //#endregion
416
+ //#region src/components/drag/drag-lift.d.ts
417
+ /**
418
+ * A drag settling (motion.md, `motion-drag-settle-*`): the lifted copy
419
+ * gliding into its place on a drop or back home on a cancel, siblings sliding
420
+ * apart to open the place, and a layout reflowing on a drop.
421
+ */
422
+ export declare const DRAG_SETTLE: {
423
+ readonly duration: 160;
424
+ readonly easing: "cubic-bezier(0.25, 1, 0.5, 1)";
425
+ };
426
+ /** For `useSortable({ transition })`: siblings slide with the same token. */
427
+ export declare const DRAG_SIBLING_TRANSITION: {
428
+ readonly duration: 160;
429
+ readonly easing: "cubic-bezier(0.25, 1, 0.5, 1)";
430
+ };
431
+ /** The item a drag came from, while nothing else has taken its place (`data-drag-origin`). */
432
+ export declare const ORIGIN_OPACITY = 0.4;
433
+ /** Auto-scroll starts this close to the edge of anything that scrolls. */
434
+ export declare const DRAG_AUTO_SCROLL_ZONE_PX = 48;
435
+ /** How far a keyboard drag sets the copy off its place, so the place's dashed outline shows. */
436
+ export declare const DRAG_KEYBOARD_OFFSET_PX = 6;
437
+ /**
438
+ * Drop: the copy glides into its place. Cancel: it glides back home. While
439
+ * it glides, the item it will become stays hidden, then appears there.
440
+ */
441
+ export declare const DROP_GLIDE: DropAnimation;
442
+ /**
443
+ * The sibling transition for `useSortable({ transition })`: the drag-settle
444
+ * slide, or none with `prefers-reduced-motion`.
445
+ */
446
+ export declare function useDragSiblingTransition(): {
447
+ readonly duration: 160;
448
+ readonly easing: "cubic-bezier(0.25, 1, 0.5, 1)";
449
+ } | null;
450
+ /**
451
+ * For a compact proxy (a section's head, at most 240px wide): the grab point
452
+ * is kept, but pulled to within `inset` of the proxy's end, so the hand never
453
+ * holds empty air beside it. A constant shift: the copy still tracks 1:1.
454
+ */
455
+ export declare function keepGrabInside(proxyWidth: number, inset?: number): Modifier;
456
+ /**
457
+ * Cancels the drag in progress, whichever sensor holds it. Every dnd-kit
458
+ * sensor (and so every sensor of `useDragSensors`) puts the item back when the
459
+ * window is resized, so this sends the window a `resize`: unlike a synthetic
460
+ * Escape, no app's own Escape handler (a dialog, a panel, a popover) hears it.
461
+ */
462
+ export declare function cancelDrag(win?: Window): void;
463
+ /**
464
+ * Above every raft-ui layer (popovers 50, a stacked dialog 60, toasts and the
465
+ * lightbox 70) and an app's own top layers: the copy in the hand is always on
466
+ * top. dnd-kit's own default.
467
+ */
468
+ export declare const DRAG_LIFT_Z_INDEX = 999;
469
+ type DragLiftProps = {
470
+ /** The lifted copy: the dragged item itself, or a compact proxy for a large one. Nothing while nothing is lifted. */
471
+ children?: ReactNode;
472
+ /**
473
+ * The copy takes the item's size and the control radius. Pass the item's
474
+ * own radius here, such as `rounded-container` for a card, or a size for a
475
+ * compact proxy (`size-auto max-w-60`).
476
+ */
477
+ className?: string;
478
+ style?: CSSProperties;
479
+ /** Modifiers for the copy only, such as one that keeps a compact proxy under the hand. */
480
+ modifiers?: Modifier[];
481
+ /**
482
+ * Scroll whatever scrollable area the pointer comes within 48px of the edge
483
+ * of. Turn dnd-kit's own off (`<DndContext autoScroll={false}>`) so the two
484
+ * don't scroll together.
485
+ * @default true
486
+ */
487
+ autoScroll?: boolean;
488
+ /**
489
+ * Render the copy in another element, such as `document.body` when an
490
+ * ancestor has a transform (a drawer, a dialog), which would offset a
491
+ * `position: fixed` copy. It keeps the theme scope it was rendered in
492
+ * (`light` / `dark`), as raft-ui's portals do. By default it renders in place.
493
+ */
494
+ container?: Element | DocumentFragment | null;
495
+ /** @default DRAG_LIFT_Z_INDEX (999) */
496
+ zIndex?: number;
497
+ };
498
+ /**
499
+ * The copy of a dragged item that follows the hand
500
+ * (design/patterns/drag-and-drop.md#what-follows-the-hand): an opaque popover
501
+ * surface with `shadow-float` and a `line-seam` ring, no scale and no tilt,
502
+ * 1:1 with the pointer from the grab point, never clamped to its container and
503
+ * never held to one axis. On a drop it glides into its place, and on a cancel
504
+ * back home (160ms, `motion-drag-settle-*`; none with reduced motion).
505
+ *
506
+ * While something is lifted it also sets the grabbing cursor, cancels the
507
+ * drag when the window loses focus or the tab is hidden, and scrolls an area
508
+ * the pointer is near the edge of. Render it inside the `DndContext`.
509
+ */
510
+ export declare function DragLift({ children, className, style, modifiers, autoScroll, container, zIndex }: DragLiftProps): import("react").JSX.Element;
511
+ //#endregion
512
+ //#region src/components/drag/drop-placeholder.d.ts
513
+ type DropPlaceholderProps = useRender.ComponentProps<"div"> & {
514
+ /**
515
+ * Over live content (a panel, a column of a layout): an opaque
516
+ * `layer-canvas` under the `fill-subtle` wash, so the content under it
517
+ * never shows through.
518
+ */
519
+ opaque?: boolean;
520
+ };
521
+ /**
522
+ * Where a dragged item will land (design/patterns/drag-and-drop.md#where-it-will-land):
523
+ * a 1.5px dashed `line-strong` outline on `fill-subtle`, with the item's
524
+ * radius and size. One look for every place. The control radius is the
525
+ * default; pass the item's own (`rounded-container` for a card). Hidden from
526
+ * assistive technology: the announcements say where the item is.
527
+ */
528
+ export declare function DropPlaceholder({ opaque, className, render, ...props }: DropPlaceholderProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
529
+ type DragRefusalHintProps = Omit<ComponentPropsWithRef<"div">, "children" | "ref"> & {
530
+ /** Why the place under the hand won't take the item, such as "Can't move from Todo to Done". */
531
+ children: string;
532
+ /** Render the hint in another element; by default it renders in `document.body`. */
533
+ container?: Element | DocumentFragment | null;
534
+ };
535
+ /**
536
+ * Shown while the hand is over a place that refuses the item
537
+ * (design/patterns/drag-and-drop.md#refused-places): the reason, in a HUD
538
+ * chip by the pointer (by the lifted copy in a keyboard drag), and the
539
+ * not-allowed cursor. Render it only while the place is refused, inside the
540
+ * `DndContext`, with no placeholder anywhere. Announce the reason as well:
541
+ * the chip is not read out.
542
+ */
543
+ export declare function DragRefusalHint({ children, container, className, style, ...props }: DragRefusalHintProps): import("react").ReactPortal | null;
544
+ //#endregion
545
+ //#region src/components/drag/drag-lists.d.ts
546
+ type DragListsItems<L extends string> = Record<L, readonly string[]>;
547
+ type UseDragListsOptions<L extends string> = {
548
+ /** The lists, in the order they are on screen (by keyboard, entering a list from above lands first, from below last). */
549
+ lists: readonly L[];
550
+ /** Each list's items, by id. */
551
+ items: DragListsItems<L>;
552
+ /** Called with the lists as they should now render: while dragging (the item standing at its landing spot), on a drop and on a cancel. */
553
+ onItemsChange: (items: DragListsItems<L>) => void;
554
+ /** A list's name as people see it ("Pinned"). */
555
+ listName: (list: L) => string;
556
+ /** An item's name as people see it ("#launch-week"); never its id. */
557
+ itemName: (id: string) => string;
558
+ /** Why `to` won't take an item from `from`, or null when it will. */
559
+ refuse?: (from: L, to: L, id: string) => string | null;
560
+ /** The surface's collision detection; it is held still for a moment right after the item changes list. */
561
+ collisionDetection: CollisionDetection;
562
+ /** Says each step in a polite live region (`useDragAnnouncer`). */
563
+ announce: (message: string) => void;
564
+ /** Your translations of the announcements. */
565
+ messages?: Partial<DragMessages>;
566
+ };
567
+ /** dnd-kit's vertical strategy, except that nothing moves while the hand is outside the list. */
568
+ export declare const dragListStrategy: SortingStrategy;
569
+ /**
570
+ * Items in one or more lists that can be reordered and moved between lists
571
+ * (a sidebar's sections, a board's columns): the lists half of the drag
572
+ * model (design/patterns/drag-and-drop.md#where-it-will-land). While dragging,
573
+ * the item stands at its landing spot (its own slot is the place; siblings
574
+ * slide apart), a list can refuse it, and every step is announced by name.
575
+ * The keyboard is measured from the item's real place, so the arrows never
576
+ * skip one after a move into another list.
577
+ *
578
+ * Spread `handlers`, `collisionDetection` and `accessibility` on the
579
+ * `DndContext`, pass `coordinateGetter` to `useDragSensors`, and render
580
+ * `DragRemeasure version={items}` inside it.
581
+ */
582
+ export declare function useDragLists<L extends string>({ lists, items, onItemsChange, listName, itemName, refuse, collisionDetection, announce, messages }: UseDragListsOptions<L>): {
583
+ /** The dragged item's id, or null. */
584
+ activeId: string | null;
585
+ /** The list that refuses the item under the hand, and why. */
586
+ refusal: {
587
+ list: L;
588
+ reason: string;
589
+ } | null;
590
+ /** The list the drag started in, while dragging. */
591
+ originList: L | null;
592
+ isHome: (id: string, index: number) => boolean;
593
+ listOf: (state: DragListsItems<L>, id: UniqueIdentifier) => L | null;
594
+ collisionDetection: CollisionDetection;
595
+ coordinateGetter: KeyboardCoordinateGetter;
596
+ accessibility: {
597
+ announcements: Announcements;
598
+ screenReaderInstructions: ScreenReaderInstructions;
599
+ };
600
+ handlers: {
601
+ onDragStart: ({ active, activatorEvent }: DragStartEvent) => void;
602
+ onDragOver: ({ active, over }: DragOverEvent) => void;
603
+ onDragEnd: ({ over }: DragEndEvent) => void;
604
+ onDragCancel: () => void;
605
+ };
606
+ };
607
+ type DraggedSlotProps = {
608
+ /**
609
+ * This item is the one being dragged. Render the slot around every item
610
+ * and pass `isDragging`, so the dragged one keeps its node (and focus).
611
+ * @default false
612
+ */
613
+ dragging?: boolean;
614
+ /** The dragged item still stands at its own place. */
615
+ home: boolean;
616
+ /** The item's radius class, for the place: `rounded-control` by default. */
617
+ radius?: string;
618
+ /** Classes for the place, after `radius`. */
619
+ className?: string;
620
+ children: ReactNode;
621
+ };
622
+ /**
623
+ * Wraps each item's content in a list. The dragged item's own node is at 40%
624
+ * while it is still home, and the dashed place (its size, its radius) once it
625
+ * stands anywhere else. Every other item renders as it is: the wrapper stays
626
+ * the same, so the item keeps focus when its drag starts.
627
+ */
628
+ export declare function DraggedSlot({ dragging, home, radius, className, children }: DraggedSlotProps): import("react").JSX.Element;
629
+ /** The last announcement, for a polite live region (`DragLiveRegion`). Repeats are dropped. */
630
+ export declare function useDragAnnouncer(): {
631
+ message: string;
632
+ announce: (text: string) => void;
633
+ };
634
+ /** A polite, visually hidden live region for drag announcements. */
635
+ export declare function DragLiveRegion({ message }: {
636
+ message: string;
637
+ }): import("react").JSX.Element;
307
638
  //#endregion
308
639
  //#region src/components/ellipsis/ellipsis.d.ts
309
640
  /** What a function passed as `after` receives. */
@@ -830,4 +1161,4 @@ type ChoiceListMultipleProps = ChoiceListCommonProps & {
830
1161
  type ChoiceListProps = ChoiceListSingleProps | ChoiceListMultipleProps;
831
1162
  export declare function ChoiceList(props: ChoiceListProps): import("react").JSX.Element;
832
1163
  //#endregion
833
- export { Dialog as AnnouncementDialog, DialogClose as AnnouncementDialogClose, DialogTrigger as AnnouncementDialogTrigger, type ChoiceListGroup, type ChoiceListItem, type ChoiceListMultipleProps, type ChoiceListProps, type ChoiceListSingleProps, type ComboboxSelectGroup, type ComboboxSelectMessages, type ComboboxSelectOption, type ComboboxSelectProps, type ComboboxSelectSelection, type ComboboxSelectValue, type CommentCardMetaProps, type CommentCardProps, type CommentCardQuoteProps, type CommentCardTriggerProps, type CommentEntryAuthorProps, type CommentEntryBodyProps, type CommentEntryHeaderProps, type CommentEntryProps, type CommentEntryTimeProps, type CommentMarginItemProps, type CommentMarginLayout, type CommentMarginLayoutItem, type CommentMarginLayoutOptions, type CommentMarginProps, type CommentMarkerProps, DialogCommit, type DialogCommitProps, DialogFooterNote, type DialogFooterNoteProps, DialogSheetBack, type DialogSheetBackProps, DialogSheetContent, type DialogSheetContentProps, DropdownMenuLinkItem, type DropdownMenuLinkItemProps, type EllipsisProps, type EllipsisState, type EllipsisToggleProps, type HoldThenMoveOptions, type InboxItemLeadingBadgeProps, type InboxItemSkeletonListProps, type InboxItemSkeletonProps, type ListRowSkeletonProps, MessageItemDelegatedAvatar, type MessageItemDelegatedAvatarProps, MessageItemDelegatedBy, MessageItemDelegatedByButton, type MessageItemDelegatedByButtonProps, MessageItemDelegatedByName, type MessageItemDelegatedByNameProps, type MessageItemDelegatedByProps, MessageListJumpControls, type MessageListJumpControlsProps, MessageListJumpPill, MessageListJumpPillDismiss, type MessageListJumpPillDismissProps, MessageListJumpPillGroup, type MessageListJumpPillGroupProps, type MessageListJumpPillProps, MessageQuotedPreviewAuthorDelegatedBy, type MessageQuotedPreviewAuthorDelegatedByProps, MessageReferenceIcon, type MessageReferenceIconProps, MessageReferenceReadMark, type MessageReferenceReadMarkProps, type MeterHeaderProps, type MeterIndicatorProps, type MeterLabelProps, type MeterProps, type MeterTrackProps, type MeterValueProps, MobileNavServerItem, type MobileNavServerItemProps, MobileNavServerPopover, MobileNavServerPopoverContent, type MobileNavServerPopoverContentProps, MobileNavServerPopoverDestination, type MobileNavServerPopoverDestinationProps, MobileNavServerPopoverDestinations, type MobileNavServerPopoverDestinationsProps, MobileNavServerPopoverGroup, type MobileNavServerPopoverGroupProps, MobileNavServerPopoverList, type MobileNavServerPopoverListProps, type MobileNavServerPopoverProps, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, type MobileNavServerPopoverRowBodyProps, MobileNavServerPopoverRowDescription, type MobileNavServerPopoverRowDescriptionProps, MobileNavServerPopoverRowLabel, type MobileNavServerPopoverRowLabelProps, type MobileNavServerPopoverRowProps, type OverlayLayerKind, type OverlayLayerProviderProps, PopoverActions, type PopoverActionsProps, PopoverBody, type PopoverBodyProps, PreviewCardActions, type PreviewCardActionsProps, PreviewCardBody, type PreviewCardBodyProps, PreviewCardEyebrow, type PreviewCardEyebrowProps, PreviewCardFooter, type PreviewCardFooterProps, PreviewCardMeta, type PreviewCardMetaProps, type PullToRefresh, type PullToRefreshIndicatorProps, type PullToRefreshPlatform, type PullToRefreshState, type UseCommentMarginFitsOptions, type UsePullToRefreshOptions };
1164
+ export { Dialog as AnnouncementDialog, DialogClose as AnnouncementDialogClose, DialogTrigger as AnnouncementDialogTrigger, type ChoiceListGroup, type ChoiceListItem, type ChoiceListMultipleProps, type ChoiceListProps, type ChoiceListSingleProps, type ComboboxSelectGroup, type ComboboxSelectMessages, type ComboboxSelectOption, type ComboboxSelectProps, type ComboboxSelectSelection, type ComboboxSelectValue, type CommentCardMetaProps, type CommentCardProps, type CommentCardQuoteProps, type CommentCardTriggerProps, type CommentEntryAuthorProps, type CommentEntryBodyProps, type CommentEntryHeaderProps, type CommentEntryProps, type CommentEntryTimeProps, type CommentMarginItemProps, type CommentMarginLayout, type CommentMarginLayoutItem, type CommentMarginLayoutOptions, type CommentMarginProps, type CommentMarkerProps, DEFAULT_DRAG_MESSAGES, DialogCommit, type DialogCommitProps, DialogFooterNote, type DialogFooterNoteProps, DialogSheetBack, type DialogSheetBackProps, DialogSheetContent, type DialogSheetContentProps, type DragAcrossLists, type DragAnnouncementSource, type DragLiftProps, type DragListsItems, type DragMessages, type DragNamed, type DragPlace, type DragRefusalHintProps, type DragRemeasureProps, type DragSensorsOptions, type DraggedSlotProps, type DropPlaceholderProps, DropdownMenuLinkItem, type DropdownMenuLinkItemProps, type EllipsisProps, type EllipsisState, type EllipsisToggleProps, type HoldThenMoveOptions, type InboxItemLeadingBadgeProps, type InboxItemSkeletonListProps, type InboxItemSkeletonProps, type ListRowSkeletonProps, MessageItemDelegatedAvatar, type MessageItemDelegatedAvatarProps, MessageItemDelegatedBy, MessageItemDelegatedByButton, type MessageItemDelegatedByButtonProps, MessageItemDelegatedByName, type MessageItemDelegatedByNameProps, type MessageItemDelegatedByProps, MessageListJumpControls, type MessageListJumpControlsProps, MessageListJumpPill, MessageListJumpPillDismiss, type MessageListJumpPillDismissProps, MessageListJumpPillGroup, type MessageListJumpPillGroupProps, type MessageListJumpPillProps, MessageQuotedPreviewAuthorDelegatedBy, type MessageQuotedPreviewAuthorDelegatedByProps, MessageReferenceIcon, type MessageReferenceIconProps, MessageReferenceReadMark, type MessageReferenceReadMarkProps, type MeterHeaderProps, type MeterIndicatorProps, type MeterLabelProps, type MeterProps, type MeterTrackProps, type MeterValueProps, MobileNavServerItem, type MobileNavServerItemProps, MobileNavServerPopover, MobileNavServerPopoverContent, type MobileNavServerPopoverContentProps, MobileNavServerPopoverDestination, type MobileNavServerPopoverDestinationProps, MobileNavServerPopoverDestinations, type MobileNavServerPopoverDestinationsProps, MobileNavServerPopoverGroup, type MobileNavServerPopoverGroupProps, MobileNavServerPopoverList, type MobileNavServerPopoverListProps, type MobileNavServerPopoverProps, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, type MobileNavServerPopoverRowBodyProps, MobileNavServerPopoverRowDescription, type MobileNavServerPopoverRowDescriptionProps, MobileNavServerPopoverRowLabel, type MobileNavServerPopoverRowLabelProps, type MobileNavServerPopoverRowProps, type OverlayLayerKind, type OverlayLayerProviderProps, PopoverActions, type PopoverActionsProps, PopoverBody, type PopoverBodyProps, PreviewCardActions, type PreviewCardActionsProps, PreviewCardBody, type PreviewCardBodyProps, PreviewCardEyebrow, type PreviewCardEyebrowProps, PreviewCardFooter, type PreviewCardFooterProps, PreviewCardMeta, type PreviewCardMetaProps, type PullToRefresh, type PullToRefreshIndicatorProps, type PullToRefreshPlatform, type PullToRefreshState, type UseCommentMarginFitsOptions, type UseDragListsOptions, type UsePullToRefreshOptions, createDragAnnouncements, dragInstructions, dragMessages };