Skip to content

Commit 62acc9c

Browse files
fix(interfaces): always-light public surfaces (chat, resume, file shares, unsubscribe, invite) with emcn components (#5336)
* fix(interfaces): pin deployed chat + resume to light mode, emcn-only components * fix(interfaces): review feedback — formErrors dep in field renderer, keep overlay tint on attachment remove * improvement(interfaces): chat header uses the platform SimWordmark instead of the svg asset * fix(interfaces): light mode for file-share gates, unsubscribe, and invite surfaces
1 parent 4421512 commit 62acc9c

26 files changed

Lines changed: 550 additions & 947 deletions

File tree

apps/sim/app/(auth)/components/auth-background-svg.tsx

Lines changed: 0 additions & 93 deletions
This file was deleted.

apps/sim/app/(auth)/components/auth-background.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/** Shared className for primary auth/status CTA buttons on dark auth surfaces. */
2-
export const AUTH_PRIMARY_CTA_BASE =
3-
'inline-flex h-[32px] items-center justify-center gap-2 rounded-[5px] border border-[var(--auth-primary-btn-border)] bg-[var(--auth-primary-btn-bg)] px-2.5 font-[430] font-season text-[var(--auth-primary-btn-text)] text-sm transition-colors hover:border-[var(--auth-primary-btn-hover-border)] hover:bg-[var(--auth-primary-btn-hover-bg)] hover:text-[var(--auth-primary-btn-hover-text)] disabled:cursor-not-allowed disabled:opacity-50' as const
4-
5-
/** Full-width variant used for primary auth form submit buttons. */
6-
export const AUTH_SUBMIT_BTN = `${AUTH_PRIMARY_CTA_BASE} w-full` as const
7-
8-
/** Shared className for inline auth action links on dark auth surfaces. */
1+
/** Shared className for inline auth action links. */
92
export const AUTH_TEXT_LINK =
103
'font-medium text-[var(--brand-accent)] underline-offset-4 transition hover:text-[var(--brand-accent-hover)] hover:underline disabled:cursor-not-allowed disabled:opacity-50' as const

apps/sim/app/(auth)/components/auth-submit-button.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ interface AuthSubmitButtonProps {
1414

1515
/**
1616
* The canonical full-width primary auth action — a `primary`-variant {@link Chip}
17-
* with the shared in-flight spinner. Replaces the legacy dark
18-
* `AUTH_SUBMIT_BTN` class string for every in-scope auth submit (login, signup,
19-
* verify, reset), so the primary CTA chrome lives in exactly one place.
17+
* with the shared in-flight spinner, so the primary CTA chrome lives in
18+
* exactly one place.
2019
*/
2120
export function AuthSubmitButton({
2221
children,

apps/sim/app/(interfaces)/chat/[identifier]/chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ export default function ChatClient({ identifier }: { identifier: string }) {
426426
}
427427

428428
return (
429-
<div className='dark fixed inset-0 z-[100] flex flex-col bg-[var(--landing-bg)] text-[var(--landing-text)]'>
429+
<div className='light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
430430
{/* Header component */}
431431
<ChatHeader chatConfig={chatConfig} starCount={starCount} />
432432

apps/sim/app/(interfaces)/chat/[identifier]/loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Skeleton } from '@sim/emcn'
22

33
export default function ChatLoading() {
44
return (
5-
<div className='dark fixed inset-0 z-[100] flex flex-col bg-[var(--landing-bg)] text-[var(--landing-text)]'>
5+
<div className='light fixed inset-0 z-[100] flex flex-col bg-[var(--bg)] text-[var(--text-primary)]'>
66
<div className='border-[var(--border-1)] border-b px-4 py-3'>
77
<div className='mx-auto flex max-w-3xl items-center justify-between'>
88
<div className='flex items-center gap-[12px]'>

apps/sim/app/(interfaces)/chat/components/error-state/error-state.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client'
22

3+
import { Button } from '@sim/emcn'
34
import { useRouter } from 'next/navigation'
45

56
interface ChatErrorStateProps {
@@ -16,12 +17,13 @@ export function ChatErrorState({ error }: ChatErrorStateProps) {
1617
Chat Unavailable
1718
</h1>
1819
<p className='text-[var(--text-muted)] text-lg'>{error}</p>
19-
<button
20+
<Button
21+
variant='primary'
2022
onClick={() => router.push('/workspace')}
21-
className='inline-flex h-[32px] w-full items-center justify-center gap-2 rounded-[5px] border border-[var(--text-primary)] bg-[var(--text-primary)] px-2.5 text-[var(--bg)] text-sm transition-colors hover:border-[var(--text-body)] hover:bg-[var(--text-body)] disabled:cursor-not-allowed disabled:opacity-50'
23+
className='h-[32px] w-full gap-2 px-2.5 text-sm'
2224
>
2325
Return to Workspace
24-
</button>
26+
</Button>
2527
</div>
2628
</div>
2729
)

apps/sim/app/(interfaces)/chat/components/header/header.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import Image from 'next/image'
44
import Link from 'next/link'
55
import { GithubIcon } from '@/components/icons'
6+
import { SimWordmark } from '@/app/(landing)/components/navbar/components'
67
import { useBrandConfig } from '@/ee/whitelabeling'
78

89
interface ChatHeaderProps {
@@ -20,13 +21,12 @@ interface ChatHeaderProps {
2021

2122
export function ChatHeader({ chatConfig, starCount }: ChatHeaderProps) {
2223
const brand = useBrandConfig()
23-
const primaryColor = chatConfig?.customizations?.primaryColor || 'var(--brand)'
2424
const customImage = chatConfig?.customizations?.imageUrl || chatConfig?.customizations?.logoUrl
2525

2626
return (
2727
<nav
2828
aria-label='Chat navigation'
29-
className={`flex w-full items-center justify-between px-4 pt-3 pb-[21px] sm:px-8 sm:pt-[8.5px] md:px-[44px] md:pt-4`}
29+
className='flex w-full items-center justify-between px-4 pt-3 pb-[21px] sm:px-8 sm:pt-[8.5px] md:px-[44px] md:pt-4'
3030
>
3131
<div className='flex items-center gap-[34px]'>
3232
<div className='flex items-center gap-3'>
@@ -40,7 +40,7 @@ export function ChatHeader({ chatConfig, starCount }: ChatHeaderProps) {
4040
className='size-6 rounded-md object-cover'
4141
/>
4242
)}
43-
<h2 className='font-medium text-[var(--landing-text)] text-lg'>
43+
<h2 className='font-medium text-[var(--text-primary)] text-lg'>
4444
{chatConfig?.customizations?.headerText || chatConfig?.title || 'Chat'}
4545
</h2>
4646
</div>
@@ -52,7 +52,7 @@ export function ChatHeader({ chatConfig, starCount }: ChatHeaderProps) {
5252
href='https://github.com/simstudioai/sim'
5353
target='_blank'
5454
rel='noopener noreferrer'
55-
className='flex items-center gap-2 text-[var(--landing-text-muted)] text-md transition-colors hover:text-[var(--landing-text)]'
55+
className='flex items-center gap-2 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]'
5656
aria-label={`GitHub repository - ${starCount} stars`}
5757
>
5858
<GithubIcon className='size-[16px]' aria-hidden='true' />
@@ -65,15 +65,9 @@ export function ChatHeader({ chatConfig, starCount }: ChatHeaderProps) {
6565
target='_blank'
6666
rel='noopener noreferrer'
6767
aria-label='Sim home'
68+
className='flex items-center'
6869
>
69-
<Image
70-
src='/logo/sim-landing.svg'
71-
alt='Sim'
72-
width={71}
73-
height={22}
74-
className='h-[22px] w-auto'
75-
priority
76-
/>
70+
<SimWordmark />
7771
</Link>
7872
</div>
7973
)}

apps/sim/app/(interfaces)/chat/components/input/input.tsx

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type React from 'react'
44
import { useCallback, useLayoutEffect, useRef, useState } from 'react'
5-
import { Badge, cn, handleKeyboardActivation, Tooltip } from '@sim/emcn'
5+
import { Badge, Button, cn, handleKeyboardActivation, Tooltip } from '@sim/emcn'
66
import { createLogger } from '@sim/logger'
77
import { generateId } from '@sim/utils/id'
88
import { ArrowUp, Mic, Paperclip, X } from 'lucide-react'
@@ -168,7 +168,7 @@ export const ChatInput: React.FC<{
168168

169169
return (
170170
<Tooltip.Provider>
171-
<div className='fixed right-0 bottom-0 left-0 flex w-full items-center justify-center bg-gradient-to-t from-[var(--landing-bg)] to-transparent px-4 pb-4 md:px-0 md:pb-4'>
171+
<div className='fixed right-0 bottom-0 left-0 flex w-full items-center justify-center bg-gradient-to-t from-[var(--bg)] to-transparent px-4 pb-4 md:px-0 md:pb-4'>
172172
<div className='w-full max-w-3xl md:max-w-[748px]'>
173173
{/* Error Messages */}
174174
{uploadErrors.length > 0 && (
@@ -191,7 +191,7 @@ export const ChatInput: React.FC<{
191191
handleKeyboardActivation(event, focusTextarea)
192192
}}
193193
className={cn(
194-
'relative z-10 cursor-text rounded-2xl border border-[var(--border-1)] bg-[var(--landing-bg-elevated)] px-2.5 py-2',
194+
'relative z-10 cursor-text rounded-2xl border border-[var(--border-1)] bg-[var(--surface-2)] px-2.5 py-2',
195195
isDragOver && 'border-purple-500'
196196
)}
197197
onDragEnter={(e) => {
@@ -222,31 +222,31 @@ export const ChatInput: React.FC<{
222222
{attachedFiles.map((file) => (
223223
<Tooltip.Root key={file.id}>
224224
<Tooltip.Trigger asChild>
225-
<div className='group relative size-[56px] flex-shrink-0 cursor-pointer overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-[var(--landing-bg)]'>
225+
<div className='group relative size-[56px] flex-shrink-0 cursor-pointer overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-[var(--surface-3)]'>
226226
{file.dataUrl ? (
227227
<img
228228
src={file.dataUrl}
229229
alt={file.name}
230230
className='h-full w-full object-cover'
231231
/>
232232
) : (
233-
<div className='flex h-full w-full flex-col items-center justify-center gap-0.5 text-[var(--landing-text-muted)]'>
233+
<div className='flex h-full w-full flex-col items-center justify-center gap-0.5 text-[var(--text-muted)]'>
234234
<Paperclip className='size-[18px]' />
235235
<span className='max-w-[48px] truncate px-[2px] text-[9px]'>
236236
{file.name.split('.').pop()}
237237
</span>
238238
</div>
239239
)}
240-
<button
241-
type='button'
240+
<Button
241+
variant='ghost'
242242
onClick={(e) => {
243243
e.stopPropagation()
244244
handleRemoveFile(file.id)
245245
}}
246-
className='absolute top-[2px] right-[2px] flex size-[16px] items-center justify-center rounded-full bg-black/60 opacity-0 group-hover:opacity-100'
246+
className='absolute top-[2px] right-[2px] size-[16px] rounded-full bg-black/60 p-0 text-white opacity-0 hover-hover:text-white group-hover:opacity-100'
247247
>
248-
<X className='size-[10px] text-white' />
249-
</button>
248+
<X className='size-[10px]' />
249+
</Button>
250250
</div>
251251
</Tooltip.Trigger>
252252
<Tooltip.Content side='top'>
@@ -265,7 +265,7 @@ export const ChatInput: React.FC<{
265265
onKeyDown={handleKeyDown}
266266
placeholder={isDragOver ? 'Drop files here...' : 'Enter a message...'}
267267
rows={1}
268-
className='m-0 h-auto min-h-[24px] w-full resize-none overflow-y-auto overflow-x-hidden border-0 bg-transparent p-1 text-[15px] text-[var(--landing-text)] leading-[24px] caret-[var(--landing-text)] outline-none [-ms-overflow-style:none] [scrollbar-width:none] placeholder:text-[var(--landing-text-muted)] focus-visible:ring-0 focus-visible:ring-offset-0 [&::-webkit-scrollbar]:hidden'
268+
className='m-0 h-auto min-h-[24px] w-full resize-none overflow-y-auto overflow-x-hidden border-0 bg-transparent p-1 text-[15px] text-[var(--text-primary)] leading-[24px] caret-[var(--text-primary)] outline-none [-ms-overflow-style:none] [scrollbar-width:none] placeholder:text-[var(--text-muted)] focus-visible:ring-0 focus-visible:ring-offset-0 [&::-webkit-scrollbar]:hidden'
269269
/>
270270

271271
{/* Bottom row */}
@@ -274,14 +274,14 @@ export const ChatInput: React.FC<{
274274
<div>
275275
<Tooltip.Root>
276276
<Tooltip.Trigger asChild>
277-
<button
278-
type='button'
277+
<Button
278+
variant='quiet'
279279
onClick={() => fileInputRef.current?.click()}
280280
disabled={isStreaming || attachedFiles.length >= 15}
281-
className='flex size-[28px] items-center justify-center rounded-full text-[var(--landing-text-muted)] transition-colors hover:bg-[#F7F7F7] disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-[#303030]'
281+
className='size-[28px] rounded-full p-0'
282282
>
283283
<Paperclip className='size-[16px]' strokeWidth={2} />
284-
</button>
284+
</Button>
285285
</Tooltip.Trigger>
286286
<Tooltip.Content side='top'>
287287
<p>Attach files</p>
@@ -307,14 +307,14 @@ export const ChatInput: React.FC<{
307307
{sttAvailable && (
308308
<Tooltip.Root>
309309
<Tooltip.Trigger asChild>
310-
<button
311-
type='button'
310+
<Button
311+
variant='quiet'
312312
onClick={onVoiceStart}
313313
disabled={isStreaming}
314-
className='flex size-[28px] items-center justify-center rounded-full text-[var(--landing-text-muted)] transition-colors hover:bg-[#F7F7F7] disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-[#303030]'
314+
className='size-[28px] rounded-full p-0'
315315
>
316316
<Mic className='size-[16px]' strokeWidth={2} />
317-
</button>
317+
</Button>
318318
</Tooltip.Trigger>
319319
<Tooltip.Content side='top'>
320320
<p>Start voice conversation</p>
@@ -323,37 +323,29 @@ export const ChatInput: React.FC<{
323323
)}
324324

325325
{isStreaming ? (
326-
<button
327-
type='button'
326+
<Button
327+
variant='primary'
328328
onClick={onStopStreaming}
329-
className='flex size-[28px] items-center justify-center rounded-full border-0 bg-[#383838] p-0 transition-colors hover:bg-[#575757] dark:bg-[#E0E0E0] dark:hover:bg-[#CFCFCF]'
329+
className='size-[28px] rounded-full p-0'
330330
title='Stop generation'
331331
>
332332
<svg
333-
className='block size-[14px] fill-white dark:fill-black'
333+
className='block size-[14px] fill-current'
334334
viewBox='0 0 24 24'
335335
xmlns='http://www.w3.org/2000/svg'
336336
>
337337
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
338338
</svg>
339-
</button>
339+
</Button>
340340
) : (
341-
<button
342-
type='button'
341+
<Button
342+
variant='primary'
343343
onClick={handleSubmit}
344344
disabled={!canSubmit}
345-
className={cn(
346-
'flex h-[28px] w-[28px] items-center justify-center rounded-full border-0 p-0 transition-colors',
347-
canSubmit
348-
? 'bg-[#383838] hover:bg-[#575757] dark:bg-[#E0E0E0] dark:hover:bg-[#CFCFCF]'
349-
: 'bg-[#808080] dark:bg-[#808080]'
350-
)}
345+
className='size-[28px] rounded-full p-0'
351346
>
352-
<ArrowUp
353-
className='block size-[16px] text-white dark:text-black'
354-
strokeWidth={2.25}
355-
/>
356-
</button>
347+
<ArrowUp className='block size-[16px]' strokeWidth={2.25} />
348+
</Button>
357349
)}
358350
</div>
359351
</div>

0 commit comments

Comments
 (0)