@meetelise/chat 1.20.97 → 1.20.99

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.
@@ -1,4 +1,4 @@
1
- import { css, html, LitElement, PropertyValueMap, TemplateResult } from "lit";
1
+ import { html, LitElement, PropertyValueMap, TemplateResult } from "lit";
2
2
  import { customElement, property, query, state } from "lit/decorators.js";
3
3
  import {
4
4
  shortcutKeyIsPressed,
@@ -34,6 +34,7 @@ import postLeadSources from "../../postLeadSources";
34
34
  import { FeatureFlagsShowDropdown } from "../../fetchFeatureFlag";
35
35
  import { pushGtmEvent } from "../../gtm";
36
36
  import disclaimer from "../../disclaimers";
37
+ import { tourSchedulerStyles } from "./tourSchedulerStyles";
37
38
 
38
39
  const getHumanReadableLayout = (layout: string) => {
39
40
  if (layout == "studio") return "Studio";
@@ -117,6 +118,9 @@ export class TourScheduler extends LitElement {
117
118
  @property({ attribute: true })
118
119
  featureFlagShowDropdown = "";
119
120
 
121
+ @property({ attribute: true })
122
+ compactDesign = false;
123
+
120
124
  @query(".nameContainer#firstName input")
121
125
  firstNameInput!: HTMLInputElement;
122
126
  @query(".nameContainer#lastName input")
@@ -461,405 +465,11 @@ export class TourScheduler extends LitElement {
461
465
  }
462
466
  };
463
467
 
464
- static styles = [
465
- css`
466
- * {
467
- box-sizing: border-box;
468
- }
469
-
470
- .tour-scheduler {
471
- position: fixed;
472
- left: 50%;
473
- top: 50%;
474
- transform: translate(-50%, -50%);
475
- width: 1018px;
476
- height: 573px;
477
- background: #ffffff;
478
- box-shadow: 0px 16px 18px 10px rgba(21, 21, 21, 0.4);
479
- border-radius: 10px;
480
- font-family: "Helvetica Neue", Arial;
481
- color: #202020;
482
- padding: 0 25px 0 27px;
483
-
484
- /* grid stuff */
485
- display: grid;
486
- grid-template-columns: 229px 432px 305px;
487
- grid-template-rows: 44px 54px 32px 245px 117px 1px;
488
- }
489
-
490
- @media screen and (max-width: 1000px) {
491
- .tour-scheduler {
492
- transform: translate(-50%, -50%) scale(0.8, 0.6);
493
- }
494
- }
495
-
496
- h1,
497
- h2 {
498
- margin: 0;
499
- }
500
-
501
- .tour-scheduler > :is(h1, h2) {
502
- align-self: end;
503
- }
504
-
505
- h1 {
506
- font-size: 14px;
507
- font-weight: 700;
508
- }
509
-
510
- h1#scheduleATour {
511
- grid-row: 1 / 2;
512
- grid-column: 1;
513
- align-self: end;
514
- z-index: 1; // idk why, but it's invisible on the confirmation page otherwise
515
- }
516
-
517
- button#closeButton {
518
- grid-row: 1 / 2;
519
- grid-column: 3;
520
- background: none;
521
- border: none;
522
- align-self: end;
523
- justify-self: end;
524
- z-index: 1; // idk why, but it's invisible on the confirmation page otherwise
525
- }
526
-
527
- /*
528
- makes button fit size of SVG:
529
- https://stackoverflow.com/questions/45423874/button-height-is-greater-than-the-nested-contents-height
530
- otherwise there's some empty space at the bottom of the button, which interferes with vertical centering
531
- */
532
- button#closeButton > svg {
533
- vertical-align: middle;
534
- }
535
-
536
- #tourTypeMenu {
537
- grid-row: 4 / 5;
538
- grid-column: 1;
539
- align-self: start;
540
- display: flex;
541
- flex-direction: column;
542
- gap: 15px;
543
- }
544
-
545
- h2 {
546
- font-weight: 600;
547
- font-size: 14px;
548
- grid-row: label-row;
549
- }
550
-
551
- h2#tourType {
552
- grid-column: 1;
553
- grid-row: 2;
554
- }
555
-
556
- h2#dateAndTime {
557
- grid-column: 2;
558
- grid-row: 2;
559
- }
560
-
561
- h2#yourInformation {
562
- grid-column: 3;
563
- grid-row: 2;
564
- }
565
-
566
- #datePicker {
567
- display: flex;
568
- }
569
-
570
- #dateAndTimeMenu {
571
- grid-row: 4 / 5;
572
- grid-column: 2;
573
- align-self: start;
574
- display: flex;
575
- flex-direction: column;
576
- }
577
-
578
- #yourInformationMenu {
579
- grid-row: 4 / 5;
580
- grid-column: 3;
581
- display: flex;
582
- flex-direction: column;
583
- gap: 12px;
584
- }
585
-
586
- #yourInformationMenu input {
587
- width: 100%;
588
- height: 49px;
589
- }
590
-
591
- .unitLayoutChoices {
592
- grid-row: 5 / 6;
593
- grid-column: 3;
594
- align-self: start;
595
- display: flex;
596
- flex-direction: column;
597
- }
598
- .unitLayoutChoicesDropdowns {
599
- display: flex;
600
- justify-content: space-between;
601
- gap: 6px;
602
- }
603
-
604
- .unitLayoutChoice {
605
- margin-bottom: 12px;
606
- width: -webkit-fill-available;
607
- }
608
-
609
- h2.unitLayoutChoice {
610
- margin-bottom: 7px;
611
- }
612
-
613
- .unitLayoutOptions {
614
- display: flex;
615
- flex-direction: column;
616
- gap: 8px;
617
- }
618
-
619
- hr {
620
- grid-row: 6;
621
- grid-column: 1 / 5;
622
- /* remove side margins because of this
623
- * (https://stackoverflow.com/questions/34365271/hr-inside-container-with-display-flex-become-corrupted)
624
- * and top/bottom margins to position the line exactly at the gridline
625
- */
626
- margin: 0;
627
- }
628
-
629
- .explanation {
630
- font-weight: 400;
631
- font-size: 12px;
632
- grid-row: 7;
633
- grid-column: 1 / 3;
634
- align-self: start;
635
- margin: 0;
636
- padding-top: 32px;
637
- }
638
- .withDisclaimer {
639
- padding-top: 16px;
640
- }
641
-
642
- #schedule {
643
- width: 145px;
644
- height: 50px;
645
- grid-row: 7;
646
- grid-column: 3;
647
- justify-self: end;
648
- align-self: start;
649
- margin-top: 18px;
650
- }
651
-
652
- #confirmationMessage {
653
- grid-row: 3;
654
- width: 625px;
655
- }
656
-
657
- #confirmationMessage > p {
658
- font-size: 18px;
659
- }
660
-
661
- /* Loading styles: pulsing gray overlay on all the form elements */
662
-
663
- @keyframes spin {
664
- 0% {
665
- transform: none;
666
- }
667
- 50% {
668
- transform: rotateZ(180deg);
669
- }
670
- 100% {
671
- transform: rotateZ(360deg);
672
- }
673
- }
674
-
675
- svg#loadingIcon {
676
- animation: spin 2s infinite linear;
677
- }
678
-
679
- .tour-scheduler.loading #scheduleATour {
680
- display: flex;
681
- gap: 10px;
682
- }
683
-
684
- @keyframes loadingPulse {
685
- 0% {
686
- background-color: #e7e7e7;
687
- }
688
- 50% {
689
- background-color: white;
690
- }
691
- 100% {
692
- background-color: #e7e7e7;
693
- }
694
- }
695
-
696
- tour-type-option,
697
- date-picker,
698
- #yourInformationMenu .inputContainer {
699
- position: relative;
700
- }
701
-
702
- .tour-scheduler.loading
703
- :is(tour-type-option, date-picker, #yourInformationMenu
704
- .inputContainer)::after {
705
- content: "";
706
- position: absolute;
707
- top: 0;
708
- left: 0;
709
- height: 100%;
710
- z-index: 1;
711
- animation: loadingPulse 2s infinite;
712
- }
713
-
714
- .tour-scheduler.loading tour-type-option::after {
715
- border-radius: 10px;
716
- width: 200px;
717
- }
718
-
719
- .tour-scheduler.loading date-picker::after {
720
- border-radius: 10px;
721
- width: 205px;
722
- }
723
-
724
- .tour-scheduler.loading #yourInformationMenu .inputContainer input {
725
- visibility: hidden;
726
- }
727
-
728
- .tour-scheduler.loading time-picker {
729
- display: none;
730
- }
731
-
732
- #namesWrapper {
733
- display: flex;
734
- justify-content: space-between;
735
- }
736
-
737
- .nameContainer {
738
- width: 48%;
739
- }
740
-
741
- .nameInput {
742
- width: 100%;
743
- }
744
-
745
- @media (max-width: 767px) {
746
- /* TODO: separate styles into general, desktop-specific, and mobile-specific.
747
- basically everything I have "unset" or "initial" on should become desktop-specific. the grid layout is only for desktop.
748
- */
749
- .tour-scheduler {
750
- position: fixed;
751
- left: 0;
752
- right: 0;
753
- bottom: 0;
754
- top: initial;
755
- height: 93vh;
756
- width: 100vw;
757
- background: #ffffff;
758
- transform: none;
759
- box-shadow: none;
760
- border-radius: 0;
761
- padding: 25px 20px 0 22px;
762
- display: flex;
763
- flex-direction: column;
764
- }
765
-
766
- #topControls {
767
- display: flex;
768
- justify-content: space-between;
769
- align-items: center;
770
- }
771
-
772
- .tour-scheduler > :is(h1, h2) {
773
- align-self: unset;
774
- }
775
-
776
- /* TODO: this and :disabled is duplicated from Schedule button. make a class,
777
- or better a component, for the button styles
778
- */
779
- button#next {
780
- height: 50px;
781
- /* width: 74px; */
782
- padding: 13px 22px 14px 22px;
783
- align-self: flex-start;
784
- background: #202020;
785
- border: 1px solid #ffffff;
786
- border-radius: 10px;
787
- font-family: "Helvetica Neue", Arial;
788
- font-weight: 700;
789
- font-size: 14px;
790
- color: #ffffff;
791
- box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
792
- margin-top: 22px;
793
- }
794
-
795
- button#next:disabled {
796
- background: #e7e7e7;
797
- box-shadow: none;
798
- }
799
-
800
- h1#scheduleATour {
801
- grid-row: unset;
802
- grid-column: unset;
803
- align-self: unset;
804
- }
805
-
806
- button#closeButton {
807
- grid-row: unset;
808
- grid-column: unset;
809
- align-self: unset;
810
- justify-self: unset;
811
- }
812
-
813
- h2 {
814
- grid-row: unset;
815
- margin-top: 37px;
816
- margin-bottom: 25px;
817
- }
818
-
819
- #tourTypeMenu {
820
- display: flex;
821
- flex-direction: column;
822
- gap: 15px;
823
- margin-bottom: 36px;
824
- }
825
-
826
- h2#tourType {
827
- grid-column: unset;
828
- grid-row: unset;
829
- }
830
-
831
- #datePicker {
832
- display: flex;
833
- flex-direction: column;
834
- gap: 18px;
835
- }
836
-
837
- time-picker {
838
- /* so the Next button doesn't jump when the date is selected and the time slots appear */
839
- height: 93px;
840
- }
841
-
842
- #dateAndTimeMenu {
843
- grid-row: unset;
844
- grid-column: unset;
845
- align-self: unset;
846
- display: unset;
847
- flex-direction: unset;
848
- }
849
-
850
- #confirmationMessage {
851
- grid-row: unset;
852
- width: 90%;
853
- margin-top: 37px;
854
- }
855
- }
856
- `,
857
- InputStyles,
858
- ];
468
+ static styles = [tourSchedulerStyles, InputStyles];
859
469
 
860
470
  tourTypeMenu(): TemplateResult {
861
- return html`<h2 id="tourType">Tour Type</h2>
862
- <div id="tourTypeMenu">
471
+ return html`<h2 class="journey-header">Tour Type</h2>
472
+ <div id="tour-type-menu">
863
473
  ${this.shouldShowTourType[TourType.Guided]
864
474
  ? html` <tour-type-option
865
475
  heading="Guided tour"
@@ -981,8 +591,8 @@ export class TourScheduler extends LitElement {
981
591
  </div>`;
982
592
  }
983
593
 
984
- dateAndTimeMenu(horizontal = false): TemplateResult {
985
- return html`<h2 id="dateAndTime">Date and Time</h2>
594
+ dateAndTimeMenu(): TemplateResult {
595
+ return html`<h2 class="journey-header">Date and Time</h2>
986
596
  <div id="dateAndTimeMenu">
987
597
  <div id="datePicker">
988
598
  <date-picker
@@ -998,7 +608,6 @@ export class TourScheduler extends LitElement {
998
608
  ></date-picker>
999
609
  <time-picker
1000
610
  ?selecteddateexists=${!!this.selectedDate}
1001
- ?horizontal=${horizontal}
1002
611
  .options=${this.selectedDate
1003
612
  ? this.availabilitiesGroupedByDay[
1004
613
  format(this.selectedDate, "y-MM-dd")
@@ -1038,7 +647,7 @@ export class TourScheduler extends LitElement {
1038
647
  }
1039
648
 
1040
649
  closeButton(): TemplateResult {
1041
- return html`<button id="closeButton" @click=${this.onCloseClicked}>
650
+ return html`<button id="close-button" @click=${this.onCloseClicked}>
1042
651
  <svg
1043
652
  width="19"
1044
653
  height="19"
@@ -1081,7 +690,7 @@ export class TourScheduler extends LitElement {
1081
690
  this.mobilePageIndex++;
1082
691
  },
1083
692
  render: (): TemplateResult => {
1084
- return html`${this.dateAndTimeMenu(true)}`;
693
+ return html`${this.dateAndTimeMenu()}`;
1085
694
  },
1086
695
  },
1087
696
  {
@@ -1089,7 +698,7 @@ export class TourScheduler extends LitElement {
1089
698
  // last page gets <action-confirm-button> instead of the regular button
1090
699
  nextButtonText: null,
1091
700
  renderNextButton: (): TemplateResult => html`<action-confirm-button
1092
- id="schedule"
701
+ id="schedule-bttn"
1093
702
  .onClick=${this.submit}
1094
703
  .isLoading=${this.isSubmitting}
1095
704
  height="50px"
@@ -1105,7 +714,7 @@ export class TourScheduler extends LitElement {
1105
714
  ];
1106
715
 
1107
716
  userInfoAndLayoutMenu(): TemplateResult {
1108
- return html`<h2 id="yourInformation">Your information</h2>
717
+ return html`<h2 class="journey-header">Your Information</h2>
1109
718
  <div id="yourInformationMenu">
1110
719
  <div id="namesWrapper">
1111
720
  <div class="nameContainer" id="firstName">
@@ -1195,7 +804,7 @@ export class TourScheduler extends LitElement {
1195
804
  <div class="unitLayoutChoices">
1196
805
  ${
1197
806
  this.layoutOptions.length > 0
1198
- ? html`<h2 class="unitLayoutChoice">
807
+ ? html`<h2 class="what-to-view-subheader">
1199
808
  What would you like to view?
1200
809
  </h2>`
1201
810
  : ""
@@ -1286,9 +895,8 @@ export class TourScheduler extends LitElement {
1286
895
  fill="#202020"
1287
896
  />
1288
897
  </svg>
898
+ <p>Thank you!</p>
1289
899
  <p>
1290
- Thank you!
1291
- <br />
1292
900
  Your
1293
901
  ${{
1294
902
  [TourType.Guided]: "guided",
@@ -1325,59 +933,75 @@ export class TourScheduler extends LitElement {
1325
933
  if (!isMobile()) {
1326
934
  return html`
1327
935
  <div
1328
- class="${classnames("tour-scheduler", {
936
+ class="${classnames({
937
+ "tour-scheduler-full": !this.compactDesign,
938
+ "tour-scheduler-compact": this.compactDesign,
1329
939
  loading: this.waitingForAvailabilities,
1330
940
  })}"
1331
941
  @leadsource="${(e: CustomEvent) =>
1332
942
  (this.selectedLeadSource = e.detail.selectedLeadSource)}"
1333
943
  >
1334
- <h1 id="scheduleATour">
1335
- ${this.waitingForAvailabilities
1336
- ? html`${this.loadingIcon()} Searching availabilities...`
1337
- : "Schedule a tour"}
1338
- </h1>
1339
- ${this.closeButton()}
944
+ <div id="top-header">
945
+ <h1 id="tour-header-title">
946
+ ${this.waitingForAvailabilities
947
+ ? html`${this.loadingIcon()} Searching availabilities...`
948
+ : "Schedule a Tour"}
949
+ </h1>
950
+ ${this.closeButton()}
951
+ </div>
952
+
1340
953
  ${this.tourIsBooked
1341
954
  ? html`
1342
955
  <div class="tour-scheduler">${this.confirmationMessage()}</div>
1343
956
  `
1344
- : html`${this.tourTypeMenu()} ${this.dateAndTimeMenu()}
1345
- ${this.userInfoAndLayoutMenu()}
1346
- <hr />
1347
- <p
1348
- class=${this.phoneInput?.value || this.emailInput?.value
1349
- ? "explanation withDisclaimer"
1350
- : "explanation"}
1351
- >
1352
- We’ll send a confirmation and any follow-ups to your email
1353
- address.
1354
- ${disclaimer({
1355
- buildingName: this.buildingName,
1356
- phoneNumberInput: this.phoneInput?.value,
1357
- emailInput: this.emailInput?.value,
1358
- })}
1359
- </p>
1360
-
1361
- <action-confirm-button
1362
- id="schedule"
1363
- .onClick=${this.submit}
1364
- .isLoading=${this.isSubmitting}
1365
- height="50px"
1366
- width="145px"
1367
- text="Schedule tour"
1368
- ?disabled=${!this.formIsValidForSubmission()}
1369
- ></action-confirm-button>`}
957
+ : html`
958
+ <div id="scheduler-container">
959
+ <div id="book-tour-journey-items">
960
+ <div id="tour-type-menu-outer-container">
961
+ ${this.tourTypeMenu()}
962
+ </div>
963
+ <div id="date-and-time-menu-outer-container">
964
+ ${this.dateAndTimeMenu()}
965
+ </div>
966
+
967
+ <div id="user-info-and-layout-menu-outer-container">
968
+ ${this.userInfoAndLayoutMenu()}
969
+ </div>
970
+ </div>
971
+ </div>
972
+ <div id="tour-scheduler-footer">
973
+ <p class="explanation">
974
+ We’ll send a confirmation and any follow-ups to your email
975
+ address.
976
+ ${disclaimer({
977
+ buildingName: this.buildingName,
978
+ phoneNumberInput: this.phoneInput?.value,
979
+ emailInput: this.emailInput?.value,
980
+ })}
981
+ </p>
982
+
983
+ <action-confirm-button
984
+ id="schedule-bttn"
985
+ .onClick=${this.submit}
986
+ .isLoading=${this.isSubmitting}
987
+ height="50px"
988
+ width="145px"
989
+ text="Schedule tour"
990
+ ?disabled=${!this.formIsValidForSubmission()}
991
+ ></action-confirm-button>
992
+ </div>
993
+ `}
1370
994
  </div>
1371
995
  `;
1372
996
  } else {
1373
997
  const currentPage = this.mobilePages[this.mobilePageIndex];
1374
998
  return html`
1375
999
  <div
1376
- class="${classnames("tour-scheduler", {
1000
+ class="${classnames("tour-scheduler-mobile", {
1377
1001
  loading: this.waitingForAvailabilities,
1378
1002
  })}"
1379
1003
  >
1380
- <div id="topControls">
1004
+ <div id="top-header">
1381
1005
  <h1 id="scheduleATour">
1382
1006
  ${this.waitingForAvailabilities
1383
1007
  ? html`${this.loadingIcon()} Searching availabilities...`
@@ -1385,31 +1009,34 @@ export class TourScheduler extends LitElement {
1385
1009
  </h1>
1386
1010
  ${this.closeButton()}
1387
1011
  </div>
1388
- ${this.tourIsBooked
1389
- ? this.confirmationMessage()
1390
- : html` ${currentPage.render()}
1391
- ${!currentPage.renderNextButton
1392
- ? html` <button
1393
- id="next"
1394
- @click=${currentPage.nextButtonAction}
1395
- ?disabled=${(() => {
1396
- return (
1397
- !currentPage.validate() || this.waitingForAvailabilities
1398
- );
1399
- })()}
1400
- >
1401
- ${currentPage.nextButtonText}
1402
- </button>`
1403
- : currentPage.renderNextButton()}`}
1404
- ${this.mobilePageIndex + 1 === this.mobilePages.length
1405
- ? html`
1406
- ${disclaimer({
1407
- buildingName: this.buildingName,
1408
- phoneNumberInput: this.phoneInput?.value,
1409
- emailInput: this.emailInput?.value,
1410
- })}
1411
- `
1412
- : html``}
1012
+ <div id="mobile-body-container">
1013
+ ${this.tourIsBooked
1014
+ ? this.confirmationMessage()
1015
+ : html` ${currentPage.render()}
1016
+ ${!currentPage.renderNextButton
1017
+ ? html` <button
1018
+ id="mobile-next-bttn"
1019
+ @click=${currentPage.nextButtonAction}
1020
+ ?disabled=${(() => {
1021
+ return (
1022
+ !currentPage.validate() ||
1023
+ this.waitingForAvailabilities
1024
+ );
1025
+ })()}
1026
+ >
1027
+ ${currentPage.nextButtonText}
1028
+ </button>`
1029
+ : currentPage.renderNextButton()}`}
1030
+ ${this.mobilePageIndex + 1 === this.mobilePages.length
1031
+ ? html`
1032
+ ${disclaimer({
1033
+ buildingName: this.buildingName,
1034
+ phoneNumberInput: this.phoneInput?.value,
1035
+ emailInput: this.emailInput?.value,
1036
+ })}
1037
+ `
1038
+ : html``}
1039
+ </div>
1413
1040
  </div>
1414
1041
  `;
1415
1042
  }
@@ -16,7 +16,7 @@ export class TourTypeOption extends LitElement {
16
16
  css`
17
17
  .tour-type-option {
18
18
  height: 90px;
19
- width: 200px;
19
+ width: 100%;
20
20
  background: #e7e7e7;
21
21
  border: 1px solid #ffffff;
22
22
  border-radius: 10px;