@withpotter/pages-bookings 0.13.0-next.101
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/dashboard/(bookings)/attendees/page.js +8 -0
- package/dist/dashboard/(bookings)/attendees/page.js.map +1 -0
- package/dist/dashboard/(bookings)/availability/_components/availability-screen.js +714 -0
- package/dist/dashboard/(bookings)/availability/_components/availability-screen.js.map +1 -0
- package/dist/dashboard/(bookings)/availability/_components/month-availability.js +130 -0
- package/dist/dashboard/(bookings)/availability/_components/month-availability.js.map +1 -0
- package/dist/dashboard/(bookings)/availability/page.js +10 -0
- package/dist/dashboard/(bookings)/availability/page.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/assign-resource-modal.js +133 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/assign-resource-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-constants.js +26 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-constants.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-desktop-layout.js +194 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-desktop-layout.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-layout-props.js +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-layout-props.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-lede.js +189 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-lede.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-meta.js +38 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-meta.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-mobile-layout.js +315 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-mobile-layout.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-mobile-screen.js +94 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-mobile-screen.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-money.js +54 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-money.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-split.js +71 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/booking-split.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/cancel-booking-modal.js +102 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/cancel-booking-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/cancellation-notice.js +33 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/cancellation-notice.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/customer-info-card.js +65 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/customer-info-card.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/index.js +23 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/index.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/intake-answers-card.js +19 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/intake-answers-card.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/refund-booking-modal.js +156 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/refund-booking-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/reschedule-booking-modal.js +120 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/reschedule-booking-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/security-deposit-card.js +63 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/security-deposit-card.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/settle-deposit-modal.js +141 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/settle-deposit-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/ticket-row-actions.js +49 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/ticket-row-actions.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/waiting-queue-notice.js +42 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components/waiting-queue-notice.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_components.js +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_hooks/index.js +19 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_hooks/index.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_hooks/use-booking-detail-data.js +352 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_hooks/use-booking-detail-data.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/_hooks.js +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/layout.js +33 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/layout.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/page.js +356 -0
- package/dist/dashboard/(bookings)/bookings/[bookingId]/page.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/appointment-calendar-layout.js +34 -0
- package/dist/dashboard/(bookings)/bookings/_components/appointment-calendar-layout.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/booking-constants.js +92 -0
- package/dist/dashboard/(bookings)/bookings/_components/booking-constants.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/booking-tab-hints.js +32 -0
- package/dist/dashboard/(bookings)/bookings/_components/booking-tab-hints.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/bookings-filter-bar.js +131 -0
- package/dist/dashboard/(bookings)/bookings/_components/bookings-filter-bar.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/bookings-mobile-controls.js +119 -0
- package/dist/dashboard/(bookings)/bookings/_components/bookings-mobile-controls.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/bookings-screen.js +414 -0
- package/dist/dashboard/(bookings)/bookings/_components/bookings-screen.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/bookings-table.js +192 -0
- package/dist/dashboard/(bookings)/bookings/_components/bookings-table.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/cannot-take-bookings.js +34 -0
- package/dist/dashboard/(bookings)/bookings/_components/cannot-take-bookings.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/demo-data.js +176 -0
- package/dist/dashboard/(bookings)/bookings/_components/demo-data.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/index.js +9 -0
- package/dist/dashboard/(bookings)/bookings/_components/index.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/booking-card.js +126 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/booking-card.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/demo-data.js +142 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/demo-data.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/handover.js +128 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/handover.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/index.js +17 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/index.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/past-band.js +69 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/past-band.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/resource-board.js +111 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/resource-board.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/today-band.js +61 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/today-band.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/upcoming-band.js +113 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/upcoming-band.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/waiting-queue.js +62 -0
- package/dist/dashboard/(bookings)/bookings/_components/today/waiting-queue.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today-board.js +192 -0
- package/dist/dashboard/(bookings)/bookings/_components/today-board.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_components/today.js +1 -0
- package/dist/dashboard/(bookings)/bookings/_components.js +1 -0
- package/dist/dashboard/(bookings)/bookings/_hooks/index.js +5 -0
- package/dist/dashboard/(bookings)/bookings/_hooks/index.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_hooks/use-bookings-data.js +331 -0
- package/dist/dashboard/(bookings)/bookings/_hooks/use-bookings-data.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_hooks/use-today-data.js +309 -0
- package/dist/dashboard/(bookings)/bookings/_hooks/use-today-data.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/_hooks.js +1 -0
- package/dist/dashboard/(bookings)/bookings/_lib/booking-link.js +13 -0
- package/dist/dashboard/(bookings)/bookings/_lib/booking-link.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/attendees/_components/attendee-cards.js +60 -0
- package/dist/dashboard/(bookings)/bookings/attendees/_components/attendee-cards.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/attendees/_components/qr-scanner-modal.js +225 -0
- package/dist/dashboard/(bookings)/bookings/attendees/_components/qr-scanner-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/attendees/demo-data.js +195 -0
- package/dist/dashboard/(bookings)/bookings/attendees/demo-data.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/attendees/page.js +341 -0
- package/dist/dashboard/(bookings)/bookings/attendees/page.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/new/page.js +129 -0
- package/dist/dashboard/(bookings)/bookings/new/page.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/page.js +10 -0
- package/dist/dashboard/(bookings)/bookings/page.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/sessions/new/_components/save-buttons.js +36 -0
- package/dist/dashboard/(bookings)/bookings/sessions/new/_components/save-buttons.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/sessions/new/_components/session-creator.js +386 -0
- package/dist/dashboard/(bookings)/bookings/sessions/new/_components/session-creator.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/sessions/new/_lib/session-payload.js +62 -0
- package/dist/dashboard/(bookings)/bookings/sessions/new/_lib/session-payload.js.map +1 -0
- package/dist/dashboard/(bookings)/bookings/sessions/new/page.js +10 -0
- package/dist/dashboard/(bookings)/bookings/sessions/new/page.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/calendar-nav.js +84 -0
- package/dist/dashboard/(bookings)/calendar/_components/calendar-nav.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/calendar-range.js +84 -0
- package/dist/dashboard/(bookings)/calendar/_components/calendar-range.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/day-board-view.js +279 -0
- package/dist/dashboard/(bookings)/calendar/_components/day-board-view.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/event-detail-modal.js +113 -0
- package/dist/dashboard/(bookings)/calendar/_components/event-detail-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/format.js +22 -0
- package/dist/dashboard/(bookings)/calendar/_components/format.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/month-grid.js +109 -0
- package/dist/dashboard/(bookings)/calendar/_components/month-grid.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/resource-day-grid.js +325 -0
- package/dist/dashboard/(bookings)/calendar/_components/resource-day-grid.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/slot-action-sheet.js +209 -0
- package/dist/dashboard/(bookings)/calendar/_components/slot-action-sheet.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/use-block-drag.js +77 -0
- package/dist/dashboard/(bookings)/calendar/_components/use-block-drag.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/use-calendar-nav.js +69 -0
- package/dist/dashboard/(bookings)/calendar/_components/use-calendar-nav.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/week-grid.js +202 -0
- package/dist/dashboard/(bookings)/calendar/_components/week-grid.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/_components/year-grid.js +111 -0
- package/dist/dashboard/(bookings)/calendar/_components/year-grid.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar/page.js +8 -0
- package/dist/dashboard/(bookings)/calendar/page.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar-sync/_components/channel-feed-modal.js +126 -0
- package/dist/dashboard/(bookings)/calendar-sync/_components/channel-feed-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar-sync/_components/channel-feeds-section.js +99 -0
- package/dist/dashboard/(bookings)/calendar-sync/_components/channel-feeds-section.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar-sync/demo-data.js +64 -0
- package/dist/dashboard/(bookings)/calendar-sync/demo-data.js.map +1 -0
- package/dist/dashboard/(bookings)/calendar-sync/page.js +15 -0
- package/dist/dashboard/(bookings)/calendar-sync/page.js.map +1 -0
- package/dist/dashboard/(bookings)/check-in/page.js +252 -0
- package/dist/dashboard/(bookings)/check-in/page.js.map +1 -0
- package/dist/dashboard/(bookings)/events/[eventId]/_components/event-attendees.js +108 -0
- package/dist/dashboard/(bookings)/events/[eventId]/_components/event-attendees.js.map +1 -0
- package/dist/dashboard/(bookings)/events/[eventId]/_components/event-share.js +73 -0
- package/dist/dashboard/(bookings)/events/[eventId]/_components/event-share.js.map +1 -0
- package/dist/dashboard/(bookings)/events/[eventId]/layout.js +10 -0
- package/dist/dashboard/(bookings)/events/[eventId]/layout.js.map +1 -0
- package/dist/dashboard/(bookings)/events/[eventId]/page.js +247 -0
- package/dist/dashboard/(bookings)/events/[eventId]/page.js.map +1 -0
- package/dist/dashboard/(bookings)/events/_components/event-grid.js +44 -0
- package/dist/dashboard/(bookings)/events/_components/event-grid.js.map +1 -0
- package/dist/dashboard/(bookings)/events/_components/event-poster.js +17 -0
- package/dist/dashboard/(bookings)/events/_components/event-poster.js.map +1 -0
- package/dist/dashboard/(bookings)/events/_hooks/use-events-data.js +55 -0
- package/dist/dashboard/(bookings)/events/_hooks/use-events-data.js.map +1 -0
- package/dist/dashboard/(bookings)/events/_lib/event-facts.js +68 -0
- package/dist/dashboard/(bookings)/events/_lib/event-facts.js.map +1 -0
- package/dist/dashboard/(bookings)/events/new/_components/event-composer.js +295 -0
- package/dist/dashboard/(bookings)/events/new/_components/event-composer.js.map +1 -0
- package/dist/dashboard/(bookings)/events/new/_components/event-poster.js +65 -0
- package/dist/dashboard/(bookings)/events/new/_components/event-poster.js.map +1 -0
- package/dist/dashboard/(bookings)/events/new/_components/ticket-tiers.js +75 -0
- package/dist/dashboard/(bookings)/events/new/_components/ticket-tiers.js.map +1 -0
- package/dist/dashboard/(bookings)/events/new/page.js +10 -0
- package/dist/dashboard/(bookings)/events/new/page.js.map +1 -0
- package/dist/dashboard/(bookings)/events/page.js +214 -0
- package/dist/dashboard/(bookings)/events/page.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/[resourceId]/layout.js +36 -0
- package/dist/dashboard/(bookings)/resources/[resourceId]/layout.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/[resourceId]/page.js +351 -0
- package/dist/dashboard/(bookings)/resources/[resourceId]/page.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/block-time-modal.js +130 -0
- package/dist/dashboard/(bookings)/resources/_components/block-time-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/category-card.js +74 -0
- package/dist/dashboard/(bookings)/resources/_components/category-card.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/category-form-dialog.js +197 -0
- package/dist/dashboard/(bookings)/resources/_components/category-form-dialog.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/day-editor.js +194 -0
- package/dist/dashboard/(bookings)/resources/_components/day-editor.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/group-dialog.js +170 -0
- package/dist/dashboard/(bookings)/resources/_components/group-dialog.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/group-header.js +90 -0
- package/dist/dashboard/(bookings)/resources/_components/group-header.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/index.js +22 -0
- package/dist/dashboard/(bookings)/resources/_components/index.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/mobile-category-form-sheet.js +256 -0
- package/dist/dashboard/(bookings)/resources/_components/mobile-category-form-sheet.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/resource-form.js +420 -0
- package/dist/dashboard/(bookings)/resources/_components/resource-form.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/resource-picker.js +144 -0
- package/dist/dashboard/(bookings)/resources/_components/resource-picker.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/resource-type-picker-empty.js +109 -0
- package/dist/dashboard/(bookings)/resources/_components/resource-type-picker-empty.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/roster-empty.js +103 -0
- package/dist/dashboard/(bookings)/resources/_components/roster-empty.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/roster-grid.js +160 -0
- package/dist/dashboard/(bookings)/resources/_components/roster-grid.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/schedule-editor.js +244 -0
- package/dist/dashboard/(bookings)/resources/_components/schedule-editor.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/schedule-timezone-field.js +25 -0
- package/dist/dashboard/(bookings)/resources/_components/schedule-timezone-field.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/solo-schedule-view.js +146 -0
- package/dist/dashboard/(bookings)/resources/_components/solo-schedule-view.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/team-onboarding-dialog.js +161 -0
- package/dist/dashboard/(bookings)/resources/_components/team-onboarding-dialog.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components/week-grid.js +175 -0
- package/dist/dashboard/(bookings)/resources/_components/week-grid.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_components.js +1 -0
- package/dist/dashboard/(bookings)/resources/_hooks/index.js +8 -0
- package/dist/dashboard/(bookings)/resources/_hooks/index.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_hooks/use-resource-categories-data.js +86 -0
- package/dist/dashboard/(bookings)/resources/_hooks/use-resource-categories-data.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_hooks/use-roster-page.js +138 -0
- package/dist/dashboard/(bookings)/resources/_hooks/use-roster-page.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_hooks/use-roster.js +182 -0
- package/dist/dashboard/(bookings)/resources/_hooks/use-roster.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_hooks.js +1 -0
- package/dist/dashboard/(bookings)/resources/_lib/presets.js +147 -0
- package/dist/dashboard/(bookings)/resources/_lib/presets.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_lib/schedule-timezone.js +17 -0
- package/dist/dashboard/(bookings)/resources/_lib/schedule-timezone.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_lib/shapes.js +105 -0
- package/dist/dashboard/(bookings)/resources/_lib/shapes.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/_lib/week.js +122 -0
- package/dist/dashboard/(bookings)/resources/_lib/week.js.map +1 -0
- package/dist/dashboard/(bookings)/resources/page.js +391 -0
- package/dist/dashboard/(bookings)/resources/page.js.map +1 -0
- package/dist/dashboard/(bookings)/schedule/page.js +8 -0
- package/dist/dashboard/(bookings)/schedule/page.js.map +1 -0
- package/dist/dashboard/(bookings)/today/page.js +14 -0
- package/dist/dashboard/(bookings)/today/page.js.map +1 -0
- package/dist/dashboard/(bookings)/waitlist/_components/demo-data.js +99 -0
- package/dist/dashboard/(bookings)/waitlist/_components/demo-data.js.map +1 -0
- package/dist/dashboard/(bookings)/waitlist/_components/offer-spot-modal.js +71 -0
- package/dist/dashboard/(bookings)/waitlist/_components/offer-spot-modal.js.map +1 -0
- package/dist/dashboard/(bookings)/waitlist/_components/waitlist-entry-editor.js +150 -0
- package/dist/dashboard/(bookings)/waitlist/_components/waitlist-entry-editor.js.map +1 -0
- package/dist/dashboard/(bookings)/waitlist/new/page.js +59 -0
- package/dist/dashboard/(bookings)/waitlist/new/page.js.map +1 -0
- package/dist/dashboard/(bookings)/waitlist/page.js +317 -0
- package/dist/dashboard/(bookings)/waitlist/page.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
function day(offset) {
|
|
2
|
+
const d = /* @__PURE__ */ new Date();
|
|
3
|
+
d.setDate(d.getDate() + offset);
|
|
4
|
+
return d.toISOString().slice(0, 10);
|
|
5
|
+
}
|
|
6
|
+
function hoursFromNow(h) {
|
|
7
|
+
return new Date(Date.now() + h * 36e5).toISOString();
|
|
8
|
+
}
|
|
9
|
+
function hoursAgo(h) {
|
|
10
|
+
return new Date(Date.now() - h * 36e5).toISOString();
|
|
11
|
+
}
|
|
12
|
+
const DEMO_WAITLIST = [
|
|
13
|
+
{
|
|
14
|
+
id: "demo-w1",
|
|
15
|
+
inquiryNumber: "WLDEMO001",
|
|
16
|
+
customerName: "Chidi Okonkwo",
|
|
17
|
+
customerEmail: "chidi@gmail.com",
|
|
18
|
+
customerPhone: "+2348031120945",
|
|
19
|
+
requestedDate: day(0),
|
|
20
|
+
requestedStartTime: "18:00",
|
|
21
|
+
requestedEndTime: "19:00",
|
|
22
|
+
contentTitle: "Table for two",
|
|
23
|
+
status: "waiting",
|
|
24
|
+
position: 1,
|
|
25
|
+
priority: "high",
|
|
26
|
+
partySize: 2,
|
|
27
|
+
createdAt: hoursAgo(30)
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "demo-w2",
|
|
31
|
+
inquiryNumber: "WLDEMO002",
|
|
32
|
+
customerName: "Zainab Musa",
|
|
33
|
+
customerEmail: "zainab@gmail.com",
|
|
34
|
+
customerPhone: "+2348024410982",
|
|
35
|
+
requestedDate: day(0),
|
|
36
|
+
requestedStartTime: "18:00",
|
|
37
|
+
requestedEndTime: "19:00",
|
|
38
|
+
contentTitle: "Friday Night Live \u2014 Regular",
|
|
39
|
+
status: "notified",
|
|
40
|
+
position: 2,
|
|
41
|
+
priority: "normal",
|
|
42
|
+
partySize: 1,
|
|
43
|
+
offeredDate: day(0),
|
|
44
|
+
offeredStartTime: "18:00",
|
|
45
|
+
offeredEndTime: "19:00",
|
|
46
|
+
offerExpiresAt: hoursFromNow(1.7),
|
|
47
|
+
createdAt: hoursAgo(28)
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "demo-w3",
|
|
51
|
+
inquiryNumber: "WLDEMO003",
|
|
52
|
+
customerName: "Bola Ahmed",
|
|
53
|
+
customerEmail: "bola@gmail.com",
|
|
54
|
+
customerPhone: "+2347066120114",
|
|
55
|
+
requestedDate: day(1),
|
|
56
|
+
requestedStartTime: "07:00",
|
|
57
|
+
requestedEndTime: "08:00",
|
|
58
|
+
contentTitle: "Sunday brunch sitting",
|
|
59
|
+
status: "waiting",
|
|
60
|
+
position: 3,
|
|
61
|
+
priority: "normal",
|
|
62
|
+
partySize: 1,
|
|
63
|
+
createdAt: hoursAgo(26)
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "demo-w4",
|
|
67
|
+
inquiryNumber: "WLDEMO004",
|
|
68
|
+
customerName: "Ngozi Eze",
|
|
69
|
+
customerEmail: "ngozi@gmail.com",
|
|
70
|
+
customerPhone: "+2348090011223",
|
|
71
|
+
requestedDate: day(-2),
|
|
72
|
+
requestedStartTime: "19:00",
|
|
73
|
+
requestedEndTime: "20:00",
|
|
74
|
+
// No contentTitle on purpose: a walk-in wanting a table, any table. The
|
|
75
|
+
// column falls back to the party size, which is the only thing known.
|
|
76
|
+
status: "converted",
|
|
77
|
+
priority: "normal",
|
|
78
|
+
partySize: 4,
|
|
79
|
+
offeredDate: day(-2),
|
|
80
|
+
offeredStartTime: "19:00",
|
|
81
|
+
offeredEndTime: "20:00",
|
|
82
|
+
offerExpiresAt: hoursAgo(44),
|
|
83
|
+
createdAt: hoursAgo(70)
|
|
84
|
+
}
|
|
85
|
+
];
|
|
86
|
+
const DEMO_WAITLIST_STATS = {
|
|
87
|
+
total: 12,
|
|
88
|
+
byStatus: {
|
|
89
|
+
waiting: 6,
|
|
90
|
+
notified: 2,
|
|
91
|
+
converted: 3,
|
|
92
|
+
expired: 1
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
export {
|
|
96
|
+
DEMO_WAITLIST,
|
|
97
|
+
DEMO_WAITLIST_STATS
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=demo-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/dashboard/%28bookings%29/waitlist/_components/demo-data.ts"],"sourcesContent":["import type { WaitlistItem } from '@withpotter/lib/api/types';\n\n/**\n * Demo waitlist entries for UI design/preview only (`?demo=1`).\n *\n * Shapes mirror the real `WaitlistMapper.toResponse` contract, so nothing here\n * is a facade of a different model — including the offered slot and its expiry,\n * which is the state the board exists to make visible.\n *\n * Dated relative to now rather than pinned, because a seed with last month's\n * dates in it renders every entry as history and the one screen that is about\n * urgency reads as an archive.\n */\nfunction day(offset: number): string {\n const d = new Date();\n d.setDate(d.getDate() + offset);\n return d.toISOString().slice(0, 10);\n}\n\nfunction hoursFromNow(h: number): string {\n return new Date(Date.now() + h * 3600_000).toISOString();\n}\n\nfunction hoursAgo(h: number): string {\n return new Date(Date.now() - h * 3600_000).toISOString();\n}\n\nexport const DEMO_WAITLIST: WaitlistItem[] = [\n {\n id: 'demo-w1',\n inquiryNumber: 'WLDEMO001',\n customerName: 'Chidi Okonkwo',\n customerEmail: 'chidi@gmail.com',\n customerPhone: '+2348031120945',\n requestedDate: day(0),\n requestedStartTime: '18:00',\n requestedEndTime: '19:00',\n contentTitle: 'Table for two',\n status: 'waiting',\n position: 1,\n priority: 'high',\n partySize: 2,\n createdAt: hoursAgo(30),\n },\n {\n id: 'demo-w2',\n inquiryNumber: 'WLDEMO002',\n customerName: 'Zainab Musa',\n customerEmail: 'zainab@gmail.com',\n customerPhone: '+2348024410982',\n requestedDate: day(0),\n requestedStartTime: '18:00',\n requestedEndTime: '19:00',\n contentTitle: 'Friday Night Live — Regular',\n status: 'notified',\n position: 2,\n priority: 'normal',\n partySize: 1,\n offeredDate: day(0),\n offeredStartTime: '18:00',\n offeredEndTime: '19:00',\n offerExpiresAt: hoursFromNow(1.7),\n createdAt: hoursAgo(28),\n },\n {\n id: 'demo-w3',\n inquiryNumber: 'WLDEMO003',\n customerName: 'Bola Ahmed',\n customerEmail: 'bola@gmail.com',\n customerPhone: '+2347066120114',\n requestedDate: day(1),\n requestedStartTime: '07:00',\n requestedEndTime: '08:00',\n contentTitle: 'Sunday brunch sitting',\n status: 'waiting',\n position: 3,\n priority: 'normal',\n partySize: 1,\n createdAt: hoursAgo(26),\n },\n {\n id: 'demo-w4',\n inquiryNumber: 'WLDEMO004',\n customerName: 'Ngozi Eze',\n customerEmail: 'ngozi@gmail.com',\n customerPhone: '+2348090011223',\n requestedDate: day(-2),\n requestedStartTime: '19:00',\n requestedEndTime: '20:00',\n // No contentTitle on purpose: a walk-in wanting a table, any table. The\n // column falls back to the party size, which is the only thing known.\n status: 'converted',\n priority: 'normal',\n partySize: 4,\n offeredDate: day(-2),\n offeredStartTime: '19:00',\n offeredEndTime: '20:00',\n offerExpiresAt: hoursAgo(44),\n createdAt: hoursAgo(70),\n },\n];\n\nexport const DEMO_WAITLIST_STATS = {\n total: 12,\n byStatus: {\n waiting: 6,\n notified: 2,\n converted: 3,\n expired: 1,\n },\n};\n"],"mappings":"AAaA,SAAS,IAAI,QAAwB;AACnC,QAAM,IAAI,oBA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,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW,SAAS,EAAE;AAAA,EACxB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,eAAe;AAAA,IACf,cAAc;AAAA,IACd,eAAe;AAAA,IACf,eAAe;AAAA,IACf,eAAe,IAAI,EAAE;AAAA,IACrB,oBAAoB;AAAA,IACpB,kBAAkB;AAAA;AAAA;AAAA,IAGlB,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,WAAW;AAAA,IACX,aAAa,IAAI,EAAE;AAAA,IACnB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,gBAAgB,SAAS,EAAE;AAAA,IAC3B,WAAW,SAAS,EAAE;AAAA,EACxB;AACF;AAEO,MAAM,sBAAsB;AAAA,EACjC,OAAO;AAAA,EACP,UAAU;AAAA,IACR,SAAS;AAAA,IACT,UAAU;AAAA,IACV,WAAW;AAAA,IACX,SAAS;AAAA,EACX;AACF;","names":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Button } from "@withpotter/ui-kit/button";
|
|
5
|
+
import { DateField } from "@withpotter/ui-kit/date-field";
|
|
6
|
+
import { TimeField } from "@withpotter/ui-kit/time-field";
|
|
7
|
+
import { FormDialog } from "@withpotter/ui-kit/form-dialog";
|
|
8
|
+
import { Field } from "@withpotter/ui-kit/field";
|
|
9
|
+
import { OptionButton } from "@withpotter/ui-kit/option-button";
|
|
10
|
+
import { ErrorBanner } from "@withpotter/ui-kit/error-banner";
|
|
11
|
+
const WINDOWS = [2, 4, 12, 24];
|
|
12
|
+
function OfferSpotModal({
|
|
13
|
+
customerName,
|
|
14
|
+
initialDate,
|
|
15
|
+
initialStartTime,
|
|
16
|
+
initialEndTime,
|
|
17
|
+
offering,
|
|
18
|
+
error,
|
|
19
|
+
onOffer,
|
|
20
|
+
onClose
|
|
21
|
+
}) {
|
|
22
|
+
const [date, setDate] = useState(initialDate ? initialDate.slice(0, 10) : "");
|
|
23
|
+
const [startTime, setStartTime] = useState(initialStartTime ?? "");
|
|
24
|
+
const [endTime, setEndTime] = useState(initialEndTime ?? "");
|
|
25
|
+
const [expiresInHours, setExpiresInHours] = useState(4);
|
|
26
|
+
const canSubmit = Boolean(date && startTime && endTime) && !offering;
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
FormDialog,
|
|
29
|
+
{
|
|
30
|
+
title: "Offer a spot",
|
|
31
|
+
description: `Notify ${customerName} that a slot opened. The offer expires if not taken.`,
|
|
32
|
+
onClose,
|
|
33
|
+
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: onClose, children: "Cancel" }),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
Button,
|
|
37
|
+
{
|
|
38
|
+
onClick: () => onOffer({ date, startTime, endTime, expiresInHours }),
|
|
39
|
+
loading: offering,
|
|
40
|
+
disabled: !canSubmit,
|
|
41
|
+
children: offering ? "Offering\u2026" : "Send offer"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] }),
|
|
45
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
46
|
+
/* @__PURE__ */ jsx(ErrorBanner, { children: error }),
|
|
47
|
+
/* @__PURE__ */ jsx(Field, { label: "Date", required: true, children: /* @__PURE__ */ jsx(DateField, { value: date, onChange: setDate }) }),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
49
|
+
/* @__PURE__ */ jsx(Field, { label: "Start", required: true, children: /* @__PURE__ */ jsx(TimeField, { value: startTime, onChange: setStartTime }) }),
|
|
50
|
+
/* @__PURE__ */ jsx(Field, { label: "End", required: true, children: /* @__PURE__ */ jsx(TimeField, { value: endTime, onChange: setEndTime }) })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ jsx(Field, { label: "Offer expires in", children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: WINDOWS.map((h) => /* @__PURE__ */ jsxs(
|
|
53
|
+
OptionButton,
|
|
54
|
+
{
|
|
55
|
+
selected: expiresInHours === h,
|
|
56
|
+
onClick: () => setExpiresInHours(h),
|
|
57
|
+
children: [
|
|
58
|
+
h,
|
|
59
|
+
"h"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
h
|
|
63
|
+
)) }) })
|
|
64
|
+
] })
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
OfferSpotModal
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=offer-spot-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/dashboard/%28bookings%29/waitlist/_components/offer-spot-modal.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { Button } from '@withpotter/ui-kit/button';\nimport { DateField } from '@withpotter/ui-kit/date-field';\nimport { TimeField } from '@withpotter/ui-kit/time-field';\nimport { FormDialog } from '@withpotter/ui-kit/form-dialog';\nimport { Field } from '@withpotter/ui-kit/field';\nimport { OptionButton } from '@withpotter/ui-kit/option-button';\nimport { ErrorBanner } from '@withpotter/ui-kit/error-banner';\n\ninterface OfferSpotModalProps {\n customerName: string;\n /** Prefill from the entry's requested slot. */\n initialDate?: string;\n initialStartTime?: string;\n initialEndTime?: string;\n offering: boolean;\n error?: string | null;\n onOffer: (data: {\n date: string;\n startTime: string;\n endTime: string;\n expiresInHours?: number;\n }) => void;\n onClose: () => void;\n}\n\n/**\n * How long the customer has to take it.\n *\n * Windows, not a number field. The engine's own automatic offer uses two\n * hours, so that is the first option and four is the default a desk picks when\n * it is offering by hand — typing \"4\" into a box asked the merchant to invent\n * a policy the product already has an opinion about.\n */\nconst WINDOWS = [2, 4, 12, 24];\n\n/**\n * Offer an open slot to a waiting customer. Prefilled from their requested\n * slot; the customer is notified and the offer expires after the given window.\n * Backed by POST /waitlist/:id/offer.\n */\nexport function OfferSpotModal({\n customerName,\n initialDate,\n initialStartTime,\n initialEndTime,\n offering,\n error,\n onOffer,\n onClose,\n}: OfferSpotModalProps) {\n const [date, setDate] = useState(initialDate ? initialDate.slice(0, 10) : '');\n const [startTime, setStartTime] = useState(initialStartTime ?? '');\n const [endTime, setEndTime] = useState(initialEndTime ?? '');\n const [expiresInHours, setExpiresInHours] = useState(4);\n const canSubmit = Boolean(date && startTime && endTime) && !offering;\n\n return (\n <FormDialog\n title=\"Offer a spot\"\n description={`Notify ${customerName} that a slot opened. The offer expires if not taken.`}\n onClose={onClose}\n footer={\n <>\n <Button variant=\"secondary\" onClick={onClose}>\n Cancel\n </Button>\n <Button\n onClick={() =>\n onOffer({ date, startTime, endTime, expiresInHours })\n }\n loading={offering}\n disabled={!canSubmit}\n >\n {offering ? 'Offering…' : 'Send offer'}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <ErrorBanner>{error}</ErrorBanner>\n\n <Field label=\"Date\" required>\n <DateField value={date} onChange={setDate} />\n </Field>\n\n <div className=\"grid grid-cols-2 gap-3\">\n <Field label=\"Start\" required>\n <TimeField value={startTime} onChange={setStartTime} />\n </Field>\n <Field label=\"End\" required>\n <TimeField value={endTime} onChange={setEndTime} />\n </Field>\n </div>\n\n <Field label=\"Offer expires in\">\n <div className=\"flex flex-wrap gap-2\">\n {WINDOWS.map((h) => (\n <OptionButton\n key={h}\n selected={expiresInHours === h}\n onClick={() => setExpiresInHours(h)}\n >\n {h}h\n </OptionButton>\n ))}\n </div>\n </Field>\n </div>\n </FormDialog>\n );\n}\n"],"mappings":";AAiEQ,mBACE,KADF;AA/DR,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,aAAa;A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SAAS,UAAU,YAAY,GACnD;AAAA,WACF;AAAA,QAEA,oBAAC,SAAM,OAAM,oBACX,8BAAC,SAAI,WAAU,wBACZ,kBAAQ,IAAI,CAAC,MACZ;AAAA,UAAC;AAAA;AAAA,YAEC,UAAU,mBAAmB;AAAA,YAC7B,SAAS,MAAM,kBAAkB,CAAC;AAAA,YAEjC;AAAA;AAAA,cAAE;AAAA;AAAA;AAAA,UAJE;AAAA,QAKP,CACD,GACH,GACF;AAAA,SACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Card } from "@withpotter/ui-kit/card";
|
|
5
|
+
import { Button } from "@withpotter/ui-kit/button";
|
|
6
|
+
import { DateField } from "@withpotter/ui-kit/date-field";
|
|
7
|
+
import { TimeField } from "@withpotter/ui-kit/time-field";
|
|
8
|
+
import { DetailColumns } from "@withpotter/ui-kit/detail-columns";
|
|
9
|
+
import { Field } from "@withpotter/ui-kit/field";
|
|
10
|
+
import { OptionButton } from "@withpotter/ui-kit/option-button";
|
|
11
|
+
import { ErrorBanner } from "@withpotter/ui-kit/error-banner";
|
|
12
|
+
import { Input } from "@withpotter/ui-kit";
|
|
13
|
+
const PRIORITIES = [
|
|
14
|
+
{ key: "normal", label: "Normal" },
|
|
15
|
+
{ key: "high", label: "High" },
|
|
16
|
+
{ key: "urgent", label: "Urgent" }
|
|
17
|
+
];
|
|
18
|
+
const FORM_ID = "waitlist-entry";
|
|
19
|
+
function WaitlistEntryEditor({
|
|
20
|
+
defaultDate,
|
|
21
|
+
saving,
|
|
22
|
+
error,
|
|
23
|
+
onAdd,
|
|
24
|
+
onCancel
|
|
25
|
+
}) {
|
|
26
|
+
const [customerName, setCustomerName] = useState("");
|
|
27
|
+
const [customerEmail, setCustomerEmail] = useState("");
|
|
28
|
+
const [customerPhone, setCustomerPhone] = useState("");
|
|
29
|
+
const [requestedDate, setRequestedDate] = useState(defaultDate);
|
|
30
|
+
const [startTime, setStartTime] = useState("");
|
|
31
|
+
const [endTime, setEndTime] = useState("");
|
|
32
|
+
const [partySize, setPartySize] = useState("1");
|
|
33
|
+
const [priority, setPriority] = useState(
|
|
34
|
+
"normal"
|
|
35
|
+
);
|
|
36
|
+
const canSubmit = Boolean(customerEmail.trim() && requestedDate) && !saving;
|
|
37
|
+
const submit = (e) => {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
if (!canSubmit) return;
|
|
40
|
+
onAdd({
|
|
41
|
+
customerEmail: customerEmail.trim(),
|
|
42
|
+
customerName: customerName.trim() || void 0,
|
|
43
|
+
customerPhone: customerPhone.trim() || void 0,
|
|
44
|
+
requestedDate,
|
|
45
|
+
requestedStartTime: startTime || void 0,
|
|
46
|
+
requestedEndTime: endTime || void 0,
|
|
47
|
+
partySize: Number(partySize) || void 0,
|
|
48
|
+
priority
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
DetailColumns,
|
|
53
|
+
{
|
|
54
|
+
aside: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
55
|
+
/* @__PURE__ */ jsxs(Card, { className: "space-y-3", children: [
|
|
56
|
+
/* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-[var(--text-primary)]", children: customerName || customerEmail || "New entry" }),
|
|
57
|
+
/* @__PURE__ */ jsxs("dl", { className: "space-y-2 text-sm", children: [
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-3", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("dt", { className: "text-[var(--text-tertiary)]", children: "Wants" }),
|
|
60
|
+
/* @__PURE__ */ jsxs("dd", { className: "text-right text-[var(--text-primary)]", children: [
|
|
61
|
+
requestedDate || "Not set",
|
|
62
|
+
startTime ? ` \xB7 ${startTime}` : ""
|
|
63
|
+
] })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-3", children: [
|
|
66
|
+
/* @__PURE__ */ jsx("dt", { className: "text-[var(--text-tertiary)]", children: "Priority" }),
|
|
67
|
+
/* @__PURE__ */ jsx("dd", { className: "text-right text-[var(--text-primary)]", children: PRIORITIES.find((p) => p.key === priority)?.label })
|
|
68
|
+
] })
|
|
69
|
+
] })
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
72
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", form: FORM_ID, loading: saving, children: saving ? "Adding\u2026" : "Add to list" }),
|
|
73
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", type: "button", onClick: onCancel, children: "Cancel" })
|
|
74
|
+
] })
|
|
75
|
+
] }),
|
|
76
|
+
children: /* @__PURE__ */ jsxs("form", { id: FORM_ID, onSubmit: submit, className: "space-y-4", children: [
|
|
77
|
+
/* @__PURE__ */ jsx(ErrorBanner, { children: error }),
|
|
78
|
+
/* @__PURE__ */ jsxs(Card, { className: "space-y-4", children: [
|
|
79
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
80
|
+
/* @__PURE__ */ jsx(Field, { label: "Name", children: /* @__PURE__ */ jsx(
|
|
81
|
+
Input,
|
|
82
|
+
{
|
|
83
|
+
value: customerName,
|
|
84
|
+
onChange: (e) => setCustomerName(e.target.value),
|
|
85
|
+
placeholder: "Customer name"
|
|
86
|
+
}
|
|
87
|
+
) }),
|
|
88
|
+
/* @__PURE__ */ jsx(Field, { label: "Phone", children: /* @__PURE__ */ jsx(
|
|
89
|
+
Input,
|
|
90
|
+
{
|
|
91
|
+
type: "tel",
|
|
92
|
+
value: customerPhone,
|
|
93
|
+
onChange: (e) => setCustomerPhone(e.target.value),
|
|
94
|
+
placeholder: "Optional"
|
|
95
|
+
}
|
|
96
|
+
) })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
Field,
|
|
100
|
+
{
|
|
101
|
+
label: "Email",
|
|
102
|
+
required: true,
|
|
103
|
+
hint: "Where the offer is sent when a slot frees.",
|
|
104
|
+
children: /* @__PURE__ */ jsx(
|
|
105
|
+
Input,
|
|
106
|
+
{
|
|
107
|
+
type: "email",
|
|
108
|
+
value: customerEmail,
|
|
109
|
+
onChange: (e) => setCustomerEmail(e.target.value),
|
|
110
|
+
placeholder: "name@example.com"
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ jsxs(Card, { className: "space-y-4", children: [
|
|
117
|
+
/* @__PURE__ */ jsx(Field, { label: "Wanted for", required: true, children: /* @__PURE__ */ jsx(DateField, { value: requestedDate, onChange: setRequestedDate }) }),
|
|
118
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-3", children: [
|
|
119
|
+
/* @__PURE__ */ jsx(Field, { label: "From", children: /* @__PURE__ */ jsx(TimeField, { value: startTime, onChange: setStartTime }) }),
|
|
120
|
+
/* @__PURE__ */ jsx(Field, { label: "Until", children: /* @__PURE__ */ jsx(TimeField, { value: endTime, onChange: setEndTime }) }),
|
|
121
|
+
/* @__PURE__ */ jsx(Field, { label: "People", children: /* @__PURE__ */ jsx(
|
|
122
|
+
Input,
|
|
123
|
+
{
|
|
124
|
+
type: "number",
|
|
125
|
+
min: 1,
|
|
126
|
+
inputMode: "numeric",
|
|
127
|
+
value: partySize,
|
|
128
|
+
onChange: (e) => setPartySize(e.target.value),
|
|
129
|
+
className: "tabular-nums"
|
|
130
|
+
}
|
|
131
|
+
) })
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ jsx(Field, { label: "Priority", children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: PRIORITIES.map((p) => /* @__PURE__ */ jsx(
|
|
134
|
+
OptionButton,
|
|
135
|
+
{
|
|
136
|
+
selected: priority === p.key,
|
|
137
|
+
onClick: () => setPriority(p.key),
|
|
138
|
+
children: p.label
|
|
139
|
+
},
|
|
140
|
+
p.key
|
|
141
|
+
)) }) })
|
|
142
|
+
] })
|
|
143
|
+
] })
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
export {
|
|
148
|
+
WaitlistEntryEditor
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=waitlist-entry-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/dashboard/%28bookings%29/waitlist/_components/waitlist-entry-editor.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { Card } from '@withpotter/ui-kit/card';\nimport { Button } from '@withpotter/ui-kit/button';\nimport { DateField } from '@withpotter/ui-kit/date-field';\nimport { TimeField } from '@withpotter/ui-kit/time-field';\nimport { DetailColumns } from '@withpotter/ui-kit/detail-columns';\nimport { Field } from '@withpotter/ui-kit/field';\nimport { OptionButton } from '@withpotter/ui-kit/option-button';\nimport { ErrorBanner } from '@withpotter/ui-kit/error-banner';\nimport { Input } from '@withpotter/ui-kit';\n\nexport interface AddToWaitlistData {\n customerEmail: string;\n customerName?: string;\n customerPhone?: string;\n requestedDate: string;\n requestedStartTime?: string;\n requestedEndTime?: string;\n partySize?: number;\n priority?: 'normal' | 'high' | 'urgent';\n}\n\nconst PRIORITIES: { key: 'normal' | 'high' | 'urgent'; label: string }[] = [\n { key: 'normal', label: 'Normal' },\n { key: 'high', label: 'High' },\n { key: 'urgent', label: 'Urgent' },\n];\n\n/** The submit button sits in the other column, so it points at the form. */\nconst FORM_ID = 'waitlist-entry';\n\n/**\n * Taking someone's details at the desk and putting them on the list.\n *\n * A screen, not a modal. This app's rule is that a create screen is a detail\n * screen — it keeps the sidebar and wears breadcrumbs, like the product, the\n * segment and the booking editors do. It shipped as a dialog earlier the same\n * day the booking form was moved OUT of one, which is the inconsistency the\n * rule exists to prevent.\n */\nexport function WaitlistEntryEditor({\n defaultDate,\n saving,\n error,\n onAdd,\n onCancel,\n}: {\n defaultDate: string;\n saving: boolean;\n error?: string | null;\n onAdd: (data: AddToWaitlistData) => void;\n onCancel: () => void;\n}) {\n const [customerName, setCustomerName] = useState('');\n const [customerEmail, setCustomerEmail] = useState('');\n const [customerPhone, setCustomerPhone] = useState('');\n const [requestedDate, setRequestedDate] = useState(defaultDate);\n const [startTime, setStartTime] = useState('');\n const [endTime, setEndTime] = useState('');\n const [partySize, setPartySize] = useState('1');\n const [priority, setPriority] = useState<'normal' | 'high' | 'urgent'>(\n 'normal',\n );\n\n // Email is what the engine notifies on, so it is the one thing that cannot\n // be skipped — an entry without it can be offered a slot and never told.\n const canSubmit = Boolean(customerEmail.trim() && requestedDate) && !saving;\n\n const submit = (e: React.FormEvent) => {\n e.preventDefault();\n if (!canSubmit) return;\n onAdd({\n customerEmail: customerEmail.trim(),\n customerName: customerName.trim() || undefined,\n customerPhone: customerPhone.trim() || undefined,\n requestedDate,\n requestedStartTime: startTime || undefined,\n requestedEndTime: endTime || undefined,\n partySize: Number(partySize) || undefined,\n priority,\n });\n };\n\n return (\n <DetailColumns\n aside={\n <>\n <Card className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold text-[var(--text-primary)]\">\n {customerName || customerEmail || 'New entry'}\n </h2>\n <dl className=\"space-y-2 text-sm\">\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-[var(--text-tertiary)]\">Wants</dt>\n <dd className=\"text-right text-[var(--text-primary)]\">\n {requestedDate || 'Not set'}\n {startTime ? ` · ${startTime}` : ''}\n </dd>\n </div>\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-[var(--text-tertiary)]\">Priority</dt>\n <dd className=\"text-right text-[var(--text-primary)]\">\n {PRIORITIES.find((p) => p.key === priority)?.label}\n </dd>\n </div>\n </dl>\n </Card>\n\n <div className=\"flex flex-col gap-2\">\n <Button type=\"submit\" form={FORM_ID} loading={saving}>\n {saving ? 'Adding…' : 'Add to list'}\n </Button>\n <Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n Cancel\n </Button>\n </div>\n </>\n }\n >\n <form id={FORM_ID} onSubmit={submit} className=\"space-y-4\">\n <ErrorBanner>{error}</ErrorBanner>\n\n <Card className=\"space-y-4\">\n <div className=\"grid grid-cols-2 gap-3\">\n <Field label=\"Name\">\n <Input\n value={customerName}\n onChange={(e) => setCustomerName(e.target.value)}\n placeholder=\"Customer name\"\n />\n </Field>\n <Field label=\"Phone\">\n <Input\n type=\"tel\"\n value={customerPhone}\n onChange={(e) => setCustomerPhone(e.target.value)}\n placeholder=\"Optional\"\n />\n </Field>\n </div>\n\n <Field\n label=\"Email\"\n required\n hint=\"Where the offer is sent when a slot frees.\"\n >\n <Input\n type=\"email\"\n value={customerEmail}\n onChange={(e) => setCustomerEmail(e.target.value)}\n placeholder=\"name@example.com\"\n />\n </Field>\n </Card>\n\n <Card className=\"space-y-4\">\n <Field label=\"Wanted for\" required>\n <DateField value={requestedDate} onChange={setRequestedDate} />\n </Field>\n\n <div className=\"grid grid-cols-3 gap-3\">\n <Field label=\"From\">\n <TimeField value={startTime} onChange={setStartTime} />\n </Field>\n <Field label=\"Until\">\n <TimeField value={endTime} onChange={setEndTime} />\n </Field>\n <Field label=\"People\">\n <Input\n type=\"number\"\n min={1}\n inputMode=\"numeric\"\n value={partySize}\n onChange={(e) => setPartySize(e.target.value)}\n className=\"tabular-nums\"\n />\n </Field>\n </div>\n\n <Field label=\"Priority\">\n <div className=\"flex flex-wrap gap-2\">\n {PRIORITIES.map((p) => (\n <OptionButton\n key={p.key}\n selected={priority === p.key}\n onClick={() => setPriority(p.key)}\n >\n {p.label}\n </OptionButton>\n ))}\n </div>\n </Field>\n </Card>\n </form>\n </DetailColumns>\n );\n}\n"],"mappings":";AAwFQ,mBAEI,KAMI,YARR;AAtFR,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,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+
import { useRouter } from "next/navigation";
|
|
5
|
+
import { ListChecks } from "lucide-react";
|
|
6
|
+
import { DetailPage } from "@withpotter/ui-kit/detail-page";
|
|
7
|
+
import { useAuth } from "@withpotter/lib/auth-context";
|
|
8
|
+
import { waitlistApi } from "@withpotter/lib/api/waitlist";
|
|
9
|
+
import {
|
|
10
|
+
WaitlistEntryEditor
|
|
11
|
+
} from "../_components/waitlist-entry-editor";
|
|
12
|
+
function NewWaitlistEntryPage() {
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
const { tenant } = useAuth();
|
|
15
|
+
const [saving, setSaving] = useState(false);
|
|
16
|
+
const [error, setError] = useState(null);
|
|
17
|
+
const handleAdd = async (data) => {
|
|
18
|
+
if (!tenant?.slug) return;
|
|
19
|
+
setSaving(true);
|
|
20
|
+
setError(null);
|
|
21
|
+
try {
|
|
22
|
+
await waitlistApi.add(tenant.slug, data);
|
|
23
|
+
router.push("/dashboard/waitlist");
|
|
24
|
+
} catch (err) {
|
|
25
|
+
setError(
|
|
26
|
+
err instanceof Error ? err.message : "Could not add that entry."
|
|
27
|
+
);
|
|
28
|
+
setSaving(false);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
DetailPage,
|
|
33
|
+
{
|
|
34
|
+
maxWidth: "max-w-6xl",
|
|
35
|
+
breadcrumbs: [
|
|
36
|
+
{
|
|
37
|
+
label: "Waitlist",
|
|
38
|
+
href: "/dashboard/waitlist",
|
|
39
|
+
icon: /* @__PURE__ */ jsx(ListChecks, {})
|
|
40
|
+
},
|
|
41
|
+
{ label: "New entry" }
|
|
42
|
+
],
|
|
43
|
+
children: /* @__PURE__ */ jsx(
|
|
44
|
+
WaitlistEntryEditor,
|
|
45
|
+
{
|
|
46
|
+
defaultDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
47
|
+
saving,
|
|
48
|
+
error,
|
|
49
|
+
onAdd: handleAdd,
|
|
50
|
+
onCancel: () => router.push("/dashboard/waitlist")
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
NewWaitlistEntryPage as default
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/dashboard/%28bookings%29/waitlist/new/page.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { useRouter } from 'next/navigation';\nimport { ListChecks } from 'lucide-react';\nimport { DetailPage } from '@withpotter/ui-kit/detail-page';\nimport { useAuth } from '@withpotter/lib/auth-context';\nimport { waitlistApi } from '@withpotter/lib/api/waitlist';\nimport {\n WaitlistEntryEditor,\n type AddToWaitlistData,\n} from '../_components/waitlist-entry-editor';\n\n/**\n * Putting somebody on the list, as a screen.\n *\n * It was a dialog, shipped hours after the booking form was moved out of one —\n * the same inconsistency, on the same surface, in the same day. A create screen\n * is a detail screen here.\n */\nexport default function NewWaitlistEntryPage() {\n const router = useRouter();\n const { tenant } = useAuth();\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleAdd = async (data: AddToWaitlistData) => {\n if (!tenant?.slug) return;\n setSaving(true);\n setError(null);\n try {\n await waitlistApi.add(tenant.slug, data);\n router.push('/dashboard/waitlist');\n } catch (err) {\n setError(\n err instanceof Error ? err.message : 'Could not add that entry.',\n );\n setSaving(false);\n }\n };\n\n return (\n <DetailPage\n maxWidth=\"max-w-6xl\"\n breadcrumbs={[\n {\n label: 'Waitlist',\n href: '/dashboard/waitlist',\n icon: <ListChecks />,\n },\n { label: 'New entry' },\n ]}\n >\n <WaitlistEntryEditor\n defaultDate={new Date().toISOString().slice(0, 10)}\n saving={saving}\n error={error}\n onAdd={handleAdd}\n onCancel={() => router.push('/dashboard/waitlist')}\n />\n </DetailPage>\n );\n}\n"],"mappings":";AAgDgB;AA9ChB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,OAEK;AASQ,SAAR,uBAAwC;AAC7C,QAAM,SAAS,UAAU;AACzB,QAAM,EAAE,OAAO,IAAI,QAAQ;AAC3B,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,IAAI;AAEtD,QAAM,YAAY,OAAO,SAA4B;AACnD,QAAI,CAAC,QAAQ,KAAM;AACnB,cAAU,IAAI;AACd,aAAS,IAAI;AACb,QAAI;AACF,YAAM,YAAY,IAAI,OAAO,MAAM,IAAI;AACvC,aAAO,KAAK,qBAAqB;AAAA,IACnC,SAAS,KAAK;AACZ;AAAA,QACE,eAAe,QAAQ,IAAI,UAAU;AAAA,MACvC;AACA,gBAAU,KAAK;AAAA,IACjB;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAS;AAAA,MACT,aAAa;AAAA,QACX;AAAA,UACE,OAAO;AAAA,UACP,MAAM;AAAA,UACN,MAAM,oBAAC,cAAW;AAAA,QACpB;AAAA,QACA,EAAE,OAAO,YAAY;AAAA,MACvB;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,cAAa,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AAAA,UACjD;AAAA,UACA;AAAA,UACA,OAAO;AAAA,UACP,UAAU,MAAM,OAAO,KAAK,qBAAqB;AAAA;AAAA,MACnD;AAAA;AAAA,EACF;AAEJ;","names":[]}
|