@meetelise/chat 1.75.0 → 1.77.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.
Files changed (31) hide show
  1. package/dist/src/WebComponent/Scheduler/time-picker.d.ts +6 -0
  2. package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +1 -1
  3. package/dist/src/WebComponent/SchedulerV2/contact-form.d.ts +9 -3
  4. package/dist/src/WebComponent/SchedulerV2/itinerary-editor.d.ts +38 -3
  5. package/dist/src/WebComponent/SchedulerV2/itineraryStopStyles.d.ts +1 -2
  6. package/dist/src/WebComponent/SchedulerV2/scheduler-popover.d.ts +18 -1
  7. package/dist/src/WebComponent/SchedulerV2/schedulerIcons.d.ts +18 -0
  8. package/dist/src/WebComponent/SchedulerV2/schedulerV2Styles.d.ts +9 -0
  9. package/dist/src/WebComponent/SchedulerV2/tour-scheduler-v2.d.ts +13 -1
  10. package/dist/src/WebComponent/SchedulerV2/tourTimes.d.ts +1 -1
  11. package/dist/src/WebComponent/actions/international-phone-input.d.ts +7 -0
  12. package/dist/src/WebComponent/me-select.d.ts +2 -0
  13. package/package.json +1 -1
  14. package/public/dist/index.js +2449 -1336
  15. package/src/WebComponent/Scheduler/date-picker.ts +130 -51
  16. package/src/WebComponent/Scheduler/time-picker.ts +62 -0
  17. package/src/WebComponent/Scheduler/tour-type-option.ts +31 -10
  18. package/src/WebComponent/SchedulerV2/booking-confirmation.ts +42 -38
  19. package/src/WebComponent/SchedulerV2/community-picker.ts +222 -160
  20. package/src/WebComponent/SchedulerV2/contact-form.ts +100 -70
  21. package/src/WebComponent/SchedulerV2/itinerary-editor.ts +498 -168
  22. package/src/WebComponent/SchedulerV2/itineraryStopStyles.ts +44 -21
  23. package/src/WebComponent/SchedulerV2/scheduler-popover.ts +105 -9
  24. package/src/WebComponent/SchedulerV2/schedulerIcons.ts +143 -0
  25. package/src/WebComponent/SchedulerV2/schedulerV2Styles.ts +347 -0
  26. package/src/WebComponent/SchedulerV2/tour-scheduler-v2.ts +443 -175
  27. package/src/WebComponent/SchedulerV2/tourTimes.ts +4 -3
  28. package/src/WebComponent/actions/action-confirm-button.ts +4 -3
  29. package/src/WebComponent/actions/international-phone-input.ts +84 -1
  30. package/src/WebComponent/me-select.ts +74 -0
  31. package/src/tourSchedulerV2Booking.test.ts +145 -15
@@ -12,18 +12,26 @@ import "../Scheduler/date-picker";
12
12
  import "../Scheduler/time-picker";
13
13
  import "../Scheduler/tour-type-option";
14
14
  import "../mini-loader";
15
+ import "./scheduler-popover";
15
16
  import type { DatePicker } from "../Scheduler/date-picker";
16
17
  import type { TimePicker, TimePickerOption } from "../Scheduler/time-picker";
17
- import { unselectedTourTypeForegroundColor } from "../Scheduler/tour-type-option";
18
- import { tourSchedulerStyles } from "../Scheduler/tourSchedulerStyles";
19
- import { InputStyles } from "../actions/InputStyles";
20
- import { itineraryStopStyles } from "./itineraryStopStyles";
21
- import floorplanImageCardStyles from "../FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles";
22
- import floorPlanSelectorStyles from "../FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles";
23
- import { GripIcon } from "../icons/GripIcon";
24
- import { PencilIcon } from "../icons/PencilIcon";
25
- import { TrashIcon } from "../icons/TrashIcon";
26
18
  import { defaultPrimaryColor } from "../../themes";
