@remit/ui 0.0.164 → 0.0.166

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.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/src/components/calendar-clash-strip.render.test.ts +51 -0
  3. package/src/components/calendar-clash-strip.stories.tsx +56 -0
  4. package/src/components/calendar-clash-strip.tsx +64 -0
  5. package/src/components/calendar-invite-card.render.test.ts +110 -0
  6. package/src/components/calendar-invite-card.stories.tsx +132 -0
  7. package/src/components/calendar-invite-card.tsx +288 -0
  8. package/src/components/calendar-parse-badge.render.test.ts +40 -0
  9. package/src/components/calendar-parse-badge.stories.tsx +46 -0
  10. package/src/components/calendar-parse-badge.tsx +59 -0
  11. package/src/components/calendar-slot-offers.render.test.ts +67 -0
  12. package/src/components/calendar-slot-offers.stories.tsx +79 -0
  13. package/src/components/calendar-slot-offers.tsx +67 -0
  14. package/src/components/calendar-suggestion-deck.render.test.ts +69 -0
  15. package/src/components/calendar-suggestion-deck.stories.tsx +165 -0
  16. package/src/components/calendar-suggestion-deck.tsx +116 -0
  17. package/src/components/calendar-types.ts +57 -0
  18. package/src/components/event-suggestion-card.tsx +8 -1
  19. package/src/components/intelligence-calendar-fixtures.ts +384 -0
  20. package/src/components/intelligence-calendar.deck-zone-gate.test.ts +142 -0
  21. package/src/components/intelligence-calendar.render.test.ts +122 -0
  22. package/src/components/intelligence-calendar.tsx +288 -0
  23. package/src/components/intelligence-panel-calendar.stories.tsx +401 -0
  24. package/src/components/intelligence-panel.render.test.ts +64 -1
  25. package/src/components/intelligence-panel.stories.tsx +21 -0
  26. package/src/components/intelligence-panel.tab-strip.test.ts +163 -0
  27. package/src/components/intelligence-panel.tsx +265 -179
  28. package/src/components/intelligence-section.tsx +24 -0
  29. package/src/components/selection-wizard.render.test.ts +32 -0
  30. package/src/components/selection-wizard.tsx +28 -12
  31. package/src/index.ts +46 -0
  32. package/src/lib/semantic-off.ts +20 -0
