@meetelise/chat 1.20.32 → 1.20.34

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.
@@ -26,6 +26,8 @@ import { isNumber, isString, mapValues } from "lodash";
26
26
  import classnames from "classnames";
27
27
  import parseISO from "date-fns/parseISO";
28
28
  import compareAsc from "date-fns/compareAsc";
29
+ import { InputStyles } from "../actions/InputStyles";
30
+ import { classMap } from "lit/directives/class-map.js";
29
31
 
30
32
  const getHumanReadableLayout = (layout: string) => {
31
33
  if (layout == "studio") return "Studio";
@@ -371,400 +373,394 @@ export class TourScheduler extends LitElement {
371
373
  }
372
374
  };
373
375
 
374
- static styles = css`
375
- * {
376
- box-sizing: border-box;
377
- }
378
-
379
- .tour-scheduler {
380
- position: fixed;
381
- left: 50%;
382
- top: 50%;
383
- transform: translate(-50%, -50%);
384
- width: 1018px;
385
- height: 573px;
386
- background: #ffffff;
387
- box-shadow: 0px 16px 18px 10px rgba(21, 21, 21, 0.4);
388
- border-radius: 10px;
389
- font-family: "Poppins";
390
- color: #202020;
391
- padding: 0 25px 0 27px;
392
-
393
- /* grid stuff */
394
- display: grid;
395
- grid-template-columns: 229px 432px 305px;
396
- grid-template-rows: 44px 54px 32px 195px 167px 1px;
397
- }
376
+ static styles = [
377
+ css`
378
+ * {
379
+ box-sizing: border-box;
380
+ }
398
381
 
399
- @media screen and (max-width: 1000px) {
400
382
  .tour-scheduler {
401
- transform: translate(-50%, -50%) scale(0.8, 0.6);
383
+ position: fixed;
384
+ left: 50%;
385
+ top: 50%;
386
+ transform: translate(-50%, -50%);
387
+ width: 1018px;
388
+ height: 573px;
389
+ background: #ffffff;
390
+ box-shadow: 0px 16px 18px 10px rgba(21, 21, 21, 0.4);
391
+ border-radius: 10px;
392
+ font-family: "Poppins";
393
+ color: #202020;
394
+ padding: 0 25px 0 27px;
395
+
396
+ /* grid stuff */
397
+ display: grid;
398
+ grid-template-columns: 229px 432px 305px;
399
+ grid-template-rows: 44px 54px 32px 195px 167px 1px;
402
400
  }
403
- }
404
401
 
405
- h1,
406
- h2 {
407
- margin: 0;
408
- }
402
+ @media screen and (max-width: 1000px) {
403
+ .tour-scheduler {
404
+ transform: translate(-50%, -50%) scale(0.8, 0.6);
405
+ }
406
+ }
409
407
 
410
- .tour-scheduler > :is(h1, h2) {
411
- align-self: end;
412
- }
408
+ h1,
409
+ h2 {
410
+ margin: 0;
411
+ }
413
412
 
414
- h1 {
415
- font-size: 14px;
416
- font-weight: 700;
417
- }
413
+ .tour-scheduler > :is(h1, h2) {
414
+ align-self: end;
415
+ }
418
416
 
419
- h1#scheduleATour {
420
- grid-row: 1 / 2;
421
- grid-column: 1;
422
- align-self: end;
423
- z-index: 1; // idk why, but it's invisible on the confirmation page otherwise
424
- }
417
+ h1 {
418
+ font-size: 14px;
419
+ font-weight: 700;
420
+ }
425
421
 
426
- button#closeButton {
427
- grid-row: 1 / 2;
428
- grid-column: 3;
429
- background: none;
430
- border: none;
431
- align-self: end;
432
- justify-self: end;
433
- z-index: 1; // idk why, but it's invisible on the confirmation page otherwise
434
- }
422
+ h1#scheduleATour {
423
+ grid-row: 1 / 2;
424
+ grid-column: 1;
425
+ align-self: end;
426
+ z-index: 1; // idk why, but it's invisible on the confirmation page otherwise
427
+ }
435
428
 
