Add CenteredPage template and fix SideNav collapse animation

Add CenteredPage template for no-sidebar, centered-content layouts
(login, error, onboarding). Fix SideNav collapse animation where items
slid right — removed nav-level items-center (each item already handles
its own centering) and added overflow-hidden to clip text during the
width transition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 15:38:03 +10:00
parent b8fb8c63c6
commit d36330084a
6 changed files with 168 additions and 2 deletions

View File

@@ -1092,6 +1092,26 @@ import { DetailPage } from '@/components/templates/DetailPage'
</DetailPage>
```
#### CenteredPage
Full-page layout with no sidebar and centered content. Use for login, sign-up, error pages, onboarding, or any focused single-task flow.
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `topBar` | `ReactNode` | — | Optional TopBar |
| `maxWidth` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Content max width |
| `children` | `ReactNode` | — | **Required.** Centered content |
```tsx
import { CenteredPage } from '@/components/templates/CenteredPage'
<CenteredPage topBar={<TopBar title="" logo={<NswLogo />} />} maxWidth="md">
<Card variant="elevated">
<CardContent>Login form here</CardContent>
</Card>
</CenteredPage>
```
---
## Do's and Don'ts