livechat-assistant 0.0.9 → 0.1.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 (64) hide show
  1. package/fesm2022/livechat-assistant.mjs +445 -0
  2. package/fesm2022/livechat-assistant.mjs.map +1 -0
  3. package/index.d.ts +5 -0
  4. package/lib/components/chat-history/chat-history.component.d.ts +94 -0
  5. package/lib/components/chat-widget/chat-widget.component.d.ts +17 -0
  6. package/lib/components/help-support/help-support.component.d.ts +15 -0
  7. package/lib/components/home/home.component.d.ts +8 -0
  8. package/lib/components/index.d.ts +2 -0
  9. package/lib/components/message/message.component.d.ts +16 -0
  10. package/lib/components/success-message/success-message.component.d.ts +15 -0
  11. package/lib/components/support-buttons/support-buttons.component.d.ts +12 -0
  12. package/lib/environment/environment.test.d.ts +15 -0
  13. package/lib/livechat-assistant.component.d.ts +5 -0
  14. package/lib/livechat-assistant.service.d.ts +6 -0
  15. package/lib/services/index.d.ts +1 -0
  16. package/lib/services/request.d.ts +12 -0
  17. package/lib/utilities/helper.d.ts +9 -0
  18. package/lib/utilities/index.d.ts +1 -0
  19. package/package.json +26 -19
  20. package/public-api.d.ts +5 -0
  21. package/ng-package.json +0 -10
  22. package/src/lib/components/chat-history/chat-history.component.html +0 -83
  23. package/src/lib/components/chat-history/chat-history.component.scss +0 -0
  24. package/src/lib/components/chat-history/chat-history.component.spec.ts +0 -23
  25. package/src/lib/components/chat-history/chat-history.component.ts +0 -97
  26. package/src/lib/components/chat-widget/chat-widget.component.html +0 -87
  27. package/src/lib/components/chat-widget/chat-widget.component.scss +0 -77
  28. package/src/lib/components/chat-widget/chat-widget.component.spec.ts +0 -23
  29. package/src/lib/components/chat-widget/chat-widget.component.ts +0 -84
  30. package/src/lib/components/help-support/help-support.component.html +0 -106
  31. package/src/lib/components/help-support/help-support.component.scss +0 -0
  32. package/src/lib/components/help-support/help-support.component.spec.ts +0 -23
  33. package/src/lib/components/help-support/help-support.component.ts +0 -46
  34. package/src/lib/components/home/home.component.html +0 -64
  35. package/src/lib/components/home/home.component.scss +0 -0
  36. package/src/lib/components/home/home.component.spec.ts +0 -23
  37. package/src/lib/components/home/home.component.ts +0 -18
  38. package/src/lib/components/index.ts +0 -2
  39. package/src/lib/components/message/message.component.html +0 -119
  40. package/src/lib/components/message/message.component.scss +0 -0
  41. package/src/lib/components/message/message.component.spec.ts +0 -23
  42. package/src/lib/components/message/message.component.ts +0 -48
  43. package/src/lib/components/success-message/success-message.component.html +0 -33
  44. package/src/lib/components/success-message/success-message.component.scss +0 -65
  45. package/src/lib/components/success-message/success-message.component.spec.ts +0 -23
  46. package/src/lib/components/success-message/success-message.component.ts +0 -34
  47. package/src/lib/components/support-buttons/support-buttons.component.html +0 -42
  48. package/src/lib/components/support-buttons/support-buttons.component.scss +0 -49
  49. package/src/lib/components/support-buttons/support-buttons.component.spec.ts +0 -21
  50. package/src/lib/components/support-buttons/support-buttons.component.ts +0 -33
  51. package/src/lib/environment/environment.test.ts +0 -15
  52. package/src/lib/livechat-assistant.component.spec.ts +0 -23
  53. package/src/lib/livechat-assistant.component.ts +0 -15
  54. package/src/lib/livechat-assistant.service.spec.ts +0 -16
  55. package/src/lib/livechat-assistant.service.ts +0 -9
  56. package/src/lib/services/index.ts +0 -1
  57. package/src/lib/services/request.ts +0 -58
  58. package/src/lib/utilities/helper.ts +0 -23
  59. package/src/lib/utilities/index.ts +0 -1
  60. package/src/public-api.ts +0 -10
  61. package/src/styles.css +0 -5
  62. package/tsconfig.lib.json +0 -15
  63. package/tsconfig.lib.prod.json +0 -11
  64. package/tsconfig.spec.json +0 -15