436
- /*
429
+ button#closeButton {
430
+ grid-row: 1 / 2;
431
+ grid-column: 3;
432
+ background: none;
433
+ border: none;
434
+ align-self: end;
435
+ justify-self: end;
436
+ z-index: 1; // idk why, but it's invisible on the confirmation page otherwise
437
+ }
438
+
439
+ /*
437
440
  makes button fit size of SVG:
438
441
  https://stackoverflow.com/questions/45423874/button-height-is-greater-than-the-nested-contents-height
439
442
  otherwise there's some empty space at the bottom of the button, which interferes with vertical centering
440
443
  */
441
- button#closeButton > svg {
442
- vertical-align: middle;
443
- }
444
-
445
- #tourTypeMenu {
446
- grid-row: 4 / 5;
447
- grid-column: 1;
448
- align-self: start;
449
- display: flex;
450
- flex-direction: column;
451
- gap: 15px;
452
- }
444
+ button#closeButton > svg {
445
+ vertical-align: middle;
446
+ }
453
447
 
454
- h2 {
455
- font-weight: 600;
456
- font-size: 14px;
457
- grid-row: label-row;
458
- }
448
+ #tourTypeMenu {
449
+ grid-row: 4 / 5;
450
+ grid-column: 1;
451
+ align-self: start;
452
+ display: flex;
453
+ flex-direction: column;
454
+ gap: 15px;
455
+ }
459
456
 
460
- h2#tourType {
461
- grid-column: 1;
462
- grid-row: 2;
463
- }
457
+ h2 {
458
+ font-weight: 600;
459
+ font-size: 14px;
460
+ grid-row: label-row;
461
+ }
464
462
 
465
- h2#dateAndTime {
466
- grid-column: 2;
467
- grid-row: 2;
468
- }
463
+ h2#tourType {
464
+ grid-column: 1;
465
+ grid-row: 2;
466
+ }
469
467
 
470
- h2#yourInformation {
471
- grid-column: 3;
472
- grid-row: 2;
473
- }
468
+ h2#dateAndTime {
469
+ grid-column: 2;
470
+ grid-row: 2;
471
+ }
474
472
 
475
- #datePicker {
476
- display: flex;
477
- }
473
+ h2#yourInformation {
474
+ grid-column: 3;
475
+ grid-row: 2;
476
+ }
478
477
 
479
- #dateAndTimeMenu {
480
- grid-row: 4 / 5;
481
- grid-column: 2;
482
- align-self: start;
483
- display: flex;
484
- flex-direction: column;
485
- }
478
+ #datePicker {
479
+ display: flex;
480
+ }
486
481
 
487
- #yourInformationMenu {
488
- grid-row: 4 / 5;
489
- grid-column: 3;
490
- display: flex;
491
- flex-direction: column;
492
- gap: 12px;
493
- }
482
+ #dateAndTimeMenu {
483
+ grid-row: 4 / 5;
484
+ grid-column: 2;
485
+ align-self: start;
486
+ display: flex;
487
+ flex-direction: column;
488
+ }
494
489
 
495
- #yourInformationMenu input {
496
- width: 100%;
497
- height: 49px;
498
- border: 1px solid #83818e;
499
- padding: 13px 11px 14px 11px;
500
- font-family: "Poppins";
501
- font-style: normal;
502
- font-weight: 400;
503
- font-size: 14px;
504
- color: #202020;
505
- }
490
+ #yourInformationMenu {
491
+ grid-row: 4 / 5;
492
+ grid-column: 3;
493
+ display: flex;
494
+ flex-direction: column;
495
+ gap: 12px;
496
+ }
506
497
 
