@remit/ui 0.0.240 → 0.0.242

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.
@@ -13,6 +13,7 @@ export interface ErrorBannerEntry {
13
13
  title: string;
14
14
  detail?: string;
15
15
  action?: ErrorBannerAction;
16
+ onRetry?: () => void;
16
17
  createdAt: number;
17
18
  }
18
19
  interface ErrorBannerProps {
@@ -21,7 +22,8 @@ interface ErrorBannerProps {
21
22
  title: string;
22
23
  detail?: string;
23
24
  action?: ErrorBannerAction;
25
+ onRetry?: () => void;
24
26
  onDismiss: (id: string) => void;
25
27
  }
26
- export declare const ErrorBanner: ({ id, severity, title, detail, action, onDismiss, }: ErrorBannerProps) => import("react").JSX.Element;
28
+ export declare const ErrorBanner: ({ id, severity, title, detail, action, onRetry, onDismiss, }: ErrorBannerProps) => import("react").JSX.Element;
27
29
  export {};
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CircleAlert, Info, TriangleAlert, X } from "../icons.js";
3
3
  import { cn } from "../lib/cn.js";
4
+ import { Button } from "./button.js";
4
5
  const SEVERITY_STYLES = {
5
6
  error: {
6
7
  container: "border-danger/50 bg-danger-soft",
@@ -28,12 +29,15 @@ const SEVERITY_LABEL = {
28
29
  warning: "Warning",
29
30
  info: "Information",
30
31
  };
31
- export const ErrorBanner = ({ id, severity, title, detail, action, onDismiss, }) => {
32
+ export const ErrorBanner = ({ id, severity, title, detail, action, onRetry, onDismiss, }) => {
32
33
  const styles = SEVERITY_STYLES[severity];
33
34
  const Icon = SEVERITY_ICONS[severity];
34
35
  return (_jsxs("div", { role: severity === "error" ? "alert" : "status", "aria-live": severity === "error" ? "assertive" : "polite", className: cn(
35
36
  // Opaque, not translucent: a banner overlaps the toolbar and the
36
37
  // message list, and see-through text on top of see-through text is
37
38
  // unreadable (issue #55).
38
- "pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas px-3 py-2 shadow-lg", styles.container), children: [_jsx(Icon, { className: cn("size-5 shrink-0 mt-0.5", styles.icon), "aria-hidden": "true" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("p", { className: cn("text-sm font-medium", styles.title), children: title }), detail && (_jsx("p", { className: "mt-0.5 text-xs text-fg-muted break-words", children: detail })), action && (_jsx("a", { href: action.href, target: "_blank", rel: "noopener noreferrer", className: "mt-1 inline-block text-xs font-medium text-accent-2 underline underline-offset-2", children: action.label }))] }), _jsx("button", { type: "button", onClick: () => onDismiss(id), className: "shrink-0 rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors", "aria-label": `Dismiss ${SEVERITY_LABEL[severity].toLowerCase()}`, children: _jsx(X, { className: "size-4", "aria-hidden": "true" }) })] }));
39
+ "pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas px-3 py-2 shadow-lg", styles.container), children: [_jsx(Icon, { className: cn("size-5 shrink-0 mt-0.5", styles.icon), "aria-hidden": "true" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("p", { className: cn("text-sm font-medium", styles.title), children: title }), detail && (_jsx("p", { className: "mt-0.5 text-xs text-fg-muted break-words", children: detail })), (onRetry || action) && (_jsxs("div", { className: "mt-1 flex flex-wrap items-center gap-x-4 gap-y-1", children: [onRetry && (_jsx(Button, { variant: "secondary", size: "sm", onClick: () => {
40
+ onDismiss(id);
41
+ onRetry();
42
+ }, children: "Try again" })), action && (_jsx("a", { href: action.href, target: "_blank", rel: "noopener noreferrer", className: "inline-block text-xs font-medium text-accent-2 underline underline-offset-2", children: action.label }))] }))] }), _jsx("button", { type: "button", onClick: () => onDismiss(id), className: "shrink-0 rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors", "aria-label": `Dismiss ${SEVERITY_LABEL[severity].toLowerCase()}`, children: _jsx(X, { className: "size-4", "aria-hidden": "true" }) })] }));
39
43
  };
