Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
llm/** filter=lfs diff=lfs merge=lfs -text
*.md text eol=lf
78 changes: 39 additions & 39 deletions web/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,37 @@ Use **semantic CSS variables** in components (Tailwind: `bg-background`, `text-t

### Brand and interactive

| Role | Variable | Light default | Usage |
|------|-----------|---------------|--------|
| Accent | `--color-accent` | `#2b70c9` | Links, primary buttons, focus rings, key highlights |
| Accent hover / active | `--color-accent-hover`, `--color-accent-active` | `#205497`, `#163865` | Pressed / hover states |
| Primary (brand weight) | `--color-primary` | `#29457a` | Strong brand moments (varies by screen) |
| Text link | `--color-text-link` | `#2b70c9` | Inline links |
| Role | Variable | Light default | Usage |
| ---------------------- | ----------------------------------------------- | -------------------- | --------------------------------------------------- |
| Accent | `--color-accent` | `#2b70c9` | Links, primary buttons, focus rings, key highlights |
| Accent hover / active | `--color-accent-hover`, `--color-accent-active` | `#205497`, `#163865` | Pressed / hover states |
| Primary (brand weight) | `--color-primary` | `#29457a` | Strong brand moments (varies by screen) |
| Text link | `--color-text-link` | `#2b70c9` | Inline links |

### Surfaces

| Role | Variable | Light default |
|------|-----------|---------------|
| Page background | `--color-background` | `#fff` |
| Soft panels | `--color-surface` | `#f8f9ff` |
| Raised / cards / sidebar | `--color-surface-raised`, `--color-surface-sidebar` | `#ecedf6` |
| Note cards | `--color-note-card` | `#ecedf6` |
| Role | Variable | Light default |
| ------------------------ | --------------------------------------------------- | ------------- |
| Page background | `--color-background` | `#fff` |
| Soft panels | `--color-surface` | `#f8f9ff` |
| Raised / cards / sidebar | `--color-surface-raised`, `--color-surface-sidebar` | `#ecedf6` |
| Note cards | `--color-note-card` | `#ecedf6` |

### Text

| Role | Variable | Light default |
|------|-----------|---------------|
| Primary | `--color-text` | `#24242d` |
| Role | Variable | Light default |
| --------- | -------------------------------------------- | --------------------- |
| Primary | `--color-text` | `#24242d` |
| Secondary | `--color-text-weak` … `--color-text-weakest` | `#383850` β†’ `#a4a4b2` |
| Muted UI | `--color-text-idle` | `#57585e` |
| Muted UI | `--color-text-idle` | `#57585e` |

### Borders and icons

| Role | Variable | Light default |
|------|-----------|---------------|
| Default border | `--color-border` | `#d9dbeb` |
| Strong border | `--color-border-strong` | `#c8c8d4` |
| Icons | `--color-icon` | `#5f5f77` |
| Role | Variable | Light default |
| -------------- | ----------------------- | ------------- |
| Default border | `--color-border` | `#d9dbeb` |
| Strong border | `--color-border-strong` | `#c8c8d4` |
| Icons | `--color-icon` | `#5f5f77` |

### Status (use full scale: base + weak/weaker + hover/active)

Expand All @@ -76,27 +76,27 @@ Some flows (e.g. profile appearance) allow a **user accent** such as `#2B70C9`,

### Font families

| Role | Variable / stack | Usage |
|------|------------------|--------|
| Display | `--font-display`: **Saira**, `sans-serif` | Headings (`text-h1` … `text-h6`), button text utilities |
| Body / UI | `--font-body`: **Inter**, `sans-serif` | Body copy, labels, dense UI |
| Role | Variable / stack | Usage |
| --------- | ----------------------------------------- | ------------------------------------------------------- |
| Display | `--font-display`: **Saira**, `sans-serif` | Headings (`text-h1` … `text-h6`), button text utilities |
| Body / UI | `--font-body`: **Inter**, `sans-serif` | Body copy, labels, dense UI |

Google Fonts are loaded from `index.html` (Inter + Saira, variable weights).

### Scale (implemented utilities)

Sizes are defined as `@theme` variables and applied via classes in `@layer utilities` in `tailwind.css`:

| Utility | Font | Size | Weight (typical) |
|---------|------|------|-------------------|
| `text-h1` … `text-h4` | Saira | 40px … 24px | 700 |
| `text-h5` | Saira | 20px | 500 |
| `text-h6` | Saira | 18px | 400 |
| `text-body-xl-strong` | Inter | 18px | 700 |
| `text-body-l`, `text-body-l-strong` | Inter | 16px | 400 / 700 |
| `text-body-m`, `text-label-*` | Inter | 14px | 400 |
| `text-body-s`, `text-body-s-strong` | Inter | 12px | 400 / 700 |
| `text-button-m`, `text-button-s` | Saira | 14px / 12px | 400 |
| Utility | Font | Size | Weight (typical) |
| ----------------------------------- | ----- | ----------- | ---------------- |
| `text-h1` … `text-h4` | Saira | 40px … 24px | 700 |
| `text-h5` | Saira | 20px | 500 |
| `text-h6` | Saira | 18px | 400 |
| `text-body-xl-strong` | Inter | 18px | 700 |
| `text-body-l`, `text-body-l-strong` | Inter | 16px | 400 / 700 |
| `text-body-m`, `text-label-*` | Inter | 14px | 400 |
| `text-body-s`, `text-body-s-strong` | Inter | 12px | 400 / 700 |
| `text-button-m`, `text-button-s` | Saira | 14px / 12px | 400 |

### Principles

Expand Down Expand Up @@ -199,9 +199,9 @@ There is no single β€œhamburger at 1024px” rule in this doc β€” match each rou

### Example prompts

- *β€œBuild a settings card: background `var(--color-surface-raised)`, 10px radius, border `var(--color-border)`. Section title Saira 13px semibold, body Inter 13px `var(--color-text-weaker)`. Primary button filled `var(--color-accent)` white text.”*
- *β€œCreate a form row: label Inter 12px `var(--color-text-idle)`, input border `var(--color-border)`, focus ring using `var(--color-accent)` at ~22% opacity.”*
- *β€œHero for TalkUp: headline Saira `text-h1`, subcopy Inter `text-body-l`, CTA primary accent β€” cool white/lavender surfaces, not warm beige.”*
- _β€œBuild a settings card: background `var(--color-surface-raised)`, 10px radius, border `var(--color-border)`. Section title Saira 13px semibold, body Inter 13px `var(--color-text-weaker)`. Primary button filled `var(--color-accent)` white text.”_
- _β€œCreate a form row: label Inter 12px `var(--color-text-idle)`, input border `var(--color-border)`, focus ring using `var(--color-accent)` at ~22% opacity.”_
- _β€œHero for TalkUp: headline Saira `text-h1`, subcopy Inter `text-body-l`, CTA primary accent β€” cool white/lavender surfaces, not warm beige.”_

### Iteration checklist

Expand All @@ -214,4 +214,4 @@ There is no single β€œhamburger at 1024px” rule in this doc β€” match each rou

## 10. Relation to external inspiration

Earlier drafts referenced **ElevenLabs**-style marketing aesthetics (warm stone, Waldenburg, extreme pill buttons, layered shadows). **That is not the TalkUp baseline.** You may still borrow *ideas* (clarity, whitespace, strong hierarchy) as long as **colors, fonts, and tokens** stay consistent with this file and `src/styles/tailwind.css`.
Earlier drafts referenced **ElevenLabs**-style marketing aesthetics (warm stone, Waldenburg, extreme pill buttons, layered shadows). **That is not the TalkUp baseline.** You may still borrow _ideas_ (clarity, whitespace, strong hierarchy) as long as **colors, fonts, and tokens** stay consistent with this file and `src/styles/tailwind.css`.
85 changes: 45 additions & 40 deletions web/src/components/atoms/base-input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,49 @@ export type { BaseInputProps };
* @param {string} [props.className] - Additional CSS classes to apply.
* @returns {JSX.Element} The rendered input component.
*/
export const BaseInput: React.FC<BaseInputProps> = (props) => {
const {
id,
name = 'input',
value = '',
type = 'text',
placeholder = 'Enter text',
disabled = false,
readOnly = false,
required = false,
onChange = () => {},
className,
...rest
} = props as BaseInputProps;
const generatedId = useId();
const inputId = id || generatedId;
export const BaseInput = React.forwardRef<HTMLInputElement, BaseInputProps>(
(props, ref) => {
const {
id,
name = 'input',
value = '',
type = 'text',
placeholder = 'Enter text',
disabled = false,
readOnly = false,
required = false,
onChange = () => {},
className,
...rest
} = props as BaseInputProps;
const generatedId = useId();
const inputId = id || generatedId;

return (
<input
{...rest}
id={inputId}
name={name}
type={type}
role="textbox"
placeholder={placeholder}
value={value}
onChange={onChange}
disabled={disabled}
aria-disabled={disabled}
readOnly={readOnly}
aria-readonly={readOnly}
required={required}
aria-label={name}
aria-required={required}
className={cn(
'p-2 text-body-m font-normal transition-colors duration-200 ease-in-out border rounded-sm border-border-strong placeholder:text font-display focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent disabled:cursor-not-allowed disabled:bg-disabled disabled:opacity-50 ',
className,
)}
/>
);
};
return (
<input
{...rest}
ref={ref}
id={inputId}
name={name}
type={type}
role="textbox"
placeholder={placeholder}
value={value}
onChange={onChange}
disabled={disabled}
aria-disabled={disabled}
readOnly={readOnly}
aria-readonly={readOnly}
required={required}
aria-label={name}
aria-required={required}
className={cn(
'p-2 text-body-m font-normal transition-colors duration-200 ease-in-out border rounded-sm border-border-strong placeholder:text font-display focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent disabled:cursor-not-allowed disabled:bg-disabled disabled:opacity-50 ',
className,
)}
/>
);
},
);