507
- #yourInformationMenu input::placeholder {
508
- color: #202020;
509
- }
498
+ #yourInformationMenu input {
499
+ width: 100%;
500
+ height: 49px;
501
+ border: 1px solid #83818e;
502
+ padding: 13px 11px 14px 11px;
503
+ }
510
504
 
511
- .unitLayoutChoices {
512
- grid-row: 5 / 6;
513
- grid-column: 3;
514
- align-self: start;
515
- display: flex;
516
- flex-direction: column;
517
- }
505
+ .unitLayoutChoices {
506
+ grid-row: 5 / 6;
507
+ grid-column: 3;
508
+ align-self: start;
509
+ display: flex;
510
+ flex-direction: column;
511
+ }
518
512
 
519
- .unitLayoutChoice {
520
- margin-bottom: 12px;
521
- }
513
+ .unitLayoutChoice {
514
+ margin-bottom: 12px;
515
+ }
522
516
 
523
- h2.unitLayoutChoice {
524
- margin-bottom: 7px;
525
- }
517
+ h2.unitLayoutChoice {
518
+ margin-bottom: 7px;
519
+ }
526
520
 
527
- .unitLayoutOptions {
528
- display: flex;
529
- flex-direction: column;
530
- gap: 8px;
531
- }
521
+ .unitLayoutOptions {
522
+ display: flex;
523
+ flex-direction: column;
524
+ gap: 8px;
525
+ }
532
526
 
533
- hr {
534
- grid-row: 6;
535
- grid-column: 1 / 5;
536
- /* remove side margins because of this
527
+ hr {
528
+ grid-row: 6;
529
+ grid-column: 1 / 5;
530
+ /* remove side margins because of this
537
531
  * (https://stackoverflow.com/questions/34365271/hr-inside-container-with-display-flex-become-corrupted)
538
532
  * and top/bottom margins to position the line exactly at the gridline
539
533
  */
540
- margin: 0;
541
- }
542
-
543
- p {
544
- font-weight: 400;
545
- font-size: 12px;
546
- grid-row: 7;
547
- grid-column: 1 / 3;
548
- align-self: start;
549
- margin: 0;
550
- padding-top: 32px;
551
- }
552
-
553
- #schedule {
554
- width: 145px;
555
- height: 50px;
556
- grid-row: 7;
557
- grid-column: 3;
558
- justify-self: end;
559
- align-self: start;
560
- margin-top: 18px;
561
- }
562
-
563
- #confirmationMessage {
564
- grid-row: 3;
565
- width: 625px;
566
- }
567
-
568
- #confirmationMessage > p {
569
- font-size: 18px;
570
- }
571
-
572
- /* Loading styles: pulsing gray overlay on all the form elements */
573
-
574
- @keyframes spin {
575
- 0% {
576
- transform: none;
577
- }
578
- 50% {
579
- transform: rotateZ(180deg);
580
- }
581
- 100% {
582
- transform: rotateZ(360deg);
534
+ margin: 0;
583
535
  }
584
- }
585
-
586
- svg#loadingIcon {
587
- animation: spin 2s infinite linear;
588
- }
589
-
590
- .tour-scheduler.loading #scheduleATour {
591
- display: flex;
592
- gap: 10px;
593
- }
594
536
 
595
- @keyframes loadingPulse {
596
- 0% {
597
- background-color: #e7e7e7;
537
+ p {
538
+ font-weight: 400;
539
+ font-size: 12px;
540
+ grid-row: 7;
541
+ grid-column: 1 / 3;
542
+ align-self: start;
543
+ margin: 0;
544
+ padding-top: 32px;
598
545
  }
599
- 50% {
600
- background-color: white;
601
- }
602
- 100% {
603
- background-color: #e7e7e7;
604
- }
605
- }
606
-
607
- tour-type-option,
608
- date-picker,
609
- #yourInformationMenu .inputContainer {
610
- position: relative;
611
- }
612
546
 
