@hegemonart/get-design-done 1.16.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/.claude-plugin/marketplace.json +7 -5
  2. package/.claude-plugin/plugin.json +17 -5
  3. package/CHANGELOG.md +84 -0
  4. package/README.md +20 -2
  5. package/agents/design-auditor.md +60 -1
  6. package/agents/design-doc-writer.md +21 -0
  7. package/agents/design-executor.md +22 -4
  8. package/agents/design-pattern-mapper.md +61 -0
  9. package/agents/motion-mapper.md +74 -9
  10. package/agents/token-mapper.md +8 -0
  11. package/package.json +10 -2
  12. package/reference/components/README.md +27 -23
  13. package/reference/components/alert.md +198 -0
  14. package/reference/components/badge.md +202 -0
  15. package/reference/components/breadcrumbs.md +198 -0
  16. package/reference/components/chip.md +209 -0
  17. package/reference/components/command-palette.md +228 -0
  18. package/reference/components/date-picker.md +227 -0
  19. package/reference/components/file-upload.md +219 -0
  20. package/reference/components/list.md +217 -0
  21. package/reference/components/menu.md +212 -0
  22. package/reference/components/navbar.md +211 -0
  23. package/reference/components/pagination.md +205 -0
  24. package/reference/components/progress.md +210 -0
  25. package/reference/components/rich-text-editor.md +226 -0
  26. package/reference/components/sidebar.md +211 -0
  27. package/reference/components/skeleton.md +197 -0
  28. package/reference/components/slider.md +208 -0
  29. package/reference/components/stepper.md +220 -0
  30. package/reference/components/table.md +229 -0
  31. package/reference/components/toast.md +200 -0
  32. package/reference/components/tree.md +225 -0
  33. package/reference/css-grid-layout.md +835 -0
  34. package/reference/external/NOTICE.hyperframes +28 -0
  35. package/reference/image-optimization.md +582 -0
  36. package/reference/motion-advanced.md +754 -0
  37. package/reference/motion-easings.md +381 -0
  38. package/reference/motion-interpolate.md +282 -0
  39. package/reference/motion-spring.md +234 -0
  40. package/reference/motion-transition-taxonomy.md +155 -0
  41. package/reference/motion.md +20 -0
  42. package/reference/output-contracts/motion-map.schema.json +135 -0
  43. package/reference/registry.json +183 -0
  44. package/reference/registry.schema.json +4 -0
  45. package/reference/variable-fonts-loading.md +532 -0
  46. package/scripts/lib/easings.cjs +280 -0
  47. package/scripts/lib/parse-contract.cjs +220 -0
  48. package/scripts/lib/spring.cjs +160 -0
  49. package/scripts/tests/test-motion-provenance.sh +64 -0