@@ -0,0 +1,288 @@
1
+ import { CalendarDays } from "lucide-react";
2
+ import { useState } from "react";
3
+ import { cn } from "../lib/cn.js";
4
+ import { CalendarEventChip } from "./calendar-event-chip.js";
5
+ import { CalendarInviteCard } from "./calendar-invite-card.js";
6
+ import { CalendarSlotOffers } from "./calendar-slot-offers.js";
7
+ import { CalendarSuggestionDeck } from "./calendar-suggestion-deck.js";
8
+ import type {
9
+ CalendarClash,
10
+ CalendarColorId,
11
+ CalendarEventData,
12
+ CalendarInvite,
13
+ CalendarProposal,
14
+ CalendarSlotPick,
15
+ EventSuggestion,
16
+ RsvpState,
17
+ } from "./calendar-types.js";
18
+ import {
19
+ EventSuggestionCard,
20
+ settleZone,
21
+ ZONE_UNSETTLED_REASON,
22
+ } from "./event-suggestion-card.js";
23
+ import { IntelligenceSection } from "./intelligence-section.js";
24
+
25
+ /**
26
+ * The calendar half of the intelligence panel. It is the day the open message
27
+ * argues about, and nothing more: what the message would cost, what is already
28
+ * booked over it, what could be offered back. There is no grid here and nothing
29
+ * to drag — those live at `/calendar`, and this tab exists because the decision
30
+ * about time is being made in the mail, not there.
31
+ *
32
+ * The panel has a thread or it does not render at all, so this tab is a clash
33
+ * check before an answer rather than a queue of every pending invitation.
34
+ */
35
+
36
+ /** The invitation the open message carries, with the day already checked. */
37
+ export interface CalendarInviteIntel {
38
+ invite: CalendarInvite;
39
+ /** Already formatted by the caller. */
40
+ whenText: string;
41
+ /** The calendar the event would land on. */
42
+ calendarName: string;
43
+ color: CalendarColorId;
44
+ clashes: CalendarClash[];
45
+ rsvp: RsvpState;
46
+ }
47
+
48
+ /** One reading off this thread that is not the invitation. */
49
+ export interface CalendarSuggestionIntel {
50
+ suggestion: EventSuggestion;
51
+ whenText: string;
52
+ }
53
+
54
+ /** An event already on the day, drawn as the chip every calendar surface uses. */
55
+ export interface CalendarDayEntry {
56
+ event: CalendarEventData;
57
+ /** Already formatted; empty for an all-day entry. */
58
+ timeText: string;
59
+ color: CalendarColorId;
60
+ }
61
+
62
+ /** Times this thread named in prose, checked against the day it named. */
63
+ export interface CalendarProseIntel {
64
+ /** The day in words — "Thursday 11 June". */
65
+ dayLabel: string;
66
+ proposals: CalendarProposal[];
67
+ /** What could be offered back, cut off that day's free gaps. */
68
+ slots: CalendarSlotPick[];
69
+ /** Start clocks already ticked into the reply. */
70
+ picked: readonly string[];
71
+ }
72
+
73
+ export interface IntelligenceCalendarData {
74
+ invite?: CalendarInviteIntel;
75
+ prose?: CalendarProseIntel;
76
+ /** Newest first. The deck shows the first one and counts the rest. */
77
+ suggestions: CalendarSuggestionIntel[];
78
+ /** What is already booked on the day under discussion. */
79
+ day: CalendarDayEntry[];
80
+ /** The day those entries sit on, in words. */
81
+ dayLabel: string;
82
+ }
83
+
84
+ export interface IntelligenceCalendarActions {
85
+ onAddInvite: () => void;
86
+ onTentativeInvite: () => void;
87
+ onDeclineInvite: () => void;
88
+ onReopenInvite: () => void;
89
+ onOfferOtherTimes: () => void;
90
+ onRemoveInvite: () => void;
91
+ onOpenNewerInvite: () => void;
92
+ onToggleSlot: (slot: CalendarSlotPick) => void;
93
+ onAddSuggestion: (suggestionId: string, timeZone: string) => void;
94
+ onReviewSuggestion: (suggestionId: string, timeZone: string) => void;
95
+ onDismissSuggestion: (suggestionId: string) => void;
96
+ onOpenThread: (threadId: string) => void;
97
+ onSelectEvent: (eventId: string) => void;
98
+ }
99
+
100
+ export interface IntelligenceCalendarProps {
101
+ data: IntelligenceCalendarData;
102
+ actions: IntelligenceCalendarActions;
103
+ /** The event the day list is showing as selected; empty when none is. */
104
+ selectedEventId?: string;
105
+ touch?: boolean;
106
+ className?: string;
107
+ }
108
+
109
+ export function IntelligenceCalendar({
110
+ data,
111
+ actions,
112
+ selectedEventId = "",
113
+ touch,
114
+ className,
115
+ }: IntelligenceCalendarProps) {
116
+ const { invite, prose, suggestions, day, dayLabel } = data;
117
+ const [zoneChoices, setZoneChoices] = useState<Record<string, string>>({});
118
+ const top = suggestions[0];
119
+ const topChoice =
120
+ top === undefined ? "" : (zoneChoices[top.suggestion.id] ?? "");
121
+ const topSettlement =
122
+ top === undefined ? undefined : settleZone(top.suggestion, topChoice);
123
+ const picked = new Set(prose?.picked ?? []);
124
+ const nothingToSay =
125
+ invite === undefined &&
126
+ prose === undefined &&
127
+ suggestions.length === 0 &&
128
+ day.length === 0;
129
+
130
+ if (nothingToSay)
131
+ return (
132
+ <div
133
+ className={cn(
134
+ "flex flex-1 flex-col items-center justify-center gap-2 px-row-inset py-10 text-center",
135
+ className,
136
+ )}
137
+ >
138
+ <CalendarDays className="size-6 text-fg-subtle" aria-hidden />
139
+ <p className="text-sm text-fg-muted">
140
+ Nothing in this message is about a time.
141
+ </p>
142
+ <p className="text-2xs text-fg-subtle">
143
+ An invitation, a booking or a thread proposing hours would show up
144
+ here, with the day it lands on.
145
+ </p>
146
+ </div>
147
+ );
148
+
149
+ return (
150
+ <div className={cn("flex flex-col", className)}>
151
+ {invite && (
152
+ <IntelligenceSection label="Invitation">
153
+ <CalendarInviteCard
154
+ invite={invite.invite}
155
+ whenText={invite.whenText}
156
+ calendarName={invite.calendarName}
157
+ color={invite.color}
158
+ clashes={invite.clashes}
159
+ rsvp={invite.rsvp}
160
+ onAdd={actions.onAddInvite}
161
+ onTentative={actions.onTentativeInvite}
162
+ onDecline={actions.onDeclineInvite}
163
+ onReopen={actions.onReopenInvite}
164
+ onOfferOtherTimes={actions.onOfferOtherTimes}
165
+ onRemove={actions.onRemoveInvite}
166
+ onOpenNewer={actions.onOpenNewerInvite}
167
+ touch={touch}
168
+ />
169
+ </IntelligenceSection>
170
+ )}
171
+
172
+ {prose && (
173
+ <IntelligenceSection label={`Times named · ${prose.dayLabel}`}>
174
+ <ul className="flex flex-col gap-1">
175
+ {prose.proposals.map((proposal) => (
176
+ <li
177
+ key={proposal.id}
178
+ className="flex items-baseline gap-2 text-xs"
179
+ >
180
+ <span className="w-24 shrink-0 truncate tabular-nums text-fg">
181
+ {proposal.phrase}
182
+ </span>
183
+ {proposal.clashTitle === "" ? (
184
+ <span className="min-w-0 flex-1 truncate text-positive">
185
+ Nothing booked
186
+ </span>
187
+ ) : (
188
+ <span className="min-w-0 flex-1 truncate text-danger">
189
+ {proposal.clashTitle} is already there
190
+ </span>
191
+ )}
192
+ </li>
193
+ ))}
194
+ </ul>
195
+ <p className="mt-3 pb-1.5 text-2xs uppercase tracking-wider text-fg-subtle">
196
+ Free, half an hour each
197
+ </p>
198
+ <CalendarSlotOffers
199
+ slots={prose.slots}
200
+ picked={picked}
201
+ onToggle={actions.onToggleSlot}
202
+ touch={touch}
203
+ scroll
204
+ />
205
+ <p className="mt-1.5 text-2xs text-fg-subtle">
206
+ Picked slots go into the reply as plain text. Nothing is booked.
207
+ </p>
208
+ </IntelligenceSection>
209
+ )}
210
+
211
+ {suggestions.length > 0 && (
212
+ <IntelligenceSection label="Read out of this thread">
213
+ <CalendarSuggestionDeck
214
+ hasCard={top !== undefined}
215
+ remaining={suggestions.length}
216
+ blocked={topSettlement !== undefined && !topSettlement.settled}
217
+ blockedReason={ZONE_UNSETTLED_REASON}
218
+ onConfirm={() => {
219
+ if (top && topSettlement?.settled)
220
+ actions.onAddSuggestion(
221
+ top.suggestion.id,
222
+ topSettlement.timeZone,
223
+ );
224
+ }}
225
+ onReject={() => {
226
+ if (top) actions.onDismissSuggestion(top.suggestion.id);
227
+ }}
228
+ >
229
+ {top && (
230
+ <EventSuggestionCard
231
+ suggestion={top.suggestion}
232
+ whenText={top.whenText}
233
+ addLabel="Add to calendar"
234
+ zoneChoice={topChoice}
235
+ onZoneChoice={(timeZone) =>
236
+ setZoneChoices((prev) => ({
237
+ ...prev,
238
+ [top.suggestion.id]: timeZone,
239
+ }))
240
+ }
241
+ onAdd={(timeZone) =>
242
+ actions.onAddSuggestion(top.suggestion.id, timeZone)
243
+ }
244
+ onReview={(timeZone) =>
245
+ actions.onReviewSuggestion(top.suggestion.id, timeZone)
246
+ }
247
+ onDismiss={() => actions.onDismissSuggestion(top.suggestion.id)}
248
+ onOpenThread={() =>
249
+ actions.onOpenThread(top.suggestion.threadId)
250
+ }
251
+ touch={touch}
252
+ />
253
+ )}
254
+ </CalendarSuggestionDeck>
255
+ <p className="mt-2 text-2xs text-fg-subtle">
256
+ None of this is on your calendar, and none of it will be until you
257
+ say so.
258
+ </p>
259
+ </IntelligenceSection>
260
+ )}
261
+
262
+ {day.length > 0 && (
263
+ <IntelligenceSection label={dayLabel} className="border-b-0">
264
+ <ul className="flex flex-col gap-1">
265
+ {day.map((entry) => (
266
+ <li key={entry.event.id}>
267
+ <CalendarEventChip
268
+ title={entry.event.title}
269
+ timeText={entry.timeText}
270
+ color={entry.color}
271
+ layout="row"
272
+ density="compact"
273
+ rsvp={entry.event.myRsvp}
274
+ status={entry.event.status}
275
+ hasThread={entry.event.threadId !== ""}
276
+ isRecurring={entry.event.recurrenceRule !== ""}
277
+ zoneCertainty={entry.event.zoneCertainty}
278
+ selected={entry.event.id === selectedEventId}
279
+ onClick={() => actions.onSelectEvent(entry.event.id)}
280
+ />
281
+ </li>
282
+ ))}
283
+ </ul>
284
+ </IntelligenceSection>
285
+ )}
286
+ </div>
287
+ );
288
+ }
@@ -0,0 +1,401 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { type ReactNode, useState } from "react";
3
+ import type { RsvpState } from "./calendar-types.js";
4
+ import type { IntelligenceCalendarData } from "./intelligence-calendar.js";
5
+ import {
6
+ airlineSender,
7
+ cancelledInvite,
8
+ flightConfirmation,
9
+ inviteWithClash,
10
+ inviteWithoutClash,
11
+ nothingAboutTime,
12
+ organiserSender,
13
+ proseTimeThread,
14
+ supersededInvite,
15
+ thursdayProse,
16
+ } from "./intelligence-calendar-fixtures.js";
17
+ import type {
18
+ IntelligenceData,
19
+ IntelligenceTabId,
20
+ } from "./intelligence-panel.js";
21
+ import { IntelligencePanel } from "./intelligence-panel.js";
22
+
23
+ /**
24
+ * Option B, re-shaped. The calendar is not a second page you go to; it is the
25
+ * half of the info panel that answers what a message would cost. It is a tab
26
+ * rather than a longer column because the panel already carries the sender, and
27
+ * because the question only exists while a decision about time is open.
28
+ *
29
+ * The strip lives on `IntelligencePanel` itself, so both hosts inherit it: the
30
+ * rail that shows from 1280px up, and the drawer every narrower layout opens in
31
+ * its place. Both are framed below, because a tab strip that works in a 304px
32
+ * rail and breaks in a full-height sheet is not one component.
33
+ *
34
+ * The rule under every state here: nothing reaches the calendar unless a person
35
+ * presses the button, and pressing it tells the organiser nothing. This plan
36
+ * sends no reply, so the card says so where the press happens.
37
+ */
38
+ const meta: Meta = {
39
+ title: "Screens/Kit/IntelligencePanel/Calendar tab",
40
+ parameters: { layout: "centered" },
41
+ };
42
+ export default meta;
43
+
44
+ type Story = StoryObj;
45
+
46
+ /* ------------------------------------------------------------------ */
47
+ /* A panel that answers, so the review is a click-through not a picture */
48
+ /* ------------------------------------------------------------------ */
49
+
50
+ function PanelDemo({
51
+ sender,
52
+ calendar,
53
+ initialTab = "calendar",
54
+ hideCloseButton,
55
+ touch,
56
+ className,
57
+ }: {
58
+ sender: IntelligenceData;
59
+ calendar: IntelligenceCalendarData;
60
+ initialTab?: IntelligenceTabId;
61
+ hideCloseButton?: boolean;
62
+ touch?: boolean;
63
+ className?: string;
64
+ }) {
65
+ const [tab, setTab] = useState<IntelligenceTabId>(initialTab);
66
+ const [rsvp, setRsvp] = useState<RsvpState>(
67
+ calendar.invite?.rsvp ?? "noReply",
68
+ );
69
+ const [removed, setRemoved] = useState(false);
70
+ const [offering, setOffering] = useState(calendar.prose !== undefined);
71
+ const [picked, setPicked] = useState<string[]>([]);
72
+ const [dropped, setDropped] = useState<string[]>([]);
73
+ const [selectedEventId, setSelectedEventId] = useState("");
74
+ const [lastAction, setLastAction] = useState("");
75
+
76
+ const prose = offering
77
+ ? { ...(calendar.prose ?? thursdayProse), picked }
78
+ : undefined;
79
+
80
+ const data: IntelligenceCalendarData = {
81
+ ...calendar,
82
+ invite:
83
+ calendar.invite && !removed ? { ...calendar.invite, rsvp } : undefined,
84
+ prose,
85
+ suggestions: calendar.suggestions.filter(
86
+ (entry) => !dropped.includes(entry.suggestion.id),
87
+ ),
88
+ };
89
+
90
+ return (
91
+ <div className="flex h-full min-w-0 flex-col">
92
+ <IntelligencePanel
93
+ className={className}
94
+ data={sender}
95
+ calendar={{
96
+ data,
97
+ selectedEventId,
98
+ actions: {
99
+ onAddInvite: () => setRsvp("accepted"),
100
+ onTentativeInvite: () => setRsvp("tentative"),
101
+ onDeclineInvite: () => setRsvp("declined"),
102
+ onReopenInvite: () => setRsvp("noReply"),
103
+ onOfferOtherTimes: () => setOffering(true),
104
+ onRemoveInvite: () => setRemoved(true),
105
+ onOpenNewerInvite: () =>
106
+ setLastAction("would open revision 2 of the invitation"),
107
+ onToggleSlot: (slot) =>
108
+ setPicked((prev) =>
109
+ prev.includes(slot.startTime)
110
+ ? prev.filter((start) => start !== slot.startTime)
111
+ : [...prev, slot.startTime],
112
+ ),
113
+ onAddSuggestion: (id, timeZone) => {
114
+ setDropped((prev) => [...prev, id]);
115
+ setLastAction(
116
+ timeZone === ""
117
+ ? `added ${id} to the calendar`
118
+ : `added ${id} on ${timeZone}`,
119
+ );
120
+ },
121
+ onReviewSuggestion: (id) =>
122
+ setLastAction(`would open the editor on ${id}`),
123
+ onDismissSuggestion: (id) => setDropped((prev) => [...prev, id]),
124
+ onOpenThread: (threadId) =>
125
+ setLastAction(`would open thread ${threadId}`),
126
+ onSelectEvent: setSelectedEventId,
127
+ },
128
+ }}
129
+ tab={tab}
130
+ onTabChange={setTab}
131
+ hideCloseButton={hideCloseButton}
132
+ touch={touch}
133
+ />
134
+ {lastAction !== "" && (
135
+ <p className="shrink-0 border-t border-line bg-surface-sunken px-row-inset py-2 text-2xs text-fg-subtle">
136
+ Prototype: {lastAction}
137
+ </p>
138
+ )}
139
+ </div>
140
+ );
141
+ }
142
+
143
+ /* ------------------------------------------------------------------ */
144
+ /* Host 1: the rail, 1280px and up */
145
+ /* ------------------------------------------------------------------ */
146
+
147
+ function RailHost({
148
+ subject,
149
+ children,
150
+ }: {
151
+ subject: string;
152
+ children: ReactNode;
153
+ }) {
154
+ return (
155
+ <div className="flex h-[860px] w-[1440px] overflow-hidden rounded-lg border border-line bg-canvas">
156
+ <div className="w-14 shrink-0 border-r border-line bg-surface-sunken" />
157
+ <div className="w-56 shrink-0 border-r border-line bg-surface-sunken" />
158
+ <div className="w-80 shrink-0 border-r border-line bg-surface" />
159
+ <div className="flex min-w-0 flex-1 flex-col bg-surface">
160
+ <header className="flex h-pane-header shrink-0 items-center border-b border-line px-row-inset">
161
+ <h1 className="min-w-0 flex-1 truncate text-sm font-semibold text-fg">
162
+ {subject}
163
+ </h1>
164
+ </header>
165
+ <p className="px-row-inset py-4 text-sm text-fg-muted">
166
+ The message. The panel beside it is the surface under review.
167
+ </p>
168
+ </div>
169
+ {children}
170
+ </div>
171
+ );
172
+ }
173
+
174
+ /* ------------------------------------------------------------------ */
175
+ /* Host 2: the drawer, below 1280px */
176
+ /* ------------------------------------------------------------------ */
177
+
178
+ function DrawerHost({
179
+ subject,
180
+ children,
181
+ }: {
182
+ subject: string;
183
+ children: ReactNode;
184
+ }) {
185
+ return (
186
+ <div className="relative flex h-[860px] w-[900px] overflow-hidden rounded-lg border border-line bg-canvas">
187
+ <div className="w-72 shrink-0 border-r border-line bg-surface" />
188
+ <div className="flex min-w-0 flex-1 flex-col bg-surface">
189
+ <header className="flex h-pane-header shrink-0 items-center border-b border-line px-row-inset">
190
+ <h1 className="min-w-0 flex-1 truncate text-sm font-semibold text-fg">
191
+ {subject}
192
+ </h1>
193
+ </header>
194
+ </div>
195
+ <div className="absolute inset-0 bg-black/40" />
196
+ <aside className="absolute inset-y-0 right-0 flex w-[420px] flex-col border-l border-line bg-surface shadow-2xl">
197
+ <header className="flex h-pane-header shrink-0 items-center justify-between border-b border-line px-row-inset">
198
+ <span className="text-sm font-semibold text-fg">Message details</span>
199
+ <span className="text-2xs text-fg-subtle">
200
+ the drawer's own close
201
+ </span>
202
+ </header>
203
+ <div className="min-h-0 flex-1 overflow-y-auto">{children}</div>
204
+ </aside>
205
+ </div>
206
+ );
207
+ }
208
+
209
+ const KICKOFF = "Invitation: Billing migration kickoff — Thu 11 Jun, 14:00";
210
+ const THURSDAY = "Can we meet Thursday?";
211
+ const FLIGHT = "Your booking is confirmed — KL1693 Amsterdam to Lisbon";
212
+ const PLAIN = "Re: Reading pane density — a vote for calmer";
213
+
214
+ function rail(
215
+ subject: string,
216
+ sender: IntelligenceData,
217
+ calendar: IntelligenceCalendarData,
218
+ initialTab: IntelligenceTabId = "calendar",
219
+ ): Story {
220
+ return {
221
+ render: () => (
222
+ <RailHost subject={subject}>
223
+ <PanelDemo
224
+ sender={sender}
225
+ calendar={calendar}
226
+ initialTab={initialTab}
227
+ className="h-full"
228
+ />
229
+ </RailHost>
230
+ ),
231
+ };
232
+ }
233
+
234
+ function drawer(
235
+ subject: string,
236
+ sender: IntelligenceData,
237
+ calendar: IntelligenceCalendarData,
238
+ initialTab: IntelligenceTabId = "calendar",
239
+ ): Story {
240
+ return {
241
+ render: () => (
242
+ <DrawerHost subject={subject}>
243
+ <PanelDemo
244
+ sender={sender}
245
+ calendar={calendar}
246
+ initialTab={initialTab}
247
+ hideCloseButton
248
+ touch
249
+ className="h-full w-full border-l-0"
250
+ />
251
+ </DrawerHost>
252
+ ),
253
+ };
254
+ }
255
+
256
+ /* ------------------------------------------------------------------ */
257
+ /* The states the review is about, in the rail */
258
+ /* ------------------------------------------------------------------ */
259
+
260
+ /**
261
+ * An invitation, and the thing every mail client leaves out. The clash is with
262
+ * a dentist appointment on the personal account: two calendars, two accounts,
263
+ * one afternoon, and it is stated above the button rather than discovered
264
+ * after. The button reads "Add to calendar" because that is all pressing it
265
+ * does — Priya learns nothing from it, and the card says so.
266
+ */
267
+ export const InviteWithAClash = rail(KICKOFF, organiserSender, inviteWithClash);
268
+
269
+ /**
270
+ * The same invitation an hour later. Nothing is booked over it, and the panel
271
+ * says that too — silence there would read as "not checked", which is the same
272
+ * as not knowing.
273
+ */
274
+ export const InviteWithNothingBooked = rail(
275
+ KICKOFF,
276
+ organiserSender,
277
+ inviteWithoutClash,
278
+ );
279
+
280
+ /**
281
+ * A later message carried a higher SEQUENCE for the same UID. The stale one is
282
+ * dimmed and its buttons are gone: answering a revision that has been replaced
283
+ * puts the wrong hour on the calendar, so the card offers the newer one instead
284
+ * of an answer.
285
+ */
286
+ export const SupersededInvitation = rail(
287
+ KICKOFF,
288
+ organiserSender,
289
+ supersededInvite,
290
+ );
291
+
292
+ /**
293
+ * METHOD:CANCEL on something already accepted. Reader does not take it off by
294
+ * itself: nothing leaves the calendar without a person saying so, for the same
295
+ * reason nothing reaches it that way. Until then the event is still there and
296
+ * the card says why.
297
+ */
298
+ export const CancellationAwaitingYou = rail(
299
+ KICKOFF,
300
+ organiserSender,
301
+ cancelledInvite,
302
+ );
303
+
304
+ /**
305
+ * A flight confirmation, read out of a machine-readable booking block rather
306
+ * than an attached invitation. The airline printed 20:25 for the arrival and
307
+ * never said whose clock; Lisbon runs an hour behind. Add stays refused until
308
+ * someone picks one, because booking the wrong hour is worse than asking.
309
+ */
310
+ export const FlightConfirmation = rail(
311
+ FLIGHT,
312
+ airlineSender,
313
+ flightConfirmation,
314
+ );
315
+
316
+ /**
317
+ * "Can we do Thursday?" — three hours named in prose, each checked against the
318
+ * day. Two are already booked and that is readable without leaving the message.
319
+ * The half-hours under them go into the reply as plain text; ticking one books
320
+ * nothing.
321
+ */
322
+ export const ProseTimeThread = rail(THURSDAY, organiserSender, proseTimeThread);
323
+
324
+ /**
325
+ * A message with no time in it. The tab is still there — it is part of the
326
+ * panel, not something that appears and disappears — and it says plainly that
327
+ * there is nothing to decide rather than showing an empty frame.
328
+ */
329
+ export const EmptyCalendarTab = rail(PLAIN, organiserSender, nothingAboutTime);
330
+
331
+ /**
332
+ * The Sender tab, unchanged. Every section that was in the panel before is
333
+ * where it was; the strip above it is the only thing that is new.
334
+ */
335
+ export const SenderTabUnchanged = rail(
336
+ KICKOFF,
337
+ organiserSender,
338
+ inviteWithClash,
339
+ "sender",
340
+ );
341
+
342
+ /* ------------------------------------------------------------------ */
343
+ /* The same states in the drawer, which every layout under 1280 opens */
344
+ /* ------------------------------------------------------------------ */
345
+
346
+ /** The clash check in the drawer. Same panel, same tabs, larger hit targets. */
347
+ export const DrawerInviteWithAClash = drawer(
348
+ KICKOFF,
349
+ organiserSender,
350
+ inviteWithClash,
351
+ );
352
+
353
+ /** Nothing booked, in the drawer. */
354
+ export const DrawerInviteWithNothingBooked = drawer(
355
+ KICKOFF,
356
+ organiserSender,
357
+ inviteWithoutClash,
358
+ );
359
+
360
+ /** The superseded revision, in the drawer. */
361
+ export const DrawerSupersededInvitation = drawer(
362
+ KICKOFF,
363
+ organiserSender,
364
+ supersededInvite,
365
+ );
366
+
367
+ /** The cancellation still waiting on the reader, in the drawer. */
368
+ export const DrawerCancellationAwaitingYou = drawer(
369
+ KICKOFF,
370
+ organiserSender,
371
+ cancelledInvite,
372
+ );
373
+
374
+ /** The flight and its unsettled clock, in the drawer. */
375
+ export const DrawerFlightConfirmation = drawer(
376
+ FLIGHT,
377
+ airlineSender,
378
+ flightConfirmation,
379
+ );
380
+
381
+ /** The hours named in prose, in the drawer. */
382
+ export const DrawerProseTimeThread = drawer(
383
+ THURSDAY,
384
+ organiserSender,
385
+ proseTimeThread,
386
+ );
387
+
388
+ /** Nothing about a time, in the drawer. */
389
+ export const DrawerEmptyCalendarTab = drawer(
390
+ PLAIN,
391
+ organiserSender,
392
+ nothingAboutTime,
393
+ );
394
+
395
+ /** The Sender tab in the drawer, unchanged from what it was before the strip. */
396
+ export const DrawerSenderTabUnchanged = drawer(
397
+ KICKOFF,
398
+ organiserSender,
399
+ inviteWithClash,
400
+ "sender",
401
+ );