613
- .tour-scheduler.loading
614
- :is(tour-type-option, date-picker, #yourInformationMenu
615
- .inputContainer)::after {
616
- content: "";
617
- position: absolute;
618
- top: 0;
619
- left: 0;
620
- height: 100%;
621
- z-index: 1;
622
- animation: loadingPulse 2s infinite;
623
- }
624
-
625
- .tour-scheduler.loading tour-type-option::after {
626
- border-radius: 10px;
627
- width: 200px;
628
- }
629
-
630
- .tour-scheduler.loading date-picker::after {
631
- border-radius: 10px;
632
- width: 205px;
633
- }
634
-
635
- .tour-scheduler.loading #yourInformationMenu .inputContainer input {
636
- visibility: hidden;
637
- }
638
-
639
- .tour-scheduler.loading time-picker {
640
- display: none;
641
- }
642
-
643
- #namesWrapper {
644
- display: flex;
645
- justify-content: space-between;
646
- }
547
+ #schedule {
548
+ width: 145px;
549
+ height: 50px;
550
+ grid-row: 7;
551
+ grid-column: 3;
552
+ justify-self: end;
553
+ align-self: start;
554
+ margin-top: 18px;
555
+ }
647
556
 
648
- .nameContainer {
649
- width: 48%;
650
- }
557
+ #confirmationMessage {
558
+ grid-row: 3;
559
+ width: 625px;
560
+ }
651
561
 
652
- .nameInput {
653
- width: 100%;
654
- }
562
+ #confirmationMessage > p {
563
+ font-size: 18px;
564
+ }
655
565
 
656
- @media (max-width: 767px) {
657
- /* TODO: separate styles into general, desktop-specific, and mobile-specific.
658
- basically everything I have "unset" or "initial" on should become desktop-specific. the grid layout is only for desktop.
659
- */
660
- .tour-scheduler {
661
- position: fixed;
662
- left: 0;
663
- right: 0;
664
- bottom: 0;
665
- top: initial;
666
- height: 93vh;
667
- width: 100vw;
668
- background: #ffffff;
669
- transform: none;
670
- box-shadow: none;
671
- border-radius: 0;
672
- padding: 25px 20px 0 22px;
673
- display: flex;
674
- flex-direction: column;
566
+ /* Loading styles: pulsing gray overlay on all the form elements */
567
+
568
+ @keyframes spin {
569
+ 0% {
570
+ transform: none;
571
+ }
572
+ 50% {
573
+ transform: rotateZ(180deg);
574
+ }
575
+ 100% {
576
+ transform: rotateZ(360deg);
577
+ }
675
578
  }
676
579
 
677
- #topControls {
678
- display: flex;
679
- justify-content: space-between;
680
- align-items: center;
580
+ svg#loadingIcon {
581
+ animation: spin 2s infinite linear;
681
582
  }
682
583
 
683
- .tour-scheduler > :is(h1, h2) {
684
- align-self: unset;
584
+ .tour-scheduler.loading #scheduleATour {
585
+ display: flex;
586
+ gap: 10px;
685
587
  }
686
588
 
687
- /* TODO: this and :disabled is duplicated from Schedule button. make a class,
688
- or better a component, for the button styles
689
- */
690
- button#next {
691
- height: 50px;
692
- /* width: 74px; */
693
- padding: 13px 22px 14px 22px;
694
- align-self: flex-start;
695
- background: #202020;
696
- border: 1px solid #ffffff;
697
- border-radius: 10px;
698
- font-family: "Poppins";
699
- font-weight: 700;
700
- font-size: 14px;
701
- color: #ffffff;
702
- box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
703
- margin-top: 22px;
589
+ @keyframes loadingPulse {
590
+ 0% {
591
+ background-color: #e7e7e7;
592
+ }
593
+ 50% {
594
+ background-color: white;
595
+ }
596
+ 100% {
597
+ background-color: #e7e7e7;
598
+ }
704
599
  }
705
600
 
706
- button#next:disabled {
707
- background: #e7e7e7;
708
- box-shadow: none;
601
+ tour-type-option,
602
+ date-picker,
603
+ #yourInformationMenu .inputContainer {
604
+ position: relative;
709
605
  }
