Skip to content

Commit 6a113d9

Browse files
Update frontend components and styles
1 parent 9ac4bf2 commit 6a113d9

7 files changed

Lines changed: 73 additions & 36 deletions

File tree

apps/frontend/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>AI OCR Frontend</title>
8+
<script
9+
src="https://mcp.figma.com/mcp/html-to-design/capture.js"
10+
async
11+
></script>
812
</head>
913
<body>
1014
<div id="root"></div>

apps/frontend/src/App.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,26 @@
99
}
1010

1111
.app-shell-bcds-header .bcds-header--container {
12+
display: flex;
13+
align-items: center;
1214
max-width: none;
1315
width: 100%;
1416
}
1517

1618
.app-shell-bcds-header .bcds-header--title {
1719
flex-grow: 0;
20+
margin-right: auto;
1821
}
1922

2023
.app-shell-bcds-header .app-shell-header-actions {
2124
display: flex;
2225
flex-shrink: 0;
2326
margin-left: auto;
27+
justify-content: flex-end;
28+
}
29+
30+
.app-shell-bcds-header .app-shell-header-actions .mantine-Group-root {
31+
flex-wrap: nowrap;
2432
}
2533

2634
/* Compact name + email in BC header utilities */
@@ -40,6 +48,17 @@
4048
margin-top: 0.25rem;
4149
}
4250