@@ -0,0 +1,211 @@
1
+ # Navbar (Top Navigation Bar) — Benchmark Spec
2
+
3
+ **Harvested from**: Material 3, Carbon, Polaris, Atlassian, Primer, UUPM (app-interface, MIT)
4
+ **Wave**: 4 · **Category**: Navigation
5
+
6
+ ---
7
+
8
+ ## Purpose
9
+
10
+ A navbar is the primary horizontal navigation surface at the top of an application. It houses the logo/home link, primary navigation destinations, and secondary actions (search, notifications, profile). It communicates the application's identity and provides always-visible wayfinding. Differs from a Sidebar (vertical, secondary nav) and Breadcrumb (trail-based context). *(Material 3, Carbon, Polaris, Atlassian agree: top navbar = primary navigation + brand identity)*
11
+
12
+ ---
13
+
14
+ ## Anatomy
15
+
16
+ ```
17
+ ┌──────────────────────────────────────────────────────┐ role="banner"
18
+ │ [Skip to main] (visually hidden, focus-visible) │
19
+ │ [Logo/Home] | Nav Item · Nav Item · Nav Item | [🔍][👤]│ role="navigation" aria-label="Primary"
20
+ └──────────────────────────────────────────────────────┘
21
+ ```
22
+
23
+ | Part | Required | Notes |
24
+ |------|----------|-------|
25
+ | `<header>` wrapper | Yes | `role="banner"` — one per page |
26
+ | `<nav>` | Yes | `role="navigation"` + `aria-label="Primary"` |
27
+ | Skip-to-main link | Yes | First focusable element; `href="#main-content"`; visible on focus |
28
+ | Logo / home link | Yes | `<a href="/">` with `aria-label="[App name] home"` |
29
+ | Nav items | Yes | `<a>` for routing; `aria-current="page"` on active item |
30
+ | Secondary actions | No | Icon buttons (search, notifications, profile) |
31
+ | Hamburger button | Conditional | Mobile only; `aria-expanded` + `aria-controls` |
32
+ | Scroll shadow | No | `box-shadow` appears on scroll > 0px |
33
+
34
+ ---
35
+
36
+ ## Variants
37
+
38
+ | Variant | Description | Systems |
39
+ |---------|-------------|---------|
40
+ | Default / static | Fixed in document flow; scrolls with page | Carbon, Polaris |
41
+ | Sticky / fixed | `position: sticky` or `fixed`; stays at top on scroll | Material 3, Atlassian, Primer |
42
+ | Transparent hero | Transparent over hero image; becomes opaque on scroll | Material 3, Polaris |
43
+ | Compact / dense | Reduced height (48px) for data-heavy apps | Carbon, UUPM app-interface |
44
+ | Dashboard navbar | App-switcher + user avatar + notifications | UUPM app-interface (MIT) |
45
+ | Settings navbar | Breadcrumb-style subtitle below app name | UUPM app-interface (MIT) |
46
+
47
+ **Norm** (≥4 systems agree): 56–64px height; logo left-aligned; secondary actions right-aligned.
48
+ **Diverge**: Material 3 distinguishes "Top app bar" (mobile) from "Navigation bar" (desktop) as separate components; other systems use a single responsive navbar.
49
+
50
+ ---
51
+
52
+ ## States
53
+
54
+ | State | Trigger | Visual | ARIA |
55
+ |-------|---------|--------|------|
56
+ | default | — | Full nav visible, no shadow | — |
57
+ | scrolled | scroll > 0 | `box-shadow` bottom border appears | — |
58
+ | nav-item-hover | pointer over item | underline or bg highlight | — |
59
+ | nav-item-focus | keyboard focus | 2px focus-visible ring | — |
60
+ | nav-item-active | current route | `font-weight: 600` + indicator underline or pill | `aria-current="page"` |
61
+ | mobile-collapsed | viewport < breakpoint | Nav items hidden; hamburger visible | `aria-expanded="false"` on hamburger |
62
+ | mobile-expanded | hamburger activated | Nav items shown as vertical list | `aria-expanded="true"` on hamburger |
63
+
64
+ ---
65
+
66
+ ## Sizing & Spacing
67
+
68
+ | Size | Height | Logo H | Item padding H | Font |
69
+ |------|--------|--------|----------------|------|
70
+ | compact | 48px | 24px | 12px | 13px/500 |
71
+ | default | 56px | 28px | 16px | 14px/500 |
72
+ | comfortable | 64px | 32px | 20px | 15px/500 |
73
+
74
+ **Norm**: 56px default height (Material 3, Carbon, Polaris, Atlassian all converge here).
75
+ Mobile breakpoint: collapse at ≤768px (Carbon, Polaris); ≤960px for complex navbars (Atlassian).
76
+
77
+ ---
78
+
79
+ ## Typography
80
+
81
+ - Nav item labels: body-sm to body-md (13–15px), weight 500 for active, 400 for inactive
82
+ - Active item visual distinction must not rely on color alone (add font-weight or underline indicator)
83
+ - Secondary action icons: 20px, with `aria-label` on each button
84
+ - Skip link text: `body-sm`, matches surrounding text — it only needs to be visible on focus
85
+
86
+ Cross-link: `reference/typography.md` — body scale, weight tokens
87
+
88
+ ---
89
+
90
+ ## Keyboard & Accessibility
91
+
92
+ > **WAI-ARIA role**: `banner` (header), `navigation` (nav)
93
+ > **Required attributes**: `aria-label="Primary"` on `<nav>`; `aria-current="page"` on active item; `aria-expanded` + `aria-controls` on hamburger
94
+
95
+ ### Keyboard Contract
96
+
97
+ *Quoted verbatim from WAI-ARIA APG — https://www.w3.org/WAI/ARIA/apg/patterns/landmark-regions/ — W3C — 2024*
98
+
99
+ | Key | Action |
100
+ |-----|--------|
101
+ | Tab | Moves focus through focusable nav elements in DOM order |
102
+ | Shift+Tab | Moves focus backwards |
103
+ | Enter / Space | Activates focused link or button |
104
+ | Escape | Closes mobile expanded menu; returns focus to hamburger |
105
+
106
+ ### Accessibility Rules
107
+
108
+ - `<nav>` MUST have `aria-label="Primary"` — multiple `<nav>` landmarks on a page must all be distinctly labelled
109
+ - Skip-to-main link MUST be the first focusable element on the page — keyboard users need to bypass repetitive nav
110
+ - Active nav item MUST use `aria-current="page"` — color alone is insufficient for AT users
111
+ - Hamburger button MUST have `aria-expanded` and `aria-controls` — AT users need to know the nav state
112
+ - `role="banner"` MUST appear only once per page (one `<header>` at page level)
113
+
114
+ Cross-link: `reference/accessibility.md` — landmark regions, skip navigation
115
+
116
+ ---
117
+
118
+ ## Motion
119
+
120
+ | Transition | Duration | Easing | Notes |
121
+ |------------|----------|--------|-------|
122
+ | Scroll shadow appear | 150ms | ease-out | `box-shadow` opacity only |
123
+ | Mobile menu open | 200ms | ease-out | Height expand or slide-down |
124
+ | Mobile menu close | 150ms | ease-in | Collapse |
125
+ | Transparent → opaque on scroll | 200ms | ease-out | Background-color transition |
126
+
127
+ **BAN**: Animating navbar height on scroll — causes layout reflow and jank on every scroll event.
128
+
129
+ Cross-link: `reference/motion.md` — layout-affecting transitions
130
+
131
+ ---
132
+
133
+ ## Do / Don't
134
+
135
+ ### Do
136
+ - Include a visible skip-to-main link as the first focusable element *(WCAG 2.4.1, Carbon, Polaris)*
137
+ - Label `<nav>` with `aria-label="Primary"` *(WAI-ARIA APG landmark regions)*
138
+ - Use `aria-current="page"` on the active nav item *(WAI-ARIA, Atlassian)*
139
+ - Manage z-index explicitly on sticky navbars to prevent overlap issues *(Material 3, Carbon)*
140
+
141
+ ### Don't
142
+ - Don't use multiple unlabelled `<nav>` landmarks — screen reader users can't distinguish them *(WCAG 4.1.2)*
143
+ - Don't rely on color alone to indicate the active nav item *(WCAG 1.4.1)*
144
+ - Don't put more than 7 primary nav items — overwhelming and hard to scan *(Carbon, Polaris HIG)*
145
+ - Don't use `position: fixed` on mobile without accounting for virtual keyboard displacement
146
+
147
+ ---
148
+
149
+ ## Anti-patterns Cross-links
150
+
151
+ | Anti-pattern | Entry |
152
+ |--------------|-------|
153
+ | BAN-04 | `transition: all` on interactive elements — `reference/anti-patterns.md#ban-04` |
154
+
155
+ ---
156
+
157
+ ## Benchmark Citations
158
+
159
+ | Claim | Sources |
160
+ |-------|---------|
161
+ | role="banner" on outer header | WAI-ARIA APG landmark regions |
162
+ | aria-label="Primary" required on nav | WAI-ARIA APG, WCAG 4.1.2 |
163
+ | Skip-to-main as first focusable element | WCAG 2.4.1, Carbon, Polaris |
164
+ | aria-current="page" on active item | WAI-ARIA APG, Atlassian, Primer |
165
+ | 56px default navbar height | Material 3, Carbon, Polaris, Atlassian |
166
+
167
+ Full system URLs: `connections/design-corpora.md`
168
+
169
+ ---
170
+
171
+ ## Grep Signatures
172
+
173
+ ```bash
174
+ # nav element missing aria-label
175
+ grep -rn '<nav' src/ | grep -v 'aria-label\|aria-labelledby'
176
+
177
+ # Active nav item missing aria-current
178
+ grep -rn 'active\|current\|selected' src/ | grep -i 'nav.*item\|navitem\|nav-link' | grep -v 'aria-current'
179
+
180
+ # Missing skip link
181
+ grep -rn 'skip.*main\|skip.*content\|skipnav' src/ | grep -v 'href'
182
+ # If the above returns nothing, no skip link exists
183
+ grep -rn 'id="main\|id="main-content"' src/ | head -5
184
+
185
+ # Multiple unlabelled nav landmarks
186
+ grep -rn '<nav' src/ | grep -v 'aria-label\|aria-labelledby'
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Failing Example
192
+
193
+ ```html
194
+ <!-- BAD: multiple <nav> elements without aria-label -->
195
+ <header>
196
+ <nav>
197
+ <a href="/">Home</a>
198
+ <a href="/about">About</a>
199
+ <a href="/contact" class="active">Contact</a> <!-- no aria-current -->
200
+ </nav>
201
+ </header>
202
+ <aside>
203
+ <nav> <!-- second nav, also unlabelled — ambiguous for AT users -->
204
+ <a href="/settings">Settings</a>
205
+ </nav>
206
+ </aside>
207
+ ```
208
+
209
+ **Why it fails**: Screen readers announce "navigation" twice with no way to distinguish them; active state relies on CSS class only (not `aria-current="page"`); no skip link; `<header>` lacks landmark context.
210
+ **Grep detection**: `grep -rn '<nav' src/ | grep -v 'aria-label'`
211
+ **Fix**: Add `aria-label="Primary"` and `aria-label="Secondary"` to each `<nav>`; add `aria-current="page"` to active link; add skip link as first child of `<header>`.
@@ -0,0 +1,205 @@
1
+ # Pagination — Benchmark Spec
2
+
3
+ **Harvested from**: Carbon, Polaris, Atlassian, Mantine, Material 3, UUPM (app-interface, MIT)
4
+ **Wave**: 4 · **Category**: Navigation
5
+
6
+ ---
7
+
8
+ ## Purpose
9
+
10
+ Pagination divides a large dataset into discrete pages and provides controls to navigate between them. It is the preferred pattern for server-rendered or API-paginated datasets where loading all items at once is impractical. Use infinite scroll for feeds/social content; use pagination for tables, search results, and list views where users need to reference or return to a specific page. *(Carbon, Polaris, Atlassian, Mantine all define pagination as discrete page-set navigation)*
11
+
12
+ ---
13
+
14
+ ## Anatomy
15
+
16
+ ```
17
+ <nav aria-label="Pagination">
18
+ [‹ Previous] [1] [2] [•3•] [4] [...] [24] [Next ›]
19
+ ↑ aria-current="page"
20
+ Items per page: [25 ▾] Showing 51–75 of 587 items
21
+ </nav>
22
+ ```
23
+
24
+ | Part | Required | Notes |
25
+ |------|----------|-------|
26
+ | `<nav>` container | Yes | `aria-label="Pagination"` |
27
+ | Previous button | Yes | `aria-label="Previous page"`; `disabled` on page 1 |
28
+ | Next button | Yes | `aria-label="Next page"`; `disabled` on last page |
29
+ | Page number buttons | Yes | Each button `aria-label="Page N"` |
30
+ | Current page indicator | Yes | `aria-current="page"` on active page button |
31
+ | Ellipsis | Conditional | At > 7 pages; `aria-hidden="true"` or `aria-label="More pages"` |
32
+ | Per-page selector | No | `<select>` with visible `<label>`; options: 10/25/50/100 |
33
+ | Results summary | No | "Showing 51–75 of 587 items"; `aria-live="polite"` on change |
34
+
35
+ ---
36
+
37
+ ## Variants
38
+
39
+ | Variant | Description | Systems |
40
+ |---------|-------------|---------|
41
+ | Full | Previous + page numbers + Next | Carbon, Polaris, Atlassian, Mantine |
42
+ | Compact | Previous + "Page N of M" label + Next (no individual page buttons) | Carbon, Material 3 |
43
+ | Simple | Previous / Next only (no page numbers) | Polaris, Atlassian mobile |
44
+ | With per-page | Adds items-per-page selector below or beside | Carbon, Polaris, UUPM list-view (MIT) |
45
+ | Borderless | Text-only Previous/Next; no page number buttons | Mantine |
46
+
47
+ **Norm** (≥4 systems agree): show 5–7 page buttons max when not truncating; always show first, last, ±1 around current when truncating.
48
+ **Diverge**: Carbon combines per-page selector and result count into the pagination bar; Polaris separates them.
49
+
50
+ ---
51
+
52
+ ## States
53
+
54
+ | State | Trigger | Visual | ARIA |
55
+ |-------|---------|--------|------|
56
+ | default | — | All buttons enabled except current page | — |
57
+ | current-page | — | Filled/highlighted button | `aria-current="page"` |
58
+ | prev-disabled | page = 1 | Previous button dimmed | `disabled` or `aria-disabled="true"` |
59
+ | next-disabled | page = last | Next button dimmed | `disabled` or `aria-disabled="true"` |
60
+ | button-hover | pointer over | 8% overlay | — |
61
+ | button-focus | keyboard focus | 2px focus-visible ring | — |
62
+ | loading | page change in flight | Spinner overlay on content; buttons retain focus | `aria-busy="true"` on results region |
63
+
64
+ ---
65
+
66
+ ## Sizing & Spacing
67
+
68
+ | Element | Size | Notes |
69
+ |---------|------|-------|
70
+ | Page button | 36×36px (md) | 32×32px compact; min tap target 44px via padding |
71
+ | Prev/Next button | 36px height × auto | Label text + chevron icon |
72
+ | Button gap | 4px | Between adjacent page buttons |
73
+ | Per-page select | 80px width | 4 options: 10/25/50/100 |
74
+ | Container padding | 16px V | Breathing room above/below |
75
+
76
+ **Norm**: 36px button height (Carbon, Atlassian, Mantine). 4px gap between buttons.
77
+
78
+ ---
79
+
80
+ ## Typography
81
+
82
+ - Page number buttons: body-sm (13–14px), weight 400; active page weight 600
83
+ - Previous/Next labels: body-sm, weight 400
84
+ - Results summary: body-sm, `color: --text-subtle`
85
+ - Per-page label: label-sm (12px), always visible above or beside the select
86
+
87
+ Cross-link: `reference/typography.md` — body-sm, label scale
88
+
89
+ ---
90
+
91
+ ## Keyboard & Accessibility
92
+
93
+ > **WAI-ARIA role**: `navigation` (container)
94
+ > **Required attributes**: `aria-label="Pagination"` on `<nav>`; `aria-current="page"` on active page button; `aria-label="Previous page"` / `"Next page"` on controls; `aria-label="Page N"` on each numbered button
95
+
96
+ ### Keyboard Contract
97
+
98
+ *Quoted verbatim from WAI-ARIA APG — https://www.w3.org/WAI/ARIA/apg/patterns/landmark-regions/ — W3C — 2024*
99
+
100
+ | Key | Action |
101
+ |-----|--------|
102
+ | Tab | Moves focus to next button in pagination |
103
+ | Shift+Tab | Moves focus to previous button |
104
+ | Enter / Space | Activates focused button (navigates to page or changes per-page count) |
105
+
106
+ ### Accessibility Rules
107
+
108
+ - `aria-label="Pagination"` MUST be on the `<nav>` — distinguishes from other navigation landmarks on the page
109
+ - `aria-current="page"` MUST be on the currently active page button — screen readers announce "Page 3, current"
110
+ - Previous button on page 1 and Next button on last page MUST use `disabled` or `aria-disabled="true"` + visually dimmed
111
+ - `aria-label` on each page number button ("Page 1", "Page 2") prevents screen readers from just announcing the number alone
112
+ - Results summary text MUST use `aria-live="polite"` so screen reader users hear the count update after page change
113
+ - Per-page `<select>` MUST have a visible `<label>` — not just a placeholder
114
+
115
+ Cross-link: `reference/accessibility.md` — aria-current, landmark labelling, live regions
116
+
117
+ ---
118
+
119
+ ## Motion
120
+
121
+ | Transition | Duration | Easing | Notes |
122
+ |------------|----------|--------|-------|
123
+ | Button hover | 80ms | ease-out | Background color only |
124
+ | Page change content transition | 150ms | ease-out | Fade the results region; managed by page, not pagination |
125
+ | Ellipsis expand (if interactive) | 120ms | ease-out | Reveal hidden page buttons |
126
+
127
+ **BAN**: Do not animate the pagination bar itself when a page changes — only the content region transitions.
128
+
129
+ Cross-link: `reference/motion.md` — content region transitions
130
+
131
+ ---
132
+
133
+ ## Do / Don't
134
+
135
+ ### Do
136
+ - Label the `<nav>` with `aria-label="Pagination"` *(WAI-ARIA APG, Carbon, Polaris)*
137
+ - Use `aria-current="page"` on the active page button *(WAI-ARIA APG)*
138
+ - Provide visible per-page selector with a visible label *(Carbon, Polaris, Atlassian)*
139
+ - Show a results summary ("Showing 51–75 of 587") near the pagination controls *(Carbon, Polaris)*
140
+
141
+ ### Don't
142
+ - Don't use `<a href>` with pushState without `aria-current` — screen readers won't know which page is current *(WAI-ARIA)*
143
+ - Don't show more than 7 page buttons without ellipsis truncation — visually overwhelming *(Carbon, Mantine)*
144
+ - Don't disable the Previous/Next buttons with only visual styling — use `disabled` attr or `aria-disabled` *(WCAG 1.4.3)*
145
+ - Don't place pagination at the top only — bottom placement is expected; both positions is acceptable *(Polaris, Carbon)*
146
+
147
+ ---
148
+
149
+ ## Anti-patterns Cross-links
150
+
151
+ | Anti-pattern | Entry |
152
+ |--------------|-------|
153
+ | BAN-07 | Missing `aria-current` on active navigation items — `reference/anti-patterns.md#ban-07` |
154
+
155
+ ---
156
+
157
+ ## Benchmark Citations
158
+
159
+ | Claim | Sources |
160
+ |-------|---------|
161
+ | aria-label="Pagination" on nav container | WAI-ARIA APG, Carbon, Polaris |
162
+ | aria-current="page" on active page button | WAI-ARIA APG, Atlassian, Mantine |
163
+ | Ellipsis pattern: first + last + ±1 around current | Carbon, Polaris, Atlassian, Mantine |
164
+ | Per-page selector requires visible label | WCAG 1.3.1, Carbon, Polaris |
165
+ | aria-live="polite" on results summary | WCAG 4.1.3, Carbon |
166
+
167
+ Full system URLs: `connections/design-corpora.md`
168
+
169
+ ---
170
+
171
+ ## Grep Signatures
172
+
173
+ ```bash
174
+ # Pagination nav missing aria-label
175
+ grep -rn 'pagination\|pager' src/ | grep '<nav' | grep -v 'aria-label'
176
+
177
+ # Active page button missing aria-current
178
+ grep -rn 'pagination\|pager' src/ | grep 'active\|current\|selected' | grep -v 'aria-current'
179
+
180
+ # Page buttons using <a> without aria-current
181
+ grep -rn '<a' src/ | grep -i 'page.*[0-9]\|pager' | grep -v 'aria-current'
182
+
183
+ # Per-page select missing label
184
+ grep -rn 'per.page\|items-per-page\|pageSize' src/ | grep '<select' | grep -v '<label\|aria-label'
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Failing Example
190
+
191
+ ```html
192
+ <!-- BAD: page buttons using <a href> with pushState but no aria-current -->
193
+ <nav> <!-- missing aria-label="Pagination" -->
194
+ <a href="?page=2" class="prev">Previous</a> <!-- no aria-label -->
195
+ <a href="?page=1">1</a>
196
+ <a href="?page=2">2</a>
197
+ <a href="?page=3" class="active">3</a> <!-- class active but no aria-current -->
198
+ <a href="?page=4">4</a>
199
+ <a href="?page=4" class="next">Next</a> <!-- no aria-label -->
200
+ </nav>
201
+ ```
202
+
203
+ **Why it fails**: No `aria-label` on `<nav>`; active page has CSS class but no `aria-current="page"` so AT announces "3" not "Page 3, current"; Previous/Next have no descriptive labels; no `aria-label="Page N"` on individual page links.
204
+ **Grep detection**: `grep -rn 'pagination' src/ | grep -v 'aria-current\|aria-label'`
205
+ **Fix**: Add `aria-label="Pagination"` to `<nav>`; add `aria-current="page"` to the active page button; add `aria-label="Previous page"` and `aria-label="Next page"`; add `aria-label="Page N"` to each numbered button.
@@ -0,0 +1,210 @@
1
+ # Progress — Benchmark Spec
2
+
3
+ **Harvested from**: Material 3, Carbon (ProgressIndicator), Polaris, Mantine
4
+ **Wave**: 3 · **Category**: Feedback
5
+
6
+ ---
7
+
8
+ ## Purpose
9
+
10
+ A progress indicator communicates the status of an ongoing operation. Determinate variants show a known percentage of completion (0–100%); indeterminate variants signal ongoing work when duration is unknown. Linear bars are suited to step-based or file-based progress; circular (spinner-ring) variants are suited to inline or compact contexts. *(Material 3, Carbon, Polaris, Mantine agree: separate determinate vs. indeterminate; linear vs. circular)*
11
+
12
+ ---
13
+
14
+ ## Anatomy
15
+
16
+ **Linear**
17
+ ```
18
+ [track ──────────────────────────────────]
19
+ [fill ◼◼◼◼◼◼◼◼◼◼◼◼◼◼·····················]
20
+ ↑ role="progressbar" aria-valuenow="45"
21
+ ```
22
+
23
+ **Circular**
24
+ ```
25
+ ╭──╮
26
+ ╭ ╮
27
+ ╰ ╯ ← SVG stroke-dashoffset ring
28
+ ╰──╯
29
+ role="progressbar"
30
+ ```
31
+
32
+ | Part | Required | Notes |
33
+ |------|----------|-------|
34
+ | Track | Yes | Background rail (linear) or ring background (circular) |
35
+ | Fill / indicator | Yes | Foreground showing progress amount |
36
+ | Label (visually hidden ok) | Yes | `aria-label` or `aria-labelledby` — describes what is loading |
37
+ | Value text | No | Rendered percentage (e.g. "45%") — supplement to ARIA value |
38
+
39
+ ---
40
+
41
+ ## Variants
42
+
43
+ | Variant | Description | Systems |
44
+ |---------|-------------|---------|
45
+ | Linear determinate | Bar fills left-to-right proportionally | Material 3, Carbon, Polaris, Mantine |
46
+ | Linear indeterminate | Bar animates in loop (shimmer or sweep) | Material 3, Carbon, Polaris, Mantine |
47
+ | Circular determinate | SVG ring fills by stroke-dashoffset | Material 3, Carbon, Mantine |
48
+ | Circular indeterminate | SVG ring rotates in loop | Material 3, Carbon, Mantine |
49
+
50
+ **Norm** (≥4/18 systems agree): `role="progressbar"` on all variants; `aria-valuenow` only on determinate; `aria-valuemin=0` + `aria-valuemax=100` always.
51
+ **Diverge**: Polaris calls the circular variant "Spinner" (single indeterminate state only); Material 3 distinguishes "linear progress indicator" and "circular progress indicator" as separate component families; Carbon offers multi-step linear progress ("ProgressStep") as a distinct component.
52
+
53
+ ---
54
+
55
+ ## States
56
+
57
+ | State | Trigger | Visual | ARIA |
58
+ |-------|---------|--------|------|
59
+ | determinate (0–100%) | known progress value | Fill width/stroke = percentage | `aria-valuenow={n}` |
60
+ | indeterminate | unknown duration | Looping animation | `aria-valuetext="Loading"` |
61
+ | complete | value reaches 100% | Full fill; brief hold before removal | `aria-valuenow="100"` |
62
+ | paused | operation suspended | Static fill; muted color | `aria-valuetext="Paused"` |
63
+
64
+ ---
65
+
66
+ ## Sizing & Spacing
67
+
68
+ **Linear**
69
+
70
+ | Size | Height | Notes |
71
+ |------|--------|-------|
72
+ | sm | 4px (default) | Decorative; thin above content |
73
+ | md | 8px | Accessible minimum — recommended when bar is the primary indicator |
74
+ | lg | 12px | High-emphasis; file upload, step progress |
75
+
76
+ **Circular**
77
+
78
+ | Size | Diameter | Stroke width | Notes |
79
+ |------|----------|-------------|-------|
80
+ | sm | 20px | 2px | Inline within text/button |
81
+ | md | 32px | 3px | Component-level loading |
82
+ | lg | 48px | 4px | Page/section loading |
83
+
84
+ **Norm**: 4px linear height default (Material 3); 8px recommended for standalone accessibility *(Carbon)*; circular diameter 20–48px *(Material 3, Mantine)*.
85
+
86
+ ---
87
+
88
+ ## Typography
89
+
90
+ - Value label (if shown): numeric-sm (12px/tabular-nums) — percentage readability
91
+ - Associated label (if visible): body-sm (14px/400) — describes what is loading
92
+ - Do not truncate the associated label; use a visually-hidden version if space is constrained
93
+
94
+ Cross-link: `reference/typography.md` — tabular-nums for percentage values
95
+
96
+ ---
97
+
98
+ ## Keyboard & Accessibility
99
+
100
+ > **WAI-ARIA role**: `progressbar`
101
+ > **Required attributes**: `aria-valuemin="0"`, `aria-valuemax="100"`, `aria-label` or `aria-labelledby`; `aria-valuenow` on determinate only
102
+
103
+ ### Keyboard Contract
104
+
105
+ *Quoted verbatim from WAI-ARIA APG — https://www.w3.org/WAI/ARIA/apg/patterns/meter/ — W3C — 2024*
106
+
107
+ | Key | Action |
108
+ |-----|--------|
109
+ | (none) | Progress bar is not interactive; no keyboard interaction required |
110
+
111
+ Progress indicators are read-only status elements. They receive no keyboard focus unless embedded in a larger focusable region.
112
+
113
+ ### Accessibility Rules
114
+
115
+ - `aria-label` or `aria-labelledby` MUST describe what is loading (e.g. "Uploading file", "Loading results") — a bare `role="progressbar"` with no label is announced as empty *(WAI-ARIA APG)*
116
+ - Determinate bars MUST include `aria-valuenow` matching the current integer percentage *(WAI-ARIA APG)*
117
+ - Indeterminate bars MUST omit `aria-valuenow` and instead set `aria-valuetext="Loading"` or similar *(WAI-ARIA APG)*
118
+ - `aria-valuemin` and `aria-valuemax` MUST be present on all progress bars (default 0 and 100)
119
+ - Indeterminate animation MUST respect `prefers-reduced-motion` — reduce to opacity pulse or static indicator *(WCAG 2.3.3)*
120
+ - Color contrast of fill vs. track MUST meet 3:1 minimum for non-text UI components *(WCAG 1.4.11)*
121
+
122
+ Cross-link: `reference/accessibility.md` — `prefers-reduced-motion`, WCAG 1.4.11
123
+
124
+ ---
125
+
126
+ ## Motion
127
+
128
+ | Transition | Duration | Easing | Notes |
129
+ |------------|----------|--------|-------|
130
+ | Determinate fill advance | 300ms | ease-out | Smooth value update on change |
131
+ | Indeterminate linear sweep | 1.2s | ease-in-out | Infinite loop; reverse direction at 50% |
132
+ | Circular spin | 1.2s | linear | Single full rotation per cycle |
133
+ | Complete → remove | 400ms | ease-in | Brief hold at 100% then fade/collapse |
134
+
135
+ **BAN**: Bouncing or elasticity on indeterminate loop — communicates false progress rhythm. Do not use `transition: all` (catches color changes during theme swap).
136
+
137
+ Cross-link: `reference/motion.md` — `prefers-reduced-motion`: replace sweep with opacity 0.5→1 pulse
138
+
139
+ ---
140
+
141
+ ## Do / Don't
142
+
143
+ ### Do
144
+ - Always provide `aria-label` describing what is loading *(WAI-ARIA APG)*
145
+ - Use `aria-valuenow` on determinate variants and omit on indeterminate *(WAI-ARIA APG)*
146
+ - Use 8px+ height for standalone linear bars — 4px bars lack sufficient touch and visual target *(Carbon)*
147
+ - Transition fill smoothly (300ms ease-out) when value updates *(Material 3, Mantine)*
148
+
149
+ ### Don't
150
+ - Don't use `aria-valuenow` on indeterminate bars — it implies a known value *(WAI-ARIA APG)*
151
+ - Don't show a spinner (circular indeterminate) when content shape is known — use Skeleton instead *(Carbon, Polaris)*
152
+ - Don't remove the progress bar the instant it hits 100% — hold briefly so the completion is registered *(Material 3)*
153
+ - Don't animate with infinite bounce — implies bouncing progress rhythm *(Carbon, Mantine)*
154
+
155
+ ---
156
+
157
+ ## Anti-patterns Cross-links
158
+
159
+ | Anti-pattern | Entry |
160
+ |--------------|-------|
161
+ | Indeterminate bar with aria-valuenow | `reference/anti-patterns.md#ban-aria-value` |
162
+ | Spinner used when content shape is known | `reference/anti-patterns.md#ban-spinner-overuse` |
163
+
164
+ ---
165
+
166
+ ## Benchmark Citations
167
+
168
+ | Claim | Sources |
169
+ |-------|---------|
170
+ | role="progressbar" on all variants | WAI-ARIA APG |
171
+ | aria-valuenow only on determinate | WAI-ARIA APG, Material 3, Carbon |
172
+ | aria-label required (what is loading) | WAI-ARIA APG |
173
+ | 8px accessible minimum height | Carbon |
174
+ | 1.2s animation loop duration | Material 3, Mantine |
175
+ | Respect prefers-reduced-motion | WCAG 2.3.3 |
176
+
177
+ Full system URLs: `connections/design-corpora.md`
178
+
179
+ ---
180
+
181
+ ## Grep Signatures
182
+
183
+ ```bash
184
+ # Progress bar missing aria-label or aria-labelledby
185
+ grep -rn 'role="progressbar"' src/ | grep -v 'aria-label\|aria-labelledby'
186
+
187
+ # Determinate progress missing aria-valuenow
188
+ grep -rn 'role="progressbar"' src/ | grep -v 'aria-valuenow\|indeterminate'
189
+
190
+ # Progress missing valuemin/valuemax
191
+ grep -rn 'role="progressbar"' src/ | grep -v 'aria-valuemin\|aria-valuemax'
192
+
193
+ # Indeterminate with aria-valuenow (invalid pattern)
194
+ grep -rn 'indeterminate' src/ | grep 'aria-valuenow'
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Failing Example
200
+
201
+ ```html
202
+ <!-- BAD: progress bar with no accessible label and no value attributes -->
203
+ <div class="progress-bar">
204
+ <div class="progress-bar__fill" style="width: 45%"></div>
205
+ </div>
206
+ ```
207
+
208
+ **Why it fails**: No `role="progressbar"` so screen readers do not recognize this as a progress indicator. No `aria-label` so there is no description of what is loading. No `aria-valuenow`, `aria-valuemin`, or `aria-valuemax` so screen readers cannot read the percentage even if the role were present.
209
+ **Grep detection**: `grep -rn 'progress-bar\|progressBar\|progress__fill' src/ | grep -v 'role="progressbar"'`
210
+ **Fix**: `<div role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" aria-label="Uploading file"><div style="width:45%"></div></div>`