710
606
 
711
- h1#scheduleATour {
712
- grid-row: unset;
713
- grid-column: unset;
714
- align-self: unset;
607
+ .tour-scheduler.loading
608
+ :is(tour-type-option, date-picker, #yourInformationMenu
609
+ .inputContainer)::after {
610
+ content: "";
611
+ position: absolute;
612
+ top: 0;
613
+ left: 0;
614
+ height: 100%;
615
+ z-index: 1;
616
+ animation: loadingPulse 2s infinite;
715
617
  }
716
618
 
717
- button#closeButton {
718
- grid-row: unset;
719
- grid-column: unset;
720
- align-self: unset;
721
- justify-self: unset;
619
+ .tour-scheduler.loading tour-type-option::after {
620
+ border-radius: 10px;
621
+ width: 200px;
722
622
  }
723
623
 
724
- h2 {
725
- grid-row: unset;
726
- margin-top: 37px;
727
- margin-bottom: 25px;
624
+ .tour-scheduler.loading date-picker::after {
625
+ border-radius: 10px;
626
+ width: 205px;
728
627
  }
729
628
 
730
- #tourTypeMenu {
731
- display: flex;
732
- flex-direction: column;
733
- gap: 15px;
734
- margin-bottom: 36px;
629
+ .tour-scheduler.loading #yourInformationMenu .inputContainer input {
630
+ visibility: hidden;
735
631
  }
736
632
 
737
- h2#tourType {
738
- grid-column: unset;
739
- grid-row: unset;
633
+ .tour-scheduler.loading time-picker {
634
+ display: none;
740
635
  }
741
636
 
742
- #datePicker {
637
+ #namesWrapper {
743
638
  display: flex;
744
- flex-direction: column;
745
- gap: 18px;
639
+ justify-content: space-between;
746
640
  }
747
641
 
