@remit/web-client 0.0.42 → 0.0.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "type": "module",
5
5
  "description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
6
6
  "exports": {
@@ -31,6 +31,7 @@ import {
31
31
  type FilterSheetProps,
32
32
  type FilterSheetSource,
33
33
  KeyboardHintBar,
34
+ LIST_ROW_ATTRIBUTE,
34
35
  type SearchResult,
35
36
  type ThreadRowData,
36
37
  type ThreadSection,
@@ -140,6 +141,7 @@ const BriefRow = ({
140
141
  return (
141
142
  <button
142
143
  type="button"
144
+ {...LIST_ROW_ATTRIBUTE}
143
145
  onClick={onClick}
144
146
  className={cn("group w-full", comfortableRowClass({ active }))}
145
147
  >
@@ -16,10 +16,12 @@
16
16
  import {
17
17
  ComfortableRow,
18
18
  flaggedFilterConfig,
19
+ LIST_ROW_SELECTOR,
19
20
  MessageListPane,
20
21
  type ThreadRowData,
22
+ useRovingFocus,
21
23
  } from "@remit/ui";
22
- import { useCallback, useMemo, useState } from "react";
24
+ import { useCallback, useMemo, useRef, useState } from "react";
23
25
  import { formatErrorMessage } from "@/components/ui/ErrorState";
24
26
  import { useIsDesktop } from "@/hooks/useMediaQuery";
25
27
  import { useSearchTokenContext } from "@/hooks/useSearchTokenContext";
@@ -54,6 +56,9 @@ export function FlaggedList({
54
56
  const tokenContext = useSearchTokenContext();
55
57
  const isDesktop = useIsDesktop();
56
58
 
59
+ const listRef = useRef<HTMLDivElement>(null);
60
+ useRovingFocus({ containerRef: listRef, itemSelector: LIST_ROW_SELECTOR });
61
+
57
62
  const [selectedCategory, setSelectedCategory] = useState("all");
58
63
  const [activeFilters, setActiveFilters] = useState<ReadonlySet<string>>(
59
64
  new Set(),
@@ -130,7 +135,7 @@ export function FlaggedList({
130
135
  }, []);
131
136
 
132
137
  const listBody = (
133
- <div className="flex-1 overflow-y-auto">
138
+ <div ref={listRef} className="flex-1 overflow-y-auto">
134
139
  <div className="divide-y divide-line">
135
140
  {rows.map((thread) => (
136
141
  <ComfortableRow
@@ -22,7 +22,12 @@ import type {
22
22
  RemitImapOutboxMessageResponse,
23
23
  RemitImapOutboxMessageStatus,
24
24
  } from "@remit/api-http-client/types.gen.ts";
25
- import { OutboxRow, ReadingPaneEmpty } from "@remit/ui";
25
+ import {
26
+ LIST_ROW_SELECTOR,
27
+ OutboxRow,
28
+ ReadingPaneEmpty,
29
+ useRovingFocus,
30
+ } from "@remit/ui";
26
31
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
27
32
  import { useNavigate, useSearch } from "@tanstack/react-router";
28
33
  import {
@@ -40,6 +45,7 @@ import {
40
45
  useCallback,
41
46
  useContext,
42
47
  useMemo,
48
+ useRef,
43
49
  } from "react";
44
50
  import { useCompose } from "@/components/compose/ComposeProvider";
45
51
  import { MessageBody } from "@/components/mail/MessageBody";
@@ -434,6 +440,8 @@ function OutboxList() {
434
440
  selectedMessageId,
435
441
  onSelectMessage,
436
442
  } = useOutboxPane();
443
+ const listRef = useRef<HTMLDivElement>(null);
444
+ useRovingFocus({ containerRef: listRef, itemSelector: LIST_ROW_SELECTOR });
437
445
 
438
446
  if (isLoading) {
439
447
  return (
@@ -468,7 +476,7 @@ function OutboxList() {
468
476
  {messages.length} {messages.length === 1 ? "message" : "messages"}
469
477
  </span>
470
478
  </header>
471
- <div className="flex-1 overflow-y-auto">
479
+ <div ref={listRef} className="flex-1 overflow-y-auto">
472
480
  {messages.map((message) => (
473
481
  <OutboxMessageRow
474
482
  key={message.outboxMessageId}
@@ -523,6 +531,8 @@ function OutboxPhone() {
523
531
  selectedMessage,
524
532
  onSelectMessage,
525
533
  } = useOutboxPane();
534
+ const listRef = useRef<HTMLDivElement>(null);
535
+ useRovingFocus({ containerRef: listRef, itemSelector: LIST_ROW_SELECTOR });
526
536
 
527
537
  if (isLoading) {
528
538
  return (
@@ -563,7 +573,7 @@ function OutboxPhone() {
563
573
  {messages.length} {messages.length === 1 ? "message" : "messages"}
564
574
  </span>
565
575
  </header>
566
- <div className="flex-1 overflow-y-auto">
576
+ <div ref={listRef} className="flex-1 overflow-y-auto">
567
577
  {messages.map((message) => (
568
578
  <OutboxMessageRow
569
579
  key={message.outboxMessageId}