Skip to content

Commit 4cdc8a9

Browse files
authored
EL-523: aligned the accordion style more closely with designs, update the dev page (#48)
EL-523: added dev pages for dropdown menu, dialog and alert. Fixed implementation and tests. EL-523: added a dev page for breadcrubms, rebuilt the page header component to match designs. EL-523: added button group to the button dev page. EL-523: refined breadcrumbs dev page
1 parent 50724d4 commit 4cdc8a9

40 files changed

Lines changed: 2505 additions & 1299 deletions

apps/citizen-portal-web/src/a11y/a11y-catalog.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import type { ComponentA11yMetadata } from '@repo/ui/a11y-types';
22
import uiCatalog from '@repo/ui/a11y-catalog.json';
3+
import breadcrumbA11y from './breadcrumb.a11y';
34
import formElementsA11y from './form-elements-reference-page.a11y';
45
import iconA11y from './icon-reference-page.a11y';
56
import statusBannerA11y from './status-banner.a11y';
67

78
// Components documented in this app but not owned by @repo/ui (app-local components, or
89
// /dev pattern pages with no single owning component) — too few to warrant their own generator.
9-
const appLocalCatalog: ComponentA11yMetadata[] = [statusBannerA11y, iconA11y, formElementsA11y];
10+
const appLocalCatalog: ComponentA11yMetadata[] = [
11+
statusBannerA11y,
12+
iconA11y,
13+
formElementsA11y,
14+
breadcrumbA11y,
15+
];
1016

1117
const catalog: ComponentA11yMetadata[] = [
1218
...(uiCatalog as ComponentA11yMetadata[]),
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import type { ComponentA11yMetadata } from '@repo/ui/a11y-types';
2+
3+
export default {
4+
component: 'breadcrumb',
5+
wcagCriteria: [
6+
{ id: '2.4.8', name: 'Location', level: 'AAA' },
7+
{ id: '1.3.1', name: 'Info and Relationships', level: 'A' },
8+
{ id: '4.1.2', name: 'Name, Role, Value', level: 'A' },
9+
],
10+
ariaPattern: {
11+
name: 'Breadcrumb',
12+
url: 'https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/',
13+
},
14+
rules: [
15+
{
16+
id: 'nav-labelled',
17+
description: 'The trail is wrapped in a <nav aria-label="Breadcrumb"> landmark.',
18+
severity: 'required',
19+
},
20+
{
21+
id: 'current-page-marked',
22+
description:
23+
'The last crumb (no href) renders as plain text with aria-current="page" rather than a link, so assistive tech announces it as the current location.',
24+
severity: 'required',
25+
},
26+
{
27+
id: 'separator-hidden',
28+
description: 'The slash separator icon between crumbs is decorative — aria-hidden={true}.',
29+
severity: 'required',
30+
},
31+
],
32+
commonMisuses: [
33+
"Giving the current (last) crumb an href — it should be the plain aria-current='page' span, not a link to the page the user is already on.",
34+
],
35+
notes: [],
36+
knownExceptions: [],
37+
} satisfies ComponentA11yMetadata;

apps/citizen-portal-web/src/components/application/consent-gate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export function ConsentGate({ agreements, serviceId, onContinue }: ConsentGatePr
131131
) : null}
132132
{content ? <RichTextView value={content} /> : null}
133133
{/* Gray, visually distinct response section (matches the read-only detail view). */}
134-
<div className="-mx-2 -mb-4 flex flex-col gap-2 border-t border-border bg-gray-20 px-4 py-4">
134+
<div className="-mx-4 -mb-4 flex flex-col gap-2 border-t border-border bg-gray-20 px-4 py-4">
135135
<p className="text-sm font-medium text-muted-foreground">Your response</p>
136136
<RadioGroup
137137
value={chosen}

apps/citizen-portal-web/src/components/breadcrumb.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { Link } from '@tanstack/react-router';
2-
import { ChevronRight } from 'lucide-react';
2+
import { Icon } from '@mdi/react';
3+
import { mdiSlashForward } from '@mdi/js';
34

45
/** A simple breadcrumb trail. Client-side router links so a crumb click doesn't reload the app. */
56
export function Breadcrumb({ trail }: { trail: { label: string; href?: string }[] }) {
67
return (
78
<nav aria-label="Breadcrumb">
8-
<ol className="flex flex-wrap items-center gap-1 text-xs text-muted-foreground">
9+
<ol className="flex flex-wrap items-center gap-2 leading-normal">
910
{trail.map((crumb, i) => (
10-
<li key={`${crumb.label}-${i}`} className="flex items-center gap-1">
11-
{i > 0 ? <ChevronRight className="size-3" aria-hidden /> : null}
11+
<li key={`${crumb.label}-${i}`} className="flex items-center gap-2">
12+
{i > 0 ? <Icon path={mdiSlashForward} size="16px" aria-hidden={true} /> : null}
1213
{crumb.href ? (
13-
<Link to={crumb.href} className="hover:text-foreground hover:underline">
14+
<Link
15+
to={crumb.href}
16+
className="rounded-sm outline-none hover:text-foreground hover:underline focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:border-ring"
17+
>
1418
{crumb.label}
1519
</Link>
1620
) : (
17-
<span aria-current="page" className="text-foreground">
21+
<span aria-current="page" className="font-bold">
1822
{crumb.label}
1923
</span>
2024
)}

0 commit comments

Comments
 (0)