19
+ import { getTimezoneAbbreviation } from "../../getTimezoneString";
20
+ import { isMobile, onMobileChange } from "../../utils";
21
+ import { schedulerV2Styles } from "./schedulerV2Styles";
22
+ import { itineraryStopStyles } from "./itineraryStopStyles";
23
+ import {
24
+ BuildingLineIcon,
25
+ CalendarLineIcon,
26
+ CheckCircleLineIcon,
27
+ GripLineIcon,
28
+ MapPinLineIcon,
29
+ PencilLineIcon,
30
+ PersonPlusLineIcon,
31
+ PlusLineIcon,
32
+ TrashLineIcon,
33
+ VideoLineIcon,
34
+ } from "./schedulerIcons";
27
35
  import {
28
36
  CommunitySummary,
29
37
  formatAddress,
@@ -33,6 +41,7 @@ import {
33
41
  import {
34
42
  dateFromIsoDate,
35
43
  formatLeg,
44
+ formatLongDate,
36
45
  formatMonthDay,
37
46
  formatTime,
38
47
  formatTimeRange,
@@ -53,6 +62,13 @@ export interface StopProblem {
53
62
  text: string;
54
63
  }
55
64
 
65
+ /** The design's line icon for each tour type. */
66
+ const TOUR_TYPE_ICONS: Record<TourTypeId, typeof PersonPlusLineIcon> = {
67
+ "escorted-tour": PersonPlusLineIcon,
68
+ "live-virtual-tour": VideoLineIcon,
69
+ "self-guided-tour": MapPinLineIcon,
70
+ };
71
+
56
72
  /** An API start time as today's time picker shows it. */
57
73
  const timeOption = (iso: string): TimePickerOption => ({
58
74
  displayTime: formatTime(iso),
@@ -134,7 +150,24 @@ export class ItineraryEditor extends LitElement {
134
150
  return this.planned && !this.loading;
135
151
  }
136
152
 
153
+ /** The stop whose "Change date & time" panel is open. */
137
154
  @state() private editingTimeFor: number | null = null;
155
+ /** That panel's calendar is open. */
156
+ @state() private stopDateOpen = false;
157
+ /** The date field's calendar is open. */
158
+ @state() private dateOpen = false;
159
+ @state() private mobile = isMobile();
160
+ private cleanupMobileListener?: () => void;
161
+
162
+ connectedCallback(): void {
163
+ super.connectedCallback();
164
+ this.cleanupMobileListener = onMobileChange((m) => (this.mobile = m));
165
+ }
166
+
167
+ disconnectedCallback(): void {
168
+ this.cleanupMobileListener?.();
169
+ super.disconnectedCallback();
170
+ }
138
171
  @state() private dragIndex: number | null = null;
139
172
  @state() private dropIndex: number | null = null;
140
173
 
@@ -197,13 +230,12 @@ export class ItineraryEditor extends LitElement {
197
230
  if (!this.single) return "";
198
231
  const id = this.stops.find((s) => !s.fixed)?.building_id;
199
232
  const community = id === undefined ? undefined : this.communities.get(id);
200
- return html`<h2 class="journey-header">Community</h2>
201
- <div class="floorplan-image-card community">
202
- <div class="section-right">
203
- <p class="image-card-title">${community?.name ?? ""}</p>
204
- <p class="image-card-subtitle">
205
- ${formatAddress(community?.address ?? null)}
206
- </p>
233
+ return html`<h2 class="section-heading">Community</h2>
234
+ <div class="card community">
235
+ <span class="icon-tile">${BuildingLineIcon(20)}</span>
236
+ <div class="card-text">
237
+ <p class="title">${community?.name ?? ""}</p>
238
+ <p class="subtitle">${formatAddress(community?.address ?? null)}</p>
207
239
  </div>
208
240
  ${this.canEditCommunities
209
241
  ? html`<button
@@ -211,14 +243,16 @@ export class ItineraryEditor extends LitElement {
211
243
  aria-label="Change community"
212
244
  @click=${() => emit(this, "edit-communities", {})}
213
245
  >
214
- ${PencilIcon()}
246
+ ${PencilLineIcon(14)}
215
247
  </button>`
216
248
  : ""}
217
- </div> `;
249
+ </div>`;
218
250
  }
219
251
 
220
252
  private renderTourTypes(): TemplateResult {
221
- return html`<h2 id="tour-type-heading" class="journey-header">Tour Type</h2>
253
+ return html`<h2 id="tour-type-heading" class="section-heading">
254
+ Tour Type
255
+ </h2>
222
256
  <div
223
257
  id="tour-type-menu"
224
258
  role="radiogroup"
@@ -243,9 +277,9 @@ export class ItineraryEditor extends LitElement {
243
277
  }
244
278
  }}
245
279
  >
246
- ${TOUR_TYPES[id].icon(
247
- selected ? this.primaryColor : unselectedTourTypeForegroundColor
248
- )}
280
+ <span slot="icon" class="tour-type-icon"
281
+ >${TOUR_TYPE_ICONS[id](20)}</span
282
+ >
249
283
  </tour-type-option>`;
250
284
  })}
251
285
  </div>
@@ -279,30 +313,175 @@ export class ItineraryEditor extends LitElement {
279
313
  ></date-picker>`;
280
314
  }
281
315
 
282
- /** One stop's own day: moving it there makes it a separate tour. */
283
- private renderStopDatePicker(stop: PlanStop): TemplateResult {
284
- return this.renderDatePicker(stop.dates, isoDate(stop.start), (date) =>
285
- emit(this, "stop-date-change", { buildingId: stop.building_id, date })
286
- );
316
+ /**
317
+ * Closes a calendar when a day is picked, the day already chosen included,
318
+ * which the calendar reports without a date change, and focuses `trigger`.
319
+ * The calendar handles the click first, inside its own shadow root.
320
+ */
321
+ private closeOnDay(close: () => void, trigger: string) {
322
+ return (e: MouseEvent): void => {
323
+ const day = e
324
+ .composedPath()
325
+ .find(
326
+ (n) =>
327
+ n instanceof HTMLButtonElement &&
328
+ n.matches("button.dayNumber:not(:disabled)")
329
+ );
330
+ if (!day) return;
331
+ close();
332
+ this.renderRoot.querySelector<HTMLElement>(trigger)?.focus();
333
+ };
287
334
  }
288
335
 
289
- private renderTimePicker(stop: PlanStop): TemplateResult {
336
+ /**
337
+ * The panel's date field: the stop's own day, which opens the calendar
338
+ * under it. Moving the stop to another day makes it a separate tour.
339
+ */
340
+ private renderStopDateField(stop: PlanStop): TemplateResult {
341
+ const id = stop.building_id;
342
+ const date = isoDate(stop.start);
343
+ const label = formatLongDate(date);
344
+ return html`<p class="field-label" aria-hidden="true">Date</p>
345
+ <scheduler-popover
346
+ class="stop-date-popover"
347
+ ?open=${this.stopDateOpen}
348
+ ?inline=${this.mobile}
349
+ @popover-close=${() => (this.stopDateOpen = false)}
350
+ >
351
+ <button
352
+ id=${`stop-date-trigger-${id}`}
353
+ slot="trigger"
354
+ class="input picker-field"
355
+ aria-expanded=${String(this.stopDateOpen)}
356
+ aria-controls=${`stop-date-panel-${id}`}
357
+ aria-label=${`Date, ${label}`}
358
+ @click=${() => (this.stopDateOpen = !this.stopDateOpen)}
359
+ >
360
+ <span class="value">${label}</span>
361
+ ${CalendarLineIcon(14)}
362
+ </button>
363
+ <div
364
+ id=${`stop-date-panel-${id}`}
365
+ class="stop-calendar-panel"
366
+ @click=${this.closeOnDay(
367
+ () => (this.stopDateOpen = false),
368
+ `#stop-date-trigger-${id}`
369
+ )}
370
+ >
371
+ ${this.stopDateOpen
372
+ ? this.renderDatePicker(stop.dates, date, (picked) =>
373
+ emit(this, "stop-date-change", { buildingId: id, date: picked })
374
+ )
375
+ : ""}
376
+ </div>
377
+ </scheduler-popover>`;
378
+ }
379
+
380
+ /** Closes the stop's panel, and puts focus back on its button. */
381
+ private closeStopPanel(): void {
382
+ const id = this.editingTimeFor;
383
+ this.editingTimeFor = null;
384
+ this.stopDateOpen = false;
385
+ this.renderRoot
386
+ .querySelector<HTMLElement>(`.edit-time[data-building-id="${id}"]`)
387
+ ?.focus();
388
+ }
389
+
390
+ /**
391
+ * The design's "Change date & time" panel, under the stop's pencil (above
392
+ * it when there isn't room, in place on phones): the stop's date when it
393
+ * has another, then its times. Picking a time closes it.
394
+ */
395
+ private renderStopPanel(
396
+ stop: PlanStop,
397
+ canChangeDate: boolean,
398
+ canChangeTime: boolean
399
+ ): TemplateResult {
400
+ const id = stop.building_id;
401
+ const open = this.editingTimeFor === id;
402
+ const name = this.name(id);
403
+ return html`<scheduler-popover
404
+ class="stop-popover"
405
+ fit
406
+ ?open=${open}
407
+ ?inline=${this.mobile}
408
+ @popover-close=${() => {
409
+ // Another stop's pencil opens its own panel before this one hears it.
410
+ if (this.editingTimeFor !== id) return;
411
+ this.editingTimeFor = null;
412
+ this.stopDateOpen = false;
413
+ }}
414
+ >
415
+ <button
416
+ slot="trigger"
417
+ class="icon-button edit-time"
418
+ data-building-id=${id}
419
+ title=${canChangeDate ? "Change date & time" : "Change time"}
420
+ aria-expanded=${String(open)}
421
+ aria-controls=${`stop-panel-${id}`}
422
+ aria-label=${`Change the ${
423
+ canChangeDate ? "date or time" : "time"
424
+ } at ${name}`}
425
+ @click=${() => {
426
+ this.editingTimeFor = open ? null : id;
427
+ this.stopDateOpen = false;
428
+ }}
429
+ >
430
+ ${PencilLineIcon(12)}
431
+ </button>
432
+ <div
433
+ id=${`stop-panel-${id}`}
434
+ class="stop-panel"
435
+ role="group"
436
+ aria-label=${`Date and time at ${name}`}
437
+ >
438
+ ${open && canChangeDate ? this.renderStopDateField(stop) : ""}
439
+ ${
440
+ // While /plan answers, these are the old plan's times, which may
441
+ // be on the stop's old day.
442
+ open && canChangeTime && !this.loading
443
+ ? html`<p
444
+ id=${`stop-time-label-${id}`}
445
+ class="field-label time-label"
446
+ >
447
+ Time (${getTimezoneAbbreviation(stop.timezone)})
448
+ </p>
449
+ <div
450
+ class="stop-times"
451
+ role="group"
452
+ aria-labelledby=${`stop-time-label-${id}`}
453
+ >
454
+ ${this.renderTimePicker(stop, () => this.closeStopPanel())}
455
+ </div>`
456
+ : ""
457
+ }
458
+ </div>
459
+ </scheduler-popover>`;
460
+ }
461
+
462
+ /** A stop's times; `picked` runs once one is picked, the chosen one included. */
463
+ private renderTimePicker(
464
+ stop: PlanStop,
465
+ picked: () => void = () => undefined
466
+ ): TemplateResult {
290
467
  const times = [...new Set([stop.start, ...stop.alternatives])].sort();
291
468
  return html`<time-picker
469
+ outlined
292
470
  selecteddateexists
293
471
  .timezone=${stop.timezone}
294
472
  .options=${times.map(timeOption)}
295
473
  .defaultSelectedTime=${timeOption(stop.start)}
296
474
  @change=${(e: Event) => {
297
- const picked = (e.target as TimePicker).selectedTime;
298
- if (!picked) {
475
+ const time = (e.target as TimePicker).selectedTime;
476
+ if (!time) {
299
477
  // A second click unselects, but every stop needs a time: hand the
300
478
  // picker this stop's time again, which it selects when none is.
301
479
  (e.target as TimePicker).defaultSelectedTime = timeOption(stop.start);
480
+ picked();
302
481
  return;
303
482
  }
304
- const start = `${picked.dateWithTimeZoneOffset.datetime}${picked.dateWithTimeZoneOffset.offset}`;
305
- this.editingTimeFor = null;
483
+ const start = `${time.dateWithTimeZoneOffset.datetime}${time.dateWithTimeZoneOffset.offset}`;
484
+ picked();
306
485
  if (start !== stop.start) {
307
486
  emit(this, "stop-time-change", {
308
487
  buildingId: stop.building_id,
@@ -314,41 +493,75 @@ export class ItineraryEditor extends LitElement {
314
493
  }
315
494
 
316
495
  private renderLinkPrompt(): TemplateResult {
317
- return html`<h2 class="journey-header">Date and Time</h2>
318
- <div id="dateAndTimeMenu">
496
+ return html`<h2 class="section-heading">Date and Time</h2>
497
+ <button
498
+ id="self-guided-redirect-bttn"
499
+ class="primary-button"
500
+ @click=${() => emit(this, "open-tour-link", {})}
501
+ >
502
+ View Tour Times
503
+ </button>`;
504
+ }
505
+
506
+ /**
507
+ * The design's date field: the chosen day, which opens the calendar under
508
+ * it (in place on phones). Picking a day closes it, the day already chosen
509
+ * included, which the calendar reports without a date change.
510
+ */
511
+ private renderDateField(): TemplateResult {
512
+ const label = this.date ? formatLongDate(this.date) : "Select a date";
513
+ return html`<h2 id="date-heading" class="section-heading">Date</h2>
514
+ <scheduler-popover
515
+ class="date-popover"
516
+ ?open=${this.dateOpen}
517
+ ?inline=${this.mobile}
518
+ @popover-close=${() => (this.dateOpen = false)}
519
+ >
319
520
  <button
320
- id="self-guided-redirect-bttn"
321
- @click=${() => emit(this, "open-tour-link", {})}
521
+ id="date-trigger"
522
+ slot="trigger"
523
+ class="input picker-field"
524
+ aria-expanded=${String(this.dateOpen)}
525
+ aria-controls="date-panel"
526
+ aria-label=${`Date, ${label}`}
527
+ @click=${() => (this.dateOpen = !this.dateOpen)}
322
528
  >
323
- View Tour Times
529
+ <span class=${classMap({ value: true, placeholder: !this.date })}
530
+ >${label}</span
531
+ >
532
+ ${CalendarLineIcon(14)}
324
533
  </button>
325
- </div>`;
534
+ <div
535
+ id="date-panel"
536
+ class="calendar-panel"
537
+ @click=${this.closeOnDay(
538
+ () => (this.dateOpen = false),
539
+ "#date-trigger"
540
+ )}
541
+ >
542
+ ${this.renderDatePicker()}
543
+ </div>
544
+ </scheduler-popover>
545
+ ${this.bookableDates.length === 0 && this.offersKnown
546
+ ? html`<p class="explanation">No tour times in the next 30 days.</p>`
547
+ : ""}`;
326
548
  }
327
549
 
328
- private renderSingleDateAndTime(): TemplateResult {
550
+ /** "Time (CDT)": the one community's times, in its own time zone. */
551
+ private renderTimes(): TemplateResult {
329
552
  const stop = this.stops.find((s) => !s.fixed);
330
- return html`<h2 class="journey-header">
331
- Date and Time ${this.loading ? html`<mini-loader></mini-loader>` : ""}
553
+ const zone = stop ? getTimezoneAbbreviation(stop.timezone) : "";
554
+ return html`<h2 class="section-heading">
555
+ ${zone ? `Time (${zone})` : "Time"}
556
+ ${this.loading ? html`<mini-loader></mini-loader>` : ""}
332
557
  </h2>
333
- <div id="dateAndTimeMenu">
334
- <div id="datePicker">
335
- ${this.renderDatePicker()}
336
- ${stop
337
- ? html`<div>${this.renderTimePicker(stop)}</div>`
338
- : html`<p class="explanation">
339
- ${this.bookableDates.length === 0 && this.offersKnown
340
- ? "No tour times in the next 30 days."
341
- : ""}
342
- </p>`}
343
- </div>
344
- </div>`;
558
+ ${stop ? this.renderTimePicker(stop) : ""}`;
345
559
  }
346
560
 
347
561
  private renderStop(stop: PlanStop, index: number): TemplateResult {
348
562
  const community = this.communities.get(stop.building_id);
349
563
  const ids = this.newStopIds();
350
564
  const newIndex = ids.indexOf(stop.building_id);
351
- const editing = this.editingTimeFor === stop.building_id;
352
565
  const canReorder = !stop.fixed && ids.length > 1;
353
566
  // With no other day or time to pick, they're plain text rather than a picker.
354
567
  const canChangeTime =
@@ -376,13 +589,13 @@ export class ItineraryEditor extends LitElement {
376
589
  data-index=${stop.fixed ? nothing : newIndex}
377
590
  >
378
591
  ${index > 0
379
- ? html`<p class="image-card-subtitle leg">
592
+ ? html`<p class="leg">
380
593
  ${leg
381
594
  ? html`${leg}<span class="sr-only"> from the previous stop</span>`
382
595
  : ""}
383
596
  </p>`
384
597
  : ""}
385
- <div class="floorplan-image-card">
598
+ <div class="card stop-card">
386
599
  ${canReorder
387
600
  ? html`<button
388
601
  class="icon-button grip"
@@ -414,47 +627,30 @@ export class ItineraryEditor extends LitElement {
414
627
  this.move(newIndex, to);
415
628
  }}
416
629
  >
417
- ${GripIcon()}
630
+ ${GripLineIcon(14)}
418
631
  </button>`
419
632
  : ""}
420
633
  <span class="stop-number" aria-hidden="true">${index + 1}</span>
421
- <div class="section-right">
422
- <p class="image-card-title">
634
+ <div class="card-text">
635
+ <p class="stop-name">
423
636
  <span class="sr-only">Stop ${index + 1}:</span>
424
637
  ${community?.name ?? ""}
425
638
  </p>
426
- <p class="image-card-subtitle">
427
- ${formatAddress(community?.address ?? null)}
428
- </p>
429
- ${!canChangeTime && !canChangeDate
430
- ? html`<p class="stop-time">
431
- ${time}
432
- ${stop.fixed
433
- ? html`<span class="floor-plan-badge selected">Booked</span>`
434
- : ""}
435
- </p>`
436
- : html`<button
437
- class="stop-time edit-time"
438
- aria-expanded=${String(editing)}
439
- aria-label=${`Change the ${
440
- canChangeDate ? "date or time" : "time"
441
- } at ${community?.name ?? ""}`}
442
- @click=${() =>
443
- (this.editingTimeFor = editing ? null : stop.building_id)}
444
- >
445
- ${time} ${PencilIcon()}
446
- </button>`}
447
- ${editing && canChangeDate ? this.renderStopDatePicker(stop) : ""}
448
- ${
449
- // While /plan answers, these are the old plan's times, which may
450
- // be on the stop's old day.
451
- editing && canChangeTime && !this.loading
452
- ? this.renderTimePicker(stop)
453
- : ""
454
- }
639
+ <p class="subtitle">${formatAddress(community?.address ?? null)}</p>
640
+ <div class="stop-time">
641
+ <span
642
+ >${time}${stop.fixed
643
+ ? html`<span class="sr-only">, booked</span>`
644
+ : ""}</span
645
+ >
646
+ ${canChangeTime || canChangeDate
647
+ ? this.renderStopPanel(stop, canChangeDate, canChangeTime)
648
+ : ""}
649
+ </div>
455
650
  </div>
456
- ${!stop.fixed &&
457
- (ids.length > 1 || this.problems.length > 0 || this.stopsOnly)
651
+ ${stop.fixed
652
+ ? html`<span class="booked-mark">${CheckCircleLineIcon(18, 1)}</span>`
653
+ : ids.length > 1 || this.problems.length > 0 || this.stopsOnly
458
654
  ? this.renderRemove(stop.building_id, community?.name ?? "")
459
655
  : ""}
460
656
  </div>
@@ -467,16 +663,16 @@ export class ItineraryEditor extends LitElement {
467
663
  aria-label=${`Remove ${name}`}
468
664
  @click=${() => emit(this, "stop-remove", { buildingId })}
469
665
  >
470
- ${TrashIcon()}
666
+ ${TrashLineIcon(16)}
471
667
  </button>`;
472
668
  }
473
669
 
474
670
  private renderProblem(problem: StopProblem): TemplateResult {
475
671
  const community = this.communities.get(problem.building_id);
476
672
  return html`<li class="stop-item">
477
- <div class="floorplan-image-card">
478
- <div class="section-right">
479
- <p class="image-card-title">${community?.name ?? ""}</p>
673
+ <div class="card stop-card">
674
+ <div class="card-text">
675
+ <p class="stop-name">${community?.name ?? ""}</p>
480
676
  <p class="error-message">${problem.text}</p>
481
677
  </div>
482
678
  ${this.renderRemove(problem.building_id, community?.name ?? "")}
@@ -486,8 +682,8 @@ export class ItineraryEditor extends LitElement {
486
682
 
487
683
  /** Several communities: the date sits under the tour type, as in the design. */
488
684
  private renderItineraryDate(): TemplateResult {
489
- return html`<h2 class="journey-header date-header">Date</h2>
490
- <div id="datePicker">${this.renderDatePicker()}</div>
685
+ return html`<h2 class="section-heading date-header">Date</h2>
686
+ <div class="calendar-frame">${this.renderDatePicker()}</div>
491
687
  ${this.bookableDates.length === 0 && this.offersKnown
492
688
  ? html`<p class="explanation">
493
689
  These communities have no back-to-back tour times in the next 30
@@ -504,8 +700,8 @@ export class ItineraryEditor extends LitElement {
504
700
  }
505
701
 
506
702
  private renderItinerary(): TemplateResult {
507
- return html`<h2 class="journey-header">
508
- Your Itinerary ${this.loading ? html`<mini-loader></mini-loader>` : ""}
703
+ return html`<h2 class="section-heading">
704
+ Tour Itinerary ${this.loading ? html`<mini-loader></mini-loader>` : ""}
509
705
  </h2>
510
706
  ${this.renderStops()}`;
511
707
  }
@@ -515,140 +711,274 @@ export class ItineraryEditor extends LitElement {
515
711
  return html`${this.renderStops()}
516
712
  ${this.canAddStop
517
713
  ? html`<button
518
- class="floor-plan-badge add-stop"
714
+ class="add-stop"
519
715
  @click=${() => emit(this, "add-stop", {})}
520
716
  >
521
- + Add another stop
717
+ ${PlusLineIcon(18)} Add Another Stop
522
718
  </button>`
523
719
  : ""}`;
524
720
  }
525
- const itinerary = !this.selectedTypeOpensLink && !this.single;
526
- return html`<div id="tour-type-menu-outer-container">
527
- ${this.renderCommunity()} ${this.renderTourTypes()}
528
- ${itinerary ? this.renderItineraryDate() : ""}
721
+ if (!this.single) {
722
+ const itinerary = !this.selectedTypeOpensLink;
723
+ return html`<div id="tour-type-menu-outer-container" class="column">
724
+ ${this.renderTourTypes()}
725
+ ${itinerary ? this.renderItineraryDate() : ""}
726
+ </div>
727
+ <div id="date-and-time-menu-outer-container" class="column">
728
+ ${itinerary ? this.renderItinerary() : this.renderLinkPrompt()}
729
+ </div>`;
730
+ }
731
+ return html`<div id="tour-type-menu-outer-container" class="column">
732
+ ${this.renderCommunity()}
733
+ ${this.selectedTypeOpensLink ? "" : this.renderDateField()}
734
+ ${this.renderTourTypes()}
529
735
  </div>
530
- <div id="date-and-time-menu-outer-container">
736
+ <div id="date-and-time-menu-outer-container" class="column">
531
737
  ${this.selectedTypeOpensLink
532
738
  ? this.renderLinkPrompt()
533
- : this.single
534
- ? this.renderSingleDateAndTime()
535
- : this.renderItinerary()}
739
+ : this.renderTimes()}
536
740
  </div>`;
537
741
  }
538
742
 
539
743
  static styles = [
540
- tourSchedulerStyles,
541
- InputStyles,
542
- floorPlanSelectorStyles,
543
- floorplanImageCardStyles,
744
+ schedulerV2Styles,
544
745
  itineraryStopStyles,
545
746
  css`
546
- /* New layout only: the stop list and the community card's actions. */
547
747
  :host {
548
748
  display: contents;
549
749
  }
550
750
 
551
- .journey-header {
552
- align-items: center;
751
+ .column {
553
752
  display: flex;
554
- gap: 8px;
555
- margin: 0;
753
+ flex-direction: column;
754
+ min-width: 0;
556
755
  }
557
756
 
558
- .floorplan-image-card {
757
+ /* 20px between the left column's sections, as in the design. */
758
+ .column > .section-heading:not(:first-child) {
759
+ margin-top: 20px;
760
+ }
761
+
762
+ .card-text {
763
+ flex: 1;
559
764
  min-width: 0;
560
765
  }
561
766
 
562
767
  .community {
563
768
  align-items: center;
564
- margin-bottom: 8px;
769
+ border-radius: 4px;
770
+ display: flex;
771
+ gap: 12px;
772
+ padding: 7px;
565
773
  }
566
774
 
567
- #tour-type-menu-outer-container .journey-header:not(:first-child) {
568
- margin-top: 4px;
775
+ .change-community {
776
+ height: 28px;
777
+ margin-right: 1px;
569
778
  }
570
779
 
571
- #tour-type-menu-outer-container .journey-header.date-header {
572
- margin-top: 20px;
780
+ #tour-type-menu {
781
+ display: flex;
782
+ flex-direction: column;
783
+ gap: 4px;
573
784
  }
574
785
 
575
- /* The pencil sits centred on the community card's right. */
576
- .icon-button.change-community {
577
- align-self: center;
786
+ .tour-type-icon {
787
+ display: flex;
578
788
  }
579
789
 
580
- .add-stop {
581
- width: 100%;
790
+ #tour-type-menu > .explanation {
791
+ margin-top: 8px;
582
792
  }
583
793
 
584
- .community {
585
- background: #ffffff;
586
- border: 1px solid #e7e7e7;
587
- border-radius: 8px;
794
+ .date-popover {
795
+ display: block;
796
+ --scheduler-popover-padding: 12px;
588
797
  }
589
798
 
590
- .stop-item.dragging {
591
- opacity: 0.5;
799
+ .date-popover .picker-field[aria-expanded="true"] {
800
+ border-color: var(--tsv2-accent);
592
801
  }
593
802
 
594
- .stop-item.drop-target .floorplan-image-card {
595
- border-color: var(--primary-color, #646987);
596
- border-style: dashed;
803
+ .calendar-panel {
804
+ width: 246px;
597
805
  }
598
806
 
599
- .section-right {
600
- flex: 1;
601
- min-width: 0;
807
+ .date-popover[inline] .calendar-panel {
808
+ border: 1px solid var(--tsv2-line);
809
+ border-radius: 8px;
810
+ margin-top: 8px;
811
+ padding: 12px;
812
+ width: auto;
602
813
  }
603
814
 
604
- .icon-button {
605
- align-items: center;
606
- align-self: flex-start;
607
- background: none;
815
+ .calendar-frame {
816
+ border: 1px solid var(--tsv2-line);
817
+ border-radius: 4px;
818
+ margin-top: 8px;
819
+ padding: 12px;
820
+ }
821
+
822
+ .column > .calendar-frame {
823
+ margin-top: 0;
824
+ }
825
+
826
+ .primary-button {
827
+ background: var(--tsv2-accent);
608
828
  border: none;
609
829
  border-radius: 4px;
610
- color: #737373;
830
+ color: var(--on-primary-color, #ffffff);
611
831
  cursor: pointer;
832
+ font: inherit;
833
+ font-size: 12px;
834
+ height: 36px;
835
+ line-height: 16px;
836
+ padding: 0 24px;
837
+ width: 100%;
838
+ }
839
+
840
+ .primary-button:hover {
841
+ opacity: 0.85;
842
+ }
843
+
844
+ /* A stop's time, then its pencil; on phones its panel opens under both. */
845
+ .stop-card .stop-time {
846
+ display: flex;
847
+ flex-wrap: wrap;
848
+ gap: 4px;
849
+ }
850
+
851
+ .edit-time {
852
+ color: var(--tsv2-placeholder);
853
+ height: 16px;
854
+ padding: 0;
855
+ position: relative;
856
+ width: 16px;
857
+ }
858
+
859
+ /* A 32px target around the 16px pencil. */
860
+ .edit-time::after {
861
+ content: "";
862
+ inset: -8px;
863
+ position: absolute;
864
+ }
865
+
866
+ .edit-time:hover {
867
+ color: var(--tsv2-text);
868
+ }
869
+
870
+ /* The design's 360px panel: 16px in, 6px from the pencil. */
871
+ .stop-popover {
872
+ --scheduler-popover-gap: 6px;
873
+ --scheduler-popover-padding: 16px;
874
+ }
875
+
876
+ /* As tall as the pencil, so the panel's 6px are from the pencil itself. */
877
+ .stop-popover:not([inline]) {
878
+ display: flex;
879
+ }
880
+
881
+ .stop-panel {
882
+ width: 326px;
883
+ }
884
+
885
+ .stop-panel > .time-label:not(:first-child) {
886
+ margin-top: 16px;
887
+ }
888
+
889
+ /* Four rows of times, scrolling into the panel's bottom padding. */
890
+ .stop-times {
891
+ margin-bottom: -16px;
892
+ max-height: 160px;
893
+ overflow-y: auto;
894
+ padding-bottom: 16px;
895
+ scrollbar-width: none;
896
+ }
897
+
898
+ .stop-times::-webkit-scrollbar {
899
+ display: none;
900
+ }
901
+
902
+ /* The panel's calendar floats 16px under its date field, as wide. */
903
+ .stop-date-popover {
904
+ display: block;
905
+ --scheduler-popover-gap: 16px;
906
+ --scheduler-popover-padding: 12px;
907
+ }
908
+
909
+ .stop-date-popover .picker-field[aria-expanded="true"] {
910
+ border-color: var(--tsv2-accent);
911
+ }
912
+
913
+ .stop-calendar-panel {
914
+ width: 300px;
915
+ }
916
+
917
+ .stop-popover[inline] .stop-panel {
918
+ margin-top: 8px;
919
+ width: 100%;
920
+ }
921
+
922
+ .stop-popover[inline] .stop-times {
923
+ margin-bottom: 0;
924
+ max-height: none;
925
+ padding-bottom: 0;
926
+ }
927
+
928
+ .stop-date-popover[inline] .stop-calendar-panel {
929
+ border: 1px solid var(--tsv2-line);
930
+ border-radius: 8px;
931
+ margin-top: 8px;
932
+ padding: 12px;
933
+ width: auto;
934
+ }
935
+
936
+ .booked-mark {
612
937
  display: inline-flex;
613
- flex-shrink: 0;
614
- padding: 4px;
938
+ flex: none;
939
+ margin-right: 8px;
615
940
  }
616
941
 
617
- .icon-button:hover {
618
- color: #202020;
942
+ .remove {
943
+ color: #868e96;
944
+ margin-right: 4px;
619
945
  }
620
946
 
621
- /* Beside the stop number, even while the stop's time picker is open. */
622
947
  .grip {
623
948
  cursor: grab;
949
+ margin: 0 -6px 0 -4px;
624
950
  touch-action: none;
625
- padding: 4px 0;
626
951
  }
627
952
 
628
- .stop-time {
629
- align-items: center;
630
- display: inline-flex;
631
- gap: 6px;
953
+ .stop-item.dragging {
954
+ opacity: 0.5;
632
955
  }
633
956
 
634
- .edit-time {
635
- background: none;
957
+ .stop-item.drop-target .stop-card {
958
+ border-color: var(--tsv2-accent);
959
+ border-style: dashed;
960
+ }
961
+
962
+ .add-stop {
963
+ align-items: center;
964
+ background: var(--tsv2-tint);
636
965
  border: none;
637
- color: inherit;
966
+ border-radius: 4px;
967
+ color: var(--tsv2-accent);
638
968
  cursor: pointer;
969
+ display: flex;
639
970
  font: inherit;
640
- font-size: 0.9rem;
641
- padding: 0;
642
- }
643
-
644
- .edit-time svg {
645
- color: #737373;
971
+ font-size: 12px;
972
+ gap: 6px;
973
+ height: 36px;
974
+ justify-content: center;
975
+ line-height: 16px;
976
+ margin-top: 12px;
977
+ width: 100%;
646
978
  }
647
979
 
648
- .stop-time .floor-plan-badge {
649
- cursor: default;
650
- font-size: 0.7rem;
651
- padding: 2px 8px;
980
+ .add-stop:hover {
981
+ background: var(--tsv2-tint-line);
652
982
  }
653
983
  `,
654
984
  ];