Skip to content

Commit 310e1c5

Browse files
committed
feat: adjust onboarding ui
1 parent bb30882 commit 310e1c5

File tree

17 files changed

+546
-215
lines changed

17 files changed

+546
-215
lines changed

be/apps/dashboard/agents.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,17 @@ This dashboard follows a **linear design language** with clean lines and subtle
175175

176176
Core Design Principles:
177177

178-
- **No rounded corners**: All elements use sharp, clean edges
179-
- **Linear gradient borders**: Use subtle gradient borders for visual separation
178+
- **Hierarchical rounding**:
179+
- Main page containers: Sharp edges with linear gradient borders
180+
- Interactive elements (inputs, buttons, cards): `rounded-lg` for approachable feel
181+
- **Linear gradient borders**: Use subtle gradient borders for main container separation
180182
- **Minimal backgrounds**: Use solid colors (`bg-background`, `bg-background-tertiary`)
181183
- **Clean typography**: Clear hierarchy with appropriate font sizes
182184
- **Subtle interactions**: Focus rings and hover states with minimal animation
183185

184186
Form Elements (Inputs, Textareas, Selects):
185187

186-
- **Shape**: **NO** `rounded-xl` - use straight edges
188+
- **Shape**: Use `rounded-lg` for subtle rounded corners (NOT sharp edges, NOT heavy rounding like `rounded-xl`)
187189
- **Background**: Use `bg-background` for standard inputs
188190
- **Border**: Use `border border-fill-tertiary` for default state
189191
- **Padding**: Standard padding is `px-3 py-2` for inputs
@@ -215,7 +217,7 @@ Example (text input):
215217
id="field-id"
216218
type="text"
217219
className={cx(
218-
'w-full border border-fill-tertiary bg-background',
220+
'w-full rounded-lg border border-fill-tertiary bg-background',
219221
'px-3 py-2 text-sm text-text placeholder:text-text-tertiary/70',
220222
'focus:outline-none focus:ring-2 focus:ring-accent/40',
221223
'transition-all duration-200',
@@ -232,7 +234,7 @@ Example (textarea):
232234
```tsx
233235
<textarea
234236
className={cx(
235-
'w-full border border-fill-tertiary bg-background',
237+
'w-full rounded-lg border border-fill-tertiary bg-background',
236238
'px-3 py-2 text-sm text-text placeholder:text-text-tertiary/70',
237239
'focus:outline-none focus:ring-2 focus:ring-accent/40',
238240
'transition-all duration-200',
@@ -244,7 +246,7 @@ Example (textarea):
244246

245247
Buttons:
246248

247-
- **Shape**: **NO** `rounded-xl` - use straight edges
249+
- **Shape**: Use `rounded-lg` for subtle rounded corners (consistent with form elements)
248250
- **Padding**: Standard is `px-6 py-2.5` for medium buttons
249251
- **Text Size**: Use `text-sm` with `font-medium`
250252
- **Primary Button**:
@@ -266,7 +268,7 @@ Example (primary button):
266268
<button
267269
type="submit"
268270
className={cx(
269-
'px-6 py-2.5',
271+
'rounded-lg px-6 py-2.5',
270272
'bg-accent text-white font-medium text-sm',
271273
'transition-all duration-200',
272274
'hover:bg-accent/90',
@@ -284,7 +286,7 @@ Example (ghost button):
284286
<button
285287
type="button"
286288
className={cx(
287-
'px-6 py-2.5',
289+
'rounded-lg px-6 py-2.5',
288290
'text-sm font-medium text-text-secondary',
289291
'hover:text-text hover:bg-fill/50',
290292
'transition-all duration-200',
@@ -296,8 +298,12 @@ Example (ghost button):
296298

297299
Cards and Containers:
298300

299-
- **Shape**: **NO rounded corners** - use sharp edges
300-
- **Borders**: Use linear gradient borders for main containers
301+
- **Shape**:
302+
- **Main page containers** (e.g., OnboardingWizard): **NO rounded corners** - use sharp edges with linear gradient borders
303+
- **Inner content cards** (e.g., form sections, review cards): Use `rounded-lg` for visual hierarchy
304+
- **Borders**:
305+
- Main containers: Use linear gradient borders
306+
- Inner cards: Use `border border-fill-tertiary`
301307
- **Dividers**: Use horizontal gradient dividers for section separation
302308
- Example: `<div className="h-[0.5px] bg-linear-to-r from-transparent via-text/20 to-transparent" />`
303309
- **Backgrounds**: Use solid colors (`bg-background`, `bg-background-tertiary`)
@@ -346,7 +352,9 @@ Typography:
346352

347353
Do NOT:
348354

349-
- ❌ Use rounded corners (`rounded-xl`, `rounded-2xl`, `rounded-full`, etc.) - this design language uses **sharp edges**
355+
- ❌ Use heavy rounding (`rounded-xl`, `rounded-2xl`, `rounded-full`) - use `rounded-lg` for form elements and cards
356+
- ❌ Use sharp edges (no rounding) on form elements - always use `rounded-lg` for inputs, buttons, and cards
357+
- ❌ Mix rounding styles - main page containers are sharp, all interactive elements use `rounded-lg`
350358
- ❌ Use heavy borders or box shadows - use subtle linear gradients instead
351359
- ❌ Use animated bottom borders or underlines on inputs (outdated pattern)
352360
- ❌ Use large padding (`py-3`, `py-4`) on standard inputs - stick to `py-2` or `py-2.5`
@@ -452,9 +460,9 @@ Change checklist (agents):
452460
- Pastel color tokens used
453461
- Atoms created via createAtomHooks; selectors stable
454462
- No edits to auto-generated files
455-
- **UI Design**: Form inputs use **NO rounded corners**, `bg-background`, `border-fill-tertiary`, and `focus:ring-2 focus:ring-accent/40`
456-
- **UI Design**: Buttons use **NO rounded corners**, `px-6 py-2.5`, `text-sm font-medium`
457-
- **UI Design**: Main containers use linear gradient borders (see login.tsx example)
463+
- **UI Design**: Form inputs use `rounded-lg`, `bg-background`, `border-fill-tertiary`, and `focus:ring-2 focus:ring-accent/40`
464+
- **UI Design**: Buttons use `rounded-lg`, `px-6 py-2.5`, `text-sm font-medium`
465+
- **UI Design**: Inner content cards use `rounded-lg` for visual hierarchy
466+
- **UI Design**: Main page containers use linear gradient borders with sharp edges
458467
- **UI Design**: All interactive elements have proper focus states and transitions
459-
- **UI Design**: NO `rounded-xl`, `rounded-2xl`, or any border-radius classes
460468
- Code passes pnpm lint, pnpm format, and pnpm build

be/apps/dashboard/src/modules/onboarding/components/LinearBorderBox.tsx

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import { clsxm } from '@afilmory/utils'
2+
import type { FC, ReactNode } from 'react'
3+
4+
type LinearBorderContainerProps = {
5+
children: ReactNode
6+
className?: string
7+
/**
8+
* If true, uses the advanced flex layout that allows borders to span the full height/width.
9+
* This is needed when you have complex nested layouts (like grid) inside.
10+
*
11+
* If false, uses simple relative positioning (works for basic cases).
12+
*/
13+
useAdvancedLayout?: boolean
14+
}
15+
16+
/**
17+
* A container with linear gradient borders on all sides.
18+
*
19+
* **Two Layout Modes:**
20+
*
21+
* 1. **Simple mode** (`useAdvancedLayout={false}`, default):
22+
* - Uses `position: relative` with absolutely positioned borders
23+
* - Works for simple content without complex nested layouts
24+
* - Borders may not span full height if content has complex flex/grid
25+
*
26+
* 2. **Advanced mode** (`useAdvancedLayout={true}`):
27+
* - Uses flex layout with separate containers for right/bottom borders
28+
* - Borders always span the full container dimensions
29+
* - Required for complex nested layouts (like OnboardingWizard grid)
30+
*
31+
* @example
32+
* ```tsx
33+
* // Simple case (login form)
34+
* <LinearBorderContainer className="p-12">
35+
* <form>...</form>
36+
* </LinearBorderContainer>
37+
*
38+
* // Complex case (onboarding wizard with grid)
39+
* <LinearBorderContainer useAdvancedLayout className="bg-background-tertiary">
40+
* <div className="grid lg:grid-cols-[280px_1fr]">
41+
* <Sidebar />
42+
* <Content />
43+
* </div>
44+
* </LinearBorderContainer>
45+
* ```
46+
*/
47+
export const LinearBorderContainer: FC<LinearBorderContainerProps> = ({
48+
children,
49+
className,
50+
useAdvancedLayout = false,
51+
}) => {
52+
if (!useAdvancedLayout) {
53+
// Simple mode: works for basic content
54+
return (
55+
<div className={clsxm('relative', className)}>
56+
{/* Top border */}
57+
<div className="absolute left-0 top-0 right-0 h-[0.5px] bg-linear-to-r from-transparent via-text to-transparent" />
58+
59+
{/* Right border */}
60+
<div className="absolute top-0 right-0 bottom-0 w-[0.5px] bg-linear-to-b from-transparent via-text to-transparent" />
61+
62+
{/* Bottom border */}
63+
<div className="absolute left-0 bottom-0 right-0 h-[0.5px] bg-linear-to-r from-transparent via-text to-transparent" />
64+
65+
{/* Left border */}
66+
<div className="absolute top-0 left-0 bottom-0 w-[0.5px] bg-linear-to-b from-transparent via-text to-transparent" />
67+
68+
{children}
69+
</div>
70+
)
71+
}
72+
73+
// Advanced mode: uses flex layout for borders that span full dimensions
74+
return (
75+
<div className="flex flex-col">
76+
<div className={clsxm('flex flex-row', className)}>
77+
{/* Top border */}
78+
<div className="absolute left-0 right-0 h-[0.5px] bg-linear-to-r from-transparent via-text to-transparent" />
79+
80+
{/* Left border */}
81+
<div className="absolute top-0 bottom-0 w-[0.5px] bg-linear-to-b from-transparent via-text to-transparent" />
82+
83+
{/* Main content area */}
84+
{children}
85+
86+
{/* Right border container */}
87+
<div className="flex flex-col shrink-0">
88+
<div className="absolute bottom-0 top-0 w-[0.5px] bg-linear-to-b from-transparent via-text to-transparent" />
89+
</div>
90+
</div>
91+
92+
{/* Bottom border container */}
93+
<div className="shrink-0 w-[2px]">
94+
<div className="absolute left-0 right-0 h-[0.5px] bg-linear-to-r from-transparent via-text to-transparent" />
95+
</div>
96+
</div>
97+
)
98+
}

be/apps/dashboard/src/modules/onboarding/components/OnboardingFooter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ export const OnboardingFooter: FC<OnboardingFooterProps> = ({
2525
<Button
2626
type="button"
2727
variant="ghost"
28-
className="px-6 py-2.5 min-w-[120px] text-sm font-medium text-text-secondary hover:text-text hover:bg-fill/50 transition-all duration-200"
28+
className="rounded-lg px-6 py-2.5 min-w-[120px] text-sm font-medium text-text-secondary hover:text-text hover:bg-fill/50 transition-all duration-200"
2929
onClick={onBack}
3030
disabled={disableBack || isSubmitting}
3131
>
3232
Back
3333
</Button>
3434
<Button
3535
type="button"
36-
className="px-6 py-2.5 min-w-[140px] bg-accent text-white text-sm font-medium hover:bg-accent/90 active:scale-[0.98] focus:outline-none focus:ring-2 focus:ring-accent/40 transition-all duration-200"
36+
className="rounded-lg px-6 py-2.5 min-w-[140px] bg-accent text-white text-sm font-medium hover:bg-accent/90 active:scale-[0.98] focus:outline-none focus:ring-2 focus:ring-accent/40 transition-all duration-200"
3737
onClick={onNext}
3838
isLoading={isSubmitting}
3939
>

be/apps/dashboard/src/modules/onboarding/components/OnboardingWizard.tsx

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { ScrollArea } from '@afilmory/ui'
12
import type { FC, ReactNode } from 'react'
23

34
import { ONBOARDING_STEPS } from '../constants'
45
import { useOnboardingWizard } from '../hooks/useOnboardingWizard'
6+
import { LinearBorderContainer } from './LinearBorderContainer'
57
import { OnboardingFooter } from './OnboardingFooter'
68
import { OnboardingHeader } from './OnboardingHeader'
79
import { OnboardingSidebar } from './OnboardingSidebar'
@@ -89,59 +91,60 @@ export const OnboardingWizard: FC = () => {
8991
}
9092

9193
return (
92-
<div className="min-h-screen bg-background flex flex-col items-center justify-center px-4 py-10">
93-
<div className="w-full max-w-7xl flex flex-row bg-background-tertiary">
94-
{/* Top border */}
95-
<div className="absolute left-0 right-0 h-[0.5px] bg-linear-to-r from-transparent via-text to-transparent" />
96-
97-
{/* Left border */}
98-
<div className="absolute top-0 bottom-0 w-[0.5px] bg-linear-to-b from-transparent via-text to-transparent" />
99-
100-
<div className="grid lg:grid-cols-[280px_1fr]">
94+
<div className="min-h-screen bg-background flex items-center justify-center px-4 py-10">
95+
<LinearBorderContainer
96+
useAdvancedLayout
97+
className="w-full max-w-7xl h-[85vh] bg-background-tertiary"
98+
>
99+
<div className="grid h-full lg:grid-cols-[280px_1fr]">
101100
{/* Sidebar */}
102-
<div className="relative">
103-
<div className="absolute top-0 right-0 bottom-0 w-[0.5px] bg-text/20" />
101+
<div className="relative h-full">
102+
{/* Vertical divider with gradient that fades at top/bottom */}
103+
<div className="absolute top-0 right-0 bottom-0 w-[0.5px] bg-linear-to-b from-transparent via-text/20 to-transparent" />
104104
<OnboardingSidebar
105105
currentStepIndex={currentStepIndex}
106106
canNavigateTo={canNavigateTo}
107107
onStepSelect={jumpToStep}
108108
/>
109109
</div>
110110

111-
{/* Main content */}
112-
<main className="flex flex-col">
113-
<OnboardingHeader
114-
currentStepIndex={currentStepIndex}
115-
totalSteps={ONBOARDING_STEPS.length}
116-
step={currentStep}
117-
/>
118-
119-
{/* Horizontal divider */}
120-
<div className="h-[0.5px] bg-linear-to-r from-transparent via-text/30 to-transparent" />
121-
122-
<section className="p-12">{stepContent[currentStep.id]}</section>
111+
{/* Main content with fixed height and scrollable area */}
112+
<main className="flex h-full flex-col w-[800px]">
113+
{/* Fixed header */}
114+
<div className="shrink-0">
115+
<OnboardingHeader
116+
currentStepIndex={currentStepIndex}
117+
totalSteps={ONBOARDING_STEPS.length}
118+
step={currentStep}
119+
/>
120+
{/* Horizontal divider */}
121+
<div className="h-[0.5px] bg-linear-to-r from-transparent via-text/20 to-transparent" />
122+
</div>
123123

124-
{/* Horizontal divider */}
125-
<div className="h-[0.5px] bg-linear-to-r from-transparent via-text/30 to-transparent" />
124+
{/* Scrollable content area */}
125+
<div className="flex-1 overflow-hidden">
126+
<ScrollArea rootClassName="h-full" viewportClassName="h-full">
127+
<section className="p-12">
128+
{stepContent[currentStep.id]}
129+
</section>
130+
</ScrollArea>
131+
</div>
126132

127-
<OnboardingFooter
128-
onBack={goToPrevious}
129-
onNext={goToNext}
130-
disableBack={currentStepIndex === 0}
131-
isSubmitting={mutation.isPending}
132-
isLastStep={currentStepIndex === ONBOARDING_STEPS.length - 1}
133-
/>
133+
{/* Fixed footer */}
134+
<div className="shrink-0">
135+
{/* Horizontal divider */}
136+
<div className="h-[0.5px] bg-linear-to-r from-transparent via-text/20 to-transparent" />
137+
<OnboardingFooter
138+
onBack={goToPrevious}
139+
onNext={goToNext}
140+
disableBack={currentStepIndex === 0}
141+
isSubmitting={mutation.isPending}
142+
isLastStep={currentStepIndex === ONBOARDING_STEPS.length - 1}
143+
/>
144+
</div>
134145
</main>
135146
</div>
136-
<div className="flex flex-col shrink-0">
137-
{/* Right border */}
138-
<div className="absolute bottom-0 top-0 w-[0.5px] bg-linear-to-b from-transparent via-text to-transparent" />
139-
</div>
140-
</div>
141-
<div className="shrink-0 w-[2px]">
142-
{/* Bottom border */}
143-
<div className="absolute left-0 right-0 h-[0.5px] bg-linear-to-r from-transparent via-text to-transparent" />
144-
</div>
147+
</LinearBorderContainer>
145148
</div>
146149
)
147150
}

0 commit comments

Comments
 (0)