@@ -1,97 +0,0 @@
1
- import { Component, ChangeDetectionStrategy, EventEmitter, Output, } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'app-chat-history',
5
- imports: [],
6
- templateUrl: './chat-history.component.html',
7
- styleUrl: './chat-history.component.scss',
8
- standalone: true,
9
- changeDetection: ChangeDetectionStrategy.OnPush,
10
- })
11
- export class ChatHistoryComponent {
12
- @Output() navigate= new EventEmitter<number>();
13
-
14
- conversations = [
15
- {
16
- id: 1,
17
- name: 'Costa Quinn',
18
- avatar: true,
19
- lastMessage: 'Yes, you can!',
20
- time: '11M',
21
- status: 'read',
22
- color: 'bg-red-600',
23
- online: true,
24
- initials: ''
25
- },
26
- {
27
- id: 2,
28
- name: 'Rachel Doe',
29
- initials: 'R',
30
- color: 'bg-blue-600',
31
- lastMessage: 'When using open method, const select = n...',
32
- time: '14M',
33
- unreadCount: 1,
34
- online: false,
35
- avatar:false
36
- },
37
- {
38
- id: 3,
39
- name: 'Lewis Clarke',
40
- avatar: true,
41
- lastMessage: 'Have a great all free! 😊',
42
- time: '15M',
43
- online: true,
44
- status: 'read',
45
- color: 'bg-blue-400'
46
- },
47
- {
48
- id: 4,
49
- name: 'Technical issues',
50
- initials: 'T',
51
- color: 'bg-orange-500',
52
- lastMessage: 'Great!',
53
- time: '35M',
54
- status: 'read',
55
- hasAttachment: true,
56
- online:false
57
- },
58
- {
59
- id: 5,
60
- name: 'Bob Dean',
61
- initials: 'B',
62
- color: 'bg-pink-500',
63
- lastMessage: 'Hey Preline team, I got an p3p48 while using...',
64
- time: '1H',
65
- unreadCount: 1,
66
- online:true
67
- },
68
- {
69
- id: 6,
70
- name: 'Mark Colbert',
71
- initials: 'M',
72
- color: 'bg-teal-500',
73
- lastMessage: 'Voice message',
74
- time: '6DM',
75
- status: 'delivered',
76
- online: false
77
- },
78
- {
79
- id: 7,
80
- name: 'Ella Lauda',
81
- avatar: true,
82
- lastMessage: 'I am really impressed! Can\'t wait...',
83
- time: '37M',
84
- online: false
85
- }
86
- ];
87
-
88
- selectConversation(id: number, tabIndex:number) {
89
- console.log('Selected conversation:', id);
90
- this.navigate.emit(tabIndex);
91
- }
92
-
93
- navigateToTab(tabIndex:number) {
94
- this.navigate.emit(tabIndex);
95
- }
96
-
97
- }
@@ -1,87 +0,0 @@
1
- <div class="chatbot bg-white dark:bg-neutral-900 ">
2
-
3
- <div>
4
- @if (activeTab === 1) {
5
- <div role="tabpanel">
6
- <app-home (navigate)="navigateToTab($event)" />
7
- </div>
8
- }
9
-
10
- @if (activeTab === 2) {
11
- <div role="tabpanel">
12
- <app-message [messages]="messages" [isTyping]="isTyping" (sendMessage)="sendMessage($event)" (navigate)="navigateToTab($event)"/>
13
- </div>
14
- }
15
-
16
- @if (activeTab === 3) {
17
- <div role="tabpanel">
18
- <app-help-support (navigate)="navigateToTab($event)"/>
19
- </div>
20
- }
21
-
22
- @if (activeTab === 4) {
23
- <div role="tabpanel">
24
- <app-chat-history (navigate)="navigateToTab($event)"/>
25
- </div>
26
- }
27
-
28
- @if (activeTab === 5) {
29
- <div role="tabpanel">
30
- <app-success-message (navigate)="navigateToTab($event)" />
31
- </div>
32
- }
33
-
34
- </div>
35
-
36
- <div class="">
37
- <nav class="flex justify-evenly" aria-label="Tabs" role="tablist">
38
- <button type="button" (click)="setActiveTab(1)"
39
- [class.text-blue-500]="activeTab === 1"
40
- [class.text-neutral-300]="activeTab !== 1"
41
- class="py-2 px-1 inline-flex items-center gap-x-2 border-b-2 border-transparent text-sm whitespace-nowrap transition-colors focus:outline-none flex flex-col gap-2">
42
-
43
- <div [ngClass]="activeTab === 1 ? 'bg-blue-100 rounded-full dark:font-semibold transition-colors' : 'bg-transparent'" class="px-4 py-2.5">
44
- <svg class="shrink-0 size-5" [class.text-black]="activeTab === 1" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
45
- viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
46
- stroke-linejoin="round">
47
- <path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
48
- <polyline points="9 22 9 12 15 12 15 22"></polyline>
49
- </svg>
50
- </div>
51
-
52
- <span class="text-lg fw-4 hover:text-blue-200">Home</span>
53
- </button>
54
-
55
- <button type="button" (click)="setActiveTab(2)" [class.font-bold]="activeTab === 2"
56
- [class.text-blue-500]="activeTab === 2" [class.text-neutral-300]="activeTab !== 2"
57
- class="py-2 px-1 inline-flex items-center gap-x-2 border-b-2 border-transparent text-sm whitespace-nowrap hover:text-blue-200 focus:outline-none flex flex-col gap-2">
58
- <div [ngClass]="activeTab === 2 ? 'bg-blue-100 rounded-full dark:font-semibold transition-colors' : 'bg-transparent'" class="px-4 py-2.5">
59
- <svg class="shrink-0 size-5" [class.text-black]="activeTab === 2" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
60
- viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
61
- stroke-linejoin="round">
62
- <circle cx="12" cy="12" r="10"></circle>
63
- <circle cx="12" cy="10" r="3"></circle>
64
- <path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662"></path>
65
- </svg>
66
- </div>
67
- <span class="text-lg fw-6 hover:text-blue-200">Message</span>
68
- </button>
69
-
70
- <button type="button" (click)="setActiveTab(3)" [class.font-bold]="activeTab === 3"
71
- [class.text-blue-500]="activeTab === 3" [class.text-neutral-300]="activeTab !== 3"
72
- class="py-2 px-1 inline-flex items-center gap-x-2 border-b-2 border-transparent text-sm whitespace-nowrap hover:text-blue-200 focus:outline-none flex flex-col gap-2">
73
- <div [ngClass]="activeTab === 3 ? 'bg-blue-100 rounded-full dark:font-semibold transition-colors' : 'bg-transparent'" class="px-4 py-2.5">
74
- <svg class="shrink-0 size-5" [class.text-black]="activeTab === 3" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
75
- viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
76
- stroke-linejoin="round">
77
- <path
78
- d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z">
79
- </path>
80
- <circle cx="12" cy="12" r="3"></circle>
81
- </svg>
82
- </div>
83
- <span class="text-lg fw-6 hover:text-blue-200">Help</span>
84
- </button>
85
- </nav>
86
- </div>
87
- </div>
@@ -1,77 +0,0 @@
1
- :host {
2
-
3
- .chat-container {
4
- width: 400px !important;
5
- }
6
- .btn-round {
7
- border-radius: 100% !important;
8
- width: 40px !important;
9
- height: 40px !important;
10
- &.btn-fab {
11
- position: fixed !important;
12
- bottom: 20px !important;
13
- right: 30px !important;
14
- width: 60px !important;
15
- height: 60px !important;
16
- border-radius: 100%;
17
- box-shadow: 0 6px 20px rgba(0,0,0,0.2);
18
- i {
19
- position: relative !important;
20
- top: 0px !important;
21
- right: -18px !important;
22
- // margin: 10px auto !important;
23
- }
24
- }
25
- }
26
- #send-btn {
27
- margin-bottom: 10px !important;
28
- margin-right: 0px !important;
29
- }
30
-
31
- .chatbot header {
32
- padding: 10px 10px !important;
33
- position: relative;
34
- text-align: center;
35
- }
36
-
37
- .chatbot .chatbox {
38
- overflow-y: auto;
39
- height: 550px;
40
- margin-bottom: 40px !important;
41
- }
42
-
43
- .chatbot :where(.chatbox, textarea)::-webkit-scrollbar {
44
- width: 6px;
45
- }
46
-
47
- .chatbot :where(.chatbox, textarea)::-webkit-scrollbar-track {
48
- border-radius: 25px;
49
- }
50
-
51
- .chatbot :where(.chatbox, textarea)::-webkit-scrollbar-thumb {
52
- border-radius: 25px;
53
- }
54
- @media (max-width: 490px) {
55
- .chatbot-toggler {
56
- right: 20px;
57
- bottom: 20px;
58
- }
59
-
60
- .chatbot {
61
- right: 0;
62
- bottom: 0;
63
- height: 100%;
64
- border-radius: 0;
65
- width: 100%;
66
- }
67
-
68
- .chatbot .chatbox {
69
- height: 90%;
70
- padding: 25px 15px 100px;
71
- }
72
-
73
- .chatbot header span {
74
- display: block;
75
- }
76
- }
77
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { ChatWidgetComponent } from './chat-widget.component';
4
-
5
- describe('ChatWidgetComponent', () => {
6
- let component: ChatWidgetComponent;
7
- let fixture: ComponentFixture<ChatWidgetComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [ChatWidgetComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(ChatWidgetComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,84 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
2
- import { FormsModule } from '@angular/forms';
3
- import { NgClass } from '@angular/common';
4
- import { ChatHistoryComponent } from '../chat-history/chat-history.component';
5
- import { HelpSupportComponent } from '../help-support/help-support.component';
6
- import { HomeComponent } from '../home/home.component';
7
- import { MessageComponent } from '../message/message.component';
8
- import { SuccessMessageComponent } from '../success-message/success-message.component';
9
- @Component({
10
- selector: 'app-chat-widget',
11
- standalone: true,
12
- imports: [
13
- FormsModule,
14
- HomeComponent,
15
- MessageComponent,
16
- HelpSupportComponent,
17
- FormsModule,
18
- ChatHistoryComponent,
19
- NgClass,
20
- SuccessMessageComponent
21
- ],
22
- changeDetection: ChangeDetectionStrategy.OnPush,
23
- templateUrl: './chat-widget.component.html',
24
- styleUrl: './chat-widget.component.scss',
25
- encapsulation: ViewEncapsulation.None
26
- })
27
- export class ChatWidgetComponent {
28
- isTyping = false;
29
- @Input() isOpen = false;
30
- activeTab = 1;
31
-
32
- setActiveTab(tab: number) {
33
- this.activeTab = tab;
34
- }
35
-
36
- navigateToTab(tab:number) {
37
- this.setActiveTab(tab);
38
- }
39
-
40
- messages = [
41
- {
42
- id: 1,
43
- sender: 'agent',
44
- text: 'Hi, I\'d like to ask some questions. Can I use Preline UI on a client project?',
45
- time: '9:40 AM'
46
- },
47
- {
48
- id: 2,
49
- sender: 'agent',
50
- text: 'https://preline.co/',
51
- time: '9:41 AM',
52
- },
53
- {
54
- id: 3,
55
- sender: 'customer',
56
- text: 'Hi, I\'d like to ask some questions. Can I use Preline UI on a client project?',
57
- time: '11:27 AM'
58
- },
59
- {
60
- id: 4,
61
- sender: 'customer',
62
- text: 'Yes, you can! 😊',
63
- time: '11:28 AM'
64
- }
65
- ];
66
-
67
- sendMessage(message: string) {
68
- if (message.trim()) {
69
- this.messages.push({
70
- id: this.messages.length + 1,
71
- sender: 'customer',
72
- text: message,
73
- time: new Date().toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' })
74
- });
75
- console.log(message)
76
- // Simulate agent typing
77
- this.isTyping = true;
78
- setTimeout(() => {
79
- this.isTyping = false;
80
- }, 2000);
81
- }
82
- }
83
-
84
- }
@@ -1,106 +0,0 @@
1
- <div class="rounded-lg flex flex-col overflow-hidden max-h-[600px]">
2
- <div class="relative h-32 bg-gradient-to-br from-cyan-300 via-blue-600 to-orange-400 overflow-hidden">
3
- <div class="absolute inset-0">
4
- <div class="absolute top-0 left-0 w-24 h-24 bg-blue-700 transform rotate-45 -translate-x-8 -translate-y-8"></div>
5
- <div class="absolute top-4 right-0 w-32 h-32 bg-orange-400 transform rotate-12 translate-x-12"></div>
6
- <div class="absolute bottom-0 left-8 w-28 h-28 bg-cyan-400 transform -rotate-12 translate-y-12"></div>
7
- </div>
8
-
9
-
10
- <!-- Logo -->
11
- <div class="absolute bottom-4 left-4 w-10 h-10 bg-white rounded-full flex items-center justify-center shadow-lg">
12
- <svg class="w-6 h-6 text-blue-600" fill="currentColor" viewBox="0 0 24 24">
13
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z"/>
14
- </svg>
15
- </div>
16
- </div>
17
-
18
- <div class="p-4 overflow-y-auto hideScroll">
19
-
20
- <h2 class="text-lg font-semibold text-neutral-800 dark:text-neutral-200 mb-1">Send a message</h2>
21
- <p class="text-sm text-neutral-500 dark:text-neutral-200 mb-6">We'll get back to you in a few hours.</p>
22
-
23
- <form [formGroup]="contactForm" (ngSubmit)="onSubmit()" class="space-y-4">
24
-
25
- <div>
26
- <label for="name" class="block text-sm font-medium text-neutral-700 dark:text-neutral-200 mb-1">Name</label>
27
- <input
28
- type="text"
29
- id="name"
30
- formControlName="name"
31
- placeholder="John Doe"
32
- class="w-full px-4 py-2.5 border border-neutral-500 dark:text-neutral-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
33
- [class.border-red-500]="contactForm.get('name')?.invalid && contactForm.get('name')?.touched">
34
- <p *ngIf="contactForm.get('name')?.invalid && contactForm.get('name')?.touched"
35
- class="text-xs text-red-500 mt-1">Name is required</p>
36
- </div>
37
-
38
- <!-- Email Field -->
39
- <div class="relative">
40
- <label for="email" class="block text-sm font-medium text-neutral-700 dark:text-neutral-200 mb-1">Email</label>
41
- <input
42
- type="email"
43
- id="email"
44
- formControlName="email"
45
- placeholder="john@site.co"
46
- (focus)="showTooltip = true"
47
- (blur)="showTooltip = false"
48
- class="w-full px-4 py-2.5 border border-neutral-500 dark:text-neutral-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
49
- [class.border-red-500]="contactForm.get('email')?.invalid && contactForm.get('email')?.touched">
50
-
51
- <!-- Tooltip -->
52
- <div *ngIf="showTooltip"
53
- class="absolute right-0 top-0 mt-1 mr-2 bg-neutral-900 dark:text-neutral-200 text-white text-xs px-3 py-2 rounded shadow-lg z-10 whitespace-nowrap">
54
- Existing accounts should use <br>your account to access the <br>source code.
55
- <div class="absolute top-1/2 -right-1 transform -translate-y-1/2 w-2 h-2 bg-neutral-900 dark:text-neutral-200 rotate-45"></div>
56
- </div>
57
-
58
- <p *ngIf="contactForm.get('email')?.invalid && contactForm.get('email')?.touched"
59
- class="text-xs text-red-500 mt-1">
60
- <span *ngIf="contactForm.get('email')?.errors?.['required']">Email is required</span>
61
- <span *ngIf="contactForm.get('email')?.errors?.['email']">Invalid email format</span>
62
- </p>
63
- </div>
64
-
65
- <!-- Subject Field -->
66
- <div>
67
- <label for="subject" class="block text-sm font-medium text-neutral-700 dark:text-neutral-200 mb-1">Subject</label>
68
- <input
69
- type="text"
70
- id="subject"
71
- formControlName="subject"
72
- placeholder="Preline Pro"
73
- class="w-full px-4 py-2.5 border border-neutral-500 dark:text-neutral-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
74
- [class.border-red-500]="contactForm.get('subject')?.invalid && contactForm.get('subject')?.touched">
75
- <p *ngIf="contactForm.get('subject')?.invalid && contactForm.get('subject')?.touched"
76
- class="text-xs text-red-500 mt-1">Subject is required</p>
77
- </div>
78
-
79
- <!-- Message Field -->
80
- <div>
81
- <label for="message" class="block text-sm font-medium text-neutral-700 dark:text-neutral-200 mb-1">How can we help?</label>
82
- <textarea
83
- id="message"
84
- formControlName="message"
85
- rows="4"
86
- placeholder="Message..."
87
- class="w-full px-4 py-2.5 border border-neutral-500 dark:text-neutral-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none"
88
- [class.border-red-500]="contactForm.get('message')?.invalid && contactForm.get('message')?.touched"></textarea>
89
- <p *ngIf="contactForm.get('message')?.invalid && contactForm.get('message')?.touched"
90
- class="text-xs text-red-500 mt-1">Message is required</p>
91
- </div>
92
-
93
- <!-- Submit Button -->
94
- <button
95
- type="submit"
96
- [disabled]="contactForm.invalid"
97
- (click)="navigateToTab(5)"
98
- class="w-full bg-blue-600 text-white py-3 rounded-lg font-medium hover:bg-blue-700 transition disabled:opacity-50 disabled:cursor-not-allowed">
99
- Send message
100
- </button>
101
-
102
- </form>
103
-
104
- </div>
105
- </div>
106
-
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { HelpSupportComponent } from './help-support.component';
4
-
5
- describe('HelpSupportComponent', () => {
6
- let component: HelpSupportComponent;
7
- let fixture: ComponentFixture<HelpSupportComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [HelpSupportComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(HelpSupportComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,46 +0,0 @@
1
- import { NgIf } from '@angular/common';
2
- import { ChangeDetectionStrategy, Component, EventEmitter, Output } from '@angular/core';
3
- import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
4
-
5
- @Component({
6
- selector: 'app-help-support',
7
- imports: [ReactiveFormsModule, NgIf],
8
- templateUrl: './help-support.component.html',
9
- styleUrl: './help-support.component.scss',
10
- standalone: true,
11
- changeDetection: ChangeDetectionStrategy.OnPush,
12
- })
13
- export class HelpSupportComponent {
14
- showTooltip = false;
15
- contactForm!: FormGroup;
16
- @Output() navigate= new EventEmitter<number>();
17
-
18
- constructor(private fb: FormBuilder) {}
19
-
20
- ngOnInit() {
21
- this.contactForm = this.fb.group({
22
- name: ['', [Validators.required]],
23
- email: ['', [Validators.required, Validators.email]],
24
- subject: ['', [Validators.required]],
25
- message: ['', [Validators.required]]
26
- });
27
- }
28
-
29
- onSubmit() {
30
- if (this.contactForm.valid) {
31
- console.log('Form submitted:', this.contactForm.value);
32
-
33
- this.contactForm.reset();
34
- } else {
35
- // Mark all fields as touched to show validation errors
36
- Object.keys(this.contactForm.controls).forEach(key => {
37
- this.contactForm.get(key)?.markAsTouched();
38
- });
39
- }
40
-
41
- }
42
-
43
- navigateToTab(tabIndex:number) {
44
- this.navigate.emit(tabIndex);
45
- }
46
- }
@@ -1,64 +0,0 @@
1
- <div class="rounded-lg flex flex-col overflow-hidden max-h-[600px]">
2
- <div class="relative h-32 bg-gradient-to-br from-cyan-300 via-blue-600 to-orange-400 overflow-hidden">
3
- <div class="absolute inset-0">
4
- <div class="absolute top-0 left-0 w-24 h-24 bg-blue-700 transform rotate-45 -translate-x-8 -translate-y-8"></div>
5
- <div class="absolute top-4 right-0 w-32 h-32 bg-orange-400 transform rotate-12 translate-x-12"></div>
6
- <div class="absolute bottom-0 left-8 w-28 h-28 bg-cyan-400 transform -rotate-12 translate-y-12"></div>
7
- </div>
8
- <button class="absolute top-3 right-3 w-6 h-6 bg-white/20 rounded-full flex items-center justify-center text-white hover:bg-white/30">
9
- ×
10
- </button>
11
-
12
- <!-- Logo -->
13
- <div class="absolute bottom-4 left-4 w-10 h-10 bg-white rounded-full flex items-center justify-center shadow-lg">
14
- <svg class="w-6 h-6 text-blue-600" fill="currentColor" viewBox="0 0 24 24">
15
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z"/>
16
- </svg>
17
- </div>
18
- </div>
19
-
20
- <div class="flex-1 overflow-y-auto p-4 hideScroll">
21
- <div>
22
- <h2 class="text-lg font-semibold dark:text-neutral-200 text-gray-800 mt-4">Hi, Penny 👋</h2>
23
- <p class="text-sm text-neutral-500 dark:text-neutral-200 mb-5">Preline support team is here to help.</p>
24
-
25
- <button (click)="navigateToTab(3)" class="w-full bg-blue-600 text-white py-3 rounded-lg font-medium hover:bg-blue-700 transition mb-6">
26
- Send us a message
27
- </button>
28
-
29
- <div class="space-y-4">
30
- <p class="text-sm font-semibold text-neutral-500 dark:text-neutral-200">Popular topics</p>
31
-
32
- <a href="#" class="flex items-center justify-between p-3 dark:bg-neutral-800 bg-neutral-50 hover:bg-neutral-800/50 rounded-lg transition group">
33
- <div>
34
- <h3 class="fs-16 fw-6 dark:text-neutral-200 text-neutral-800">Live Chat</h3>
35
- <p class="text-sm text-neutral-500 dark:text-neutral-200/80 text-neutral-800">Team, Invoices, Refunds, and Updates</p>
36
- </div>
37
- <svg class="w-5 h-5 text-neutral-400 group-hover:text-neutral-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
38
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
39
- </svg>
40
- </a>
41
-
42
- <a href="#" class="flex items-center justify-between p-3 dark:bg-neutral-800 bg-neutral-50 hover:bg-neutral-800/50 rounded-lg transition group">
43
- <div>
44
- <h3 class="fs-16 fw-6 dark:text-neutral-200 text-neutral-800">AI Chat</h3>
45
- <p class="text-sm text-neutral-500 dark:text-neutral-200/80 text-neutral-800">Team, Invoices, Refunds, and Updates</p>
46
- </div>
47
- <svg class="w-5 h-5 text-neutral-400 group-hover:text-neutral-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
48
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
49
- </svg>
50
- </a>
51
-
52
- <a href="#" class="flex mb-2 items-center justify-between p-3 dark:bg-neutral-800 bg-gray-50 hover:bg-neutral-800/50 rounded-lg transition group">
53
- <div>
54
- <h3 class="fs-16 fw-6 dark:text-neutral-200 text-neutral-800">Support Chat</h3>
55
- <p class="text-sm text-gray-500 dark:text-neutral-200/80 text-neutral-800">Team, Invoices, Refunds, and Updates</p>
56
- </div>
57
- <svg class="w-5 h-5 text-gray-400 group-hover:text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
58
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
59
- </svg>
60
- </a>
61
- </div>
62
- </div>
63
-
64
- <div class="border-t border-neutral-700"></div>
File without changes
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { HomeComponent } from './home.component';
4
-
5
- describe('HomeComponent', () => {
6
- let component: HomeComponent;
7
- let fixture: ComponentFixture<HomeComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [HomeComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(HomeComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,18 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, Output, EventEmitter, ViewEncapsulation } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'app-home',
5
- imports: [],
6
- templateUrl: './home.component.html',
7
- styleUrl: './home.component.scss',
8
- standalone: true,
9
- changeDetection: ChangeDetectionStrategy.OnPush,
10
- encapsulation: ViewEncapsulation.None
11
- })
12
- export class HomeComponent {
13
- @Output() navigate= new EventEmitter<number>();
14
-
15
- navigateToTab(tabIndex: number) {
16
- this.navigate.emit(tabIndex);
17
- }
18
- }
@@ -1,2 +0,0 @@
1
- export * from './chat-widget/chat-widget.component'
2
- export * from './support-buttons/support-buttons.component'