@@ -2,17 +2,16 @@ import * as RadixDialog from '@radix-ui/react-dialog';
22import { motion } from 'framer-motion' ;
33import { useState } from 'react' ;
44import { classNames } from '~/utils/classNames' ;
5- import { DialogTitle , dialogVariants , dialogBackdropVariants } from '. /Dialog' ;
6- import { IconButton } from '. /IconButton' ;
5+ import { DialogTitle , dialogVariants , dialogBackdropVariants } from '~/components/ui /Dialog' ;
6+ import { IconButton } from '~/components/ui /IconButton' ;
77import { providersList } from '~/lib/stores/settings' ;
88import { db , getAll , deleteById } from '~/lib/persistence' ;
99import { toast } from 'react-toastify' ;
1010import { useNavigate } from '@remix-run/react' ;
1111import commit from '~/commit.json' ;
1212import Cookies from 'js-cookie' ;
13- import { SettingsSlider } from './SettingsSlider' ;
14- import '~/styles/components/SettingsSlider.scss' ;
15- import '~/styles/components/Settings.scss' ;
13+ import styles from './Settings.module.scss' ;
14+ import { Switch } from '~/components/ui/Switch' ;
1615
1716interface SettingsProps {
1817 open : boolean ;
@@ -24,7 +23,7 @@ type TabType = 'chat-history' | 'providers' | 'features' | 'debug';
2423// Providers that support base URL configuration
2524const URL_CONFIGURABLE_PROVIDERS = [ 'Ollama' , 'LMStudio' , 'OpenAILike' ] ;
2625
27- export const Settings = ( { open, onClose } : SettingsProps ) => {
26+ export const SettingsWindow = ( { open, onClose } : SettingsProps ) => {
2827 const navigate = useNavigate ( ) ;
2928 const [ activeTab , setActiveTab ] = useState < TabType > ( 'chat-history' ) ;
3029 const [ isDebugEnabled , setIsDebugEnabled ] = useState ( false ) ;
@@ -93,10 +92,10 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
9392 return providersList ;
9493 } ) ;
9594
96- const handleToggleProvider = ( providerName : string ) => {
95+ const handleToggleProvider = ( providerName : string , enabled : boolean ) => {
9796 setProviders ( ( prevProviders ) => {
9897 const newProviders = prevProviders . map ( ( provider ) =>
99- provider . name === providerName ? { ...provider , isEnabled : ! provider . isEnabled } : provider ,
98+ provider . name === providerName ? { ...provider , isEnabled : enabled } : provider ,
10099 ) ;
101100
102101 // Save to cookies
@@ -196,9 +195,9 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
196195 return (
197196 < RadixDialog . Root open = { open } >
198197 < RadixDialog . Portal >
199- < RadixDialog . Overlay asChild >
198+ < RadixDialog . Overlay asChild onClick = { onClose } >
200199 < motion . div
201- className = "bg-black/50 fixed inset-0 z-max"
200+ className = "bg-black/50 fixed inset-0 z-max backdrop-blur-sm "
202201 initial = "closed"
203202 animate = "open"
204203 exit = "closed"
@@ -214,14 +213,20 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
214213 variants = { dialogVariants }
215214 >
216215 < div className = "flex h-full" >
217- < div className = "w-48 border-r border-bolt-elements-borderColor bg-white dark:bg-gray-900 p-4 flex flex-col justify-between settings-tabs" >
216+ < div
217+ className = { classNames (
218+ 'w-48 border-r border-bolt-elements-borderColor bg-bolt-elements-background-depth-1 p-4 flex flex-col justify-between' ,
219+ styles [ 'settings-tabs' ] ,
220+ ) }
221+ >
222+ < DialogTitle className = "flex-shrink-0 text-lg font-semibold text-bolt-elements-textPrimary mb-2" >
223+ Settings
224+ </ DialogTitle >
218225 { tabs . map ( ( tab ) => (
219226 < button
220227 key = { tab . id }
221228 onClick = { ( ) => setActiveTab ( tab . id ) }
222- className = { classNames (
223- activeTab === tab . id ? 'active' : ''
224- ) }
229+ className = { classNames ( activeTab === tab . id ? styles . active : '' ) }
225230 >
226231 < div className = { tab . icon } />
227232 { tab . label }
@@ -232,7 +237,7 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
232237 href = "https://github.com/coleam00/bolt.new-any-llm"
233238 target = "_blank"
234239 rel = "noopener noreferrer"
235- className = " settings-button flex items-center gap-2"
240+ className = { classNames ( styles [ ' settings-button' ] , ' flex items-center gap-2' ) }
236241 >
237242 < div className = "i-ph:github-logo" />
238243 GitHub
@@ -241,36 +246,49 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
241246 href = "https://coleam00.github.io/bolt.new-any-llm"
242247 target = "_blank"
243248 rel = "noopener noreferrer"
244- className = " settings-button flex items-center gap-2"
249+ className = { classNames ( styles [ ' settings-button' ] , ' flex items-center gap-2' ) }
245250 >
246251 < div className = "i-ph:book" />
247252 Docs
248253 </ a >
249254 </ div >
250255 </ div >
251256
252- < div className = "flex-1 flex flex-col p-8 bg-gray-50 dark:bg-gray-800" >
253- < DialogTitle className = "flex-shrink-0 text-lg font-semibold text-bolt-elements-textPrimary" > Settings</ DialogTitle >
257+ < div className = "flex-1 flex flex-col p-8 pt-10 bg-bolt-elements-background-depth-2" >
254258 < div className = "flex-1 overflow-y-auto" >
255259 { activeTab === 'chat-history' && (
256260 < div className = "p-4" >
257261 < h3 className = "text-lg font-medium text-bolt-elements-textPrimary mb-4" > Chat History</ h3 >
258262 < button
259263 onClick = { handleExportAllChats }
260- className = "bg-blue-500 text-white rounded-lg px-4 py-2 hover:bg-blue-600 mb-4 transition-colors duration-200"
264+ className = { classNames (
265+ 'bg-bolt-elements-button-primary-background' ,
266+ 'rounded-lg px-4 py-2 mb-4 transition-colors duration-200' ,
267+ 'hover:bg-bolt-elements-button-primary-backgroundHover' ,
268+ 'text-bolt-elements-button-primary-text' ,
269+ ) }
261270 >
262271 Export All Chats
263272 </ button >
264273
265- < div className = "text-bolt-elements-textPrimary rounded-lg p-4 mb-4 settings-danger-area" >
274+ < div
275+ className = { classNames (
276+ 'text-bolt-elements-textPrimary rounded-lg py-4 mb-4' ,
277+ styles [ 'settings-danger-area' ] ,
278+ ) }
279+ >
266280 < h4 className = "font-semibold" > Danger Area</ h4 >
267281 < p className = "mb-2" > This action cannot be undone!</ p >
268282 < button
269283 onClick = { handleDeleteAllChats }
270284 disabled = { isDeleting }
271285 className = { classNames (
272- 'bg-red-700 text-white rounded-lg px-4 py-2 transition-colors duration-200' ,
273- isDeleting ? 'opacity-50 cursor-not-allowed' : 'hover:bg-red-800' ,
286+ 'bg-bolt-elements-button-danger-background' ,
287+ 'rounded-lg px-4 py-2 transition-colors duration-200' ,
288+ isDeleting
289+ ? 'opacity-50 cursor-not-allowed'
290+ : 'hover:bg-bolt-elements-button-danger-backgroundHover' ,
291+ 'text-bolt-elements-button-danger-text' ,
274292 ) }
275293 >
276294 { isDeleting ? 'Deleting...' : 'Delete All Chats' }
@@ -280,39 +298,27 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
280298 ) }
281299 { activeTab === 'providers' && (
282300 < div className = "p-4" >
283- < div className = "flex items-center justify-between mb-4" >
284- < h3 className = "text-lg font-medium text-bolt-elements-textPrimary" > Providers</ h3 >
301+ < div className = "flex mb-4" >
285302 < input
286303 type = "text"
287304 placeholder = "Search providers..."
288305 value = { searchTerm }
289306 onChange = { ( e ) => setSearchTerm ( e . target . value ) }
290- className = "mb-4 p -2 rounded border border-gray-300 "
307+ className = "w-full bg-white dark:bg-bolt-elements-background-depth-4 relative px -2 py-1.5 rounded-md focus:outline-none placeholder-bolt-elements-textTertiary text-bolt-elements-textPrimary dark:text-bolt-elements-textPrimary border border-bolt-elements-borderColor "
291308 />
292309 </ div >
293310 { filteredProviders . map ( ( provider ) => (
294311 < div
295312 key = { provider . name }
296- className = "flex flex-col mb-6 provider-item hover:bg-bolt-elements-bg-depth-3 p-4 rounded-lg"
313+ className = "flex flex-col mb-2 provider-item hover:bg-bolt-elements-bg-depth-3 p-4 rounded-lg border border-bolt-elements-borderColor "
297314 >
298315 < div className = "flex items-center justify-between mb-2" >
299316 < span className = "text-bolt-elements-textPrimary" > { provider . name } </ span >
300- < label className = "relative inline-flex items-center cursor-pointer" >
301- < input
302- type = "checkbox"
303- className = "sr-only"
304- checked = { provider . isEnabled }
305- onChange = { ( ) => handleToggleProvider ( provider . name ) }
306- />
307- < div className = { classNames (
308- 'settings-toggle__track' ,
309- provider . isEnabled ? 'settings-toggle__track--enabled' : 'settings-toggle__track--disabled'
310- ) } > </ div >
311- < div className = { classNames (
312- 'settings-toggle__thumb' ,
313- provider . isEnabled ? 'settings-toggle__thumb--enabled' : ''
314- ) } > </ div >
315- </ label >
317+ < Switch
318+ className = "ml-auto"
319+ checked = { provider . isEnabled }
320+ onCheckedChange = { ( enabled ) => handleToggleProvider ( provider . name , enabled ) }
321+ />
316322 </ div >
317323 { /* Base URL input for configurable providers */ }
318324 { URL_CONFIGURABLE_PROVIDERS . includes ( provider . name ) && provider . isEnabled && (
@@ -323,7 +329,7 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
323329 value = { baseUrls [ provider . name ] }
324330 onChange = { ( e ) => handleBaseUrlChange ( provider . name , e . target . value ) }
325331 placeholder = { `Enter ${ provider . name } base URL` }
326- className = "w-full p-2 rounded border border -bolt-elements-borderColor bg -bolt-elements-bg-depth-2 text-bolt-elements-textPrimary text-sm "
332+ className = "w-full bg-white dark:bg-bolt-elements-background-depth-4 relative px-2 py-1.5 rounded-md focus:outline-none placeholder -bolt-elements-textTertiary text -bolt-elements-textPrimary dark: text-bolt-elements-textPrimary border border-bolt-elements-borderColor "
327333 />
328334 </ div >
329335 ) }
@@ -343,14 +349,18 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
343349 checked = { isDebugEnabled }
344350 onChange = { ( ) => setIsDebugEnabled ( ! isDebugEnabled ) }
345351 />
346- < div className = { classNames (
347- 'settings-toggle__track' ,
348- isDebugEnabled ? 'settings-toggle__track--enabled' : 'settings-toggle__track--disabled'
349- ) } > </ div >
350- < div className = { classNames (
351- 'settings-toggle__thumb' ,
352- isDebugEnabled ? 'settings-toggle__thumb--enabled' : ''
353- ) } > </ div >
352+ < div
353+ className = { classNames (
354+ 'settings-toggle__track' ,
355+ isDebugEnabled ? 'settings-toggle__track--enabled' : 'settings-toggle__track--disabled' ,
356+ ) }
357+ > </ div >
358+ < div
359+ className = { classNames (
360+ 'settings-toggle__thumb' ,
361+ isDebugEnabled ? 'settings-toggle__thumb--enabled' : '' ,
362+ ) }
363+ > </ div >
354364 </ label >
355365 </ div >
356366 </ div >
@@ -367,14 +377,18 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
367377 checked = { isJustSayEnabled }
368378 onChange = { ( ) => setIsJustSayEnabled ( ! isJustSayEnabled ) }
369379 />
370- < div className = { classNames (
371- 'settings-toggle__track' ,
372- isJustSayEnabled ? 'settings-toggle__track--enabled' : 'settings-toggle__track--disabled'
373- ) } > </ div >
374- < div className = { classNames (
375- 'settings-toggle__thumb' ,
376- isJustSayEnabled ? 'settings-toggle__thumb--enabled' : ''
377- ) } > </ div >
380+ < div
381+ className = { classNames (
382+ 'settings-toggle__track' ,
383+ isJustSayEnabled ? 'settings-toggle__track--enabled' : 'settings-toggle__track--disabled' ,
384+ ) }
385+ > </ div >
386+ < div
387+ className = { classNames (
388+ 'settings-toggle__thumb' ,
389+ isJustSayEnabled ? 'settings-toggle__thumb--enabled' : '' ,
390+ ) }
391+ > </ div >
378392 </ label >
379393 </ div >
380394 </ div >
@@ -408,7 +422,9 @@ export const Settings = ({ open, onClose }: SettingsProps) => {
408422 < ul >
409423 < li className = "text-bolt-elements-textSecondary" > Ollama: { process . env . REACT_APP_OLLAMA_URL } </ li >
410424 < li className = "text-bolt-elements-textSecondary" > OpenAI: { process . env . REACT_APP_OPENAI_URL } </ li >
411- < li className = "text-bolt-elements-textSecondary" > LM Studio: { process . env . REACT_APP_LM_STUDIO_URL } </ li >
425+ < li className = "text-bolt-elements-textSecondary" >
426+ LM Studio: { process . env . REACT_APP_LM_STUDIO_URL }
427+ </ li >
412428 </ ul >
413429
414430 < h4 className = "text-md font-medium text-bolt-elements-textPrimary mt-4" > Version Information</ h4 >
0 commit comments