@netlify/spark-ui 1.5.0-alpha.13 → 1.5.0-alpha.14
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.js +439 -423
- package/dist/components/preact/Icon/index.js +2 -2
- package/package.json +1 -1
- package/packages/components/preact/AskNetlify/AskNetlify.css +30 -5
- package/packages/components/preact/AskNetlify/AskNetlify.tsx +17 -7
- package/packages/components/preact/Icon/index.tsx +2 -2
- package/packages/components/preact/SearchModal/components/SearchHeading/SearchHeading.css +1 -1
- package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.css +5 -0
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.css +4 -4
- package/packages/styles/tokens.css +12 -8
|
@@ -83,7 +83,7 @@ const l = () => /* @__PURE__ */ C(e, { children: [
|
|
|
83
83
|
x: "3",
|
|
84
84
|
y: "7.3",
|
|
85
85
|
width: "3",
|
|
86
|
-
height: "2
|
|
86
|
+
height: "2",
|
|
87
87
|
fill: "var(--search-bg-color, currentColor)"
|
|
88
88
|
}
|
|
89
89
|
),
|
|
@@ -94,7 +94,7 @@ const l = () => /* @__PURE__ */ C(e, { children: [
|
|
|
94
94
|
x: "9.7",
|
|
95
95
|
y: "7.3",
|
|
96
96
|
width: "3",
|
|
97
|
-
height: "2
|
|
97
|
+
height: "2",
|
|
98
98
|
fill: "var(--search-bg-color, currentColor)"
|
|
99
99
|
}
|
|
100
100
|
)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/spark-ui",
|
|
3
3
|
"description": "Assets, design tokens, components, and utilities",
|
|
4
|
-
"version": "1.5.0-alpha.
|
|
4
|
+
"version": "1.5.0-alpha.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/components/preact/index.js",
|
|
7
7
|
"types": "dist/components/preact/index.d.ts",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
align-items: center;
|
|
23
23
|
position: relative;
|
|
24
24
|
height: var(--n-search-input-height);
|
|
25
|
+
background-color: var(--search-input-bg-color);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
.form-wrapper::after {
|
|
@@ -47,9 +48,31 @@
|
|
|
47
48
|
font-weight: var(--font-weight-regular);
|
|
48
49
|
text-align: left;
|
|
49
50
|
text-wrap: pretty;
|
|
51
|
+
display: flex;
|
|
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
|
+
}
|
|
50
71
|
}
|
|
51
72
|
|
|
52
73
|
.question-list li {
|
|
74
|
+
position: relative;
|
|
75
|
+
width: fit-content;
|
|
53
76
|
opacity: 0;
|
|
54
77
|
transform: translateY(10px);
|
|
55
78
|
animation: fadeInUp 0.5s forwards;
|
|
@@ -100,7 +123,7 @@
|
|
|
100
123
|
margin-inline-end: var(--space-2xs);
|
|
101
124
|
border: none;
|
|
102
125
|
border-radius: var(--radius-pill);
|
|
103
|
-
background: var(--
|
|
126
|
+
background: var(--search-submit-btn-bg-color);
|
|
104
127
|
color: var(--neutral-000);
|
|
105
128
|
transition: background-color 150ms ease-out;
|
|
106
129
|
}
|
|
@@ -157,12 +180,14 @@
|
|
|
157
180
|
.prose h2,
|
|
158
181
|
.prose h3 {
|
|
159
182
|
font-size: var(--step-1);
|
|
183
|
+
font-weight: var(--font-weight-bold);
|
|
160
184
|
}
|
|
161
185
|
|
|
162
186
|
.prose h4,
|
|
163
187
|
.prose h5,
|
|
164
188
|
.prose h6 {
|
|
165
189
|
font-size: var(--step-0);
|
|
190
|
+
font-weight: var(--font-weight-bold);
|
|
166
191
|
}
|
|
167
192
|
|
|
168
193
|
.prose pre {
|
|
@@ -214,7 +239,7 @@
|
|
|
214
239
|
|
|
215
240
|
.message-loader :where(#ask-netlify-eyelid-left, #ask-netlify-eyelid-right) {
|
|
216
241
|
transform-origin: top center;
|
|
217
|
-
transform: scaleY(1);
|
|
242
|
+
transform: scaleY(1.035);
|
|
218
243
|
animation: askEyeBlink 4s infinite;
|
|
219
244
|
animation-delay: 1s;
|
|
220
245
|
}
|
|
@@ -241,7 +266,7 @@
|
|
|
241
266
|
@keyframes askEyeBlink {
|
|
242
267
|
0%,
|
|
243
268
|
5% {
|
|
244
|
-
transform: scaleY(1);
|
|
269
|
+
transform: scaleY(1.035);
|
|
245
270
|
}
|
|
246
271
|
6%,
|
|
247
272
|
10% {
|
|
@@ -249,7 +274,7 @@
|
|
|
249
274
|
}
|
|
250
275
|
11%,
|
|
251
276
|
15% {
|
|
252
|
-
transform: scaleY(1);
|
|
277
|
+
transform: scaleY(1.035);
|
|
253
278
|
}
|
|
254
279
|
16%,
|
|
255
280
|
20% {
|
|
@@ -257,6 +282,6 @@
|
|
|
257
282
|
}
|
|
258
283
|
21%,
|
|
259
284
|
100% {
|
|
260
|
-
transform: scaleY(1);
|
|
285
|
+
transform: scaleY(1.035);
|
|
261
286
|
}
|
|
262
287
|
}
|
|
@@ -29,7 +29,9 @@ function ChatInterface({ setModalState }: AskNetlifyProps) {
|
|
|
29
29
|
const { conversation, submitQuery, isGeneratingAnswer, isPreparingAnswer, stopGeneration } =
|
|
30
30
|
useChat();
|
|
31
31
|
|
|
32
|
-
const chatRef = useRef(null);
|
|
32
|
+
const chatRef = useRef<HTMLDivElement>(null);
|
|
33
|
+
const indicatorRef = useRef<HTMLSpanElement>(null);
|
|
34
|
+
const menuRef = useRef<HTMLUListElement>(null);
|
|
33
35
|
|
|
34
36
|
const questions: Record<string, string> = {
|
|
35
37
|
'a69747ed-505b-4e98-8535-fd357c327516': 'How do I deploy an app to Netlify using AI?',
|
|
@@ -58,11 +60,6 @@ function ChatInterface({ setModalState }: AskNetlifyProps) {
|
|
|
58
60
|
}
|
|
59
61
|
};
|
|
60
62
|
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
const el = chatRef.current as HTMLElement | null;
|
|
63
|
-
if (el) el.scrollTop = el.scrollHeight;
|
|
64
|
-
}, [conversation]);
|
|
65
|
-
|
|
66
63
|
return (
|
|
67
64
|
<div className="chat-container">
|
|
68
65
|
<button
|
|
@@ -81,14 +78,27 @@ function ChatInterface({ setModalState }: AskNetlifyProps) {
|
|
|
81
78
|
</button>
|
|
82
79
|
<div ref={chatRef} className="conversation n-search-window">
|
|
83
80
|
{!conversation.length && (
|
|
84
|
-
<ul class="question-list" role="list">
|
|
81
|
+
<ul ref={menuRef} class="question-list" role="list">
|
|
85
82
|
{Object.entries(questions).map(([id, question]) => (
|
|
86
83
|
<li>
|
|
87
84
|
<button class="question" onClick={handleSubmit} data-id={id}>
|
|
88
85
|
{question}
|
|
86
|
+
<Icon name="caretRight" />
|
|
89
87
|
</button>
|
|
90
88
|
</li>
|
|
91
89
|
))}
|
|
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
|
+
/>
|
|
92
102
|
</ul>
|
|
93
103
|
)}
|
|
94
104
|
|
|
@@ -66,7 +66,7 @@ const AskNetlify: FunctionComponent = () => {
|
|
|
66
66
|
x="3"
|
|
67
67
|
y="7.3"
|
|
68
68
|
width="3"
|
|
69
|
-
height="2
|
|
69
|
+
height="2"
|
|
70
70
|
fill="var(--search-bg-color, currentColor)"
|
|
71
71
|
/>
|
|
72
72
|
<rect
|
|
@@ -74,7 +74,7 @@ const AskNetlify: FunctionComponent = () => {
|
|
|
74
74
|
x="9.7"
|
|
75
75
|
y="7.3"
|
|
76
76
|
width="3"
|
|
77
|
-
height="2
|
|
77
|
+
height="2"
|
|
78
78
|
fill="var(--search-bg-color, currentColor)"
|
|
79
79
|
/>
|
|
80
80
|
</>
|
|
@@ -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-weak, #757575);
|
|
5
5
|
|
|
6
6
|
font-size: var(--n-search-heading-size);
|
|
7
7
|
font-weight: var(--n-search-heading-weight);
|
|
@@ -31,6 +31,11 @@
|
|
|
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
|
+
}
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
.n-search-link-title {
|
|
@@ -6,8 +6,8 @@
|
|
|
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-
|
|
9
|
+
--n-search-color-text-secondary: var(--color-text-weak, currentColor);
|
|
10
|
+
--n-search-color-icon: var(--color-text-weak);
|
|
11
11
|
--n-search-color-bg: var(--search-bg-color);
|
|
12
12
|
--n-search-color-bg-2: var(--color-bg-3);
|
|
13
13
|
--n-search-color-border: var(--color-bg-3);
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
--n-search-text-highlight: var(--search-highlight-color);
|
|
17
17
|
--n-search-input-height: 50px;
|
|
18
18
|
--n-search-footer-height: 40px;
|
|
19
|
-
--n-search-container-height:
|
|
19
|
+
--n-search-container-height: min(50dvh, 26.5rem);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.n-search-modal {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
position: relative;
|
|
62
62
|
display: inline-flex;
|
|
63
63
|
box-sizing: border-box;
|
|
64
|
-
background:
|
|
64
|
+
background: transparent;
|
|
65
65
|
inline-size: 100%;
|
|
66
66
|
padding-block: 0.75rem;
|
|
67
67
|
padding-inline: var(--n-search-padding-inline);
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
--color-text-accent: var(--teal-000);
|
|
60
60
|
--color-text-weak: var(--neutral-500);
|
|
61
61
|
--color-text-weaker: var(--neutral-400);
|
|
62
|
-
--color-text-weakest: var(--neutral-300);
|
|
63
62
|
--color-warning-bg: var(--gold-100);
|
|
64
63
|
--color-warning-border: var(--gold-300);
|
|
65
64
|
--color-warning-text: var(--gold-800);
|
|
@@ -161,8 +160,10 @@
|
|
|
161
160
|
--search-back-btn-bg-color: var(--neutral-100);
|
|
162
161
|
--search-bg-color: var(--neutral-000);
|
|
163
162
|
--search-highlight-color: var(--teal-000);
|
|
164
|
-
--search-
|
|
165
|
-
--search-
|
|
163
|
+
--search-input-bg-color: var(--neutral-100);
|
|
164
|
+
--search-loading-color: var(--teal-700);
|
|
165
|
+
--search-submit-btn-bg-color: var(--teal-200);
|
|
166
|
+
--search-user-message-color: var(--teal-000);
|
|
166
167
|
--shadow-deep: 0 16px 24px 0 color(srgb 0 0 0 / 0.07), 0 6px 30px 0 color(srgb 0 0 0 / 0.06), 0 8px 10px 0 color(srgb 0 0 0 / 0.1);
|
|
167
168
|
--shadow-heavy: -10px 10px 80px 0 color(srgb 0 0 0 / 0.1);
|
|
168
169
|
--shadow-hover: 0 4px 12px 0 color(srgb 0 0 0 / 0.25);
|
|
@@ -239,7 +240,6 @@
|
|
|
239
240
|
--color-text-accent: var(--teal-600);
|
|
240
241
|
--color-text-weak: var(--neutral-300);
|
|
241
242
|
--color-text-weaker: var(--neutral-400);
|
|
242
|
-
--color-text-weakest: var(--neutral-300);
|
|
243
243
|
--color-warning-bg: var(--gold-200);
|
|
244
244
|
--color-warning-border: var(--gold-400);
|
|
245
245
|
--color-warning-text: var(--gold-900);
|
|
@@ -258,7 +258,9 @@
|
|
|
258
258
|
--search-back-btn-bg-color: var(--neutral-500);
|
|
259
259
|
--search-bg-color: var(--neutral-700);
|
|
260
260
|
--search-highlight-color: var(--teal-800);
|
|
261
|
+
--search-input-bg-color: var(--neutral-600);
|
|
261
262
|
--search-loading-color: var(--teal-200);
|
|
263
|
+
--search-submit-btn-bg-color: var(--teal-200);
|
|
262
264
|
--search-user-message-color: var(--teal-800);
|
|
263
265
|
--switcher-tab-bg-color: color(srgb 0.047058823529411764 0.16470588235294117 0.16470588235294117 / 0.2);
|
|
264
266
|
--title-text-color: color(srgb 0.8352941176470589 1 0.996078431372549 / 0.7490196078431373);
|
|
@@ -312,7 +314,6 @@
|
|
|
312
314
|
--color-text-accent: var(--teal-600);
|
|
313
315
|
--color-text-weak: var(--neutral-300);
|
|
314
316
|
--color-text-weaker: var(--neutral-400);
|
|
315
|
-
--color-text-weakest: var(--neutral-300);
|
|
316
317
|
--color-warning-bg: var(--gold-200);
|
|
317
318
|
--color-warning-border: var(--gold-400);
|
|
318
319
|
--color-warning-text: var(--gold-900);
|
|
@@ -331,7 +332,9 @@
|
|
|
331
332
|
--search-back-btn-bg-color: var(--neutral-500);
|
|
332
333
|
--search-bg-color: var(--neutral-700);
|
|
333
334
|
--search-highlight-color: var(--teal-800);
|
|
335
|
+
--search-input-bg-color: var(--neutral-600);
|
|
334
336
|
--search-loading-color: var(--teal-200);
|
|
337
|
+
--search-submit-btn-bg-color: var(--teal-200);
|
|
335
338
|
--search-user-message-color: var(--teal-800);
|
|
336
339
|
--switcher-tab-bg-color: color(srgb 0.047058823529411764 0.16470588235294117 0.16470588235294117 / 0.2);
|
|
337
340
|
--title-text-color: color(srgb 0.8352941176470589 1 0.996078431372549 / 0.7490196078431373);
|
|
@@ -384,7 +387,6 @@
|
|
|
384
387
|
--color-text-accent: var(--teal-000);
|
|
385
388
|
--color-text-weak: var(--neutral-500);
|
|
386
389
|
--color-text-weaker: var(--neutral-400);
|
|
387
|
-
--color-text-weakest: var(--neutral-300);
|
|
388
390
|
--color-warning-bg: var(--gold-100);
|
|
389
391
|
--color-warning-border: var(--gold-300);
|
|
390
392
|
--color-warning-text: var(--gold-800);
|
|
@@ -403,8 +405,10 @@
|
|
|
403
405
|
--search-back-btn-bg-color: var(--neutral-100);
|
|
404
406
|
--search-bg-color: var(--neutral-000);
|
|
405
407
|
--search-highlight-color: var(--teal-000);
|
|
406
|
-
--search-
|
|
407
|
-
--search-
|
|
408
|
+
--search-input-bg-color: var(--neutral-100);
|
|
409
|
+
--search-loading-color: var(--teal-700);
|
|
410
|
+
--search-submit-btn-bg-color: var(--teal-200);
|
|
411
|
+
--search-user-message-color: var(--teal-000);
|
|
408
412
|
--switcher-tab-bg-color: color(srgb 1 1 1 / 0.047058823529411764);
|
|
409
413
|
--title-text-color: color(srgb 0.32941176470588235 0.35294117647058826 0.3803921568627451 / 0.7490196078431373);
|
|
410
414
|
}
|