@salesforcedevs/docs-components 0.0.11-edit → 0.0.13-chat

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,259 +1,45 @@
1
- /* Fixed positioned chat with full viewport height */
2
- :host {
3
- position: fixed;
4
- top: 0;
5
- right: 0;
6
- height: 100vh;
7
- z-index: 100000;
8
- font-family: "Salesforce Sans", -apple-system, BlinkMacSystemFont,
9
- "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
10
- sans-serif;
11
- pointer-events: none; /* Allow clicks to pass through when chat is closed */
12
- }
13
-
14
- /* Apply content shift to main page content when chat is open */
15
- body.chat-open .content {
16
- transform: translateX(-400px);
17
- transition: transform 0.3s ease-in-out;
18
- }
19
-
20
- body.chat-closed .content {
21
- transform: translateX(0);
22
- transition: transform 0.3s ease-in-out;
23
- }
24
-
25
- /* Also shift the global header if it exists */
26
- body.chat-open dx-global-header,
27
- body.chat-open .global-header {
28
- transform: translateX(-400px);
29
- transition: transform 0.3s ease-in-out;
30
- }
31
-
32
- body.chat-closed dx-global-header,
33
- body.chat-closed .global-header {
34
- transform: translateX(0);
35
- transition: transform 0.3s ease-in-out;
36
- }
37
-
38
- /* Floating trigger button */
39
- .chat-trigger-button {
40
- position: fixed;
41
- bottom: 20px;
42
- right: 20px;
43
- background: transparent;
44
- color: white;
45
- border: none;
46
- cursor: pointer;
47
- z-index: 1001;
48
- display: flex;
49
- align-items: center;
50
- justify-content: center;
51
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
52
- animation: pulse 3s infinite;
53
- padding: 0;
54
- pointer-events: auto; /* Enable clicks on trigger button */
55
- }
56
-
57
- /* Tooltip styling */
58
- .chat-trigger-button::before {
59
- content: attr(data-tooltip);
60
- position: absolute;
61
- right: 100%;
62
- top: 50%;
63
- transform: translateY(-50%);
64
- background: linear-gradient(135deg, #0176d3 0%, #005fb2 100%);
65
- color: white;
66
- padding: 12px 16px;
67
- border-radius: 12px;
68
- font-size: 14px;
69
- font-weight: 500;
70
- white-space: nowrap;
71
- opacity: 0;
72
- visibility: hidden;
73
- margin-right: 16px;
74
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
75
- box-shadow: 0 8px 24px rgb(1 118 211 / 25%), 0 2px 8px rgb(1 118 211 / 15%);
76
- backdrop-filter: blur(10px);
77
- z-index: 1002;
78
- pointer-events: none;
79
- letter-spacing: 0.02em;
80
- }
81
-
82
- /* Tooltip arrow */
83
- .chat-trigger-button::after {
84
- content: "";
85
- position: absolute;
86
- right: 100%;
87
- top: 50%;
88
- transform: translateY(-50%);
89
- margin-right: 8px;
90
- width: 0;
91
- height: 0;
92
- border-left: 8px solid #0176d3;
93
- border-top: 8px solid transparent;
94
- border-bottom: 8px solid transparent;
95
- opacity: 0;
96
- visibility: hidden;
97
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
98
- z-index: 1002;
99
- pointer-events: none;
100
- }
101
-
102
- /* Show tooltip on hover */
103
- .chat-trigger-button:hover::before,
104
- .chat-trigger-button:hover::after {
105
- opacity: 1;
106
- visibility: visible;
107
- transform: translateY(-50%) translateX(-4px);
108
- }
109
-
110
- .chat-trigger-button:hover .chat-gif {
111
- transform: scale(1.1);
112
- }
113
-
114
- .chat-trigger-button:active .chat-gif {
115
- transform: scale(0.95);
116
- }
117
-
118
- .chat-gif {
119
- width: 155px;
120
- height: 218px;
121
- object-fit: cover;
122
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
123
- }
124
-
125
- @keyframes pulse {
126
- 0% {
127
- transform: scale(1);
128
- }
129
-
130
- 70% {
131
- transform: scale(1.05);
132
- }
133
-
134
- 100% {
135
- transform: scale(1);
136
- }
137
- }
138
-
139
- /* Chat container */
140
1
  .chat-container {
141
- height: 100vh;
142
- width: 700px;
143
- background-color: #fff;
144
- box-shadow: -8px 0 32px rgb(0 0 0 / 12%), -2px 0 8px rgb(0 0 0 / 8%);
145
- transform: translateX(100%);
146
- transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
147
2
  display: flex;
148
3
  flex-direction: column;
149
- border-left: 1px solid #d8dde6;
150
- backdrop-filter: blur(20px);
151
- pointer-events: auto; /* Enable clicks on chat container */
152
- }
153
-
154
- .chat-container_open {
155
- transform: translateX(0);
4
+ border: 1px solid #e0e0e0;
5
+ border-radius: 8px;
6
+ background-color: #ffffff;
7
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
8
+ overflow: hidden;
9
+ max-width: 600px;
10
+ width: 100%;
156
11
  }
157
12
 
158
- .chat-container_disabled {
13
+ .chat-container--disabled {
159
14
  opacity: 0.6;
160
15
  pointer-events: none;
161
16
  }
162
17
 
163
18
  .chat-header {
164
- background: linear-gradient(135deg, #0176d3 0%, #005fb2 100%);
165
- padding: 18px 24px;
166
- border-bottom: 1px solid rgb(1 118 211 / 20%);
167
- display: flex;
168
- align-items: center;
169
- justify-content: space-between;
170
- flex-shrink: 0;
171
- backdrop-filter: blur(10px);
172
- position: relative;
173
- }
174
-
175
- .chat-header::before {
176
- content: "";
177
- position: absolute;
178
- top: 0;
179
- left: 0;
180
- right: 0;
181
- bottom: 0;
182
- background: linear-gradient(
183
- 135deg,
184
- rgb(255 255 255 / 5%) 0%,
185
- rgb(255 255 255 / 1%) 100%
186
- );
187
- pointer-events: none;
188
- }
189
-
190
- .chat-header-actions {
191
- display: flex;
192
- align-items: center;
193
- gap: 8px;
194
- }
195
-
196
- .chat-close-button,
197
- .chat-clear-button {
198
- width: 36px;
199
- height: 36px;
200
- border: none;
201
- background: rgb(255 255 255 / 15%);
202
- cursor: pointer;
203
- display: flex;
204
- align-items: center;
205
- justify-content: center;
206
- border-radius: 8px;
207
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
208
- color: white;
209
- position: relative;
210
- z-index: 1;
211
- }
212
-
213
- .chat-close-button:hover,
214
- .chat-clear-button:hover {
215
- background: rgb(255 255 255 / 25%);
216
- transform: scale(1.05);
217
- color: white;
218
- }
219
-
220
- .chat-clear-button:hover {
221
- background: rgb(255 82 82 / 20%);
222
- color: #ff6b6b;
223
- }
224
-
225
- .close-icon,
226
- .clear-icon {
227
- width: 18px;
228
- height: 18px;
19
+ background-color: #f8f9fa;
20
+ padding: 16px;
21
+ border-bottom: 1px solid #e0e0e0;
229
22
  }
230
23
 
231
24
  .chat-title {
232
25
  margin: 0;
233
- font-size: 20px;
234
- font-weight: 700;
235
- color: white;
236
- flex: 1;
237
- position: relative;
238
- z-index: 1;
239
- letter-spacing: -0.02em;
26
+ font-size: 18px;
27
+ font-weight: 600;
28
+ color: #333333;
240
29
  }
241
30
 
242
31
  .chat-messages {
243
32
  flex: 1;
244
33
  overflow-y: auto;
245
- padding: 24px 20px;
34
+ padding: 16px;
35
+ max-height: 300px;
246
36
  scroll-behavior: smooth;
247
- min-height: 0;
248
- background: linear-gradient(180deg, #fafbfc 0%, #f7f9fb 100%);
249
37
  }
250
38
 
251
39
  .message-wrapper {
252
- margin-bottom: 20px;
40
+ margin-bottom: 16px;
253
41
  display: flex;
254
42
  align-items: flex-start;
255
- animation: message-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
256
- gap: 12px;
257
43
  }
258
44
 
259
45
  .message-wrapper[data-sender="user"] {
@@ -264,133 +50,6 @@ body.chat-closed .global-header {
264
50
  justify-content: flex-start;
265
51
  }
266
52
 
267
- /* Avatar styling */
268
- .message-avatar-wrapper {
269
- flex-shrink: 0;
270
- display: flex;
271
- align-items: flex-start;
272
- margin-top: 2px;
273
- }
274
-
275
- /* Hide avatar for user messages */
276
- .message-wrapper[data-sender="user"] .message-avatar-wrapper {
277
- display: none;
278
- }
279
-
280
- /* Show avatar for assistant messages */
281
- .message-wrapper[data-sender="assistant"] .message-avatar-wrapper {
282
- display: flex;
283
- }
284
-
285
- .avatar-container {
286
- width: 36px;
287
- height: 36px;
288
- background: linear-gradient(180deg, #fafbfc 0%, #f7f9fb 100%);
289
- border-radius: 50%;
290
- display: flex;
291
- align-items: center;
292
- justify-content: center;
293
- box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
294
- position: relative;
295
- overflow: hidden;
296
- animation: thinking-avatar-pulse 3s ease-in-out infinite;
297
- }
298
-
299
- .avatar-container::before {
300
- content: "";
301
- position: absolute;
302
- inset: 0;
303
- background: linear-gradient(
304
- 135deg,
305
- rgb(255 255 255 / 20%) 0%,
306
- rgb(255 255 255 / 10%) 100%
307
- );
308
- border-radius: 50%;
309
- }
310
-
311
- .avatar-icon {
312
- width: 32px;
313
- height: 32px;
314
- color: white;
315
- position: relative;
316
- z-index: 1;
317
- filter: drop-shadow(0 1px 2px rgb(0 0 0 / 15%));
318
- }
319
-
320
- /* Thinking Bot SVG Animations */
321
- .thinking-body {
322
- animation: thinking-breathe 2s ease-in-out infinite;
323
- transform-origin: center;
324
- }
325
-
326
- .thinking-smile {
327
- animation: thinking-smile-animation 3s ease-in-out infinite;
328
- }
329
-
330
- .thinking-eye {
331
- animation: think-blink 6s infinite;
332
- transform-origin: center;
333
- }
334
-
335
- @keyframes thinking-avatar-pulse {
336
- 0%,
337
- 100% {
338
- transform: scale(1);
339
- box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
340
- }
341
-
342
- 50% {
343
- transform: scale(1.08);
344
- box-shadow: 0 4px 16px rgb(0 0 0 / 20%);
345
- }
346
- }
347
-
348
- @keyframes thinking-breathe {
349
- 0%,
350
- 100% {
351
- transform: scale(1);
352
- }
353
-
354
- 50% {
355
- transform: scale(1.05);
356
- }
357
- }
358
-
359
- @keyframes thinking-smile-animation {
360
- 0%,
361
- 100% {
362
- transform: translateY(0);
363
- }
364
-
365
- 50% {
366
- transform: translateY(-2px);
367
- }
368
- }
369
-
370
- @keyframes think-blink {
371
- 0%,
372
- 85%,
373
- 100% {
374
- transform: scaleY(1);
375
- }
376
-
377
- 90% {
378
- transform: scaleY(0.6);
379
- }
380
-
381
- 92% {
382
- transform: scaleY(0.2);
383
- }
384
-
385
- 94% {
386
- transform: scaleY(0.6);
387
- }
388
-
389
- 96% {
390
- transform: scaleY(1);
391
- }
392
- }
393
-
394
53
  .message-content {
395
54
  max-width: 80%;
396
55
  display: flex;
@@ -403,105 +62,35 @@ body.chat-closed .global-header {
403
62
  }
404
63
 
405
64
  .message-bubble {
406
- padding: 14px 18px;
407
- border-radius: 20px;
65
+ padding: 12px 16px;
66
+ border-radius: 18px;
408
67
  word-wrap: break-word;
409
68
  max-width: 100%;
410
- position: relative;
411
- backdrop-filter: blur(10px);
412
- box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
413
69
  }
414
70
 
415
71
  .message-wrapper[data-sender="user"] .message-bubble {
416
- background: linear-gradient(135deg, #0176d3 0%, #005fb2 100%);
72
+ background-color: #0066cc;
417
73
  color: white;
418
- border-bottom-right-radius: 8px;
419
74
  }
420
75
 
421
76
  .message-wrapper[data-sender="assistant"] .message-bubble {
422
- background: white;
423
- color: #181818;
424
- border: 1px solid #e5e7ea;
425
- border-bottom-left-radius: 8px;
77
+ background-color: #f0f0f0;
78
+ color: #333333;
426
79
  }
427
80
 
428
81
  .message-text {
429
82
  margin: 0;
430
- line-height: 1.5;
431
- font-size: 15px;
432
- font-weight: 400;
433
- }
434
-
435
- /* HTML content styling for rich messages */
436
- .message-text .chat-link {
437
- color: #0176d3;
438
- text-decoration: none;
439
- border-bottom: 1px solid transparent;
440
- transition: all 0.2s ease;
441
- }
442
-
443
- .message-text .chat-link:hover {
444
- color: #005fb2;
445
- border-bottom-color: #005fb2;
446
- }
447
-
448
- .message-text .chat-list {
449
- margin: 12px 0;
450
- padding-left: 20px;
451
- counter-reset: none;
452
- }
453
-
454
- .message-text .chat-list li {
455
- margin: 12px 0;
456
- line-height: 1.6;
457
- font-weight: 500;
458
- }
459
-
460
- .message-text .chat-description {
461
- font-weight: 400;
462
- color: #666;
83
+ line-height: 1.4;
463
84
  font-size: 14px;
464
- line-height: 1.5;
465
- margin-top: 4px;
466
- display: block;
467
- }
468
-
469
- .message-text strong {
470
- font-weight: 600;
471
- color: #181818;
472
- }
473
-
474
- .message-text em {
475
- font-style: italic;
476
- color: #555;
477
- }
478
-
479
- /* Style for line breaks in HTML content */
480
- .message-text br {
481
- margin: 4px 0;
482
- }
483
-
484
- /* Ensure proper spacing for HTML content */
485
- .message-text p {
486
- margin: 8px 0;
487
- }
488
-
489
- .message-text p:first-child {
490
- margin-top: 0;
491
- }
492
-
493
- .message-text p:last-child {
494
- margin-bottom: 0;
495
85
  }
496
86
 
497
87
  .message-timestamp {
498
88
  font-size: 12px;
499
- color: #706e6b;
500
- margin-top: 6px;
89
+ color: #666666;
90
+ margin-top: 4px;
501
91
  display: flex;
502
92
  align-items: center;
503
93
  gap: 4px;
504
- font-weight: 400;
505
94
  }
506
95
 
507
96
  .message-sender {
@@ -524,7 +113,7 @@ body.chat-closed .global-header {
524
113
  width: 8px;
525
114
  height: 8px;
526
115
  border-radius: 50%;
527
- background-color: #0176d3;
116
+ background-color: #666666;
528
117
  animation: typing 1.4s infinite ease-in-out both;
529
118
  }
530
119
 
@@ -537,37 +126,20 @@ body.chat-closed .global-header {
537
126
  }
538
127
 
539
128
  @keyframes typing {
540
- 0%,
541
- 80%,
542
- 100% {
129
+ 0%, 80%, 100% {
543
130
  transform: scale(0);
544
131
  opacity: 0.5;
545
132
  }
546
-
547
133
  40% {
548
134
  transform: scale(1);
549
135
  opacity: 1;
550
136
  }
551
137
  }
552
138
 
553
- @keyframes message-slide-in {
554
- from {
555
- opacity: 0;
556
- transform: translateY(12px);
557
- }
558
-
559
- to {
560
- opacity: 1;
561
- transform: translateY(0);
562
- }
563
- }
564
-
565
139
  .chat-input-area {
566
- border-top: 1px solid #e5e7ea;
567
- padding: 20px 24px;
568
- background: white;
569
- flex-shrink: 0;
570
- backdrop-filter: blur(20px);
140
+ border-top: 1px solid #e0e0e0;
141
+ padding: 16px;
142
+ background-color: #ffffff;
571
143
  }
572
144
 
573
145
  .chat-input-container {
@@ -578,22 +150,18 @@ body.chat-closed .global-header {
578
150
 
579
151
  .chat-input {
580
152
  flex: 1;
581
- padding: 14px 18px;
582
- border: 2px solid #d8dde6;
583
- border-radius: 24px;
584
- font-size: 15px;
153
+ padding: 12px 16px;
154
+ border: 1px solid #e0e0e0;
155
+ border-radius: 20px;
156
+ font-size: 14px;
585
157
  outline: none;
586
- background-color: #fafbfc;
587
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
588
- font-family: inherit;
589
- line-height: 1.4;
158
+ background-color: #f8f9fa;
159
+ transition: border-color 0.2s ease;
590
160
  }
591
161
 
592
162
  .chat-input:focus {
593
- border-color: #0176d3;
594
- background-color: #fff;
595
- box-shadow: 0 0 0 3px rgb(1 118 211 / 10%);
596
- transform: translateY(-1px);
163
+ border-color: #0066cc;
164
+ background-color: #ffffff;
597
165
  }
598
166
 
599
167
  .chat-input:disabled {
@@ -602,32 +170,26 @@ body.chat-closed .global-header {
602
170
  }
603
171
 
604
172
  .chat-send-button {
605
- width: 44px;
606
- height: 44px;
173
+ width: 40px;
174
+ height: 40px;
607
175
  border: none;
608
176
  border-radius: 50%;
609
- background: linear-gradient(135deg, #0176d3 0%, #005fb2 100%);
177
+ background-color: #0066cc;
610
178
  color: white;
611
179
  cursor: pointer;
612
180
  display: flex;
613
181
  align-items: center;
614
182
  justify-content: center;
615
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
616
- box-shadow: 0 4px 12px rgb(1 118 211 / 25%);
617
- margin-left: 12px;
183
+ transition: background-color 0.2s ease;
618
184
  }
619
185
 
620
186
  .chat-send-button:hover:not(:disabled) {
621
- background: linear-gradient(135deg, #005fb2 0%, #003e73 100%);
622
- transform: scale(1.05);
623
- box-shadow: 0 6px 16px rgb(1 118 211 / 35%);
187
+ background-color: #0052a3;
624
188
  }
625
189
 
626
190
  .chat-send-button:disabled {
627
- background: #d8dde6;
191
+ background-color: #cccccc;
628
192
  cursor: not-allowed;
629
- transform: none;
630
- box-shadow: none;
631
193
  }
632
194
 
633
195
  .send-icon {
@@ -637,185 +199,47 @@ body.chat-closed .global-header {
637
199
 
638
200
  /* Responsive design */
639
201
  @media (max-width: 768px) {
640
- .chat-trigger-button {
641
- bottom: 16px;
642
- right: 16px;
643
- }
644
-
645
- .chat-gif {
646
- width: 56px;
647
- height: 56px;
648
- }
649
-
650
- /* Adjust tooltip for mobile */
651
- .chat-trigger-button::before {
652
- font-size: 13px;
653
- padding: 10px 14px;
654
- margin-right: 12px;
655
- }
656
-
657
- .chat-trigger-button::after {
658
- margin-right: 6px;
659
- border-left-width: 6px;
660
- border-top-width: 6px;
661
- border-bottom-width: 6px;
662
- }
663
-
664
202
  .chat-container {
665
- width: 100%;
666
- right: 0;
667
- transform: translateX(100%);
203
+ max-width: 100%;
204
+ border-radius: 0;
205
+ border-left: none;
206
+ border-right: none;
668
207
  }
669
-
670
- .chat-container_open {
671
- transform: translateX(0);
672
- }
673
-
674
- .chat-header {
675
- padding: 16px 20px;
676
- }
677
-
678
- .chat-title {
679
- font-size: 18px;
680
- }
681
-
682
- .chat-messages {
683
- padding: 20px 16px;
684
- }
685
-
686
- .chat-input-area {
687
- padding: 16px 20px;
688
- }
689
-
208
+
690
209
  .message-content {
691
- max-width: 85%;
692
- }
693
-
694
- .avatar-container {
695
- width: 32px;
696
- height: 32px;
697
- }
698
-
699
- .avatar-icon {
700
- width: 28px;
701
- height: 28px;
702
- }
703
-
704
- .message-wrapper {
705
- gap: 10px;
706
- }
707
- }
708
-
709
- @media (max-width: 480px) {
710
- .chat-trigger-button {
711
- bottom: 10px;
712
- right: 10px;
713
- }
714
-
715
- .chat-gif {
716
- width: 48px;
717
- height: 48px;
718
- }
719
-
720
- /* Smaller tooltip for small screens */
721
- .chat-trigger-button::before {
722
- font-size: 12px;
723
- padding: 8px 12px;
724
- margin-right: 10px;
725
- border-radius: 8px;
726
- }
727
-
728
- .chat-trigger-button::after {
729
- margin-right: 4px;
730
- border-left-width: 5px;
731
- border-top-width: 5px;
732
- border-bottom-width: 5px;
733
- }
734
-
735
- .chat-container {
736
- width: 100%;
210
+ max-width: 90%;
737
211
  }
738
-
739
- .chat-header {
740
- padding: 12px;
741
- }
742
-
212
+
743
213
  .chat-messages {
744
- padding: 12px;
745
- }
746
-
747
- .chat-input-area {
748
- padding: 12px;
749
- }
750
-
751
- .avatar-container {
752
- width: 28px;
753
- height: 28px;
754
- }
755
-
756
- .avatar-icon {
757
- width: 24px;
758
- height: 24px;
759
- }
760
-
761
- .message-wrapper {
762
- gap: 8px;
763
- margin-bottom: 16px;
214
+ max-height: 250px;
764
215
  }
765
216
  }
766
217
 
767
218
  /* Accessibility improvements */
768
219
  @media (prefers-reduced-motion: reduce) {
769
- .chat-trigger-button {
770
- animation: none;
771
- }
772
-
773
220
  .typing-dot {
774
221
  animation: none;
775
222
  }
776
-
223
+
777
224
  .chat-messages {
778
225
  scroll-behavior: auto;
779
226
  }
780
-
781
- .avatar-container {
782
- animation: none;
783
- }
784
-
785
- /* Disable all thinking bot animations for reduced motion users */
786
- .thinking-body {
787
- animation: none !important;
788
- }
789
-
790
- .thinking-smile {
791
- animation: none !important;
792
- }
793
-
794
- .thinking-eye {
795
- animation: none !important;
796
- }
797
-
798
- /* Disable tooltip animations for reduced motion users */
799
- .chat-trigger-button::before,
800
- .chat-trigger-button::after {
801
- transition: none;
802
- }
803
227
  }
804
228
 
805
229
  /* High contrast mode support */
806
230
  @media (prefers-contrast: high) {
807
231
  .chat-container {
808
- border: 2px solid #000;
232
+ border: 2px solid #000000;
809
233
  }
810
-
234
+
811
235
  .message-wrapper[data-sender="user"] .message-bubble {
812
- background-color: #000;
813
- color: #fff;
236
+ background-color: #000000;
237
+ color: #ffffff;
814
238
  }
815
-
239
+
816
240
  .message-wrapper[data-sender="assistant"] .message-bubble {
817
- background-color: #fff;
818
- color: #000;
819
- border: 1px solid #000;
241
+ background-color: #ffffff;
242
+ color: #000000;
243
+ border: 1px solid #000000;
820
244
  }
821
- }
245
+ }