@remit/ui 0.0.207 → 0.0.209

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.207",
3
+ "version": "0.0.209",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
@@ -137,3 +137,22 @@ export const SmtpMissing: Story = {
137
137
  },
138
138
  },
139
139
  };
140
+
141
+ export const MailOff: Story = {
142
+ name: "Blocked — mail is off for this account",
143
+ args: {
144
+ send: {
145
+ status: "blocked",
146
+ reason:
147
+ "Mail is turned off for this account, so it cannot send. Turn Mail back on for this account in Settings to send from it.",
148
+ },
149
+ },
150
+ play: async ({ args, canvasElement }) => {
151
+ const canvas = within(canvasElement);
152
+ await userEvent.click(canvas.getByRole("button", { name: "Send" }));
153
+ await expect(args.onBlocked).toHaveBeenCalledWith(
154
+ "Mail is turned off for this account, so it cannot send. Turn Mail back on for this account in Settings to send from it.",
155
+ );
156
+ await expect(args.onSend).not.toHaveBeenCalled();
157
+ },
158
+ };
@@ -0,0 +1,26 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { expect, within } from "storybook/test";
3
+ import { ComposeBodySkeleton } from "./compose-body-skeleton.js";
4
+
5
+ const meta = {
6
+ title: "Design System/Compose/ComposeBodySkeleton",
7
+ component: ComposeBodySkeleton,
8
+ decorators: [
9
+ (Story) => (
10
+ <div className="h-80 w-[560px] border border-line bg-canvas">
11
+ <Story />
12
+ </div>
13
+ ),
14
+ ],
15
+ } satisfies Meta<typeof ComposeBodySkeleton>;
16
+ export default meta;
17
+
18
+ type Story = StoryObj<typeof meta>;
19
+
20
+ export const Loading: Story = {
21
+ play: async ({ canvasElement }) => {
22
+ await expect(
23
+ within(canvasElement).getByTestId("compose-body-skeleton"),
24
+ ).toBeVisible();
25
+ },
26
+ };
@@ -0,0 +1,24 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { expect, fn, userEvent, within } from "storybook/test";
3
+ import { ComposeFab } from "./compose-fab.js";
4
+
5
+ const meta = {
6
+ title: "Design System/Mail/ComposeFab",
7
+ component: ComposeFab,
8
+ args: { onCompose: fn() },
9
+ globals: { viewport: { value: "mobile", isRotated: false } },
10
+ } satisfies Meta<typeof ComposeFab>;
11
+ export default meta;
12
+
13
+ type Story = StoryObj<typeof meta>;
14
+
15
+ export const Default: Story = {
16
+ play: async ({ args, canvasElement }) => {
17
+ const button = within(canvasElement).getByRole("button", {
18
+ name: "Compose new message",
19
+ });
20
+ await expect(button).toBeVisible();
21
+ await userEvent.click(button);
22
+ await expect(args.onCompose).toHaveBeenCalledOnce();
23
+ },
24
+ };
@@ -0,0 +1,19 @@
1
+ import { Pencil } from "lucide-react";
2
+
3
+ export interface ComposeFabProps {
4
+ onCompose: () => void;
5
+ }
6
+
7
+ export function ComposeFab({ onCompose }: ComposeFabProps) {
8
+ return (
9
+ <button
10
+ type="button"
11
+ onClick={onCompose}
12
+ aria-label="Compose new message"
13
+ className="lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all"
14
+ style={{ bottom: "calc(env(safe-area-inset-bottom, 0) + 1rem)" }}
15
+ >
16
+ <Pencil className="size-6" />
17
+ </button>
18
+ );
19
+ }
@@ -0,0 +1,335 @@
1
+ import type { SearchConversion } from "../lib/search-rule.js";
2
+ import type { WizardMessage } from "./selection-wizard.js";
3
+
4
+ export interface SelectionMessage extends WizardMessage {
5
+ email: string;
6
+ preview: string;
7
+ }
8
+
9
+ export const SELECTION_SAMPLE: SelectionMessage[] = [
10
+ {
11
+ id: "m1",
12
+ sender: "Booking.com",
13
+ email: "noreply@booking.com",
14
+ subject: "Booking confirmation: Hotel Bairro Alto",
15
+ preview: "Your stay in Lisbon is confirmed for Jul 12–16.",
16
+ date: "Jul 2",
17
+ },
18
+ {
19
+ id: "m2",
20
+ sender: "Airbnb",
21
+ email: "automated@airbnb.com",
22
+ subject: "Your reservation is confirmed – Lisbon",
23
+ preview: "Miguel is expecting you on Friday at 15:00.",
24
+ date: "Jun 28",
25
+ },
26
+ {
27
+ id: "m3",
28
+ sender: "Expedia",
29
+ email: "travel@expediamail.com",
30
+ subject: "Itinerary for your upcoming trip",
31
+ preview: "Flight IB3109 departs Amsterdam 09:40.",
32
+ date: "Jun 27",
33
+ },
34
+ {
35
+ id: "m4",
36
+ sender: "Trainline",
37
+ email: "tickets@thetrainline.com",
38
+ subject: "Your ticket for Lisboa → Porto",
39
+ preview: "Coach 4, seat 21A. Show this QR at the gate.",
40
+ date: "Jun 24",
41
+ },
42
+ {
43
+ id: "m5",
44
+ sender: "Booking.com",
45
+ email: "noreply@booking.com",
46
+ subject: "How was your stay?",
47
+ preview: "Leave a review and help other travellers.",
48
+ date: "Jun 19",
49
+ },
50
+ {
51
+ id: "m6",
52
+ sender: "Ryanair",
53
+ email: "noreply@ryanair.com",
54
+ subject: "Check-in is now open",
55
+ preview: "Check in before Jul 11 to avoid the airport fee.",
56
+ date: "Jun 18",
57
+ },
58
+ {
59
+ id: "m7",
60
+ sender: "KLM",
61
+ email: "info@klm.com",
62
+ subject: "Your boarding pass for KL1695",
63
+ preview: "Gate D14 closes 20 minutes before departure.",
64
+ date: "Jun 17",
65
+ },
66
+ {
67
+ id: "m8",
68
+ sender: "Booking.com",
69
+ email: "noreply@booking.com",
70
+ subject: "Your stay in Porto is 3 weeks away",
71
+ preview: "Casa do Conto expects you on Jul 16.",
72
+ date: "Jun 15",
73
+ },
74
+ {
75
+ id: "m9",
76
+ sender: "Rome2Rio",
77
+ email: "hello@rome2rio.com",
78
+ subject: "Getting from Porto airport to the centre",
79
+ preview: "Metro line E runs every 20 minutes until 01:00.",
80
+ date: "Jun 14",
81
+ },
82
+ {
83
+ id: "m10",
84
+ sender: "Sixt",
85
+ email: "noreply@sixt.com",
86
+ subject: "Rental agreement 4471-9930",
87
+ preview: "Pick up Jul 18, 10:00, Porto Campanhã.",
88
+ date: "Jun 11",
89
+ },
90
+ {
91
+ id: "m11",
92
+ sender: "Airbnb",
93
+ email: "automated@airbnb.com",
94
+ subject: "Miguel sent you a message",
95
+ preview: "The key box code is on the door to the left.",
96
+ date: "Jun 9",
97
+ },
98
+ {
99
+ id: "m12",
100
+ sender: "Trainline",
101
+ email: "tickets@thetrainline.com",
102
+ subject: "Refund processed for CP 4412",
103
+ preview: "€24.50 is back on the card ending 4417.",
104
+ date: "Jun 6",
105
+ },
106
+ {
107
+ id: "m13",
108
+ sender: "Expedia",
109
+ email: "travel@expediamail.com",
110
+ subject: "Price drop on your saved trip",
111
+ preview: "Amsterdam → Faro is now €38 lower.",
112
+ date: "Jun 4",
113
+ },
114
+ {
115
+ id: "m14",
116
+ sender: "GetYourGuide",
117
+ email: "noreply@getyourguide.com",
118
+ subject: "Your Douro valley tour is booked",
119
+ preview: "Meet at Praça da Liberdade, 08:15.",
120
+ date: "Jun 2",
121
+ },
122
+ {
123
+ id: "m15",
124
+ sender: "Booking.com",
125
+ email: "noreply@booking.com",
126
+ subject: "Free cancellation ends tomorrow",
127
+ preview: "Hotel Bairro Alto can still be changed until Jun 1.",
128
+ date: "May 31",
129
+ },
130
+ {
131
+ id: "m16",
132
+ sender: "Ryanair",
133
+ email: "noreply@ryanair.com",
134
+ subject: "Schedule change on FR2455",
135
+ preview: "Departure moved from 06:20 to 07:05.",
136
+ date: "May 28",
137
+ },
138
+ {
139
+ id: "m17",
140
+ sender: "Revolut",
141
+ email: "no-reply@revolut.com",
142
+ subject: "Travel insurance for your Portugal trip",
143
+ preview: "Cover starts the day you leave the country.",
144
+ date: "May 26",
145
+ },
146
+ {
147
+ id: "m18",
148
+ sender: "Airbnb",
149
+ email: "automated@airbnb.com",
150
+ subject: "Receipt for your Porto reservation",
151
+ preview: "Paid €412.00 on May 24.",
152
+ date: "May 24",
153
+ },
154
+ {
155
+ id: "m19",
156
+ sender: "Skyscanner",
157
+ email: "alerts@skyscanner.net",
158
+ subject: "Fare alert: Lisbon in September",
159
+ preview: "Return flights from €96 for the dates you watched.",
160
+ date: "May 21",
161
+ },
162
+ {
163
+ id: "m20",
164
+ sender: "KLM",
165
+ email: "info@klm.com",
166
+ subject: "Choose your seats for KL1694",
167
+ preview: "Rows 12 to 18 are still open at no charge.",
168
+ date: "May 19",
169
+ },
170
+ ];
171
+
172
+ export const SELECTION_SEARCH_SAMPLE: SelectionMessage[] = [
173
+ {
174
+ id: "s1",
175
+ sender: "npm",
176
+ email: "support@npmjs.com",
177
+ subject: "npm: remit-ui@0.4.2 was published",
178
+ preview: "A new version of a package you own is now on the registry.",
179
+ date: "Jul 3",
180
+ },
181
+ {
182
+ id: "s2",
183
+ sender: "npm",
184
+ email: "security@npmjs.com",
185
+ subject: "npm security advisory affects 2 of your packages",
186
+ preview: "A high-severity advisory was published for lodash.",
187
+ date: "Jul 2",
188
+ },
189
+ {
190
+ id: "s3",
191
+ sender: "Node Weekly",
192
+ email: "newsletter@cooperpress.com",
193
+ subject: "Node.js 24 reaches LTS, plus 12 links",
194
+ preview: "The release notes, the timeline, and what breaks.",
195
+ date: "Jul 1",
196
+ },
197
+ {
198
+ id: "s4",
199
+ sender: "GitHub",
200
+ email: "notifications@github.com",
201
+ subject: "[remit] Dependabot: bump vite from 7.3.4 to 7.3.6",
202
+ preview: "Automated dependency update opened a pull request.",
203
+ date: "Jun 30",
204
+ },
205
+ {
206
+ id: "s5",
207
+ sender: "npm",
208
+ email: "support@npmjs.com",
209
+ subject: "npm now requires two-factor authentication",
210
+ preview: "Publishing without 2FA stops working on Aug 1.",
211
+ date: "Jun 29",
212
+ },
213
+ {
214
+ id: "s6",
215
+ sender: "Booking.com",
216
+ email: "noreply@booking.com",
217
+ subject: "Booking confirmation: Hotel Bairro Alto",
218
+ preview: "Your stay in Lisbon is confirmed for Jul 12–16.",
219
+ date: "Jun 28",
220
+ },
221
+ {
222
+ id: "s7",
223
+ sender: "JavaScript Weekly",
224
+ email: "newsletter@cooperpress.com",
225
+ subject: "The state of bundlers in 2026",
226
+ preview: "Rolldown lands, esbuild holds, and the numbers behind it.",
227
+ date: "Jun 27",
228
+ },
229
+ {
230
+ id: "s8",
231
+ sender: "Eline",
232
+ email: "eline@example.com",
233
+ subject: "Re: can you look at the npm thing tonight?",
234
+ preview: "It fails on my machine but not on the runner.",
235
+ date: "Jun 26",
236
+ },
237
+ {
238
+ id: "s9",
239
+ sender: "Sentry",
240
+ email: "noreply@sentry.io",
241
+ subject: "New issue: TypeError in @remit/web-client",
242
+ preview: "Seen 41 times in the last hour on production.",
243
+ date: "Jun 25",
244
+ },
245
+ {
246
+ id: "s10",
247
+ sender: "npm",
248
+ email: "support@npmjs.com",
249
+ subject: "Your npm access token expires in 7 days",
250
+ preview: "Rotate it before Jul 2 to keep publishing.",
251
+ date: "Jun 22",
252
+ },
253
+ {
254
+ id: "s11",
255
+ sender: "LinkedIn",
256
+ email: "jobs@linkedin.com",
257
+ subject: "5 new Node.js roles near Amsterdam",
258
+ preview: "Based on the skills on your profile.",
259
+ date: "Jun 21",
260
+ },
261
+ {
262
+ id: "s12",
263
+ sender: "ABN AMRO",
264
+ email: "noreply@abnamro.nl",
265
+ subject: "Betaalbevestiging €218,00",
266
+ preview: "Uw betaling is geslaagd op 20 juni 2026.",
267
+ date: "Jun 20",
268
+ },
269
+ ];
270
+
271
+ export const SELECTION_RECEIPTS_SAMPLE: SelectionMessage[] = [
272
+ {
273
+ id: "r1",
274
+ sender: "Blue Bottle",
275
+ email: "receipts@bluebottle.example",
276
+ subject: "Your receipt from Blue Bottle #4821",
277
+ preview: "Two bags of Bella Donovan, picked up in store.",
278
+ date: "Jul 1",
279
+ },
280
+ {
281
+ id: "r2",
282
+ sender: "Ritual Coffee",
283
+ email: "hello@ritual.example",
284
+ subject: "Re: Your receipt from Ritual Coffee #119",
285
+ preview: "Thanks for coming in — here is the copy you asked for.",
286
+ date: "Jun 30",
287
+ },
288
+ {
289
+ id: "r3",
290
+ sender: "Sightglass",
291
+ email: "no-reply@sightglass.example",
292
+ subject: "Your receipt from Sightglass #77",
293
+ preview: "Owl's Howl espresso, 1kg. Paid by card.",
294
+ date: "Jun 28",
295
+ },
296
+ {
297
+ id: "r4",
298
+ sender: "Trainline",
299
+ email: "tickets@thetrainline.com",
300
+ subject: "Your ticket for Lisboa → Porto",
301
+ preview: "Coach 4, seat 21A. Show this QR at the gate.",
302
+ date: "Jun 24",
303
+ },
304
+ ];
305
+
306
+ export const SELECTION_FOLDERS = [
307
+ "Archive",
308
+ "Travel",
309
+ "Travel/2026",
310
+ "Receipts",
311
+ "Newsletters",
312
+ "Work",
313
+ "Personal",
314
+ "Junk",
315
+ ];
316
+
317
+ export const RICH_CONVERSION: SearchConversion = {
318
+ clauses: [{ field: "HasWords", value: "npm" }],
319
+ matchOperator: "all",
320
+ scopedOut: { mailboxId: "mbx-archive", label: "Archive" },
321
+ droppedFacets: [
322
+ { type: "isUnread", label: "Unread" },
323
+ { type: "before", label: "Before 2026-01-01" },
324
+ ],
325
+ keptTerms: true,
326
+ droppedSemantic: true,
327
+ };
328
+
329
+ export const PLAIN_CONVERSION: SearchConversion = {
330
+ clauses: [{ field: "HasWords", value: "npm" }],
331
+ matchOperator: "all",
332
+ droppedFacets: [],
333
+ keptTerms: true,
334
+ droppedSemantic: false,
335
+ };