@nuxt-customer-portal/planning 0.4.0
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/CHANGELOG.md +61 -0
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/app/components/PlanningAppointmentCreateForm.vue +49 -0
- package/app/components/PlanningAppointmentDetails.vue +163 -0
- package/app/components/PlanningAppointmentDrawer.vue +109 -0
- package/app/components/PlanningAvailabilityCalendar.vue +525 -0
- package/app/components/PlanningDashboardOverview.vue +62 -0
- package/app/components/PlanningDashboardUpcomingAppointments.vue +81 -0
- package/app/components/PlanningPersonalCalendarSettings.vue +218 -0
- package/app/components/PlanningPersonalConnection.vue +68 -0
- package/app/components/PlanningPersonalMeetingSettings.vue +1 -0
- package/app/components/PlanningPolicyFields.vue +196 -0
- package/app/components/PlanningSettingsMembers.vue +50 -0
- package/app/components/PlanningSettingsPolicy.vue +46 -0
- package/app/components/PlanningSettingsSynchronization.vue +433 -0
- package/app/components/PlanningSlotPicker.vue +588 -0
- package/app/components/PlanningTimezoneReadOnlyHover.vue +172 -0
- package/app/components/PlanningTimezoneSelect.vue +101 -0
- package/app/composables/usePlanning.ts +180 -0
- package/app/composables/usePlanningDashboard.ts +4 -0
- package/app/composables/usePlanningTimeDisplay.ts +15 -0
- package/app/pages/admin/planning.vue +36 -0
- package/app/pages/appointments/[id].vue +13 -0
- package/app/pages/appointments/index.vue +384 -0
- package/app/pages/availability.vue +585 -0
- package/app/pages/booking/[slug].vue +298 -0
- package/app/pages/my-appointment-settings.vue +33 -0
- package/app/plugins/planning.ts +5 -0
- package/i18n/locales/en.json +260 -0
- package/i18n/locales/nl.json +260 -0
- package/migrations/0000_baseline.sql +58 -0
- package/migrations/0001_availability_calendar_title.sql +2 -0
- package/migrations/0002_job_activity.sql +11 -0
- package/migrations/0003_deduplicate_availability_jobs.sql +19 -0
- package/migrations/0004_connection_label.sql +2 -0
- package/nuxt.config.ts +15 -0
- package/package.json +55 -0
- package/portal.manifest.mjs +8 -0
- package/server/api/planning/admin/appointments/[id]/audit.get.ts +11 -0
- package/server/api/planning/admin/appointments.get.ts +11 -0
- package/server/api/planning/admin/jobs/[id]/retry.post.ts +26 -0
- package/server/api/planning/admin/jobs.get.ts +199 -0
- package/server/api/planning/admin/policy.get.ts +6 -0
- package/server/api/planning/admin/policy.put.ts +8 -0
- package/server/api/planning/admin/products/[id].put.ts +8 -0
- package/server/api/planning/admin/providers/[userId].patch.ts +8 -0
- package/server/api/planning/admin/providers.get.ts +6 -0
- package/server/api/planning/admin/retry.post.ts +31 -0
- package/server/api/planning/appointments/[id]/availability.get.ts +19 -0
- package/server/api/planning/appointments/[id]/cancel.post.ts +8 -0
- package/server/api/planning/appointments/[id]/files/[assetId].get.ts +17 -0
- package/server/api/planning/appointments/[id]/files.get.ts +28 -0
- package/server/api/planning/appointments/[id]/pending.delete.ts +8 -0
- package/server/api/planning/appointments/[id]/reschedule.put.ts +8 -0
- package/server/api/planning/appointments/[id].get.ts +6 -0
- package/server/api/planning/appointments.get.ts +4 -0
- package/server/api/planning/availability/[id].delete.ts +12 -0
- package/server/api/planning/availability/[id].put.ts +8 -0
- package/server/api/planning/availability.get.ts +6 -0
- package/server/api/planning/availability.post.ts +8 -0
- package/server/api/planning/calendar-busy.get.ts +29 -0
- package/server/api/planning/calendars.get.ts +8 -0
- package/server/api/planning/dashboard.get.ts +36 -0
- package/server/api/planning/google/notifications.post.ts +24 -0
- package/server/api/planning/oauth/[provider]/callback.get.ts +18 -0
- package/server/api/planning/oauth/[provider]/start.post.ts +8 -0
- package/server/api/planning/oauth/[provider].delete.ts +15 -0
- package/server/api/planning/products.get.ts +11 -0
- package/server/api/planning/provider-appointments.get.ts +11 -0
- package/server/api/planning/provider.get.ts +6 -0
- package/server/api/planning/provider.put.ts +8 -0
- package/server/api/store/planning/[productId]/availability.get.ts +8 -0
- package/server/api/store/planning/hold.delete.ts +11 -0
- package/server/api/store/planning/hold.get.ts +36 -0
- package/server/api/store/planning/holds.post.ts +10 -0
- package/server/db/schema/planning.ts +213 -0
- package/server/plugins/openapi.ts +36 -0
- package/server/plugins/planning.ts +6 -0
- package/server/tasks/planning/reconcile.ts +30 -0
- package/server/utils/access.ts +80 -0
- package/server/utils/adapters.ts +468 -0
- package/server/utils/appointments.ts +37 -0
- package/server/utils/booking.ts +619 -0
- package/server/utils/crypto.ts +23 -0
- package/server/utils/jobs.ts +671 -0
- package/server/utils/management.ts +427 -0
- package/server/utils/oauth.ts +104 -0
- package/server/utils/staff-appointments.ts +158 -0
- package/shared/appointment-calendar.ts +82 -0
- package/shared/availability.ts +140 -0
- package/shared/emails.ts +99 -0
- package/shared/feature.ts +78 -0
- package/shared/invitation.ts +58 -0
- package/shared/types.ts +110 -0
- package/shared/validation.ts +77 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Slot } from '../../shared/types'
|
|
3
|
+
import { localParts } from '../../shared/availability'
|
|
4
|
+
import type { HoldResult } from '../composables/usePlanning'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
productId: string
|
|
8
|
+
currency: string
|
|
9
|
+
locale: 'en' | 'nl'
|
|
10
|
+
replacesId?: string
|
|
11
|
+
selectOnly?: boolean
|
|
12
|
+
docked?: boolean
|
|
13
|
+
}>()
|
|
14
|
+
const emit = defineEmits<{ reserved: [hold: HoldResult]; selected: [slot: Slot, timezone: string] }>()
|
|
15
|
+
const api = usePlanning(),
|
|
16
|
+
{ t } = useI18n()
|
|
17
|
+
const { appointmentTime, appointmentRange } = usePlanningTimeDisplay()
|
|
18
|
+
const selectedSlot = ref<Slot>()
|
|
19
|
+
const timesOpen = ref(false)
|
|
20
|
+
const timesHeading = useTemplateRef('timesHeading')
|
|
21
|
+
async function chooseDate(date: string) {
|
|
22
|
+
selectedDate.value = date
|
|
23
|
+
timesOpen.value = true
|
|
24
|
+
await nextTick()
|
|
25
|
+
timesHeading.value?.focus({ preventScroll: true })
|
|
26
|
+
}
|
|
27
|
+
const userTimezone = ref('Europe/Amsterdam')
|
|
28
|
+
const timezone = ref(userTimezone.value),
|
|
29
|
+
now = new Date(),
|
|
30
|
+
month = ref(new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)))
|
|
31
|
+
const selectedDate = ref(''),
|
|
32
|
+
provider = ref('any'),
|
|
33
|
+
slots = ref<Slot[]>([]),
|
|
34
|
+
loading = ref(false),
|
|
35
|
+
busy = ref(false),
|
|
36
|
+
error = ref('')
|
|
37
|
+
const monthLabel = computed(() =>
|
|
38
|
+
new Intl.DateTimeFormat(props.locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(month.value)
|
|
39
|
+
)
|
|
40
|
+
const weekdays = computed(() =>
|
|
41
|
+
Array.from({ length: 7 }, (_, i) =>
|
|
42
|
+
new Intl.DateTimeFormat(props.locale, { weekday: 'short', timeZone: 'UTC' }).format(
|
|
43
|
+
new Date(Date.UTC(2026, 0, 5 + i))
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
const days = computed(() => {
|
|
48
|
+
const first = month.value,
|
|
49
|
+
length = new Date(Date.UTC(first.getUTCFullYear(), first.getUTCMonth() + 1, 0)).getUTCDate(),
|
|
50
|
+
padding = (first.getUTCDay() + 6) % 7
|
|
51
|
+
return [
|
|
52
|
+
...Array.from({ length: padding }, () => ''),
|
|
53
|
+
...Array.from({ length }, (_, i) =>
|
|
54
|
+
new Date(Date.UTC(first.getUTCFullYear(), first.getUTCMonth(), i + 1)).toISOString().slice(0, 10)
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
})
|
|
58
|
+
const providerOptions = computed(() => [
|
|
59
|
+
{ value: 'any', label: t('planning.anyProvider') },
|
|
60
|
+
...[...new Map(slots.value.map((s) => [s.providerUserId, s.providerName])).entries()].map(([value, label]) => ({
|
|
61
|
+
value,
|
|
62
|
+
label
|
|
63
|
+
}))
|
|
64
|
+
])
|
|
65
|
+
const filtered = computed(() =>
|
|
66
|
+
slots.value.filter((s) => provider.value === 'any' || s.providerUserId === provider.value)
|
|
67
|
+
)
|
|
68
|
+
const availableDates = computed(
|
|
69
|
+
() => new Set(filtered.value.map((s) => localParts(new Date(s.start), timezone.value).date))
|
|
70
|
+
)
|
|
71
|
+
const today = computed(() => localParts(now, timezone.value).date)
|
|
72
|
+
function dateState(date: string) {
|
|
73
|
+
if (date < today.value) {
|
|
74
|
+
return 'past'
|
|
75
|
+
}
|
|
76
|
+
if (loading.value) {
|
|
77
|
+
return 'loading'
|
|
78
|
+
}
|
|
79
|
+
return availableDates.value.has(date) ? 'available' : 'unavailable'
|
|
80
|
+
}
|
|
81
|
+
function dateLabel(date: string) {
|
|
82
|
+
const label = new Intl.DateTimeFormat(props.locale, { dateStyle: 'full', timeZone: 'UTC' }).format(
|
|
83
|
+
new Date(`${date}T12:00:00Z`)
|
|
84
|
+
)
|
|
85
|
+
return `${label}: ${t(`planning.calendarDate.${dateState(date)}`)}`
|
|
86
|
+
}
|
|
87
|
+
const daySlots = computed(() => {
|
|
88
|
+
const values = filtered.value.filter((s) => localParts(new Date(s.start), timezone.value).date === selectedDate.value)
|
|
89
|
+
// Any-provider mode shows each instant once; the server binds the chosen concrete provider.
|
|
90
|
+
const candidates = provider.value === 'any' ? [...new Map(values.map((s) => [s.start, s])).values()] : values
|
|
91
|
+
return candidates
|
|
92
|
+
})
|
|
93
|
+
let request = 0
|
|
94
|
+
async function load() {
|
|
95
|
+
const current = ++request
|
|
96
|
+
loading.value = true
|
|
97
|
+
error.value = ''
|
|
98
|
+
try {
|
|
99
|
+
const from = new Date(month.value.getTime() - 14 * 3600000),
|
|
100
|
+
mid = new Date(from.getTime() + 16 * 86400000),
|
|
101
|
+
to = new Date(Date.UTC(month.value.getUTCFullYear(), month.value.getUTCMonth() + 1, 1) + 14 * 3600000)
|
|
102
|
+
const values = (
|
|
103
|
+
await Promise.all([
|
|
104
|
+
api.available(props.productId, { from: from.toISOString(), to: mid.toISOString() }, props.replacesId),
|
|
105
|
+
api.available(props.productId, { from: mid.toISOString(), to: to.toISOString() }, props.replacesId)
|
|
106
|
+
])
|
|
107
|
+
).flat()
|
|
108
|
+
if (current === request) {
|
|
109
|
+
slots.value = values
|
|
110
|
+
if (
|
|
111
|
+
!availableDates.value.has(selectedDate.value) ||
|
|
112
|
+
selectedDate.value.slice(0, 7) !== month.value.toISOString().slice(0, 7)
|
|
113
|
+
) {
|
|
114
|
+
selectedDate.value = ''
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
} catch {
|
|
118
|
+
if (current === request) {
|
|
119
|
+
error.value = t('planning.loadError')
|
|
120
|
+
}
|
|
121
|
+
} finally {
|
|
122
|
+
if (current === request) {
|
|
123
|
+
loading.value = false
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function move(delta: number) {
|
|
128
|
+
month.value = new Date(Date.UTC(month.value.getUTCFullYear(), month.value.getUTCMonth() + delta, 1))
|
|
129
|
+
}
|
|
130
|
+
function choose(slot: Slot) {
|
|
131
|
+
if (props.selectOnly) {
|
|
132
|
+
emit('selected', slot, timezone.value)
|
|
133
|
+
return
|
|
134
|
+
}
|
|
135
|
+
selectedSlot.value = slot
|
|
136
|
+
error.value = ''
|
|
137
|
+
}
|
|
138
|
+
async function confirmTime() {
|
|
139
|
+
const slot = selectedSlot.value
|
|
140
|
+
if (!slot || busy.value || loading.value) {
|
|
141
|
+
return
|
|
142
|
+
}
|
|
143
|
+
busy.value = true
|
|
144
|
+
error.value = ''
|
|
145
|
+
try {
|
|
146
|
+
const previousHoldToken = sessionStorage.getItem(`planning-hold:${props.productId}`) || undefined
|
|
147
|
+
const reservedHold = await api.reserve({
|
|
148
|
+
productId: props.productId,
|
|
149
|
+
providerUserId: slot.providerUserId,
|
|
150
|
+
start: slot.start,
|
|
151
|
+
customerTimezone: timezone.value,
|
|
152
|
+
currency: props.currency,
|
|
153
|
+
locale: props.locale,
|
|
154
|
+
replacesId: props.replacesId,
|
|
155
|
+
previousHoldToken
|
|
156
|
+
})
|
|
157
|
+
sessionStorage.setItem(`planning-hold:${props.productId}`, reservedHold.holdToken)
|
|
158
|
+
emit('reserved', reservedHold)
|
|
159
|
+
} catch {
|
|
160
|
+
selectedSlot.value = undefined
|
|
161
|
+
error.value = t('planning.slotUnavailable')
|
|
162
|
+
await load()
|
|
163
|
+
} finally {
|
|
164
|
+
busy.value = false
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
watch(month, load)
|
|
168
|
+
watch([timezone, provider, () => props.currency], () => {
|
|
169
|
+
selectedSlot.value = undefined
|
|
170
|
+
})
|
|
171
|
+
if (import.meta.client) {
|
|
172
|
+
userTimezone.value = Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
173
|
+
timezone.value = userTimezone.value
|
|
174
|
+
await load()
|
|
175
|
+
}
|
|
176
|
+
</script>
|
|
177
|
+
|
|
178
|
+
<template>
|
|
179
|
+
<div
|
|
180
|
+
class="slot-picker space-y-5"
|
|
181
|
+
:class="{ 'slot-picker--docked': docked, 'slot-picker--times': timesOpen }"
|
|
182
|
+
:aria-busy="loading"
|
|
183
|
+
>
|
|
184
|
+
<div v-if="loading" class="availability-loading" role="status">
|
|
185
|
+
<UIcon name="i-lucide-loader-circle" class="size-4 motion-safe:animate-spin" aria-hidden="true" />
|
|
186
|
+
<span>{{ t('planning.loading') }}</span>
|
|
187
|
+
</div>
|
|
188
|
+
<UAlert v-if="error" variant="outline" color="error" :title="error" />
|
|
189
|
+
<div class="slot-workspace">
|
|
190
|
+
<div class="calendar-content">
|
|
191
|
+
<div class="flex items-center justify-between">
|
|
192
|
+
<UButton
|
|
193
|
+
icon="i-lucide-chevron-left"
|
|
194
|
+
color="neutral"
|
|
195
|
+
variant="ghost"
|
|
196
|
+
:aria-label="t('planning.previousMonth')"
|
|
197
|
+
@click="move(-1)"
|
|
198
|
+
/>
|
|
199
|
+
<h2 class="font-semibold">{{ monthLabel }}</h2>
|
|
200
|
+
<UButton
|
|
201
|
+
icon="i-lucide-chevron-right"
|
|
202
|
+
color="neutral"
|
|
203
|
+
variant="ghost"
|
|
204
|
+
:aria-label="t('planning.nextMonth')"
|
|
205
|
+
@click="move(1)"
|
|
206
|
+
/>
|
|
207
|
+
</div>
|
|
208
|
+
<div class="grid grid-cols-7 gap-1" :aria-label="monthLabel">
|
|
209
|
+
<span v-for="day in weekdays" :key="day" class="text-center text-sm text-muted">{{ day }}</span>
|
|
210
|
+
<template v-for="(date, index) in days" :key="date || index"
|
|
211
|
+
><UButton
|
|
212
|
+
v-if="date"
|
|
213
|
+
:disabled="loading || busy || dateState(date) !== 'available'"
|
|
214
|
+
variant="ghost"
|
|
215
|
+
:aria-label="dateLabel(date)"
|
|
216
|
+
:title="dateLabel(date)"
|
|
217
|
+
:aria-pressed="selectedDate === date"
|
|
218
|
+
class="calendar-date justify-center"
|
|
219
|
+
:class="[`calendar-date--${dateState(date)}`, { 'calendar-date--selected': selectedDate === date }]"
|
|
220
|
+
@click="chooseDate(date)"
|
|
221
|
+
>{{ Number(date.slice(-2)) }}</UButton
|
|
222
|
+
><span v-else
|
|
223
|
+
/></template>
|
|
224
|
+
</div>
|
|
225
|
+
<div class="flex flex-wrap gap-x-5 gap-y-2 text-xs" aria-label="Calendar legend">
|
|
226
|
+
<span class="calendar-key"
|
|
227
|
+
><span class="calendar-key-dot calendar-key-dot--available" />{{
|
|
228
|
+
t('planning.calendarDate.available')
|
|
229
|
+
}}</span
|
|
230
|
+
>
|
|
231
|
+
<span class="calendar-key"
|
|
232
|
+
><span class="calendar-key-dot calendar-key-dot--unavailable" />{{
|
|
233
|
+
t('planning.calendarDate.unavailable')
|
|
234
|
+
}}</span
|
|
235
|
+
>
|
|
236
|
+
<span class="calendar-key calendar-key--past"
|
|
237
|
+
><span class="calendar-key-dot calendar-key-dot--past" />{{ t('planning.calendarDate.past') }}</span
|
|
238
|
+
>
|
|
239
|
+
</div>
|
|
240
|
+
<div class="booking-selectors">
|
|
241
|
+
<UFormField v-if="providerOptions.length > 1" class="border-label-field" :label="t('planning.provider')"
|
|
242
|
+
><USelect v-model="provider" :items="providerOptions" class="w-full"
|
|
243
|
+
/></UFormField>
|
|
244
|
+
<UFormField class="border-label-field booking-timezone" :label="t('planning.timezone')"
|
|
245
|
+
><PlanningTimezoneSelect v-model="timezone" :user-timezone="userTimezone" class="w-full"
|
|
246
|
+
/></UFormField>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
<Transition name="times-slide">
|
|
250
|
+
<section v-if="selectedDate" class="times-panel" :aria-label="t('planning.chooseAppointmentTime')">
|
|
251
|
+
<div class="mobile-times-heading">
|
|
252
|
+
<UButton
|
|
253
|
+
icon="i-lucide-arrow-left"
|
|
254
|
+
color="neutral"
|
|
255
|
+
variant="soft"
|
|
256
|
+
size="lg"
|
|
257
|
+
class="change-date-button min-h-11"
|
|
258
|
+
:disabled="busy"
|
|
259
|
+
@click="timesOpen = false"
|
|
260
|
+
>{{ t('planning.changeDate') }}</UButton
|
|
261
|
+
>
|
|
262
|
+
<h3 ref="timesHeading" tabindex="-1">
|
|
263
|
+
{{
|
|
264
|
+
new Intl.DateTimeFormat(locale, { dateStyle: 'long', timeZone: 'UTC' }).format(
|
|
265
|
+
new Date(`${selectedDate}T12:00:00Z`)
|
|
266
|
+
)
|
|
267
|
+
}}
|
|
268
|
+
</h3>
|
|
269
|
+
</div>
|
|
270
|
+
<p v-if="selectedDate && !loading && !daySlots.length" role="status">{{ t('planning.noAvailability') }}</p>
|
|
271
|
+
<p v-if="daySlots.length" class="text-sm text-muted">
|
|
272
|
+
{{ t('planning.slotTimesTimezone', { timezone: timezone.replaceAll('_', ' ') }) }}
|
|
273
|
+
</p>
|
|
274
|
+
<div class="slot-grid grid grid-cols-2 gap-2 sm:grid-cols-3">
|
|
275
|
+
<UButton
|
|
276
|
+
v-for="slot in daySlots"
|
|
277
|
+
:key="slot.start + slot.providerUserId"
|
|
278
|
+
:variant="
|
|
279
|
+
selectedSlot?.start === slot.start && selectedSlot?.providerUserId === slot.providerUserId
|
|
280
|
+
? 'solid'
|
|
281
|
+
: 'outline'
|
|
282
|
+
"
|
|
283
|
+
:aria-pressed="selectedSlot?.start === slot.start && selectedSlot?.providerUserId === slot.providerUserId"
|
|
284
|
+
:disabled="busy || loading"
|
|
285
|
+
class="justify-center"
|
|
286
|
+
@click="choose(slot)"
|
|
287
|
+
>{{ appointmentTime(slot.start, timezone) }}</UButton
|
|
288
|
+
>
|
|
289
|
+
</div>
|
|
290
|
+
</section>
|
|
291
|
+
</Transition>
|
|
292
|
+
</div>
|
|
293
|
+
<div v-if="!selectOnly" class="time-confirmation" :class="{ 'time-confirmation--docked': docked }">
|
|
294
|
+
<div class="time-confirmation-inner">
|
|
295
|
+
<div v-if="selectedSlot" class="selected-time-summary" role="status">
|
|
296
|
+
<UIcon name="i-lucide-calendar-check" class="size-5 shrink-0" aria-hidden="true" />
|
|
297
|
+
<div>
|
|
298
|
+
<p class="font-semibold">{{ appointmentRange(selectedSlot.start, selectedSlot.end, timezone) }}</p>
|
|
299
|
+
<p class="text-sm text-muted">{{ selectedSlot.providerName }} · {{ timezone.replaceAll('_', ' ') }}</p>
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
<div v-else class="time-selection-placeholder" aria-hidden="true" />
|
|
303
|
+
<UButton
|
|
304
|
+
class="w-full justify-center"
|
|
305
|
+
size="lg"
|
|
306
|
+
:variant="selectedSlot ? 'solid' : 'outline'"
|
|
307
|
+
icon="i-lucide-arrow-right"
|
|
308
|
+
:disabled="!selectedSlot || loading || busy"
|
|
309
|
+
:loading="busy"
|
|
310
|
+
@click="confirmTime"
|
|
311
|
+
>{{ t('planning.continueToCheckout') }}</UButton
|
|
312
|
+
>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</template>
|
|
317
|
+
|
|
318
|
+
<style scoped>
|
|
319
|
+
.slot-picker {
|
|
320
|
+
position: relative;
|
|
321
|
+
}
|
|
322
|
+
.booking-selectors {
|
|
323
|
+
display: grid;
|
|
324
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
325
|
+
gap: 16px;
|
|
326
|
+
padding-top: 8px;
|
|
327
|
+
}
|
|
328
|
+
.booking-timezone {
|
|
329
|
+
grid-column: 2;
|
|
330
|
+
}
|
|
331
|
+
.border-label-field {
|
|
332
|
+
position: relative;
|
|
333
|
+
}
|
|
334
|
+
.border-label-field :deep(label) {
|
|
335
|
+
position: absolute;
|
|
336
|
+
top: -8px;
|
|
337
|
+
left: 12px;
|
|
338
|
+
z-index: 1;
|
|
339
|
+
padding-inline: 5px;
|
|
340
|
+
background: var(--booking-field-background, var(--checkout-paper, var(--ui-bg)));
|
|
341
|
+
color: var(--checkout-muted, var(--ui-text-muted));
|
|
342
|
+
font-size: 0.75rem;
|
|
343
|
+
line-height: 16px;
|
|
344
|
+
}
|
|
345
|
+
.border-label-field :deep(button[role='combobox']),
|
|
346
|
+
.border-label-field :deep(select) {
|
|
347
|
+
height: 32px;
|
|
348
|
+
min-height: 32px;
|
|
349
|
+
}
|
|
350
|
+
.calendar-content {
|
|
351
|
+
display: contents;
|
|
352
|
+
}
|
|
353
|
+
.slot-workspace {
|
|
354
|
+
display: contents;
|
|
355
|
+
}
|
|
356
|
+
.mobile-times-heading {
|
|
357
|
+
display: none;
|
|
358
|
+
}
|
|
359
|
+
.change-date-button {
|
|
360
|
+
border-radius: 8px;
|
|
361
|
+
background: color-mix(in srgb, var(--checkout-display, var(--ui-text)) 9%, var(--checkout-surface, var(--ui-bg)));
|
|
362
|
+
color: var(--checkout-display, var(--ui-text));
|
|
363
|
+
font-weight: 600;
|
|
364
|
+
}
|
|
365
|
+
.change-date-button:hover {
|
|
366
|
+
background: color-mix(in srgb, var(--checkout-display, var(--ui-text)) 15%, var(--checkout-surface, var(--ui-bg)));
|
|
367
|
+
}
|
|
368
|
+
.times-panel {
|
|
369
|
+
display: grid;
|
|
370
|
+
gap: 12px;
|
|
371
|
+
}
|
|
372
|
+
.time-confirmation-inner {
|
|
373
|
+
display: grid;
|
|
374
|
+
gap: 12px;
|
|
375
|
+
}
|
|
376
|
+
.slot-picker--docked {
|
|
377
|
+
padding-bottom: 0;
|
|
378
|
+
}
|
|
379
|
+
.slot-picker--docked .slot-workspace {
|
|
380
|
+
display: grid;
|
|
381
|
+
}
|
|
382
|
+
.slot-picker--docked .calendar-content {
|
|
383
|
+
display: grid;
|
|
384
|
+
gap: 12px;
|
|
385
|
+
grid-area: 1 / 1;
|
|
386
|
+
}
|
|
387
|
+
.slot-picker--docked.slot-picker--times .calendar-content {
|
|
388
|
+
visibility: hidden;
|
|
389
|
+
pointer-events: none;
|
|
390
|
+
}
|
|
391
|
+
.slot-picker--docked:not(.slot-picker--times) .times-panel {
|
|
392
|
+
display: none;
|
|
393
|
+
}
|
|
394
|
+
.slot-picker--docked .mobile-times-heading {
|
|
395
|
+
display: grid;
|
|
396
|
+
justify-items: start;
|
|
397
|
+
gap: 12px;
|
|
398
|
+
}
|
|
399
|
+
.slot-picker--docked .times-panel {
|
|
400
|
+
grid-area: 1 / 1;
|
|
401
|
+
min-height: 0;
|
|
402
|
+
max-height: 100%;
|
|
403
|
+
overflow-y: auto;
|
|
404
|
+
align-content: start;
|
|
405
|
+
animation: times-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
406
|
+
}
|
|
407
|
+
.time-confirmation--docked {
|
|
408
|
+
position: sticky;
|
|
409
|
+
bottom: 0;
|
|
410
|
+
z-index: 40;
|
|
411
|
+
margin: 0;
|
|
412
|
+
padding: 16px max(16px, env(safe-area-inset-left)) calc(16px + env(safe-area-inset-bottom));
|
|
413
|
+
background: var(--checkout-surface, var(--ui-bg));
|
|
414
|
+
color: var(--checkout-display, var(--ui-text));
|
|
415
|
+
border-top: 1px solid var(--checkout-border, var(--ui-border));
|
|
416
|
+
}
|
|
417
|
+
.time-confirmation--docked .time-confirmation-inner {
|
|
418
|
+
width: min(1120px, 100%);
|
|
419
|
+
margin-inline: auto;
|
|
420
|
+
grid-template-columns: minmax(0, 1fr);
|
|
421
|
+
align-items: center;
|
|
422
|
+
gap: 8px;
|
|
423
|
+
}
|
|
424
|
+
.time-confirmation--docked button {
|
|
425
|
+
width: 100%;
|
|
426
|
+
white-space: nowrap;
|
|
427
|
+
min-height: 44px;
|
|
428
|
+
}
|
|
429
|
+
.time-confirmation--docked .selected-time-summary,
|
|
430
|
+
.time-confirmation--docked .time-selection-placeholder {
|
|
431
|
+
min-height: 48px;
|
|
432
|
+
}
|
|
433
|
+
@media (max-width: 960px) {
|
|
434
|
+
.slot-picker--docked {
|
|
435
|
+
padding-bottom: calc(200px + env(safe-area-inset-bottom));
|
|
436
|
+
}
|
|
437
|
+
.time-confirmation--docked {
|
|
438
|
+
position: fixed;
|
|
439
|
+
inset: auto 0 0;
|
|
440
|
+
}
|
|
441
|
+
.slot-picker--docked .calendar-content {
|
|
442
|
+
display: grid;
|
|
443
|
+
gap: 8px;
|
|
444
|
+
}
|
|
445
|
+
.slot-picker--docked:not(.slot-picker--times) .times-panel {
|
|
446
|
+
display: none;
|
|
447
|
+
}
|
|
448
|
+
.slot-picker--docked .mobile-times-heading {
|
|
449
|
+
display: grid;
|
|
450
|
+
justify-items: start;
|
|
451
|
+
gap: 12px;
|
|
452
|
+
}
|
|
453
|
+
.slot-picker--docked .times-panel {
|
|
454
|
+
animation: times-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
455
|
+
}
|
|
456
|
+
.time-confirmation--docked .time-confirmation-inner {
|
|
457
|
+
grid-template-columns: minmax(0, 1fr);
|
|
458
|
+
gap: 8px;
|
|
459
|
+
}
|
|
460
|
+
.time-confirmation--docked button {
|
|
461
|
+
width: 100%;
|
|
462
|
+
}
|
|
463
|
+
.time-confirmation--docked .selected-time-summary {
|
|
464
|
+
font-size: 0.9rem;
|
|
465
|
+
}
|
|
466
|
+
.slot-picker--docked .calendar-date {
|
|
467
|
+
min-height: 44px;
|
|
468
|
+
}
|
|
469
|
+
.slot-picker--docked .slot-grid button {
|
|
470
|
+
min-height: 44px;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
@keyframes times-in {
|
|
474
|
+
from {
|
|
475
|
+
opacity: 0;
|
|
476
|
+
transform: translateX(20px);
|
|
477
|
+
}
|
|
478
|
+
to {
|
|
479
|
+
opacity: 1;
|
|
480
|
+
transform: none;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
@media (prefers-reduced-motion: reduce) {
|
|
484
|
+
.slot-picker--docked .times-panel {
|
|
485
|
+
animation: none;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
.availability-loading {
|
|
489
|
+
position: absolute;
|
|
490
|
+
top: 0;
|
|
491
|
+
right: 0;
|
|
492
|
+
z-index: 1;
|
|
493
|
+
display: flex;
|
|
494
|
+
align-items: center;
|
|
495
|
+
gap: 8px;
|
|
496
|
+
padding: 6px 12px;
|
|
497
|
+
border-radius: 999px;
|
|
498
|
+
color: var(--checkout-accent, var(--ui-primary));
|
|
499
|
+
background: var(--ui-bg, white);
|
|
500
|
+
box-shadow: 0 2px 10px rgb(0 0 0 / 6%);
|
|
501
|
+
font-size: 0.875rem;
|
|
502
|
+
}
|
|
503
|
+
.slot-grid {
|
|
504
|
+
min-height: 152px;
|
|
505
|
+
align-content: start;
|
|
506
|
+
}
|
|
507
|
+
.time-confirmation {
|
|
508
|
+
display: grid;
|
|
509
|
+
gap: 12px;
|
|
510
|
+
padding-top: 16px;
|
|
511
|
+
border-top: 1px solid var(--checkout-border, var(--ui-border));
|
|
512
|
+
}
|
|
513
|
+
.selected-time-summary {
|
|
514
|
+
display: flex;
|
|
515
|
+
align-items: flex-start;
|
|
516
|
+
gap: 12px;
|
|
517
|
+
color: var(--checkout-display, var(--ui-text));
|
|
518
|
+
}
|
|
519
|
+
.selected-time-summary > span {
|
|
520
|
+
color: var(--checkout-accent, var(--ui-primary));
|
|
521
|
+
}
|
|
522
|
+
.calendar-date {
|
|
523
|
+
min-height: 42px;
|
|
524
|
+
border-radius: 8px;
|
|
525
|
+
border: 1px solid transparent;
|
|
526
|
+
opacity: 1;
|
|
527
|
+
}
|
|
528
|
+
.calendar-date--available {
|
|
529
|
+
color: var(--checkout-accent, var(--ui-primary));
|
|
530
|
+
background: color-mix(in srgb, var(--checkout-accent, var(--ui-primary)) 10%, transparent);
|
|
531
|
+
border-color: color-mix(in srgb, var(--checkout-accent, var(--ui-primary)) 35%, transparent);
|
|
532
|
+
font-weight: 600;
|
|
533
|
+
}
|
|
534
|
+
.calendar-date--available:hover {
|
|
535
|
+
background: color-mix(in srgb, var(--checkout-accent, var(--ui-primary)) 20%, transparent);
|
|
536
|
+
}
|
|
537
|
+
.calendar-date--selected {
|
|
538
|
+
color: white;
|
|
539
|
+
background: var(--checkout-accent, var(--ui-primary));
|
|
540
|
+
border-color: var(--checkout-accent, var(--ui-primary));
|
|
541
|
+
}
|
|
542
|
+
.calendar-date--selected:hover {
|
|
543
|
+
background: var(--checkout-accent, var(--ui-primary));
|
|
544
|
+
}
|
|
545
|
+
.calendar-date--past {
|
|
546
|
+
color: var(--checkout-muted, var(--ui-text-muted));
|
|
547
|
+
opacity: 0.4;
|
|
548
|
+
text-decoration: line-through;
|
|
549
|
+
}
|
|
550
|
+
.calendar-date--unavailable {
|
|
551
|
+
color: var(--checkout-muted, var(--ui-text-muted));
|
|
552
|
+
background: color-mix(in srgb, var(--checkout-muted, var(--ui-text-muted)) 7%, transparent);
|
|
553
|
+
}
|
|
554
|
+
.calendar-date--loading {
|
|
555
|
+
color: var(--checkout-muted, var(--ui-text-muted));
|
|
556
|
+
opacity: 0.5;
|
|
557
|
+
}
|
|
558
|
+
.calendar-key {
|
|
559
|
+
display: inline-flex;
|
|
560
|
+
align-items: center;
|
|
561
|
+
gap: 6px;
|
|
562
|
+
color: var(--checkout-muted, var(--ui-text-muted));
|
|
563
|
+
}
|
|
564
|
+
.calendar-key-dot {
|
|
565
|
+
width: 10px;
|
|
566
|
+
height: 10px;
|
|
567
|
+
border-radius: 3px;
|
|
568
|
+
border: 1px solid var(--checkout-border, var(--ui-border));
|
|
569
|
+
}
|
|
570
|
+
.calendar-key-dot--available {
|
|
571
|
+
background: color-mix(in srgb, var(--checkout-accent, var(--ui-primary)) 10%, transparent);
|
|
572
|
+
border-color: color-mix(in srgb, var(--checkout-accent, var(--ui-primary)) 35%, transparent);
|
|
573
|
+
}
|
|
574
|
+
.calendar-key-dot--unavailable {
|
|
575
|
+
background: color-mix(in srgb, var(--checkout-muted, var(--ui-text-muted)) 12%, transparent);
|
|
576
|
+
}
|
|
577
|
+
.calendar-key-dot--past {
|
|
578
|
+
background: linear-gradient(
|
|
579
|
+
135deg,
|
|
580
|
+
transparent 43%,
|
|
581
|
+
var(--checkout-muted, var(--ui-text-muted)) 44% 56%,
|
|
582
|
+
transparent 57%
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
.calendar-key--past {
|
|
586
|
+
opacity: 0.6;
|
|
587
|
+
}
|
|
588
|
+
</style>
|