@remit/web-client 0.0.140 → 0.0.142

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.140",
3
+ "version": "0.0.142",
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": {
@@ -1,5 +1,6 @@
1
1
  import type { RemitImapThreadMessageResponse } from "@remit/api-http-client/types.gen.ts";
2
2
  import {
3
+ DialogBackdrop,
3
4
  IntelligencePanel,
4
5
  type IntelligenceQuickActions,
5
6
  type SimilarMessageLinkComponent,
@@ -154,19 +155,17 @@ function ReclassifyDialog({
154
155
  }) {
155
156
  if (!isOpen) return null;
156
157
  return (
157
- <div
158
- className="fixed inset-0 z-50 flex items-center justify-center"
159
- aria-hidden="true"
160
- onClick={onCancel}
161
- >
162
- <div className="absolute inset-0 bg-canvas/80 backdrop-blur-sm" />
158
+ <div className="fixed inset-0 z-50 flex items-center justify-center">
159
+ <DialogBackdrop
160
+ label="Dismiss reclassify sender"
161
+ onDismiss={onCancel}
162
+ className="backdrop-blur-sm"
163
+ />
163
164
  <div
164
165
  role="dialog"
165
166
  aria-modal="true"
166
167
  aria-label="Reclassify sender"
167
168
  className="relative z-10 w-full max-w-sm rounded-sm border border-line bg-surface p-6 shadow-lg"
168
- onClick={(e) => e.stopPropagation()}
169
- onKeyDown={(e) => e.stopPropagation()}
170
169
  >
171
170
  <h2 className="text-lg font-semibold">Reclassify this sender</h2>
172
171
  <p className="mt-2 text-sm text-fg-muted">
@@ -1,4 +1,4 @@
1
- import { Kbd, KEY_HINT_GROUPS } from "@remit/ui";
1
+ import { DialogBackdrop, Kbd, KEY_HINT_GROUPS } from "@remit/ui";
2
2
  import { X } from "lucide-react";
3
3
  import { Fragment, useCallback, useEffect } from "react";
4
4
  import { cn } from "@/lib/utils";
@@ -37,29 +37,23 @@ export const KeyboardShortcutsModal = ({
37
37
  if (!isOpen) return null;
38
38
 
39
39
  return (
40
- <div
41
- className="fixed inset-0 z-50 flex items-center justify-center"
42
- role="dialog"
43
- aria-modal="true"
44
- aria-label="Keyboard shortcuts"
45
- onClick={onClose}
46
- onKeyDown={(e) => e.key === "Escape" && onClose()}
47
- >
48
- {/* Backdrop */}
49
- <div className="absolute inset-0 bg-canvas/80 backdrop-blur-sm" />
40
+ <div className="fixed inset-0 z-50 flex items-center justify-center">
41
+ <DialogBackdrop
42
+ label="Dismiss keyboard shortcuts"
43
+ onDismiss={onClose}
44
+ className="backdrop-blur-sm"
45
+ />
50
46
 
51
47
  {/* Modal */}
52
- {/* biome-ignore lint/a11y/noStaticElementInteractions: stops event propagation from the modal content; keyboard is handled by the outer wrapper */}
53
48
  <div
49
+ role="dialog"
50
+ aria-modal="true"
51
+ aria-label="Keyboard shortcuts"
54
52
  className={cn(
55
53
  "relative z-10 max-h-[85vh] w-full max-w-2xl overflow-y-auto",
56
54
  "rounded-lg border border-line bg-surface shadow-lg",
57
55
  "p-6",
58
56
  )}
59
- onClick={(e) => e.stopPropagation()}
60
- onKeyDown={(e) => {
61
- if (e.key !== "Escape") e.stopPropagation();
62
- }}
63
57
  >
64
58
  {/* Header */}
65
59
  <div className="mb-6 flex items-center justify-between">
@@ -1,10 +1,10 @@
1
1
  import type { RemitImapAddressResponse } from "@remit/api-http-client/types.gen.ts";
2
2
 
3
3
  /**
4
- * `GET /addresses/search` is a prefix search over both the display-name
5
- * compound and the normalized email, so a query for one sender's address can
6
- * legitimately return several rows (`sup@x.com` also prefixes `support@x.com`,
7
- * and any display name starting with the same characters matches too).
4
+ * `GET /addresses/search` matches the query as a substring of a display name, a
5
+ * local part, a domain or a whole address, and answers in relevance order. A
6
+ * query for one sender's address therefore returns several rows: everyone
7
+ * sharing that domain matches it too.
8
8
  *
9
9
  * Asking for a single row and taking `items[0]` is therefore wrong twice over:
10
10
  * the row it returns may belong to a different sender, and the row we actually
@@ -22,10 +22,9 @@ export const senderAddressSearchQuery = (
22
22
  });
23
23
 
24
24
  /**
25
- * Select the address row for exactly this sender. A prefix match on another
26
- * sender is not this sender, so it resolves to `undefined` rather than the
27
- * wrong address — silently flagging the wrong sender is worse than not
28
- * resolving.
25
+ * Select the address row for exactly this sender. Another sender under the same
26
+ * domain is not this sender, so it resolves to `undefined` rather than the wrong
27
+ * address — silently flagging the wrong sender is worse than not resolving.
29
28
  */
30
29
  export const pickSenderAddress = (
31
30
  items: RemitImapAddressResponse[] | undefined,