51+
/* Tight title/description pairing in standard page headers */
52+
.bcds-page-header__title-block .bcds-react-aria-Heading,
53+
.bcds-page-header__title-block .bcds-react-aria-Text {
54+
margin: 0 !important;
55+
}
56+
57+
.bcds-page-header__meta {
58+
margin-top: var(--layout-margin-xsmall);
59+
min-height: 3rem;
60+
}
61+
4362
/* BC footer at end of main scroll area (gov.bc.ca pattern — not fixed to viewport) */
4463
.app-shell-bcds-footer {
4564
margin-top: var(--layout-margin-medium);

apps/frontend/src/components/upload/DocumentUploadPanel.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,10 @@ export const DocumentUploadPanel: React.FC<DocumentUploadPanelProps> = ({
302302
<div className="bcds-upload-panel">
303303
<PanelCard>
304304
<div className="bcds-upload-panel__intro">
305-
<Title order={3}>Upload images</Title>
306-
<Text c="dimmed" size="sm">
305+
<Title order={3} mt={0} mb={0}>
306+
Upload images
307+
</Title>
308+
<Text c="dimmed" size="sm" mt={0} mb={0}>
307309
Select a processing model, then drag and drop scans or mobile
308310
captures. Click Upload to start OCR processing.
309311
</Text>
@@ -373,10 +375,10 @@ export const DocumentUploadPanel: React.FC<DocumentUploadPanelProps> = ({
373375
</Dropzone.Idle>
374376

375377
<div>
376-
<Text size="xl" inline>
378+
<Text size="xl" mt={0} mb={0}>
377379
Drag images or click to browse
378380
</Text>
379-
<Text size="sm" c="dimmed" inline mt={7}>
381+
<Text size="sm" c="dimmed" mt="xs" mb={0}>
380382
Accepts {SUPPORTED_FILE_TYPES.join(", ")} up to{" "}
381383
{Math.round(MAX_FILE_SIZE / (1024 * 1024))} MB
382384
</Text>
@@ -449,7 +451,7 @@ export const DocumentUploadPanel: React.FC<DocumentUploadPanelProps> = ({
449451
<IconFileDescription size={20} />
450452
</Avatar>
451453
<div className="bcds-upload-queue-row__meta">
452-
<Group gap={4} mb={4} wrap="nowrap">
454+
<Group gap="xs" mb="xs" wrap="nowrap">
453455
<Text fw={600} truncate>
454456
{item.file.name}
455457
</Text>

apps/frontend/src/pages/DocumentsPage.tsx

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
Table,
1616
Text,
1717
TextInput,
18-
Title,
1918
Tooltip,
2019
UnstyledButton,
2120
} from "@mantine/core";
@@ -39,6 +38,7 @@ import { useDocuments } from "../data/hooks/useDocuments";
3938
import { useDocumentThumbnails } from "../data/hooks/useDocumentThumbnails";
4039
import type { Document, DocumentStatus } from "../shared/types";
4140
import { formatDate, formatFileSize } from "../shared/utils";
41+
import { PageHeader } from "../ui";
4242

4343
const statusOptions: { value: DocumentStatus | "all"; label: string }[] = [
4444
{ value: "all", label: "All statuses" },
@@ -188,31 +188,29 @@ export function DocumentsPage() {
188188
return (
189189
<>
190190
<Stack gap="lg">
191-
<Group justify="space-between">
192-
<div>
193-
<Title order={2}>Documents</Title>
194-
<Text size="sm" c="dimmed">
195-
View and manage all documents in your group
196-
</Text>
197-
</div>
198-
<Group gap="xs">
199-
<Tooltip label={statsOpen ? "Hide stats" : "Show stats"}>
200-
<ActionIcon variant="light" onClick={toggleStats} size="lg">
201-
<IconChartBar size={18} />
202-
</ActionIcon>
203-
</Tooltip>
204-
<Tooltip label="Refresh now">
205-
<ActionIcon
206-
variant="light"
207-
onClick={() => refetch()}
208-
loading={isFetching}
209-
size="lg"
210-
>
211-
<IconRefresh size={18} />
212-
</ActionIcon>
213-
</Tooltip>
214-
</Group>
215-
</Group>
191+
<PageHeader
192+
title="Documents"
193+
description="View and manage all documents in your group"
194+
actions={
195+
<Group gap="xs">
196+
<Tooltip label={statsOpen ? "Hide stats" : "Show stats"}>
197+
<ActionIcon variant="light" onClick={toggleStats} size="lg">
198+
<IconChartBar size={18} />
199+
</ActionIcon>
200+
</Tooltip>
201+
<Tooltip label="Refresh now">
202+
<ActionIcon
203+
variant="light"
204+
onClick={() => refetch()}
205+
loading={isFetching}
206+
size="lg"
207+
>
208+
<IconRefresh size={18} />
209+
</ActionIcon>
210+
</Tooltip>
211+
</Group>
212+
}
213+
/>
216214

217215
<Collapse in={statsOpen}>
218216
<SimpleGrid cols={{ base: 1, sm: 2, md: 4, lg: 6 }}>

apps/frontend/src/pages/UploadPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PageHeader, Stack } from "../ui";
33

44
export function UploadPage() {
55
return (
6-
<Stack gap="lg">
6+
<Stack style={{ gap: "var(--layout-margin-large)" }}>
77
<PageHeader
88
title="Upload documents"
99
description="Add new images and track their ingestion progress."

apps/frontend/src/ui/PageHeader.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,20 @@ export function PageHeader({
2525
}: PageHeaderProps) {
2626
return (
2727
<Group justify="space-between" align="flex-start" wrap="wrap">
28-
<Stack gap={2}>
29-
<Title order={2}>{title}</Title>
28+
<Stack
29+
className="bcds-page-header__title-block"
30+
style={{ gap: "var(--layout-margin-xsmall)" }}
31+
>
32+
<Title order={2} mt={0} mb={0}>
33+
{title}
34+
</Title>
3035
{description ? (
31-
<Text c="dimmed" size="sm">
36+
<Text c="dimmed" size="sm" mt={0} mb={0}>
3237
{description}
3338
</Text>
3439
) : null}
3540
</Stack>
36-
<Group gap="md" align="center">
41+
<Group gap="md" align="center" className="bcds-page-header__meta">
3742
{actions}
3843
{showDateBadge ? (
3944
<Badge variant="outline" size="lg">

apps/frontend/src/ui/bcds-upload-panel.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
gap: var(--layout-margin-xsmall);
1313
}
1414

15+
/* Suppress BC DS Heading default bottom margin inside the intro block */
16+
.bcds-upload-panel__intro .bcds-react-aria-Heading {
17+
margin: 0;
18+
}
19+
20+
.bcds-upload-panel__intro .bcds-react-aria-Text {
21+
margin: 0 !important;
22+
}
23+
1524
.bcds-upload-panel__actions {
1625
margin-top: var(--layout-margin-medium);
1726
}

0 commit comments

Comments
 (0)