codacus commited on
Commit
b25b8b9
·
1 Parent(s): 3d8abee

updated styling wordings and animations icons

Browse files
app/commit.json CHANGED
@@ -1 +1 @@
1
- { "commit": "fd193ee7d75080ac62d51cd6b1ebbf30942eac89" }
 
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 chatWithContainer z-prompt mb-6', {
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 { type, title, description, content } = alert;
12
-
13
- const iconColor =
14
- type === 'error' ? 'text-bolt-elements-button-danger-text' : 'text-bolt-elements-button-primary-text';
15
 
16
  return (
17
- <div className={`rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-background-depth-2 p-4`}>
18
- <div className="flex items-start">
19
- {/* Icon */}
20
- <div className="flex-shrink-0">
21
- {type === 'error' ? (
22
- <div className={`i-ph:x text-xl ${iconColor}`}></div>
23
- ) : (
24
- <svg className={`h-5 w-5 ${iconColor}`} viewBox="0 0 20 20" fill="currentColor">
25
- <path
26
- fillRule="evenodd"
27
- d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"
28
- clipRule="evenodd"
29
- />
30
- </svg>
31
- )}
32
- </div>
33
-
34
- {/* Content */}
35
- <div className="ml-3 flex-1">
36
- <h3 className={`text-sm font-medium text-bolt-elements-textPrimary`}>{title}</h3>
37
- <div className={`mt-2 text-sm text-bolt-elements-textSecondary`}>
38
- <p>{description}</p>
39
- {/* {content && (
40
- <pre className="mt-2 whitespace-pre-wrap font-mono text-xs bg-white bg-opacity-50 p-2 rounded">
41
- {content}
42
- </pre>
43
- )} */}
44
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
- {/* Actions */}
47
- <div className="mt-4">
48
- <div className={classNames(' flex gap-2')}>
49
- {type === 'error' && (
 
 
 
 
50
  <button
51
- onClick={() => postMessage(`*Fix this error on terminal* \n\`\`\`\n${content}\n\`\`\`\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
- Fix Issue
 
61
  </button>
62
- )}
63
- <button
64
- onClick={clearAlert}
65
- className={classNames(
66
- `px-2 py-1.5 rounded-md text-sm font-medium`,
67
- 'bg-bolt-elements-button-secondary-background',
68
- 'hover:bg-bolt-elements-button-secondary-backgroundHover',
69
- 'focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-bolt-elements-button-secondary-background',
70
- 'text-bolt-elements-button-secondary-text',
71
- )}
72
- >
73
- Dismiss
74
- </button>
75
- </div>
76
  </div>
77
  </div>
78
- </div>
79
- </div>
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: 'error' | 'info';
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;