updated styling wordings and animations icons
Browse files- app/commit.json +1 -1
- app/components/chat/BaseChat.tsx +1 -1
- app/components/chat/ChatAlert.tsx +74 -54
- app/types/actions.ts +1 -1
app/commit.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{ "commit": "
|
|
|
1 |
+
{ "commit": "3d8abee511aca2db3d3040a88f3ed46069d9b037" }
|
app/components/chat/BaseChat.tsx
CHANGED
@@ -319,7 +319,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
|
|
319 |
}}
|
320 |
</ClientOnly>
|
321 |
<div
|
322 |
-
className={classNames('flex flex-col gap-4
|
323 |
'sticky bottom-2': chatStarted,
|
324 |
})}
|
325 |
>
|
|
|
319 |
}}
|
320 |
</ClientOnly>
|
321 |
<div
|
322 |
+
className={classNames('flex flex-col gap-4 w-full max-w-chat mx-auto z-prompt mb-6', {
|
323 |
'sticky bottom-2': chatStarted,
|
324 |
})}
|
325 |
>
|
app/components/chat/ChatAlert.tsx
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import type { ActionAlert } from '~/types/actions';
|
2 |
import { classNames } from '~/utils/classNames';
|
3 |
|
@@ -8,74 +9,93 @@ interface Props {
|
|
8 |
}
|
9 |
|
10 |
export default function ChatAlert({ alert, clearAlert, postMessage }: Props) {
|
11 |
-
const {
|
12 |
-
|
13 |
-
const iconColor =
|
14 |
-
type === 'error' ? 'text-bolt-elements-button-danger-text' : 'text-bolt-elements-button-primary-text';
|
15 |
|
16 |
return (
|
17 |
-
<
|
18 |
-
<div
|
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 |
<button
|
51 |
-
onClick={() => postMessage(`*Fix this error on terminal* \n
|
52 |
className={classNames(
|
53 |
`px-2 py-1.5 rounded-md text-sm font-medium`,
|
54 |
'bg-bolt-elements-button-primary-background',
|
55 |
'hover:bg-bolt-elements-button-primary-backgroundHover',
|
56 |
'focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-bolt-elements-button-danger-background',
|
57 |
'text-bolt-elements-button-primary-text',
|
|
|
58 |
)}
|
59 |
>
|
60 |
-
|
|
|
61 |
</button>
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
</
|
75 |
-
</div>
|
76 |
</div>
|
77 |
</div>
|
78 |
-
</div>
|
79 |
-
</
|
80 |
);
|
81 |
}
|
|
|
1 |
+
import { AnimatePresence, motion } from 'framer-motion';
|
2 |
import type { ActionAlert } from '~/types/actions';
|
3 |
import { classNames } from '~/utils/classNames';
|
4 |
|
|
|
9 |
}
|
10 |
|
11 |
export default function ChatAlert({ alert, clearAlert, postMessage }: Props) {
|
12 |
+
const { title, description, content } = alert;
|
|
|
|
|
|
|
13 |
|
14 |
return (
|
15 |
+
<AnimatePresence>
|
16 |
+
<motion.div
|
17 |
+
initial={{ opacity: 0, y: -20 }}
|
18 |
+
animate={{ opacity: 1, y: 0 }}
|
19 |
+
exit={{ opacity: 0, y: -20 }}
|
20 |
+
transition={{ duration: 0.3 }}
|
21 |
+
className={`rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-background-depth-2 p-4`}
|
22 |
+
>
|
23 |
+
<div className="flex items-start">
|
24 |
+
{/* Icon */}
|
25 |
+
<motion.div
|
26 |
+
className="flex-shrink-0"
|
27 |
+
initial={{ scale: 0 }}
|
28 |
+
animate={{ scale: 1 }}
|
29 |
+
transition={{ delay: 0.2 }}
|
30 |
+
>
|
31 |
+
<div className={`i-ph:warning-duotone text-xl text-bolt-elements-button-danger-text`}></div>
|
32 |
+
</motion.div>
|
33 |
+
{/* Content */}
|
34 |
+
<div className="ml-3 flex-1">
|
35 |
+
<motion.h3
|
36 |
+
initial={{ opacity: 0 }}
|
37 |
+
animate={{ opacity: 1 }}
|
38 |
+
transition={{ delay: 0.1 }}
|
39 |
+
className={`text-sm font-medium text-bolt-elements-textPrimary`}
|
40 |
+
>
|
41 |
+
{title}
|
42 |
+
</motion.h3>
|
43 |
+
<motion.div
|
44 |
+
initial={{ opacity: 0 }}
|
45 |
+
animate={{ opacity: 1 }}
|
46 |
+
transition={{ delay: 0.2 }}
|
47 |
+
className={`mt-2 text-sm text-bolt-elements-textSecondary`}
|
48 |
+
>
|
49 |
+
<p>
|
50 |
+
We encountered an error while running terminal commands. Would you like Bolt to analyze and help resolve
|
51 |
+
this issue?
|
52 |
+
</p>
|
53 |
+
{description && (
|
54 |
+
<div className="text-xs text-bolt-elements-textSecondary p-2 bg-bolt-elements-background-depth-3 rounded mt-4 mb-4">
|
55 |
+
Error: {description}
|
56 |
+
</div>
|
57 |
+
)}
|
58 |
+
</motion.div>
|
59 |
|
60 |
+
{/* Actions */}
|
61 |
+
<motion.div
|
62 |
+
className="mt-4"
|
63 |
+
initial={{ opacity: 0, y: 10 }}
|
64 |
+
animate={{ opacity: 1, y: 0 }}
|
65 |
+
transition={{ delay: 0.3 }}
|
66 |
+
>
|
67 |
+
<div className={classNames(' flex gap-2')}>
|
68 |
<button
|
69 |
+
onClick={() => postMessage(`*Fix this error on terminal* \n\`\`\`sh\n${content}\n\`\`\`\n`)}
|
70 |
className={classNames(
|
71 |
`px-2 py-1.5 rounded-md text-sm font-medium`,
|
72 |
'bg-bolt-elements-button-primary-background',
|
73 |
'hover:bg-bolt-elements-button-primary-backgroundHover',
|
74 |
'focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-bolt-elements-button-danger-background',
|
75 |
'text-bolt-elements-button-primary-text',
|
76 |
+
'flex items-center gap-1.5',
|
77 |
)}
|
78 |
>
|
79 |
+
<div className="i-ph:chat-circle-duotone"></div>
|
80 |
+
Ask Bolt
|
81 |
</button>
|
82 |
+
<button
|
83 |
+
onClick={clearAlert}
|
84 |
+
className={classNames(
|
85 |
+
`px-2 py-1.5 rounded-md text-sm font-medium`,
|
86 |
+
'bg-bolt-elements-button-secondary-background',
|
87 |
+
'hover:bg-bolt-elements-button-secondary-backgroundHover',
|
88 |
+
'focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-bolt-elements-button-secondary-background',
|
89 |
+
'text-bolt-elements-button-secondary-text',
|
90 |
+
)}
|
91 |
+
>
|
92 |
+
Dismiss
|
93 |
+
</button>
|
94 |
+
</div>
|
95 |
+
</motion.div>
|
96 |
</div>
|
97 |
</div>
|
98 |
+
</motion.div>
|
99 |
+
</AnimatePresence>
|
100 |
);
|
101 |
}
|
app/types/actions.ts
CHANGED
@@ -22,7 +22,7 @@ export type BoltAction = FileAction | ShellAction | StartAction;
|
|
22 |
export type BoltActionData = BoltAction | BaseAction;
|
23 |
|
24 |
export interface ActionAlert {
|
25 |
-
type:
|
26 |
title: string;
|
27 |
description: string;
|
28 |
content: string;
|
|
|
22 |
export type BoltActionData = BoltAction | BaseAction;
|
23 |
|
24 |
export interface ActionAlert {
|
25 |
+
type: string;
|
26 |
title: string;
|
27 |
description: string;
|
28 |
content: string;
|