BaseInput.displayName = 'BaseInput';
42 changes: 42 additions & 0 deletions web/src/components/atoms/chatbot/ChatAvatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* ChatAvatar
*
* Displays a small circular avatar inside the chatbot interface.
* The 'ai' variant uses the TalkUp gradient with a "T" initial.
* The 'user' variant uses a neutral background with a "U" initial.
*
* @param props - ChatAvatarProps
* @returns A circular avatar badge as a React functional component.
*
* @example
* <ChatAvatar variant="ai" />
* <ChatAvatar variant="user" size="lg" />
*/

interface ChatAvatarProps {
/** 'ai' for the TalkUp assistant avatar, 'user' for the current user */
variant: 'ai' | 'user';
/** Visual size β€” 'sm' for message rows, 'lg' for the window header */
size?: 'sm' | 'lg';
}

const sizeClasses = {
sm: 'w-7 h-7 text-body-s',
lg: 'w-9 h-9 text-body-m',
} as const;

export const ChatAvatar = ({ variant, size = 'sm' }: ChatAvatarProps) => {
const isAi = variant === 'ai';

return (
<div
className={`${sizeClasses[size]} rounded-full flex-shrink-0 flex items-center justify-center font-bold ${
isAi
? 'bg-brand-gradient text-white'
: 'bg-surface-raised text-text-weak'
}`}
>
{isAi ? 'T' : 'U'}
</div>
);
};
37 changes: 37 additions & 0 deletions web/src/components/atoms/chatbot/ChatBubble.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* ChatBubble
*
* Renders a single message bubble inside the chatbot widget.
* Supports two variants: 'ai' (left-aligned, surface background) and
* 'user' (right-aligned, TalkUp gradient background).
*
* @param props - ChatBubbleProps
* @returns A styled message bubble as a React functional component.
*
* @example
* <ChatBubble variant="ai" message="Hello! How can I help?" />
* <ChatBubble variant="user" message="Tell me about interviews." />
*/