@@ -3,5 +3,5 @@ import { ErrorBanner } from "./ErrorBanner.js";
3
3
  export const ErrorBannerStack = ({ errors, onDismiss, }) => {
4
4
  if (errors.length === 0)
5
5
  return null;
6
- return (_jsx("section", { "aria-label": "Notifications", className: "pointer-events-none fixed inset-x-0 top-0 z-[60] flex flex-col items-center gap-2 px-4 pt-[calc(1rem+env(safe-area-inset-top,0px))] sm:items-end sm:pr-6", children: _jsx("div", { className: "flex w-full max-w-md flex-col gap-2", children: errors.map((entry) => (_jsx(ErrorBanner, { id: entry.id, severity: entry.severity, title: entry.title, detail: entry.detail, action: entry.action, onDismiss: onDismiss }, entry.id))) }) }));
6
+ return (_jsx("section", { "aria-label": "Notifications", className: "pointer-events-none fixed inset-x-0 top-0 z-[60] flex flex-col items-center gap-2 px-4 pt-[calc(1rem+env(safe-area-inset-top,0px))] sm:items-end sm:pr-6", children: _jsx("div", { className: "flex w-full max-w-md flex-col gap-2", children: errors.map((entry) => (_jsx(ErrorBanner, { id: entry.id, severity: entry.severity, title: entry.title, detail: entry.detail, action: entry.action, onRetry: entry.onRetry, onDismiss: onDismiss }, entry.id))) }) }));
7
7
  };
@@ -1,5 +1,6 @@
1
1
  const REASON_SENTENCES = {
2
2
  DmarcFail: "It failed the sender domain's DMARC check.",
3
+ DkimDmarcFail: "The sender's domain did not sign it, and its authentication failed.",
3
4
  SignerMismatch: "It was signed by a different domain than its sender.",
4
5
  ReplyToMismatch: "Replies would go to a different domain than the sender's.",
5
6
  LinkTextMismatch: "A link's text shows one domain and opens another.",
@@ -20,6 +20,7 @@ export const warnSpamVerdict = {
20
20
  action: "Warn",
21
21
  kind: "Spam",
22
22
  modelOutcome: "OutOfBand",
23
+ decidedBy: "Rspamd",
23
24
  reasons: [
24
25
  reason("LinkTextMismatch", 0.3, ["bank.example -> login-check.example"]),
25
26
  reason("FirstContactDomain", 0.25, ["sender-domain.example"]),
@@ -32,6 +33,7 @@ export const warnPhishingVerdict = {
32
33
  action: "Warn",
33
34
  kind: "Phishing",
34
35
  modelOutcome: "OutOfBand",
36
+ decidedBy: "Rspamd",
35
37
  reasons: [
36
38
  reason("DisplayNameForeignAddress", 0.4, [
37
39
  '"support@bank.example" <x@other.example>',
@@ -54,6 +56,7 @@ export const modelJudgedVerdict = {
54
56
  action: "Warn",
55
57
  kind: "Spam",
56
58
  modelOutcome: "Answered",
59
+ decidedBy: "Model",
57
60
  reasons: [
58
61
  reason("RecentlyRegisteredDomain", 0.35, ["registered 2026-11-02"]),
59
62
  reason("ModelSpam", 0.2, [
@@ -72,6 +75,7 @@ export const warnOnlyAboveJunkVerdict = {
72
75
  action: "Warn",
73
76
  kind: "Spam",
74
77
  modelOutcome: "Answered",
78
+ decidedBy: "Model",
75
79
  reasons: [
76
80
  reason("LinkTextMismatch", 0.5, ["bank.example -> login-check.example"]),
77
81
  reason("FirstContactDomain", 0.4, ["sender-domain.example"]),
@@ -83,6 +87,7 @@ export const unknownReasonVerdict = {
83
87
  action: "Warn",
84
88
  kind: "Spam",
85
89
  modelOutcome: "Answered",
90
+ decidedBy: "Model",
86
91
  reasons: [
87
92
  reason("ProviderSpam", 0.3),
88
93
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/ui",
3
- "version": "0.0.240",
3
+ "version": "0.0.242",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",