@remit/ui 0.0.224 → 0.0.226
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/dist/components/app-shell-slotted.js +1 -1
- package/dist/components/app-switcher.d.ts +15 -0
- package/dist/components/app-switcher.js +31 -0
- package/dist/components/calendar-event-popup.d.ts +43 -0
- package/dist/components/calendar-event-popup.js +18 -0
- package/dist/components/calendar-event-sidebar.d.ts +45 -0
- package/dist/components/calendar-event-sidebar.js +19 -0
- package/dist/components/calendar-grid.d.ts +11 -7
- package/dist/components/calendar-grid.js +55 -109
- package/dist/components/calendar-guests.d.ts +80 -0
- package/dist/components/calendar-guests.js +102 -0
- package/dist/components/calendar-popover.d.ts +25 -0
- package/dist/components/calendar-popover.js +84 -0
- package/dist/components/calendar-quick-create.d.ts +53 -0
- package/dist/components/calendar-quick-create.js +43 -0
- package/dist/components/calendar-screen-toolbar.d.ts +30 -0
- package/dist/components/calendar-screen-toolbar.js +24 -0
- package/dist/components/calendar-sheet.d.ts +14 -0
- package/dist/components/calendar-sheet.js +34 -0
- package/dist/components/calendar-side-pane.d.ts +20 -0
- package/dist/components/calendar-side-pane.js +11 -0
- package/dist/components/calendar-suggestion-list.d.ts +11 -0
- package/dist/components/calendar-suggestion-list.js +9 -0
- package/dist/components/calendar-task-popup.d.ts +28 -0
- package/dist/components/calendar-task-popup.js +17 -0
- package/dist/components/calendar-time-grid.d.ts +70 -0
- package/dist/components/calendar-time-grid.js +701 -0
- package/dist/components/calendar-toolbar.d.ts +0 -31
- package/dist/components/calendar-toolbar.js +0 -27
- package/dist/components/calendar-types.d.ts +12 -2
- package/dist/components/calendar-types.js +0 -5
- package/dist/components/calendar-year.d.ts +11 -0
- package/dist/components/calendar-year.js +9 -0
- package/dist/components/compose-fab.js +3 -1
- package/dist/components/event-editor.js +2 -1
- package/dist/components/intelligence-calendar.d.ts +1 -1
- package/dist/components/intelligence-calendar.js +10 -16
- package/dist/components/mini-month.d.ts +19 -0
- package/dist/components/mini-month.js +34 -0
- package/dist/components/recurrence-scope-prompt.d.ts +3 -1
- package/dist/components/recurrence-scope-prompt.js +4 -2
- package/dist/index.d.ts +24 -5
- package/dist/index.js +23 -4
- package/dist/lib/calendar-range.d.ts +10 -0
- package/dist/lib/calendar-range.js +39 -0
- package/dist/lib/calendar-slot-pick.d.ts +29 -0
- package/dist/lib/calendar-slot-pick.js +67 -0
- package/dist/lib/event-drag.d.ts +20 -0
- package/dist/lib/event-drag.js +50 -0
- package/dist/lib/grid-keyboard.d.ts +15 -0
- package/dist/lib/grid-keyboard.js +46 -0
- package/dist/lib/guest-list.d.ts +17 -0
- package/dist/lib/guest-list.js +34 -0
- package/dist/lib/iso-week.d.ts +2 -0
- package/dist/lib/iso-week.js +13 -0
- package/dist/lib/long-press.d.ts +25 -0
- package/dist/lib/long-press.js +37 -0
- package/dist/lib/mini-month.d.ts +27 -0
- package/dist/lib/mini-month.js +33 -0
- package/dist/lib/popup-placement.d.ts +22 -0
- package/dist/lib/popup-placement.js +39 -0
- package/dist/lib/time-grid-layout.d.ts +38 -0
- package/dist/lib/time-grid-layout.js +94 -0
- package/package.json +1 -1
- package/dist/components/calendar-suggestion-deck.d.ts +0 -18
- package/dist/components/calendar-suggestion-deck.js +0 -51
- package/dist/components/event-detail.d.ts +0 -38
- package/dist/components/event-detail.js +0 -21
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Sparkles } from "lucide-react";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { cn } from "../lib/cn.js";
|
|
5
|
-
/**
|
|
6
|
-
* Readings one at a time, as a deck rather than a column: one decision fills
|
|
7
|
-
* the width it is given, and the swipe is the fast path over the buttons that
|
|
8
|
-
* are always there under it. A gesture is never the only way to answer.
|
|
9
|
-
*/
|
|
10
|
-
const COMMIT_DISTANCE = 96;
|
|
11
|
-
const DRAG_SLOP = 6;
|
|
12
|
-
export function CalendarSuggestionDeck({ children, hasCard, onConfirm, onReject, blocked, blockedReason, remaining, confirmLabel = "Add", emptyText = "Nothing in your mail is waiting on a decision about time.", className, }) {
|
|
13
|
-
const [drag, setDrag] = useState(0);
|
|
14
|
-
const [from, setFrom] = useState(null);
|
|
15
|
-
if (!hasCard)
|
|
16
|
-
return (_jsxs("div", { className: cn("flex flex-col items-center gap-2 p-6 text-center", className), children: [_jsx(Sparkles, { className: "size-6 text-fg-subtle", "aria-hidden": true }), _jsx("p", { className: "text-sm text-fg-muted", children: emptyText })] }));
|
|
17
|
-
const committing = Math.abs(drag) > COMMIT_DISTANCE;
|
|
18
|
-
const towardsConfirm = drag > 0;
|
|
19
|
-
return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "touch-pan-y select-none", style: {
|
|
20
|
-
transform: `translateX(${drag}px) rotate(${drag / 40}deg)`,
|
|
21
|
-
transition: from === null ? "transform 180ms ease-out" : "none",
|
|
22
|
-
}, onPointerDown: (e) => {
|
|
23
|
-
setFrom(e.clientX);
|
|
24
|
-
}, onPointerMove: (e) => {
|
|
25
|
-
if (from === null)
|
|
26
|
-
return;
|
|
27
|
-
const moved = e.clientX - from;
|
|
28
|
-
if (Math.abs(moved) > DRAG_SLOP &&
|
|
29
|
-
!e.currentTarget.hasPointerCapture(e.pointerId))
|
|
30
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
31
|
-
setDrag(moved);
|
|
32
|
-
}, onPointerUp: () => {
|
|
33
|
-
if (Math.abs(drag) > COMMIT_DISTANCE) {
|
|
34
|
-
if (drag > 0 && !blocked)
|
|
35
|
-
onConfirm();
|
|
36
|
-
if (drag < 0)
|
|
37
|
-
onReject();
|
|
38
|
-
}
|
|
39
|
-
setFrom(null);
|
|
40
|
-
setDrag(0);
|
|
41
|
-
}, onPointerCancel: () => {
|
|
42
|
-
setFrom(null);
|
|
43
|
-
setDrag(0);
|
|
44
|
-
}, children: children }), committing && (_jsx("span", { className: cn("pointer-events-none absolute top-3 rounded-md px-2 py-1 text-xs font-semibold", towardsConfirm
|
|
45
|
-
? "right-3 bg-accent-soft text-accent"
|
|
46
|
-
: "left-3 bg-danger-soft text-danger"), children: towardsConfirm
|
|
47
|
-
? blocked
|
|
48
|
-
? blockedReason
|
|
49
|
-
: confirmLabel
|
|
50
|
-
: "Not this" }))] }), _jsxs("p", { className: "text-center text-2xs text-fg-subtle", children: [remaining, " left \u00B7 swipe right to accept, left to drop, or use the buttons"] })] }));
|
|
51
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { CalendarAttendee, CalendarDescriptor, CalendarEventData } from "./calendar-types.js";
|
|
2
|
-
export interface EventDetailProps {
|
|
3
|
-
event: CalendarEventData;
|
|
4
|
-
calendar: CalendarDescriptor;
|
|
5
|
-
/** Already formatted by the caller — the component owns no clock. */
|
|
6
|
-
whenText: string;
|
|
7
|
-
/**
|
|
8
|
-
* Absent where the surface cannot write yet. A control that leads nowhere is
|
|
9
|
-
* worse than no control, so the header renders each one only when it has
|
|
10
|
-
* somewhere to go.
|
|
11
|
-
*/
|
|
12
|
-
onEdit?: () => void;
|
|
13
|
-
onDelete?: () => void;
|
|
14
|
-
/** Absent when the event was never born from a mail. */
|
|
15
|
-
onOpenThread?: () => void;
|
|
16
|
-
/** Puts the pane back to whatever it shows with nothing selected. */
|
|
17
|
-
onClose?: () => void;
|
|
18
|
-
/** The guest whose context is open. Empty for none. */
|
|
19
|
-
activeAttendee?: string;
|
|
20
|
-
/** Called with a guest to open and with "" to close. Absent leaves the list inert. */
|
|
21
|
-
onActivateAttendee?: (email: string) => void;
|
|
22
|
-
/** Rendered under the open guest. The kit knows nothing about mail. */
|
|
23
|
-
renderAttendeeContext?: (attendee: CalendarAttendee) => React.ReactNode;
|
|
24
|
-
/** A thumb needs a bigger row than a pointer does. */
|
|
25
|
-
touch?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* `bare` drops the header and the scrolling frame, for a surface that already
|
|
28
|
-
* carries both — a full-screen flow whose footer holds the same actions.
|
|
29
|
-
*/
|
|
30
|
-
chrome?: "header" | "bare";
|
|
31
|
-
className?: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* One event, opened. The link back to the mail it came from is part of the
|
|
35
|
-
* event rather than a footnote: an event with a thread behind it is never a
|
|
36
|
-
* dead end, and the way back is one click from the detail you are reading.
|
|
37
|
-
*/
|
|
38
|
-
export declare function EventDetail({ event, calendar, whenText, onEdit, onDelete, onOpenThread, onClose, activeAttendee, onActivateAttendee, renderAttendeeContext, touch, chrome, className, }: EventDetailProps): import("react").JSX.Element;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Clock, Globe, Mail, MapPin, Pencil, Repeat, Trash2, X, } from "lucide-react";
|
|
3
|
-
import { calendarColorClasses } from "../lib/calendar-color.js";
|
|
4
|
-
import { cn } from "../lib/cn.js";
|
|
5
|
-
import { AttendeeList, RsvpBadge } from "./attendee-row.js";
|
|
6
|
-
import { Button } from "./button.js";
|
|
7
|
-
function Line({ icon, children, }) {
|
|
8
|
-
return (_jsxs("div", { className: "flex items-start gap-2.5 py-1", children: [_jsx("span", { className: "mt-0.5 shrink-0 text-fg-subtle", children: icon }), _jsx("div", { className: "min-w-0 flex-1 text-sm text-fg", children: children })] }));
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* One event, opened. The link back to the mail it came from is part of the
|
|
12
|
-
* event rather than a footnote: an event with a thread behind it is never a
|
|
13
|
-
* dead end, and the way back is one click from the detail you are reading.
|
|
14
|
-
*/
|
|
15
|
-
export function EventDetail({ event, calendar, whenText, onEdit, onDelete, onOpenThread, onClose, activeAttendee = "", onActivateAttendee, renderAttendeeContext, touch = false, chrome = "header", className, }) {
|
|
16
|
-
const hue = calendarColorClasses(calendar.color);
|
|
17
|
-
const facts = (_jsxs(_Fragment, { children: [_jsx("h1", { className: "text-xl font-semibold text-fg", children: event.title }), _jsxs("div", { className: "mt-3 flex flex-col border-b border-line pb-3", children: [_jsx(Line, { icon: _jsx(Clock, { className: "size-4" }), children: _jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [whenText, event.attendees.length > 0 && _jsx(RsvpBadge, { rsvp: event.myRsvp })] }) }), event.zoneCertainty === "ambiguous" ? (_jsx(Line, { icon: _jsx(Globe, { className: "size-4 text-warning" }), children: _jsx("span", { className: "text-warning", children: "The mail said a time but never a zone. Shown in your own; confirm before you travel for it." }) })) : (event.timeZone !== "" && (_jsx(Line, { icon: _jsx(Globe, { className: "size-4" }), children: event.timeZone }))), event.recurrenceRule !== "" && (_jsx(Line, { icon: _jsx(Repeat, { className: "size-4" }), children: _jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [event.recurrenceRule, event.seriesException && (_jsx("span", { className: "rounded-xs bg-warning-soft px-1.5 py-0.5 text-2xs text-warning", children: "Moved out of the series" }))] }) })), event.location !== "" && (_jsx(Line, { icon: _jsx(MapPin, { className: "size-4" }), children: event.location }))] }), event.threadId !== "" && onOpenThread && (_jsxs("button", { type: "button", onClick: onOpenThread, className: "mt-3 flex w-full items-center gap-2.5 rounded-md border border-line bg-surface-sunken px-3 py-2 text-left outline-none hover:border-line-strong focus-visible:ring-2 focus-visible:ring-ring", children: [_jsx(Mail, { className: "size-4 shrink-0 text-accent-2" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block text-2xs uppercase tracking-wider text-fg-subtle", children: "From this thread" }), _jsx("span", { className: "block truncate text-sm text-fg", children: event.threadSubject })] })] })), event.attendees.length > 0 && (_jsx(AttendeeList, { attendees: event.attendees, activeEmail: activeAttendee, onActivate: onActivateAttendee, renderContext: renderAttendeeContext, touch: touch, className: "mt-3" })), event.notes !== "" && (_jsx("p", { className: "mt-3 whitespace-pre-wrap text-sm text-fg-muted", children: event.notes }))] }));
|
|
18
|
-
if (chrome === "bare")
|
|
19
|
-
return _jsx("div", { className: cn("flex flex-col", className), children: facts });
|
|
20
|
-
return (_jsxs("article", { className: cn("flex h-full w-full flex-col bg-surface", className), children: [_jsxs("header", { className: "flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset", children: [_jsx("span", { className: cn("size-2.5 shrink-0 rounded-full", hue.solid) }), _jsxs("span", { className: "min-w-0 flex-1 truncate text-xs text-fg-muted", children: [calendar.name, " \u00B7 ", calendar.accountLabel] }), onEdit && (_jsx(Button, { variant: "ghost", size: "sm", icon: _jsx(Pencil, { className: "size-3.5" }), onClick: onEdit, children: "Edit" })), onDelete && (_jsx(Button, { variant: "ghost", size: "sm", icon: _jsx(Trash2, { className: "size-3.5" }), onClick: onDelete, className: "text-danger", children: "Delete" })), onClose && (_jsx("button", { type: "button", "aria-label": "Close event", onClick: onClose, className: "flex size-7 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(X, { className: "size-4" }) }))] }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-row-inset py-3", children: facts })] }));
|
|
21
|
-
}
|