-
Notifications
You must be signed in to change notification settings - Fork 554
Expand file tree
/
Copy path_chat.scss
More file actions
145 lines (126 loc) · 3.36 KB
/
_chat.scss
File metadata and controls
145 lines (126 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
@use '../../shared/_variables';
.ais-Chat {
position: fixed;
display: flex;
flex-direction: column;
justify-content: flex-end;
gap: var(--ais-spacing);
align-items: flex-end;
right: var(--ais-chat-margin);
bottom: var(--ais-chat-margin);
width: var(--ais-chat-width);
height: var(--ais-chat-height);
max-width: calc(100% - var(--ais-chat-margin) * 2);
max-height: calc(100% - var(--ais-chat-margin) * 2);
z-index: var(--ais-z-index-chat);
pointer-events: none;
&--maximized {
width: var(--ais-chat-maximized-width);
height: var(--ais-chat-maximized-height);
}
// Side panel mode: full-height panel anchored to the right edge
&--side-panel {
right: 0;
bottom: 0;
top: 0;
width: 0;
height: 100%;
max-height: 100%;
max-width: 100%;
gap: 0;
&.ais-Chat--open {
width: var(--ais-chat-side-panel-width, 24rem);
}
.ais-Chat-container {
border-radius: 0;
transform-origin: right center;
transform: translateX(100%);
&--open {
transform: translateX(0);
}
}
.ais-Chat-toggleButtonWrapper {
position: absolute;
left: 0;
bottom: var(--ais-chat-margin);
transform: translateX(calc(-100% - var(--ais-chat-margin)));
}
}
// Inline mode: flows with the document, single-message view
&--inline {
position: relative;
right: auto;
bottom: auto;
width: 100%;
height: auto;
max-width: none;
max-height: none;
pointer-events: auto;
gap: 0;
.ais-Chat-container {
pointer-events: auto;
opacity: 1;
transform: none;
max-height: var(--ais-chat-inline-max-height, 32rem);
}
.ais-ChatHeader-maximize,
.ais-ChatHeader-close {
display: none;
}
}
@media (prefers-reduced-motion: no-preference) {
transition: width var(--ais-transition-duration) var(--ais-transition-timing-function),
height var(--ais-transition-duration) var(--ais-transition-timing-function);
}
}
.ais-Chat-container {
display: flex;
flex-direction: column;
background-color: rgba(var(--ais-background-color-rgb),
var(--ais-background-color-alpha));
border-radius: var(--ais-border-radius-lg);
box-shadow: var(--ais-shadow-md);
width: 100%;
height: 100%;
overflow: hidden;
opacity: 0;
transform-origin: bottom right;
transform: scale(0.95) translateY(var(--ais-spacing));
@media (prefers-reduced-motion: no-preference) {
transition: opacity var(--ais-transition-duration) var(--ais-transition-timing-function),
transform var(--ais-transition-duration) var(--ais-transition-timing-function);
}
&--open {
pointer-events: auto;
opacity: 1;
transform: scale(1) translateY(0);
}
}
.ais-Chat-toggleButtonWrapper {
pointer-events: auto;
}
// Smooth body margin transition for side-panel mode
body {
@media (prefers-reduced-motion: no-preference) {
transition: margin-right var(--ais-transition-duration, 200ms) var(--ais-transition-timing-function, ease);
}
}
@media (max-width: variables.$ais-chat-breakpoint) {
.ais-Chat {
inset: 0;
height: 100%;
width: 100%;
transition: none;
max-width: initial;
max-height: initial;
gap: 0;
}
.ais-Chat-container {
border-radius: 0;
transition: none;
}
// On mobile, side-panel falls back to full-screen like overlay
.ais-Chat--side-panel {
width: 100%;
}
}