@netlify/spark-ui 1.5.0-alpha.14 → 1.5.0-alpha.3
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.
- package/dist/assets/AskNetlify.css +1 -1
- package/dist/assets/SearchHeading.css +1 -1
- package/dist/assets/SearchLink.css +1 -1
- package/dist/assets/SearchModal.css +1 -1
- package/dist/components/preact/AskNetlify/AskNetlify.d.ts +1 -6
- package/dist/components/preact/AskNetlify/AskNetlify.js +665 -680
- package/dist/components/preact/Icon/index.js +30 -57
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +49 -42
- package/dist/components/preact/SearchModal/components/SearchWindow.js +19 -20
- package/dist/components/preact/SearchModal/hooks/useSearchToggles.d.ts +1 -3
- package/dist/components/preact/SearchModal/hooks/useSearchToggles.js +10 -13
- package/package.json +1 -1
- package/packages/components/preact/AskNetlify/AskNetlify.css +109 -191
- package/packages/components/preact/AskNetlify/AskNetlify.tsx +29 -45
- package/packages/components/preact/Icon/index.tsx +0 -21
- package/packages/components/preact/SearchModal/components/SearchHeading/SearchHeading.css +1 -1
- package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.css +1 -6
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.css +20 -4
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +11 -3
- package/packages/components/preact/SearchModal/components/SearchWindow.tsx +2 -4
- package/packages/components/preact/SearchModal/hooks/useSearchToggles.ts +3 -11
- package/packages/styles/tokens.css +4 -12
- package/packages/utils/theme.ts +0 -4
|
@@ -1,78 +1,38 @@
|
|
|
1
|
-
/* ----------------------------- */
|
|
2
|
-
/* Layout Containers */
|
|
3
|
-
/* ----------------------------- */
|
|
4
1
|
.chat-container {
|
|
5
2
|
opacity: 0;
|
|
6
3
|
animation: appearContainer 120ms ease-in-out forwards;
|
|
7
4
|
animation-delay: 140ms;
|
|
8
5
|
}
|
|
9
6
|
|
|
7
|
+
@keyframes appearContainer {
|
|
8
|
+
0% {
|
|
9
|
+
opacity: 0;
|
|
10
|
+
}
|
|
11
|
+
100% {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
.conversation {
|
|
11
|
-
display: grid;
|
|
12
|
-
align-items: flex-end;
|
|
13
17
|
height: calc(var(--n-search-container-height) + var(--n-search-footer-height));
|
|
14
18
|
padding: var(--n-search-padding-inline);
|
|
15
|
-
overflow-y: auto;
|
|
16
19
|
scroll-behavior: smooth;
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
display: grid;
|
|
22
|
+
align-items: flex-end;
|
|
17
23
|
gap: var(--space-s);
|
|
18
24
|
}
|
|
19
25
|
|
|
20
|
-
.form-wrapper {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
position: relative;
|
|
24
|
-
height: var(--n-search-input-height);
|
|
25
|
-
background-color: var(--search-input-bg-color);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.form-wrapper::after {
|
|
29
|
-
content: '';
|
|
30
|
-
display: block;
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: 0;
|
|
33
|
-
left: 0;
|
|
34
|
-
width: 100%;
|
|
35
|
-
height: 1px;
|
|
36
|
-
background: var(--color-bg-3);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* ----------------------------- */
|
|
40
|
-
/* Conversation and Message UI */
|
|
41
|
-
/* ----------------------------- */
|
|
42
26
|
.question {
|
|
43
27
|
border: none;
|
|
44
|
-
border-radius: var(--radius-pill);
|
|
45
|
-
transform: translateX(-0.75rem);
|
|
46
28
|
color: var(--color-text-1);
|
|
47
|
-
font-size: var(--step--1);
|
|
48
29
|
font-weight: var(--font-weight-regular);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
align-items: center;
|
|
53
|
-
gap: var(--space-2xs);
|
|
54
|
-
transition: background-color 200ms ease-out;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.question [data-icon='caretRight'] {
|
|
58
|
-
opacity: 0;
|
|
59
|
-
color: var(--color-text-weaker);
|
|
60
|
-
transform: translateX(-3px);
|
|
61
|
-
transition: transform 200ms ease-out;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.question:hover {
|
|
65
|
-
background-color: var(--search-back-btn-bg-color);
|
|
66
|
-
|
|
67
|
-
[data-icon='caretRight'] {
|
|
68
|
-
opacity: 1;
|
|
69
|
-
transform: translateX(0px);
|
|
70
|
-
}
|
|
30
|
+
font-size: var(--step--1);
|
|
31
|
+
border-radius: var(--radius-pill);
|
|
32
|
+
transform: translateX(-0.75rem);
|
|
71
33
|
}
|
|
72
34
|
|
|
73
35
|
.question-list li {
|
|
74
|
-
position: relative;
|
|
75
|
-
width: fit-content;
|
|
76
36
|
opacity: 0;
|
|
77
37
|
transform: translateY(10px);
|
|
78
38
|
animation: fadeInUp 0.5s forwards;
|
|
@@ -81,37 +41,99 @@
|
|
|
81
41
|
.question-list li:nth-child(1) {
|
|
82
42
|
animation-delay: 0.5s;
|
|
83
43
|
}
|
|
44
|
+
|
|
84
45
|
.question-list li:nth-child(2) {
|
|
85
46
|
animation-delay: 0.3s;
|
|
86
47
|
}
|
|
48
|
+
|
|
87
49
|
.question-list li:nth-child(3) {
|
|
88
50
|
animation-delay: 0.1s;
|
|
89
51
|
}
|
|
90
52
|
|
|
53
|
+
@keyframes fadeInUp {
|
|
54
|
+
to {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
transform: translateY(0);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
91
60
|
.message {
|
|
92
61
|
display: grid;
|
|
93
|
-
grid-template-columns: minmax(0, 1fr);
|
|
94
62
|
gap: var(--space-s);
|
|
95
|
-
margin-block-start: var(--space-2xl);
|
|
96
63
|
}
|
|
97
64
|
|
|
98
65
|
.message-bubble {
|
|
99
|
-
width: fit-content;
|
|
100
|
-
max-width: 85%;
|
|
101
66
|
padding: var(--space-xs) var(--space-s);
|
|
102
67
|
background: var(--search-answer-message-color);
|
|
103
68
|
border-radius: var(--radius-l);
|
|
69
|
+
width: fit-content;
|
|
70
|
+
max-width: 85%;
|
|
104
71
|
font-size: var(--step-0);
|
|
105
72
|
}
|
|
106
73
|
|
|
74
|
+
.prose {
|
|
75
|
+
font-size: var(--step--0);
|
|
76
|
+
|
|
77
|
+
> * + * {
|
|
78
|
+
margin-top: var(--flow-space, var(--space-xs));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
h1,
|
|
82
|
+
h2,
|
|
83
|
+
h3 {
|
|
84
|
+
font-size: var(--step-1);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
h4,
|
|
88
|
+
h5,
|
|
89
|
+
h6 {
|
|
90
|
+
font-size: var(--step-0);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
pre {
|
|
94
|
+
background: var(--neutral-light-700);
|
|
95
|
+
border-radius: var(--radius-m);
|
|
96
|
+
max-width: 100%;
|
|
97
|
+
box-sizing: border-box;
|
|
98
|
+
padding: var(--space-s);
|
|
99
|
+
color: var(--color-text-inverse);
|
|
100
|
+
overflow-x: auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
code {
|
|
104
|
+
overflow-x: auto;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
code[class*='language-'],
|
|
108
|
+
pre[class*='language-'] {
|
|
109
|
+
display: block;
|
|
110
|
+
font-size: var(--font-size-text-xs);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
107
114
|
.user-message {
|
|
108
115
|
margin-inline-start: auto;
|
|
109
116
|
background: var(--search-user-message-color);
|
|
110
117
|
}
|
|
111
118
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
.form-wrapper {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
position: relative;
|
|
123
|
+
height: var(--n-search-input-height);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.form-wrapper::after {
|
|
127
|
+
content: '';
|
|
128
|
+
display: block;
|
|
129
|
+
width: 100%;
|
|
130
|
+
height: 1px;
|
|
131
|
+
background: var(--color-bg-3);
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 0;
|
|
134
|
+
left: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
115
137
|
.form-input {
|
|
116
138
|
border: none;
|
|
117
139
|
outline: none;
|
|
@@ -119,11 +141,12 @@
|
|
|
119
141
|
}
|
|
120
142
|
|
|
121
143
|
.form-submit {
|
|
144
|
+
border: none;
|
|
122
145
|
padding: 0.7rem;
|
|
146
|
+
border-radius: var(--radius-pill);
|
|
123
147
|
margin-inline-end: var(--space-2xs);
|
|
124
148
|
border: none;
|
|
125
|
-
|
|
126
|
-
background: var(--search-submit-btn-bg-color);
|
|
149
|
+
background: var(--color-link);
|
|
127
150
|
color: var(--neutral-000);
|
|
128
151
|
transition: background-color 150ms ease-out;
|
|
129
152
|
}
|
|
@@ -138,150 +161,45 @@
|
|
|
138
161
|
|
|
139
162
|
.form-submit[disabled] {
|
|
140
163
|
background: var(--neutral-500);
|
|
141
|
-
}
|
|
142
164
|
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
& > * {
|
|
166
|
+
opacity: 0.5;
|
|
167
|
+
}
|
|
145
168
|
}
|
|
146
169
|
|
|
147
|
-
/* ----------------------------- */
|
|
148
|
-
/* Buttons */
|
|
149
|
-
/* ----------------------------- */
|
|
150
170
|
.button-back {
|
|
171
|
+
width: fit-content;
|
|
172
|
+
background: transparent;
|
|
151
173
|
position: absolute;
|
|
152
174
|
z-index: 1;
|
|
153
|
-
width: fit-content;
|
|
154
|
-
margin: 1rem;
|
|
155
175
|
padding: 0.5rem 1rem;
|
|
156
176
|
background: var(--search-back-btn-bg-color);
|
|
157
|
-
|
|
177
|
+
margin: 1rem;
|
|
178
|
+
border: 2px solid var(--color-bg-3);
|
|
158
179
|
border-radius: var(--radius-pill);
|
|
159
180
|
font-size: var(--step--1);
|
|
160
|
-
|
|
181
|
+
border: 1px solid;
|
|
161
182
|
cursor: pointer;
|
|
183
|
+
border-color: var(--color-bg-3);
|
|
184
|
+
color: var(--color-text-1);
|
|
185
|
+
border-width: 0.5px;
|
|
162
186
|
}
|
|
163
187
|
|
|
164
|
-
|
|
165
|
-
/* Typography & Prose */
|
|
166
|
-
/* ----------------------------- */
|
|
167
|
-
.prose {
|
|
168
|
-
font-size: var(--step--0);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.prose > * + * {
|
|
172
|
-
margin-top: var(--flow-space, var(--space-s));
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.prose :where(ol, ul, li) > * + * {
|
|
176
|
-
margin-top: var(--flow-space, var(--space-3xs));
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.prose h1,
|
|
180
|
-
.prose h2,
|
|
181
|
-
.prose h3 {
|
|
182
|
-
font-size: var(--step-1);
|
|
183
|
-
font-weight: var(--font-weight-bold);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.prose h4,
|
|
187
|
-
.prose h5,
|
|
188
|
-
.prose h6 {
|
|
189
|
-
font-size: var(--step-0);
|
|
190
|
-
font-weight: var(--font-weight-bold);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.prose pre {
|
|
194
|
-
max-width: 100%;
|
|
195
|
-
padding: var(--space-s);
|
|
196
|
-
background: var(--neutral-light-700);
|
|
197
|
-
border-radius: var(--radius-m);
|
|
198
|
-
box-sizing: border-box;
|
|
199
|
-
color: var(--neutral-100);
|
|
200
|
-
overflow-x: auto;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.prose code {
|
|
204
|
-
overflow-x: auto;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.prose code[class*='language-'],
|
|
208
|
-
.prose pre[class*='language-'] {
|
|
209
|
-
display: block;
|
|
210
|
-
font-size: var(--font-size-text-xs);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/* ----------------------------- */
|
|
214
|
-
/* Loaders and SVG Effects */
|
|
215
|
-
/* ----------------------------- */
|
|
216
|
-
.message-loader {
|
|
217
|
-
width: 2.5rem;
|
|
218
|
-
height: auto;
|
|
188
|
+
.pulsing {
|
|
219
189
|
display: block;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
animation: fadeIn 800ms ease-in-out infinite;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.message-loader #ask-netlify-tick-1 {
|
|
229
|
-
animation-delay: 100ms;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.message-loader #ask-netlify-tick-2 {
|
|
233
|
-
animation-delay: 200ms;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.message-loader #ask-netlify-tick-3 {
|
|
237
|
-
animation-delay: 300ms;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.message-loader :where(#ask-netlify-eyelid-left, #ask-netlify-eyelid-right) {
|
|
241
|
-
transform-origin: top center;
|
|
242
|
-
transform: scaleY(1.035);
|
|
243
|
-
animation: askEyeBlink 4s infinite;
|
|
244
|
-
animation-delay: 1s;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/* ----------------------------- */
|
|
248
|
-
/* Animations and Keyframes */
|
|
249
|
-
/* ----------------------------- */
|
|
250
|
-
@keyframes fadeIn {
|
|
251
|
-
0% {
|
|
252
|
-
opacity: 0;
|
|
253
|
-
}
|
|
254
|
-
100% {
|
|
255
|
-
opacity: 1;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
@keyframes fadeInUp {
|
|
260
|
-
to {
|
|
261
|
-
opacity: 1;
|
|
262
|
-
transform: translateY(0);
|
|
263
|
-
}
|
|
190
|
+
width: 1rem;
|
|
191
|
+
height: 1rem;
|
|
192
|
+
clip-path: circle(40%);
|
|
193
|
+
background: var(--search-loading-color);
|
|
194
|
+
animation: pulsing 2.5s infinite ease-in-out;
|
|
264
195
|
}
|
|
265
196
|
|
|
266
|
-
@keyframes
|
|
197
|
+
@keyframes pulsing {
|
|
267
198
|
0%,
|
|
268
|
-
5% {
|
|
269
|
-
transform: scaleY(1.035);
|
|
270
|
-
}
|
|
271
|
-
6%,
|
|
272
|
-
10% {
|
|
273
|
-
transform: scaleY(1.3);
|
|
274
|
-
}
|
|
275
|
-
11%,
|
|
276
|
-
15% {
|
|
277
|
-
transform: scaleY(1.035);
|
|
278
|
-
}
|
|
279
|
-
16%,
|
|
280
|
-
20% {
|
|
281
|
-
transform: scaleY(1.3);
|
|
282
|
-
}
|
|
283
|
-
21%,
|
|
284
199
|
100% {
|
|
285
|
-
transform:
|
|
200
|
+
transform: scale(0.9);
|
|
201
|
+
}
|
|
202
|
+
50% {
|
|
203
|
+
transform: scale(1.05);
|
|
286
204
|
}
|
|
287
205
|
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { useState, useRef, useEffect } from 'preact/hooks';
|
|
2
2
|
import { marked } from 'marked';
|
|
3
3
|
import { KapaProvider, useChat } from '@kapaai/react-sdk';
|
|
4
|
-
import Icon from '../Icon';
|
|
5
4
|
|
|
6
5
|
import './AskNetlify.css';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
setModalState?: (state?: { current: string }) => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function AskNetlify(props: AskNetlifyProps) {
|
|
7
|
+
function AskNetlify(props) {
|
|
13
8
|
return (
|
|
14
9
|
<KapaProvider
|
|
15
10
|
integrationId="3c0789a6-c6a8-4fbc-b0cc-235f9e4a6351"
|
|
@@ -24,48 +19,49 @@ function AskNetlify(props: AskNetlifyProps) {
|
|
|
24
19
|
);
|
|
25
20
|
}
|
|
26
21
|
|
|
27
|
-
function ChatInterface({ setModalState }
|
|
22
|
+
function ChatInterface({ setModalState }) {
|
|
28
23
|
const [message, setMessage] = useState('');
|
|
29
24
|
const { conversation, submitQuery, isGeneratingAnswer, isPreparingAnswer, stopGeneration } =
|
|
30
25
|
useChat();
|
|
31
26
|
|
|
32
|
-
const chatRef = useRef
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
'
|
|
38
|
-
'e477f4dd-7159-4c31-8a18-4dfc7e84d927': 'How does Netlify simplify my CI/CD pipeline?',
|
|
39
|
-
'39229ddb-9000-4e83-bbf8-54f1c1e55ed4':
|
|
40
|
-
'How does Netlify help improve my site’s Core Web Vitals?',
|
|
41
|
-
'5c41b3c2-4c90-4cf7-9f24-f0d0b8f0f759':
|
|
42
|
-
'What are the benefits of using Netlify with a headless CMS?',
|
|
43
|
-
'0270de6c-387e-401f-b24c-6ae1166db477':
|
|
44
|
-
'What are the benefits of hosting on Netlify’s edge network?',
|
|
27
|
+
const chatRef = useRef(null);
|
|
28
|
+
|
|
29
|
+
const QandAMap = {
|
|
30
|
+
'487cda5f-e852-4223-85dd-d18ab58dc7a9': "Why can't I add my domain to Netlify DNS?",
|
|
31
|
+
'd133a822-dbe1-4870-8a94-212c5841f194': 'Why is my website not loading?',
|
|
32
|
+
'e477f4dd-7159-4c31-8a18-4dfc7e84d927': 'How do I set up environment variables?',
|
|
45
33
|
};
|
|
46
34
|
|
|
47
|
-
const handleSubmit =
|
|
35
|
+
const handleSubmit = e => {
|
|
48
36
|
e.preventDefault();
|
|
49
37
|
|
|
50
|
-
const
|
|
51
|
-
const questionId = input?.getAttribute('data-id');
|
|
52
|
-
const question = questionId ? questions[questionId] : message;
|
|
38
|
+
const id = e.target.getAttribute('data-id');
|
|
53
39
|
|
|
54
|
-
if (
|
|
55
|
-
|
|
40
|
+
if (id) {
|
|
41
|
+
const question = QandAMap[id];
|
|
42
|
+
if (question.trim()) {
|
|
43
|
+
submitQuery(question.trim());
|
|
44
|
+
}
|
|
45
|
+
setMessage('');
|
|
56
46
|
}
|
|
57
47
|
|
|
58
48
|
if (message.trim()) {
|
|
49
|
+
submitQuery(message.trim());
|
|
59
50
|
setMessage('');
|
|
60
51
|
}
|
|
61
52
|
};
|
|
62
53
|
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const el = chatRef.current as HTMLElement | null;
|
|
56
|
+
if (el) el.scrollTop = el.scrollHeight;
|
|
57
|
+
}, [conversation]);
|
|
58
|
+
|
|
63
59
|
return (
|
|
64
60
|
<div className="chat-container">
|
|
65
61
|
<button
|
|
66
62
|
class="button button-back"
|
|
67
63
|
data-button-variant="outline"
|
|
68
|
-
onClick={() => setModalState
|
|
64
|
+
onClick={() => setModalState({ current: 'search' })}
|
|
69
65
|
aria-label={'Return to search'}
|
|
70
66
|
>
|
|
71
67
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
|
@@ -78,27 +74,14 @@ function ChatInterface({ setModalState }: AskNetlifyProps) {
|
|
|
78
74
|
</button>
|
|
79
75
|
<div ref={chatRef} className="conversation n-search-window">
|
|
80
76
|
{!conversation.length && (
|
|
81
|
-
<ul
|
|
82
|
-
{Object.entries(
|
|
77
|
+
<ul class="question-list" role="list">
|
|
78
|
+
{Object.entries(QandAMap).map(([id, question]) => (
|
|
83
79
|
<li>
|
|
84
80
|
<button class="question" onClick={handleSubmit} data-id={id}>
|
|
85
81
|
{question}
|
|
86
|
-
<Icon name="caretRight" />
|
|
87
82
|
</button>
|
|
88
83
|
</li>
|
|
89
84
|
))}
|
|
90
|
-
|
|
91
|
-
<span
|
|
92
|
-
ref={indicatorRef}
|
|
93
|
-
style={{
|
|
94
|
-
position: 'absolute',
|
|
95
|
-
background: 'rgba(0, 0, 0, 0.1)',
|
|
96
|
-
borderRadius: '4px',
|
|
97
|
-
transition: 'all 200ms ease',
|
|
98
|
-
pointerEvents: 'none',
|
|
99
|
-
zIndex: -1,
|
|
100
|
-
}}
|
|
101
|
-
/>
|
|
102
85
|
</ul>
|
|
103
86
|
)}
|
|
104
87
|
|
|
@@ -121,9 +104,7 @@ function ChatInterface({ setModalState }: AskNetlifyProps) {
|
|
|
121
104
|
/>
|
|
122
105
|
</div>
|
|
123
106
|
) : (
|
|
124
|
-
<
|
|
125
|
-
<Icon name="askNetlify" />
|
|
126
|
-
</div>
|
|
107
|
+
<span class="pulsing"></span>
|
|
127
108
|
)}
|
|
128
109
|
</div>
|
|
129
110
|
</div>
|
|
@@ -139,6 +120,9 @@ function ChatInterface({ setModalState }: AskNetlifyProps) {
|
|
|
139
120
|
placeholder="Ask a question..."
|
|
140
121
|
disabled={isGeneratingAnswer}
|
|
141
122
|
/>
|
|
123
|
+
{/* <button type="submit" className="form-submit" disabled={isGeneratingAnswer}>
|
|
124
|
+
Send
|
|
125
|
+
</button> */}
|
|
142
126
|
|
|
143
127
|
{isGeneratingAnswer ? (
|
|
144
128
|
<button
|
|
@@ -27,27 +27,22 @@ const AskNetlify: FunctionComponent = () => {
|
|
|
27
27
|
return (
|
|
28
28
|
<>
|
|
29
29
|
<path
|
|
30
|
-
id="ask-netlify-tick-3"
|
|
31
30
|
d="M9.26465 1.02094L9.31322 0.921348L10.0528 0.666687L10.1524 0.715259L10.5563 1.9638L10.2999 2.4895L10.195 2.52628L9.6685 2.26948L9.26465 1.02094Z"
|
|
32
31
|
fill="currentColor"
|
|
33
32
|
/>
|
|
34
33
|
<path
|
|
35
|
-
id="ask-netlify-tick-1"
|
|
36
34
|
d="M15.5915 3.11667L15.6942 3.15818L15.9999 3.8782L15.9584 3.98093L14.741 4.4709L14.1987 4.25179L14.1547 4.14977L14.3742 3.60663L15.5915 3.11667Z"
|
|
37
35
|
fill="currentColor"
|
|
38
36
|
/>
|
|
39
37
|
<path
|
|
40
|
-
id="ask-netlify-tick-2"
|
|
41
38
|
d="M12.8306 0.944052L12.9353 0.907978L13.6384 1.25087L13.6744 1.35564L12.9408 2.91375L12.3877 3.10417L12.2876 3.05604L12.0969 2.50216L12.8306 0.944052Z"
|
|
42
39
|
fill="currentColor"
|
|
43
40
|
/>
|
|
44
41
|
<path
|
|
45
|
-
id="ask-netlify-eye-left"
|
|
46
42
|
d="M5.60625 10.7823C5.60625 11.421 5.09138 11.9387 4.45625 11.9387C3.82112 11.9387 3.30625 11.421 3.30625 10.7823C3.30625 10.1436 3.82112 9.62585 4.45625 9.62585C5.09138 9.62585 5.60625 10.1436 5.60625 10.7823Z"
|
|
47
43
|
fill="currentColor"
|
|
48
44
|
/>
|
|
49
45
|
<path
|
|
50
|
-
id="ask-netlify-eye-right"
|
|
51
46
|
d="M10.8777 11.9387C11.5129 11.9387 12.0277 11.421 12.0277 10.7823C12.0277 10.1436 11.5129 9.62585 10.8777 9.62585C10.2426 9.62585 9.72774 10.1436 9.72774 10.7823C9.72774 11.421 10.2426 11.9387 10.8777 11.9387Z"
|
|
52
47
|
fill="currentColor"
|
|
53
48
|
/>
|
|
@@ -61,22 +56,6 @@ const AskNetlify: FunctionComponent = () => {
|
|
|
61
56
|
d="M7.86997 4.00002C11.9918 4.00002 15.3333 6.70814 15.3333 10.853C15.3333 13.3274 13.3386 15.3334 10.878 15.3334H0V10.853C0 6.70814 3.34157 4.00002 7.46336 4.00002H7.86997ZM0.990302 10.5245C0.990302 8.69571 2.51537 7.15558 4.33747 7.15558C5.71877 7.15558 6.90206 7.9938 7.41504 9.19232C7.41751 9.1981 7.42291 9.20918 7.42291 9.20918H7.91072C7.91072 9.20918 7.91612 9.1981 7.91859 9.19232C8.43157 7.9938 9.61486 7.15558 10.9962 7.15558C12.8183 7.15558 14.3433 8.69571 14.3433 10.5245C14.3433 12.2311 12.9812 13.8499 11.447 13.8845H4.15184C2.38987 13.7867 0.990302 12.323 0.990302 10.5245Z"
|
|
62
57
|
fill="currentColor"
|
|
63
58
|
/>
|
|
64
|
-
<rect
|
|
65
|
-
id="ask-netlify-eyelid-left"
|
|
66
|
-
x="3"
|
|
67
|
-
y="7.3"
|
|
68
|
-
width="3"
|
|
69
|
-
height="2"
|
|
70
|
-
fill="var(--search-bg-color, currentColor)"
|
|
71
|
-
/>
|
|
72
|
-
<rect
|
|
73
|
-
id="ask-netlify-eyelid-right"
|
|
74
|
-
x="9.7"
|
|
75
|
-
y="7.3"
|
|
76
|
-
width="3"
|
|
77
|
-
height="2"
|
|
78
|
-
fill="var(--search-bg-color, currentColor)"
|
|
79
|
-
/>
|
|
80
59
|
</>
|
|
81
60
|
);
|
|
82
61
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.n-search-heading {
|
|
2
2
|
--n-search-heading-weight: var(--font-weight-semibold, 400);
|
|
3
3
|
--n-search-heading-size: var(--font-size-text-xs, 13px);
|
|
4
|
-
--n-search-heading-color: var(--color-text-
|
|
4
|
+
--n-search-heading-color: var(--color-text-weaker, #757575);
|
|
5
5
|
|
|
6
6
|
font-size: var(--n-search-heading-size);
|
|
7
7
|
font-weight: var(--n-search-heading-weight);
|
|
@@ -31,11 +31,6 @@
|
|
|
31
31
|
& .n-search-link-icon [data-icon='caretRight'] {
|
|
32
32
|
opacity: 1;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
& .n-search-link-icon :where(#ask-netlify-eyelid-left, #ask-netlify-eyelid-right) {
|
|
36
|
-
animation: askEyeBlink 4s infinite;
|
|
37
|
-
animation-delay: 500ms;
|
|
38
|
-
}
|
|
39
34
|
}
|
|
40
35
|
|
|
41
36
|
.n-search-link-title {
|
|
@@ -64,7 +59,7 @@
|
|
|
64
59
|
display: flex;
|
|
65
60
|
width: var(--n-search-icon-size);
|
|
66
61
|
height: var(--n-search-icon-size);
|
|
67
|
-
color: var(--n-search-color-
|
|
62
|
+
color: var(--n-search-color-text-secondary);
|
|
68
63
|
}
|
|
69
64
|
|
|
70
65
|
.n-search-link-icon [data-icon='caretRight'] {
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
.n-search-modal {
|
|
7
7
|
--n-search-padding-inline: var(--space-s);
|
|
8
8
|
--n-search-color-text: var(--color-text-1, currentColor);
|
|
9
|
-
--n-search-color-text-secondary: var(--color-text-
|
|
10
|
-
--n-search-color-icon: var(--color-text-weak);
|
|
9
|
+
--n-search-color-text-secondary: var(--color-text-weaker, currentColor);
|
|
11
10
|
--n-search-color-bg: var(--search-bg-color);
|
|
12
11
|
--n-search-color-bg-2: var(--color-bg-3);
|
|
13
12
|
--n-search-color-border: var(--color-bg-3);
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
--n-search-text-highlight: var(--search-highlight-color);
|
|
17
16
|
--n-search-input-height: 50px;
|
|
18
17
|
--n-search-footer-height: 40px;
|
|
19
|
-
--n-search-container-height:
|
|
18
|
+
--n-search-container-height: 400px;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
.n-search-modal {
|
|
@@ -28,6 +27,21 @@
|
|
|
28
27
|
background: var(--n-search-color-bg);
|
|
29
28
|
}
|
|
30
29
|
|
|
30
|
+
.n-search-modal::after {
|
|
31
|
+
content: '';
|
|
32
|
+
display: block;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
background: blue;
|
|
36
|
+
position: absolute;
|
|
37
|
+
z-index: 0;
|
|
38
|
+
inset: 0;
|
|
39
|
+
transform-origin: center;
|
|
40
|
+
transform: scale(0);
|
|
41
|
+
border-radius: var(--radius-m);
|
|
42
|
+
transition: transform 300ms ease-in-out;
|
|
43
|
+
}
|
|
44
|
+
|
|
31
45
|
.n-search-modal-ask {
|
|
32
46
|
--n-search-max-w: 800px;
|
|
33
47
|
}
|
|
@@ -36,6 +50,7 @@
|
|
|
36
50
|
--mark-bg: var(--n-search-text-highlight);
|
|
37
51
|
display: grid;
|
|
38
52
|
width: min(var(--n-search-max-w), 100%);
|
|
53
|
+
/* min-height: 530px; */
|
|
39
54
|
background-color: var(--n-search-color-bg);
|
|
40
55
|
border-radius: var(--n-search-border-radius);
|
|
41
56
|
overflow: hidden;
|
|
@@ -51,6 +66,7 @@
|
|
|
51
66
|
}
|
|
52
67
|
|
|
53
68
|
.n-search-input-wrapper {
|
|
69
|
+
/* all: unset; */
|
|
54
70
|
position: relative;
|
|
55
71
|
display: flex;
|
|
56
72
|
width: 100%;
|
|
@@ -61,7 +77,7 @@
|
|
|
61
77
|
position: relative;
|
|
62
78
|
display: inline-flex;
|
|
63
79
|
box-sizing: border-box;
|
|
64
|
-
background:
|
|
80
|
+
background: var(--n-search-color-bg);
|
|
65
81
|
inline-size: 100%;
|
|
66
82
|
padding-block: 0.75rem;
|
|
67
83
|
padding-inline: var(--n-search-padding-inline);
|