@remit/ui 0.0.130 → 0.0.131

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/ui",
3
- "version": "0.0.130",
3
+ "version": "0.0.131",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
@@ -46,6 +46,21 @@ describe("OutboxRow", () => {
46
46
  assert.doesNotMatch(html, /disabled=""/);
47
47
  });
48
48
 
49
+ it("offers only delete for an unfiled row and names the reason", () => {
50
+ const html = renderToString(
51
+ createElement(OutboxRow, {
52
+ ...baseProps,
53
+ status: "unfiled",
54
+ error: "this account has no Sent folder",
55
+ }),
56
+ );
57
+ assert.match(html, /Sent, not filed/);
58
+ assert.match(html, /this account has no Sent folder/);
59
+ assert.match(html, /aria-label="Delete message"/);
60
+ assert.doesNotMatch(html, /aria-label="Retry sending"/);
61
+ assert.doesNotMatch(html, /aria-label="Edit as draft"/);
62
+ });
63
+
49
64
  it("omits retry for a blocked row but keeps edit and delete", () => {
50
65
  const html = renderToString(
51
66
  createElement(OutboxRow, {
@@ -24,6 +24,14 @@ export const Sending: Story = { args: { status: "sending" } };
24
24
 
25
25
  export const Sent: Story = { args: { status: "sent" } };
26
26
 
27
+ export const Unfiled: Story = {
28
+ args: {
29
+ status: "unfiled",
30
+ error:
31
+ "Sent, but not filed: this account has no Sent folder. Create one named Sent and later messages will be filed there.",
32
+ },
33
+ };
34
+
27
35
  export const Failed: Story = {
28
36
  args: {
29
37
  status: "failed",
@@ -11,7 +11,7 @@ export interface OutboxRowProps {
11
11
  /** Pre-formatted timestamp shown at the row's trailing edge. */
12
12
  time: string;
13
13
  status: OutboxStatus;
14
- /** Surfaced after the status label for failed/blocked rows. */
14
+ /** Surfaced after the status label for failed, blocked and unfiled rows. */
15
15
  error?: string;
16
16
  selected?: boolean;
17
17
  onSelect: () => void;
@@ -26,7 +26,7 @@ export interface OutboxRowProps {
26
26
  const tintForStatus = (status: OutboxStatus, selected?: boolean): string => {
27
27
  if (selected) return "bg-accent-2-soft";
28
28
  if (status === "failed") return "bg-danger-soft";
29
- if (status === "blocked") return "bg-warning/10";
29
+ if (status === "blocked" || status === "unfiled") return "bg-warning/10";
30
30
  return "";
31
31
  };
32
32
 
@@ -49,7 +49,8 @@ export function OutboxRow({
49
49
  onDelete,
50
50
  deleting,
51
51
  }: OutboxRowProps) {
52
- const showActions = status === "failed" || status === "blocked";
52
+ const showActions =
53
+ status === "failed" || status === "blocked" || status === "unfiled";
53
54
 
54
55
  return (
55
56
  <div
@@ -96,12 +97,16 @@ export function OutboxRow({
96
97
  } as const,
97
98
  ]
98
99
  : []),
99
- {
100
- label: "Edit as draft",
101
- iconOnly: true,
102
- icon: <Send className="size-3.5" />,
103
- onClick: onEdit,
104
- },
100
+ ...(status === "unfiled"
101
+ ? []
102
+ : [
103
+ {
104
+ label: "Edit as draft",
105
+ iconOnly: true,
106
+ icon: <Send className="size-3.5" />,
107
+ onClick: onEdit,
108
+ } as const,
109
+ ]),
105
110
  ]}
106
111
  destructive={{
107
112
  label: "Delete message",
@@ -8,7 +8,13 @@ import {
8
8
  import { cn } from "../lib/cn.js";
9
9
 
10
10
  /** The non-draft outbox lifecycle states (drafts live in a separate view). */
11
- export type OutboxStatus = "queued" | "sending" | "sent" | "failed" | "blocked";
11
+ export type OutboxStatus =
12
+ | "queued"
13
+ | "sending"
14
+ | "sent"
15
+ | "unfiled"
16
+ | "failed"
17
+ | "blocked";
12
18
 
13
19
  interface StatusConfig {
14
20
  icon: typeof Clock;
@@ -26,6 +32,11 @@ export const outboxStatusConfig: Record<OutboxStatus, StatusConfig> = {
26
32
  spin: true,
27
33
  },
28
34
  sent: { icon: CheckCircle, label: "Sent", className: "text-positive" },
35
+ unfiled: {
36
+ icon: AlertTriangle,
37
+ label: "Sent, not filed",
38
+ className: "text-warning",
39
+ },
29
40
  failed: { icon: AlertCircle, label: "Failed", className: "text-danger" },
30
41
  blocked: { icon: AlertTriangle, label: "Blocked", className: "text-warning" },
31
42
  };