From 7f3975e38b33e17b4dc2d2c3bbbe4cb72068cf99 Mon Sep 17 00:00:00 2001 From: pasqualevitiello Date: Fri, 20 Nov 2026 18:07:29 +0100 Subject: [PATCH 01/53] docs(agents): add agent skills configuration Point agent skills at where this repo keeps issues, triage labels and domain docs. Co-Authored-By: Claude Fable 5.2 --- AGENTS.md | 14 ++++++++++ docs/agents/domain.md | 51 ++++++++++++++++++++++++++++++++++++ docs/agents/issue-tracker.md | 30 +++++++++++++++++++++ docs/agents/triage-labels.md | 15 +++++++++++ 4 files changed, 110 insertions(+) create mode 100644 docs/agents/domain.md create mode 100644 docs/agents/issue-tracker.md create mode 100644 docs/agents/triage-labels.md diff --git a/AGENTS.md b/AGENTS.md index 2bf3378a6..20a474b85 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,3 +11,17 @@ The comprehensive agent guidelines for this repository are located in: ## Typography Set type per the [Cal Sans font guide](packages/ui/src/fonts/font-guide.md): no added letter-spacing, `font-optical-sizing: auto` instead of a hard-coded `opsz`, one `GEOM` value per role, no synthesized bold or italic, and typeset punctuation (’ – − “ ”) in UI strings. + +## Agent skills + +### Issue tracker + +Issues and specs live as markdown files under `.scratch//`. See `docs/agents/issue-tracker.md`. + +### Triage labels + +The five default triage roles, recorded as a `Status:` line in each issue file. See `docs/agents/triage-labels.md`. + +### Domain docs + +Single-context: one `GLOSSARY.md` and `docs/adr/` at the repo root. See `docs/agents/domain.md`. diff --git a/docs/agents/domain.md b/docs/agents/domain.md new file mode 100644 index 000000000..4032de016 --- /dev/null +++ b/docs/agents/domain.md @@ -0,0 +1,51 @@ +# Domain Docs + +How the engineering skills should consume this repo's domain documentation when exploring the codebase. + +## Before exploring, read these + +- **`GLOSSARY.md`** at the repo root, or +- **`GLOSSARY-MAP.md`** at the repo root if it exists: it points at one `GLOSSARY.md` per context. Read each one relevant to the topic. +- **`docs/adr/`**: read ADRs that touch the area you're about to work in. In multi-context repos, also check `src//docs/adr/` for context-scoped decisions. + +If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved. + +## File structure + +Single-context repo (most repos): + +``` +/ +├── GLOSSARY.md +├── docs/adr/ +│ ├── 0001-event-sourced-orders.md +│ └── 0002-postgres-for-write-model.md +└── src/ +``` + +Multi-context repo (presence of `GLOSSARY-MAP.md` at the root): + +``` +/ +├── GLOSSARY-MAP.md +├── docs/adr/ ← system-wide decisions +└── src/ + ├── ordering/ + │ ├── GLOSSARY.md + │ └── docs/adr/ ← context-specific decisions + └── billing/ + ├── GLOSSARY.md + └── docs/adr/ +``` + +## Use the glossary's vocabulary + +When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `GLOSSARY.md`. Don't drift to synonyms the glossary explicitly avoids. + +If the concept you need isn't in the glossary yet, that's a signal: either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`). + +## Flag ADR conflicts + +If your output contradicts an existing ADR, surface it explicitly rather than silently overriding: + +> _Contradicts ADR-0007 (event-sourced orders), but worth reopening because…_ diff --git a/docs/agents/issue-tracker.md b/docs/agents/issue-tracker.md new file mode 100644 index 000000000..0209a19af --- /dev/null +++ b/docs/agents/issue-tracker.md @@ -0,0 +1,30 @@ +# Issue tracker: Local Markdown + +Issues and specs for this repo live as markdown files in `.scratch/`. + +## Conventions + +- One feature per directory: `.scratch//` +- The spec is `.scratch//spec.md` +- Implementation issues are one file per ticket at `.scratch//issues/-.md`, numbered from `01`, never a single combined tickets file +- Triage state is recorded as a `Status:` line near the top of each issue file (see `triage-labels.md` for the role strings) +- Comments and conversation history append to the bottom of the file under a `## Comments` heading + +## When a skill says "publish to the issue tracker" + +Create a new file under `.scratch//` (creating the directory if needed). + +## When a skill says "fetch the relevant ticket" + +Read the file at the referenced path. The user will normally pass the path or the issue number directly. + +## Wayfinding operations + +Used by `/wayfinder`. The **map** is a file with one **child** file per ticket. + +- **Map**: `.scratch//map.md` (the Notes / Decisions-so-far / Fog body). +- **Child ticket**: `.scratch//issues/NN-.md`, numbered from `01`, with the question in the body. A `Type:` line records the ticket type (`research`/`prototype`/`grilling`/`task`); a `Status:` line records `claimed`/`resolved`. +- **Blocking**: a `Blocked by: NN, NN` line near the top. A ticket is unblocked when every file it lists is `resolved`. +- **Frontier**: scan `.scratch//issues/` for files that are open, unblocked, and unclaimed; first by number wins. +- **Claim**: set `Status: claimed` and save before any work. +- **Resolve**: append the answer under an `## Answer` heading, set `Status: resolved`, then append a context pointer (gist + link) to the map's Decisions-so-far in `map.md`. diff --git a/docs/agents/triage-labels.md b/docs/agents/triage-labels.md new file mode 100644 index 000000000..527646424 --- /dev/null +++ b/docs/agents/triage-labels.md @@ -0,0 +1,15 @@ +# Triage Labels + +The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker. + +| Label in mattpocock/skills | Label in our tracker | Meaning | +| -------------------------- | -------------------- | ---------------------------------------- | +| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue | +| `needs-info` | `needs-info` | Waiting on reporter for more information | +| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent | +| `ready-for-human` | `ready-for-human` | Requires human implementation | +| `wontfix` | `wontfix` | Will not be actioned | + +When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table. + +Edit the "Label in our tracker" column to match whatever vocabulary you actually use. From 54fc641a339a9b6932fda6e0afd8b3647654ff75 Mon Sep 17 00:00:00 2001 From: pasqualevitiello Date: Fri, 20 Nov 2026 18:07:30 +0100 Subject: [PATCH 02/53] docs: add glossary and the booker data-layer decision record Define atom, particle, Booker, event type, attendee, guest and fallback, and record why the Booker calls the Cal API from the browser. Co-Authored-By: Claude Fable 5.2 --- GLOSSARY.md | 33 +++++++++++++++++++ ...oker-calls-the-cal-api-from-the-browser.md | 13 ++++++++ 2 files changed, 46 insertions(+) create mode 100644 GLOSSARY.md create mode 100644 docs/adr/0001-booker-calls-the-cal-api-from-the-browser.md diff --git a/GLOSSARY.md b/GLOSSARY.md new file mode 100644 index 000000000..fd79981fa --- /dev/null +++ b/GLOSSARY.md @@ -0,0 +1,33 @@ +# coss ui + +A registry of copy-paste React components installed with the shadcn CLI. This glossary fixes the words used for the kinds of thing the registry ships. + +## Language + +**Atom**: +A registry item that connects coss ui components to the Cal.com API, so it works against real scheduling data once installed. +_Avoid_: Cal atom, widget, block, embed + +**Booker**: +The atom that lets someone pick a time and book a Cal.com event. +_Avoid_: Booking widget, scheduler, calendar embed + +**Event type**: +What an attendee books: a kind of meeting a host offers on Cal.com, with its own title, duration, locations and rules. +_Avoid_: Event, target, meeting type, booking link + +**Attendee**: +The person booking an event through the Booker. +_Avoid_: Booker (for the person), visitor, user, customer + +**Guest**: +A person the attendee adds to their booking. +_Avoid_: Additional attendee, invitee + +**Fallback**: +What the Booker shows in place of the booking flow when an event cannot be booked through it: a short message and a link to the event's own Cal.com booking page. +_Avoid_: Error state, unsupported screen + +**Particle**: +A pre-assembled registry item that combines several primitives into a ready-to-use piece of interface, with no connection to an outside service. +_Avoid_: Block, pattern, atom diff --git a/docs/adr/0001-booker-calls-the-cal-api-from-the-browser.md b/docs/adr/0001-booker-calls-the-cal-api-from-the-browser.md new file mode 100644 index 000000000..33f435440 --- /dev/null +++ b/docs/adr/0001-booker-calls-the-cal-api-from-the-browser.md @@ -0,0 +1,13 @@ +# The Booker calls the Cal API from the browser + +The Booker atom fetches event types and slots and creates bookings directly from the visitor's browser, with plain `fetch` behind one `BookerClient` interface, and ships no API key handling and no server code. We chose this because every endpoint in the booking flow accepts anonymous requests and the API allows any origin, so there is no secret to protect; the atom then installs with no setup in any React framework, and each visitor is rate-limited on their own instead of all of a site's visitors sharing the server's budget. + +## Considered options + +- **Server actions with a mandatory API key**, as the first version of the Booker did. Rejected: it ties the atom to Next.js, requires environment setup before anything renders, and puts every visitor on one shared rate limit. +- **A route handler the integrator adds as a proxy.** Rejected as the default for the same setup cost. It remains possible for an integrator who wants a key, by supplying their own `BookerClient`. + +## Consequences + +- The atom may only use endpoints that work anonymously. Anything that needs authentication, such as fetching an event type by id or the calendar-links endpoint, is unavailable to it. +- The Cal API version header is sent from the client on every request, so a version change is a change to the installed code, not to a server setting. From 89648734b5518f2a974361d515e4802b8f3d933d Mon Sep 17 00:00:00 2001 From: pasqualevitiello Date: Fri, 20 Nov 2026 18:07:40 +0100 Subject: [PATCH 03/53] feat(booker): carry over the booker atom work in progress Copy the booker atom from devin/1783358765-booker-motion onto this branch as the starting point for v1. The old data layer is unchanged apart from making CAL_API_KEY optional; it is due to be replaced. - registry/default/atoms: the Booker, its parts, hook, actions, helpers - registry/default/lib/cal-api: the API client - app/playground/booker: temporary demo page, accepts ?bookingUrl= - add isomorphic-dompurify and marked, and keep isomorphic-dompurify out of the server bundle, where its jsdom dependency breaks - path aliases for the old @/lib/booker and @/lib/cal-api imports Not carried over: the /atoms pages and the registry item declaration. Co-Authored-By: Claude Fable 5.2 --- apps/ui/app/playground/booker/page.tsx | 50 + apps/ui/next.config.ts | 3 + apps/ui/package.json | 2 + apps/ui/registry/default/atoms/booker-1.tsx | 243 +++ .../default/atoms/booker/booker-avatars.tsx | 92 ++ .../default/atoms/booker/booker-calendar.tsx | 894 +++++++++++ .../atoms/booker/booker-confirm-form.tsx | 280 ++++ .../atoms/booker/booker-error-state.tsx | 71 + .../default/atoms/booker/booker-labels.ts | 86 ++ .../default/atoms/booker/booker-steps.tsx | 122 ++ .../default/atoms/booker/duration-picker.tsx | 64 + .../atoms/booker/event-description.tsx | 67 + .../default/atoms/booker/header-banner.tsx | 22 + .../default/atoms/booker/location.tsx | 242 +++ .../default/atoms/booker/time-picker.tsx | 186 +++ .../default/atoms/booker/timezone-picker.tsx | 145 ++ .../default/atoms/lib/booker/actions.ts | 623 ++++++++ .../atoms/lib/booker/booking-location.ts | 32 + .../default/atoms/lib/booker/target.ts | 338 +++++ .../default/atoms/lib/booker/use-booker.ts | 1072 +++++++++++++ .../default/atoms/lib/booker/utils.ts | 1326 +++++++++++++++++ .../registry/default/lib/cal-api/bookings.ts | 13 + .../ui/registry/default/lib/cal-api/client.ts | 149 ++ apps/ui/registry/default/lib/cal-api/env.ts | 12 + .../default/lib/cal-api/event-types.ts | 111 ++ .../default/lib/cal-api/public-event.ts | 127 ++ apps/ui/registry/default/lib/cal-api/slots.ts | 46 + apps/ui/registry/default/lib/cal-api/types.ts | 147 ++ apps/ui/tsconfig.json | 2 + bun.lock | 78 +- 30 files changed, 6643 insertions(+), 2 deletions(-) create mode 100644 apps/ui/app/playground/booker/page.tsx create mode 100644 apps/ui/registry/default/atoms/booker-1.tsx create mode 100644 apps/ui/registry/default/atoms/booker/booker-avatars.tsx create mode 100644 apps/ui/registry/default/atoms/booker/booker-calendar.tsx create mode 100644 apps/ui/registry/default/atoms/booker/booker-confirm-form.tsx create mode 100644 apps/ui/registry/default/atoms/booker/booker-error-state.tsx create mode 100644 apps/ui/registry/default/atoms/booker/booker-labels.ts create mode 100644 apps/ui/registry/default/atoms/booker/booker-steps.tsx create mode 100644 apps/ui/registry/default/atoms/booker/duration-picker.tsx create mode 100644 apps/ui/registry/default/atoms/booker/event-description.tsx create mode 100644 apps/ui/registry/default/atoms/booker/header-banner.tsx create mode 100644 apps/ui/registry/default/atoms/booker/location.tsx create mode 100644 apps/ui/registry/default/atoms/booker/time-picker.tsx create mode 100644 apps/ui/registry/default/atoms/booker/timezone-picker.tsx create mode 100644 apps/ui/registry/default/atoms/lib/booker/actions.ts create mode 100644 apps/ui/registry/default/atoms/lib/booker/booking-location.ts create mode 100644 apps/ui/registry/default/atoms/lib/booker/target.ts create mode 100644 apps/ui/registry/default/atoms/lib/booker/use-booker.ts create mode 100644 apps/ui/registry/default/atoms/lib/booker/utils.ts create mode 100644 apps/ui/registry/default/lib/cal-api/bookings.ts create mode 100644 apps/ui/registry/default/lib/cal-api/client.ts create mode 100644 apps/ui/registry/default/lib/cal-api/env.ts create mode 100644 apps/ui/registry/default/lib/cal-api/event-types.ts create mode 100644 apps/ui/registry/default/lib/cal-api/public-event.ts create mode 100644 apps/ui/registry/default/lib/cal-api/slots.ts create mode 100644 apps/ui/registry/default/lib/cal-api/types.ts diff --git a/apps/ui/app/playground/booker/page.tsx b/apps/ui/app/playground/booker/page.tsx new file mode 100644 index 000000000..956bebeee --- /dev/null +++ b/apps/ui/app/playground/booker/page.tsx @@ -0,0 +1,50 @@ +import type { Metadata } from "next"; +import { Booker } from "@/registry/default/atoms/booker-1"; +import { fetchRawBookerDataAction } from "@/lib/booker/actions"; +import type { BookerTarget } from "@/lib/booker/target"; + +export const metadata: Metadata = { + title: "Booker Playground - coss ui", +}; + +const defaultBookingUrl = "https://i.cal.com/pasquale/15min"; +const timeZone = "Europe/Rome"; + +type BookerPlaygroundPageProps = { + searchParams: Promise<{ bookingUrl?: string | string[] }>; +}; + +// Temporary demo page. Pass `?bookingUrl=` to point the Booker at another +// event, e.g. `?bookingUrl=cal.com/rickastley/15min`. +export default async function BookerPlaygroundPage({ + searchParams, +}: BookerPlaygroundPageProps) { + const { bookingUrl } = await searchParams; + const target = { + bookingUrl: + typeof bookingUrl === "string" && bookingUrl.trim() + ? bookingUrl + : defaultBookingUrl, + type: "link", + } satisfies BookerTarget; + + const initialInput = { + fetchMeta: true, + monthIso: new Date().toISOString(), + monthsToFetch: 3, + target, + timeZone, + }; + const initialData = { + monthIso: initialInput.monthIso, + monthsToFetch: initialInput.monthsToFetch, + result: await fetchRawBookerDataAction(initialInput), + timeZone: initialInput.timeZone, + }; + + return ( +
+ +
+ ); +} diff --git a/apps/ui/next.config.ts b/apps/ui/next.config.ts index cdd60e02d..402ae3ab0 100644 --- a/apps/ui/next.config.ts +++ b/apps/ui/next.config.ts @@ -22,6 +22,9 @@ const nextConfig: NextConfig = { }, ]; }, + // The old booker sanitises event descriptions with isomorphic-dompurify, + // whose jsdom dependency breaks when bundled for the server. + serverExternalPackages: ["isomorphic-dompurify"], transpilePackages: ["@coss/ui"], }; diff --git a/apps/ui/package.json b/apps/ui/package.json index c5163683f..ed15438a4 100644 --- a/apps/ui/package.json +++ b/apps/ui/package.json @@ -12,8 +12,10 @@ "date-fns": "^4.1.0", "fumadocs-core": "^16.0.14", "fumadocs-mdx": "^14.0.3", + "isomorphic-dompurify": "^3.18.0", "jotai": "^2.15.1", "lucide-react": "^0.555.0", + "marked": "^18.0.5", "motion": "14.0.0", "next": "16.4.1", "react": "^19.2.6", diff --git a/apps/ui/registry/default/atoms/booker-1.tsx b/apps/ui/registry/default/atoms/booker-1.tsx new file mode 100644 index 000000000..fe56c9f23 --- /dev/null +++ b/apps/ui/registry/default/atoms/booker-1.tsx @@ -0,0 +1,243 @@ +"use client"; + +import { CalendarIcon, Clock3Icon } from "lucide-react"; +import { cn } from "@/registry/default/lib/utils"; +import { Card } from "@/registry/default/ui/card"; +import { Skeleton } from "@/registry/default/ui/skeleton"; +import { BookerAvatars } from "./booker/booker-avatars"; +import { BookerCalendar } from "./booker/booker-calendar"; +import { BookerConfirmForm } from "./booker/booker-confirm-form"; +import { BookerErrorState } from "./booker/booker-error-state"; +import { type BookerLabels, getBookerLabels } from "./booker/booker-labels"; +import { BookerSteps } from "./booker/booker-steps"; +import { DurationPicker } from "./booker/duration-picker"; +import { EventDescription } from "./booker/event-description"; +import { HeaderBanner } from "./booker/header-banner"; +import { Location } from "./booker/location"; +import { TimePicker } from "./booker/time-picker"; +import { TimezoneDisplay, TimezonePicker } from "./booker/timezone-picker"; +import type { BookerTarget } from "@/lib/booker/target"; +import { type BookerInitialData, useBooker } from "@/lib/booker/use-booker"; +import { + formatConfirmDateDetail, + formatConfirmTimeRange, + formatSelectedWeekday, +} from "@/lib/booker/utils"; + +type BookerProps = { + target: BookerTarget; + timezone?: string; + initialData?: BookerInitialData; + defaultFormValues?: Record; + onCreateBookingSuccess?: (data: unknown) => void; + labels?: Partial; +}; + +export function Booker({ + initialData, + target, + timezone, + labels, + defaultFormValues, + onCreateBookingSuccess, +}: BookerProps) { + const t = getBookerLabels(labels); + const booker = useBooker({ initialData, target, timezone }); + + if (booker.error) { + return ( + + ); + } + + const displayMeta = booker.meta; + const selectedDate = booker.timePickerProps.selectedDate; + const selectedTime = booker.confirmFormProps.selectedTime; + const showSelectedSlot = + booker.step === "confirm" && selectedDate != null && selectedTime != null; + const headerImageAlt = displayMeta + ? t.headerImageAlt(displayMeta.hostName, displayMeta.eventTypeTitle) + : "Booker header"; + + return ( +
+ + {/* Meta */} +
+ +
+
+
+ + {displayMeta ? ( +

+ {displayMeta.hostName} +

+ ) : ( + + )} +
+
+ {displayMeta ? ( + <> +

+ {displayMeta.eventTypeTitle} +

+ + + ) : ( + <> + + + + + )} +
+
+ + {displayMeta ? ( +
+ {showSelectedSlot ? ( +
+
+ ) : null} + {displayMeta.eventTypeDurationOptions ? ( + + ) : ( +
+
+ )} + + {booker.step === "select" ? ( + + ) : ( + + )} +
+ ) : ( +
+ + + +
+ )} +
+
+ + {booker.step === "select" ? ( +
+
+ +
+ +
+ ) : ( +
+ +
+ )} +
+
+ + Cal.com + +
+ ); +} + +export default Booker; diff --git a/apps/ui/registry/default/atoms/booker/booker-avatars.tsx b/apps/ui/registry/default/atoms/booker/booker-avatars.tsx new file mode 100644 index 000000000..95e7d4a56 --- /dev/null +++ b/apps/ui/registry/default/atoms/booker/booker-avatars.tsx @@ -0,0 +1,92 @@ +"use client"; + +import { + Avatar, + AvatarFallback, + AvatarImage, +} from "@/registry/default/ui/avatar"; +import { Skeleton } from "@/registry/default/ui/skeleton"; +import { + Tooltip, + TooltipPopup, + TooltipProvider, + TooltipTrigger, +} from "@/registry/default/ui/tooltip"; +import { type BookerAvatar, getInitials } from "@/lib/booker/utils"; + +type BookerAvatarsProps = { + avatars?: BookerAvatar[]; + fallbackName?: string; +}; + +export function BookerAvatars({ avatars, fallbackName }: BookerAvatarsProps) { + if (!fallbackName) { + return ( + + + + + + ); + } + + if (avatars && avatars.length === 0) { + return null; + } + + const visibleAvatars = + avatars && avatars.length > 0 + ? avatars + : [{ avatarUrl: "", name: fallbackName, profileUrl: "" }]; + const firstAvatar = visibleAvatars[0]; + + if (visibleAvatars.length === 1 && firstAvatar) { + return ( + + + {firstAvatar.avatarUrl ? ( + + ) : null} + {getInitials(firstAvatar.name)} + + + ); + } + + return ( + +
+ {visibleAvatars.map((avatar, index) => ( + + + {avatar.name} + + {avatar.avatarUrl ? ( + + ) : null} + {getInitials(avatar.name)} + + + } + /> + {avatar.name} + + ))} +
+
+ ); +} diff --git a/apps/ui/registry/default/atoms/booker/booker-calendar.tsx b/apps/ui/registry/default/atoms/booker/booker-calendar.tsx new file mode 100644 index 000000000..4f13f16b1 --- /dev/null +++ b/apps/ui/registry/default/atoms/booker/booker-calendar.tsx @@ -0,0 +1,894 @@ +"use client"; + +import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"; +import { + type ComponentProps, + type KeyboardEvent, + type MouseEvent, + type ReactElement, + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from "react"; +import { cn } from "@/registry/default/lib/utils"; +import { Button } from "@/registry/default/ui/button"; +import { Skeleton } from "@/registry/default/ui/skeleton"; +import { + Tooltip, + TooltipCreateHandle, + TooltipPopup, + TooltipProvider, + TooltipTrigger, +} from "@/registry/default/ui/tooltip"; + +// A single shared tooltip reused across every day cell (via the handle/payload +// pattern). Reusing one instance lets it gracefully move/scale between days +// instead of mounting a separate tooltip per cell. +const monthTooltipHandle = TooltipCreateHandle(); + +// Falls back to English (US) when no `locale` prop is provided. +const DEFAULT_LOCALE = "en-US"; + +type CalendarLabels = { + /** ARIA label for the previous-month navigation button. */ + previousMonth: string; + /** ARIA label for the next-month navigation button. */ + nextMonth: string; + /** ARIA label for the navigation toolbar. */ + nav: string; + /** Prefix for today's day button label, e.g. "Today, Monday, …". */ + today: string; + /** Suffix for the selected day button label, e.g. "…, selected". */ + selected: string; +}; + +// English defaults. Localize by passing translated strings via the `labels` +// prop (wire it up to your app's own i18n layer); date/weekday/month names are +// still localized automatically from `locale` via `Intl`. +const DEFAULT_LABELS: CalendarLabels = { + previousMonth: "Go to the Previous Month", + nextMonth: "Go to the Next Month", + nav: "Navigation bar", + today: "Today", + selected: "selected", +}; + +// Resolves the text direction for the locale (e.g. "rtl" for Arabic/Hebrew). +function getTextDirection(locale: string): "ltr" | "rtl" { + try { + const localeObj = new Intl.Locale(locale) as Intl.Locale & { + textInfo?: { direction?: string }; + getTextInfo?: () => { direction?: string }; + }; + const info = + typeof localeObj.getTextInfo === "function" + ? localeObj.getTextInfo() + : localeObj.textInfo; + if (info?.direction === "rtl") { + return "rtl"; + } + } catch { + // Fall through to the ltr default below. + } + return "ltr"; +} + +// Locale-aware formatting/ordering, derived from a BCP-47 locale string. +type Localization = { + weekStartsOn: number; + monthYearLabel: (date: Date) => string; + fullDateLabel: (date: Date) => string; + monthShortLabel: (date: Date) => string; + monthLongLabel: (date: Date) => string; + weekdayLong: (date: Date) => string; + weekdayShort: (date: Date) => string; + dayNumber: (date: Date) => string; + captionFormatter: Intl.DateTimeFormat; +}; + +// 1 = Monday … 7 = Sunday (ISO) → JS getDay() index (0 = Sunday … 6 = Saturday). +function getWeekStartsOn(locale: string): number { + try { + const localeObj = new Intl.Locale(locale) as Intl.Locale & { + weekInfo?: { firstDay?: number }; + getWeekInfo?: () => { firstDay?: number }; + }; + const info = + typeof localeObj.getWeekInfo === "function" + ? localeObj.getWeekInfo() + : localeObj.weekInfo; + const firstDay = info?.firstDay; + if (typeof firstDay === "number") { + return firstDay % 7; + } + } catch { + // Fall through to the Sunday default below. + } + return 0; +} + +function buildLocalization( + locale: string, + weekStartsOnOverride?: number, +): Localization { + const longDateFormatter = new Intl.DateTimeFormat(locale, { + weekday: "long", + year: "numeric", + month: "long", + day: "numeric", + }); + const monthYearFormatter = new Intl.DateTimeFormat(locale, { + month: "long", + year: "numeric", + }); + const monthShortFormatter = new Intl.DateTimeFormat(locale, { + month: "short", + }); + const monthLongFormatter = new Intl.DateTimeFormat(locale, { + month: "long", + }); + const weekdayLongFormatter = new Intl.DateTimeFormat(locale, { + weekday: "long", + }); + const weekdayShortFormatter = new Intl.DateTimeFormat(locale, { + weekday: "short", + }); + const dayFormatter = new Intl.DateTimeFormat(locale, { day: "numeric" }); + + return { + weekStartsOn: weekStartsOnOverride ?? getWeekStartsOn(locale), + monthYearLabel: (date) => monthYearFormatter.format(date), + fullDateLabel: (date) => longDateFormatter.format(date), + monthShortLabel: (date) => monthShortFormatter.format(date), + monthLongLabel: (date) => monthLongFormatter.format(date), + weekdayLong: (date) => weekdayLongFormatter.format(date), + weekdayShort: (date) => weekdayShortFormatter.format(date), + dayNumber: (date) => dayFormatter.format(date), + captionFormatter: monthYearFormatter, + }; +} + +function pad2(value: number): string { + return value < 10 ? `0${value}` : String(value); +} + +function isoDate(date: Date): string { + return `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}`; +} + +function isoMonth(date: Date): string { + return `${date.getFullYear()}-${pad2(date.getMonth() + 1)}`; +} + +function startOfDay(date: Date): Date { + return new Date(date.getFullYear(), date.getMonth(), date.getDate()); +} + +function startOfMonth(date: Date): Date { + return new Date(date.getFullYear(), date.getMonth(), 1); +} + +function endOfMonth(date: Date): Date { + return new Date(date.getFullYear(), date.getMonth() + 1, 0); +} + +function addDays(date: Date, amount: number): Date { + return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount); +} + +function addMonths(date: Date, amount: number): Date { + return new Date(date.getFullYear(), date.getMonth() + amount, date.getDate()); +} + +function startOfWeek(date: Date, weekStartsOn = 0): Date { + const day = startOfDay(date); + const diff = (day.getDay() - weekStartsOn + 7) % 7; + return addDays(day, -diff); +} + +function endOfWeek(date: Date, weekStartsOn = 0): Date { + return addDays(startOfWeek(date, weekStartsOn), 6); +} + +function isSameDay(a: Date, b: Date): boolean { + return ( + a.getFullYear() === b.getFullYear() && + a.getMonth() === b.getMonth() && + a.getDate() === b.getDate() + ); +} + +function isSameMonth(a: Date, b: Date): boolean { + return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth(); +} + +function differenceInCalendarMonths(a: Date, b: Date): number { + return ( + (a.getFullYear() - b.getFullYear()) * 12 + (a.getMonth() - b.getMonth()) + ); +} + +type CalendarDay = { + date: Date; + outside: boolean; + isoDate: string; + dateMonthId: string; +}; + +type DayModifiers = { + focused: boolean; + disabled: boolean; + hidden: boolean; + outside: boolean; + today: boolean; + selected: boolean; +}; + +// Builds the month grid as full weeks covering the month. +// +// `shiftRows` slides the window forward by that many weeks, dropping the +// month's earliest week(s). When `fillToSix` is set the grid is then padded to +// a full 6 rows with days from the next month. Together they keep today's week +// plus the next two visible without exceeding 6 rows; with both at their +// defaults the month spans only the weeks it naturally needs. +function buildCalendarDays( + month: Date, + weekStartsOn: number, + shiftRows: number, + fillToSix: boolean, +): CalendarDay[] { + const monthStart = startOfMonth(month); + const offset = shiftRows * 7; + const gridStart = addDays(startOfWeek(monthStart, weekStartsOn), offset); + const gridEnd = addDays(endOfWeek(endOfMonth(month), weekStartsOn), offset); + + const dates: Date[] = []; + for (let cursor = gridStart; cursor <= gridEnd; cursor = addDays(cursor, 1)) { + dates.push(cursor); + } + + if (fillToSix) { + while (dates.length < 42) { + const lastDate = dates.at(-1); + if (!lastDate) { + break; + } + dates.push(addDays(lastDate, 1)); + } + } + + return dates.map((date) => ({ + date, + outside: !isSameMonth(date, month), + isoDate: isoDate(date), + dateMonthId: isoMonth(date), + })); +} + +function chunkWeeks(days: CalendarDay[]): CalendarDay[][] { + const weeks: CalendarDay[][] = []; + for (let i = 0; i < days.length; i += 7) { + weeks.push(days.slice(i, i + 7)); + } + return weeks; +} + +function isFocusableDay(modifiers: DayModifiers): boolean { + return !modifiers.disabled && !modifiers.hidden && !modifiers.outside; +} + +// A single day cell's button. Focuses itself when it becomes the roving-tabindex +// target so keyboard navigation moves the actual DOM focus. +function DayButton({ + focused, + nextMonthLabel, + tooltip, + children, + ...buttonProps +}: ComponentProps<"button"> & { + focused: boolean; + nextMonthLabel?: string; + tooltip?: string; +}): ReactElement { + const ref = useRef(null); + + useEffect(() => { + if (focused) ref.current?.focus(); + }, [focused]); + + const button = ( + + ); + + if (!tooltip) return button; + + return ( + + ); +} + +// Month + year heading; the year is muted via formatToParts so it stays +// locale-correct (some locales render "2026 June"). +export function MonthCaption({ + date, + formatter, + className, + muteYear = true, +}: { + date: Date; + formatter: Intl.DateTimeFormat; + className?: string; + muteYear?: boolean; +}): ReactElement { + return ( +
+ {formatter.formatToParts(date).map((part) => + part.type === "year" ? ( + + {part.value} + + ) : ( + part.value + ), + )} +
+ ); +} + +type MoveBy = "day" | "week" | "month" | "year" | "startOfWeek" | "endOfWeek"; +type MoveDir = "before" | "after"; + +export type BookerCalendarProps = { + className?: string; + /** + * For the current month, once today reaches the 4th row, keep its week plus + * the next two visible within the 6-row grid: extend into next-month days, + * and slide the window down (dropping early weeks) only when today sits too + * low for those two weeks to fit. Off renders a plain month grid. On by + * default. + */ + shiftWeeks?: boolean; + availabilityLoading?: boolean; + initialLoading?: boolean; + month?: Date; + defaultMonth?: Date; + startMonth?: Date; + endMonth?: Date; + selected?: Date; + onSelect?: (date: Date | undefined, triggerDate: Date) => void; + onMonthChange?: (month: Date) => void; + disabled?: (date: Date) => boolean; + /** BCP-47 locale tag used to localize day/month/weekday names and ARIA labels. */ + locale?: string; + /** Override the locale's first day of the week (0 = Sunday … 6 = Saturday). */ + weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; + /** Text direction; defaults to the locale's direction ("rtl" for ar/he/…). */ + dir?: "ltr" | "rtl"; + /** Translatable strings for the navigation buttons and day button states. */ + labels?: Partial; + /** Reference "today" for highlighting and week shifting; defaults to now. */ + today?: Date; +}; + +export function BookerCalendar({ + className, + shiftWeeks = true, + availabilityLoading = false, + initialLoading = false, + month, + defaultMonth, + startMonth, + endMonth, + selected, + onSelect, + onMonthChange, + disabled, + locale = DEFAULT_LOCALE, + weekStartsOn, + dir, + labels, + today: todayProp, +}: BookerCalendarProps): ReactElement { + const dayCellsLoading = initialLoading || availabilityLoading; + const localization = useMemo( + () => buildLocalization(locale, weekStartsOn), + [locale, weekStartsOn], + ); + const resolvedLabels = { ...DEFAULT_LABELS, ...labels }; + const resolvedDir = dir ?? getTextDirection(locale); + const weekStart = localization.weekStartsOn; + + const today = todayProp ?? new Date(); + + // The month is controlled by the parent (via `month`/`onMonthChange`), but we + // keep an internal fallback so the calendar works uncontrolled too. + const [internalMonth, setInternalMonth] = useState(() => + startOfMonth(month ?? defaultMonth ?? today), + ); + const monthTime = month ? startOfMonth(month).getTime() : undefined; + useEffect(() => { + if (monthTime !== undefined) { + setInternalMonth(new Date(monthTime)); + } + }, [monthTime]); + + const firstMonth = month ? startOfMonth(month) : internalMonth; + + const [focusedDate, setFocusedDate] = useState(undefined); + const [lastFocusedDate, setLastFocusedDate] = useState( + undefined, + ); + + const navStart = startMonth ? startOfMonth(startMonth) : undefined; + const navEnd = endMonth ? startOfMonth(endMonth) : undefined; + + const previousMonth = + navStart && differenceInCalendarMonths(firstMonth, navStart) <= 0 + ? undefined + : addMonths(firstMonth, -1); + const nextMonth = + navEnd && differenceInCalendarMonths(navEnd, firstMonth) <= 0 + ? undefined + : addMonths(firstMonth, 1); + + const goToMonth = useCallback( + (date: Date) => { + let newMonth = startOfMonth(date); + if (navStart && newMonth < navStart) { + newMonth = navStart; + } + if (navEnd && newMonth > navEnd) { + newMonth = navEnd; + } + setInternalMonth(newMonth); + onMonthChange?.(newMonth); + }, + [navEnd, navStart, onMonthChange], + ); + + // For the live current month, once today reaches the 4th row, guarantee its + // week plus the next two are visible. todayRow is today's 0-based row in the + // natural (unshifted) grid. + const naturalGridStart = startOfWeek(startOfMonth(firstMonth), weekStart); + const todayRow = Math.floor( + Math.round( + (startOfDay(today).getTime() - naturalGridStart.getTime()) / 86_400_000, + ) / 7, + ); + const expand = shiftWeeks && isSameMonth(firstMonth, today) && todayRow >= 3; + // Extend downward first; only drop early weeks (shift) when today sits so low + // that the two trailing weeks wouldn't fit within the 6-row cap. + const shiftRows = expand ? Math.max(0, todayRow - 3) : 0; + + const days = buildCalendarDays(firstMonth, weekStart, shiftRows, expand); + const weeks = chunkWeeks(days); + + // Reserve any missing rows up to 6 (the most any month needs) with empty + // placeholders, so the grid keeps a constant height across navigation. This + // is 0 when expanding, since those months already fill all 6 rows with days. + const placeholderRows = Math.max(0, 6 - weeks.length); + + const isSelected = (date: Date): boolean => + selected ? isSameDay(selected, date) : false; + + const getModifiers = (day: CalendarDay): DayModifiers => { + const { date, outside } = day; + const isBeforeNavStart = Boolean(navStart && date < navStart); + const isAfterNavEnd = Boolean(navEnd && date > endOfMonth(navEnd)); + const isDisabled = disabled ? disabled(date) : false; + // Leading previous-month days are never shown (past days aren't relevant). + // Next-month days only belong in the grid while expanding; otherwise the + // empty placeholder rows reserve their space instead of spilling over. + const isPrevMonthDay = date < startOfMonth(firstMonth); + const isNextMonthDay = date > endOfMonth(firstMonth); + const isHidden = + isBeforeNavStart || + isAfterNavEnd || + isPrevMonthDay || + (!expand && isNextMonthDay); + const isToday = isSameDay(date, today); + const isFocused = + !isHidden && + !outside && + focusedDate !== undefined && + isSameDay(date, focusedDate); + + return { + focused: isFocused, + disabled: isDisabled, + hidden: isHidden, + outside, + today: isToday, + selected: isSelected(date), + }; + }; + + // Roving tabindex target. Priority: focused > last focused > selected > today + // > first focusable day. + const focusTarget = ((): CalendarDay | undefined => { + let target: CalendarDay | undefined; + let priority = -1; + for (const day of days) { + const modifiers = getModifiers(day); + if (!isFocusableDay(modifiers)) continue; + if (modifiers.focused && priority < 3) { + target = day; + priority = 3; + } else if ( + lastFocusedDate && + isSameDay(day.date, lastFocusedDate) && + priority < 2 + ) { + target = day; + priority = 2; + } else if (isSelected(day.date) && priority < 1) { + target = day; + priority = 1; + } else if (modifiers.today && priority < 0) { + target = day; + priority = 0; + } + } + if (!target) { + target = days.find((day) => isFocusableDay(getModifiers(day))); + } + return target; + })(); + + // While expanding, mark the 1st of the next month (the first visible day past + // the current month's end) with the month label. + const monthEnd = endOfMonth(firstMonth); + const nextMonthLabelIso = expand + ? days.find((day) => { + const modifiers = getModifiers(day); + return day.date > monthEnd && !modifiers.hidden; + })?.isoDate + : undefined; + + const getFocusableDate = ( + moveBy: MoveBy, + moveDir: MoveDir, + refDate: Date, + ): Date => { + const delta = moveDir === "after" ? 1 : -1; + let result: Date; + switch (moveBy) { + case "day": + result = addDays(refDate, delta); + break; + case "week": + result = addDays(refDate, delta * 7); + break; + case "month": + result = addMonths(refDate, delta); + break; + case "year": + result = addMonths(refDate, delta * 12); + break; + case "startOfWeek": + result = startOfWeek(refDate, weekStart); + break; + case "endOfWeek": + result = endOfWeek(refDate, weekStart); + break; + } + if (moveDir === "before" && navStart && result < navStart) { + result = navStart; + } + if (moveDir === "after" && navEnd && result > endOfMonth(navEnd)) { + result = endOfMonth(navEnd); + } + return result; + }; + + const getNextFocus = ( + moveBy: MoveBy, + moveDir: MoveDir, + refDate: Date, + attempt = 0, + ): Date | undefined => { + if (attempt > 365) return undefined; + const next = getFocusableDate(moveBy, moveDir, refDate); + const isDisabled = disabled ? disabled(next) : false; + if (!isDisabled) return next; + return getNextFocus(moveBy, moveDir, next, attempt + 1); + }; + + const moveFocus = (moveBy: MoveBy, moveDir: MoveDir) => { + if (!focusedDate) return; + const next = getNextFocus(moveBy, moveDir, focusedDate); + if (!next) return; + if (!isSameMonth(next, firstMonth)) { + goToMonth(next); + } + setFocusedDate(next); + }; + + const handleDayClick = + (day: CalendarDay, modifiers: DayModifiers) => (event: MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + setFocusedDate(day.date); + if (modifiers.disabled) return; + const newDate = + selected && isSameDay(day.date, selected) ? undefined : day.date; + onSelect?.(newDate, day.date); + }; + + const handleDayFocus = (day: CalendarDay) => () => { + setFocusedDate(day.date); + }; + + const handleDayBlur = () => { + setLastFocusedDate(focusedDate); + setFocusedDate(undefined); + }; + + const handleDayKeyDown = (event: KeyboardEvent) => { + const keyMap: Record = { + ArrowLeft: [event.shiftKey ? "month" : "day", "before"], + ArrowRight: [event.shiftKey ? "month" : "day", "after"], + ArrowDown: [event.shiftKey ? "year" : "week", "after"], + ArrowUp: [event.shiftKey ? "year" : "week", "before"], + PageUp: [event.shiftKey ? "year" : "month", "before"], + PageDown: [event.shiftKey ? "year" : "month", "after"], + Home: ["startOfWeek", "before"], + End: ["endOfWeek", "after"], + }; + const move = keyMap[event.key]; + if (move) { + event.preventDefault(); + event.stopPropagation(); + const [moveBy, moveDir] = move; + moveFocus(moveBy, moveDir); + } + }; + + const weekdayHeaderStart = startOfWeek(today, weekStart); + const weekdays = Array.from({ length: 7 }, (_, index) => { + const date = addDays(weekdayHeaderStart, index); + return { + long: localization.weekdayLong(date), + short: localization.weekdayShort(date), + }; + }); + + return ( +
+
+
+ {localization.monthYearLabel(firstMonth)} +
+
+ {initialLoading ? ( + + ) : ( + <> + + + + )} +
+ + + + + {weekdays.map((weekday) => ( + + ))} + + + + {weeks.map((week) => ( + + {week.map((day) => { + const modifiers = getModifiers(day); + + // The day button's own styling is driven by the `data-*` + // attributes below; these cell classes only cover the + // layout and the outside/hidden/today states. + const cellClassName = cn( + "@max-3xl:max-h-9 flex-1 p-0", + modifiers.hidden && "invisible", + modifiers.outside && "text-muted-foreground/50", + modifiers.today && + !dayCellsLoading && + "*:before:pointer-events-none *:before:absolute *:before:start-1/2 *:before:bottom-1/7 *:before:z-1 *:before:size-1 *:before:-translate-x-1/2 *:before:rounded-full *:before:bg-primary *:before:transition-colors [&[data-selected]>*]:before:bg-primary-foreground", + ); + + // Label (e.g. "Aug") sits on the 1st of the next month. + const nextMonthLabel = + day.isoDate === nextMonthLabelIso + ? localization.monthShortLabel(day.date) + : undefined; + + // Next-month days only show in the shifted current-month + // view; a month-name tooltip keeps them from being mistaken + // for the current month. + const monthTooltip = + day.outside && !modifiers.disabled && !modifiers.hidden + ? localization.monthLongLabel(day.date) + : undefined; + + return ( + + ); + })} + + ))} + {Array.from( + { length: placeholderRows }, + (_, rowIndex) => `placeholder-row-${rowIndex}`, + ).map((rowKey) => ( + + {weekdays.map((weekday) => ( + + ))} + + ))} + +
+ {modifiers.hidden ? null : dayCellsLoading ? ( + + ) : ( + { + let label = localization.fullDateLabel(day.date); + if (modifiers.today) { + label = `${resolvedLabels.today}, ${label}`; + } + if (modifiers.selected) { + label = `${label}, ${resolvedLabels.selected}`; + } + return label; + })()} + onClick={handleDayClick(day, modifiers)} + onBlur={handleDayBlur} + onFocus={handleDayFocus(day)} + onKeyDown={handleDayKeyDown} + > + {localization.dayNumber(day.date)} + + )} +
+
+
+ + {({ payload }) => ( + + {payload} + + )} + +
+
+
+ ); +} diff --git a/apps/ui/registry/default/atoms/booker/booker-confirm-form.tsx b/apps/ui/registry/default/atoms/booker/booker-confirm-form.tsx new file mode 100644 index 000000000..bf17d90d6 --- /dev/null +++ b/apps/ui/registry/default/atoms/booker/booker-confirm-form.tsx @@ -0,0 +1,280 @@ +"use client"; + +import { UserPlusIcon, XIcon } from "lucide-react"; +import type { FormEvent } from "react"; +import { useRef, useState } from "react"; +import { Button } from "@/registry/default/ui/button"; +import { Field, FieldError, FieldLabel } from "@/registry/default/ui/field"; +import { Form } from "@/registry/default/ui/form"; +import { Group } from "@/registry/default/ui/group"; +import { Input } from "@/registry/default/ui/input"; +import { Textarea } from "@/registry/default/ui/textarea"; +import type { BookerLabels } from "./booker-labels"; +import { getLocationOptionValue, LocationPicker } from "./location"; +import { createBookingAction } from "@/lib/booker/actions"; +import type { BookerConfirmFormContext } from "@/lib/booker/use-booker"; +import { toCalendarDateKey } from "@/lib/booker/utils"; +import type { Booking } from "@/lib/cal-api/types"; + +export type BookerConfirmFormProps = BookerConfirmFormContext & { + defaultEmail?: string; + defaultName?: string; + labels: BookerLabels; + onSuccess?: (booking: Booking) => void; +}; + +function RequiredMark() { + return *; +} + +function getDefaultLocationProvider( + locations: BookerConfirmFormContext["locations"], +): string { + const location = locations?.[0]; + if (!location) { + return ""; + } + + return location.provider || getLocationOptionValue(location, 0); +} + +export function BookerConfirmForm({ + defaultEmail, + defaultName, + disableGuests = false, + durationMinutes, + includeLengthInMinutes, + labels, + locale, + locations = [], + onBack, + onSuccess, + selectedDate, + selectedTime, + target, + timeZone, +}: BookerConfirmFormProps) { + const nextGuestIdRef = useRef(0); + const [guestIds, setGuestIds] = useState([]); + const [locationProvider, setLocationProvider] = useState(() => + getDefaultLocationProvider(locations), + ); + const [submitting, setSubmitting] = useState(false); + const [submitError, setSubmitError] = useState(null); + const [successBooking, setSuccessBooking] = useState(null); + + const resolvedLocationProvider = + locations.length > 1 + ? locationProvider || getDefaultLocationProvider(locations) + : getDefaultLocationProvider(locations); + + const handleAddGuest = () => { + const id = nextGuestIdRef.current; + nextGuestIdRef.current += 1; + setGuestIds((current) => [...current, id]); + }; + + const handleRemoveGuest = (id: number) => { + setGuestIds((current) => current.filter((guestId) => guestId !== id)); + }; + + const handleSubmit = async (event: FormEvent) => { + event.preventDefault(); + setSubmitError(null); + + if (!selectedDate || !selectedTime) { + setSubmitError(labels.confirmError); + return; + } + + const formData = new FormData(event.currentTarget); + const name = String(formData.get("name") ?? "").trim(); + const email = String(formData.get("email") ?? "").trim(); + const notes = String(formData.get("notes") ?? "").trim(); + const guests = formData + .getAll("guests") + .map((value) => String(value).trim()) + .filter(Boolean); + + if (!name || !email) { + return; + } + + setSubmitting(true); + + try { + const result = await createBookingAction({ + email, + guests: guests.length > 0 ? guests : undefined, + ...(includeLengthInMinutes && durationMinutes + ? { lengthInMinutes: durationMinutes } + : {}), + locale, + locationProvider: resolvedLocationProvider || undefined, + name, + notes: notes || undefined, + selectedDateKey: toCalendarDateKey(selectedDate), + selectedTime, + target, + timeZone, + }); + + if (!result.ok) { + setSubmitError(result.error || labels.confirmError); + return; + } + + setSuccessBooking(result.booking); + onSuccess?.(result.booking); + } catch { + setSubmitError(labels.confirmError); + } finally { + setSubmitting(false); + } + }; + + if (successBooking) { + return ( +
+

+ {labels.confirmSuccess} +

+ {successBooking.meetingUrl ? ( +

+ + {successBooking.meetingUrl} + +

+ ) : null} +
+ ); + } + + return ( +
+
+ + + {labels.confirmYourName} + + + {labels.confirmNameError} + + + + + {labels.confirmEmail} + + + {labels.confirmEmailError} + + + + + + {labels.confirmNotes} +