interface ChatBubbleProps {
/** The text content of the message */
message: string;
/** Visual variant: 'ai' for assistant messages, 'user' for user messages */
variant: 'ai' | 'user';
}

export const ChatBubble = ({ message, variant }: ChatBubbleProps) => {
const isAi = variant === 'ai';

return (
<div
className={`max-w-[220px] px-3 py-2 rounded-2xl text-body-s leading-relaxed ${
isAi
? 'bg-surface border border-border text-text rounded-bl-sm'
: 'bg-brand-gradient text-white rounded-br-sm'
}`}
>
Comment thread
badarouzia marked this conversation as resolved.
{message}
</div>
);
};
71 changes: 71 additions & 0 deletions web/src/components/atoms/chatbot/ChatInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { BaseInput } from '@/components/atoms/base-input';
import React from 'react';

/**
* ChatInput
*
* A controlled single-line text input for the chatbot message bar.
* Thin wrapper around the shared BaseInput atom so focus-ring, disabled and
* accessibility behaviour stay consistent with the rest of the design system.
* Triggers onSend when the user presses Enter (without Shift).
*
* @param props - ChatInputProps
* @returns A styled text input as a React functional component.
*
* @example
* <ChatInput
* value={message}
* onChange={setMessage}
* onSend={handleSend}
* placeholder="Ask a question..."
* />
*/

interface ChatInputProps {
/** Current value of the input */
value: string;
/** Callback fired on each keystroke */
onChange: (value: string) => void;
/** Callback fired when the user presses Enter */
onSend: () => void;
/** Placeholder text */
placeholder?: string;
/** Whether the input is disabled */
disabled?: boolean;
}

export const ChatInput = React.forwardRef<HTMLInputElement, ChatInputProps>(
(
{
value,
onChange,
onSend,
placeholder = 'Ask a question...',
disabled = false,
},
ref,
) => {
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
onSend();
}
};

return (
<BaseInput
ref={ref}
// `name` drives BaseInput's accessible name (aria-label).
name="Chat message input"
value={value}
onChange={(e) => onChange(e.target.value)}
onKeyDown={handleKeyDown}
placeholder={placeholder}
disabled={disabled}
className="flex-1 rounded-xl bg-background focus:bg-surface"
/>
);
},
);

ChatInput.displayName = 'ChatInput';
31 changes: 31 additions & 0 deletions web/src/components/atoms/chatbot/TypingIndicator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* TypingIndicator
*
* Displays an animated three-dot indicator to signal that the TalkUp AI
* is currently generating a response. Uses CSS animations via Tailwind.
*
* @returns An animated typing indicator as a React functional component.
*
* @example
* {isTyping && <TypingIndicator />}
*/

export const TypingIndicator = () => {
return (
<div
className="flex items-center gap-1 px-3 py-2"
// No own live region: this sits inside ChatWindow's role="log"
// aria-live="polite" list, so a nested status region would
// double-announce on some screen readers.
aria-label="TalkUp AI is typing"
>
{[0, 1, 2].map((i) => (
<span
key={i}
className="w-1.5 h-1.5 rounded-full bg-text-weaker animate-bounce"
style={{ animationDelay: `${i * 0.2}s` }}
/>
))}
</div>
);
};
Loading
Loading