748
- time-picker {
749
- /* so the Next button doesn't jump when the date is selected and the time slots appear */
750
- height: 93px;
642
+ .nameContainer {
643
+ width: 48%;
751
644
  }
752
645
 
753
- #dateAndTimeMenu {
754
- grid-row: unset;
755
- grid-column: unset;
756
- align-self: unset;
757
- display: unset;
758
- flex-direction: unset;
646
+ .nameInput {
647
+ width: 100%;
759
648
  }
760
649
 
761
- #confirmationMessage {
762
- grid-row: unset;
763
- width: 90%;
764
- margin-top: 37px;
650
+ @media (max-width: 767px) {
651
+ /* TODO: separate styles into general, desktop-specific, and mobile-specific.
652
+ basically everything I have "unset" or "initial" on should become desktop-specific. the grid layout is only for desktop.
653
+ */
654
+ .tour-scheduler {
655
+ position: fixed;
656
+ left: 0;
657
+ right: 0;
658
+ bottom: 0;
659
+ top: initial;
660
+ height: 93vh;
661
+ width: 100vw;
662
+ background: #ffffff;
663
+ transform: none;
664
+ box-shadow: none;
665
+ border-radius: 0;
666
+ padding: 25px 20px 0 22px;
667
+ display: flex;
668
+ flex-direction: column;
669
+ }
670
+
671
+ #topControls {
672
+ display: flex;
673
+ justify-content: space-between;
674
+ align-items: center;
675
+ }
676
+
677
+ .tour-scheduler > :is(h1, h2) {
678
+ align-self: unset;
679
+ }
680
+
681
+ /* TODO: this and :disabled is duplicated from Schedule button. make a class,
682
+ or better a component, for the button styles
683
+ */
684
+ button#next {
685
+ height: 50px;
686
+ /* width: 74px; */
687
+ padding: 13px 22px 14px 22px;
688
+ align-self: flex-start;
689
+ background: #202020;
690
+ border: 1px solid #ffffff;
691
+ border-radius: 10px;
692
+ font-family: "Poppins";
693
+ font-weight: 700;
694
+ font-size: 14px;
695
+ color: #ffffff;
696
+ box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
697
+ margin-top: 22px;
698
+ }
699
+
700
+ button#next:disabled {
701
+ background: #e7e7e7;
702
+ box-shadow: none;
703
+ }
704
+
705
+ h1#scheduleATour {
706
+ grid-row: unset;
707
+ grid-column: unset;
708
+ align-self: unset;
709
+ }
710
+
711
+ button#closeButton {
712
+ grid-row: unset;
713
+ grid-column: unset;
714
+ align-self: unset;
715
+ justify-self: unset;
716
+ }
717
+
718
+ h2 {
719
+ grid-row: unset;
720
+ margin-top: 37px;
721
+ margin-bottom: 25px;
722
+ }
723
+
724
+ #tourTypeMenu {
725
+ display: flex;
726
+ flex-direction: column;
727
+ gap: 15px;
728
+ margin-bottom: 36px;
729
+ }
730
+
731
+ h2#tourType {
732
+ grid-column: unset;
733
+ grid-row: unset;
734
+ }
735
+
736
+ #datePicker {
737
+ display: flex;
738
+ flex-direction: column;
739
+ gap: 18px;
740
+ }
741
+
742
+ time-picker {
743
+ /* so the Next button doesn't jump when the date is selected and the time slots appear */
744
+ height: 93px;
745
+ }
746
+
747
+ #dateAndTimeMenu {
748
+ grid-row: unset;
749
+ grid-column: unset;
750
+ align-self: unset;
751
+ display: unset;
752
+ flex-direction: unset;
753
+ }
754
+
755
+ #confirmationMessage {
756
+ grid-row: unset;
757
+ width: 90%;
758
+ margin-top: 37px;
759
+ }
765
760
  }
766
- }
767
- `;
761
+ `,
762
+ InputStyles,
763
+ ];
768
764
 
769
765
  tourTypeMenu(): TemplateResult {
770
766
  return html`<h2 id="tourType">Tour Type</h2>
@@ -1019,7 +1015,10 @@ export class TourScheduler extends LitElement {
1019
1015
  <div id="namesWrapper">
1020
1016
  <div class="nameContainer" id="firstName">
1021
1017
  <input
1022
- class="nameInput"
1018
+ class=${classMap({
1019
+ ["webchat-input"]: true,
1020
+ ["nameInput"]: true,
1021
+ })}
1023
1022
  type="text"
1024
1023
  placeholder="First name"
1025
1024
  name="firstName"
@@ -1029,7 +1028,10 @@ export class TourScheduler extends LitElement {
1029
1028
  </div>
1030
1029
  <div class="nameContainer" id="lastName">
1031
1030
  <input
1032
- class="nameInput"
1031
+ class=${classMap({
1032
+ ["webchat-input"]: true,
1033
+ ["nameInput"]: true,
1034
+ })}
1033
1035
  type="text"
1034
1036
  placeholder="Last name"
1035
1037
  name="lastName"
@@ -1041,6 +1043,7 @@ export class TourScheduler extends LitElement {
1041
1043
 
1042
1044
  <div class="inputContainer" id="email">
1043
1045
  <input
1046
+ class="webchat-input"
1044
1047
  type="email"
1045
1048
  inputmode="email"
1046
1049
  placeholder="Email"
@@ -1052,6 +1055,7 @@ export class TourScheduler extends LitElement {
1052
1055
  </div>
1053
1056
  <div class="inputContainer" id="phone">
1054
1057
  <input
1058
+ class="webchat-input"
1055
1059
  type="tel"
1056
1060
  inputmode="tel"
1057
1061
  placeholder="Phone"